mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefAppManager and remove global ContentClient accessors (see issue #2969)
This is the first pass in removing direct dependencies on the Alloy runtime from code that can potentially be shared between runtimes. CefBrowserHost and CefRequestContext APIs (including CefCookieManager, CefURLRequest, etc.) are not yet implemented for the Chrome runtime. Assert early if these API methods are called while the Chrome runtime is enabled.
This commit is contained in:
@@ -3,14 +3,15 @@
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#include "libcef/browser/request_context_impl.h"
|
||||
#include "libcef/browser/alloy/alloy_content_browser_client.h"
|
||||
#include "libcef/browser/browser_context.h"
|
||||
#include "libcef/browser/context.h"
|
||||
#include "libcef/browser/extensions/extension_system.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
#include "libcef/common/app_manager.h"
|
||||
#include "libcef/common/extensions/extensions_util.h"
|
||||
#include "libcef/common/task_runner_impl.h"
|
||||
#include "libcef/common/values_impl.h"
|
||||
#include "libcef/features/runtime_checks.h"
|
||||
|
||||
#include "base/atomic_sequence_num.h"
|
||||
#include "base/logging.h"
|
||||
@@ -622,10 +623,14 @@ void CefRequestContextImpl::OnRenderFrameDeleted(int render_process_id,
|
||||
// static
|
||||
CefRefPtr<CefRequestContextImpl>
|
||||
CefRequestContextImpl::GetOrCreateRequestContext(const Config& config) {
|
||||
// TODO(chrome-runtime): Add support for this method.
|
||||
REQUIRE_ALLOY_RUNTIME();
|
||||
|
||||
if (config.is_global ||
|
||||
(config.other && config.other->IsGlobal() && !config.handler)) {
|
||||
// Return the singleton global context.
|
||||
return AlloyContentBrowserClient::Get()->request_context();
|
||||
return static_cast<CefRequestContextImpl*>(
|
||||
CefAppManager::Get()->GetGlobalRequestContext().get());
|
||||
}
|
||||
|
||||
// The new context will be initialized later by EnsureBrowserContext().
|
||||
|
Reference in New Issue
Block a user