summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-12-03 15:29:48 +0100
committerMichal Klocek <michal.klocek@theqtcompany.com>2016-01-15 22:07:06 +0000
commit7ae7b58955b018aa7294aa07d6ff7754af336f4c (patch)
tree0eaee11e15c5eb5cb59a9bf072237deb0524cc26 /src
parent09ff58b1a91a1472b4aa4c644686fb2e46a3b1ca (diff)
Remove FilterRequest from qwebenginecookiestore
OnCanSetCookie and OnCanGetCookies should both be mapped to API. Since the other call is missing (filter cookies which should be send) remove existing one from 5.6 Change-Id: I4f42c4a1fee6add7a5efffaf4c38877a1f35ce61 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/api/qwebenginecookiestore.cpp32
-rw-r--r--src/core/api/qwebenginecookiestore.h12
-rw-r--r--src/core/api/qwebenginecookiestore_p.h3
-rw-r--r--src/core/cookie_monster_delegate_qt.cpp6
4 files changed, 2 insertions, 51 deletions
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index ab2612803..c0a3f3208 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -175,20 +175,6 @@ void QWebEngineCookieStorePrivate::onCookieChanged(const QNetworkCookie &cookie,
Q_EMIT q->cookieAdded(cookie);
}
-bool QWebEngineCookieStorePrivate::canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url)
-{
- if (filterCallback) {
- QWebEngineCookieStore::FilterRequest request;
- request.accepted = true;
- request.firstPartyUrl = firstPartyUrl;
- request.cookieLine = cookieLine;
- request.cookieSource = url;
- callbackDirectory.invokeDirectly<QWebEngineCookieStore::FilterRequest&>(filterCallback, request);
- return request.accepted;
- }
- return true;
-}
-
/*!
\class QWebEngineCookieStore
\inmodule QtWebEngineCore
@@ -350,22 +336,4 @@ void QWebEngineCookieStore::deleteAllCookies()
d->deleteAllCookies();
}
-/*!
- \fn void QWebEngineCookieStore::setCookieFilter(FunctorOrLambda filterCallback)
-
- Installs a cookie filter that can reject cookies before they are added to the cookie store.
- The \a filterCallback must be a lambda or functor taking FilterRequest structure. If the
- cookie is to be rejected, the filter can set FilterRequest::accepted to \c false.
-
- The callback should not be used to execute heavy tasks since it is running on the
- IO thread and therefore blocks the Chromium networking.
-
- \sa deleteAllCookies(), loadAllCookies()
-*/
-void QWebEngineCookieStore::setCookieFilter(const QWebEngineCallback<QWebEngineCookieStore::FilterRequest&> &filter)
-{
- Q_D(QWebEngineCookieStore);
- d->filterCallback = filter;
-}
-
QT_END_NAMESPACE
diff --git a/src/core/api/qwebenginecookiestore.h b/src/core/api/qwebenginecookiestore.h
index 3a52a2025..b1d625385 100644
--- a/src/core/api/qwebenginecookiestore.h
+++ b/src/core/api/qwebenginecookiestore.h
@@ -57,20 +57,8 @@ class QWEBENGINE_EXPORT QWebEngineCookieStore : public QObject {
Q_OBJECT
public:
- struct FilterRequest {
- bool accepted;
-
- QUrl firstPartyUrl;
- QByteArray cookieLine;
- QUrl cookieSource;
- };
virtual ~QWebEngineCookieStore();
-#ifdef Q_QDOC
- void setCookieFilter(FunctorOrLambda filterCallback);
-#else
- void setCookieFilter(const QWebEngineCallback<FilterRequest&> &filterCallback);
-#endif
void setCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl());
void deleteCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl());
void deleteSessionCookies();
diff --git a/src/core/api/qwebenginecookiestore_p.h b/src/core/api/qwebenginecookiestore_p.h
index 348dcd69f..41456cfdc 100644
--- a/src/core/api/qwebenginecookiestore_p.h
+++ b/src/core/api/qwebenginecookiestore_p.h
@@ -75,7 +75,6 @@ class QWEBENGINE_PRIVATE_EXPORT QWebEngineCookieStorePrivate : public QObjectPri
friend class QTypeInfo<CookieData>;
public:
QtWebEngineCore::CallbackDirectory callbackDirectory;
- QWebEngineCallback<QWebEngineCookieStore::FilterRequest&> filterCallback;
QVector<CookieData> m_pendingUserCookies;
quint64 m_nextCallbackId;
bool m_deleteSessionCookiesPending;
@@ -94,8 +93,6 @@ public:
void deleteAllCookies();
void getAllCookies();
- bool canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url);
-
void onGetAllCallbackResult(qint64 callbackId, const QByteArray &cookieList);
void onSetCallbackResult(qint64 callbackId, bool success);
void onDeleteCallbackResult(qint64 callbackId, int numCookies);
diff --git a/src/core/cookie_monster_delegate_qt.cpp b/src/core/cookie_monster_delegate_qt.cpp
index 3689d54d7..493743385 100644
--- a/src/core/cookie_monster_delegate_qt.cpp
+++ b/src/core/cookie_monster_delegate_qt.cpp
@@ -166,10 +166,8 @@ void CookieMonsterDelegateQt::setClient(QWebEngineCookieStore *client)
bool CookieMonsterDelegateQt::canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url)
{
- if (!m_client)
- return true;
-
- return m_client->d_func()->canSetCookie(firstPartyUrl, cookieLine, url);
+ // TODO: should be used for FilterRequest implementation
+ return true;
}
void CookieMonsterDelegateQt::OnCookieChanged(const net::CanonicalCookie& cookie, bool removed, ChangeCause cause)