diff options
author | Andras Becsi <andras.becsi@theqtcompany.com> | 2015-08-17 17:21:03 +0200 |
---|---|---|
committer | Andras Becsi <becsi.andras@gmail.com> | 2015-08-27 12:40:28 +0000 |
commit | 8cd47a6df005ae61dbc366b884bebeb0ec49e889 (patch) | |
tree | 123e2357c7c666a61f6e13a6deed95488f73a24d /src/core/cookie_monster_delegate_qt.cpp | |
parent | 93d3a21009b601d9fcee1c9faa2324625d3b5ed1 (diff) |
Add support for blocking cookies
This patch adds acceptCookie virtual function that is
called when a request wants to set a new cookie and
can be overridden to intercept or block these cookies.
Change-Id: I8b932d4176ffc3c0ac48b1656486d5492cabaefd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/cookie_monster_delegate_qt.cpp')
-rw-r--r-- | src/core/cookie_monster_delegate_qt.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/cookie_monster_delegate_qt.cpp b/src/core/cookie_monster_delegate_qt.cpp index 6b808e76c..7838617ba 100644 --- a/src/core/cookie_monster_delegate_qt.cpp +++ b/src/core/cookie_monster_delegate_qt.cpp @@ -158,6 +158,14 @@ void CookieMonsterDelegateQt::setClient(QWebEngineCookieStoreClient *client) m_client->d_func()->processPendingUserCookies(); } +bool CookieMonsterDelegateQt::canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url) +{ + if (!m_client) + return true; + + return m_client->d_ptr->canSetCookie(firstPartyUrl, cookieLine, url); +} + void CookieMonsterDelegateQt::OnCookieChanged(const net::CanonicalCookie& cookie, bool removed, ChangeCause cause) { if (!m_client) |