summaryrefslogtreecommitdiffstats
path: root/src/core/network_delegate_qt.cpp
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@theqtcompany.com>2015-08-17 17:21:03 +0200
committerAndras Becsi <becsi.andras@gmail.com>2015-08-27 12:40:28 +0000
commit8cd47a6df005ae61dbc366b884bebeb0ec49e889 (patch)
tree123e2357c7c666a61f6e13a6deed95488f73a24d /src/core/network_delegate_qt.cpp
parent93d3a21009b601d9fcee1c9faa2324625d3b5ed1 (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/network_delegate_qt.cpp')
-rw-r--r--src/core/network_delegate_qt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp
index d79f6e609..38fd3c710 100644
--- a/src/core/network_delegate_qt.cpp
+++ b/src/core/network_delegate_qt.cpp
@@ -221,7 +221,8 @@ bool NetworkDelegateQt::OnCanSetCookie(const net::URLRequest& request,
const std::string& cookie_line,
net::CookieOptions*)
{
- return true;
+ Q_ASSERT(m_requestContextGetter);
+ return m_requestContextGetter->m_cookieDelegate->canSetCookie(toQt(request.first_party_for_cookies()), QByteArray::fromStdString(cookie_line), toQt(request.url()));
}
void NetworkDelegateQt::OnResolveProxy(const GURL&, int, const net::ProxyService&, net::ProxyInfo*)