diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-01 13:10:34 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-19 07:42:58 +0000 |
commit | 757004ecf484289f576870b4f251c3e7551294c5 (patch) | |
tree | 3f45d9230b87239d16ca7584c07b54b068c11697 /src/core/cookie_monster_delegate_qt.cpp | |
parent | 71d6dc0c326523103dff867d7184e7bc7e49c71d (diff) |
Reinstate cookie filter API
Expose API to block cookies for specific domains, or third party cookies
in general.
Task-number: QTBUG-62897
Change-Id: I7f0e3f346368a2ef2fbd77f3197ee2dea50d57ce
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/cookie_monster_delegate_qt.cpp')
-rw-r--r-- | src/core/cookie_monster_delegate_qt.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/cookie_monster_delegate_qt.cpp b/src/core/cookie_monster_delegate_qt.cpp index 0fa8dead0..58cd481dc 100644 --- a/src/core/cookie_monster_delegate_qt.cpp +++ b/src/core/cookie_monster_delegate_qt.cpp @@ -211,10 +211,20 @@ void CookieMonsterDelegateQt::setClient(QWebEngineCookieStore *client) m_client->d_func()->processPendingUserCookies(); } -bool CookieMonsterDelegateQt::canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url) +bool CookieMonsterDelegateQt::canSetCookie(const QUrl &firstPartyUrl, const QByteArray &/*cookieLine*/, const QUrl &url) { - // TODO: should be used for FilterRequest implementation - return true; + if (!m_client) + return true; + + return m_client->d_func()->canAccessCookies(firstPartyUrl, url); +} + +bool CookieMonsterDelegateQt::canGetCookies(const QUrl &firstPartyUrl, const QUrl &url) +{ + if (!m_client) + return true; + + return m_client->d_func()->canAccessCookies(firstPartyUrl, url); } void CookieMonsterDelegateQt::OnCookieChanged(const net::CanonicalCookie& cookie, bool removed, net::CookieStore::ChangeCause cause) |