diff options
-rw-r--r-- | src/core/api/qwebenginecookiestore.cpp | 8 | ||||
-rw-r--r-- | src/core/api/qwebenginecookiestore_p.h | 1 | ||||
-rw-r--r-- | src/core/cookie_monster_delegate_qt.cpp | 10 | ||||
-rw-r--r-- | src/core/url_request_context_getter_qt.cpp | 2 |
4 files changed, 19 insertions, 2 deletions
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp index 89272057e..2938eddbd 100644 --- a/src/core/api/qwebenginecookiestore.cpp +++ b/src/core/api/qwebenginecookiestore.cpp @@ -88,6 +88,14 @@ void QWebEngineCookieStorePrivate::processPendingUserCookies() m_pendingUserCookies.clear(); } +void QWebEngineCookieStorePrivate::rejectPendingUserCookies() +{ + m_getAllCookiesPending = false; + m_deleteAllCookiesPending = false; + m_deleteSessionCookiesPending = false; + m_pendingUserCookies.clear(); +} + void QWebEngineCookieStorePrivate::setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie, const QUrl &origin) { const quint64 currentCallbackId = callback ? m_nextCallbackId++ : static_cast<quint64>(CallbackDirectory::NoCallbackId); diff --git a/src/core/api/qwebenginecookiestore_p.h b/src/core/api/qwebenginecookiestore_p.h index b8c8b6145..348dcd69f 100644 --- a/src/core/api/qwebenginecookiestore_p.h +++ b/src/core/api/qwebenginecookiestore_p.h @@ -87,6 +87,7 @@ public: QWebEngineCookieStorePrivate(); void processPendingUserCookies(); + void rejectPendingUserCookies(); void setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie, const QUrl &origin); void deleteCookie(const QNetworkCookie &cookie, const QUrl &url); void deleteSessionCookies(); diff --git a/src/core/cookie_monster_delegate_qt.cpp b/src/core/cookie_monster_delegate_qt.cpp index fa4e9e8bf..e740d01e7 100644 --- a/src/core/cookie_monster_delegate_qt.cpp +++ b/src/core/cookie_monster_delegate_qt.cpp @@ -139,10 +139,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) diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index f5c310e90..26e2633d8 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -210,7 +210,7 @@ void URLRequestContextGetterQt::generateCookieStore() Q_ASSERT(m_storage); m_updateCookieStore = 0; - // Unset it first to get a chance to destroy and flush the old cookie store before before opening a new on possibly the same file. + // Unset it first to get a chance to destroy and flush the old cookie store before opening a new on possibly the same file. m_storage->set_cookie_store(0); m_cookieDelegate->setCookieMonster(0); m_cookieDelegate->setClient(m_browserContext->cookieStore()); |