mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefCookieManager::GetBlockingManager (issue #2374)
This commit is contained in:
@@ -22,7 +22,14 @@ namespace {
|
||||
class ClientRequestContextHandler : public CefRequestContextHandler,
|
||||
public CefExtensionHandler {
|
||||
public:
|
||||
ClientRequestContextHandler() {}
|
||||
ClientRequestContextHandler() {
|
||||
CefRefPtr<CefCommandLine> command_line =
|
||||
CefCommandLine::GetGlobalCommandLine();
|
||||
if (command_line->HasSwitch(switches::kRequestContextBlockCookies)) {
|
||||
// Use a cookie manager that neither stores nor retrieves cookies.
|
||||
cookie_manager_ = CefCookieManager::GetBlockingManager();
|
||||
}
|
||||
}
|
||||
|
||||
// CefRequestContextHandler methods:
|
||||
bool OnBeforePluginLoad(const CefString& mime_type,
|
||||
@@ -73,6 +80,10 @@ class ClientRequestContextHandler : public CefRequestContextHandler,
|
||||
}
|
||||
}
|
||||
|
||||
CefRefPtr<CefCookieManager> GetCookieManager() OVERRIDE {
|
||||
return cookie_manager_;
|
||||
}
|
||||
|
||||
// CefExtensionHandler methods:
|
||||
void OnExtensionLoaded(CefRefPtr<CefExtension> extension) OVERRIDE {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
@@ -99,6 +110,8 @@ class ClientRequestContextHandler : public CefRequestContextHandler,
|
||||
}
|
||||
|
||||
private:
|
||||
CefRefPtr<CefCookieManager> cookie_manager_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(ClientRequestContextHandler);
|
||||
DISALLOW_COPY_AND_ASSIGN(ClientRequestContextHandler);
|
||||
};
|
||||
|
Reference in New Issue
Block a user