Rename the current CEF runtime to Alloy (see issue #2969)

As part of introducing the Chrome runtime we now need to distinguish
between the classes that implement the current CEF runtime and the
classes the implement the shared CEF library/runtime structure and
public API. We choose the name Alloy for the current CEF runtime
because it describes a combination of Chrome and other elements.

Shared CEF library/runtime classes will continue to use the Cef
prefix. Classes that implement the Alloy or Chrome runtime will use
the Alloy or Chrome prefixes respectively. Classes that extend an
existing Chrome-prefixed class will add the Cef or Alloy suffix,
thereby following the existing naming pattern of Chrome-derived
classes.

This change applies the new naming pattern to an initial set of
runtime-related classes. Additional classes/files will be renamed
and moved as the Chrome runtime implementation progresses.
This commit is contained in:
Marshall Greenblatt
2020-06-28 14:29:44 -04:00
parent f5587b74f0
commit 84f3ff2afd
63 changed files with 632 additions and 563 deletions

View File

@ -407,6 +407,16 @@ test("libcef_static_unittests") {
static_library("libcef_static") { static_library("libcef_static") {
sources = includes_common + sources = includes_common +
gypi_paths.autogen_cpp_includes + [ gypi_paths.autogen_cpp_includes + [
"libcef/browser/alloy/alloy_browser_main.cc",
"libcef/browser/alloy/alloy_browser_main.h",
"libcef/browser/alloy/chrome_browser_process_alloy.cc",
"libcef/browser/alloy/chrome_browser_process_alloy.h",
"libcef/browser/alloy/chrome_profile_manager_alloy.cc",
"libcef/browser/alloy/chrome_profile_manager_alloy.h",
"libcef/browser/alloy/chrome_profile_alloy.cc",
"libcef/browser/alloy/chrome_profile_alloy.h",
"libcef/browser/alloy/alloy_content_browser_client.cc",
"libcef/browser/alloy/alloy_content_browser_client.h",
"libcef/browser/audio_capturer.cc", "libcef/browser/audio_capturer.cc",
"libcef/browser/audio_capturer.h", "libcef/browser/audio_capturer.h",
"libcef/browser/browser_context.cc", "libcef/browser/browser_context.cc",
@ -419,8 +429,6 @@ static_library("libcef_static") {
"libcef/browser/browser_info.h", "libcef/browser/browser_info.h",
"libcef/browser/browser_info_manager.cc", "libcef/browser/browser_info_manager.cc",
"libcef/browser/browser_info_manager.h", "libcef/browser/browser_info_manager.h",
"libcef/browser/browser_main.cc",
"libcef/browser/browser_main.h",
"libcef/browser/browser_message_filter.cc", "libcef/browser/browser_message_filter.cc",
"libcef/browser/browser_message_filter.h", "libcef/browser/browser_message_filter.h",
"libcef/browser/browser_message_loop.cc", "libcef/browser/browser_message_loop.cc",
@ -434,15 +442,7 @@ static_library("libcef_static") {
"libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h", "libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h",
"libcef/browser/chrome/chrome_content_browser_client_cef.cc", "libcef/browser/chrome/chrome_content_browser_client_cef.cc",
"libcef/browser/chrome/chrome_content_browser_client_cef.h", "libcef/browser/chrome/chrome_content_browser_client_cef.h",
"libcef/browser/chrome_browser_process_stub.cc",
"libcef/browser/chrome_browser_process_stub.h",
"libcef/browser/chrome_crash_reporter_client_stub.cc", "libcef/browser/chrome_crash_reporter_client_stub.cc",
"libcef/browser/chrome_profile_manager_stub.cc",
"libcef/browser/chrome_profile_manager_stub.h",
"libcef/browser/chrome_profile_stub.cc",
"libcef/browser/chrome_profile_stub.h",
"libcef/browser/content_browser_client.cc",
"libcef/browser/content_browser_client.h",
"libcef/browser/context.cc", "libcef/browser/context.cc",
"libcef/browser/context.h", "libcef/browser/context.h",
"libcef/browser/context_menu_params_impl.cc", "libcef/browser/context_menu_params_impl.cc",
@ -642,6 +642,12 @@ static_library("libcef_static") {
"libcef/browser/xml_reader_impl.h", "libcef/browser/xml_reader_impl.h",
"libcef/browser/zip_reader_impl.cc", "libcef/browser/zip_reader_impl.cc",
"libcef/browser/zip_reader_impl.h", "libcef/browser/zip_reader_impl.h",
"libcef/common/alloy/alloy_content_client.cc",
"libcef/common/alloy/alloy_content_client.h",
"libcef/common/alloy/alloy_main_delegate.cc",
"libcef/common/alloy/alloy_main_delegate.h",
"libcef/common/alloy/alloy_main_runner_delegate.cc",
"libcef/common/alloy/alloy_main_runner_delegate.h",
"libcef/common/base_impl.cc", "libcef/common/base_impl.cc",
"libcef/common/cef_message_generator.cc", "libcef/common/cef_message_generator.cc",
"libcef/common/cef_message_generator.h", "libcef/common/cef_message_generator.h",
@ -655,8 +661,6 @@ static_library("libcef_static") {
"libcef/common/chrome/chrome_main_runner_delegate.h", "libcef/common/chrome/chrome_main_runner_delegate.h",
"libcef/common/command_line_impl.cc", "libcef/common/command_line_impl.cc",
"libcef/common/command_line_impl.h", "libcef/common/command_line_impl.h",
"libcef/common/content_client.cc",
"libcef/common/content_client.h",
"libcef/common/crash_reporter_client.cc", "libcef/common/crash_reporter_client.cc",
"libcef/common/crash_reporter_client.h", "libcef/common/crash_reporter_client.h",
"libcef/common/crash_reporting.cc", "libcef/common/crash_reporting.cc",
@ -675,8 +679,6 @@ static_library("libcef_static") {
"libcef/common/frame_util.cc", "libcef/common/frame_util.cc",
"libcef/common/frame_util.h", "libcef/common/frame_util.h",
"libcef/common/json_impl.cc", "libcef/common/json_impl.cc",
"libcef/common/main_delegate.cc",
"libcef/common/main_delegate.h",
"libcef/common/main_runner_delegate.h", "libcef/common/main_runner_delegate.h",
"libcef/common/main_runner_handler.h", "libcef/common/main_runner_handler.h",
"libcef/common/net/http_header_utils.cc", "libcef/common/net/http_header_utils.cc",
@ -731,11 +733,11 @@ static_library("libcef_static") {
"libcef/common/waitable_event_impl.h", "libcef/common/waitable_event_impl.h",
"libcef/common/widevine_loader.cc", "libcef/common/widevine_loader.cc",
"libcef/common/widevine_loader.h", "libcef/common/widevine_loader.h",
"libcef/features/chrome_cef.h", "libcef/features/runtime.h",
"libcef/renderer/alloy/alloy_content_renderer_client.cc",
"libcef/renderer/alloy/alloy_content_renderer_client.h",
"libcef/renderer/browser_impl.cc", "libcef/renderer/browser_impl.cc",
"libcef/renderer/browser_impl.h", "libcef/renderer/browser_impl.h",
"libcef/renderer/content_renderer_client.cc",
"libcef/renderer/content_renderer_client.h",
"libcef/renderer/dom_document_impl.cc", "libcef/renderer/dom_document_impl.cc",
"libcef/renderer/dom_document_impl.h", "libcef/renderer/dom_document_impl.h",
"libcef/renderer/dom_node_impl.cc", "libcef/renderer/dom_node_impl.cc",
@ -899,7 +901,7 @@ static_library("libcef_static") {
if (is_win) { if (is_win) {
sources += includes_win + [ sources += includes_win + [
"libcef/browser/browser_main_win.cc", "libcef/browser/alloy/alloy_browser_main_win.cc",
"libcef/browser/native/browser_platform_delegate_native_win.cc", "libcef/browser/native/browser_platform_delegate_native_win.cc",
"libcef/browser/native/browser_platform_delegate_native_win.h", "libcef/browser/native/browser_platform_delegate_native_win.h",
"libcef/browser/native/file_dialog_runner_win.cc", "libcef/browser/native/file_dialog_runner_win.cc",

View File

@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/browser/browser_main.h" #include "libcef/browser/alloy/alloy_browser_main.h"
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_context_keyed_service_factories.h" #include "libcef/browser/browser_context_keyed_service_factories.h"
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/devtools/devtools_manager_delegate.h" #include "libcef/browser/devtools/devtools_manager_delegate.h"
#include "libcef/browser/extensions/extension_system_factory.h" #include "libcef/browser/extensions/extension_system_factory.h"
@ -74,15 +74,15 @@
#include "libcef/browser/printing/print_dialog_linux.h" #include "libcef/browser/printing/print_dialog_linux.h"
#endif #endif
CefBrowserMainParts::CefBrowserMainParts( AlloyBrowserMainParts::AlloyBrowserMainParts(
const content::MainFunctionParams& parameters) const content::MainFunctionParams& parameters)
: BrowserMainParts(), devtools_delegate_(nullptr) {} : BrowserMainParts(), devtools_delegate_(nullptr) {}
CefBrowserMainParts::~CefBrowserMainParts() { AlloyBrowserMainParts::~AlloyBrowserMainParts() {
constrained_window::SetConstrainedWindowViewsClient(nullptr); constrained_window::SetConstrainedWindowViewsClient(nullptr);
} }
int CefBrowserMainParts::PreEarlyInitialization() { int AlloyBrowserMainParts::PreEarlyInitialization() {
#if defined(USE_AURA) && defined(OS_LINUX) #if defined(USE_AURA) && defined(OS_LINUX)
// TODO(linux): Consider using a real input method or // TODO(linux): Consider using a real input method or
// views::LinuxUI::SetInstance. // views::LinuxUI::SetInstance.
@ -92,7 +92,7 @@ int CefBrowserMainParts::PreEarlyInitialization() {
return service_manager::RESULT_CODE_NORMAL_EXIT; return service_manager::RESULT_CODE_NORMAL_EXIT;
} }
void CefBrowserMainParts::ToolkitInitialized() { void AlloyBrowserMainParts::ToolkitInitialized() {
SetConstrainedWindowViewsClient(CreateCefConstrainedWindowViewsClient()); SetConstrainedWindowViewsClient(CreateCefConstrainedWindowViewsClient());
#if defined(USE_AURA) #if defined(USE_AURA)
CHECK(aura::Env::GetInstance()); CHECK(aura::Env::GetInstance());
@ -101,7 +101,7 @@ void CefBrowserMainParts::ToolkitInitialized() {
#if defined(OS_WIN) #if defined(OS_WIN)
ui::CursorLoaderWin::SetCursorResourceModule( ui::CursorLoaderWin::SetCursorResourceModule(
CefContentBrowserClient::Get()->GetResourceDllName()); AlloyContentBrowserClient::Get()->GetResourceDllName());
#endif #endif
#endif // defined(USE_AURA) #endif // defined(USE_AURA)
@ -115,7 +115,7 @@ void CefBrowserMainParts::ToolkitInitialized() {
#endif // defined(TOOLKIT_VIEWS) #endif // defined(TOOLKIT_VIEWS)
} }
void CefBrowserMainParts::PreMainMessageLoopStart() { void AlloyBrowserMainParts::PreMainMessageLoopStart() {
#if defined(USE_AURA) && defined(USE_X11) #if defined(USE_AURA) && defined(USE_X11)
ui::TouchFactory::SetTouchDeviceListFromCommandLine(); ui::TouchFactory::SetTouchDeviceListFromCommandLine();
#endif #endif
@ -133,7 +133,7 @@ void CefBrowserMainParts::PreMainMessageLoopStart() {
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
} }
void CefBrowserMainParts::PostMainMessageLoopStart() { void AlloyBrowserMainParts::PostMainMessageLoopStart() {
#if defined(OS_LINUX) #if defined(OS_LINUX)
printing::PrintingContextLinux::SetCreatePrintDialogFunction( printing::PrintingContextLinux::SetCreatePrintDialogFunction(
&CefPrintDialogLinux::CreatePrintDialog); &CefPrintDialogLinux::CreatePrintDialog);
@ -142,7 +142,7 @@ void CefBrowserMainParts::PostMainMessageLoopStart() {
#endif #endif
} }
int CefBrowserMainParts::PreCreateThreads() { int AlloyBrowserMainParts::PreCreateThreads() {
#if defined(OS_WIN) #if defined(OS_WIN)
PlatformInitialize(); PlatformInitialize();
#endif #endif
@ -157,7 +157,7 @@ int CefBrowserMainParts::PreCreateThreads() {
return 0; return 0;
} }
void CefBrowserMainParts::PreMainMessageLoopRun() { void AlloyBrowserMainParts::PreMainMessageLoopRun() {
#if defined(USE_AURA) #if defined(USE_AURA)
display::Screen::SetScreenInstance(views::CreateDesktopScreen()); display::Screen::SetScreenInstance(views::CreateDesktopScreen());
#endif #endif
@ -213,7 +213,7 @@ void CefBrowserMainParts::PreMainMessageLoopRun() {
scheme::RegisterWebUIControllerFactory(); scheme::RegisterWebUIControllerFactory();
} }
void CefBrowserMainParts::PostMainMessageLoopRun() { void AlloyBrowserMainParts::PostMainMessageLoopRun() {
// NOTE: Destroy objects in reverse order of creation. // NOTE: Destroy objects in reverse order of creation.
CefDevToolsManagerDelegate::StopHttpHandler(); CefDevToolsManagerDelegate::StopHttpHandler();
@ -223,7 +223,7 @@ void CefBrowserMainParts::PostMainMessageLoopRun() {
global_request_context_ = nullptr; global_request_context_ = nullptr;
} }
void CefBrowserMainParts::PostDestroyThreads() { void AlloyBrowserMainParts::PostDestroyThreads() {
if (extensions::ExtensionsEnabled()) { if (extensions::ExtensionsEnabled()) {
extensions::ExtensionsBrowserClient::Set(nullptr); extensions::ExtensionsBrowserClient::Set(nullptr);
extensions_browser_client_.reset(); extensions_browser_client_.reset();

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_BROWSER_MAIN_H_ #ifndef CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_
#define CEF_LIBCEF_BROWSER_BROWSER_MAIN_H_ #define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_
#pragma once #pragma once
#include "libcef/browser/request_context_impl.h" #include "libcef/browser/request_context_impl.h"
@ -35,15 +35,15 @@ class ViewsDelegate;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
class LayoutProvider; class LayoutProvider;
#endif #endif
} } // namespace views
#endif // defined(TOOLKIT_VIEWS) #endif // defined(TOOLKIT_VIEWS)
class CefDevToolsDelegate; class CefDevToolsDelegate;
class CefBrowserMainParts : public content::BrowserMainParts { class AlloyBrowserMainParts : public content::BrowserMainParts {
public: public:
explicit CefBrowserMainParts(const content::MainFunctionParams& parameters); explicit AlloyBrowserMainParts(const content::MainFunctionParams& parameters);
~CefBrowserMainParts() override; ~AlloyBrowserMainParts() override;
int PreEarlyInitialization() override; int PreEarlyInitialization() override;
void ToolkitInitialized() override; void ToolkitInitialized() override;
@ -101,7 +101,7 @@ class CefBrowserMainParts : public content::BrowserMainParts {
#endif #endif
#endif // defined(TOOLKIT_VIEWS) #endif // defined(TOOLKIT_VIEWS)
DISALLOW_COPY_AND_ASSIGN(CefBrowserMainParts); DISALLOW_COPY_AND_ASSIGN(AlloyBrowserMainParts);
}; };
#endif // CEF_LIBCEF_BROWSER_BROWSER_MAIN_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_

View File

@ -6,11 +6,11 @@
#include <commctrl.h> #include <commctrl.h>
#include <windows.h> #include <windows.h>
#include "libcef/browser/browser_main.h" #include "libcef/browser/alloy/alloy_browser_main.h"
#include "base/logging.h" #include "base/logging.h"
void CefBrowserMainParts::PlatformInitialize() { void AlloyBrowserMainParts::PlatformInitialize() {
HRESULT res; HRESULT res;
// Initialize common controls. // Initialize common controls.

View File

@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/browser/content_browser_client.h" #include "libcef/browser/alloy/alloy_content_browser_client.h"
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
#include "include/cef_version.h" #include "include/cef_version.h"
#include "libcef/browser/alloy/alloy_browser_main.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/browser_info.h" #include "libcef/browser/browser_info.h"
#include "libcef/browser/browser_info_manager.h" #include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/browser_main.h"
#include "libcef/browser/browser_message_filter.h" #include "libcef/browser/browser_message_filter.h"
#include "libcef/browser/browser_platform_delegate.h" #include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
@ -31,10 +31,10 @@
#include "libcef/browser/ssl_info_impl.h" #include "libcef/browser/ssl_info_impl.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/browser/x509_certificate_impl.h" #include "libcef/browser/x509_certificate_impl.h"
#include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/cef_messages.h" #include "libcef/common/cef_messages.h"
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
#include "libcef/common/command_line_impl.h" #include "libcef/common/command_line_impl.h"
#include "libcef/common/content_client.h"
#include "libcef/common/extensions/extensions_util.h" #include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/net/scheme_registration.h" #include "libcef/common/net/scheme_registration.h"
#include "libcef/common/request_impl.h" #include "libcef/common/request_impl.h"
@ -386,7 +386,7 @@ breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost(
{ {
ANNOTATE_SCOPED_MEMORY_LEAK; ANNOTATE_SCOPED_MEMORY_LEAK;
// Uploads will only occur if a non-empty crash URL is specified in // Uploads will only occur if a non-empty crash URL is specified in
// CefMainDelegate::InitCrashReporter. // AlloyMainDelegate::InitCrashReporter.
breakpad::CrashHandlerHostLinux* crash_handler = breakpad::CrashHandlerHostLinux* crash_handler =
new breakpad::CrashHandlerHostLinux(process_type, dumps_path, new breakpad::CrashHandlerHostLinux(process_type, dumps_path,
true /* upload */); true /* upload */);
@ -533,30 +533,30 @@ void PopulateChromeFrameBinders(
} // namespace } // namespace
CefContentBrowserClient::CefContentBrowserClient() { AlloyContentBrowserClient::AlloyContentBrowserClient() {
plugin_service_filter_.reset(new CefPluginServiceFilter); plugin_service_filter_.reset(new CefPluginServiceFilter);
content::PluginServiceImpl::GetInstance()->SetFilter( content::PluginServiceImpl::GetInstance()->SetFilter(
plugin_service_filter_.get()); plugin_service_filter_.get());
} }
CefContentBrowserClient::~CefContentBrowserClient() {} AlloyContentBrowserClient::~AlloyContentBrowserClient() {}
// static // static
CefContentBrowserClient* CefContentBrowserClient::Get() { AlloyContentBrowserClient* AlloyContentBrowserClient::Get() {
if (!CefContentClient::Get()) if (!AlloyContentClient::Get())
return nullptr; return nullptr;
return static_cast<CefContentBrowserClient*>( return static_cast<AlloyContentBrowserClient*>(
CefContentClient::Get()->browser()); AlloyContentClient::Get()->browser());
} }
std::unique_ptr<content::BrowserMainParts> std::unique_ptr<content::BrowserMainParts>
CefContentBrowserClient::CreateBrowserMainParts( AlloyContentBrowserClient::CreateBrowserMainParts(
const content::MainFunctionParams& parameters) { const content::MainFunctionParams& parameters) {
browser_main_parts_ = new CefBrowserMainParts(parameters); browser_main_parts_ = new AlloyBrowserMainParts(parameters);
return base::WrapUnique(browser_main_parts_); return base::WrapUnique(browser_main_parts_);
} }
void CefContentBrowserClient::RenderProcessWillLaunch( void AlloyContentBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) { content::RenderProcessHost* host) {
const int id = host->GetID(); const int id = host->GetID();
Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
@ -582,7 +582,7 @@ void CefContentBrowserClient::RenderProcessWillLaunch(
->InitializeRenderer(host); ->InitializeRenderer(host);
} }
bool CefContentBrowserClient::ShouldUseProcessPerSite( bool AlloyContentBrowserClient::ShouldUseProcessPerSite(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,
const GURL& effective_url) { const GURL& effective_url) {
if (!extensions::ExtensionsEnabled()) if (!extensions::ExtensionsEnabled())
@ -611,7 +611,7 @@ bool CefContentBrowserClient::ShouldUseProcessPerSite(
// Based on // Based on
// ChromeContentBrowserClientExtensionsPart::DoesSiteRequireDedicatedProcess. // ChromeContentBrowserClientExtensionsPart::DoesSiteRequireDedicatedProcess.
bool CefContentBrowserClient::DoesSiteRequireDedicatedProcess( bool AlloyContentBrowserClient::DoesSiteRequireDedicatedProcess(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,
const GURL& effective_site_url) { const GURL& effective_site_url) {
if (!extensions::ExtensionsEnabled()) if (!extensions::ExtensionsEnabled())
@ -625,7 +625,7 @@ bool CefContentBrowserClient::DoesSiteRequireDedicatedProcess(
return extension != nullptr; return extension != nullptr;
} }
void CefContentBrowserClient::OverrideURLLoaderFactoryParams( void AlloyContentBrowserClient::OverrideURLLoaderFactoryParams(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,
const url::Origin& origin, const url::Origin& origin,
bool is_for_isolated_world, bool is_for_isolated_world,
@ -636,21 +636,21 @@ void CefContentBrowserClient::OverrideURLLoaderFactoryParams(
} }
} }
void CefContentBrowserClient::GetAdditionalWebUISchemes( void AlloyContentBrowserClient::GetAdditionalWebUISchemes(
std::vector<std::string>* additional_schemes) { std::vector<std::string>* additional_schemes) {
// Any schemes listed here are treated as WebUI schemes but do not get WebUI // Any schemes listed here are treated as WebUI schemes but do not get WebUI
// bindings. Also, view-source is allowed for these schemes. WebUI schemes // bindings. Also, view-source is allowed for these schemes. WebUI schemes
// will not be passed to HandleExternalProtocol. // will not be passed to HandleExternalProtocol.
} }
void CefContentBrowserClient::GetAdditionalViewSourceSchemes( void AlloyContentBrowserClient::GetAdditionalViewSourceSchemes(
std::vector<std::string>* additional_schemes) { std::vector<std::string>* additional_schemes) {
GetAdditionalWebUISchemes(additional_schemes); GetAdditionalWebUISchemes(additional_schemes);
additional_schemes->push_back(extensions::kExtensionScheme); additional_schemes->push_back(extensions::kExtensionScheme);
} }
void CefContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( void AlloyContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_allowed_schemes) { std::vector<std::string>* additional_allowed_schemes) {
ContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( ContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
additional_allowed_schemes); additional_allowed_schemes);
@ -658,12 +658,12 @@ void CefContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
additional_allowed_schemes->push_back(content::kChromeUIScheme); additional_allowed_schemes->push_back(content::kChromeUIScheme);
} }
bool CefContentBrowserClient::IsWebUIAllowedToMakeNetworkRequests( bool AlloyContentBrowserClient::IsWebUIAllowedToMakeNetworkRequests(
const url::Origin& origin) { const url::Origin& origin) {
return scheme::IsWebUIAllowedToMakeNetworkRequests(origin); return scheme::IsWebUIAllowedToMakeNetworkRequests(origin);
} }
bool CefContentBrowserClient::IsHandledURL(const GURL& url) { bool AlloyContentBrowserClient::IsHandledURL(const GURL& url) {
if (!url.is_valid()) if (!url.is_valid())
return false; return false;
const std::string& scheme = url.scheme(); const std::string& scheme = url.scheme();
@ -672,10 +672,10 @@ bool CefContentBrowserClient::IsHandledURL(const GURL& url) {
if (scheme::IsInternalHandledScheme(scheme)) if (scheme::IsInternalHandledScheme(scheme))
return true; return true;
return CefContentClient::Get()->HasCustomScheme(scheme); return AlloyContentClient::Get()->HasCustomScheme(scheme);
} }
void CefContentBrowserClient::SiteInstanceGotProcess( void AlloyContentBrowserClient::SiteInstanceGotProcess(
content::SiteInstance* site_instance) { content::SiteInstance* site_instance) {
if (!extensions::ExtensionsEnabled()) if (!extensions::ExtensionsEnabled())
return; return;
@ -699,7 +699,7 @@ void CefContentBrowserClient::SiteInstanceGotProcess(
site_instance->GetId())); site_instance->GetId()));
} }
void CefContentBrowserClient::SiteInstanceDeleting( void AlloyContentBrowserClient::SiteInstanceDeleting(
content::SiteInstance* site_instance) { content::SiteInstance* site_instance) {
if (!extensions::ExtensionsEnabled()) if (!extensions::ExtensionsEnabled())
return; return;
@ -731,7 +731,7 @@ void CefContentBrowserClient::SiteInstanceDeleting(
site_instance->GetId())); site_instance->GetId()));
} }
void CefContentBrowserClient::BindHostReceiverForRenderer( void AlloyContentBrowserClient::BindHostReceiverForRenderer(
content::RenderProcessHost* render_process_host, content::RenderProcessHost* render_process_host,
mojo::GenericPendingReceiver receiver) { mojo::GenericPendingReceiver receiver) {
if (auto host_receiver = receiver.As<spellcheck::mojom::SpellCheckHost>()) { if (auto host_receiver = receiver.As<spellcheck::mojom::SpellCheckHost>()) {
@ -751,7 +751,7 @@ void CefContentBrowserClient::BindHostReceiverForRenderer(
} }
base::Optional<service_manager::Manifest> base::Optional<service_manager::Manifest>
CefContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { AlloyContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
if (name == content::mojom::kBrowserServiceName) { if (name == content::mojom::kBrowserServiceName) {
return GetCefContentBrowserOverlayManifest(); return GetCefContentBrowserOverlayManifest();
} }
@ -759,7 +759,7 @@ CefContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
return base::nullopt; return base::nullopt;
} }
void CefContentBrowserClient::AppendExtraCommandLineSwitches( void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line, base::CommandLine* command_line,
int child_process_id) { int child_process_id) {
const base::CommandLine* browser_cmd = base::CommandLine::ForCurrentProcess(); const base::CommandLine* browser_cmd = base::CommandLine::ForCurrentProcess();
@ -867,7 +867,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
} }
#endif // defined(OS_LINUX) #endif // defined(OS_LINUX)
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app.get()) { if (app.get()) {
CefRefPtr<CefBrowserProcessHandler> handler = CefRefPtr<CefBrowserProcessHandler> handler =
app->GetBrowserProcessHandler(); app->GetBrowserProcessHandler();
@ -880,12 +880,12 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
} }
} }
std::string CefContentBrowserClient::GetApplicationLocale() { std::string AlloyContentBrowserClient::GetApplicationLocale() {
return g_browser_process->GetApplicationLocale(); return g_browser_process->GetApplicationLocale();
} }
scoped_refptr<network::SharedURLLoaderFactory> scoped_refptr<network::SharedURLLoaderFactory>
CefContentBrowserClient::GetSystemSharedURLLoaderFactory() { AlloyContentBrowserClient::GetSystemSharedURLLoaderFactory() {
DCHECK( DCHECK(
content::BrowserThread::CurrentlyOn(content::BrowserThread::UI) || content::BrowserThread::CurrentlyOn(content::BrowserThread::UI) ||
!content::BrowserThread::IsThreadInitialized(content::BrowserThread::UI)); !content::BrowserThread::IsThreadInitialized(content::BrowserThread::UI));
@ -898,23 +898,23 @@ CefContentBrowserClient::GetSystemSharedURLLoaderFactory() {
} }
network::mojom::NetworkContext* network::mojom::NetworkContext*
CefContentBrowserClient::GetSystemNetworkContext() { AlloyContentBrowserClient::GetSystemNetworkContext() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(SystemNetworkContextManager::GetInstance()); DCHECK(SystemNetworkContextManager::GetInstance());
return SystemNetworkContextManager::GetInstance()->GetContext(); return SystemNetworkContextManager::GetInstance()->GetContext();
} }
scoped_refptr<content::QuotaPermissionContext> scoped_refptr<content::QuotaPermissionContext>
CefContentBrowserClient::CreateQuotaPermissionContext() { AlloyContentBrowserClient::CreateQuotaPermissionContext() {
return new CefQuotaPermissionContext(); return new CefQuotaPermissionContext();
} }
content::MediaObserver* CefContentBrowserClient::GetMediaObserver() { content::MediaObserver* AlloyContentBrowserClient::GetMediaObserver() {
return CefMediaCaptureDevicesDispatcher::GetInstance(); return CefMediaCaptureDevicesDispatcher::GetInstance();
} }
content::SpeechRecognitionManagerDelegate* content::SpeechRecognitionManagerDelegate*
CefContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { AlloyContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
const base::CommandLine* command_line = const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess(); base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kEnableSpeechInput)) if (command_line->HasSwitch(switches::kEnableSpeechInput))
@ -924,7 +924,7 @@ CefContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
} }
content::GeneratedCodeCacheSettings content::GeneratedCodeCacheSettings
CefContentBrowserClient::GetGeneratedCodeCacheSettings( AlloyContentBrowserClient::GetGeneratedCodeCacheSettings(
content::BrowserContext* context) { content::BrowserContext* context) {
// If we pass 0 for size, disk_cache will pick a default size using the // If we pass 0 for size, disk_cache will pick a default size using the
// heuristics based on available disk size. These are implemented in // heuristics based on available disk size. These are implemented in
@ -934,7 +934,7 @@ CefContentBrowserClient::GetGeneratedCodeCacheSettings(
0 /* size */, cache_path); 0 /* size */, cache_path);
} }
void CefContentBrowserClient::AllowCertificateError( void AlloyContentBrowserClient::AllowCertificateError(
content::WebContents* web_contents, content::WebContents* web_contents,
int cert_error, int cert_error,
const net::SSLInfo& ssl_info, const net::SSLInfo& ssl_info,
@ -980,7 +980,7 @@ void CefContentBrowserClient::AllowCertificateError(
} }
} }
base::OnceClosure CefContentBrowserClient::SelectClientCertificate( base::OnceClosure AlloyContentBrowserClient::SelectClientCertificate(
content::WebContents* web_contents, content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info, net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs, net::ClientCertIdentityList client_certs,
@ -1021,7 +1021,7 @@ base::OnceClosure CefContentBrowserClient::SelectClientCertificate(
return base::OnceClosure(); return base::OnceClosure();
} }
bool CefContentBrowserClient::CanCreateWindow( bool AlloyContentBrowserClient::CanCreateWindow(
content::RenderFrameHost* opener, content::RenderFrameHost* opener,
const GURL& opener_url, const GURL& opener_url,
const GURL& opener_top_level_frame_url, const GURL& opener_top_level_frame_url,
@ -1043,7 +1043,7 @@ bool CefContentBrowserClient::CanCreateWindow(
user_gesture, opener_suppressed, no_javascript_access); user_gesture, opener_suppressed, no_javascript_access);
} }
void CefContentBrowserClient::OverrideWebkitPrefs( void AlloyContentBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* rvh, content::RenderViewHost* rvh,
content::WebPreferences* prefs) { content::WebPreferences* prefs) {
// Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr // Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr
@ -1056,16 +1056,16 @@ void CefContentBrowserClient::OverrideWebkitPrefs(
} }
} }
void CefContentBrowserClient::BrowserURLHandlerCreated( void AlloyContentBrowserClient::BrowserURLHandlerCreated(
content::BrowserURLHandler* handler) { content::BrowserURLHandler* handler) {
scheme::BrowserURLHandlerCreated(handler); scheme::BrowserURLHandlerCreated(handler);
} }
std::string CefContentBrowserClient::GetDefaultDownloadName() { std::string AlloyContentBrowserClient::GetDefaultDownloadName() {
return "download"; return "download";
} }
void CefContentBrowserClient::DidCreatePpapiPlugin( void AlloyContentBrowserClient::DidCreatePpapiPlugin(
content::BrowserPpapiHost* browser_host) { content::BrowserPpapiHost* browser_host) {
browser_host->GetPpapiHost()->AddHostFactoryFilter( browser_host->GetPpapiHost()->AddHostFactoryFilter(
std::unique_ptr<ppapi::host::HostFactory>( std::unique_ptr<ppapi::host::HostFactory>(
@ -1073,12 +1073,12 @@ void CefContentBrowserClient::DidCreatePpapiPlugin(
} }
content::DevToolsManagerDelegate* content::DevToolsManagerDelegate*
CefContentBrowserClient::GetDevToolsManagerDelegate() { AlloyContentBrowserClient::GetDevToolsManagerDelegate() {
return new CefDevToolsManagerDelegate(); return new CefDevToolsManagerDelegate();
} }
std::vector<std::unique_ptr<content::NavigationThrottle>> std::vector<std::unique_ptr<content::NavigationThrottle>>
CefContentBrowserClient::CreateThrottlesForNavigation( AlloyContentBrowserClient::CreateThrottlesForNavigation(
content::NavigationHandle* navigation_handle) { content::NavigationHandle* navigation_handle) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
@ -1111,7 +1111,7 @@ CefContentBrowserClient::CreateThrottlesForNavigation(
} }
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
CefContentBrowserClient::CreateURLLoaderThrottles( AlloyContentBrowserClient::CreateURLLoaderThrottles(
const network::ResourceRequest& request, const network::ResourceRequest& request,
content::BrowserContext* browser_context, content::BrowserContext* browser_context,
const base::RepeatingCallback<content::WebContents*()>& wc_getter, const base::RepeatingCallback<content::WebContents*()>& wc_getter,
@ -1136,7 +1136,7 @@ CefContentBrowserClient::CreateURLLoaderThrottles(
} }
#if defined(OS_LINUX) #if defined(OS_LINUX)
void CefContentBrowserClient::GetAdditionalMappedFilesForChildProcess( void AlloyContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line, const base::CommandLine& command_line,
int child_process_id, int child_process_id,
content::PosixFileDescriptorInfo* mappings) { content::PosixFileDescriptorInfo* mappings) {
@ -1148,7 +1148,7 @@ void CefContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
#endif // defined(OS_LINUX) #endif // defined(OS_LINUX)
#if defined(OS_WIN) #if defined(OS_WIN)
const wchar_t* CefContentBrowserClient::GetResourceDllName() { const wchar_t* AlloyContentBrowserClient::GetResourceDllName() {
static wchar_t file_path[MAX_PATH + 1] = {0}; static wchar_t file_path[MAX_PATH + 1] = {0};
if (file_path[0] == 0) { if (file_path[0] == 0) {
@ -1164,13 +1164,13 @@ const wchar_t* CefContentBrowserClient::GetResourceDllName() {
return file_path; return file_path;
} }
bool CefContentBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy, bool AlloyContentBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy,
RendererSpawnFlags flags) { RendererSpawnFlags flags) {
return true; return true;
} }
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
void CefContentBrowserClient::ExposeInterfacesToRenderer( void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
service_manager::BinderRegistry* registry, service_manager::BinderRegistry* registry,
blink::AssociatedInterfaceRegistry* associated_registry, blink::AssociatedInterfaceRegistry* associated_registry,
content::RenderProcessHost* host) { content::RenderProcessHost* host) {
@ -1179,7 +1179,7 @@ void CefContentBrowserClient::ExposeInterfacesToRenderer(
} }
std::unique_ptr<net::ClientCertStore> std::unique_ptr<net::ClientCertStore>
CefContentBrowserClient::CreateClientCertStore( AlloyContentBrowserClient::CreateClientCertStore(
content::BrowserContext* browser_context) { content::BrowserContext* browser_context) {
// Match the logic in ProfileNetworkContextService::CreateClientCertStore. // Match the logic in ProfileNetworkContextService::CreateClientCertStore.
#if defined(USE_NSS_CERTS) #if defined(USE_NSS_CERTS)
@ -1196,7 +1196,7 @@ CefContentBrowserClient::CreateClientCertStore(
} }
std::unique_ptr<content::LoginDelegate> std::unique_ptr<content::LoginDelegate>
CefContentBrowserClient::CreateLoginDelegate( AlloyContentBrowserClient::CreateLoginDelegate(
const net::AuthChallengeInfo& auth_info, const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents, content::WebContents* web_contents,
const content::GlobalRequestID& request_id, const content::GlobalRequestID& request_id,
@ -1210,7 +1210,7 @@ CefContentBrowserClient::CreateLoginDelegate(
std::move(auth_required_callback)); std::move(auth_required_callback));
} }
void CefContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
int frame_tree_node_id, int frame_tree_node_id,
NonNetworkURLLoaderFactoryMap* factories) { NonNetworkURLLoaderFactoryMap* factories) {
if (!extensions::ExtensionsEnabled()) if (!extensions::ExtensionsEnabled())
@ -1225,7 +1225,7 @@ void CefContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
!!extensions::WebViewGuest::FromWebContents(web_contents))); !!extensions::WebViewGuest::FromWebContents(web_contents)));
} }
void CefContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id, int render_process_id,
int render_frame_id, int render_frame_id,
NonNetworkURLLoaderFactoryMap* factories) { NonNetworkURLLoaderFactoryMap* factories) {
@ -1275,7 +1275,7 @@ void CefContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
} }
} }
bool CefContentBrowserClient::WillCreateURLLoaderFactory( bool AlloyContentBrowserClient::WillCreateURLLoaderFactory(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,
content::RenderFrameHost* frame, content::RenderFrameHost* frame,
int render_process_id, int render_process_id,
@ -1299,7 +1299,7 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory(
return true; return true;
} }
void CefContentBrowserClient::OnNetworkServiceCreated( void AlloyContentBrowserClient::OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) { network::mojom::NetworkService* network_service) {
DCHECK(g_browser_process); DCHECK(g_browser_process);
PrefService* local_state = g_browser_process->local_state(); PrefService* local_state = g_browser_process->local_state();
@ -1311,7 +1311,7 @@ void CefContentBrowserClient::OnNetworkServiceCreated(
network_service); network_service);
} }
void CefContentBrowserClient::ConfigureNetworkContextParams( void AlloyContentBrowserClient::ConfigureNetworkContextParams(
content::BrowserContext* context, content::BrowserContext* context,
bool in_memory, bool in_memory,
const base::FilePath& relative_partition_path, const base::FilePath& relative_partition_path,
@ -1329,7 +1329,7 @@ void CefContentBrowserClient::ConfigureNetworkContextParams(
// The sandbox may block read/write access from the NetworkService to // The sandbox may block read/write access from the NetworkService to
// directories that are not returned by this method. // directories that are not returned by this method.
std::vector<base::FilePath> std::vector<base::FilePath>
CefContentBrowserClient::GetNetworkContextsParentDirectory() { AlloyContentBrowserClient::GetNetworkContextsParentDirectory() {
base::FilePath user_data_path; base::FilePath user_data_path;
base::PathService::Get(chrome::DIR_USER_DATA, &user_data_path); base::PathService::Get(chrome::DIR_USER_DATA, &user_data_path);
DCHECK(!user_data_path.empty()); DCHECK(!user_data_path.empty());
@ -1345,7 +1345,7 @@ CefContentBrowserClient::GetNetworkContextsParentDirectory() {
return {user_data_path, root_cache_path}; return {user_data_path, root_cache_path};
} }
bool CefContentBrowserClient::HandleExternalProtocol( bool AlloyContentBrowserClient::HandleExternalProtocol(
const GURL& url, const GURL& url,
base::OnceCallback<content::WebContents*()> web_contents_getter, base::OnceCallback<content::WebContents*()> web_contents_getter,
int child_id, int child_id,
@ -1359,7 +1359,7 @@ bool CefContentBrowserClient::HandleExternalProtocol(
return false; return false;
} }
bool CefContentBrowserClient::HandleExternalProtocol( bool AlloyContentBrowserClient::HandleExternalProtocol(
content::WebContents::Getter web_contents_getter, content::WebContents::Getter web_contents_getter,
int frame_tree_node_id, int frame_tree_node_id,
content::NavigationUIData* navigation_data, content::NavigationUIData* navigation_data,
@ -1397,7 +1397,7 @@ bool CefContentBrowserClient::HandleExternalProtocol(
} }
std::unique_ptr<content::OverlayWindow> std::unique_ptr<content::OverlayWindow>
CefContentBrowserClient::CreateWindowForPictureInPicture( AlloyContentBrowserClient::CreateWindowForPictureInPicture(
content::PictureInPictureWindowController* controller) { content::PictureInPictureWindowController* controller) {
// Note: content::OverlayWindow::Create() is defined by platform-specific // Note: content::OverlayWindow::Create() is defined by platform-specific
// implementation in chrome/browser/ui/views. This layering hack, which goes // implementation in chrome/browser/ui/views. This layering hack, which goes
@ -1408,7 +1408,7 @@ CefContentBrowserClient::CreateWindowForPictureInPicture(
return content::OverlayWindow::Create(controller); return content::OverlayWindow::Create(controller);
} }
void CefContentBrowserClient::RegisterBrowserInterfaceBindersForFrame( void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) { mojo::BinderMapWithContext<content::RenderFrameHost*>* map) {
PopulateChromeFrameBinders(map); PopulateChromeFrameBinders(map);
@ -1438,25 +1438,25 @@ void CefContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
} }
base::FilePath base::FilePath
CefContentBrowserClient::GetSandboxedStorageServiceDataDirectory() { AlloyContentBrowserClient::GetSandboxedStorageServiceDataDirectory() {
return GetRootCachePath(); return GetRootCachePath();
} }
std::string CefContentBrowserClient::GetProduct() { std::string AlloyContentBrowserClient::GetProduct() {
// Match the logic in chrome_content_browser_client.cc GetProduct(). // Match the logic in chrome_content_browser_client.cc GetProduct().
return ::GetProduct(); return ::GetProduct();
} }
std::string CefContentBrowserClient::GetChromeProduct() { std::string AlloyContentBrowserClient::GetChromeProduct() {
return version_info::GetProductNameAndVersionForUserAgent(); return version_info::GetProductNameAndVersionForUserAgent();
} }
std::string CefContentBrowserClient::GetUserAgent() { std::string AlloyContentBrowserClient::GetUserAgent() {
// Match the logic in chrome_content_browser_client.cc GetUserAgent(). // Match the logic in chrome_content_browser_client.cc GetUserAgent().
return ::GetUserAgent(); return ::GetUserAgent();
} }
blink::UserAgentMetadata CefContentBrowserClient::GetUserAgentMetadata() { blink::UserAgentMetadata AlloyContentBrowserClient::GetUserAgentMetadata() {
blink::UserAgentMetadata metadata; blink::UserAgentMetadata metadata;
metadata.brand_version_list = {blink::UserAgentBrandVersion{ metadata.brand_version_list = {blink::UserAgentBrandVersion{
@ -1472,7 +1472,7 @@ blink::UserAgentMetadata CefContentBrowserClient::GetUserAgentMetadata() {
} }
base::flat_set<std::string> base::flat_set<std::string>
CefContentBrowserClient::GetPluginMimeTypesWithExternalHandlers( AlloyContentBrowserClient::GetPluginMimeTypesWithExternalHandlers(
content::BrowserContext* browser_context) { content::BrowserContext* browser_context) {
base::flat_set<std::string> mime_types; base::flat_set<std::string> mime_types;
auto map = PluginUtils::GetMimeTypeToExtensionIdMap(browser_context); auto map = PluginUtils::GetMimeTypeToExtensionIdMap(browser_context);
@ -1481,31 +1481,31 @@ CefContentBrowserClient::GetPluginMimeTypesWithExternalHandlers(
return mime_types; return mime_types;
} }
CefRefPtr<CefRequestContextImpl> CefContentBrowserClient::request_context() CefRefPtr<CefRequestContextImpl> AlloyContentBrowserClient::request_context()
const { const {
return browser_main_parts_->request_context(); return browser_main_parts_->request_context();
} }
CefDevToolsDelegate* CefContentBrowserClient::devtools_delegate() const { CefDevToolsDelegate* AlloyContentBrowserClient::devtools_delegate() const {
return browser_main_parts_->devtools_delegate(); return browser_main_parts_->devtools_delegate();
} }
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
CefContentBrowserClient::background_task_runner() const { AlloyContentBrowserClient::background_task_runner() const {
return browser_main_parts_->background_task_runner(); return browser_main_parts_->background_task_runner();
} }
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
CefContentBrowserClient::user_visible_task_runner() const { AlloyContentBrowserClient::user_visible_task_runner() const {
return browser_main_parts_->user_visible_task_runner(); return browser_main_parts_->user_visible_task_runner();
} }
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
CefContentBrowserClient::user_blocking_task_runner() const { AlloyContentBrowserClient::user_blocking_task_runner() const {
return browser_main_parts_->user_blocking_task_runner(); return browser_main_parts_->user_blocking_task_runner();
} }
const extensions::Extension* CefContentBrowserClient::GetExtension( const extensions::Extension* AlloyContentBrowserClient::GetExtension(
content::SiteInstance* site_instance) { content::SiteInstance* site_instance) {
extensions::ExtensionRegistry* registry = extensions::ExtensionRegistry* registry =
extensions::ExtensionRegistry::Get(site_instance->GetBrowserContext()); extensions::ExtensionRegistry::Get(site_instance->GetBrowserContext());

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_ #ifndef CEF_LIBCEF_BROWSER_ALLOY_ALLOY_CONTENT_BROWSER_CLIENT_H_
#define CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_ #define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_CONTENT_BROWSER_CLIENT_H_
#pragma once #pragma once
#include <string> #include <string>
@ -18,7 +18,7 @@
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
class CefBrowserMainParts; class AlloyBrowserMainParts;
class CefDevToolsDelegate; class CefDevToolsDelegate;
namespace content { namespace content {
@ -30,13 +30,13 @@ namespace extensions {
class Extension; class Extension;
} }
class CefContentBrowserClient : public content::ContentBrowserClient { class AlloyContentBrowserClient : public content::ContentBrowserClient {
public: public:
CefContentBrowserClient(); AlloyContentBrowserClient();
~CefContentBrowserClient() override; ~AlloyContentBrowserClient() override;
// Returns the singleton CefContentBrowserClient instance. // Returns the singleton AlloyContentBrowserClient instance.
static CefContentBrowserClient* Get(); static AlloyContentBrowserClient* Get();
// ContentBrowserClient implementation. // ContentBrowserClient implementation.
std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts( std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(
@ -224,9 +224,9 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
const extensions::Extension* GetExtension( const extensions::Extension* GetExtension(
content::SiteInstance* site_instance); content::SiteInstance* site_instance);
CefBrowserMainParts* browser_main_parts_ = nullptr; AlloyBrowserMainParts* browser_main_parts_ = nullptr;
std::unique_ptr<content::PluginServiceFilter> plugin_service_filter_; std::unique_ptr<content::PluginServiceFilter> plugin_service_filter_;
}; };
#endif // CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_CONTENT_BROWSER_CLIENT_H_

View File

@ -3,10 +3,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/browser/chrome_browser_process_stub.h" #include "libcef/browser/alloy/chrome_browser_process_alloy.h"
#include "libcef/browser/alloy/chrome_profile_manager_alloy.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/chrome_profile_manager_stub.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/prefs/browser_prefs.h" #include "libcef/browser/prefs/browser_prefs.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
@ -27,17 +27,17 @@
#include "services/network/public/cpp/network_switches.h" #include "services/network/public/cpp/network_switches.h"
#include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/shared_url_loader_factory.h"
ChromeBrowserProcessStub::ChromeBrowserProcessStub() ChromeBrowserProcessAlloy::ChromeBrowserProcessAlloy()
: initialized_(false), : initialized_(false),
context_initialized_(false), context_initialized_(false),
shutdown_(false), shutdown_(false),
locale_("en-US") {} locale_("en-US") {}
ChromeBrowserProcessStub::~ChromeBrowserProcessStub() { ChromeBrowserProcessAlloy::~ChromeBrowserProcessAlloy() {
DCHECK((!initialized_ && !context_initialized_) || shutdown_); DCHECK((!initialized_ && !context_initialized_) || shutdown_);
} }
void ChromeBrowserProcessStub::Initialize() { void ChromeBrowserProcessAlloy::Initialize() {
DCHECK(!initialized_); DCHECK(!initialized_);
DCHECK(!context_initialized_); DCHECK(!context_initialized_);
DCHECK(!shutdown_); DCHECK(!shutdown_);
@ -49,7 +49,7 @@ void ChromeBrowserProcessStub::Initialize() {
initialized_ = true; initialized_ = true;
} }
void ChromeBrowserProcessStub::OnContextInitialized() { void ChromeBrowserProcessAlloy::OnContextInitialized() {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
DCHECK(initialized_); DCHECK(initialized_);
DCHECK(!context_initialized_); DCHECK(!context_initialized_);
@ -57,12 +57,12 @@ void ChromeBrowserProcessStub::OnContextInitialized() {
// Must be created after the NotificationService. // Must be created after the NotificationService.
print_job_manager_.reset(new printing::PrintJobManager()); print_job_manager_.reset(new printing::PrintJobManager());
profile_manager_.reset(new ChromeProfileManagerStub()); profile_manager_.reset(new ChromeProfileManagerAlloy());
event_router_forwarder_ = new extensions::EventRouterForwarder(); event_router_forwarder_ = new extensions::EventRouterForwarder();
context_initialized_ = true; context_initialized_ = true;
} }
void ChromeBrowserProcessStub::CleanupOnUIThread() { void ChromeBrowserProcessAlloy::CleanupOnUIThread() {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
DCHECK(initialized_); DCHECK(initialized_);
DCHECK(context_initialized_); DCHECK(context_initialized_);
@ -107,54 +107,54 @@ void ChromeBrowserProcessStub::CleanupOnUIThread() {
shutdown_ = true; shutdown_ = true;
} }
void ChromeBrowserProcessStub::EndSession() { void ChromeBrowserProcessAlloy::EndSession() {
NOTREACHED(); NOTREACHED();
} }
void ChromeBrowserProcessStub::FlushLocalStateAndReply( void ChromeBrowserProcessAlloy::FlushLocalStateAndReply(
base::OnceClosure reply) { base::OnceClosure reply) {
NOTREACHED(); NOTREACHED();
} }
metrics_services_manager::MetricsServicesManager* metrics_services_manager::MetricsServicesManager*
ChromeBrowserProcessStub::GetMetricsServicesManager() { ChromeBrowserProcessAlloy::GetMetricsServicesManager() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
metrics::MetricsService* ChromeBrowserProcessStub::metrics_service() { metrics::MetricsService* ChromeBrowserProcessAlloy::metrics_service() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
rappor::RapporServiceImpl* ChromeBrowserProcessStub::rappor_service() { rappor::RapporServiceImpl* ChromeBrowserProcessAlloy::rappor_service() {
// Called from PluginInfoHostImpl::ReportMetrics. // Called from PluginInfoHostImpl::ReportMetrics.
return nullptr; return nullptr;
} }
SystemNetworkContextManager* SystemNetworkContextManager*
ChromeBrowserProcessStub::system_network_context_manager() { ChromeBrowserProcessAlloy::system_network_context_manager() {
DCHECK(SystemNetworkContextManager::GetInstance()); DCHECK(SystemNetworkContextManager::GetInstance());
return SystemNetworkContextManager::GetInstance(); return SystemNetworkContextManager::GetInstance();
} }
network::NetworkQualityTracker* network::NetworkQualityTracker*
ChromeBrowserProcessStub::network_quality_tracker() { ChromeBrowserProcessAlloy::network_quality_tracker() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
WatchDogThread* ChromeBrowserProcessStub::watchdog_thread() { WatchDogThread* ChromeBrowserProcessAlloy::watchdog_thread() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
ProfileManager* ChromeBrowserProcessStub::profile_manager() { ProfileManager* ChromeBrowserProcessAlloy::profile_manager() {
DCHECK(context_initialized_); DCHECK(context_initialized_);
return profile_manager_.get(); return profile_manager_.get();
} }
PrefService* ChromeBrowserProcessStub::local_state() { PrefService* ChromeBrowserProcessAlloy::local_state() {
DCHECK(initialized_); DCHECK(initialized_);
if (!local_state_) { if (!local_state_) {
// Use a location that is shared by all request contexts. // Use a location that is shared by all request contexts.
@ -173,40 +173,40 @@ PrefService* ChromeBrowserProcessStub::local_state() {
} }
scoped_refptr<network::SharedURLLoaderFactory> scoped_refptr<network::SharedURLLoaderFactory>
ChromeBrowserProcessStub::shared_url_loader_factory() { ChromeBrowserProcessAlloy::shared_url_loader_factory() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
variations::VariationsService* ChromeBrowserProcessStub::variations_service() { variations::VariationsService* ChromeBrowserProcessAlloy::variations_service() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
BrowserProcessPlatformPart* ChromeBrowserProcessStub::platform_part() { BrowserProcessPlatformPart* ChromeBrowserProcessAlloy::platform_part() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
extensions::EventRouterForwarder* extensions::EventRouterForwarder*
ChromeBrowserProcessStub::extension_event_router_forwarder() { ChromeBrowserProcessAlloy::extension_event_router_forwarder() {
DCHECK(context_initialized_); DCHECK(context_initialized_);
return event_router_forwarder_.get(); return event_router_forwarder_.get();
} }
NotificationUIManager* ChromeBrowserProcessStub::notification_ui_manager() { NotificationUIManager* ChromeBrowserProcessAlloy::notification_ui_manager() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
NotificationPlatformBridge* NotificationPlatformBridge*
ChromeBrowserProcessStub::notification_platform_bridge() { ChromeBrowserProcessAlloy::notification_platform_bridge() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
policy::ChromeBrowserPolicyConnector* policy::ChromeBrowserPolicyConnector*
ChromeBrowserProcessStub::browser_policy_connector() { ChromeBrowserProcessAlloy::browser_policy_connector() {
if (!browser_policy_connector_) { if (!browser_policy_connector_) {
browser_policy_connector_ = browser_policy_connector_ =
std::make_unique<policy::ChromeBrowserPolicyConnector>(); std::make_unique<policy::ChromeBrowserPolicyConnector>();
@ -214,40 +214,40 @@ ChromeBrowserProcessStub::browser_policy_connector() {
return browser_policy_connector_.get(); return browser_policy_connector_.get();
} }
policy::PolicyService* ChromeBrowserProcessStub::policy_service() { policy::PolicyService* ChromeBrowserProcessAlloy::policy_service() {
return browser_policy_connector()->GetPolicyService(); return browser_policy_connector()->GetPolicyService();
} }
IconManager* ChromeBrowserProcessStub::icon_manager() { IconManager* ChromeBrowserProcessAlloy::icon_manager() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
GpuModeManager* ChromeBrowserProcessStub::gpu_mode_manager() { GpuModeManager* ChromeBrowserProcessAlloy::gpu_mode_manager() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
void ChromeBrowserProcessStub::CreateDevToolsProtocolHandler() { void ChromeBrowserProcessAlloy::CreateDevToolsProtocolHandler() {
NOTREACHED(); NOTREACHED();
} }
void ChromeBrowserProcessStub::CreateDevToolsAutoOpener() { void ChromeBrowserProcessAlloy::CreateDevToolsAutoOpener() {
NOTREACHED(); NOTREACHED();
} }
bool ChromeBrowserProcessStub::IsShuttingDown() { bool ChromeBrowserProcessAlloy::IsShuttingDown() {
NOTREACHED(); NOTREACHED();
return false; return false;
} }
printing::PrintJobManager* ChromeBrowserProcessStub::print_job_manager() { printing::PrintJobManager* ChromeBrowserProcessAlloy::print_job_manager() {
DCHECK(context_initialized_); DCHECK(context_initialized_);
return print_job_manager_.get(); return print_job_manager_.get();
} }
printing::PrintPreviewDialogController* printing::PrintPreviewDialogController*
ChromeBrowserProcessStub::print_preview_dialog_controller() { ChromeBrowserProcessAlloy::print_preview_dialog_controller() {
if (!print_preview_dialog_controller_.get()) { if (!print_preview_dialog_controller_.get()) {
print_preview_dialog_controller_ = print_preview_dialog_controller_ =
new printing::PrintPreviewDialogController(); new printing::PrintPreviewDialogController();
@ -256,7 +256,7 @@ ChromeBrowserProcessStub::print_preview_dialog_controller() {
} }
printing::BackgroundPrintingManager* printing::BackgroundPrintingManager*
ChromeBrowserProcessStub::background_printing_manager() { ChromeBrowserProcessAlloy::background_printing_manager() {
if (!background_printing_manager_.get()) { if (!background_printing_manager_.get()) {
background_printing_manager_.reset( background_printing_manager_.reset(
new printing::BackgroundPrintingManager()); new printing::BackgroundPrintingManager());
@ -265,113 +265,114 @@ ChromeBrowserProcessStub::background_printing_manager() {
} }
IntranetRedirectDetector* IntranetRedirectDetector*
ChromeBrowserProcessStub::intranet_redirect_detector() { ChromeBrowserProcessAlloy::intranet_redirect_detector() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
const std::string& ChromeBrowserProcessStub::GetApplicationLocale() { const std::string& ChromeBrowserProcessAlloy::GetApplicationLocale() {
DCHECK(!locale_.empty()); DCHECK(!locale_.empty());
return locale_; return locale_;
} }
void ChromeBrowserProcessStub::SetApplicationLocale(const std::string& locale) { void ChromeBrowserProcessAlloy::SetApplicationLocale(
const std::string& locale) {
locale_ = locale; locale_ = locale;
} }
DownloadStatusUpdater* ChromeBrowserProcessStub::download_status_updater() { DownloadStatusUpdater* ChromeBrowserProcessAlloy::download_status_updater() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
DownloadRequestLimiter* ChromeBrowserProcessStub::download_request_limiter() { DownloadRequestLimiter* ChromeBrowserProcessAlloy::download_request_limiter() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
#if BUILDFLAG(ENABLE_BACKGROUND_MODE) #if BUILDFLAG(ENABLE_BACKGROUND_MODE)
BackgroundModeManager* ChromeBrowserProcessStub::background_mode_manager() { BackgroundModeManager* ChromeBrowserProcessAlloy::background_mode_manager() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
void ChromeBrowserProcessStub::set_background_mode_manager_for_test( void ChromeBrowserProcessAlloy::set_background_mode_manager_for_test(
std::unique_ptr<BackgroundModeManager> manager) { std::unique_ptr<BackgroundModeManager> manager) {
NOTREACHED(); NOTREACHED();
} }
#endif #endif
StatusTray* ChromeBrowserProcessStub::status_tray() { StatusTray* ChromeBrowserProcessAlloy::status_tray() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
safe_browsing::SafeBrowsingService* safe_browsing::SafeBrowsingService*
ChromeBrowserProcessStub::safe_browsing_service() { ChromeBrowserProcessAlloy::safe_browsing_service() {
return nullptr; return nullptr;
} }
subresource_filter::RulesetService* subresource_filter::RulesetService*
ChromeBrowserProcessStub::subresource_filter_ruleset_service() { ChromeBrowserProcessAlloy::subresource_filter_ruleset_service() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
optimization_guide::OptimizationGuideService* optimization_guide::OptimizationGuideService*
ChromeBrowserProcessStub::optimization_guide_service() { ChromeBrowserProcessAlloy::optimization_guide_service() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
StartupData* ChromeBrowserProcessStub::startup_data() { StartupData* ChromeBrowserProcessAlloy::startup_data() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
void ChromeBrowserProcessStub::StartAutoupdateTimer() {} void ChromeBrowserProcessAlloy::StartAutoupdateTimer() {}
#endif #endif
component_updater::ComponentUpdateService* component_updater::ComponentUpdateService*
ChromeBrowserProcessStub::component_updater() { ChromeBrowserProcessAlloy::component_updater() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
MediaFileSystemRegistry* MediaFileSystemRegistry*
ChromeBrowserProcessStub::media_file_system_registry() { ChromeBrowserProcessAlloy::media_file_system_registry() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
WebRtcLogUploader* ChromeBrowserProcessStub::webrtc_log_uploader() { WebRtcLogUploader* ChromeBrowserProcessAlloy::webrtc_log_uploader() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
network_time::NetworkTimeTracker* network_time::NetworkTimeTracker*
ChromeBrowserProcessStub::network_time_tracker() { ChromeBrowserProcessAlloy::network_time_tracker() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
gcm::GCMDriver* ChromeBrowserProcessStub::gcm_driver() { gcm::GCMDriver* ChromeBrowserProcessAlloy::gcm_driver() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
resource_coordinator::TabManager* ChromeBrowserProcessStub::GetTabManager() { resource_coordinator::TabManager* ChromeBrowserProcessAlloy::GetTabManager() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
resource_coordinator::ResourceCoordinatorParts* resource_coordinator::ResourceCoordinatorParts*
ChromeBrowserProcessStub::resource_coordinator_parts() { ChromeBrowserProcessAlloy::resource_coordinator_parts() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
BuildState* ChromeBrowserProcessStub::GetBuildState() { BuildState* ChromeBrowserProcessAlloy::GetBuildState() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }

View File

@ -6,8 +6,8 @@
// This file provides a stub implementation of Chrome's BrowserProcess object // This file provides a stub implementation of Chrome's BrowserProcess object
// for use as an interop layer between CEF and files that live in chrome/. // for use as an interop layer between CEF and files that live in chrome/.
#ifndef CEF_LIBCEF_BROWSER_CHROME_BROWSER_PROCESS_STUB_H_ #ifndef CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_
#define CEF_LIBCEF_BROWSER_CHROME_BROWSER_PROCESS_STUB_H_ #define CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_
#include <memory> #include <memory>
#include <string> #include <string>
@ -18,7 +18,7 @@
#include "chrome/browser/extensions/event_router_forwarder.h" #include "chrome/browser/extensions/event_router_forwarder.h"
#include "media/media_buildflags.h" #include "media/media_buildflags.h"
class ChromeProfileManagerStub; class ChromeProfileManagerAlloy;
class BackgroundModeManager { class BackgroundModeManager {
public: public:
@ -29,10 +29,10 @@ class BackgroundModeManager {
DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager); DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager);
}; };
class ChromeBrowserProcessStub : public BrowserProcess { class ChromeBrowserProcessAlloy : public BrowserProcess {
public: public:
ChromeBrowserProcessStub(); ChromeBrowserProcessAlloy();
~ChromeBrowserProcessStub() override; ~ChromeBrowserProcessAlloy() override;
void Initialize(); void Initialize();
void OnContextInitialized(); void OnContextInitialized();
@ -107,7 +107,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
std::string locale_; std::string locale_;
std::unique_ptr<printing::PrintJobManager> print_job_manager_; std::unique_ptr<printing::PrintJobManager> print_job_manager_;
std::unique_ptr<ChromeProfileManagerStub> profile_manager_; std::unique_ptr<ChromeProfileManagerAlloy> profile_manager_;
scoped_refptr<extensions::EventRouterForwarder> event_router_forwarder_; scoped_refptr<extensions::EventRouterForwarder> event_router_forwarder_;
scoped_refptr<printing::PrintPreviewDialogController> scoped_refptr<printing::PrintPreviewDialogController>
print_preview_dialog_controller_; print_preview_dialog_controller_;
@ -119,7 +119,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
browser_policy_connector_; browser_policy_connector_;
std::unique_ptr<base::FieldTrialList> field_trial_list_; std::unique_ptr<base::FieldTrialList> field_trial_list_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProcessStub); DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProcessAlloy);
}; };
#endif // CEF_LIBCEF_BROWSER_CHROME_BROWSER_PROCESS_STUB_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_

View File

@ -3,7 +3,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/browser/chrome_profile_stub.h" #include "libcef/browser/alloy/chrome_profile_alloy.h"
#include "components/variations/variations_client.h" #include "components/variations/variations_client.h"
#include "components/variations/variations_http_header_provider.h" #include "components/variations/variations_http_header_provider.h"
@ -34,144 +34,145 @@ class CefVariationsClient : public variations::VariationsClient {
} // namespace } // namespace
ChromeProfileStub::ChromeProfileStub() {} ChromeProfileAlloy::ChromeProfileAlloy() {}
ChromeProfileStub::~ChromeProfileStub() {} ChromeProfileAlloy::~ChromeProfileAlloy() {}
bool ChromeProfileStub::IsOffTheRecord() { bool ChromeProfileAlloy::IsOffTheRecord() {
return false; return false;
} }
bool ChromeProfileStub::IsOffTheRecord() const { bool ChromeProfileAlloy::IsOffTheRecord() const {
return false; return false;
} }
const Profile::OTRProfileID& ChromeProfileStub::GetOTRProfileID() const { const Profile::OTRProfileID& ChromeProfileAlloy::GetOTRProfileID() const {
NOTREACHED(); NOTREACHED();
static base::NoDestructor<Profile::OTRProfileID> otr_profile_id( static base::NoDestructor<Profile::OTRProfileID> otr_profile_id(
"ProfileImp::NoOTRProfileID"); "ProfileImp::NoOTRProfileID");
return *otr_profile_id; return *otr_profile_id;
} }
variations::VariationsClient* ChromeProfileStub::GetVariationsClient() { variations::VariationsClient* ChromeProfileAlloy::GetVariationsClient() {
if (!variations_client_) if (!variations_client_)
variations_client_ = std::make_unique<CefVariationsClient>(this); variations_client_ = std::make_unique<CefVariationsClient>(this);
return variations_client_.get(); return variations_client_.get();
} }
scoped_refptr<base::SequencedTaskRunner> ChromeProfileStub::GetIOTaskRunner() { scoped_refptr<base::SequencedTaskRunner> ChromeProfileAlloy::GetIOTaskRunner() {
NOTREACHED(); NOTREACHED();
return scoped_refptr<base::SequencedTaskRunner>(); return scoped_refptr<base::SequencedTaskRunner>();
} }
std::string ChromeProfileStub::GetProfileUserName() const { std::string ChromeProfileAlloy::GetProfileUserName() const {
NOTREACHED(); NOTREACHED();
return std::string(); return std::string();
} }
Profile::ProfileType ChromeProfileStub::GetProfileType() const { Profile::ProfileType ChromeProfileAlloy::GetProfileType() const {
return REGULAR_PROFILE; return REGULAR_PROFILE;
} }
Profile* ChromeProfileStub::GetOffTheRecordProfile( Profile* ChromeProfileAlloy::GetOffTheRecordProfile(
const Profile::OTRProfileID& otr_profile_id) { const Profile::OTRProfileID& otr_profile_id) {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
std::vector<Profile*> ChromeProfileStub::GetAllOffTheRecordProfiles() { std::vector<Profile*> ChromeProfileAlloy::GetAllOffTheRecordProfiles() {
NOTREACHED(); NOTREACHED();
return {}; return {};
} }
void ChromeProfileStub::DestroyOffTheRecordProfile(Profile* otr_profile) { void ChromeProfileAlloy::DestroyOffTheRecordProfile(Profile* otr_profile) {
NOTREACHED(); NOTREACHED();
} }
bool ChromeProfileStub::HasOffTheRecordProfile( bool ChromeProfileAlloy::HasOffTheRecordProfile(
const Profile::OTRProfileID& otr_profile_id) { const Profile::OTRProfileID& otr_profile_id) {
return false; return false;
} }
bool ChromeProfileStub::HasAnyOffTheRecordProfile() { bool ChromeProfileAlloy::HasAnyOffTheRecordProfile() {
return false; return false;
} }
Profile* ChromeProfileStub::GetOriginalProfile() { Profile* ChromeProfileAlloy::GetOriginalProfile() {
return this; return this;
} }
const Profile* ChromeProfileStub::GetOriginalProfile() const { const Profile* ChromeProfileAlloy::GetOriginalProfile() const {
return this; return this;
} }
bool ChromeProfileStub::IsSupervised() const { bool ChromeProfileAlloy::IsSupervised() const {
return false; return false;
} }
bool ChromeProfileStub::IsChild() const { bool ChromeProfileAlloy::IsChild() const {
return false; return false;
} }
bool ChromeProfileStub::IsLegacySupervised() const { bool ChromeProfileAlloy::IsLegacySupervised() const {
return false; return false;
} }
ExtensionSpecialStoragePolicy* ExtensionSpecialStoragePolicy*
ChromeProfileStub::GetExtensionSpecialStoragePolicy() { ChromeProfileAlloy::GetExtensionSpecialStoragePolicy() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
PrefService* ChromeProfileStub::GetOffTheRecordPrefs() { PrefService* ChromeProfileAlloy::GetOffTheRecordPrefs() {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
bool ChromeProfileStub::IsSameProfile(Profile* profile) { bool ChromeProfileAlloy::IsSameProfile(Profile* profile) {
NOTREACHED(); NOTREACHED();
return false; return false;
} }
base::Time ChromeProfileStub::GetStartTime() const { base::Time ChromeProfileAlloy::GetStartTime() const {
NOTREACHED(); NOTREACHED();
return base::Time(); return base::Time();
} }
base::FilePath ChromeProfileStub::last_selected_directory() { base::FilePath ChromeProfileAlloy::last_selected_directory() {
NOTREACHED(); NOTREACHED();
return base::FilePath(); return base::FilePath();
} }
void ChromeProfileStub::set_last_selected_directory( void ChromeProfileAlloy::set_last_selected_directory(
const base::FilePath& path) { const base::FilePath& path) {
NOTREACHED(); NOTREACHED();
} }
GURL ChromeProfileStub::GetHomePage() { GURL ChromeProfileAlloy::GetHomePage() {
NOTREACHED(); NOTREACHED();
return GURL(); return GURL();
} }
bool ChromeProfileStub::WasCreatedByVersionOrLater(const std::string& version) { bool ChromeProfileAlloy::WasCreatedByVersionOrLater(
const std::string& version) {
NOTREACHED(); NOTREACHED();
return false; return false;
} }
void ChromeProfileStub::SetExitType(ExitType exit_type) { void ChromeProfileAlloy::SetExitType(ExitType exit_type) {
NOTREACHED(); NOTREACHED();
} }
Profile::ExitType ChromeProfileStub::GetLastSessionExitType() { Profile::ExitType ChromeProfileAlloy::GetLastSessionExitType() {
NOTREACHED(); NOTREACHED();
return EXIT_NORMAL; return EXIT_NORMAL;
} }
base::Time ChromeProfileStub::GetCreationTime() const { base::Time ChromeProfileAlloy::GetCreationTime() const {
NOTREACHED(); NOTREACHED();
return base::Time(); return base::Time();
} }
void ChromeProfileStub::SetCreationTimeForTesting(base::Time creation_time) { void ChromeProfileAlloy::SetCreationTimeForTesting(base::Time creation_time) {
NOTREACHED(); NOTREACHED();
} }

View File

@ -5,18 +5,18 @@
// This class gathers state related to a single user profile. // This class gathers state related to a single user profile.
#ifndef CEF_LIBCEF_BROWSER_CHROME_PROFILE_STUB_H_ #ifndef CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_
#define CEF_LIBCEF_BROWSER_CHROME_PROFILE_STUB_H_ #define CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
// This file provides a stub implementation of Chrome's Profile object for use // This file provides a stub implementation of Chrome's Profile object for use
// as an interop layer between CEF and files that live in chrome/. // as an interop layer between CEF and files that live in chrome/.
class ChromeProfileStub : public Profile { class ChromeProfileAlloy : public Profile {
public: public:
ChromeProfileStub(); ChromeProfileAlloy();
~ChromeProfileStub() override; ~ChromeProfileAlloy() override;
protected: protected:
// Profile methods. // Profile methods.
@ -55,7 +55,7 @@ class ChromeProfileStub : public Profile {
private: private:
std::unique_ptr<variations::VariationsClient> variations_client_; std::unique_ptr<variations::VariationsClient> variations_client_;
DISALLOW_COPY_AND_ASSIGN(ChromeProfileStub); DISALLOW_COPY_AND_ASSIGN(ChromeProfileAlloy);
}; };
#endif // CEF_LIBCEF_BROWSER_CHROME_PROFILE_STUB_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_

View File

@ -3,10 +3,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/browser/chrome_profile_manager_stub.h" #include "libcef/browser/alloy/chrome_profile_manager_alloy.h"
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/content_browser_client.h"
namespace { namespace {
@ -22,17 +22,17 @@ namespace {
// determine that. // determine that.
CefBrowserContext* GetActiveBrowserContext() { CefBrowserContext* GetActiveBrowserContext() {
return static_cast<CefBrowserContext*>( return static_cast<CefBrowserContext*>(
CefContentBrowserClient::Get()->request_context()->GetBrowserContext()); AlloyContentBrowserClient::Get()->request_context()->GetBrowserContext());
} }
} // namespace } // namespace
ChromeProfileManagerStub::ChromeProfileManagerStub() ChromeProfileManagerAlloy::ChromeProfileManagerAlloy()
: ProfileManager(base::FilePath()) {} : ProfileManager(base::FilePath()) {}
ChromeProfileManagerStub::~ChromeProfileManagerStub() {} ChromeProfileManagerAlloy::~ChromeProfileManagerAlloy() {}
Profile* ChromeProfileManagerStub::GetProfile( Profile* ChromeProfileManagerAlloy::GetProfile(
const base::FilePath& profile_dir) { const base::FilePath& profile_dir) {
CefBrowserContext* browser_context = CefBrowserContext* browser_context =
CefBrowserContext::GetForCachePath(profile_dir); CefBrowserContext::GetForCachePath(profile_dir);
@ -48,14 +48,14 @@ Profile* ChromeProfileManagerStub::GetProfile(
return browser_context; return browser_context;
} }
bool ChromeProfileManagerStub::IsValidProfile(const void* profile) { bool ChromeProfileManagerAlloy::IsValidProfile(const void* profile) {
if (!profile) if (!profile)
return false; return false;
return !!CefBrowserContext::GetForContext( return !!CefBrowserContext::GetForContext(
reinterpret_cast<content::BrowserContext*>(const_cast<void*>(profile))); reinterpret_cast<content::BrowserContext*>(const_cast<void*>(profile)));
} }
Profile* ChromeProfileManagerStub::GetLastUsedProfile( Profile* ChromeProfileManagerAlloy::GetLastUsedProfile(
const base::FilePath& user_data_dir) { const base::FilePath& user_data_dir) {
// Override this method to avoid having to register prefs::kProfileLastUsed, // Override this method to avoid having to register prefs::kProfileLastUsed,
// usage of which doesn't make sense for CEF. // usage of which doesn't make sense for CEF.

View File

@ -6,22 +6,22 @@
// This file provides a stub implementation of Chrome's ProfileManager object // This file provides a stub implementation of Chrome's ProfileManager object
// for use as an interop layer between CEF and files that live in chrome/. // for use as an interop layer between CEF and files that live in chrome/.
#ifndef CEF_LIBCEF_BROWSER_CHROME_PROFILE_MANAGER_STUB_H_ #ifndef CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_MANAGER_ALLOY_H_
#define CEF_LIBCEF_BROWSER_CHROME_PROFILE_MANAGER_STUB_H_ #define CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_MANAGER_ALLOY_H_
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
class ChromeProfileManagerStub : public ProfileManager { class ChromeProfileManagerAlloy : public ProfileManager {
public: public:
ChromeProfileManagerStub(); ChromeProfileManagerAlloy();
~ChromeProfileManagerStub() override; ~ChromeProfileManagerAlloy() override;
Profile* GetProfile(const base::FilePath& profile_dir) override; Profile* GetProfile(const base::FilePath& profile_dir) override;
bool IsValidProfile(const void* profile) override; bool IsValidProfile(const void* profile) override;
Profile* GetLastUsedProfile(const base::FilePath& user_data_dir) override; Profile* GetLastUsedProfile(const base::FilePath& user_data_dir) override;
private: private:
DISALLOW_COPY_AND_ASSIGN(ChromeProfileManagerStub); DISALLOW_COPY_AND_ASSIGN(ChromeProfileManagerAlloy);
}; };
#endif // CEF_LIBCEF_BROWSER_CHROME_PROFILE_MANAGER_STUB_H_ #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_MANAGER_ALLOY_H_

View File

@ -7,7 +7,7 @@
#include <map> #include <map>
#include <utility> #include <utility>
#include "libcef/browser/content_browser_client.h" #include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/download_manager_delegate.h" #include "libcef/browser/download_manager_delegate.h"
#include "libcef/browser/extensions/extension_system.h" #include "libcef/browser/extensions/extension_system.h"
#include "libcef/browser/media_router/media_router_manager.h" #include "libcef/browser/media_router/media_router_manager.h"

View File

@ -9,7 +9,7 @@
#include <set> #include <set>
#include "include/cef_request_context_handler.h" #include "include/cef_request_context_handler.h"
#include "libcef/browser/chrome_profile_stub.h" #include "libcef/browser/alloy/chrome_profile_alloy.h"
#include "libcef/browser/request_context_handler_map.h" #include "libcef/browser/request_context_handler_map.h"
#include "libcef/browser/resource_context.h" #include "libcef/browser/resource_context.h"
@ -36,7 +36,7 @@
// BHI = CefBrowserHostImpl // BHI = CefBrowserHostImpl
// Implements the CefBrowser and CefBrowserHost interfaces which are exposed // Implements the CefBrowser and CefBrowserHost interfaces which are exposed
// to clients. References an RCI instance. Owns a WC. Life span is controlled // to clients. References an RCI instance. Owns a WC. Life span is controlled
// by client references and CefContentBrowserClient. // by client references and AlloyContentBrowserClient.
// //
// RCI = CefRequestContextImpl // RCI = CefRequestContextImpl
// Implements the CefRequestContext interface which is exposed to clients. // Implements the CefRequestContext interface which is exposed to clients.
@ -44,7 +44,8 @@
// //
// BC = CefBrowserContext // BC = CefBrowserContext
// Entry point from WC when using an isolated RCI. Owns the RC and creates the // Entry point from WC when using an isolated RCI. Owns the RC and creates the
// SPI indirectly. Owned by CefBrowserMainParts for the global context or RCI // SPI indirectly. Owned by AlloyBrowserMainParts for the global context or
RCI
// for non-global contexts. // for non-global contexts.
// //
// SPI = content::StoragePartitionImpl // SPI = content::StoragePartitionImpl
@ -63,7 +64,7 @@
// own = ownership (std::unique_ptr) // own = ownership (std::unique_ptr)
// ptr = raw pointer // ptr = raw pointer
// //
// CefBrowserMainParts // AlloyBrowserMainParts
// | // |
// own // own
// v // v
@ -79,7 +80,7 @@
// thread due to CefBrowserHostImpl destruction, ref release, etc. // thread due to CefBrowserHostImpl destruction, ref release, etc.
// 3. CefBrowserContext is destroyed on the UI thread due to // 3. CefBrowserContext is destroyed on the UI thread due to
// CefRequestContextImpl destruction or deletion in // CefRequestContextImpl destruction or deletion in
// CefBrowserMainParts::PostMainMessageLoopRun(). // AlloyBrowserMainParts::PostMainMessageLoopRun().
// 4. CefResourceContext is destroyed asynchronously on the IO thread due to // 4. CefResourceContext is destroyed asynchronously on the IO thread due to
// CefBrowserContext destruction. This cancels/destroys any pending // CefBrowserContext destruction. This cancels/destroys any pending
// network requests. // network requests.
@ -104,7 +105,7 @@ class VisitedLinkWriter;
// Main entry point for configuring behavior on a per-browser basis. An instance // Main entry point for configuring behavior on a per-browser basis. An instance
// of this class is passed to WebContents::Create in CefBrowserHostImpl:: // of this class is passed to WebContents::Create in CefBrowserHostImpl::
// CreateInternal. Only accessed on the UI thread unless otherwise indicated. // CreateInternal. Only accessed on the UI thread unless otherwise indicated.
class CefBrowserContext : public ChromeProfileStub, class CefBrowserContext : public ChromeProfileAlloy,
public visitedlink::VisitedLinkDelegate { public visitedlink::VisitedLinkDelegate {
public: public:
explicit CefBrowserContext(const CefRequestContextSettings& settings); explicit CefBrowserContext(const CefRequestContextSettings& settings);

View File

@ -8,13 +8,13 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/audio_capturer.h" #include "libcef/browser/audio_capturer.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_info.h" #include "libcef/browser/browser_info.h"
#include "libcef/browser/browser_info_manager.h" #include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/browser_platform_delegate.h" #include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/browser_util.h" #include "libcef/browser/browser_util.h"
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/devtools/devtools_manager.h" #include "libcef/browser/devtools/devtools_manager.h"
#include "libcef/browser/extensions/browser_extensions_util.h" #include "libcef/browser/extensions/browser_extensions_util.h"
@ -35,7 +35,6 @@
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
#include "libcef/common/drag_data_impl.h" #include "libcef/common/drag_data_impl.h"
#include "libcef/common/extensions/extensions_util.h" #include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/main_delegate.h"
#include "libcef/common/request_impl.h" #include "libcef/common/request_impl.h"
#include "libcef/common/values_impl.h" #include "libcef/common/values_impl.h"
@ -390,7 +389,7 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::Create(
// Extension resources will fail to load if we don't use a SiteInstance // Extension resources will fail to load if we don't use a SiteInstance
// associated with the extension. // associated with the extension.
// (CefContentBrowserClient::SiteInstanceGotProcess won't find the // (AlloyContentBrowserClient::SiteInstanceGotProcess won't find the
// extension to register with InfoMap, and AllowExtensionResourceLoad in // extension to register with InfoMap, and AllowExtensionResourceLoad in
// ExtensionProtocolHandler::MaybeCreateJob will return false resulting in // ExtensionProtocolHandler::MaybeCreateJob will return false resulting in
// ERR_BLOCKED_BY_CLIENT). // ERR_BLOCKED_BY_CLIENT).
@ -2097,7 +2096,7 @@ bool CefBrowserHostImpl::IsAudioMuted() {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// |source| may be NULL if the navigation originates from a guest view via // |source| may be NULL if the navigation originates from a guest view via
// CefContentBrowserClient::CanCreateWindow. // AlloyContentBrowserClient::CanCreateWindow.
content::WebContents* CefBrowserHostImpl::OpenURLFromTab( content::WebContents* CefBrowserHostImpl::OpenURLFromTab(
content::WebContents* source, content::WebContents* source,
const content::OpenURLParams& params) { const content::OpenURLParams& params) {

View File

@ -63,7 +63,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
bool is_windowless, bool is_windowless,
CefRefPtr<CefDictionaryValue> extra_info); CefRefPtr<CefDictionaryValue> extra_info);
// Called from CefContentBrowserClient::CanCreateWindow. See comments on // Called from AlloyContentBrowserClient::CanCreateWindow. See comments on
// PendingPopup for more information. // PendingPopup for more information.
bool CanCreateWindow(content::RenderFrameHost* opener, bool CanCreateWindow(content::RenderFrameHost* opener,
const GURL& target_url, const GURL& target_url,
@ -143,7 +143,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
void RenderProcessHostDestroyed(content::RenderProcessHost* host) override; void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
// Store state information about pending popups. Call order is: // Store state information about pending popups. Call order is:
// - CefContentBrowserClient::CanCreateWindow (UIT) // - AlloyContentBrowserClient::CanCreateWindow (UIT)
// Provides an opportunity to cancel the popup (calls OnBeforePopup) and // Provides an opportunity to cancel the popup (calls OnBeforePopup) and
// creates the new platform delegate for the popup. If the popup owner is // creates the new platform delegate for the popup. If the popup owner is
// an extension guest view then the popup is canceled and // an extension guest view then the popup is canceled and

View File

@ -7,8 +7,8 @@
#include "libcef/browser/browser_info_manager.h" #include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/origin_whitelist_impl.h" #include "libcef/browser/origin_whitelist_impl.h"
#include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/cef_messages.h" #include "libcef/common/cef_messages.h"
#include "libcef/common/content_client.h"
#include "libcef/common/values_impl.h" #include "libcef/common/values_impl.h"
#include "base/bind.h" #include "base/bind.h"
@ -43,7 +43,7 @@ void CefBrowserMessageFilter::OnGetNewRenderThreadInfo(
CefProcessHostMsg_GetNewRenderThreadInfo_Params* params) { CefProcessHostMsg_GetNewRenderThreadInfo_Params* params) {
GetCrossOriginWhitelistEntries(&params->cross_origin_whitelist_entries); GetCrossOriginWhitelistEntries(&params->cross_origin_whitelist_entries);
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app.get()) { if (app.get()) {
CefRefPtr<CefBrowserProcessHandler> handler = CefRefPtr<CefBrowserProcessHandler> handler =
app->GetBrowserProcessHandler(); app->GetBrowserProcessHandler();

View File

@ -3,7 +3,7 @@
// be found in the LICENSE file. // be found in the LICENSE file.
#include "libcef/browser/browser_message_loop.h" #include "libcef/browser/browser_message_loop.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_pump.h" #include "base/message_loop/message_pump.h"
@ -91,7 +91,7 @@ class MessagePumpExternal : public base::MessagePumpForUI {
}; };
CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() { CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() {
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app) if (app)
return app->GetBrowserProcessHandler(); return app->GetBrowserProcessHandler();
return nullptr; return nullptr;

View File

@ -9,8 +9,8 @@
#include <iomanip> #include <iomanip>
#include <utility> #include <utility>
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/devtools/devtools_manager_delegate.h" #include "libcef/browser/devtools/devtools_manager_delegate.h"
#include "libcef/browser/net/devtools_scheme_handler.h" #include "libcef/browser/net/devtools_scheme_handler.h"
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
@ -606,7 +606,7 @@ void CefDevToolsFrontend::LogProtocolMessage(ProtocolMessageType type,
std::string to_log = message.substr(0, kMaxLogLineLength).as_string(); std::string to_log = message.substr(0, kMaxLogLineLength).as_string();
// Execute in an ordered context that allows blocking. // Execute in an ordered context that allows blocking.
auto task_runner = CefContentBrowserClient::Get()->background_task_runner(); auto task_runner = AlloyContentBrowserClient::Get()->background_task_runner();
task_runner->PostTask( task_runner->PostTask(
FROM_HERE, base::BindOnce(::LogProtocolMessage, protocol_log_file_, type, FROM_HERE, base::BindOnce(::LogProtocolMessage, protocol_log_file_, type,
std::move(to_log))); std::move(to_log)));

View File

@ -45,7 +45,7 @@ CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForFrameRoute(
// |is_guest_view| will be set to true if the host matches a guest view // |is_guest_view| will be set to true if the host matches a guest view
// associated with the returned browser instead of the browser itself. // associated with the returned browser instead of the browser itself.
// TODO(cef): Delete the RVH variant once the remaining use case // TODO(cef): Delete the RVH variant once the remaining use case
// (via CefContentBrowserClient::OverrideWebkitPrefs) has been removed. // (via AlloyContentBrowserClient::OverrideWebkitPrefs) has been removed.
CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForHost( CefRefPtr<CefBrowserHostImpl> GetOwnerBrowserForHost(
content::RenderViewHost* host, content::RenderViewHost* host,
bool* is_guest_view); bool* is_guest_view);

View File

@ -224,7 +224,7 @@ void CefExtensionSystem::Init() {
// WebContents routing IDs with the owner CefBrowser. MimeHandlerViewGuest // WebContents routing IDs with the owner CefBrowser. MimeHandlerViewGuest
// then loads the extension URL (index.html) in the guest WebContents. // then loads the extension URL (index.html) in the guest WebContents.
// 13.Creation of the RenderFrame in the guest renderer process triggers a // 13.Creation of the RenderFrame in the guest renderer process triggers a
// sync IPC call from CefContentRendererClient::MaybeCreateBrowser to // sync IPC call from AlloyContentRendererClient::MaybeCreateBrowser to
// CefBrowserInfoManager::GetBrowserInfo in the browser process to retrieve // CefBrowserInfoManager::GetBrowserInfo in the browser process to retrieve
// the CefBrowser information, which will be immediately available due to // the CefBrowser information, which will be immediately available due to
// step 12. // step 12.
@ -248,7 +248,7 @@ void CefExtensionSystem::Init() {
// 17.HTMLPlugInElement::RequestObject is called in the guest renderer process // 17.HTMLPlugInElement::RequestObject is called in the guest renderer process
// and determines that the PDF PPAPI plugin should be handled internally // and determines that the PDF PPAPI plugin should be handled internally
// (handled_externally=false). A PluginDocument is created and // (handled_externally=false). A PluginDocument is created and
// CefContentRendererClient::OverrideCreatePlugin is called to create a // AlloyContentRendererClient::OverrideCreatePlugin is called to create a
// WebPlugin. // WebPlugin.
// 18.The PDF extension and PDF plugin are now loaded. Print commands, if // 18.The PDF extension and PDF plugin are now loaded. Print commands, if
// any, are handled in the guest renderer process by ChromePDFPrintClient // any, are handled in the guest renderer process by ChromePDFPrintClient

View File

@ -5,10 +5,10 @@
#include "libcef/browser/extensions/mime_handler_view_guest_delegate.h" #include "libcef/browser/extensions/mime_handler_view_guest_delegate.h"
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/browser_info.h" #include "libcef/browser/browser_info.h"
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/osr/web_contents_view_osr.h" #include "libcef/browser/osr/web_contents_view_osr.h"
#include "content/browser/browser_plugin/browser_plugin_guest.h" #include "content/browser/browser_plugin/browser_plugin_guest.h"

View File

@ -7,10 +7,10 @@
#include "libcef/browser/browser_message_loop.h" #include "libcef/browser/browser_message_loop.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/common/alloy/alloy_main_runner_delegate.h"
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
#include "libcef/common/chrome/chrome_main_runner_delegate.h" #include "libcef/common/chrome/chrome_main_runner_delegate.h"
#include "libcef/common/main_delegate.h" #include "libcef/features/runtime.h"
#include "libcef/features/chrome_cef.h"
#include "base/at_exit.h" #include "base/at_exit.h"
#include "base/base_switches.h" #include "base/base_switches.h"
@ -43,7 +43,7 @@ namespace {
enum class RuntimeType { enum class RuntimeType {
UNINITIALIZED, UNINITIALIZED,
CEF, ALLOY,
CHROME, CHROME,
}; };
RuntimeType g_runtime_type = RuntimeType::UNINITIALIZED; RuntimeType g_runtime_type = RuntimeType::UNINITIALIZED;
@ -53,9 +53,10 @@ std::unique_ptr<CefMainRunnerDelegate> MakeDelegate(
CefMainRunnerHandler* runner, CefMainRunnerHandler* runner,
CefSettings* settings, CefSettings* settings,
CefRefPtr<CefApp> application) { CefRefPtr<CefApp> application) {
if (type == RuntimeType::CEF) { if (type == RuntimeType::ALLOY) {
g_runtime_type = RuntimeType::CEF; g_runtime_type = RuntimeType::ALLOY;
return std::make_unique<CefMainDelegate>(runner, settings, application); return std::make_unique<AlloyMainRunnerDelegate>(runner, settings,
application);
} else { } else {
g_runtime_type = RuntimeType::CHROME; g_runtime_type = RuntimeType::CHROME;
return std::make_unique<ChromeMainRunnerDelegate>(runner); return std::make_unique<ChromeMainRunnerDelegate>(runner);
@ -226,7 +227,7 @@ bool CefMainRunner::Initialize(CefSettings* settings,
base::OnceClosure context_initialized) { base::OnceClosure context_initialized) {
DCHECK(!main_delegate_); DCHECK(!main_delegate_);
main_delegate_ = MakeDelegate( main_delegate_ = MakeDelegate(
settings->chrome_runtime ? RuntimeType::CHROME : RuntimeType::CEF, this, settings->chrome_runtime ? RuntimeType::CHROME : RuntimeType::ALLOY, this,
settings, application); settings, application);
const int exit_code = const int exit_code =
@ -315,7 +316,7 @@ int CefMainRunner::RunAsHelperProcess(const CefMainArgs& args,
auto runtime_type = command_line.HasSwitch(switches::kEnableChromeRuntime) auto runtime_type = command_line.HasSwitch(switches::kEnableChromeRuntime)
? RuntimeType::CHROME ? RuntimeType::CHROME
: RuntimeType::CEF; : RuntimeType::ALLOY;
auto main_delegate = MakeDelegate(runtime_type, /*runner=*/nullptr, auto main_delegate = MakeDelegate(runtime_type, /*runner=*/nullptr,
/*settings=*/nullptr, application); /*settings=*/nullptr, application);
main_delegate->BeforeExecuteProcess(args); main_delegate->BeforeExecuteProcess(args);
@ -441,7 +442,7 @@ int CefMainRunner::RunMainProcess(
browser_runner_ = content::BrowserMainRunner::Create(); browser_runner_ = content::BrowserMainRunner::Create();
// Initialize browser process state. Results in a call to // Initialize browser process state. Results in a call to
// CefBrowserMain::PreMainMessageLoopStart() which creates the UI message // AlloyBrowserMain::PreMainMessageLoopStart() which creates the UI message
// loop. // loop.
int exit_code = browser_runner_->Initialize(main_function_params); int exit_code = browser_runner_->Initialize(main_function_params);
if (exit_code >= 0) if (exit_code >= 0)
@ -517,11 +518,11 @@ void CefMainRunner::FinalizeShutdown(base::OnceClosure finalize_shutdown) {
g_runtime_type = RuntimeType::UNINITIALIZED; g_runtime_type = RuntimeType::UNINITIALIZED;
} }
// From libcef/features/chrome_cef.h: // From libcef/features/runtime.h:
namespace cef { namespace cef {
bool IsCefRuntimeEnabled() { bool IsAlloyRuntimeEnabled() {
return g_runtime_type == RuntimeType::CEF; return g_runtime_type == RuntimeType::ALLOY;
} }
bool IsChromeRuntimeEnabled() { bool IsChromeRuntimeEnabled() {

View File

@ -10,7 +10,7 @@
#include "libcef/browser/context_menu_params_impl.h" #include "libcef/browser/context_menu_params_impl.h"
#include "libcef/browser/menu_runner.h" #include "libcef/browser/menu_runner.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/logging.h" #include "base/logging.h"
@ -24,7 +24,7 @@ namespace {
CefString GetLabel(int message_id) { CefString GetLabel(int message_id) {
base::string16 label = base::string16 label =
CefContentClient::Get()->GetLocalizedString(message_id); AlloyContentClient::Get()->GetLocalizedString(message_id);
DCHECK(!label.empty()); DCHECK(!label.empty());
return label; return label;
} }

View File

@ -12,12 +12,12 @@
#include "include/cef_version.h" #include "include/cef_version.h"
#include "include/cef_web_plugin.h" #include "include/cef_web_plugin.h"
#include "libcef/browser/content_browser_client.h" #include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/extensions/chrome_api_registration.h" #include "libcef/browser/extensions/chrome_api_registration.h"
#include "libcef/browser/frame_host_impl.h" #include "libcef/browser/frame_host_impl.h"
#include "libcef/browser/net/internal_scheme_handler.h" #include "libcef/browser/net/internal_scheme_handler.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
@ -60,7 +60,7 @@ const char kChromeUIWebUIHostsHost[] = "webui-hosts";
// TODO(network): Consider handling content::kChromeDevToolsScheme via WebUI // TODO(network): Consider handling content::kChromeDevToolsScheme via WebUI
// (DevToolsUI class) with the following changes: // (DevToolsUI class) with the following changes:
// 1. Add an entry for content::kChromeDevToolsScheme in // 1. Add an entry for content::kChromeDevToolsScheme in
// CefContentBrowserClient::GetAdditionalWebUISchemes. // AlloyContentBrowserClient::GetAdditionalWebUISchemes.
// 2. Allow the scheme in CefWebUIControllerFactory::AllowWebUIForURL. // 2. Allow the scheme in CefWebUIControllerFactory::AllowWebUIForURL.
// 3. Add an entry for chrome::kChromeUIDevToolsHost in kAllowedWebUIHosts and // 3. Add an entry for chrome::kChromeUIDevToolsHost in kAllowedWebUIHosts and
// kUnlistedHosts. // kUnlistedHosts.
@ -341,7 +341,7 @@ bool OnExtensionsSupportUI(std::string* mime_type, std::string* output) {
} }
bool OnLicenseUI(std::string* mime_type, std::string* output) { bool OnLicenseUI(std::string* mime_type, std::string* output) {
base::StringPiece piece = CefContentClient::Get()->GetDataResource( base::StringPiece piece = AlloyContentClient::Get()->GetDataResource(
IDR_CEF_LICENSE_TXT, ui::SCALE_FACTOR_NONE); IDR_CEF_LICENSE_TXT, ui::SCALE_FACTOR_NONE);
if (piece.empty()) { if (piece.empty()) {
NOTREACHED() << "Failed to load license txt resource."; NOTREACHED() << "Failed to load license txt resource.";
@ -358,7 +358,7 @@ bool OnLicenseUI(std::string* mime_type, std::string* output) {
bool OnVersionUI(Profile* profile, bool OnVersionUI(Profile* profile,
std::string* mime_type, std::string* mime_type,
std::string* output) { std::string* output) {
base::StringPiece piece = CefContentClient::Get()->GetDataResource( base::StringPiece piece = AlloyContentClient::Get()->GetDataResource(
IDR_CEF_VERSION_HTML, ui::SCALE_FACTOR_NONE); IDR_CEF_VERSION_HTML, ui::SCALE_FACTOR_NONE);
if (piece.empty()) { if (piece.empty()) {
NOTREACHED() << "Failed to load version html resource."; NOTREACHED() << "Failed to load version html resource.";
@ -376,7 +376,7 @@ bool OnVersionUI(Profile* profile,
parser.Add("WEBKIT", content::GetWebKitVersion()); parser.Add("WEBKIT", content::GetWebKitVersion());
parser.Add("JAVASCRIPT", v8::V8::GetVersion()); parser.Add("JAVASCRIPT", v8::V8::GetVersion());
parser.Add("FLASH", std::string()); // Value populated asynchronously. parser.Add("FLASH", std::string()); // Value populated asynchronously.
parser.Add("USERAGENT", CefContentClient::Get()->browser()->GetUserAgent()); parser.Add("USERAGENT", AlloyContentClient::Get()->browser()->GetUserAgent());
parser.Add("COMMANDLINE", GetCommandLine()); parser.Add("COMMANDLINE", GetCommandLine());
parser.Add("MODULEPATH", GetModulePath()); parser.Add("MODULEPATH", GetModulePath());
parser.Add("CACHEPATH", CefString(profile->GetPath().value())); parser.Add("CACHEPATH", CefString(profile->GetPath().value()));

View File

@ -8,7 +8,7 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
@ -159,7 +159,7 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
if (!action.bytes && action.resource_id >= 0) { if (!action.bytes && action.resource_id >= 0) {
action.bytes = action.bytes =
CefContentClient::Get()->GetDataResourceBytes(action.resource_id); AlloyContentClient::Get()->GetDataResourceBytes(action.resource_id);
if (!action.bytes) { if (!action.bytes) {
NOTREACHED() << "Failed to load internal resource for id: " NOTREACHED() << "Failed to load internal resource for id: "
<< action.resource_id << " URL: " << url.spec().c_str(); << action.resource_id << " URL: " << url.spec().c_str();

View File

@ -156,7 +156,7 @@ void CefCookieManagerImpl::SetSupportedSchemes(
// This will be forwarded to the CookieMonster that lives in the // This will be forwarded to the CookieMonster that lives in the
// NetworkService process when the NetworkContext is created via // NetworkService process when the NetworkContext is created via
// CefContentBrowserClient::CreateNetworkContext. // AlloyContentBrowserClient::CreateNetworkContext.
browser_context->set_cookieable_schemes(base::make_optional(all_schemes)); browser_context->set_cookieable_schemes(base::make_optional(all_schemes));
RunAsyncCompletionOnUIThread(callback); RunAsyncCompletionOnUIThread(callback);
} }

View File

@ -4,9 +4,9 @@
#include "libcef/browser/net_service/resource_request_handler_wrapper.h" #include "libcef/browser/net_service/resource_request_handler_wrapper.h"
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/browser_platform_delegate.h" #include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/net_service/cookie_helper.h" #include "libcef/browser/net_service/cookie_helper.h"
#include "libcef/browser/net_service/proxy_url_loader_factory.h" #include "libcef/browser/net_service/proxy_url_loader_factory.h"
@ -14,7 +14,7 @@
#include "libcef/browser/net_service/response_filter_wrapper.h" #include "libcef/browser/net_service/response_filter_wrapper.h"
#include "libcef/browser/resource_context.h" #include "libcef/browser/resource_context.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/net/scheme_registration.h" #include "libcef/common/net/scheme_registration.h"
#include "libcef/common/net_service/net_service_util.h" #include "libcef/common/net_service/net_service_util.h"
#include "libcef/common/request_impl.h" #include "libcef/common/request_impl.h"
@ -290,7 +290,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
accept_language_ = ComputeAcceptLanguageFromPref( accept_language_ = ComputeAcceptLanguageFromPref(
GetAcceptLanguageList(browser_context, browser)); GetAcceptLanguageList(browser_context, browser));
DCHECK(!accept_language_.empty()); DCHECK(!accept_language_.empty());
user_agent_ = CefContentClient::Get()->browser()->GetUserAgent(); user_agent_ = AlloyContentClient::Get()->browser()->GetUserAgent();
DCHECK(!user_agent_.empty()); DCHECK(!user_agent_.empty());
} }

View File

@ -5,7 +5,7 @@
#include "libcef/browser/net_service/url_loader_factory_getter.h" #include "libcef/browser/net_service/url_loader_factory_getter.h"
#include "libcef/browser/content_browser_client.h" #include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
@ -59,7 +59,7 @@ scoped_refptr<URLLoaderFactoryGetter> URLLoaderFactoryGetter::Create(
} }
// Allow the Content embedder to inject itself if it wants to. // Allow the Content embedder to inject itself if it wants to.
should_proxy |= CefContentBrowserClient::Get()->WillCreateURLLoaderFactory( should_proxy |= AlloyContentBrowserClient::Get()->WillCreateURLLoaderFactory(
browser_context, render_frame_host, render_process_id, browser_context, render_frame_host, render_process_id,
content::ContentBrowserClient::URLLoaderFactoryType::kDocumentSubResource, content::ContentBrowserClient::URLLoaderFactoryType::kDocumentSubResource,
url::Origin(), base::nullopt /* navigation_id */, url::Origin(), base::nullopt /* navigation_id */,

View File

@ -7,8 +7,8 @@
#include <windows.h> #include <windows.h>
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/browser_host_impl.h" #include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/content_browser_client.h"
#include "ui/resources/grit/ui_unscaled_resources.h" #include "ui/resources/grit/ui_unscaled_resources.h"
@ -165,8 +165,8 @@ ui::PlatformCursor CefRenderWidgetHostViewOSR::GetPlatformCursor(
HMODULE module_handle = NULL; HMODULE module_handle = NULL;
const wchar_t* cursor_id = ToCursorID(type); const wchar_t* cursor_id = ToCursorID(type);
if (!IsSystemCursorID(cursor_id)) { if (!IsSystemCursorID(cursor_id)) {
module_handle = module_handle = ::GetModuleHandle(
::GetModuleHandle(CefContentBrowserClient::Get()->GetResourceDllName()); AlloyContentBrowserClient::Get()->GetResourceDllName());
if (!module_handle) if (!module_handle)
module_handle = ::GetModuleHandle(NULL); module_handle = ::GetModuleHandle(NULL);
} }

View File

@ -8,7 +8,7 @@
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/browser/web_plugin_impl.h" #include "libcef/browser/web_plugin_impl.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
@ -42,11 +42,11 @@ bool CefPluginServiceFilter::IsPluginAvailable(
// with an empty origin. If we return false then the plugin will not be listed // with an empty origin. If we return false then the plugin will not be listed
// in navigator.plugins and navigating to the plugin mime type will trigger // in navigator.plugins and navigating to the plugin mime type will trigger
// the download code path. If we return true then individual plugin instance // the download code path. If we return true then individual plugin instance
// loads will be evaluated in CefContentRendererClient::OverrideCreatePlugin, // loads will be evaluated in
// which will result in a call to CefPluginInfoMessageFilter::PluginsLoaded to // AlloyContentRendererClient::OverrideCreatePlugin, which will result in a
// retrieve the actual load decision with a non-empty origin. That will // call to CefPluginInfoMessageFilter::PluginsLoaded to retrieve the actual
// determine whether the plugin load is allowed or the plugin placeholder is // load decision with a non-empty origin. That will determine whether the
// displayed. // plugin load is allowed or the plugin placeholder is displayed.
return IsPluginAvailable(render_process_id, render_frame_id, url, return IsPluginAvailable(render_process_id, render_frame_id, url,
is_main_frame, url::Origin(), plugin, &status); is_main_frame, url::Origin(), plugin, &status);
} }
@ -72,7 +72,7 @@ bool CefPluginServiceFilter::IsPluginAvailable(
return false; return false;
} }
if (plugin->path == CefString(CefContentClient::kPDFPluginPath)) { if (plugin->path == CefString(AlloyContentClient::kPDFPluginPath)) {
// Always allow the internal PDF plugin to load. // Always allow the internal PDF plugin to load.
*status = chrome::mojom::PluginStatus::kAllowed; *status = chrome::mojom::PluginStatus::kAllowed;
return true; return true;

View File

@ -11,7 +11,7 @@
#include "libcef/browser/extensions/browser_extensions_util.h" #include "libcef/browser/extensions/browser_extensions_util.h"
#include "libcef/browser/print_settings_impl.h" #include "libcef/browser/print_settings_impl.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
@ -105,7 +105,7 @@ gfx::Size CefPrintDialogLinux::GetPdfPaperSize(
gfx::Size size; gfx::Size size;
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app.get()) { if (app.get()) {
CefRefPtr<CefBrowserProcessHandler> browser_handler = CefRefPtr<CefBrowserProcessHandler> browser_handler =
app->GetBrowserProcessHandler(); app->GetBrowserProcessHandler();
@ -136,7 +136,7 @@ void CefPrintDialogLinux::OnPrintStart(int render_process_id,
return; return;
} }
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (!app.get()) if (!app.get())
return; return;
@ -251,7 +251,7 @@ void CefPrintDialogLinux::SetHandler() {
if (handler_.get()) if (handler_.get())
return; return;
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app.get()) { if (app.get()) {
CefRefPtr<CefBrowserProcessHandler> browser_handler = CefRefPtr<CefBrowserProcessHandler> browser_handler =
app->GetBrowserProcessHandler(); app->GetBrowserProcessHandler();

View File

@ -3,8 +3,8 @@
// can be found in the LICENSE file. // can be found in the LICENSE file.
#include "libcef/browser/request_context_impl.h" #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/browser_context.h"
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/browser/extensions/extension_system.h" #include "libcef/browser/extensions/extension_system.h"
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
@ -625,7 +625,7 @@ CefRequestContextImpl::GetOrCreateRequestContext(const Config& config) {
if (config.is_global || if (config.is_global ||
(config.other && config.other->IsGlobal() && !config.handler)) { (config.other && config.other->IsGlobal() && !config.handler)) {
// Return the singleton global context. // Return the singleton global context.
return CefContentBrowserClient::Get()->request_context(); return AlloyContentBrowserClient::Get()->request_context();
} }
// The new context will be initialized later by EnsureBrowserContext(). // The new context will be initialized later by EnsureBrowserContext().

View File

@ -21,7 +21,7 @@ class CefRequestContextImpl : public CefRequestContext {
~CefRequestContextImpl() override; ~CefRequestContextImpl() override;
// Creates the singleton global RequestContext. Called from // Creates the singleton global RequestContext. Called from
// CefBrowserMainParts::PreMainMessageLoopRun. // AlloyBrowserMainParts::PreMainMessageLoopRun.
static CefRefPtr<CefRequestContextImpl> CreateGlobalRequestContext( static CefRefPtr<CefRequestContextImpl> CreateGlobalRequestContext(
const CefRequestContextSettings& settings); const CefRequestContextSettings& settings);

View File

@ -53,8 +53,8 @@
// Tasks posted with this method are not guaranteed to run sequentially. Use // Tasks posted with this method are not guaranteed to run sequentially. Use
// base::CreateSequencedTaskRunner instead if sequence is important. // base::CreateSequencedTaskRunner instead if sequence is important.
// Sequenced runners at various priorities that always execute all pending tasks // Sequenced runners at various priorities that always execute all pending tasks
// before shutdown are available via CefContentBrowserClient::*_task_runner() // before shutdown are available via CefTaskRunnerManager and exposed by the CEF
// and exposed by the CEF API. // API.
#define CEF_POST_BLOCKING_TASK(priority, task) \ #define CEF_POST_BLOCKING_TASK(priority, task) \
base::PostTask( \ base::PostTask( \
FROM_HERE, \ FROM_HERE, \

View File

@ -17,7 +17,7 @@ class CefX509CertificateImpl : public CefX509Certificate {
public: public:
explicit CefX509CertificateImpl(scoped_refptr<net::X509Certificate> cert); explicit CefX509CertificateImpl(scoped_refptr<net::X509Certificate> cert);
// Used with CefContentBrowserClient::SelectClientCertificate only. // Used with AlloyContentBrowserClient::SelectClientCertificate only.
explicit CefX509CertificateImpl( explicit CefX509CertificateImpl(
std::unique_ptr<net::ClientCertIdentity> identity); std::unique_ptr<net::ClientCertIdentity> identity);

View File

@ -3,7 +3,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include <stdint.h> #include <stdint.h>
@ -44,7 +44,7 @@
namespace { namespace {
CefContentClient* g_content_client = nullptr; AlloyContentClient* g_content_client = nullptr;
// The following plugin-related methods are from // The following plugin-related methods are from
// chrome/common/chrome_content_client.cc // chrome/common/chrome_content_client.cc
@ -72,7 +72,7 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
pdf_info.name = extensions::pdf_extension_util::kPdfPluginName; pdf_info.name = extensions::pdf_extension_util::kPdfPluginName;
pdf_info.description = kPDFPluginDescription; pdf_info.description = kPDFPluginDescription;
pdf_info.path = pdf_info.path =
base::FilePath::FromUTF8Unsafe(CefContentClient::kPDFPluginPath); base::FilePath::FromUTF8Unsafe(AlloyContentClient::kPDFPluginPath);
content::WebPluginMimeType pdf_mime_type(kPDFPluginOutOfProcessMimeType, content::WebPluginMimeType pdf_mime_type(kPDFPluginOutOfProcessMimeType,
kPDFPluginExtension, kPDFPluginExtension,
kPDFPluginDescription); kPDFPluginDescription);
@ -182,9 +182,9 @@ bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) {
} // namespace } // namespace
const char CefContentClient::kPDFPluginPath[] = "internal-pdf-viewer"; const char AlloyContentClient::kPDFPluginPath[] = "internal-pdf-viewer";
CefContentClient::CefContentClient(CefRefPtr<CefApp> application) AlloyContentClient::AlloyContentClient(CefRefPtr<CefApp> application)
: application_(application), : application_(application),
pack_loading_disabled_(false), pack_loading_disabled_(false),
allow_pack_file_load_(false), allow_pack_file_load_(false),
@ -194,16 +194,16 @@ CefContentClient::CefContentClient(CefRefPtr<CefApp> application)
g_content_client = this; g_content_client = this;
} }
CefContentClient::~CefContentClient() { AlloyContentClient::~AlloyContentClient() {
g_content_client = nullptr; g_content_client = nullptr;
} }
// static // static
CefContentClient* CefContentClient::Get() { AlloyContentClient* AlloyContentClient::Get() {
return g_content_client; return g_content_client;
} }
void CefContentClient::AddPepperPlugins( void AlloyContentClient::AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) { std::vector<content::PepperPluginInfo>* plugins) {
ComputeBuiltInPlugins(plugins); ComputeBuiltInPlugins(plugins);
AddPepperFlashFromCommandLine(plugins); AddPepperFlashFromCommandLine(plugins);
@ -213,7 +213,7 @@ void CefContentClient::AddPepperPlugins(
plugins->push_back(plugin); plugins->push_back(plugin);
} }
void CefContentClient::AddContentDecryptionModules( void AlloyContentClient::AddContentDecryptionModules(
std::vector<content::CdmInfo>* cdms, std::vector<content::CdmInfo>* cdms,
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) { std::vector<media::CdmHostFilePath>* cdm_host_file_paths) {
#if defined(OS_LINUX) #if defined(OS_LINUX)
@ -223,7 +223,7 @@ void CefContentClient::AddContentDecryptionModules(
#endif #endif
} }
void CefContentClient::AddAdditionalSchemes(Schemes* schemes) { void AlloyContentClient::AddAdditionalSchemes(Schemes* schemes) {
DCHECK(!scheme_info_list_locked_); DCHECK(!scheme_info_list_locked_);
if (application_.get()) { if (application_.get()) {
@ -237,7 +237,7 @@ void CefContentClient::AddAdditionalSchemes(Schemes* schemes) {
scheme_info_list_locked_ = true; scheme_info_list_locked_ = true;
} }
base::string16 CefContentClient::GetLocalizedString(int message_id) { base::string16 AlloyContentClient::GetLocalizedString(int message_id) {
base::string16 value = base::string16 value =
ui::ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); ui::ResourceBundle::GetSharedInstance().GetLocalizedString(message_id);
if (value.empty()) if (value.empty())
@ -246,7 +246,7 @@ base::string16 CefContentClient::GetLocalizedString(int message_id) {
return value; return value;
} }
base::string16 CefContentClient::GetLocalizedString( base::string16 AlloyContentClient::GetLocalizedString(
int message_id, int message_id,
const base::string16& replacement) { const base::string16& replacement) {
base::string16 value = l10n_util::GetStringFUTF16(message_id, replacement); base::string16 value = l10n_util::GetStringFUTF16(message_id, replacement);
@ -256,7 +256,7 @@ base::string16 CefContentClient::GetLocalizedString(
return value; return value;
} }
base::StringPiece CefContentClient::GetDataResource( base::StringPiece AlloyContentClient::GetDataResource(
int resource_id, int resource_id,
ui::ScaleFactor scale_factor) { ui::ScaleFactor scale_factor) {
base::StringPiece value = base::StringPiece value =
@ -268,7 +268,7 @@ base::StringPiece CefContentClient::GetDataResource(
return value; return value;
} }
base::RefCountedMemory* CefContentClient::GetDataResourceBytes( base::RefCountedMemory* AlloyContentClient::GetDataResourceBytes(
int resource_id) { int resource_id) {
base::RefCountedMemory* value = base::RefCountedMemory* value =
ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
@ -279,7 +279,7 @@ base::RefCountedMemory* CefContentClient::GetDataResourceBytes(
return value; return value;
} }
gfx::Image& CefContentClient::GetNativeImageNamed(int resource_id) { gfx::Image& AlloyContentClient::GetNativeImageNamed(int resource_id) {
gfx::Image& value = gfx::Image& value =
ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
if (value.IsEmpty()) if (value.IsEmpty())
@ -288,7 +288,7 @@ gfx::Image& CefContentClient::GetNativeImageNamed(int resource_id) {
return value; return value;
} }
void CefContentClient::AddCustomScheme(const SchemeInfo& scheme_info) { void AlloyContentClient::AddCustomScheme(const SchemeInfo& scheme_info) {
DCHECK(!scheme_info_list_locked_); DCHECK(!scheme_info_list_locked_);
scheme_info_list_.push_back(scheme_info); scheme_info_list_.push_back(scheme_info);
@ -304,12 +304,13 @@ void CefContentClient::AddCustomScheme(const SchemeInfo& scheme_info) {
} }
} }
const CefContentClient::SchemeInfoList* CefContentClient::GetCustomSchemes() { const AlloyContentClient::SchemeInfoList*
AlloyContentClient::GetCustomSchemes() {
DCHECK(scheme_info_list_locked_); DCHECK(scheme_info_list_locked_);
return &scheme_info_list_; return &scheme_info_list_;
} }
bool CefContentClient::HasCustomScheme(const std::string& scheme_name) { bool AlloyContentClient::HasCustomScheme(const std::string& scheme_name) {
DCHECK(scheme_info_list_locked_); DCHECK(scheme_info_list_locked_);
if (scheme_info_list_.empty()) if (scheme_info_list_.empty())
return false; return false;
@ -324,7 +325,7 @@ bool CefContentClient::HasCustomScheme(const std::string& scheme_name) {
} }
// static // static
void CefContentClient::SetPDFEntryFunctions( void AlloyContentClient::SetPDFEntryFunctions(
content::PepperPluginInfo::GetInterfaceFunc get_interface, content::PepperPluginInfo::GetInterfaceFunc get_interface,
content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module) { content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module) {

View File

@ -3,8 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CEF_LIBCEF_COMMON_CONTENT_CLIENT_H_ #ifndef CEF_LIBCEF_COMMON_ALLOY_ALLOY_CONTENT_CLIENT_H_
#define CEF_LIBCEF_COMMON_CONTENT_CLIENT_H_ #define CEF_LIBCEF_COMMON_ALLOY_ALLOY_CONTENT_CLIENT_H_
#pragma once #pragma once
#include <list> #include <list>
@ -19,15 +19,15 @@
#include "content/public/common/pepper_plugin_info.h" #include "content/public/common/pepper_plugin_info.h"
#include "url/url_util.h" #include "url/url_util.h"
class CefContentClient : public content::ContentClient { class AlloyContentClient : public content::ContentClient {
public: public:
static const char kPDFPluginPath[]; static const char kPDFPluginPath[];
explicit CefContentClient(CefRefPtr<CefApp> application); explicit AlloyContentClient(CefRefPtr<CefApp> application);
~CefContentClient() override; ~AlloyContentClient() override;
// Returns the singleton CefContentClient instance. // Returns the singleton AlloyContentClient instance.
static CefContentClient* Get(); static AlloyContentClient* Get();
// content::ContentClient methods. // content::ContentClient methods.
void AddPepperPlugins( void AddPepperPlugins(
@ -88,9 +88,9 @@ class CefContentClient : public content::ContentClient {
typedef std::list<SchemeInfo> SchemeInfoList; typedef std::list<SchemeInfo> SchemeInfoList;
// Custom scheme information will be registered first with all processes // Custom scheme information will be registered first with all processes
// (url/url_util.h) via CefContentClient::AddAdditionalSchemes which calls // (url/url_util.h) via AlloyContentClient::AddAdditionalSchemes which calls
// AddCustomScheme, and second with Blink (SchemeRegistry) via // AddCustomScheme, and second with Blink (SchemeRegistry) via
// CefContentRendererClient::WebKitInitialized which calls GetCustomSchemes. // AlloyContentRendererClient::WebKitInitialized which calls GetCustomSchemes.
void AddCustomScheme(const SchemeInfo& scheme_info); void AddCustomScheme(const SchemeInfo& scheme_info);
const SchemeInfoList* GetCustomSchemes(); const SchemeInfoList* GetCustomSchemes();
bool HasCustomScheme(const std::string& scheme_name); bool HasCustomScheme(const std::string& scheme_name);
@ -123,4 +123,4 @@ class CefContentClient : public content::ContentClient {
CefResourceBundleDelegate resource_bundle_delegate_; CefResourceBundleDelegate resource_bundle_delegate_;
}; };
#endif // CEF_LIBCEF_COMMON_CONTENT_CLIENT_H_ #endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_CONTENT_CLIENT_H_

View File

@ -2,20 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/common/main_delegate.h" #include "libcef/common/alloy/alloy_main_delegate.h"
#if defined(OS_LINUX) #if defined(OS_LINUX)
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
#include "libcef/browser/chrome_browser_process_stub.h" #include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/content_browser_client.h"
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
#include "libcef/common/command_line_impl.h" #include "libcef/common/command_line_impl.h"
#include "libcef/common/crash_reporting.h" #include "libcef/common/crash_reporting.h"
#include "libcef/common/extensions/extensions_util.h" #include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/widevine_loader.h" #include "libcef/renderer/alloy/alloy_content_renderer_client.h"
#include "libcef/renderer/content_renderer_client.h"
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
@ -37,7 +35,6 @@
#include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/viz/common/features.h" #include "components/viz/common/features.h"
#include "content/browser/browser_process_sub_thread.h" #include "content/browser/browser_process_sub_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_features.h" #include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h" #include "content/public/common/main_function_params.h"
@ -321,7 +318,7 @@ void OverrideAssetPath() {
} // namespace } // namespace
CefMainDelegate::CefMainDelegate(CefMainRunnerHandler* runner, AlloyMainDelegate::AlloyMainDelegate(CefMainRunnerHandler* runner,
CefSettings* settings, CefSettings* settings,
CefRefPtr<CefApp> application) CefRefPtr<CefApp> application)
: runner_(runner), settings_(settings), content_client_(application) { : runner_(runner), settings_(settings), content_client_(application) {
@ -335,13 +332,13 @@ CefMainDelegate::CefMainDelegate(CefMainRunnerHandler* runner,
#endif #endif
} }
CefMainDelegate::~CefMainDelegate() {} AlloyMainDelegate::~AlloyMainDelegate() {}
void CefMainDelegate::PreCreateMainMessageLoop() { void AlloyMainDelegate::PreCreateMainMessageLoop() {
runner_->PreCreateMainMessageLoop(); runner_->PreCreateMainMessageLoop();
} }
bool CefMainDelegate::BasicStartupComplete(int* exit_code) { bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
std::string process_type = std::string process_type =
command_line->GetSwitchValueASCII(switches::kProcessType); command_line->GetSwitchValueASCII(switches::kProcessType);
@ -624,7 +621,7 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
return false; return false;
} }
void CefMainDelegate::PreSandboxStartup() { void AlloyMainDelegate::PreSandboxStartup() {
const base::CommandLine* command_line = const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess(); base::CommandLine::ForCurrentProcess();
const std::string& process_type = const std::string& process_type =
@ -674,13 +671,13 @@ void CefMainDelegate::PreSandboxStartup() {
MaybeInitializeGDI(); MaybeInitializeGDI();
} }
void CefMainDelegate::SandboxInitialized(const std::string& process_type) { void AlloyMainDelegate::SandboxInitialized(const std::string& process_type) {
CefContentClient::SetPDFEntryFunctions(chrome_pdf::PPP_GetInterface, AlloyContentClient::SetPDFEntryFunctions(chrome_pdf::PPP_GetInterface,
chrome_pdf::PPP_InitializeModule, chrome_pdf::PPP_InitializeModule,
chrome_pdf::PPP_ShutdownModule); chrome_pdf::PPP_ShutdownModule);
} }
int CefMainDelegate::RunProcess( int AlloyMainDelegate::RunProcess(
const std::string& process_type, const std::string& process_type,
const content::MainFunctionParams& main_function_params) { const content::MainFunctionParams& main_function_params) {
if (process_type.empty()) { if (process_type.empty()) {
@ -690,12 +687,12 @@ int CefMainDelegate::RunProcess(
return -1; return -1;
} }
void CefMainDelegate::ProcessExiting(const std::string& process_type) { void AlloyMainDelegate::ProcessExiting(const std::string& process_type) {
ui::ResourceBundle::CleanupSharedInstance(); ui::ResourceBundle::CleanupSharedInstance();
} }
#if defined(OS_LINUX) #if defined(OS_LINUX)
void CefMainDelegate::ZygoteForked() { void AlloyMainDelegate::ZygoteForked() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
const std::string& process_type = const std::string& process_type =
command_line->GetSwitchValueASCII(switches::kProcessType); command_line->GetSwitchValueASCII(switches::kProcessType);
@ -704,95 +701,58 @@ void CefMainDelegate::ZygoteForked() {
} }
#endif #endif
content::ContentBrowserClient* CefMainDelegate::CreateContentBrowserClient() { content::ContentBrowserClient* AlloyMainDelegate::CreateContentBrowserClient() {
browser_client_.reset(new CefContentBrowserClient); browser_client_.reset(new AlloyContentBrowserClient);
return browser_client_.get(); return browser_client_.get();
} }
content::ContentRendererClient* CefMainDelegate::CreateContentRendererClient() { content::ContentRendererClient*
renderer_client_.reset(new CefContentRendererClient); AlloyMainDelegate::CreateContentRendererClient() {
renderer_client_.reset(new AlloyContentRendererClient);
return renderer_client_.get(); return renderer_client_.get();
} }
content::ContentUtilityClient* CefMainDelegate::CreateContentUtilityClient() { content::ContentUtilityClient* AlloyMainDelegate::CreateContentUtilityClient() {
utility_client_.reset(new ChromeContentUtilityClient); utility_client_.reset(new ChromeContentUtilityClient);
return utility_client_.get(); return utility_client_.get();
} }
void CefMainDelegate::BeforeMainThreadInitialize(const CefMainArgs& args) {
g_browser_process = new ChromeBrowserProcessStub();
}
void CefMainDelegate::BeforeMainThreadRun() {
static_cast<ChromeBrowserProcessStub*>(g_browser_process)->Initialize();
}
void CefMainDelegate::AfterUIThreadInitialize() {
#if BUILDFLAG(ENABLE_WIDEVINE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
CefWidevineLoader::GetInstance()->OnContextInitialized();
#endif
static_cast<ChromeBrowserProcessStub*>(g_browser_process)
->OnContextInitialized();
}
void CefMainDelegate::AfterUIThreadShutdown() {
static_cast<ChromeBrowserProcessStub*>(g_browser_process)
->CleanupOnUIThread();
ui::ResourceBundle::GetSharedInstance().CleanupOnUIThread();
}
void CefMainDelegate::BeforeMainThreadShutdown() {
if (content::RenderProcessHost::run_renderer_in_process()) {
// Blocks until RenderProcess cleanup is complete.
CefContentRendererClient::Get()->RunSingleProcessCleanup();
}
}
void CefMainDelegate::AfterMainThreadShutdown() {
if (g_browser_process) {
delete g_browser_process;
g_browser_process = nullptr;
}
}
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
CefMainDelegate::GetBackgroundTaskRunner() { AlloyMainDelegate::GetBackgroundTaskRunner() {
if (browser_client_) if (browser_client_)
return browser_client_->background_task_runner(); return browser_client_->background_task_runner();
return nullptr; return nullptr;
} }
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
CefMainDelegate::GetUserVisibleTaskRunner() { AlloyMainDelegate::GetUserVisibleTaskRunner() {
if (browser_client_) if (browser_client_)
return browser_client_->user_visible_task_runner(); return browser_client_->user_visible_task_runner();
return nullptr; return nullptr;
} }
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
CefMainDelegate::GetUserBlockingTaskRunner() { AlloyMainDelegate::GetUserBlockingTaskRunner() {
if (browser_client_) if (browser_client_)
return browser_client_->user_blocking_task_runner(); return browser_client_->user_blocking_task_runner();
return nullptr; return nullptr;
} }
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
CefMainDelegate::GetRenderTaskRunner() { AlloyMainDelegate::GetRenderTaskRunner() {
if (renderer_client_) if (renderer_client_)
return renderer_client_->render_task_runner(); return renderer_client_->render_task_runner();
return nullptr; return nullptr;
} }
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
CefMainDelegate::GetWebWorkerTaskRunner() { AlloyMainDelegate::GetWebWorkerTaskRunner() {
if (renderer_client_) if (renderer_client_)
return renderer_client_->GetCurrentTaskRunner(); return renderer_client_->GetCurrentTaskRunner();
return nullptr; return nullptr;
} }
void CefMainDelegate::InitializeResourceBundle() { void AlloyMainDelegate::InitializeResourceBundle() {
const base::CommandLine* command_line = const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess(); base::CommandLine::ForCurrentProcess();
base::FilePath cef_pak_file, cef_100_percent_pak_file, base::FilePath cef_pak_file, cef_100_percent_pak_file,

View File

@ -2,15 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CEF_LIBCEF_COMMON_MAIN_DELEGATE_H_ #ifndef CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_DELEGATE_H_
#define CEF_LIBCEF_COMMON_MAIN_DELEGATE_H_ #define CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_DELEGATE_H_
#pragma once #pragma once
#include <string> #include <string>
#include "include/cef_app.h" #include "include/cef_app.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/main_runner_delegate.h"
#include "libcef/common/main_runner_handler.h" #include "libcef/common/main_runner_handler.h"
#include "libcef/common/task_runner_manager.h" #include "libcef/common/task_runner_manager.h"
@ -21,21 +20,20 @@ namespace base {
class CommandLine; class CommandLine;
} }
class CefContentBrowserClient; class AlloyContentBrowserClient;
class CefContentRendererClient; class AlloyContentRendererClient;
class ChromeContentUtilityClient; class ChromeContentUtilityClient;
// Manages state specific to the CEF runtime. // Manages state specific to the CEF runtime.
class CefMainDelegate : public content::ContentMainDelegate, class AlloyMainDelegate : public content::ContentMainDelegate,
public CefMainRunnerDelegate,
public CefTaskRunnerManager { public CefTaskRunnerManager {
public: public:
// |runner| and |settings| will be non-nullptr for the main process only, // |runner| and |settings| will be non-nullptr for the main process only,
// and will outlive this object. // and will outlive this object.
CefMainDelegate(CefMainRunnerHandler* runner, AlloyMainDelegate(CefMainRunnerHandler* runner,
CefSettings* settings, CefSettings* settings,
CefRefPtr<CefApp> application); CefRefPtr<CefApp> application);
~CefMainDelegate() override; ~AlloyMainDelegate() override;
// content::ContentMainDelegate overrides. // content::ContentMainDelegate overrides.
void PreCreateMainMessageLoop() override; void PreCreateMainMessageLoop() override;
@ -53,21 +51,10 @@ class CefMainDelegate : public content::ContentMainDelegate,
content::ContentRendererClient* CreateContentRendererClient() override; content::ContentRendererClient* CreateContentRendererClient() override;
content::ContentUtilityClient* CreateContentUtilityClient() override; content::ContentUtilityClient* CreateContentUtilityClient() override;
CefContentBrowserClient* browser_client() { return browser_client_.get(); } AlloyContentBrowserClient* browser_client() { return browser_client_.get(); }
CefContentClient* content_client() { return &content_client_; } AlloyContentClient* content_client() { return &content_client_; }
protected: protected:
// CefMainRunnerDelegate overrides.
content::ContentMainDelegate* GetContentMainDelegate() override {
return this;
}
void BeforeMainThreadInitialize(const CefMainArgs& args) override;
void BeforeMainThreadRun() override;
void AfterUIThreadInitialize() override;
void AfterUIThreadShutdown() override;
void BeforeMainThreadShutdown() override;
void AfterMainThreadShutdown() override;
// CefTaskRunnerManager overrides. // CefTaskRunnerManager overrides.
scoped_refptr<base::SingleThreadTaskRunner> GetBackgroundTaskRunner() scoped_refptr<base::SingleThreadTaskRunner> GetBackgroundTaskRunner()
override; override;
@ -84,12 +71,12 @@ class CefMainDelegate : public content::ContentMainDelegate,
CefMainRunnerHandler* const runner_; CefMainRunnerHandler* const runner_;
CefSettings* const settings_; CefSettings* const settings_;
std::unique_ptr<CefContentBrowserClient> browser_client_; std::unique_ptr<AlloyContentBrowserClient> browser_client_;
std::unique_ptr<CefContentRendererClient> renderer_client_; std::unique_ptr<AlloyContentRendererClient> renderer_client_;
std::unique_ptr<ChromeContentUtilityClient> utility_client_; std::unique_ptr<ChromeContentUtilityClient> utility_client_;
CefContentClient content_client_; AlloyContentClient content_client_;
DISALLOW_COPY_AND_ASSIGN(CefMainDelegate); DISALLOW_COPY_AND_ASSIGN(AlloyMainDelegate);
}; };
#endif // CEF_LIBCEF_COMMON_MAIN_DELEGATE_H_ #endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_DELEGATE_H_

View File

@ -0,0 +1,68 @@
// Copyright 2020 The Chromium Embedded Framework Authors.
// Portions copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "libcef/common/alloy/alloy_main_runner_delegate.h"
#include "libcef/browser/alloy/chrome_browser_process_alloy.h"
#include "libcef/common/alloy/alloy_main_delegate.h"
#include "libcef/common/widevine_loader.h"
#include "libcef/renderer/alloy/alloy_content_renderer_client.h"
#include "content/public/browser/render_process_host.h"
#include "ui/base/resource/resource_bundle.h"
AlloyMainRunnerDelegate::AlloyMainRunnerDelegate(CefMainRunnerHandler* runner,
CefSettings* settings,
CefRefPtr<CefApp> application)
: runner_(runner), settings_(settings), application_(application) {}
AlloyMainRunnerDelegate::~AlloyMainRunnerDelegate() = default;
content::ContentMainDelegate*
AlloyMainRunnerDelegate::GetContentMainDelegate() {
if (!main_delegate_) {
main_delegate_ =
std::make_unique<AlloyMainDelegate>(runner_, settings_, application_);
}
return main_delegate_.get();
}
void AlloyMainRunnerDelegate::BeforeMainThreadInitialize(
const CefMainArgs& args) {
g_browser_process = new ChromeBrowserProcessAlloy();
}
void AlloyMainRunnerDelegate::BeforeMainThreadRun() {
static_cast<ChromeBrowserProcessAlloy*>(g_browser_process)->Initialize();
}
void AlloyMainRunnerDelegate::AfterUIThreadInitialize() {
#if BUILDFLAG(ENABLE_WIDEVINE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
CefWidevineLoader::GetInstance()->OnContextInitialized();
#endif
static_cast<ChromeBrowserProcessAlloy*>(g_browser_process)
->OnContextInitialized();
}
void AlloyMainRunnerDelegate::AfterUIThreadShutdown() {
static_cast<ChromeBrowserProcessAlloy*>(g_browser_process)
->CleanupOnUIThread();
ui::ResourceBundle::GetSharedInstance().CleanupOnUIThread();
}
void AlloyMainRunnerDelegate::BeforeMainThreadShutdown() {
if (content::RenderProcessHost::run_renderer_in_process()) {
// Blocks until RenderProcess cleanup is complete.
AlloyContentRendererClient::Get()->RunSingleProcessCleanup();
}
}
void AlloyMainRunnerDelegate::AfterMainThreadShutdown() {
if (g_browser_process) {
delete g_browser_process;
g_browser_process = nullptr;
}
}

View File

@ -0,0 +1,46 @@
// Copyright 2020 The Chromium Embedded Framework Authors.
// Portions copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_RUNNER_DELEGATE_
#define CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_RUNNER_DELEGATE_
#include <memory>
#include "include/cef_base.h"
#include "libcef/common/main_runner_delegate.h"
#include "libcef/common/main_runner_handler.h"
class AlloyMainDelegate;
class AlloyMainRunnerDelegate : public CefMainRunnerDelegate {
public:
// |runner| and |settings| will be non-nullptr for the main process only, and
// will outlive this object.
AlloyMainRunnerDelegate(CefMainRunnerHandler* runner,
CefSettings* settings,
CefRefPtr<CefApp> application);
~AlloyMainRunnerDelegate() override;
protected:
// CefMainRunnerDelegate overrides.
content::ContentMainDelegate* GetContentMainDelegate() override;
void BeforeMainThreadInitialize(const CefMainArgs& args) override;
void BeforeMainThreadRun() override;
void AfterUIThreadInitialize() override;
void AfterUIThreadShutdown() override;
void BeforeMainThreadShutdown() override;
void AfterMainThreadShutdown() override;
private:
std::unique_ptr<AlloyMainDelegate> main_delegate_;
CefMainRunnerHandler* const runner_;
CefSettings* const settings_;
CefRefPtr<CefApp> application_;
DISALLOW_COPY_AND_ASSIGN(AlloyMainRunnerDelegate);
};
#endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_RUNNER_DELEGATE_

View File

@ -20,7 +20,7 @@ bool Enabled();
bool SetCrashKeyValue(const base::StringPiece& key, bool SetCrashKeyValue(const base::StringPiece& key,
const base::StringPiece& value); const base::StringPiece& value);
// Functions are called from similarly named methods in CefMainDelegate. // Functions are called from similarly named methods in AlloyMainDelegate.
#if defined(OS_POSIX) #if defined(OS_POSIX)
void BasicStartupComplete(base::CommandLine* command_line); void BasicStartupComplete(base::CommandLine* command_line);

View File

@ -4,7 +4,7 @@
#include "libcef/common/net/scheme_registration.h" #include "libcef/common/net/scheme_registration.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
@ -18,8 +18,8 @@ void AddInternalSchemes(content::ContentClient::Schemes* schemes) {
// chrome: and chrome-devtools: schemes are registered in // chrome: and chrome-devtools: schemes are registered in
// RenderThreadImpl::RegisterSchemes(). // RenderThreadImpl::RegisterSchemes().
// Access restrictions for chrome-extension: and chrome-extension-resource: // Access restrictions for chrome-extension: and chrome-extension-resource:
// schemes will be applied in CefContentRendererClient::WillSendRequest(). // schemes will be applied in AlloyContentRendererClient::WillSendRequest().
static CefContentClient::SchemeInfo internal_schemes[] = { static AlloyContentClient::SchemeInfo internal_schemes[] = {
{ {
extensions::kExtensionScheme, true, /* is_standard */ extensions::kExtensionScheme, true, /* is_standard */
false, /* is_local */ false, /* is_local */
@ -32,7 +32,7 @@ void AddInternalSchemes(content::ContentClient::Schemes* schemes) {
// The |is_display_isolated| value is excluded here because it's registered // The |is_display_isolated| value is excluded here because it's registered
// with Blink only. // with Blink only.
CefContentClient* client = CefContentClient::Get(); AlloyContentClient* client = AlloyContentClient::Get();
for (size_t i = 0; i < sizeof(internal_schemes) / sizeof(internal_schemes[0]); for (size_t i = 0; i < sizeof(internal_schemes) / sizeof(internal_schemes[0]);
++i) { ++i) {
if (internal_schemes[i].is_standard) if (internal_schemes[i].is_standard)

View File

@ -1,6 +1,6 @@
#include "libcef/common/resource_bundle_delegate.h" #include "libcef/common/resource_bundle_delegate.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
base::FilePath CefResourceBundleDelegate::GetPathForResourcePack( base::FilePath CefResourceBundleDelegate::GetPathForResourcePack(
const base::FilePath& pack_path, const base::FilePath& pack_path,

View File

@ -9,11 +9,11 @@
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
class CefContentClient; class AlloyContentClient;
class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate {
public: public:
CefResourceBundleDelegate(CefContentClient* content_client) CefResourceBundleDelegate(AlloyContentClient* content_client)
: content_client_(content_client) {} : content_client_(content_client) {}
private: private:
@ -33,7 +33,7 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate {
bool GetLocalizedString(int message_id, base::string16* value) override; bool GetLocalizedString(int message_id, base::string16* value) override;
private: private:
CefContentClient* content_client_; AlloyContentClient* content_client_;
}; };
#endif // CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_ #endif // CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_

View File

@ -6,7 +6,7 @@
#include <string> #include <string>
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/net/scheme_registration.h" #include "libcef/common/net/scheme_registration.h"
#include "base/bind.h" #include "base/bind.h"
@ -56,10 +56,10 @@ bool CefSchemeRegistrarImpl::AddCustomScheme(const CefString& scheme_name,
if (is_csp_bypassing) if (is_csp_bypassing)
schemes_.csp_bypassing_schemes.push_back(scheme); schemes_.csp_bypassing_schemes.push_back(scheme);
CefContentClient::SchemeInfo scheme_info = { AlloyContentClient::SchemeInfo scheme_info = {
scheme, is_standard, is_local, is_display_isolated, scheme, is_standard, is_local, is_display_isolated,
is_secure, is_cors_enabled, is_csp_bypassing, is_fetch_enabled}; is_secure, is_cors_enabled, is_csp_bypassing, is_fetch_enabled};
CefContentClient::Get()->AddCustomScheme(scheme_info); AlloyContentClient::Get()->AddCustomScheme(scheme_info);
return true; return true;
} }

View File

@ -4,7 +4,7 @@
#include "include/cef_urlrequest.h" #include "include/cef_urlrequest.h"
#include "libcef/browser/net_service/browser_urlrequest_impl.h" #include "libcef/browser/net_service/browser_urlrequest_impl.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/task_runner_impl.h" #include "libcef/common/task_runner_impl.h"
#include "libcef/renderer/render_urlrequest_impl.h" #include "libcef/renderer/render_urlrequest_impl.h"
@ -27,14 +27,14 @@ CefRefPtr<CefURLRequest> CefURLRequest::Create(
return nullptr; return nullptr;
} }
if (CefContentClient::Get()->browser()) { if (AlloyContentClient::Get()->browser()) {
// In the browser process. // In the browser process.
CefRefPtr<CefBrowserURLRequest> impl = CefRefPtr<CefBrowserURLRequest> impl =
new CefBrowserURLRequest(nullptr, request, client, request_context); new CefBrowserURLRequest(nullptr, request, client, request_context);
if (impl->Start()) if (impl->Start())
return impl.get(); return impl.get();
return nullptr; return nullptr;
} else if (CefContentClient::Get()->renderer()) { } else if (AlloyContentClient::Get()->renderer()) {
// In the render process. // In the render process.
CefRefPtr<CefRenderURLRequest> impl = CefRefPtr<CefRenderURLRequest> impl =
new CefRenderURLRequest(nullptr, request, client); new CefRenderURLRequest(nullptr, request, client);

View File

@ -478,7 +478,7 @@ void CefWidevineLoader::AddContentDecryptionModules(
} }
// The Widevine CDM path is passed to the zygote process via // The Widevine CDM path is passed to the zygote process via
// CefContentBrowserClient::AppendExtraCommandLineSwitches. // AlloyContentBrowserClient::AppendExtraCommandLineSwitches.
const base::FilePath& base_path = const base::FilePath& base_path =
command_line.GetSwitchValuePath(switches::kWidevineCdmPath); command_line.GetSwitchValuePath(switches::kWidevineCdmPath);
if (base_path.empty()) if (base_path.empty())

View File

@ -44,7 +44,7 @@ class CefWidevineLoader {
// The zygote process which is used when the sandbox is enabled on Linux // The zygote process which is used when the sandbox is enabled on Linux
// requires early loading of CDM modules. Other processes will receive // requires early loading of CDM modules. Other processes will receive
// load notification in the usual way. // load notification in the usual way.
// Called from CefContentClient::AddContentDecryptionModules. // Called from AlloyContentClient::AddContentDecryptionModules.
static void AddContentDecryptionModules( static void AddContentDecryptionModules(
std::vector<content::CdmInfo>* cdms, std::vector<content::CdmInfo>* cdms,
std::vector<media::CdmHostFilePath>* cdm_host_file_paths); std::vector<media::CdmHostFilePath>* cdm_host_file_paths);

View File

@ -2,8 +2,8 @@
// reserved. Use of this source code is governed by a BSD-style license that // reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file. // can be found in the LICENSE file.
#ifndef CEF_LIBCEF_FEATURES_CHROME_CEF_H_ #ifndef CEF_LIBCEF_FEATURES_RUNTIME_H_
#define CEF_LIBCEF_FEATURES_CHROME_CEF_H_ #define CEF_LIBCEF_FEATURES_RUNTIME_H_
#pragma once #pragma once
#include "cef/libcef/features/features.h" #include "cef/libcef/features/features.h"
@ -16,8 +16,8 @@ inline bool IsCefBuildEnabled() {
return true; return true;
} }
// True if CEF was initialized with the CEF runtime. // True if CEF was initialized with the Alloy runtime.
bool IsCefRuntimeEnabled(); bool IsAlloyRuntimeEnabled();
// True if CEF was initialized with the Chrome runtime. // True if CEF was initialized with the Chrome runtime.
bool IsChromeRuntimeEnabled(); bool IsChromeRuntimeEnabled();
@ -27,7 +27,7 @@ bool IsChromeRuntimeEnabled();
inline bool IsCefBuildEnabled() { inline bool IsCefBuildEnabled() {
return false; return false;
} }
inline bool IsCefRuntimeEnabled() { inline bool IsAlloyRuntimeEnabled() {
return false; return false;
} }
inline bool IsChromeRuntimeEnabled() { inline bool IsChromeRuntimeEnabled() {
@ -38,4 +38,4 @@ inline bool IsChromeRuntimeEnabled() {
} // namespace cef } // namespace cef
#endif // CEF_LIBCEF_FEATURES_CHROME_CEF_H_ #endif // CEF_LIBCEF_FEATURES_RUNTIME_H_

View File

@ -3,7 +3,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/renderer/content_renderer_client.h" #include "libcef/renderer/alloy/alloy_content_renderer_client.h"
#include <utility> #include <utility>
@ -20,11 +20,11 @@
#endif #endif
#endif #endif
#include "libcef/browser/content_browser_client.h" #include "libcef/browser/alloy/alloy_content_browser_client.h"
#include "libcef/browser/context.h" #include "libcef/browser/context.h"
#include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/cef_messages.h" #include "libcef/common/cef_messages.h"
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
#include "libcef/common/content_client.h"
#include "libcef/common/extensions/extensions_client.h" #include "libcef/common/extensions/extensions_client.h"
#include "libcef/common/extensions/extensions_util.h" #include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/request_impl.h" #include "libcef/common/request_impl.h"
@ -154,13 +154,13 @@ class CefGuestView : public content::RenderViewObserver {
private: private:
// RenderViewObserver methods. // RenderViewObserver methods.
void OnDestruct() override { void OnDestruct() override {
CefContentRendererClient::Get()->OnGuestViewDestroyed(this); AlloyContentRendererClient::Get()->OnGuestViewDestroyed(this);
} }
const bool is_windowless_; const bool is_windowless_;
}; };
CefContentRendererClient::CefContentRendererClient() AlloyContentRendererClient::AlloyContentRendererClient()
: main_entry_time_(base::TimeTicks::Now()), : main_entry_time_(base::TimeTicks::Now()),
devtools_agent_count_(0), devtools_agent_count_(0),
uncaught_exception_stack_size_(0), uncaught_exception_stack_size_(0),
@ -175,15 +175,15 @@ CefContentRendererClient::CefContentRendererClient()
} }
} }
CefContentRendererClient::~CefContentRendererClient() {} AlloyContentRendererClient::~AlloyContentRendererClient() {}
// static // static
CefContentRendererClient* CefContentRendererClient::Get() { AlloyContentRendererClient* AlloyContentRendererClient::Get() {
return static_cast<CefContentRendererClient*>( return static_cast<AlloyContentRendererClient*>(
CefContentClient::Get()->renderer()); AlloyContentClient::Get()->renderer());
} }
CefRefPtr<CefBrowserImpl> CefContentRendererClient::GetBrowserForView( CefRefPtr<CefBrowserImpl> AlloyContentRendererClient::GetBrowserForView(
content::RenderView* view) { content::RenderView* view) {
CEF_REQUIRE_RT_RETURN(nullptr); CEF_REQUIRE_RT_RETURN(nullptr);
@ -193,7 +193,7 @@ CefRefPtr<CefBrowserImpl> CefContentRendererClient::GetBrowserForView(
return nullptr; return nullptr;
} }
CefRefPtr<CefBrowserImpl> CefContentRendererClient::GetBrowserForMainFrame( CefRefPtr<CefBrowserImpl> AlloyContentRendererClient::GetBrowserForMainFrame(
blink::WebFrame* frame) { blink::WebFrame* frame) {
CEF_REQUIRE_RT_RETURN(nullptr); CEF_REQUIRE_RT_RETURN(nullptr);
@ -209,7 +209,7 @@ CefRefPtr<CefBrowserImpl> CefContentRendererClient::GetBrowserForMainFrame(
return nullptr; return nullptr;
} }
void CefContentRendererClient::OnBrowserDestroyed(CefBrowserImpl* browser) { void AlloyContentRendererClient::OnBrowserDestroyed(CefBrowserImpl* browser) {
BrowserMap::iterator it = browsers_.begin(); BrowserMap::iterator it = browsers_.begin();
for (; it != browsers_.end(); ++it) { for (; it != browsers_.end(); ++it) {
if (it->second.get() == browser) { if (it->second.get() == browser) {
@ -222,7 +222,7 @@ void CefContentRendererClient::OnBrowserDestroyed(CefBrowserImpl* browser) {
NOTREACHED(); NOTREACHED();
} }
CefGuestView* CefContentRendererClient::GetGuestViewForView( CefGuestView* AlloyContentRendererClient::GetGuestViewForView(
content::RenderView* view) { content::RenderView* view) {
CEF_REQUIRE_RT_RETURN(nullptr); CEF_REQUIRE_RT_RETURN(nullptr);
@ -232,7 +232,8 @@ CefGuestView* CefContentRendererClient::GetGuestViewForView(
return nullptr; return nullptr;
} }
void CefContentRendererClient::OnGuestViewDestroyed(CefGuestView* guest_view) { void AlloyContentRendererClient::OnGuestViewDestroyed(
CefGuestView* guest_view) {
GuestViewMap::iterator it = guest_views_.begin(); GuestViewMap::iterator it = guest_views_.begin();
for (; it != guest_views_.end(); ++it) { for (; it != guest_views_.end(); ++it) {
if (it->second.get() == guest_view) { if (it->second.get() == guest_view) {
@ -246,7 +247,7 @@ void CefContentRendererClient::OnGuestViewDestroyed(CefGuestView* guest_view) {
} }
blink::WebURLLoaderFactory* blink::WebURLLoaderFactory*
CefContentRendererClient::GetDefaultURLLoaderFactory() { AlloyContentRendererClient::GetDefaultURLLoaderFactory() {
if (!default_url_loader_factory_) { if (!default_url_loader_factory_) {
default_url_loader_factory_ = default_url_loader_factory_ =
blink::Platform::Current()->CreateDefaultURLLoaderFactory(); blink::Platform::Current()->CreateDefaultURLLoaderFactory();
@ -254,7 +255,7 @@ CefContentRendererClient::GetDefaultURLLoaderFactory() {
return default_url_loader_factory_.get(); return default_url_loader_factory_.get();
} }
void CefContentRendererClient::WebKitInitialized() { void AlloyContentRendererClient::WebKitInitialized() {
const base::CommandLine* command_line = const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess(); base::CommandLine::ForCurrentProcess();
@ -264,14 +265,14 @@ void CefContentRendererClient::WebKitInitialized() {
// TODO(cef): Enable these once the implementation supports it. // TODO(cef): Enable these once the implementation supports it.
blink::WebRuntimeFeatures::EnableNotifications(false); blink::WebRuntimeFeatures::EnableNotifications(false);
const CefContentClient::SchemeInfoList* schemes = const AlloyContentClient::SchemeInfoList* schemes =
CefContentClient::Get()->GetCustomSchemes(); AlloyContentClient::Get()->GetCustomSchemes();
if (!schemes->empty()) { if (!schemes->empty()) {
// Register the custom schemes. The |is_standard| value is excluded here // Register the custom schemes. The |is_standard| value is excluded here
// because it's not explicitly registered with Blink. // because it's not explicitly registered with Blink.
CefContentClient::SchemeInfoList::const_iterator it = schemes->begin(); AlloyContentClient::SchemeInfoList::const_iterator it = schemes->begin();
for (; it != schemes->end(); ++it) { for (; it != schemes->end(); ++it) {
const CefContentClient::SchemeInfo& info = *it; const AlloyContentClient::SchemeInfo& info = *it;
const blink::WebString& scheme = const blink::WebString& scheme =
blink::WebString::FromUTF8(info.scheme_name); blink::WebString::FromUTF8(info.scheme_name);
if (info.is_local) if (info.is_local)
@ -318,7 +319,7 @@ void CefContentRendererClient::WebKitInitialized() {
} }
// Notify the render process handler. // Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application(); CefRefPtr<CefApp> application = AlloyContentClient::Get()->application();
if (application.get()) { if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler = CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler(); application->GetRenderProcessHandler();
@ -328,14 +329,14 @@ void CefContentRendererClient::WebKitInitialized() {
} }
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
CefContentRendererClient::GetCurrentTaskRunner() { AlloyContentRendererClient::GetCurrentTaskRunner() {
// Check if currently on the render thread. // Check if currently on the render thread.
if (CEF_CURRENTLY_ON_RT()) if (CEF_CURRENTLY_ON_RT())
return render_task_runner_; return render_task_runner_;
return nullptr; return nullptr;
} }
void CefContentRendererClient::RunSingleProcessCleanup() { void AlloyContentRendererClient::RunSingleProcessCleanup() {
DCHECK(content::RenderProcessHost::run_renderer_in_process()); DCHECK(content::RenderProcessHost::run_renderer_in_process());
// Make sure the render thread was actually started. // Make sure the render thread was actually started.
@ -347,7 +348,8 @@ void CefContentRendererClient::RunSingleProcessCleanup() {
} else { } else {
base::PostTask( base::PostTask(
FROM_HERE, {content::BrowserThread::UI}, FROM_HERE, {content::BrowserThread::UI},
base::Bind(&CefContentRendererClient::RunSingleProcessCleanupOnUIThread, base::Bind(
&AlloyContentRendererClient::RunSingleProcessCleanupOnUIThread,
base::Unretained(this))); base::Unretained(this)));
} }
@ -365,7 +367,7 @@ void CefContentRendererClient::RunSingleProcessCleanup() {
} while (!complete); } while (!complete);
} }
void CefContentRendererClient::RenderThreadStarted() { void AlloyContentRendererClient::RenderThreadStarted() {
const base::CommandLine* command_line = const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess(); base::CommandLine::ForCurrentProcess();
@ -425,7 +427,7 @@ void CefContentRendererClient::RenderThreadStarted() {
extensions_renderer_client_->RenderThreadStarted(); extensions_renderer_client_->RenderThreadStarted();
} }
void CefContentRendererClient::ExposeInterfacesToBrowser( void AlloyContentRendererClient::ExposeInterfacesToBrowser(
mojo::BinderMap* binders) { mojo::BinderMap* binders) {
auto task_runner = base::SequencedTaskRunnerHandle::Get(); auto task_runner = base::SequencedTaskRunnerHandle::Get();
@ -446,7 +448,7 @@ void CefContentRendererClient::ExposeInterfacesToBrowser(
} }
} }
void CefContentRendererClient::RenderThreadConnected() { void AlloyContentRendererClient::RenderThreadConnected() {
content::RenderThread* thread = content::RenderThread::Get(); content::RenderThread* thread = content::RenderThread::Get();
// Retrieve the new render thread information synchronously. // Retrieve the new render thread information synchronously.
@ -457,7 +459,7 @@ void CefContentRendererClient::RenderThreadConnected() {
cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries; cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries;
// Notify the render process handler. // Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application(); CefRefPtr<CefApp> application = AlloyContentClient::Get()->application();
if (application.get()) { if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler = CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler(); application->GetRenderProcessHandler();
@ -475,7 +477,7 @@ void CefContentRendererClient::RenderThreadConnected() {
WebKitInitialized(); WebKitInitialized();
} }
void CefContentRendererClient::RenderFrameCreated( void AlloyContentRendererClient::RenderFrameCreated(
content::RenderFrame* render_frame) { content::RenderFrame* render_frame) {
CefRenderFrameObserver* render_frame_observer = CefRenderFrameObserver* render_frame_observer =
new CefRenderFrameObserver(render_frame); new CefRenderFrameObserver(render_frame);
@ -517,14 +519,14 @@ void CefContentRendererClient::RenderFrameCreated(
} }
} }
void CefContentRendererClient::RenderViewCreated( void AlloyContentRendererClient::RenderViewCreated(
content::RenderView* render_view) { content::RenderView* render_view) {
new CefPrerendererClient(render_view); new CefPrerendererClient(render_view);
MaybeCreateBrowser(render_view, render_view->GetMainRenderFrame(), nullptr); MaybeCreateBrowser(render_view, render_view->GetMainRenderFrame(), nullptr);
} }
bool CefContentRendererClient::IsPluginHandledExternally( bool AlloyContentRendererClient::IsPluginHandledExternally(
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
const blink::WebElement& plugin_element, const blink::WebElement& plugin_element,
const GURL& original_url, const GURL& original_url,
@ -562,7 +564,7 @@ bool CefContentRendererClient::IsPluginHandledExternally(
plugin_info->plugin); plugin_info->plugin);
} }
bool CefContentRendererClient::OverrideCreatePlugin( bool AlloyContentRendererClient::OverrideCreatePlugin(
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
const blink::WebPluginParams& params, const blink::WebPluginParams& params,
blink::WebPlugin** plugin) { blink::WebPlugin** plugin) {
@ -584,7 +586,7 @@ bool CefContentRendererClient::OverrideCreatePlugin(
return true; return true;
} }
void CefContentRendererClient::WillSendRequest( void AlloyContentRendererClient::WillSendRequest(
blink::WebLocalFrame* frame, blink::WebLocalFrame* frame,
ui::PageTransition transition_type, ui::PageTransition transition_type,
const blink::WebURL& url, const blink::WebURL& url,
@ -601,23 +603,23 @@ void CefContentRendererClient::WillSendRequest(
} }
} }
uint64_t CefContentRendererClient::VisitedLinkHash(const char* canonical_url, uint64_t AlloyContentRendererClient::VisitedLinkHash(const char* canonical_url,
size_t length) { size_t length) {
return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); return visited_link_slave_->ComputeURLFingerprint(canonical_url, length);
} }
bool CefContentRendererClient::IsLinkVisited(uint64_t link_hash) { bool AlloyContentRendererClient::IsLinkVisited(uint64_t link_hash) {
return visited_link_slave_->IsVisited(link_hash); return visited_link_slave_->IsVisited(link_hash);
} }
bool CefContentRendererClient::IsOriginIsolatedPepperPlugin( bool AlloyContentRendererClient::IsOriginIsolatedPepperPlugin(
const base::FilePath& plugin_path) { const base::FilePath& plugin_path) {
return plugin_path == return plugin_path ==
base::FilePath::FromUTF8Unsafe(CefContentClient::kPDFPluginPath); base::FilePath::FromUTF8Unsafe(AlloyContentClient::kPDFPluginPath);
} }
content::BrowserPluginDelegate* content::BrowserPluginDelegate*
CefContentRendererClient::CreateBrowserPluginDelegate( AlloyContentRendererClient::CreateBrowserPluginDelegate(
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
const content::WebPluginInfo& info, const content::WebPluginInfo& info,
const std::string& mime_type, const std::string& mime_type,
@ -627,35 +629,35 @@ CefContentRendererClient::CreateBrowserPluginDelegate(
render_frame, info, mime_type, original_url); render_frame, info, mime_type, original_url);
} }
void CefContentRendererClient::AddSupportedKeySystems( void AlloyContentRendererClient::AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) { std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) {
AddChromeKeySystems(key_systems); AddChromeKeySystems(key_systems);
} }
void CefContentRendererClient::RunScriptsAtDocumentStart( void AlloyContentRendererClient::RunScriptsAtDocumentStart(
content::RenderFrame* render_frame) { content::RenderFrame* render_frame) {
if (extensions::ExtensionsEnabled()) if (extensions::ExtensionsEnabled())
extensions_renderer_client_->RunScriptsAtDocumentStart(render_frame); extensions_renderer_client_->RunScriptsAtDocumentStart(render_frame);
} }
void CefContentRendererClient::RunScriptsAtDocumentEnd( void AlloyContentRendererClient::RunScriptsAtDocumentEnd(
content::RenderFrame* render_frame) { content::RenderFrame* render_frame) {
if (extensions::ExtensionsEnabled()) if (extensions::ExtensionsEnabled())
extensions_renderer_client_->RunScriptsAtDocumentEnd(render_frame); extensions_renderer_client_->RunScriptsAtDocumentEnd(render_frame);
} }
void CefContentRendererClient::RunScriptsAtDocumentIdle( void AlloyContentRendererClient::RunScriptsAtDocumentIdle(
content::RenderFrame* render_frame) { content::RenderFrame* render_frame) {
if (extensions::ExtensionsEnabled()) if (extensions::ExtensionsEnabled())
extensions_renderer_client_->RunScriptsAtDocumentIdle(render_frame); extensions_renderer_client_->RunScriptsAtDocumentIdle(render_frame);
} }
void CefContentRendererClient::DevToolsAgentAttached() { void AlloyContentRendererClient::DevToolsAgentAttached() {
// WebWorkers may be creating agents on a different thread. // WebWorkers may be creating agents on a different thread.
if (!render_task_runner_->BelongsToCurrentThread()) { if (!render_task_runner_->BelongsToCurrentThread()) {
render_task_runner_->PostTask( render_task_runner_->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&CefContentRendererClient::DevToolsAgentAttached, base::BindOnce(&AlloyContentRendererClient::DevToolsAgentAttached,
base::Unretained(this))); base::Unretained(this)));
return; return;
} }
@ -663,12 +665,12 @@ void CefContentRendererClient::DevToolsAgentAttached() {
++devtools_agent_count_; ++devtools_agent_count_;
} }
void CefContentRendererClient::DevToolsAgentDetached() { void AlloyContentRendererClient::DevToolsAgentDetached() {
// WebWorkers may be creating agents on a different thread. // WebWorkers may be creating agents on a different thread.
if (!render_task_runner_->BelongsToCurrentThread()) { if (!render_task_runner_->BelongsToCurrentThread()) {
render_task_runner_->PostTask( render_task_runner_->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&CefContentRendererClient::DevToolsAgentDetached, base::BindOnce(&AlloyContentRendererClient::DevToolsAgentDetached,
base::Unretained(this))); base::Unretained(this)));
return; return;
} }
@ -682,19 +684,19 @@ void CefContentRendererClient::DevToolsAgentDetached() {
} }
std::unique_ptr<content::URLLoaderThrottleProvider> std::unique_ptr<content::URLLoaderThrottleProvider>
CefContentRendererClient::CreateURLLoaderThrottleProvider( AlloyContentRendererClient::CreateURLLoaderThrottleProvider(
content::URLLoaderThrottleProviderType provider_type) { content::URLLoaderThrottleProviderType provider_type) {
return std::make_unique<CefURLLoaderThrottleProviderImpl>(provider_type); return std::make_unique<CefURLLoaderThrottleProviderImpl>(provider_type);
} }
bool CefContentRendererClient::RequiresWebComponentsV0(const GURL& url) { bool AlloyContentRendererClient::RequiresWebComponentsV0(const GURL& url) {
// TODO(1025782): For now, file:// URLs are allowed to access Web Components // TODO(1025782): For now, file:// URLs are allowed to access Web Components
// v0 features. This will be removed once origin trials support file:// URLs // v0 features. This will be removed once origin trials support file:// URLs
// for this purpose. // for this purpose.
return url.SchemeIs(content::kChromeUIScheme) || url.SchemeIs("file"); return url.SchemeIs(content::kChromeUIScheme) || url.SchemeIs("file");
} }
void CefContentRendererClient::GetInterface( void AlloyContentRendererClient::GetInterface(
const std::string& interface_name, const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) { mojo::ScopedMessagePipeHandle interface_pipe) {
// TODO(crbug.com/977637): Get rid of the use of this implementation of // TODO(crbug.com/977637): Get rid of the use of this implementation of
@ -706,12 +708,12 @@ void CefContentRendererClient::GetInterface(
mojo::GenericPendingReceiver(interface_name, std::move(interface_pipe))); mojo::GenericPendingReceiver(interface_name, std::move(interface_pipe)));
} }
void CefContentRendererClient::WillDestroyCurrentMessageLoop() { void AlloyContentRendererClient::WillDestroyCurrentMessageLoop() {
base::AutoLock lock_scope(single_process_cleanup_lock_); base::AutoLock lock_scope(single_process_cleanup_lock_);
single_process_cleanup_complete_ = true; single_process_cleanup_complete_ = true;
} }
CefRefPtr<CefBrowserImpl> CefContentRendererClient::MaybeCreateBrowser( CefRefPtr<CefBrowserImpl> AlloyContentRendererClient::MaybeCreateBrowser(
content::RenderView* render_view, content::RenderView* render_view,
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
base::Optional<bool>* is_windowless) { base::Optional<bool>* is_windowless) {
@ -776,7 +778,7 @@ CefRefPtr<CefBrowserImpl> CefContentRendererClient::MaybeCreateBrowser(
browsers_.insert(std::make_pair(render_view, browser)); browsers_.insert(std::make_pair(render_view, browser));
// Notify the render process handler. // Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application(); CefRefPtr<CefApp> application = AlloyContentClient::Get()->application();
if (application.get()) { if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler = CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler(); application->GetRenderProcessHandler();
@ -791,7 +793,7 @@ CefRefPtr<CefBrowserImpl> CefContentRendererClient::MaybeCreateBrowser(
return browser; return browser;
} }
void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() { void AlloyContentRendererClient::RunSingleProcessCleanupOnUIThread() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
// Clean up the single existing RenderProcessHost. // Clean up the single existing RenderProcessHost.

View File

@ -3,8 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CEF_LIBCEF_RENDERER_CONTENT_RENDERER_CLIENT_H_ #ifndef CEF_LIBCEF_RENDERER_ALLOY_ALLOY_CONTENT_RENDERER_CLIENT_H_
#define CEF_LIBCEF_RENDERER_CONTENT_RENDERER_CLIENT_H_ #define CEF_LIBCEF_RENDERER_ALLOY_ALLOY_CONTENT_RENDERER_CLIENT_H_
#pragma once #pragma once
#include <list> #include <list>
@ -53,16 +53,16 @@ struct Cef_CrossOriginWhiteListEntry_Params;
class ChromePDFPrintClient; class ChromePDFPrintClient;
class SpellCheck; class SpellCheck;
class CefContentRendererClient class AlloyContentRendererClient
: public content::ContentRendererClient, : public content::ContentRendererClient,
public service_manager::LocalInterfaceProvider, public service_manager::LocalInterfaceProvider,
public base::MessageLoopCurrent::DestructionObserver { public base::MessageLoopCurrent::DestructionObserver {
public: public:
CefContentRendererClient(); AlloyContentRendererClient();
~CefContentRendererClient() override; ~AlloyContentRendererClient() override;
// Returns the singleton CefContentRendererClient instance. // Returns the singleton AlloyContentRendererClient instance.
static CefContentRendererClient* Get(); static AlloyContentRendererClient* Get();
// Returns the browser associated with the specified RenderView. // Returns the browser associated with the specified RenderView.
CefRefPtr<CefBrowserImpl> GetBrowserForView(content::RenderView* view); CefRefPtr<CefBrowserImpl> GetBrowserForView(content::RenderView* view);
@ -200,7 +200,7 @@ class CefContentRendererClient
bool single_process_cleanup_complete_; bool single_process_cleanup_complete_;
base::Lock single_process_cleanup_lock_; base::Lock single_process_cleanup_lock_;
DISALLOW_COPY_AND_ASSIGN(CefContentRendererClient); DISALLOW_COPY_AND_ASSIGN(AlloyContentRendererClient);
}; };
#endif // CEF_LIBCEF_RENDERER_CONTENT_RENDERER_CLIENT_H_ #endif // CEF_LIBCEF_RENDERER_ALLOY_ALLOY_CONTENT_RENDERER_CLIENT_H_

View File

@ -8,10 +8,10 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/cef_messages.h" #include "libcef/common/cef_messages.h"
#include "libcef/common/content_client.h" #include "libcef/renderer/alloy/alloy_content_renderer_client.h"
#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/blink_glue.h"
#include "libcef/renderer/content_renderer_client.h"
#include "libcef/renderer/render_frame_util.h" #include "libcef/renderer/render_frame_util.h"
#include "libcef/renderer/thread_util.h" #include "libcef/renderer/thread_util.h"
@ -38,13 +38,13 @@
// static // static
CefRefPtr<CefBrowserImpl> CefBrowserImpl::GetBrowserForView( CefRefPtr<CefBrowserImpl> CefBrowserImpl::GetBrowserForView(
content::RenderView* view) { content::RenderView* view) {
return CefContentRendererClient::Get()->GetBrowserForView(view); return AlloyContentRendererClient::Get()->GetBrowserForView(view);
} }
// static // static
CefRefPtr<CefBrowserImpl> CefBrowserImpl::GetBrowserForMainFrame( CefRefPtr<CefBrowserImpl> CefBrowserImpl::GetBrowserForMainFrame(
blink::WebFrame* frame) { blink::WebFrame* frame) {
return CefContentRendererClient::Get()->GetBrowserForMainFrame(frame); return AlloyContentRendererClient::Get()->GetBrowserForMainFrame(frame);
} }
// CefBrowser methods. // CefBrowser methods.
@ -345,14 +345,14 @@ void CefBrowserImpl::AddFrameObject(int64_t frame_id,
void CefBrowserImpl::OnDestruct() { void CefBrowserImpl::OnDestruct() {
// Notify that the browser window has been destroyed. // Notify that the browser window has been destroyed.
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app.get()) { if (app.get()) {
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler(); CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
if (handler.get()) if (handler.get())
handler->OnBrowserDestroyed(this); handler->OnBrowserDestroyed(this);
} }
CefContentRendererClient::Get()->OnBrowserDestroyed(this); AlloyContentRendererClient::Get()->OnBrowserDestroyed(this);
} }
void CefBrowserImpl::FrameDetached(int64_t frame_id) { void CefBrowserImpl::FrameDetached(int64_t frame_id) {
@ -373,7 +373,7 @@ void CefBrowserImpl::FrameDetached(int64_t frame_id) {
} }
void CefBrowserImpl::OnLoadingStateChange(bool isLoading) { void CefBrowserImpl::OnLoadingStateChange(bool isLoading) {
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app.get()) { if (app.get()) {
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler(); CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
if (handler.get()) { if (handler.get()) {

View File

@ -59,7 +59,7 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
const GURL& scope, const GURL& scope,
const GURL& script_url) const override; const GURL& script_url) const override;
// See CefContentRendererClient methods with the same names. // See AlloyContentRendererClient methods with the same names.
void RenderThreadStarted(); void RenderThreadStarted();
void RenderFrameCreated(content::RenderFrame* render_frame, void RenderFrameCreated(content::RenderFrame* render_frame,
service_manager::BinderRegistry* registry); service_manager::BinderRegistry* registry);

View File

@ -17,8 +17,8 @@
#endif #endif
#endif #endif
#include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/cef_messages.h" #include "libcef/common/cef_messages.h"
#include "libcef/common/content_client.h"
#include "libcef/common/net/http_header_utils.h" #include "libcef/common/net/http_header_utils.h"
#include "libcef/common/process_message_impl.h" #include "libcef/common/process_message_impl.h"
#include "libcef/common/request_impl.h" #include "libcef/common/request_impl.h"
@ -325,7 +325,7 @@ void CefFrameImpl::OnDidFinishLoad() {
Send(new CefHostMsg_DidFinishLoad(MSG_ROUTING_NONE, dl->GetUrl(), Send(new CefHostMsg_DidFinishLoad(MSG_ROUTING_NONE, dl->GetUrl(),
http_status_code)); http_status_code));
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app) { if (app) {
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler(); CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
if (handler) { if (handler) {
@ -417,7 +417,7 @@ void CefFrameImpl::OnRequest(const Cef_Request_Params& params) {
if (params.user_initiated) { if (params.user_initiated) {
// Give the user a chance to handle the request. // Give the user a chance to handle the request.
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app.get()) { if (app.get()) {
CefRefPtr<CefRenderProcessHandler> handler = CefRefPtr<CefRenderProcessHandler> handler =
app->GetRenderProcessHandler(); app->GetRenderProcessHandler();

View File

@ -17,7 +17,7 @@
#include "libcef/renderer/render_frame_observer.h" #include "libcef/renderer/render_frame_observer.h"
#include "libcef/common/content_client.h" #include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/blink_glue.h"
#include "libcef/renderer/browser_impl.h" #include "libcef/renderer/browser_impl.h"
#include "libcef/renderer/dom_document_impl.h" #include "libcef/renderer/dom_document_impl.h"
@ -96,7 +96,7 @@ void CefRenderFrameObserver::FocusedElementChanged(
return; return;
CefRefPtr<CefRenderProcessHandler> handler; CefRefPtr<CefRenderProcessHandler> handler;
CefRefPtr<CefApp> application = CefContentClient::Get()->application(); CefRefPtr<CefApp> application = AlloyContentClient::Get()->application();
if (application) if (application)
handler = application->GetRenderProcessHandler(); handler = application->GetRenderProcessHandler();
if (!handler) if (!handler)
@ -138,7 +138,7 @@ void CefRenderFrameObserver::DidCreateScriptContext(
return; return;
CefRefPtr<CefRenderProcessHandler> handler; CefRefPtr<CefRenderProcessHandler> handler;
CefRefPtr<CefApp> application = CefContentClient::Get()->application(); CefRefPtr<CefApp> application = AlloyContentClient::Get()->application();
if (application) if (application)
handler = application->GetRenderProcessHandler(); handler = application->GetRenderProcessHandler();
if (!handler) if (!handler)
@ -164,7 +164,7 @@ void CefRenderFrameObserver::WillReleaseScriptContext(
CefRefPtr<CefBrowserImpl> browserPtr = CefRefPtr<CefBrowserImpl> browserPtr =
CefBrowserImpl::GetBrowserForMainFrame(frame->Top()); CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
if (browserPtr) { if (browserPtr) {
CefRefPtr<CefApp> application = CefContentClient::Get()->application(); CefRefPtr<CefApp> application = AlloyContentClient::Get()->application();
if (application) { if (application) {
CefRefPtr<CefRenderProcessHandler> handler = CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler(); application->GetRenderProcessHandler();
@ -210,7 +210,7 @@ void CefRenderFrameObserver::AttachFrame(CefFrameImpl* frame) {
} }
void CefRenderFrameObserver::OnLoadStart() { void CefRenderFrameObserver::OnLoadStart() {
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app.get()) { if (app.get()) {
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler(); CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
if (handler.get()) { if (handler.get()) {
@ -226,7 +226,7 @@ void CefRenderFrameObserver::OnLoadStart() {
} }
void CefRenderFrameObserver::OnLoadError() { void CefRenderFrameObserver::OnLoadError() {
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = AlloyContentClient::Get()->application();
if (app.get()) { if (app.get()) {
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler(); CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
if (handler.get()) { if (handler.get()) {

View File

@ -8,7 +8,6 @@
#include "libcef/common/cef_messages.h" #include "libcef/common/cef_messages.h"
#include "libcef/common/net/net_resource_provider.h" #include "libcef/common/net/net_resource_provider.h"
#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/blink_glue.h"
#include "libcef/renderer/content_renderer_client.h"
#include "components/visitedlink/renderer/visitedlink_reader.h" #include "components/visitedlink/renderer/visitedlink_reader.h"
#include "content/public/child/child_thread.h" #include "content/public/child/child_thread.h"

View File

@ -9,8 +9,8 @@
#include "libcef/common/request_impl.h" #include "libcef/common/request_impl.h"
#include "libcef/common/response_impl.h" #include "libcef/common/response_impl.h"
#include "libcef/common/task_runner_impl.h" #include "libcef/common/task_runner_impl.h"
#include "libcef/renderer/alloy/alloy_content_renderer_client.h"
#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/blink_glue.h"
#include "libcef/renderer/content_renderer_client.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
@ -155,7 +155,7 @@ class CefRenderURLRequest::Context
} }
if (!factory) { if (!factory) {
// This factory only supports unintercepted http(s) and blob requests. // This factory only supports unintercepted http(s) and blob requests.
factory = CefContentRendererClient::Get()->GetDefaultURLLoaderFactory(); factory = AlloyContentRendererClient::Get()->GetDefaultURLLoaderFactory();
} }
loader_ = factory->CreateURLLoader( loader_ = factory->CreateURLLoader(

View File

@ -6,7 +6,7 @@
#define CEF_LIBCEF_RENDERER_THREAD_UTIL_H_ #define CEF_LIBCEF_RENDERER_THREAD_UTIL_H_
#pragma once #pragma once
#include "libcef/renderer/content_renderer_client.h" #include "libcef/common/task_runner_manager.h"
#include "base/location.h" #include "base/location.h"
#include "base/logging.h" #include "base/logging.h"
@ -28,12 +28,13 @@
return; \ return; \
} }
#define CEF_RENDER_LOOP() \ #define CEF_RENDER_TASK_RUNNER() \
(CefContentRendererClient::Get()->render_task_runner()) (CefTaskRunnerManager::Get()->GetRenderTaskRunner())
#define CEF_POST_TASK_RT(task) CEF_RENDER_LOOP()->PostTask(FROM_HERE, task) #define CEF_POST_TASK_RT(task) \
CEF_RENDER_TASK_RUNNER()->PostTask(FROM_HERE, task)
#define CEF_POST_DELAYED_TASK_RT(task, delay_ms) \ #define CEF_POST_DELAYED_TASK_RT(task, delay_ms) \
CEF_RENDER_LOOP()->PostDelayedTask( \ CEF_RENDER_TASK_RUNNER()->PostDelayedTask( \
FROM_HERE, task, base::TimeDelta::FromMilliseconds(delay_ms)) FROM_HERE, task, base::TimeDelta::FromMilliseconds(delay_ms))
// Use this template in conjuction with RefCountedThreadSafe when you want to // Use this template in conjuction with RefCountedThreadSafe when you want to
@ -44,7 +45,7 @@ struct CefDeleteOnRenderThread {
if (CEF_CURRENTLY_ON_RT()) { if (CEF_CURRENTLY_ON_RT()) {
delete x; delete x;
} else { } else {
if (!CEF_RENDER_LOOP()->DeleteSoon(FROM_HERE, x)) { if (!CEF_RENDER_TASK_RUNNER()->DeleteSoon(FROM_HERE, x)) {
#if defined(UNIT_TEST) #if defined(UNIT_TEST)
// Only logged under unit testing because leaks at shutdown // Only logged under unit testing because leaks at shutdown
// are acceptable under normal circumstances. // are acceptable under normal circumstances.

View File

@ -25,8 +25,8 @@
#include "libcef/renderer/v8_impl.h" #include "libcef/renderer/v8_impl.h"
#include "libcef/common/alloy/alloy_content_client.h"
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
#include "libcef/common/content_client.h"
#include "libcef/common/task_runner_impl.h" #include "libcef/common/task_runner_impl.h"
#include "libcef/common/tracker.h" #include "libcef/common/tracker.h"
#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/blink_glue.h"
@ -87,7 +87,7 @@ class CefV8IsolateManager {
public: public:
CefV8IsolateManager() CefV8IsolateManager()
: isolate_(v8::Isolate::GetCurrent()), : isolate_(v8::Isolate::GetCurrent()),
task_runner_(CefContentRendererClient::Get()->GetCurrentTaskRunner()), task_runner_(CEF_RENDER_TASK_RUNNER()),
message_listener_registered_(false), message_listener_registered_(false),
worker_id_(0) { worker_id_(0) {
DCHECK(isolate_); DCHECK(isolate_);
@ -783,7 +783,7 @@ class CefV8ExceptionImpl : public CefV8Exception {
void MessageListenerCallbackImpl(v8::Handle<v8::Message> message, void MessageListenerCallbackImpl(v8::Handle<v8::Message> message,
v8::Handle<v8::Value> data) { v8::Handle<v8::Value> data) {
CefRefPtr<CefApp> application = CefContentClient::Get()->application(); CefRefPtr<CefApp> application = AlloyContentClient::Get()->application();
if (!application.get()) if (!application.get())
return; return;

View File

@ -6,7 +6,7 @@ index c06585b15b8f..b5ed3518c0fd 100644
#include "build/branding_buildflags.h" #include "build/branding_buildflags.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "cc/base/switches.h" #include "cc/base/switches.h"
+#include "cef/libcef/features/chrome_cef.h" +#include "cef/libcef/features/runtime.h"
#include "chrome/browser/about_flags.h" #include "chrome/browser/about_flags.h"
#include "chrome/browser/active_use_util.h" #include "chrome/browser/active_use_util.h"
#include "chrome/browser/after_startup_task_utils.h" #include "chrome/browser/after_startup_task_utils.h"

View File

@ -6,7 +6,7 @@ index 75a5ee192358..379e0bdd11b1 100644
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
+#include "cef/libcef/features/chrome_cef.h" +#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@ -19,7 +19,7 @@ index 75a5ee192358..379e0bdd11b1 100644
// Configure on-disk storage for non-OTR profiles. OTR profiles just use // Configure on-disk storage for non-OTR profiles. OTR profiles just use
// default behavior (in memory storage, default sizes). // default behavior (in memory storage, default sizes).
- if (!in_memory) { - if (!in_memory) {
+ if (!in_memory && cef::IsCefRuntimeEnabled()) { + if (!in_memory && cef::IsAlloyRuntimeEnabled()) {
+ PrefService* prefs = profile_->GetPrefs(); + PrefService* prefs = profile_->GetPrefs();
+ // Configure the HTTP cache path and size. + // Configure the HTTP cache path and size.
+ const base::FilePath& base_cache_path = + const base::FilePath& base_cache_path =
@ -31,7 +31,7 @@ index 75a5ee192358..379e0bdd11b1 100644
+ prefs->GetInteger(prefs::kDiskCacheSize); + prefs->GetInteger(prefs::kDiskCacheSize);
+ } + }
+ +
+ if (!in_memory && !cef::IsCefRuntimeEnabled()) { + if (!in_memory && !cef::IsAlloyRuntimeEnabled()) {
PrefService* local_state = g_browser_process->local_state(); PrefService* local_state = g_browser_process->local_state();
// Configure the HTTP cache path and size. // Configure the HTTP cache path and size.
base::FilePath base_cache_path; base::FilePath base_cache_path;