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:
@ -4,7 +4,7 @@
|
||||
|
||||
#include "libcef/browser/extensions/browser_extensions_util.h"
|
||||
|
||||
#include "libcef/browser/browser_context_impl.h"
|
||||
#include "libcef/browser/browser_context.h"
|
||||
#include "libcef/browser/browser_info_manager.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
#include "libcef/common/extensions/extensions_util.h"
|
||||
@ -140,8 +140,8 @@ CefRefPtr<CefBrowserHostImpl> GetBrowserForTabId(
|
||||
if (tab_id < 0 || !browser_context)
|
||||
return nullptr;
|
||||
|
||||
CefBrowserContextImpl* browser_context_impl =
|
||||
CefBrowserContextImpl::GetForContext(browser_context);
|
||||
CefBrowserContext* browser_context_impl =
|
||||
CefBrowserContext::GetForContext(browser_context);
|
||||
|
||||
CefBrowserInfoManager::BrowserInfoList list;
|
||||
CefBrowserInfoManager::GetInstance()->GetBrowserInfoList(list);
|
||||
@ -149,7 +149,7 @@ CefRefPtr<CefBrowserHostImpl> GetBrowserForTabId(
|
||||
CefRefPtr<CefBrowserHostImpl> current_browser = browser_info->browser();
|
||||
if (current_browser && current_browser->GetIdentifier() == tab_id) {
|
||||
// Make sure we're operating in the same BrowserContextImpl.
|
||||
if (CefBrowserContextImpl::GetForContext(
|
||||
if (CefBrowserContext::GetForContext(
|
||||
current_browser->GetBrowserContext()) == browser_context_impl) {
|
||||
return current_browser;
|
||||
} else {
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "libcef/browser/extensions/extension_function_details.h"
|
||||
|
||||
#include "libcef/browser/browser_context_impl.h"
|
||||
#include "libcef/browser/browser_context.h"
|
||||
#include "libcef/browser/extensions/browser_extensions_util.h"
|
||||
#include "libcef/browser/extensions/extension_system.h"
|
||||
#include "libcef/browser/navigate_params.h"
|
||||
@ -168,9 +168,8 @@ CefRefPtr<CefBrowserHostImpl> CefExtensionFunctionDetails::GetCurrentBrowser()
|
||||
static_cast<CefBrowserHostImpl*>(active_browser.get());
|
||||
|
||||
// Make sure we're operating in the same BrowserContextImpl.
|
||||
if (CefBrowserContextImpl::GetForContext(
|
||||
browser->GetBrowserContext()) ==
|
||||
CefBrowserContextImpl::GetForContext(
|
||||
if (CefBrowserContext::GetForContext(browser->GetBrowserContext()) ==
|
||||
CefBrowserContext::GetForContext(
|
||||
active_browser_impl->GetBrowserContext())) {
|
||||
browser = active_browser_impl;
|
||||
} else {
|
||||
@ -349,8 +348,8 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
|
||||
if (params.index.get())
|
||||
index = *params.index;
|
||||
|
||||
CefBrowserContextImpl* browser_context_impl =
|
||||
CefBrowserContextImpl::GetForContext(active_browser->GetBrowserContext());
|
||||
CefBrowserContext* browser_context_impl =
|
||||
CefBrowserContext::GetForContext(active_browser->GetBrowserContext());
|
||||
|
||||
// A CEF representation should always exist.
|
||||
CefRefPtr<CefExtension> cef_extension =
|
||||
@ -361,7 +360,6 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
|
||||
return nullptr;
|
||||
|
||||
// Always use the same request context that the extension was registered with.
|
||||
// May represent an *Impl or *Proxy BrowserContext.
|
||||
// GetLoaderContext() will return NULL for internal extensions.
|
||||
CefRefPtr<CefRequestContext> request_context =
|
||||
cef_extension->GetLoaderContext();
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "libcef/browser/extensions/extensions_api_client.h"
|
||||
|
||||
#include "include/internal/cef_types_wrappers.h"
|
||||
#include "libcef/browser/browser_context_impl.h"
|
||||
#include "libcef/browser/browser_context.h"
|
||||
#include "libcef/browser/extensions/api/storage/sync_value_store_cache.h"
|
||||
#include "libcef/browser/extensions/extension_web_contents_observer.h"
|
||||
#include "libcef/browser/extensions/mime_handler_view_guest_delegate.h"
|
||||
@ -35,14 +35,9 @@ CefExtensionsAPIClient::CreateGuestViewManagerDelegate(
|
||||
content::BrowserContext* context) const {
|
||||
// The GuestViewManager instance associated with the returned Delegate, which
|
||||
// will be retrieved in the future via GuestViewManager::FromBrowserContext,
|
||||
// will be associated with the CefBrowserContextImpl instead of |context| due
|
||||
// to ShouldProxyUserData in browser_context_proxy.cc. Because the
|
||||
// GuestViewManagerDelegate keeps a reference to the passed-in context we need
|
||||
// to provide the *Impl object instead of |context| which may be a *Proxy
|
||||
// object. If we don't do this then the Delegate may attempt to access a
|
||||
// *Proxy object that has already been deleted.
|
||||
// will be associated with the CefBrowserContext.
|
||||
return base::WrapUnique(new extensions::ExtensionsGuestViewManagerDelegate(
|
||||
CefBrowserContextImpl::GetForContext(context)));
|
||||
CefBrowserContext::GetForContext(context)));
|
||||
}
|
||||
|
||||
std::unique_ptr<MimeHandlerViewGuestDelegate>
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/browser_context_impl.h"
|
||||
#include "libcef/browser/browser_context.h"
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
#include "libcef/browser/extensions/component_extension_resource_manager.h"
|
||||
#include "libcef/browser/extensions/extension_system.h"
|
||||
@ -65,13 +65,13 @@ bool CefExtensionsBrowserClient::AreExtensionsDisabled(
|
||||
}
|
||||
|
||||
bool CefExtensionsBrowserClient::IsValidContext(BrowserContext* context) {
|
||||
return CefBrowserContextImpl::GetForContext(context) != NULL;
|
||||
return CefBrowserContext::GetForContext(context) != NULL;
|
||||
}
|
||||
|
||||
bool CefExtensionsBrowserClient::IsSameContext(BrowserContext* first,
|
||||
BrowserContext* second) {
|
||||
// Returns true if |first| and |second| share the same underlying
|
||||
// CefBrowserContextImpl.
|
||||
// CefBrowserContext.
|
||||
return GetCefImplContext(first) == GetCefImplContext(second);
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ BrowserContext* CefExtensionsBrowserClient::GetOriginalContext(
|
||||
|
||||
BrowserContext* CefExtensionsBrowserClient::GetCefImplContext(
|
||||
BrowserContext* context) {
|
||||
return CefBrowserContextImpl::GetForContext(context);
|
||||
return CefBrowserContext::GetForContext(context);
|
||||
}
|
||||
|
||||
bool CefExtensionsBrowserClient::IsGuestSession(BrowserContext* context) const {
|
||||
@ -196,10 +196,8 @@ bool CefExtensionsBrowserClient::CreateBackgroundExtensionHost(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& url,
|
||||
ExtensionHost** host) {
|
||||
// The BrowserContext referenced by ProcessManager should always be an *Impl.
|
||||
DCHECK(!static_cast<CefBrowserContext*>(browser_context)->is_proxy());
|
||||
CefBrowserContextImpl* browser_context_impl =
|
||||
CefBrowserContextImpl::GetForContext(browser_context);
|
||||
CefBrowserContext* browser_context_impl =
|
||||
CefBrowserContext::GetForContext(browser_context);
|
||||
|
||||
// A CEF representation should always exist.
|
||||
CefRefPtr<CefExtension> cef_extension =
|
||||
@ -211,7 +209,6 @@ bool CefExtensionsBrowserClient::CreateBackgroundExtensionHost(
|
||||
}
|
||||
|
||||
// Always use the same request context that the extension was registered with.
|
||||
// May represent an *Impl or *Proxy BrowserContext.
|
||||
// GetLoaderContext() will return NULL for internal extensions.
|
||||
CefRefPtr<CefRequestContext> request_context =
|
||||
cef_extension->GetLoaderContext();
|
||||
|
Reference in New Issue
Block a user