mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Remove methods that modify cookie storage at runtime (see issue #2622).
This change removes cookie and request handler functionality that will not supported by the NetworkService. Specifically, it is no longer possible to change cookie storage locations at runime by returning a different CefCookieManager for an already initialized CefRequestContext. After this change you will need to use a separate CefRequestContext when creating a CefBrowser if you require separate cookie storage. The following methods have been removed: - CefCookieManager::CreateManager - CefCookieManager::GetBlockingManager - CefCookieManager::SetStoragePath - CefRequestContextHandler::GetCookieManager The following methods have been renamed: - CefRequestContext::GetDefaultCookieManager to GetCookieManager. This change substantially simplifies the network implementation in CEF because it is no longer necessary to proxy objects that are normally owned by Chromium. Chromium patches that are no longer necessary will be removed as a follow-up commit. To test: Verify that `ceftests --gtest_filter=-PluginTest.*` pass with NetworkService disabled. Plugin tests will be fixed in a follow-up commit.
This commit is contained in:
@ -23,49 +23,13 @@
|
||||
#include "net/ssl/client_cert_store_mac.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
bool ShouldProxyUserData(const void* key) {
|
||||
// If this value is not proxied WebUI will fail to load.
|
||||
if (key == content::GetURLDataManagerBackendUserDataKey())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefResourceContext::CefResourceContext(
|
||||
bool is_off_the_record,
|
||||
CefRefPtr<CefRequestContextHandler> handler)
|
||||
: parent_(nullptr),
|
||||
is_off_the_record_(is_off_the_record),
|
||||
handler_(handler) {}
|
||||
: is_off_the_record_(is_off_the_record), handler_(handler) {}
|
||||
|
||||
CefResourceContext::~CefResourceContext() {}
|
||||
|
||||
base::SupportsUserData::Data* CefResourceContext::GetUserData(
|
||||
const void* key) const {
|
||||
if (parent_ && ShouldProxyUserData(key))
|
||||
return parent_->GetUserData(key);
|
||||
return content::ResourceContext::GetUserData(key);
|
||||
}
|
||||
|
||||
void CefResourceContext::SetUserData(const void* key,
|
||||
std::unique_ptr<Data> data) {
|
||||
if (parent_ && ShouldProxyUserData(key))
|
||||
parent_->SetUserData(key, std::move(data));
|
||||
else
|
||||
content::ResourceContext::SetUserData(key, std::move(data));
|
||||
}
|
||||
|
||||
void CefResourceContext::RemoveUserData(const void* key) {
|
||||
if (parent_ && ShouldProxyUserData(key))
|
||||
parent_->RemoveUserData(key);
|
||||
else
|
||||
content::ResourceContext::RemoveUserData(key);
|
||||
}
|
||||
|
||||
std::unique_ptr<net::ClientCertStore>
|
||||
CefResourceContext::CreateClientCertStore() {
|
||||
#if defined(USE_NSS_CERTS)
|
||||
@ -91,12 +55,6 @@ void CefResourceContext::set_extensions_info_map(
|
||||
extension_info_map_ = extensions_info_map;
|
||||
}
|
||||
|
||||
void CefResourceContext::set_parent(CefResourceContext* parent) {
|
||||
DCHECK(!parent_);
|
||||
DCHECK(parent);
|
||||
parent_ = parent;
|
||||
}
|
||||
|
||||
void CefResourceContext::AddPluginLoadDecision(
|
||||
int render_process_id,
|
||||
const base::FilePath& plugin_path,
|
||||
|
Reference in New Issue
Block a user