diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-03-16 11:16:48 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-03-16 18:26:29 +0000 |
commit | 327fcc7fd3396219a29a6c8d38dc4774e410c1e9 (patch) | |
tree | 12d594340295fe58efe0a35a7ab266bf09f2990d /src/core/api/qwebenginecookiestore.h | |
parent | 29a9f9d6e4ad9ffee62d3633edb17c1be335203e (diff) |
Switch cookie-filter API to std::function
Allows us to use return value instead of magic properties
Task-number: QTBUG-66825
Change-Id: I55202a7aca2e662bc214b05caf767d2da496f026
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/api/qwebenginecookiestore.h')
-rw-r--r-- | src/core/api/qwebenginecookiestore.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/api/qwebenginecookiestore.h b/src/core/api/qwebenginecookiestore.h index 0e839f73c..a62765f77 100644 --- a/src/core/api/qwebenginecookiestore.h +++ b/src/core/api/qwebenginecookiestore.h @@ -41,13 +41,14 @@ #define QWEBENGINECOOKIESTORE_H #include <QtWebEngineCore/qtwebenginecoreglobal.h> -#include <QtWebEngineCore/qwebenginecallback.h> #include <QtCore/qobject.h> #include <QtCore/qscopedpointer.h> #include <QtCore/qurl.h> #include <QtNetwork/qnetworkcookie.h> +#include <functional> + namespace QtWebEngineCore { class BrowserContextAdapter; class CookieMonsterDelegateQt; @@ -61,15 +62,14 @@ class QWEBENGINE_EXPORT QWebEngineCookieStore : public QObject { public: struct FilterRequest { - bool accepted; - const bool thirdParty; - - const QUrl firstPartyUrl; - const QUrl origin; + bool thirdParty; + QUrl firstPartyUrl; + QUrl origin; }; virtual ~QWebEngineCookieStore(); - void setCookieFilter(const QWebEngineCallback<FilterRequest&> &filterCallback); + void setCookieFilter(const std::function<bool(const FilterRequest &)> &filterCallback); + void setCookieFilter(std::function<bool(const FilterRequest &)> &&filterCallback); void setCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl()); void deleteCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl()); void deleteSessionCookies(); |