summaryrefslogtreecommitdiffstats
path: root/src/core/cookie_monster_delegate_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-12 11:32:02 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-12 11:35:45 +0100
commita077399f4c17f57e911334867c918cc6ddeb15fc (patch)
treec8e4d326d7a074e9d16b68399ecc5f728f8533fe /src/core/cookie_monster_delegate_qt.cpp
parent3d698f5de377bde2293e222536bc50171cfdf1b8 (diff)
parent12dd6ff845656eb625e2ee3d0e73392bc2c61983 (diff)
Merge branch '5.6' into dev
Diffstat (limited to 'src/core/cookie_monster_delegate_qt.cpp')
-rw-r--r--src/core/cookie_monster_delegate_qt.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/core/cookie_monster_delegate_qt.cpp b/src/core/cookie_monster_delegate_qt.cpp
index a81670a6c..3689d54d7 100644
--- a/src/core/cookie_monster_delegate_qt.cpp
+++ b/src/core/cookie_monster_delegate_qt.cpp
@@ -44,8 +44,6 @@
#include "api/qwebenginecookiestore_p.h"
#include "type_conversion.h"
-#include <QStringBuilder>
-
namespace QtWebEngineCore {
static GURL sourceUrlForCookie(const QNetworkCookie &cookie) {
@@ -139,10 +137,18 @@ void CookieMonsterDelegateQt::deleteAllCookies(quint64 callbackId)
void CookieMonsterDelegateQt::setCookieMonster(net::CookieMonster* monster)
{
+ if (!monster && !m_cookieMonster)
+ return;
+
m_cookieMonster = monster;
- if (m_client)
+ if (!m_client)
+ return;
+
+ if (monster)
m_client->d_func()->processPendingUserCookies();
+ else
+ m_client->d_func()->rejectPendingUserCookies();
}
void CookieMonsterDelegateQt::setClient(QWebEngineCookieStore *client)
@@ -152,7 +158,7 @@ void CookieMonsterDelegateQt::setClient(QWebEngineCookieStore *client)
if (!m_client)
return;
- m_client->d_ptr->delegate = this;
+ m_client->d_func()->delegate = this;
if (hasCookieMonster())
m_client->d_func()->processPendingUserCookies();
@@ -163,14 +169,14 @@ bool CookieMonsterDelegateQt::canSetCookie(const QUrl &firstPartyUrl, const QByt
if (!m_client)
return true;
- return m_client->d_ptr->canSetCookie(firstPartyUrl, cookieLine, url);
+ return m_client->d_func()->canSetCookie(firstPartyUrl, cookieLine, url);
}
void CookieMonsterDelegateQt::OnCookieChanged(const net::CanonicalCookie& cookie, bool removed, ChangeCause cause)
{
if (!m_client)
return;
- m_client->d_ptr->onCookieChanged(toQt(cookie), removed);
+ m_client->d_func()->onCookieChanged(toQt(cookie), removed);
}
}