summaryrefslogtreecommitdiffstats
path: root/src/core/net
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-02-11 11:26:42 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-05-04 11:41:34 +0000
commit08aa603e8c28b23d2b30983e8b16149ae0b3abb1 (patch)
tree8feac81dbaab539aad4b45a093dbe8c2834a2466 /src/core/net
parenteaefb4c564ab3c06aa436ff2024392e74cc45997 (diff)
Minor cleanup
Remove now redundant extra function, and let Chromium handle conversion back to cookie-line. Change-Id: I969cffb14c1df8ed897dd23a1b9e228ea153b44a Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/net')
-rw-r--r--src/core/net/cookie_monster_delegate_qt.cpp18
-rw-r--r--src/core/net/cookie_monster_delegate_qt.h3
2 files changed, 6 insertions, 15 deletions
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index cf114406b..d3157f760 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -223,20 +223,11 @@ void CookieMonsterDelegateQt::OnCookieChanged(const net::CookieChangeInfo &chang
m_client->d_func()->onCookieChanged(toQt(change.cookie), change.cause != net::CookieChangeCause::INSERTED);
}
-void CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread(qint64 callbackId, const std::vector<net::CanonicalCookie> &cookies)
-{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- QByteArray rawCookies;
- for (auto &&cookie : cookies)
- rawCookies += toQt(cookie).toRawForm() % QByteArrayLiteral("\n");
-
- GetAllCookiesResultOnUIThread(callbackId, rawCookies);
-}
-
-void CookieMonsterDelegateQt::GetAllCookiesResultOnUIThread(qint64 callbackId, const QByteArray &cookies)
+void CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread(qint64 callbackId, const net::CookieList &cookies)
{
+ QByteArray rawCookies = QByteArray::fromStdString(net::CanonicalCookie::BuildCookieLine(cookies));
if (m_client)
- m_client->d_func()->onGetAllCallbackResult(callbackId, cookies);
+ m_client->d_func()->onGetAllCallbackResult(callbackId, rawCookies);
}
void CookieMonsterDelegateQt::SetCookieCallbackOnUIThread(qint64 callbackId, net::CanonicalCookie::CookieInclusionStatus status)
@@ -250,4 +241,5 @@ void CookieMonsterDelegateQt::DeleteCookiesCallbackOnUIThread(qint64 callbackId,
if (m_client)
m_client->d_func()->onDeleteCallbackResult(callbackId, numCookies);
}
-}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/net/cookie_monster_delegate_qt.h b/src/core/net/cookie_monster_delegate_qt.h
index 6caaeea94..bcbbe4c52 100644
--- a/src/core/net/cookie_monster_delegate_qt.h
+++ b/src/core/net/cookie_monster_delegate_qt.h
@@ -115,8 +115,7 @@ public:
void OnCookieChanged(const net::CookieChangeInfo &change);
private:
- void GetAllCookiesCallbackOnUIThread(qint64 callbackId, const std::vector<net::CanonicalCookie> &cookies);
- void GetAllCookiesResultOnUIThread(qint64 callbackId, const QByteArray &cookies);
+ void GetAllCookiesCallbackOnUIThread(qint64 callbackId, const net::CookieList &cookies);
void SetCookieCallbackOnUIThread(qint64 callbackId, net::CanonicalCookie::CookieInclusionStatus status);
void DeleteCookiesCallbackOnUIThread(qint64 callbackId, uint numCookies);
};