Update to Chromium version 86.0.4240.0 (#800218)

- CefURLRequest::Create is no longer supported in the renderer process
  (see https://crbug.com/891872). Use CefFrame::CreateURLRequest instead.
- Mac platform definitions have been changed from `MACOSX` to `MAC`
  (see https://crbug.com/1105907) and related CMake macro names have
  been updated. The old `OS_MACOSX` define is still set in code and CMake
  for backwards compatibility.
- Linux ARM build is currently broken (see https://crbug.com/1123214).
This commit is contained in:
Marshall Greenblatt 2020-08-28 18:39:23 -04:00
parent 6b1e5335bc
commit 24c2f2fa38
190 changed files with 1302 additions and 1354 deletions

View File

@ -122,8 +122,8 @@ if (is_linux) {
import("//third_party/fontconfig/fontconfig.gni")
}
if (is_mac) {
import("//build/apple/tweak_info_plist.gni")
import("//build/config/mac/rules.gni")
import("//build/mac/tweak_info_plist.gni")
import("//build/util/version.gni")
import("//media/cdm/library_cdm/cdm_paths.gni")
import("//build/config/mac/base_rules.gni")
@ -808,7 +808,6 @@ static_library("libcef_static") {
deps = [
":cef_make_headers",
":cef_service_manifests",
":libcef_static_unittested",
@ -841,7 +840,7 @@ static_library("libcef_static") {
"//components/keyed_service/content:content",
"//components/keyed_service/core:core",
"//components/navigation_interception",
"//components/network_session_configurator/browser",
"//components/network_session_configurator/common",
"//components/pdf/browser",
"//components/pdf/renderer",
"//components/plugins/renderer",
@ -1167,7 +1166,6 @@ static_library("libcef_static") {
sources += [
# Support for UI input events.
# Part of //ui/aura:test_support which is testingonly.
"//ui/aura/test/ui_controls_factory_aurax11.cc",
"//ui/aura/test/x11_event_sender.cc",
"//ui/aura/test/x11_event_sender.h",
# Part of //ui/views:test_support which is testingonly.
@ -1252,56 +1250,6 @@ if (is_mac) {
}
}
#
# Service manifests.
#
source_set("cef_content_browser_overlay_manifest") {
sources = [
"libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc",
"libcef/common/service_manifests/cef_content_browser_overlay_manifest.h",
]
configs += [
"libcef/features:config"
]
deps = [
"//base",
"//extensions/buildflags",
"//extensions/common:mojom",
"//extensions/common/api:mojom",
"//services/service_manager/public/cpp",
"//third_party/blink/public/common",
]
}
source_set("cef_content_renderer_overlay_manifest") {
sources = [
"libcef/common/service_manifests/cef_content_renderer_overlay_manifest.h",
]
configs += [
"libcef/features:config"
]
deps = [
"//base",
"//components/subresource_filter/content/mojom",
"//extensions/buildflags",
"//extensions/common:mojom",
"//services/service_manager/public/cpp",
"//third_party/blink/public/common",
]
}
source_set("cef_service_manifests") {
public_deps = [
":cef_content_browser_overlay_manifest",
":cef_content_renderer_overlay_manifest",
]
}
#
# Resource grit/pack targets.
#
@ -1935,8 +1883,8 @@ if (is_mac) {
deps += invoker.deps
}
if (defined(invoker.libs)) {
libs = invoker.libs
if (defined(invoker.frameworks)) {
frameworks = invoker.frameworks
}
if (defined(invoker.defines)) {
@ -2020,7 +1968,7 @@ if (is_mac) {
":cefclient_resources_bundle_data_english",
":cefclient_xibs",
]
libs = [
frameworks = [
"AppKit.framework",
"OpenGL.framework",
]
@ -2084,7 +2032,7 @@ if (is_mac) {
":cefsimple_resources_bundle_data_english",
":cefsimple_xibs",
]
libs = [
frameworks = [
"AppKit.framework",
]
defines = [
@ -2155,7 +2103,7 @@ if (is_mac) {
":ceftests_xibs",
"//testing/gtest",
]
libs = [
frameworks = [
"AppKit.framework",
]
defines = [

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/85.0.4183.0'
'chromium_checkout': 'refs/tags/86.0.4240.0'
}

View File

@ -27,8 +27,6 @@
# Files in the chromium/src directory that should be evaluated for changes.
# Similar changes may need to be applied to the CEF source code.
'files': [
'chrome/app/chrome_*_manifest.*',
'chrome/app/chrome_*_manifests.*',
'chrome/browser/browser_process.h',
'chrome/browser/extensions/api/tabs/tabs_api.*',
'chrome/browser/extensions/chrome_component_extension_resource_manager.*',

View File

@ -25,7 +25,7 @@ macro(PRINT_CEF_CONFIG)
message(STATUS "Binary distribution root: ${_CEF_ROOT}")
if(OS_MACOSX)
if(OS_MAC)
message(STATUS "Base SDK: ${CMAKE_OSX_SYSROOT}")
message(STATUS "Target SDK: ${CEF_TARGET_SDK}")
endif()
@ -75,8 +75,8 @@ macro(APPEND_PLATFORM_SOURCES name_of_list)
if(OS_WINDOWS AND ${name_of_list}_WINDOWS)
list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS})
endif()
if(OS_MACOSX AND ${name_of_list}_MACOSX)
list(APPEND ${name_of_list} ${${name_of_list}_MACOSX})
if(OS_MAC AND ${name_of_list}_MAC)
list(APPEND ${name_of_list} ${${name_of_list}_MAC})
endif()
endmacro()
@ -184,10 +184,10 @@ endif(OS_LINUX)
# Mac OS X macros.
#
if(OS_MACOSX)
if(OS_MAC)
# Manually process and copy over resource files.
macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path)
macro(COPY_MAC_RESOURCES resource_list prefix_list target source_dir app_path)
foreach(FILENAME ${resource_list})
# Remove one or more prefixes from the source paths.
set(TARGET_FILENAME "${FILENAME}")
@ -229,7 +229,7 @@ macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path
endforeach()
endmacro()
endif(OS_MACOSX)
endif(OS_MAC)
#
@ -298,7 +298,7 @@ macro(SET_COMMON_TARGET_PROPERTIES target)
set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str})
endif()
if(OS_MACOSX)
if(OS_MAC)
# Set Xcode target properties.
set_target_properties(${target} PROPERTIES
XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO

View File

@ -14,7 +14,8 @@ endif()
# Determine the platform.
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(OS_MACOSX 1)
set(OS_MAC 1)
set(OS_MACOSX 1) # For backwards compatibility.
set(OS_POSIX 1)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(OS_LINUX 1)
@ -31,7 +32,7 @@ if(NOT DEFINED PROJECT_ARCH)
set(PROJECT_ARCH "x86")
endif()
if(OS_MACOSX)
if(OS_MAC)
# PROJECT_ARCH should be specified on Mac OS X.
message(WARNING "No PROJECT_ARCH value specified, using ${PROJECT_ARCH}")
endif()
@ -246,7 +247,7 @@ endif()
# Mac OS X configuration.
#
if(OS_MACOSX)
if(OS_MAC)
# Platform-specific compiler/linker flags.
# See also Xcode target properties in cef_macros.cmake.
set(CEF_LIBTYPE SHARED)

View File

@ -180,7 +180,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
#include "include/base/internal/cef_atomicops_x86_msvc.h"
#elif defined(OS_WIN) && (defined(__ARM_ARCH_ISA_A64) || defined(_M_ARM64))
#include "include/base/internal/cef_atomicops_arm64_msvc.h"
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
#include "include/base/internal/cef_atomicops_mac.h"
#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY)
#include "include/base/internal/cef_atomicops_x86_gcc.h"
@ -194,7 +194,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
// On some platforms we need additional declarations to make
// AtomicWord compatible with our other Atomic* types.
#if defined(OS_MACOSX) || defined(OS_OPENBSD)
#if defined(OS_MAC) || defined(OS_OPENBSD)
#include "include/base/internal/cef_atomicops_atomicword_compat.h"
#endif

View File

@ -42,7 +42,7 @@
//
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
// <inttypes.h> format macros even in the LP64 model.
#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
#if defined(__LP64__) && !defined(OS_MAC) && !defined(OS_OPENBSD)
typedef long int64;
typedef unsigned long uint64;
#else

View File

@ -44,6 +44,14 @@
#define OS_WIN 1
#endif
#elif defined(__APPLE__)
// New platform defines after https://crbug.com/1105907.
#ifndef OS_MAC
#define OS_MAC 1
#endif
#ifndef OS_APPLE
#define OS_APPLE 1
#endif
// Old platform defines retained for backwards compatibility.
#ifndef OS_MACOSX
#define OS_MACOSX 1
#endif
@ -57,7 +65,7 @@
// For access to standard POSIXish features, use OS_POSIX instead of a
// more specific macro.
#if defined(OS_MACOSX) || defined(OS_LINUX)
#if defined(OS_MAC) || defined(OS_LINUX)
#ifndef OS_POSIX
#define OS_POSIX 1
#endif

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=63d875f5a922dd2c2e1efaaf0ddaa20475f79ef8$
// $hash=75f4f7a9ff628a6ae699a697722caa5d49546784$
//
#ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_
@ -115,20 +115,13 @@ typedef struct _cef_urlrequest_t {
// Create a new URL request that is not associated with a specific browser or
// frame. Use cef_frame_t::CreateURLRequest instead if you want the request to
// have this association, in which case it may be handled differently (see
// documentation on that function). Requests may originate from the both browser
// process and the render process.
//
// For requests originating from the browser process:
// documentation on that function). A request created with this function may
// only originate from the browser process, and will behave as follows:
// - It may be intercepted by the client via CefResourceRequestHandler or
// CefSchemeHandlerFactory.
// - POST data may only contain only a single element of type PDE_TYPE_FILE
// or PDE_TYPE_BYTES.
// - If |request_context| is empty the global request context will be used.
// For requests originating from the render process:
// - It cannot be intercepted by the client so only http(s) and blob schemes
// are supported.
// - POST data may only contain a single element of type PDE_TYPE_BYTES.
// - The |request_context| parameter must be NULL.
//
// The |request| object will be marked as read-only after calling this function.
///

View File

@ -45,7 +45,7 @@
#define CEF_API_HASH_UNIVERSAL "09dba98bcfcdf8a84e6e1bddf9cfbfd02cdb9c41"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "52cba70fb6dd7cfa07a64033875f2b9951ab194b"
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "40ddb93c4e9b9d0f81b62a61a595307c6ed204e5"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "e48b0f06a363df82624951e4b85fb638bf0987c0"

View File

@ -35,7 +35,7 @@
#include "include/cef_base.h"
#endif // __cplusplus
#if defined(OS_MACOSX) && defined(__OBJC__)
#if defined(OS_MAC) && defined(__OBJC__)
#ifdef USING_CHROMIUM_INCLUDES
@ -105,6 +105,6 @@ class CefScopedSendingEvent {
#endif // __cplusplus
#endif // defined(OS_MACOSX) && defined(__OBJC__)
#endif // defined(OS_MAC) && defined(__OBJC__)
#endif // CEF_INCLUDE_CEF_APPLICATION_MAC_H_

View File

@ -40,7 +40,7 @@
#include "include/internal/cef_types_wrappers.h"
#if defined(OS_WIN)
#include "include/internal/cef_win.h"
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
#include "include/internal/cef_mac.h"
#elif defined(OS_LINUX)
#include "include/internal/cef_linux.h"

View File

@ -34,7 +34,7 @@
#include "include/base/cef_build.h"
#include "include/internal/cef_export.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#ifdef __cplusplus
extern "C" {
@ -83,6 +83,6 @@ class CEF_EXPORT CefScopedSandboxContext {
};
#endif // __cplusplus
#endif // defined(OS_MACOSX)
#endif // defined(OS_MAC)
#endif // CEF_INCLUDE_CEF_SANDBOX_MAC_H_

View File

@ -63,20 +63,13 @@ class CefURLRequest : public virtual CefBaseRefCounted {
// Create a new URL request that is not associated with a specific browser or
// frame. Use CefFrame::CreateURLRequest instead if you want the request to
// have this association, in which case it may be handled differently (see
// documentation on that method). Requests may originate from the both browser
// process and the render process.
//
// For requests originating from the browser process:
// documentation on that method). A request created with this method may only
// originate from the browser process, and will behave as follows:
// - It may be intercepted by the client via CefResourceRequestHandler or
// CefSchemeHandlerFactory.
// - POST data may only contain only a single element of type PDE_TYPE_FILE
// or PDE_TYPE_BYTES.
// - If |request_context| is empty the global request context will be used.
// For requests originating from the render process:
// - It cannot be intercepted by the client so only http(s) and blob schemes
// are supported.
// - POST data may only contain a single element of type PDE_TYPE_BYTES.
// - The |request_context| parameter must be NULL.
//
// The |request| object will be marked as read-only after calling this method.
///

View File

@ -39,7 +39,7 @@
// Bring in platform-specific definitions.
#if defined(OS_WIN)
#include "include/internal/cef_types_win.h"
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
#include "include/internal/cef_types_mac.h"
#elif defined(OS_LINUX)
#include "include/internal/cef_types_linux.h"

View File

@ -33,7 +33,7 @@
#include "include/base/cef_build.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "include/internal/cef_string.h"
// Handle types.
@ -137,6 +137,6 @@ typedef struct _cef_window_info_t {
}
#endif
#endif // OS_MACOSX
#endif // OS_MAC
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_

View File

@ -56,7 +56,7 @@ int cef_unload_library();
#ifdef __cplusplus
}
#if defined(OS_MACOSX)
#if defined(OS_MAC)
///
// Scoped helper for loading and unloading the CEF framework library at
@ -122,7 +122,7 @@ class CefScopedLibraryLoader {
DISALLOW_COPY_AND_ASSIGN(CefScopedLibraryLoader);
};
#endif // defined(OS_MACOSX)
#endif // defined(OS_MAC)
#endif // __cplusplus
#endif // CEF_INCLUDE_WRAPPER_CEF_LIBRARY_LOADER_H_

View File

@ -96,10 +96,10 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
// Values checked in ProfileNetworkContextService::CreateNetworkContextParams
// when creating the NetworkContext.
bool ShouldRestoreOldSessionCookies() override {
bool ShouldRestoreOldSessionCookies() const override {
return ShouldPersistSessionCookies();
}
bool ShouldPersistSessionCookies() override {
bool ShouldPersistSessionCookies() const override {
return !!settings_.persist_session_cookies;
}
base::Optional<std::vector<std::string>> GetCookieableSchemes() override {

View File

@ -57,7 +57,7 @@
#endif // defined(USE_AURA)
#if defined(TOOLKIT_VIEWS)
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_views_delegate.h"
#else
@ -105,7 +105,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
#endif // defined(USE_AURA)
#if defined(TOOLKIT_VIEWS)
#if defined(OS_MACOSX)
#if defined(OS_MAC)
views_delegate_ = std::make_unique<ChromeViewsDelegate>();
layout_provider_ = ChromeLayoutProvider::CreateLayoutProvider();
#else
@ -230,7 +230,7 @@ void AlloyBrowserMainParts::PostDestroyThreads() {
#if defined(TOOLKIT_VIEWS)
views_delegate_.reset();
#if defined(OS_MACOSX)
#if defined(OS_MAC)
layout_provider_.reset();
#endif
#endif // defined(TOOLKIT_VIEWS)

View File

@ -32,7 +32,7 @@ class WMState;
#if defined(TOOLKIT_VIEWS)
namespace views {
class ViewsDelegate;
#if defined(OS_MACOSX)
#if defined(OS_MAC)
class LayoutProvider;
#endif
} // namespace views
@ -96,7 +96,7 @@ class AlloyBrowserMainParts : public content::BrowserMainParts {
#if defined(TOOLKIT_VIEWS)
std::unique_ptr<views::ViewsDelegate> views_delegate_;
#if defined(OS_MACOSX)
#if defined(OS_MAC)
std::unique_ptr<views::LayoutProvider> layout_provider_;
#endif
#endif // defined(TOOLKIT_VIEWS)

View File

@ -40,7 +40,6 @@
#include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/net/scheme_registration.h"
#include "libcef/common/request_impl.h"
#include "libcef/common/service_manifests/cef_content_browser_overlay_manifest.h"
#include "base/base_switches.h"
#include "base/command_line.h"
@ -73,7 +72,6 @@
#include "components/navigation_interception/intercept_navigation_throttle.h"
#include "components/navigation_interception/navigation_params.h"
#include "components/spellcheck/common/spellcheck.mojom.h"
#include "components/variations/variations_http_header_provider.h"
#include "components/version_info/version_info.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/plugin_service_impl.h"
@ -104,6 +102,8 @@
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/guest_view/extensions_guest_view_message_filter.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/process_map.h"
#include "extensions/browser/url_loader_factory_manager.h"
#include "extensions/common/constants.h"
#include "extensions/common/switches.h"
@ -112,11 +112,11 @@
#include "net/base/auth.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
#include "sandbox/policy/switches.h"
#include "services/network/public/cpp/network_switches.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
#include "services/service_manager/embedder/switches.h"
#include "services/service_manager/public/mojom/connector.mojom.h"
#include "services/service_manager/sandbox/switches.h"
#include "storage/browser/quota/quota_settings.h"
#include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h"
#include "third_party/blink/public/mojom/prerender/prerender.mojom.h"
@ -131,7 +131,7 @@
#include "libcef/common/widevine_loader.h"
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_MAC)
#include "base/debug/leak_annotations.h"
#include "chrome/common/chrome_paths.h"
#include "components/crash/content/browser/crash_handler_host_linux.h"
@ -139,7 +139,7 @@
#include "content/public/common/content_descriptors.h"
#endif
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "net/ssl/client_cert_store_mac.h"
#include "services/video_capture/public/mojom/constants.mojom.h"
#endif
@ -381,7 +381,7 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
DISALLOW_COPY_AND_ASSIGN(CefQuotaPermissionContext);
};
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_MAC)
breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost(
const std::string& process_type) {
base::FilePath dumps_path;
@ -436,7 +436,7 @@ int GetCrashSignalFD(const base::CommandLine& command_line) {
return -1;
}
#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
#endif // defined(OS_POSIX) && !defined(OS_MAC)
// TODO(cef): We can't currently trust NavigationParams::is_main_frame() because
// it's always set to true in
@ -697,12 +697,6 @@ void AlloyContentBrowserClient::SiteInstanceGotProcess(
extensions::ProcessMap::Get(browser_context)
->Insert(extension->id(), site_instance->GetProcess()->GetID(),
site_instance->GetId());
CEF_POST_TASK(
CEF_IOT, base::Bind(&extensions::InfoMap::RegisterExtensionProcess,
browser_context->extension_system()->info_map(),
extension->id(), site_instance->GetProcess()->GetID(),
site_instance->GetId()));
}
void AlloyContentBrowserClient::SiteInstanceDeleting(
@ -729,12 +723,6 @@ void AlloyContentBrowserClient::SiteInstanceDeleting(
extensions::ProcessMap::Get(browser_context)
->Remove(extension->id(), site_instance->GetProcess()->GetID(),
site_instance->GetId());
CEF_POST_TASK(
CEF_IOT, base::Bind(&extensions::InfoMap::UnregisterExtensionProcess,
browser_context->extension_system()->info_map(),
extension->id(), site_instance->GetProcess()->GetID(),
site_instance->GetId()));
}
void AlloyContentBrowserClient::BindHostReceiverForRenderer(
@ -756,15 +744,6 @@ void AlloyContentBrowserClient::BindHostReceiverForRenderer(
#endif // BUILDFLAG(HAS_SPELLCHECK_PANEL)
}
base::Optional<service_manager::Manifest>
AlloyContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
if (name == content::mojom::kBrowserServiceName) {
return GetCefContentBrowserOverlayManifest();
}
return base::nullopt;
}
void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line,
int child_process_id) {
@ -775,7 +754,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
// associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {
switches::kDisablePackLoading,
#if defined(OS_MACOSX)
#if defined(OS_MAC)
switches::kFrameworkDirPath,
switches::kMainBundlePath,
#endif
@ -855,7 +834,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
base::size(kSwitchNames));
#if BUILDFLAG(ENABLE_WIDEVINE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
if (!browser_cmd->HasSwitch(service_manager::switches::kNoSandbox)) {
if (!browser_cmd->HasSwitch(sandbox::policy::switches::kNoSandbox)) {
// Pass the Widevine CDM path to the Zygote process. See comments in
// CefWidevineLoader::AddContentDecryptionModules.
const base::FilePath& cdm_path = CefWidevineLoader::GetInstance()->path();
@ -1179,7 +1158,7 @@ AlloyContentBrowserClient::CreateClientCertStore(
net::ClientCertStoreNSS::PasswordDelegateFactory()));
#elif defined(OS_WIN)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
#else
#error Unknown platform.
@ -1203,6 +1182,7 @@ AlloyContentBrowserClient::CreateLoginDelegate(
void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
int frame_tree_node_id,
base::UkmSourceId ukm_source_id,
NonNetworkURLLoaderFactoryMap* factories) {
if (!extensions::ExtensionsEnabled())
return;
@ -1212,7 +1192,7 @@ void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
factories->emplace(
extensions::kExtensionScheme,
extensions::CreateExtensionNavigationURLLoaderFactory(
web_contents->GetBrowserContext(),
web_contents->GetBrowserContext(), ukm_source_id,
!!extensions::WebViewGuest::FromWebContents(web_contents)));
}

View File

@ -61,8 +61,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
void BindHostReceiverForRenderer(
content::RenderProcessHost* render_process_host,
mojo::GenericPendingReceiver receiver) override;
base::Optional<service_manager::Manifest> GetServiceManifestOverlay(
base::StringPiece name) override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
std::string GetApplicationLocale() override;
@ -149,6 +147,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
LoginAuthRequiredCallback auth_required_callback) override;
void RegisterNonNetworkNavigationURLLoaderFactories(
int frame_tree_node_id,
base::UkmSourceId ukm_source_id,
NonNetworkURLLoaderFactoryMap* factories) override;
void RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,

View File

@ -222,7 +222,7 @@ void CefBrowserPlatformDelegateAlloy::SendCaptureLostEvent() {
widget->LostCapture();
}
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
void CefBrowserPlatformDelegateAlloy::NotifyMoveOrResizeStarted() {
if (!web_contents_)
return;

View File

@ -36,7 +36,7 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
extensions::ExtensionHost* GetExtensionHost() const override;
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
void SendCaptureLostEvent() override;
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
void NotifyMoveOrResizeStarted() override;
#endif
bool PreHandleGestureEvent(content::WebContents* source,

View File

@ -5,8 +5,9 @@
#include "libcef/browser/alloy/chrome_profile_alloy.h"
#include "base/no_destructor.h"
#include "components/variations/variations_client.h"
#include "components/variations/variations_http_header_provider.h"
#include "components/variations/variations_ids_provider.h"
#include "net/url_request/url_request_context.h"
namespace {
@ -23,7 +24,7 @@ class CefVariationsClient : public variations::VariationsClient {
}
std::string GetVariationsHeader() const override {
return variations::VariationsHttpHeaderProvider::GetInstance()
return variations::VariationsIdsProvider::GetInstance()
->GetClientDataHeader(false /* is_signed_in */);
}
@ -157,7 +158,7 @@ void ChromeProfileAlloy::SetExitType(ExitType exit_type) {
NOTREACHED();
}
Profile::ExitType ChromeProfileAlloy::GetLastSessionExitType() {
Profile::ExitType ChromeProfileAlloy::GetLastSessionExitType() const {
NOTREACHED();
return EXIT_NORMAL;
}

View File

@ -47,7 +47,7 @@ class ChromeProfileAlloy : public Profile {
GURL GetHomePage() override;
bool WasCreatedByVersionOrLater(const std::string& version) override;
void SetExitType(ExitType exit_type) override;
ExitType GetLastSessionExitType() override;
ExitType GetLastSessionExitType() const override;
base::Time GetCreationTime() const override;
void SetCreationTimeForTesting(base::Time creation_time) override;

View File

@ -65,7 +65,7 @@
#include "ui/events/base_event_utils.h"
#include "ui/gfx/image/image_skia.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "components/spellcheck/browser/spellcheck_platform.h"
#endif
@ -565,7 +565,7 @@ void CefBrowserHostImpl::CloseBrowser(bool force_close) {
}
content::WebContents* contents = web_contents();
if (contents && contents->NeedToFireBeforeUnloadOrUnload()) {
if (contents && contents->NeedToFireBeforeUnloadOrUnloadEvents()) {
// Will result in a call to BeforeUnloadFired() and, if the close isn't
// canceled, CloseContents().
contents->DispatchBeforeUnload(false /* auto_cancel */);
@ -1048,7 +1048,7 @@ void CefBrowserHostImpl::AddWordToDictionary(const CefString& word) {
if (spellcheck)
spellcheck->GetCustomDictionary()->AddWord(word);
}
#if defined(OS_MACOSX)
#if defined(OS_MAC)
if (spellcheck && spellcheck::UseBrowserSpellChecker()) {
spellcheck_platform::AddWord(spellcheck->platform_spell_checker(), word);
}
@ -1225,7 +1225,7 @@ void CefBrowserHostImpl::SendCaptureLostEvent() {
}
void CefBrowserHostImpl::NotifyMoveOrResizeStarted() {
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(
CEF_UIT,
@ -2301,10 +2301,10 @@ CefBrowserHostImpl::GetJavaScriptDialogManager(content::WebContents* source) {
void CefBrowserHostImpl::RunFileChooser(
content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) {
EnsureFileDialogManager();
file_dialog_manager_->RunFileChooser(std::move(listener), params);
file_dialog_manager_->RunFileChooser(listener, params);
}
bool CefBrowserHostImpl::HandleContextMenu(
@ -2320,7 +2320,7 @@ bool CefBrowserHostImpl::HandleContextMenu(
void CefBrowserHostImpl::UpdatePreferredSize(content::WebContents* source,
const gfx::Size& pref_size) {
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
CEF_REQUIRE_UIT();
if (platform_delegate_)
platform_delegate_->SizeTo(pref_size.width(), pref_size.height());

View File

@ -430,7 +430,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
content::WebContents* source) override;
void RunFileChooser(content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override;
bool EmbedsFullscreenWidget() override;
void EnterFullscreenModeForTab(

View File

@ -157,7 +157,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
CefPopupFeatures cef_features;
TranslatePopupFeatures(features, cef_features);
#if (defined(OS_WIN) || defined(OS_MACOSX))
#if (defined(OS_WIN) || defined(OS_MAC))
// Default to the size from the popup features.
if (cef_features.xSet)
window_info->x = cef_features.x;

View File

@ -9,7 +9,7 @@
#include "base/message_loop/message_pump.h"
#include "base/message_loop/message_pump_for_ui.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/message_loop/message_pump_mac.h"
#endif
@ -29,7 +29,7 @@ class MessagePumpExternal : public base::MessagePumpForUI {
void Run(Delegate* delegate) override {
base::TimeTicks start = base::TimeTicks::Now();
while (true) {
#if defined(OS_MACOSX)
#if defined(OS_MAC)
base::mac::ScopedNSAutoreleasePool autorelease_pool;
#endif
@ -108,7 +108,7 @@ std::unique_ptr<base::MessagePump> MessagePumpFactoryForUI() {
return std::make_unique<MessagePumpExternal>(0.01f, handler);
}
#if defined(OS_MACOSX)
#if defined(OS_MAC)
return base::MessagePumpMac::Create();
#else
return std::make_unique<base::MessagePumpForUI>();

View File

@ -127,7 +127,7 @@ void CefBrowserPlatformDelegate::SendCaptureLostEvent() {
NOTIMPLEMENTED();
}
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
void CefBrowserPlatformDelegate::NotifyMoveOrResizeStarted() {}
void CefBrowserPlatformDelegate::SizeTo(int width, int height) {}

View File

@ -207,7 +207,7 @@ class CefBrowserPlatformDelegate {
// Send capture lost event.
virtual void SendCaptureLostEvent();
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
// The window hosting the browser is about to be moved or resized. Only used
// on Windows and Linux.
virtual void NotifyMoveOrResizeStarted();

View File

@ -18,7 +18,7 @@
#if defined(OS_WIN)
#include "libcef/browser/native/browser_platform_delegate_native_win.h"
#include "libcef/browser/osr/browser_platform_delegate_osr_win.h"
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
#include "libcef/browser/native/browser_platform_delegate_native_mac.h"
#include "libcef/browser/osr/browser_platform_delegate_osr_mac.h"
#elif defined(OS_LINUX)
@ -40,7 +40,7 @@ std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
#if defined(OS_WIN)
return std::make_unique<CefBrowserPlatformDelegateNativeWin>(
window_info, background_color);
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
return std::make_unique<CefBrowserPlatformDelegateNativeMac>(
window_info, background_color);
#elif defined(OS_LINUX)
@ -56,7 +56,7 @@ std::unique_ptr<CefBrowserPlatformDelegateOsr> CreateOSRDelegate(
#if defined(OS_WIN)
return std::make_unique<CefBrowserPlatformDelegateOsrWin>(
std::move(native_delegate), use_shared_texture, use_external_begin_frame);
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
return std::make_unique<CefBrowserPlatformDelegateOsrMac>(
std::move(native_delegate));
#elif defined(OS_LINUX)

View File

@ -26,7 +26,8 @@ ChromeContentBrowserClientCef::CreateBrowserMainParts(
ChromeContentBrowserClient::CreateBrowserMainParts(parameters);
browser_main_parts_ = new ChromeBrowserMainExtraPartsCef;
static_cast<ChromeBrowserMainParts*>(main_parts.get())
->AddParts(browser_main_parts_);
->AddParts(
base::WrapUnique<ChromeBrowserMainExtraParts>(browser_main_parts_));
return main_parts;
}

View File

@ -5,11 +5,11 @@
#include "build/build_config.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "chrome/app/chrome_crash_reporter_client.h"
// Required due to https://crrev.com/1c9f89a06f
void ChromeCrashReporterClient::Create() {}
#endif // defined(OS_MACOSX)
#endif // defined(OS_MAC)

View File

@ -11,8 +11,8 @@
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/message_loop/message_loop_current.h"
#include "base/run_loop.h"
#include "base/task/current_thread.h"
#include "base/threading/thread_restrictions.h"
#include "components/network_session_configurator/common/network_switches.h"
#include "content/public/browser/notification_service.h"
@ -294,7 +294,7 @@ void CefSetOSModalLoop(bool osModalLoop) {
}
if (CEF_CURRENTLY_ON_UIT())
base::MessageLoopCurrent::Get()->set_os_modal_loop(osModalLoop);
base::CurrentThread::Get()->set_os_modal_loop(osModalLoop);
else
CEF_POST_TASK(CEF_UIT, base::Bind(CefSetOSModalLoop, osModalLoop));
#endif // defined(OS_WIN)

View File

@ -25,6 +25,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
@ -538,7 +539,7 @@ void CefDevToolsFrontend::DispatchProtocolMessage(
if (ProtocolLoggingEnabled()) {
// Quick check to avoid parsing the JSON object. Events begin with a
// "method" value whereas method results begin with an "id" value.
LogProtocolMessage(str_message.starts_with("{\"method\":")
LogProtocolMessage(base::StartsWith(str_message, "{\"method\":")
? ProtocolMessageType::EVENT
: ProtocolMessageType::RESULT,
str_message);

View File

@ -5,6 +5,7 @@
#include "libcef/browser/devtools/devtools_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
namespace devtools_util {
@ -24,7 +25,7 @@ bool ParseEvent(const base::StringPiece& message,
static const char kMethodEnd[] = "\"";
static const char kParamsStart[] = ",\"params\":";
if (!message.starts_with(kMethodStart))
if (!base::StartsWith(message, kMethodStart))
return false;
const size_t method_start = sizeof(kMethodStart) - 1;
@ -41,7 +42,7 @@ bool ParseEvent(const base::StringPiece& message,
params = base::StringPiece();
} else {
const base::StringPiece& remainder = message.substr(remainder_start);
if (remainder.starts_with(kParamsStart)) {
if (base::StartsWith(remainder, kParamsStart)) {
// Stop immediately before the message closing bracket.
remainder_start += sizeof(kParamsStart) - 1;
params =
@ -71,7 +72,7 @@ bool ParseResult(const base::StringPiece& message,
static const char kResultStart[] = "\"result\":";
static const char kErrorStart[] = "\"error\":";
if (!message.starts_with(kIdStart))
if (!base::StartsWith(message, kIdStart))
return false;
const size_t id_start = sizeof(kIdStart) - 1;
@ -84,13 +85,13 @@ bool ParseResult(const base::StringPiece& message,
size_t remainder_start = id_end + sizeof(kIdEnd) - 1;
const base::StringPiece& remainder = message.substr(remainder_start);
if (remainder.starts_with(kResultStart)) {
if (base::StartsWith(remainder, kResultStart)) {
// Stop immediately before the message closing bracket.
remainder_start += sizeof(kResultStart) - 1;
result =
message.substr(remainder_start, message.size() - 1 - remainder_start);
success = true;
} else if (remainder.starts_with(kErrorStart)) {
} else if (base::StartsWith(remainder, kErrorStart)) {
// Stop immediately before the message closing bracket.
remainder_start += sizeof(kErrorStart) - 1;
result =

View File

@ -487,7 +487,7 @@ void CefExtensionSystem::InstallUpdate(
bool install_immediately,
InstallUpdateCallback install_update_callback) {
NOTREACHED();
base::DeleteFile(temp_dir, true /* recursive */);
base::DeletePathRecursively(temp_dir);
}
void CefExtensionSystem::PerformActionBasedOnOmahaAttributes(

View File

@ -13,7 +13,6 @@
#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/file_chooser_file_info.h"
#include "net/base/directory_lister.h"
namespace {
@ -202,7 +201,7 @@ void CefFileDialogManager::RunFileDialog(
}
void CefFileDialogManager::RunFileChooser(
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) {
CEF_REQUIRE_UIT();
@ -213,11 +212,11 @@ void CefFileDialogManager::RunFileChooser(
if (params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) {
callback = base::BindOnce(
&CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener));
weak_ptr_factory_.GetWeakPtr(), params.mode, listener);
} else {
callback = base::BindOnce(
&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener));
callback =
base::BindOnce(&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), params.mode, listener);
}
RunFileChooserInternal(cef_params, std::move(callback));
@ -320,7 +319,7 @@ void CefFileDialogManager::OnRunFileChooserCallback(
void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback(
const blink::mojom::FileChooserParams::Mode mode,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
int selected_accept_filter,
const std::vector<base::FilePath>& file_paths) {
CEF_REQUIRE_UIT();
@ -328,21 +327,21 @@ void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback(
if (file_paths.size() == 0) {
// Client canceled the file chooser.
OnRunFileChooserDelegateCallback(mode, std::move(listener),
selected_accept_filter, file_paths);
OnRunFileChooserDelegateCallback(mode, listener, selected_accept_filter,
file_paths);
} else {
lister_.reset(new net::DirectoryLister(
file_paths[0], net::DirectoryLister::NO_SORT_RECURSIVE,
new UploadFolderHelper(base::BindOnce(
&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), mode, std::move(listener)))));
weak_ptr_factory_.GetWeakPtr(), mode, listener))));
lister_->Start();
}
}
void CefFileDialogManager::OnRunFileChooserDelegateCallback(
blink::mojom::FileChooserParams::Mode mode,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
int selected_accept_filter,
const std::vector<base::FilePath>& file_paths) {
CEF_REQUIRE_UIT();

View File

@ -46,7 +46,7 @@ class CefFileDialogManager {
// Called from CefBrowserHostImpl::RunFileChooser.
// See WebContentsDelegate::RunFileChooser documentation.
void RunFileChooser(std::unique_ptr<content::FileSelectListener> listener,
void RunFileChooser(scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params);
// Run the file chooser dialog specified by |params|. Only a single dialog may
@ -71,7 +71,7 @@ class CefFileDialogManager {
// blink::mojom::FileChooserParams::Mode::kUploadFolder.
void OnRunFileChooserUploadFolderDelegateCallback(
const blink::mojom::FileChooserParams::Mode mode,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
int selected_accept_filter,
const std::vector<base::FilePath>& file_paths);
@ -79,7 +79,7 @@ class CefFileDialogManager {
// RenderFrameHost.
void OnRunFileChooserDelegateCallback(
blink::mojom::FileChooserParams::Mode mode,
std::unique_ptr<content::FileSelectListener> listener,
scoped_refptr<content::FileSelectListener> listener,
int selected_accept_filter,
const std::vector<base::FilePath>& file_paths);

View File

@ -34,7 +34,7 @@
#include "sandbox/win/src/sandbox_types.h"
#endif
#if defined(OS_MACOSX) || defined(OS_WIN)
#if defined(OS_MAC) || defined(OS_WIN)
#include "components/crash/core/app/crash_switches.h"
#include "third_party/crashpad/crashpad/handler/handler_main.h"
#endif
@ -64,7 +64,7 @@ std::unique_ptr<CefMainRunnerDelegate> MakeDelegate(
}
}
#if defined(OS_MACOSX) || defined(OS_WIN)
#if defined(OS_MAC) || defined(OS_WIN)
// Based on components/crash/core/app/run_as_crashpad_handler_win.cc
// Remove the "--type=crashpad-handler" command-line flag that will otherwise
@ -87,7 +87,7 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) {
}),
argv.end());
#if defined(OS_MACOSX)
#if defined(OS_MAC)
// HandlerMain on macOS uses the system version of getopt_long which expects
// the first argument to be the program name.
argv.insert(argv.begin(), command_line.GetProgram().value());
@ -110,7 +110,7 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) {
argv_as_utf8.get(), nullptr);
}
#endif // defined(OS_MACOSX) || defined(OS_WIN)
#endif // defined(OS_MAC) || defined(OS_WIN)
} // namespace
@ -325,7 +325,7 @@ int CefMainRunner::RunAsHelperProcess(const CefMainArgs& args,
int result;
#if defined(OS_MACOSX) || defined(OS_WIN)
#if defined(OS_MAC) || defined(OS_WIN)
if (process_type == crash_reporter::switches::kCrashpadHandler) {
result = RunAsCrashpadHandler(command_line);
main_delegate->AfterExecuteProcess();

View File

@ -27,7 +27,7 @@
#if defined(USE_X11)
#include "libcef/browser/native/window_x11.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
#endif
namespace {
@ -40,11 +40,6 @@ long GetSystemUptime() {
return 0;
}
// See https://crbug.com/1066670#c57 for background.
inline x11::Window ToX11Window(::Window window) {
return static_cast<x11::Window>(window);
}
} // namespace
CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
@ -92,8 +87,8 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
CefWindowDelegateView* delegate_view = new CefWindowDelegateView(
GetBackgroundColor(), window_x11_->TopLevelAlwaysOnTop(),
GetBoundsChangedCallback());
delegate_view->Init(ToX11Window(window_info_.window), web_contents_,
gfx::Rect(gfx::Point(), rect.size()));
delegate_view->Init(static_cast<gfx::AcceleratedWidget>(window_info_.window),
web_contents_, gfx::Rect(gfx::Point(), rect.size()));
window_widget_ = delegate_view->GetWidget();
window_widget_->Show();
@ -176,7 +171,7 @@ void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() {
if (!window_x11_)
return;
views::DesktopWindowTreeHostX11* tree_host = window_x11_->GetHost();
views::DesktopWindowTreeHostLinux* tree_host = window_x11_->GetHost();
if (!tree_host)
return;
@ -212,7 +207,7 @@ gfx::Point CefBrowserPlatformDelegateNativeLinux::GetScreenPoint(
return view;
// We can't use aura::Window::GetBoundsInScreen on Linux because it will
// return bounds from DesktopWindowTreeHostX11 which in our case is relative
// return bounds from DesktopWindowTreeHostLinux which in our case is relative
// to the parent window instead of the root window (screen).
const gfx::Rect& bounds_in_screen = window_x11_->GetBoundsInScreen();
return gfx::Point(bounds_in_screen.x() + view.x(),

View File

@ -8,7 +8,7 @@
#include "base/compiler_specific.h"
#import "base/mac/scoped_sending_event.h"
#include "base/message_loop/message_loop_current.h"
#include "base/task/current_thread.h"
#import "ui/base/cocoa/menu_controller.h"
#include "ui/gfx/geometry/point.h"
@ -23,6 +23,7 @@ bool CefMenuRunnerMac::RunContextMenu(
// Create a menu controller based on the model.
menu_controller_.reset([[MenuControllerCocoa alloc]
initWithModel:model->model()
delegate:nil
useWithPopUpButtonCell:NO]);
// Keep the menu controller alive (by adding an additional retain) until after
@ -33,7 +34,7 @@ bool CefMenuRunnerMac::RunContextMenu(
menu_controller_);
// Make sure events can be pumped while the menu is up.
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
base::CurrentThread::ScopedNestableTaskAllower allow;
// One of the events that could be pumped is |window.close()|.
// User-initiated event-tracking loops protect against this by

View File

@ -7,7 +7,7 @@
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/native/menu_2.h"
#include "base/message_loop/message_loop_current.h"
#include "base/task/current_thread.h"
#include "ui/gfx/geometry/point.h"
CefMenuRunnerWin::CefMenuRunnerWin() {}
@ -21,7 +21,7 @@ bool CefMenuRunnerWin::RunContextMenu(
menu_->Rebuild(nullptr);
// Make sure events can be pumped while the menu is up.
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
base::CurrentThread::ScopedNestableTaskAllower allow;
const gfx::Point& screen_point =
browser->GetScreenPoint(gfx::Point(params.x, params.y));

View File

@ -4,18 +4,18 @@
// found in the LICENSE file.
#include "libcef/browser/native/window_x11.h"
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XInput2.h>
#include "libcef/browser/thread_util.h"
#include "ui/base/x/x11_util.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/events/x/x11_event_translation.h"
#include "ui/platform_window/x11/x11_topmost_window_finder.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XInput2.h>
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
namespace {
@ -208,7 +208,7 @@ void CefWindowX11::Show() {
if (child && toplevel_window) {
// Configure the drag&drop proxy property for the top-most window so
// that all drag&drop-related messages will be sent to the child
// DesktopWindowTreeHostX11. The proxy property is referenced by
// DesktopWindowTreeHostLinux. The proxy property is referenced by
// DesktopDragDropClientAuraX11::FindWindowFor.
x11::Window window = x11::Window::None;
ui::GetProperty(ToX11Window(toplevel_window), gfx::GetAtom(kXdndProxy),
@ -246,7 +246,7 @@ void CefWindowX11::Focus() {
if (browser_.get()) {
::Window child = FindChild(xdisplay_, xwindow_);
if (child && ui::IsWindowVisible(ToX11Window(child))) {
// Give focus to the child DesktopWindowTreeHostX11.
// Give focus to the child DesktopWindowTreeHostLinux.
XSetInputFocus(xdisplay_, child, RevertToParent, x11::CurrentTime);
}
} else {
@ -289,13 +289,13 @@ gfx::Rect CefWindowX11::GetBoundsInScreen() {
return gfx::Rect();
}
views::DesktopWindowTreeHostX11* CefWindowX11::GetHost() {
views::DesktopWindowTreeHostLinux* CefWindowX11::GetHost() {
if (browser_.get()) {
::Window child = FindChild(xdisplay_, xwindow_);
if (child) {
return static_cast<views::DesktopWindowTreeHostX11*>(
return static_cast<views::DesktopWindowTreeHostLinux*>(
views::DesktopWindowTreeHostLinux::GetHostForWidget(
ToX11Window(child)));
static_cast<gfx::AcceleratedWidget>(child)));
}
}
return nullptr;
@ -318,8 +318,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
// Called by X11EventSourceLibevent to determine whether this XEventDispatcher
// implementation is able to process the next translated event sent by it.
void CefWindowX11::CheckCanDispatchNextPlatformEvent(x11::Event* x11_event) {
XEvent* xev = &x11_event->xlib_event();
current_xevent_ = IsTargetedBy(*x11_event) ? xev : nullptr;
current_xevent_ = IsTargetedBy(*x11_event) ? x11_event : nullptr;
}
void CefWindowX11::PlatformEventDispatchFinished() {
@ -333,8 +332,7 @@ ui::PlatformEventDispatcher* CefWindowX11::GetPlatformEventDispatcher() {
bool CefWindowX11::DispatchXEvent(x11::Event* x11_event) {
if (!IsTargetedBy(*x11_event))
return false;
XEvent* xev = &x11_event->xlib_event();
ProcessXEvent(xev);
ProcessXEvent(x11_event);
return true;
}
@ -378,77 +376,64 @@ bool CefWindowX11::TopLevelAlwaysOnTop() const {
}
bool CefWindowX11::IsTargetedBy(const x11::Event& x11_event) const {
const XEvent& xev = x11_event.xlib_event();
::Window target_window =
xev.type == x11::GeGenericEvent::opcode
? static_cast<XIDeviceEvent*>(xev.xcookie.data)->event
: xev.xany.window;
return target_window == xwindow_;
return ToWindow(x11_event.window()) == xwindow_;
}
void CefWindowX11::ProcessXEvent(XEvent* xev) {
switch (xev->type) {
case ConfigureNotify: {
DCHECK_EQ(xwindow_, xev->xconfigure.event);
DCHECK_EQ(xwindow_, xev->xconfigure.window);
// It's possible that the X window may be resized by some other means
// than from within Aura (e.g. the X window manager can change the
// size). Make sure the root window size is maintained properly.
gfx::Rect bounds(xev->xconfigure.x, xev->xconfigure.y,
xev->xconfigure.width, xev->xconfigure.height);
bounds_ = bounds;
void CefWindowX11::ProcessXEvent(x11::Event* event) {
if (auto* configure = event->As<x11::ConfigureNotifyEvent>()) {
DCHECK_EQ(xwindow_, ToWindow(configure->event));
DCHECK_EQ(xwindow_, ToWindow(configure->window));
// It's possible that the X window may be resized by some other means
// than from within Aura (e.g. the X window manager can change the
// size). Make sure the root window size is maintained properly.
bounds_ = gfx::Rect(configure->x, configure->y, configure->width,
configure->height);
if (browser_.get()) {
::Window child = FindChild(xdisplay_, xwindow_);
if (child) {
// Resize the child DesktopWindowTreeHostX11 to match this window.
XWindowChanges changes = {0};
changes.width = bounds.width();
changes.height = bounds.height();
XConfigureWindow(xdisplay_, child, CWHeight | CWWidth, &changes);
if (browser_.get()) {
::Window child = FindChild(xdisplay_, xwindow_);
if (child) {
// Resize the child DesktopWindowTreeHostLinux to match this window.
XWindowChanges changes = {0};
changes.width = bounds_.width();
changes.height = bounds_.height();
XConfigureWindow(xdisplay_, child, CWHeight | CWWidth, &changes);
browser_->NotifyMoveOrResizeStarted();
}
browser_->NotifyMoveOrResizeStarted();
}
break;
}
case ClientMessage: {
Atom message_type = xev->xclient.message_type;
if (message_type == GetAtom(kWMProtocols)) {
Atom protocol = static_cast<Atom>(xev->xclient.data.l[0]);
if (protocol == GetAtom(kWMDeleteWindow)) {
// We have received a close message from the window manager.
if (!browser_ || browser_->TryCloseBrowser()) {
// Allow the close.
XDestroyWindow(xdisplay_, xwindow_);
} else if (auto* client = event->As<x11::ClientMessageEvent>()) {
if (client->type == gfx::GetAtom(kWMProtocols)) {
x11::Atom protocol = static_cast<x11::Atom>(client->data.data32[0]);
if (protocol == gfx::GetAtom(kWMDeleteWindow)) {
// We have received a close message from the window manager.
if (!browser_ || browser_->TryCloseBrowser()) {
// Allow the close.
XDestroyWindow(xdisplay_, xwindow_);
xwindow_ = x11::None;
xwindow_ = x11::None;
if (browser_.get()) {
// Force the browser to be destroyed and release the reference
// added in PlatformCreateWindow().
browser_->WindowDestroyed();
}
delete this;
if (browser_.get()) {
// Force the browser to be destroyed and release the reference
// added in PlatformCreateWindow().
browser_->WindowDestroyed();
}
} else if (protocol == GetAtom(kNetWMPing)) {
XEvent reply_event = *xev;
reply_event.xclient.window = parent_xwindow_;
XSendEvent(xdisplay_, reply_event.xclient.window, false,
SubstructureRedirectMask | SubstructureNotifyMask,
&reply_event);
XFlush(xdisplay_);
delete this;
}
} else if (protocol == gfx::GetAtom(kNetWMPing)) {
x11::ClientMessageEvent reply_event = *client;
reply_event.window = ToX11Window(parent_xwindow_);
ui::SendEvent(reply_event, reply_event.window,
x11::EventMask::SubstructureNotify |
x11::EventMask::SubstructureRedirect);
}
break;
}
case x11::FocusIn:
} else if (auto* focus = event->As<x11::FocusEvent>()) {
if (focus->opcode == x11::FocusEvent::In) {
// This message is received first followed by a "_NET_ACTIVE_WINDOW"
// message sent to the root window. When X11DesktopHandler handles the
// "_NET_ACTIVE_WINDOW" message it will erroneously mark the WebView
// (hosted in a DesktopWindowTreeHostX11) as unfocused. Use a delayed
// (hosted in a DesktopWindowTreeHostLinux) as unfocused. Use a delayed
// task here to restore the WebView's focus state.
if (!focus_pending_) {
focus_pending_ = true;
@ -457,44 +442,40 @@ void CefWindowX11::ProcessXEvent(XEvent* xev) {
weak_ptr_factory_.GetWeakPtr()),
100);
}
break;
case x11::FocusOut:
} else {
// Cancel the pending focus change if some other window has gained focus
// while waiting for the async task to run. Otherwise we can get stuck in
// a focus change loop.
if (focus_pending_)
focus_pending_ = false;
break;
case PropertyNotify: {
::Atom changed_atom = xev->xproperty.atom;
if (changed_atom == GetAtom(kNetWMState)) {
// State change event like minimize/maximize.
if (browser_.get()) {
::Window child = FindChild(xdisplay_, xwindow_);
if (child) {
// Forward the state change to the child DesktopWindowTreeHostX11
// window so that resource usage will be reduced while the window is
// minimized.
std::vector<x11::Atom> atom_list;
if (ui::GetAtomArrayProperty(ToX11Window(xwindow_), kNetWMState,
&atom_list) &&
!atom_list.empty()) {
ui::SetAtomArrayProperty(ToX11Window(child), kNetWMState, "ATOM",
atom_list);
} else {
// Set an empty list of property values to pass the check in
// DesktopWindowTreeHostX11::OnWMStateUpdated().
XChangeProperty(xdisplay_, child,
GetAtom(kNetWMState), // name
GetAtom(kAtom), // type
32, // size in bits of items in 'value'
PropModeReplace, NULL,
0); // num items
}
}
} else if (auto* property = event->As<x11::PropertyNotifyEvent>()) {
if (property->atom == gfx::GetAtom(kNetWMState)) {
// State change event like minimize/maximize.
if (browser_.get()) {
::Window child = FindChild(xdisplay_, xwindow_);
if (child) {
// Forward the state change to the child DesktopWindowTreeHostLinux
// window so that resource usage will be reduced while the window is
// minimized.
std::vector<x11::Atom> atom_list;
if (ui::GetAtomArrayProperty(ToX11Window(xwindow_), kNetWMState,
&atom_list) &&
!atom_list.empty()) {
ui::SetAtomArrayProperty(ToX11Window(child), kNetWMState, "ATOM",
atom_list);
} else {
// Set an empty list of property values to pass the check in
// DesktopWindowTreeHostLinux::OnWMStateUpdated().
XChangeProperty(xdisplay_, child,
GetAtom(kNetWMState), // name
GetAtom(kAtom), // type
32, // size in bits of items in 'value'
PropModeReplace, NULL,
0); // num items
}
}
}
break;
}
}
}

View File

@ -21,7 +21,7 @@ typedef struct _XDisplay Display;
#include "ui/gfx/x/x11_atom_cache.h"
namespace views {
class DesktopWindowTreeHostX11;
class DesktopWindowTreeHostLinux;
}
// Object wrapper for an X11 Window.
@ -46,7 +46,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
gfx::Rect GetBoundsInScreen();
views::DesktopWindowTreeHostX11* GetHost();
views::DesktopWindowTreeHostLinux* GetHost();
// ui::PlatformEventDispatcher methods:
bool CanDispatchEvent(const ui::PlatformEvent& event) override;
@ -67,7 +67,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
void ContinueFocus();
bool IsTargetedBy(const x11::Event& x11_event) const;
void ProcessXEvent(XEvent* xev);
void ProcessXEvent(x11::Event* xev);
CefRefPtr<CefBrowserHostImpl> browser_;
@ -87,7 +87,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher,
// Tells if this dispatcher can process next translated event based on a
// previous check in ::CheckCanDispatchNextPlatformEvent based on a XID
// target.
XEvent* current_xevent_ = nullptr;
x11::Event* current_xevent_ = nullptr;
// Must always be the last member.
base::WeakPtrFactory<CefWindowX11> weak_ptr_factory_;

View File

@ -13,6 +13,7 @@
#include "content/public/browser/global_request_id.h"
#include "content/public/common/referrer.h"
#include "net/cookies/site_for_cookies.h"
#include "ui/base/page_transition_types.h"
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"

View File

@ -191,7 +191,7 @@ void GetDebugURLs(std::vector<std::string>* urls) {
std::string GetOSType() {
#if defined(OS_WIN)
return "Windows";
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
return "Mac OS X";
#elif defined(OS_CHROMEOS)
return "Chromium OS";

View File

@ -82,10 +82,10 @@ struct SaveCookiesProgress {
void SetCanonicalCookieCallback(SaveCookiesProgress* progress,
const net::CanonicalCookie& cookie,
net::CookieInclusionStatus status) {
net::CookieAccessResult access_result) {
CEF_REQUIRE_UIT();
progress->num_cookie_lines_left_--;
if (status.IsInclude()) {
if (access_result.status.IsInclude()) {
progress->allowed_cookies_.push_back(cookie);
}
@ -131,8 +131,8 @@ void SaveCookiesOnUIThread(content::BrowserContext* browser_context,
SetCanonicalCookieCallback(
progress, net::CanonicalCookie(),
net::CookieInclusionStatus(
net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR));
net::CookieAccessResult(net::CookieInclusionStatus(
net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR)));
}
} // namespace

View File

@ -45,14 +45,16 @@ void RunAsyncCompletionOnUIThread(CefRefPtr<CefCompletionCallback> callback) {
// Always execute the callback asynchronously.
void SetCookieCallbackImpl(CefRefPtr<CefSetCookieCallback> callback,
net::CookieInclusionStatus status) {
net::CookieAccessResult access_result) {
if (!callback.get())
return;
if (!status.IsInclude()) {
LOG(WARNING) << "SetCookie failed with reason: " << status.GetDebugString();
const bool is_include = access_result.status.IsInclude();
if (!is_include) {
LOG(WARNING) << "SetCookie failed with reason: "
<< access_result.status.GetDebugString();
}
CEF_POST_TASK(CEF_UIT, base::Bind(&CefSetCookieCallback::OnComplete,
callback.get(), status.IsInclude()));
callback.get(), is_include));
}
// Always execute the callback asynchronously.
@ -260,8 +262,8 @@ bool CefCookieManagerImpl::SetCookie(const CefString& url,
if (!canonical_cookie) {
SetCookieCallbackImpl(
callback, net::CookieInclusionStatus(
net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR));
callback, net::CookieAccessResult(net::CookieInclusionStatus(
net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR)));
return true;
}

View File

@ -20,6 +20,7 @@
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/base/big_buffer.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_request.h"
#include "services/network/public/cpp/cors/cors.h"
#include "services/network/public/cpp/features.h"

View File

@ -13,7 +13,7 @@
#include "libcef/browser/osr/web_contents_view_osr.h"
#include "libcef/common/drag_data_impl.h"
#include "base/message_loop/message_loop_current.h"
#include "base/task/current_thread.h"
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/render_view_host.h"
@ -482,7 +482,7 @@ void CefBrowserPlatformDelegateOsr::StartDragging(
CefRefPtr<CefDragDataImpl> drag_data(
new CefDragDataImpl(drop_data, cef_image, cef_image_pos));
drag_data->SetReadOnly(true);
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
base::CurrentThread::ScopedNestableTaskAllower allow;
handled = handler->StartDragging(
browser_, drag_data.get(),
static_cast<CefRenderHandler::DragOperationsMask>(allowed_ops),

View File

@ -150,6 +150,12 @@ struct PopulateAxNodeAttributes {
attributes->SetString(ToString(attr.first), ToString(state));
}
} break;
case ax::mojom::IntAttribute::kTextAlign: {
auto state = static_cast<ax::mojom::TextAlign>(attr.second);
if (ax::mojom::TextAlign::kNone != state) {
attributes->SetString(ToString(attr.first), ToString(state));
}
} break;
case ax::mojom::IntAttribute::kNameFrom:
attributes->SetString(
ToString(attr.first),
@ -173,8 +179,8 @@ struct PopulateAxNodeAttributes {
}
} break;
case ax::mojom::IntAttribute::kTextDirection: {
auto state = static_cast<ax::mojom::TextDirection>(attr.second);
if (ax::mojom::TextDirection::kNone != state) {
auto state = static_cast<ax::mojom::WritingDirection>(attr.second);
if (ax::mojom::WritingDirection::kNone != state) {
attributes->SetString(ToString(attr.first), ToString(state));
}
} break;

View File

@ -55,7 +55,7 @@
#include "ui/gfx/geometry/size_conversions.h"
#if defined(USE_X11)
#include "ui/base/x/x11_cursor.h"
#include "ui/base/x/x11_cursor_loader.h"
#include "ui/base/x/x11_util.h"
#endif
@ -67,8 +67,8 @@ const size_t kMaxDamageRects = 10;
const float kDefaultScaleFactor = 1.0;
content::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) {
content::ScreenInfo screenInfo;
blink::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) {
blink::ScreenInfo screenInfo;
screenInfo.device_scale_factor = src.device_scale_factor;
screenInfo.depth = src.depth;
screenInfo.depth_per_component = src.depth_per_component;
@ -101,7 +101,7 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
// may not match the page's, so use black as the gutter color to avoid
// flashes of brighter colors during the transition.
if (view_->render_widget_host()->delegate() &&
view_->render_widget_host()->delegate()->IsFullscreenForCurrentTab()) {
view_->render_widget_host()->delegate()->IsFullscreen()) {
return SK_ColorBLACK;
}
return *view_->GetBackgroundColor();
@ -197,7 +197,8 @@ ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle(
CefCursorHandle ToCursorHandle(ui::PlatformCursor cursor) {
#if defined(USE_X11)
// See https://crbug.com/1029142 for background.
return static_cast<ui::X11Cursor*>(cursor)->xcursor();
return static_cast<CefCursorHandle>(
static_cast<ui::X11Cursor*>(cursor)->xcursor());
#else
return cursor;
#endif
@ -654,7 +655,7 @@ void CefRenderWidgetHostViewOSR::UpdateCursor(
handler->OnCursorChange(browser_impl_.get(), platform_cursor, cursor_type,
custom_cursor_info);
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
// |web_cursor| owns the resulting |native_cursor|.
content::WebCursor web_cursor(cursor);
CefCursorHandle native_cursor = web_cursor.GetNativeCursor();
@ -741,7 +742,7 @@ void CefRenderWidgetHostViewOSR::CopyFromSurface(
}
}
void CefRenderWidgetHostViewOSR::GetScreenInfo(content::ScreenInfo* results) {
void CefRenderWidgetHostViewOSR::GetScreenInfo(blink::ScreenInfo* results) {
if (!browser_impl_.get())
return;
@ -792,7 +793,7 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
return GetViewBounds();
}
#if !defined(OS_MACOSX)
#if !defined(OS_MAC)
viz::ScopedSurfaceIdAllocator
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) {
@ -1443,13 +1444,16 @@ gfx::Size CefRenderWidgetHostViewOSR::SizeInPixels() {
current_device_scale_factor_);
}
#if defined(OS_MACOSX)
#if defined(OS_MAC)
void CefRenderWidgetHostViewOSR::SetActive(bool active) {}
void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {}
void CefRenderWidgetHostViewOSR::SpeakSelection() {}
#endif
void CefRenderWidgetHostViewOSR::SetWindowFrameInScreen(const gfx::Rect& rect) {
}
#endif // defined(OS_MAC)
void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
const gfx::Size& pixel_size,

View File

@ -36,7 +36,7 @@
#include "ui/events/gesture_detection/motion_event_generic.h"
#include "ui/gfx/geometry/rect.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "content/browser/renderer_host/browser_compositor_view_mac.h"
#endif
@ -65,8 +65,9 @@ class CefWebContentsViewOSR;
#if defined(USE_X11)
namespace ui {
class XScopedCursor;
}
class X11Cursor;
class XCursorLoader;
} // namespace ui
class CefWindowX11;
#endif
@ -88,7 +89,7 @@ class CefWindowX11;
// RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
///////////////////////////////////////////////////////////////////////////////
#if defined(OS_MACOSX)
#if defined(OS_MAC)
class MacHelper;
#endif
@ -129,11 +130,12 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void UnlockMouse() override;
void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override;
#if defined(OS_MACOSX)
#if defined(OS_MAC)
void SetActive(bool active) override;
void ShowDefinitionForSelection() override;
void SpeakSelection() override;
#endif // defined(OS_MACOSX)
void SetWindowFrameInScreen(const gfx::Rect& rect) override;
#endif // defined(OS_MAC)
// RenderWidgetHostViewBase implementation.
void ResetFallbackToFirstNavigationSurface() override;
@ -152,11 +154,11 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
const gfx::Rect& src_rect,
const gfx::Size& output_size,
base::OnceCallback<void(const SkBitmap&)> callback) override;
void GetScreenInfo(content::ScreenInfo* results) override;
void GetScreenInfo(blink::ScreenInfo* results) override;
void TransformPointToRootSurface(gfx::PointF* point) override;
gfx::Rect GetBoundsInRootWindow() override;
#if !defined(OS_MACOSX)
#if !defined(OS_MAC)
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) override;
#endif
@ -345,7 +347,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
viz::ParentLocalSurfaceIdAllocator compositor_local_surface_id_allocator_;
#if defined(USE_X11)
std::unique_ptr<ui::XScopedCursor> invisible_cursor_;
std::unique_ptr<ui::XCursorLoader> cursor_loader_;
scoped_refptr<ui::X11Cursor> invisible_cursor_;
#endif
std::unique_ptr<content::CursorManager> cursor_manager_;

View File

@ -8,10 +8,11 @@
#if defined(USE_X11)
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#undef Status // Avoid conflicts with url_request_status.h
#include "libcef/browser/native/window_x11.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/x/x11_cursor_loader.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/x11_types.h"
#endif // defined(USE_X11)
@ -176,6 +177,14 @@ XCursorCache* cursor_cache = nullptr;
return cursor_cache->GetCursor(cursor_shape);
}
// Based on ui/base/x/x11_cursor_factory.cc.
scoped_refptr<ui::X11Cursor> CreateInvisibleCursor(
ui::XCursorLoader* cursor_loader) {
SkBitmap bitmap;
bitmap.allocN32Pixels(1, 1);
return cursor_loader->CreateCursor(bitmap, gfx::Point(0, 0));
}
} // namespace
#endif // defined(USE_X11)
@ -184,10 +193,11 @@ CefCursorHandle CefRenderWidgetHostViewOSR::GetPlatformCursor(
#if defined(USE_X11)
if (type == ui::mojom::CursorType::kNone) {
if (!invisible_cursor_) {
invisible_cursor_.reset(new ui::XScopedCursor(ui::CreateInvisibleCursor(),
gfx::GetXDisplay()));
cursor_loader_ =
std::make_unique<ui::XCursorLoader>(x11::Connection::Get());
invisible_cursor_ = CreateInvisibleCursor(cursor_loader_.get());
}
return invisible_cursor_->get();
return static_cast<::Cursor>(invisible_cursor_->xcursor());
} else {
return GetXCursor(ToCursorID(type));
}

View File

@ -5,7 +5,6 @@
#include "libcef/browser/osr/synthetic_gesture_target_osr.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/common/screen_info.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
CefSyntheticGestureTargetOSR::CefSyntheticGestureTargetOSR(

View File

@ -138,11 +138,11 @@ void CefWebContentsViewOSR::RenderViewHostChanged(
void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) {}
#if defined(OS_MACOSX)
#if defined(OS_MAC)
bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() {
return false;
}
#endif // defined(OS_MACOSX)
#endif // defined(OS_MAC)
void CefWebContentsViewOSR::StartDragging(
const content::DropData& drop_data,

View File

@ -56,7 +56,7 @@ class CefWebContentsViewOSR : public content::WebContentsView,
content::RenderViewHost* new_host) override;
void SetOverscrollControllerEnabled(bool enabled) override;
#if defined(OS_MACOSX)
#if defined(OS_MAC)
bool CloseTabAfterEventTrackingIfNeeded() override;
#endif

View File

@ -299,10 +299,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
PrefsTabHelper::RegisterProfilePrefs(registry, locale);
RegisterAnimationPolicyPrefs(registry);
// From chrome::RegisterBrowserUserPrefs.
// From chrome/browser/ui/browser_ui_prefs.cc RegisterBrowserUserPrefs.
registry->RegisterBooleanPref(
prefs::kEnableDoNotTrack, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kCaretBrowsingEnabled, false);
// TODO(guoweis): Remove next 2 options at M50.
registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
@ -311,7 +312,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
blink::kWebRTCIPHandlingDefault);
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
#if !defined(OS_MACOSX)
#if !defined(OS_MAC)
registry->RegisterBooleanPref(prefs::kFullscreenAllowed, true);
#endif

View File

@ -122,7 +122,7 @@ bool CefPrintSettingsImpl::WillCollate() {
void CefPrintSettingsImpl::SetColorModel(ColorModel model) {
CEF_VALUE_VERIFY_RETURN_VOID(true);
mutable_value()->set_color(static_cast<printing::ColorModel>(model));
mutable_value()->set_color(static_cast<printing::mojom::ColorModel>(model));
}
CefPrintSettings::ColorModel CefPrintSettingsImpl::GetColorModel() {

View File

@ -224,7 +224,7 @@ void CefPrintDialogLinux::PrintDocument(
success = metafile.SaveTo(&file);
file.Close();
if (!success)
base::DeleteFile(path_to_pdf_, false);
base::DeleteFile(path_to_pdf_);
}
if (!success) {

View File

@ -60,7 +60,8 @@ void FillInDictionaryFromPdfPrintSettings(
// Fixed settings.
print_settings.SetIntKey(kSettingPrinterType,
static_cast<int>(PrinterType::kPdf));
print_settings.SetInteger(kSettingColor, GRAY);
print_settings.SetInteger(kSettingColor,
static_cast<int>(mojom::ColorModel::kGray));
print_settings.SetInteger(kSettingDuplexMode,
static_cast<int>(mojom::DuplexMode::kSimplex));
print_settings.SetInteger(kSettingCopies, 1);
@ -100,23 +101,23 @@ void FillInDictionaryFromPdfPrintSettings(
print_settings.Set(kSettingMediaSize, std::move(dict));
}
int margin_type = DEFAULT_MARGINS;
auto margin_type = printing::mojom::MarginType::kDefaultMargins;
switch (pdf_settings.margin_type) {
case PDF_PRINT_MARGIN_NONE:
margin_type = NO_MARGINS;
margin_type = printing::mojom::MarginType::kNoMargins;
break;
case PDF_PRINT_MARGIN_MINIMUM:
margin_type = PRINTABLE_AREA_MARGINS;
margin_type = printing::mojom::MarginType::kPrintableAreaMargins;
break;
case PDF_PRINT_MARGIN_CUSTOM:
margin_type = CUSTOM_MARGINS;
margin_type = printing::mojom::MarginType::kCustomMargins;
break;
default:
break;
}
print_settings.SetInteger(kSettingMarginsType, margin_type);
if (margin_type == CUSTOM_MARGINS) {
print_settings.SetInteger(kSettingMarginsType, static_cast<int>(margin_type));
if (margin_type == printing::mojom::MarginType::kCustomMargins) {
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
dict->SetInteger(kSettingMarginTop, pdf_settings.margin_top);
dict->SetInteger(kSettingMarginRight, pdf_settings.margin_right);
@ -301,7 +302,7 @@ void CefPrintViewManager::OnRequestPrintPreview_PrintToPdf(
void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(
content::RenderFrameHost* rfh,
const PrintHostMsg_DidPreviewDocument_Params& params,
const mojom::DidPreviewDocumentParams& params,
const PrintHostMsg_PreviewIds& ids) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
StopWorker(params.document_cookie);
@ -318,7 +319,7 @@ void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(
print_render_frame_remote->OnPrintPreviewDialogClosed();
auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
params.content.metafile_data_region);
params.content->metafile_data_region);
if (!shared_buf) {
TerminatePdfPrintJob();
return;

View File

@ -8,6 +8,7 @@
#include "include/internal/cef_types_wrappers.h"
#include "base/macros.h"
#include "components/printing/common/print.mojom-forward.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@ -19,7 +20,6 @@ class WebContentsObserver;
class CefBrowserInfo;
struct PrintHostMsg_DidPreviewDocument_Params;
struct PrintHostMsg_PreviewIds;
struct PrintHostMsg_RequestPrintPreview_Params;
@ -85,7 +85,7 @@ class CefPrintViewManager
void OnDidShowPrintDialog_PrintToPdf(content::RenderFrameHost* rfh);
void OnMetafileReadyForPrinting_PrintToPdf(
content::RenderFrameHost* rfh,
const PrintHostMsg_DidPreviewDocument_Params& params,
const mojom::DidPreviewDocumentParams& params,
const PrintHostMsg_PreviewIds& ids);
void InitializePrintPreview(int frame_tree_node_id);
void TerminatePdfPrintJob();

View File

@ -25,6 +25,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/child_process_host.h"
#include "printing/mojom/print.mojom.h"
#if defined(OS_LINUX)
#include "libcef/browser/printing/print_dialog_linux.h"
@ -139,8 +140,8 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings(
// will hang until the settings are retrieved.
auto* printer_query_ptr = printer_query.get();
printer_query_ptr->GetSettings(
PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false, DEFAULT_MARGINS,
false, false,
PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false,
printing::mojom::MarginType::kDefaultMargins, false, false,
base::BindOnce(&CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply,
this, std::move(printer_query), reply_msg));
}
@ -148,11 +149,8 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings(
void CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply(
std::unique_ptr<PrinterQuery> printer_query,
IPC::Message* reply_msg) {
PrintMsg_Print_Params params;
if (!printer_query.get() ||
printer_query->last_status() != PrintingContext::OK) {
params.Reset();
} else {
mojom::PrintParams params;
if (printer_query && printer_query->last_status() == PrintingContext::OK) {
RenderParamsFromPrintSettings(printer_query->settings(), &params);
params.document_cookie = printer_query->cookie();
}

View File

@ -49,7 +49,7 @@ CEF_BUTTON_IMPL_T class CefButtonImpl : public CEF_VIEW_IMPL_D {
CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) {
CEF_REQUIRE_VALID_RETURN_VOID();
views::Button::ButtonState old_state = ParentClass::root_view()->state();
views::Button::ButtonState old_state = ParentClass::root_view()->GetState();
views::Button::ButtonState new_state =
static_cast<views::Button::ButtonState>(state);
@ -72,7 +72,7 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) {
CEF_BUTTON_IMPL_T cef_button_state_t CEF_BUTTON_IMPL_D::GetState() {
CEF_REQUIRE_VALID_RETURN(CEF_BUTTON_STATE_NORMAL);
return static_cast<cef_button_state_t>(ParentClass::root_view()->state());
return static_cast<cef_button_state_t>(ParentClass::root_view()->GetState());
}
CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) {

View File

@ -61,7 +61,7 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed(
ParentClass::cef_delegate()->OnButtonPressed(GetCefButton());
if (ParentClass::ink_drop_mode() != views::Button::InkDropMode::OFF &&
!ParentClass::IsFocusable() &&
ParentClass::state() != views::Button::STATE_PRESSED) {
ParentClass::GetState() != views::Button::STATE_PRESSED) {
// Ink drop state does not get reset properly on click when the button is
// non-focusable. Reset the ink drop state here if the state has not been
// explicitly set to pressed by the OnButtonPressed callback calling

View File

@ -18,7 +18,7 @@
// CefButtonView template.
class MenuButtonEx : public views::MenuButton, public views::ButtonListener {
public:
MenuButtonEx() : views::MenuButton(base::string16(), this) {
MenuButtonEx() : views::MenuButton(this, base::string16()) {
// TODO(cef): MenuButton should not use ButtonListener. See
// http://crbug.com/585252 for details.
Button::listener_ = this;

View File

@ -36,7 +36,11 @@ class ClientViewEx : public views::ClientView {
DCHECK(window_delegate_);
}
bool CanClose() override { return window_delegate_->CanWidgetClose(); }
views::CloseRequestResult OnWindowCloseRequested() override {
return window_delegate_->CanWidgetClose()
? views::CloseRequestResult::kCanClose
: views::CloseRequestResult::kCannotClose;
}
private:
CefWindowView::Delegate* window_delegate_; // Not owned by this object.
@ -404,15 +408,15 @@ views::ClientView* CefWindowView::CreateClientView(views::Widget* widget) {
return new ClientViewEx(widget, GetContentsView(), window_delegate_);
}
views::NonClientFrameView* CefWindowView::CreateNonClientFrameView(
views::Widget* widget) {
std::unique_ptr<views::NonClientFrameView>
CefWindowView::CreateNonClientFrameView(views::Widget* widget) {
if (is_frameless_) {
// Custom frame type that doesn't render a caption.
return new CaptionlessFrameView(widget, this);
return std::make_unique<CaptionlessFrameView>(widget, this);
} else if (widget->ShouldUseNativeFrame()) {
// DesktopNativeWidgetAura::CreateNonClientFrameView() returns
// NativeFrameView by default. Extend that type.
return new NativeFrameViewEx(widget, this);
return std::make_unique<NativeFrameViewEx>(widget, this);
}
// Use Chromium provided CustomFrameView. In case if we would like to

View File

@ -63,7 +63,7 @@ class CefWindowView
void WindowClosing() override;
views::View* GetContentsView() override;
views::ClientView* CreateClientView(views::Widget* widget) override;
views::NonClientFrameView* CreateNonClientFrameView(
std::unique_ptr<views::NonClientFrameView> CreateNonClientFrameView(
views::Widget* widget) override;
bool ShouldDescendIntoChildForEventHandling(
gfx::NativeView child,

View File

@ -39,14 +39,14 @@
#include "ipc/ipc_buildflags.h"
#include "net/base/features.h"
#include "pdf/pdf_ppapi.h"
#include "sandbox/policy/switches.h"
#include "services/network/public/cpp/features.h"
#include "services/service_manager/sandbox/switches.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "libcef/common/util_mac.h"
#endif
@ -127,7 +127,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
}
}
#if defined(OS_MACOSX)
#if defined(OS_MAC)
if (settings_->framework_dir_path.length > 0) {
base::FilePath file_path =
base::FilePath(CefString(&settings_->framework_dir_path));
@ -144,7 +144,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
#endif
if (no_sandbox)
command_line->AppendSwitch(service_manager::switches::kNoSandbox);
command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox);
if (settings_->user_agent.length > 0) {
command_line->AppendSwitchASCII(switches::kUserAgent,
@ -355,7 +355,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
content::SetContentClient(&content_client_);
#if defined(OS_MACOSX)
#if defined(OS_MAC)
util_mac::BasicStartupComplete();
#endif
@ -370,7 +370,7 @@ void AlloyMainDelegate::PreSandboxStartup() {
if (process_type.empty()) {
// Only override these paths when executing the main process.
#if defined(OS_MACOSX)
#if defined(OS_MAC)
util_mac::PreSandboxStartup();
#endif

View File

@ -12,7 +12,6 @@
#include "base/logging.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/common/content_switches.h"
#include "third_party/blink/public/platform/platform.h"
#if defined(OS_WIN)
#include <windows.h>
@ -108,11 +107,3 @@ const wchar_t* CefAppManager::GetResourceDllName() {
return file_path;
}
#endif // defined(OS_WIN)
blink::WebURLLoaderFactory* CefAppManager::GetDefaultURLLoaderFactory() {
if (!default_url_loader_factory_) {
default_url_loader_factory_ =
blink::Platform::Current()->CreateDefaultURLLoaderFactory();
}
return default_url_loader_factory_.get();
}

View File

@ -15,10 +15,6 @@
#include "build/build_config.h"
#include "content/public/common/content_client.h"
namespace blink {
class WebURLLoaderFactory;
}
class CefBrowserContext;
struct CefSchemeInfo;
@ -58,12 +54,6 @@ class CefAppManager {
const wchar_t* GetResourceDllName();
#endif
// The following methods are only available in the render process.
// Returns a factory that only supports unintercepted http(s) and blob
// requests. Used by CefRenderURLRequest.
blink::WebURLLoaderFactory* GetDefaultURLLoaderFactory();
protected:
CefAppManager();
virtual ~CefAppManager();
@ -73,8 +63,6 @@ class CefAppManager {
SchemeInfoList scheme_info_list_;
bool scheme_info_list_locked_ = false;
std::unique_ptr<blink::WebURLLoaderFactory> default_url_loader_factory_;
DISALLOW_COPY_AND_ASSIGN(CefAppManager);
};

View File

@ -125,7 +125,7 @@ const char kDevToolsProtocolLogFile[] = "devtools-protocol-log-file";
// Enable use of the Chrome runtime in CEF. See issue #2969 for details.
const char kEnableChromeRuntime[] = "enable-chrome-runtime";
#if defined(OS_MACOSX)
#if defined(OS_MAC)
// Path to the framework directory.
const char kFrameworkDirPath[] = "framework-dir-path";
const char kMainBundlePath[] = "main-bundle-path";

View File

@ -56,7 +56,7 @@ extern const char kDisableNewBrowserInfoTimeout[];
extern const char kDevToolsProtocolLogFile[];
extern const char kEnableChromeRuntime[];
#if defined(OS_MACOSX)
#if defined(OS_MAC)
extern const char kFrameworkDirPath[];
extern const char kMainBundlePath[];
#endif

View File

@ -10,9 +10,10 @@
#include "libcef/common/crash_reporting.h"
#include "libcef/common/resource_util.h"
#include "base/command_line.h"
#include "content/public/common/content_switches.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "libcef/common/util_mac.h"
#endif
@ -42,7 +43,7 @@ bool ChromeMainDelegateCef::BasicStartupComplete(int* exit_code) {
base::CommandLine::ForCurrentProcess());
#endif
#if defined(OS_MACOSX)
#if defined(OS_MAC)
util_mac::BasicStartupComplete();
#endif
}
@ -56,11 +57,11 @@ void ChromeMainDelegateCef::PreSandboxStartup() {
const std::string& process_type =
command_line->GetSwitchValueASCII(switches::kProcessType);
#if defined(OS_MACOSX)
#if defined(OS_MAC)
if (process_type.empty()) {
util_mac::PreSandboxStartup();
}
#endif // defined(OS_MACOSX)
#endif // defined(OS_MAC)
// Since this may be configured via CefSettings we override the value on
// all platforms. We can't use the default implementation on macOS because

View File

@ -114,7 +114,11 @@ void CefCommandLineImpl::AppendSwitch(const CefString& name) {
void CefCommandLineImpl::AppendSwitchWithValue(const CefString& name,
const CefString& value) {
CEF_VALUE_VERIFY_RETURN_VOID(true);
mutable_value()->AppendSwitchNative(name, value);
#if defined(OS_WIN)
mutable_value()->AppendSwitchNative(name, value.ToWString());
#else
mutable_value()->AppendSwitchNative(name, value.ToString());
#endif
}
bool CefCommandLineImpl::HasArguments() {

View File

@ -23,7 +23,7 @@
#include "services/service_manager/embedder/switches.h"
#include "third_party/crashpad/crashpad/client/annotation.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "libcef/common/util_mac.h"
#endif
@ -39,7 +39,7 @@
#include "chrome/common/chrome_paths.h"
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_MAC)
#include "content/public/common/content_switches.h"
#include "libcef/common/cef_crash_report_utils.h"
#endif
@ -79,7 +79,7 @@ PathString GetCrashConfigPath() {
#elif defined(OS_POSIX)
base::FilePath config_path;
#if defined(OS_MACOSX)
#if defined(OS_MAC)
// Start with the path to the main app Resources directory. May be empty if
// not running in an app bundle.
config_path = util_mac::GetMainResourcesDirectory();
@ -439,7 +439,7 @@ bool CefCrashReporterClient::ReadCrashConfigFile() {
app_name_ = val_str;
}
}
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
else if (name_str == "BrowserCrashForwardingEnabled") {
enable_browser_crash_forwarding_ = ParseBool(val_str);
}
@ -617,7 +617,7 @@ void CefCrashReporterClient::GetProductNameAndVersion(std::string* product_name,
*version = product_version_;
}
#if !defined(OS_MACOSX)
#if !defined(OS_MAC)
base::FilePath CefCrashReporterClient::GetReporterLogFilename() {
return base::FilePath(FILE_PATH_LITERAL("uploads.log"));
@ -631,7 +631,7 @@ bool CefCrashReporterClient::EnableBreakpadForProcess(
process_type == switches::kGpuProcess;
}
#endif // !defined(OS_MACOSX)
#endif // !defined(OS_MAC)
bool CefCrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
// By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate
@ -656,7 +656,7 @@ bool CefCrashReporterClient::GetCollectStatsInSample() {
return true;
}
#if defined(OS_WIN) || defined(OS_MACOSX)
#if defined(OS_WIN) || defined(OS_MAC)
bool CefCrashReporterClient::ReportingIsEnforcedByPolicy(
bool* crashpad_enabled) {
*crashpad_enabled = true;
@ -664,7 +664,7 @@ bool CefCrashReporterClient::ReportingIsEnforcedByPolicy(
}
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_MAC)
bool CefCrashReporterClient::IsRunningUnattended() {
// Crash upload will only be enabled with Breakpad on Linux if this method
// returns false.
@ -717,13 +717,13 @@ bool CefCrashReporterClient::HasCrashExternalHandler() const {
#endif // defined(OS_WIN)
#if defined(OS_MACOSX)
#if defined(OS_MAC)
bool CefCrashReporterClient::EnableBrowserCrashForwarding() {
return enable_browser_crash_forwarding_;
}
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_MAC)
CefCrashReporterClient::ParameterMap CefCrashReporterClient::FilterParameters(
const ParameterMap& parameters) {
return crash_report_utils::FilterParameters(parameters);

View File

@ -57,7 +57,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
void GetProductNameAndVersion(std::string* product_name,
std::string* version,
std::string* channel) override;
#if !defined(OS_MACOSX)
#if !defined(OS_MAC)
base::FilePath GetReporterLogFilename() override;
bool EnableBreakpadForProcess(const std::string& process_type) override;
#endif
@ -67,11 +67,11 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
// All of these methods must return true to enable crash report upload.
bool GetCollectStatsConsent() override;
bool GetCollectStatsInSample() override;
#if defined(OS_WIN) || defined(OS_MACOSX)
#if defined(OS_WIN) || defined(OS_MAC)
bool ReportingIsEnforcedByPolicy(bool* crashpad_enabled) override;
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_MAC)
bool IsRunningUnattended() override;
#endif
@ -84,11 +84,11 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
bool HasCrashExternalHandler() const;
#endif
#if defined(OS_MACOSX)
#if defined(OS_MAC)
bool EnableBrowserCrashForwarding() override;
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_MAC)
ParameterMap FilterParameters(const ParameterMap& parameters) override;
#endif
@ -123,7 +123,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
std::string external_handler_;
#endif
#if defined(OS_MACOSX)
#if defined(OS_MAC)
bool enable_browser_crash_forwarding_ = false;
#endif

View File

@ -21,7 +21,7 @@
#include "content/public/common/content_switches.h"
#include "services/service_manager/embedder/switches.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "base/mac/foundation_util.h"
#include "components/crash/core/app/crashpad.h"
#include "components/crash/core/common/crash_keys.h"
@ -33,7 +33,7 @@
#include "libcef/common/crash_reporter_client.h"
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_MAC)
#include "components/crash/core/app/breakpad_linux.h"
#include "v8/include/v8-wasm-trap-handler-posix.h"
#endif
@ -101,7 +101,7 @@ void InitCrashReporter(const base::CommandLine& command_line,
crash_reporter::SetCrashReporterClient(crash_client);
#if defined(OS_MACOSX)
#if defined(OS_MAC)
// TODO(mark): Right now, InitializeCrashpad() needs to be called after
// CommandLine::Init() and configuration of chrome::DIR_CRASH_DUMPS. Ideally,
// Crashpad initialization could occur sooner, preferably even before the
@ -131,7 +131,7 @@ void InitCrashReporter(const base::CommandLine& command_line,
}
g_crash_reporting_enabled = true;
#else // !defined(OS_MACOSX)
#else // !defined(OS_MAC)
if (process_type != service_manager::switches::kZygoteProcess) {
// Crash reporting for subprocesses created using the zygote will be
@ -140,7 +140,7 @@ void InitCrashReporter(const base::CommandLine& command_line,
g_crash_reporting_enabled = true;
}
#endif // !defined(OS_MACOSX)
#endif // !defined(OS_MAC)
}
#endif // defined(OS_POSIX)
@ -196,7 +196,7 @@ bool SetCrashKeyValue(const base::StringPiece& key,
void BasicStartupComplete(base::CommandLine* command_line) {
CefCrashReporterClient* crash_client = g_crash_reporter_client.Pointer();
if (crash_client->ReadCrashConfigFile()) {
#if !defined(OS_MACOSX)
#if !defined(OS_MAC)
// Breakpad requires this switch.
command_line->AppendSwitch(switches::kEnableCrashReporter);
@ -228,7 +228,7 @@ void PreSandboxStartup(const base::CommandLine& command_line,
crash_keys::SetSwitchesFromCommandLine(command_line, &IsBoringCEFSwitch);
}
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MAC)
void ZygoteForked(base::CommandLine* command_line,
const std::string& process_type) {
CefCrashReporterClient* crash_client = g_crash_reporter_client.Pointer();

View File

@ -29,7 +29,7 @@ void BasicStartupComplete(base::CommandLine* command_line);
void PreSandboxStartup(const base::CommandLine& command_line,
const std::string& process_type);
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MAC)
void ZygoteForked(base::CommandLine* command_line,
const std::string& process_type);
#endif

View File

@ -58,15 +58,15 @@ void CefExtensionsClient::FilterHostPermissions(
NOTIMPLEMENTED();
}
void CefExtensionsClient::SetScriptingWhitelist(
const ScriptingWhitelist& whitelist) {
scripting_whitelist_ = whitelist;
void CefExtensionsClient::SetScriptingAllowlist(
const ScriptingAllowlist& allowlist) {
scripting_allowlist_ = allowlist;
}
const ExtensionsClient::ScriptingWhitelist&
CefExtensionsClient::GetScriptingWhitelist() const {
// TODO(jamescook): Real whitelist.
return scripting_whitelist_;
const ExtensionsClient::ScriptingAllowlist&
CefExtensionsClient::GetScriptingAllowlist() const {
// TODO(jamescook): Real allowlist.
return scripting_allowlist_;
}
URLPatternSet CefExtensionsClient::GetPermittedChromeSchemeHosts(

View File

@ -29,8 +29,8 @@ class CefExtensionsClient : public ExtensionsClient {
void FilterHostPermissions(const URLPatternSet& hosts,
URLPatternSet* new_hosts,
PermissionIDSet* permissions) const override;
void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override;
const ScriptingWhitelist& GetScriptingWhitelist() const override;
void SetScriptingAllowlist(const ScriptingAllowlist& allowlist) override;
const ScriptingAllowlist& GetScriptingAllowlist() const override;
URLPatternSet GetPermittedChromeSchemeHosts(
const Extension* extension,
const APIPermissionSet& api_permissions) const override;
@ -42,7 +42,7 @@ class CefExtensionsClient : public ExtensionsClient {
private:
const ChromePermissionMessageProvider permission_message_provider_;
ScriptingWhitelist scripting_whitelist_;
ScriptingAllowlist scripting_allowlist_;
// Mutable to allow caching in a const method.
const GURL webstore_base_url_;

View File

@ -25,7 +25,7 @@ bool PdfExtensionEnabled() {
}
bool PrintPreviewEnabled() {
#if defined(OS_MACOSX)
#if defined(OS_MAC)
// Not currently supported on macOS.
return false;
#else

View File

@ -74,7 +74,11 @@ bool CefDirectoryExists(const CefString& path) {
bool CefDeleteFile(const CefString& path, bool recursive) {
if (!AllowFileIO())
return false;
return base::DeleteFile(path, recursive);
if (recursive) {
return base::DeletePathRecursively(path);
} else {
return base::DeleteFile(path);
}
}
bool CefZipDirectory(const CefString& src_dir,

View File

@ -19,6 +19,7 @@
#include "net/http/http_status_code.h"
#include "net/url_request/redirect_info.h"
#include "net/url_request/redirect_util.h"
#include "net/url_request/referrer_policy.h"
#include "net/url_request/url_request.h"
#include "services/network/public/cpp/resource_request.h"
@ -180,10 +181,10 @@ net::RedirectInfo MakeRedirectInfo(const network::ResourceRequest& request,
}
}
net::URLRequest::FirstPartyURLPolicy first_party_url_policy =
auto first_party_url_policy =
request.update_first_party_url_on_redirect
? net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT
: net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL;
? net::RedirectInfo::FirstPartyURLPolicy::UPDATE_URL_ON_REDIRECT
: net::RedirectInfo::FirstPartyURLPolicy::NEVER_CHANGE_URL;
return net::RedirectInfo::ComputeRedirectInfo(
request.method, request.url, request.site_for_cookies,
first_party_url_policy, request.referrer_policy, request.referrer.spec(),

View File

@ -32,6 +32,7 @@
#include "net/http/http_request_headers.h"
#include "net/http/http_util.h"
#include "net/url_request/redirect_info.h"
#include "net/url_request/referrer_policy.h"
#include "services/network/public/cpp/data_element.h"
#include "services/network/public/cpp/network_switches.h"
#include "services/network/public/cpp/resource_request.h"
@ -241,7 +242,7 @@ CefRefPtr<CefRequest> CefRequest::Create() {
CefRequestImpl::CefRequestImpl() {
// Verify that our enum matches Chromium's values.
static_assert(static_cast<int>(REFERRER_POLICY_LAST_VALUE) ==
static_cast<int>(net::URLRequest::MAX_REFERRER_POLICY),
static_cast<int>(net::ReferrerPolicy::MAX),
"enum mismatch");
base::AutoLock lock_scope(lock_);
@ -498,7 +499,7 @@ void CefRequestImpl::Get(network::ResourceRequest* request,
if (ShouldSet(kChangedReferrer, changed_only)) {
request->referrer = referrer_url_;
request->referrer_policy =
static_cast<net::URLRequest::ReferrerPolicy>(referrer_policy_);
static_cast<net::ReferrerPolicy>(referrer_policy_);
}
if (ShouldSet(kChangedHeaderMap, changed_only)) {

View File

@ -19,7 +19,7 @@
#include "chrome/common/chrome_switches.h"
#include "ui/base/layout.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "base/mac/foundation_util.h"
#include "libcef/common/util_mac.h"
#endif
@ -55,7 +55,7 @@ bool GetSystemFlashFilename(base::FilePath* out_path) {
return true;
}
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
const base::FilePath::CharType kPepperFlashSystemBaseDirectory[] =
FILE_PATH_LITERAL("Internet Plug-Ins/PepperFlashPlayer");
@ -78,7 +78,7 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) {
return true;
}
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
// Based on chrome/common/chrome_paths_mac.mm.
bool GetDefaultUserDataDirectory(base::FilePath* result) {
@ -168,7 +168,7 @@ bool GetDefaultDownloadSafeDirectory(base::FilePath* result) {
} // namespace
#if defined(OS_MACOSX)
#if defined(OS_MAC)
base::FilePath GetResourcesDir() {
return util_mac::GetFrameworkResourcesDirectory();
@ -183,7 +183,7 @@ base::FilePath GetDefaultLogFilePath() {
.Append(FILE_PATH_LITERAL(exe_name + "_debug.log"));
}
#else // !defined(OS_MACOSX)
#else // !defined(OS_MAC)
base::FilePath GetResourcesDir() {
base::FilePath pak_dir;
@ -198,26 +198,26 @@ base::FilePath GetDefaultLogFilePath() {
return log_path.Append(FILE_PATH_LITERAL("debug.log"));
}
#endif // !defined(OS_MACOSX)
#endif // !defined(OS_MAC)
void OverridePepperFlashSystemPluginPath() {
#if defined(OS_WIN) || defined(OS_MACOSX)
#if defined(OS_WIN) || defined(OS_MAC)
base::FilePath plugin_filename;
#if defined(OS_WIN)
if (!GetSystemFlashFilename(&plugin_filename))
return;
#elif defined(OS_MACOSX)
#elif defined(OS_MAC)
if (!util_mac::GetLocalLibraryDirectory(&plugin_filename))
return;
plugin_filename = plugin_filename.Append(kPepperFlashSystemBaseDirectory)
.Append(chrome::kPepperFlashPluginFilename);
#endif // defined(OS_MACOSX)
#endif // defined(OS_MAC)
if (!plugin_filename.empty()) {
base::PathService::Override(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN,
plugin_filename);
}
#else // !(defined(OS_WIN) || defined(OS_MACOSX))
#else // !(defined(OS_WIN) || defined(OS_MAC))
// A system plugin is not available on other platforms.
return;
#endif

View File

@ -1,34 +0,0 @@
// Copyright 2018 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/service_manifests/cef_content_browser_overlay_manifest.h"
#include "base/command_line.h"
#include "base/no_destructor.h"
#include "build/build_config.h"
#include "components/metrics/public/mojom/call_stack_profile_collector.mojom.h"
#include "extensions/buildflags/buildflags.h"
#include "services/service_manager/public/cpp/manifest_builder.h"
#if defined(OS_WIN)
#include "chrome/common/conflicts/module_event_sink_win.mojom.h"
#endif
const service_manager::Manifest& GetCefContentBrowserOverlayManifest() {
static base::NoDestructor<service_manager::Manifest> manifest {
service_manager::ManifestBuilder()
.ExposeCapability("gpu",
service_manager::Manifest::InterfaceList<
metrics::mojom::CallStackProfileCollector>())
.ExposeCapability("renderer",
service_manager::Manifest::InterfaceList<
#if defined(OS_WIN)
mojom::ModuleEventSink,
#endif
metrics::mojom::CallStackProfileCollector>())
.RequireCapability("chrome_printing", "converter")
.Build()
};
return *manifest;
}

View File

@ -1,16 +0,0 @@
// Copyright 2018 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_SERVICE_MANIFESTS_CEF_CONTENT_BROWSER_OVERLAY_MANIFEST_H_
#define CEF_LIBCEF_COMMON_SERVICE_MANIFESTS_CEF_CONTENT_BROWSER_OVERLAY_MANIFEST_H_
#include "services/service_manager/public/cpp/manifest.h"
// Returns the Manifest CEF amends to Content's content_browser service
// manifest. This allows CEF to extend the capabilities exposed and/or
// required by content_browser service instances, as well as declaring any
// additional in- and out-of-process per-profile packaged services.
const service_manager::Manifest& GetCefContentBrowserOverlayManifest();
#endif // CEF_LIBCEF_COMMON_SERVICE_MANIFESTS_CEF_CONTENT_BROWSER_OVERLAY_MANIFEST_H_

View File

@ -7,7 +7,6 @@
#include "libcef/common/app_manager.h"
#include "libcef/common/task_runner_impl.h"
#include "libcef/features/runtime_checks.h"
#include "libcef/renderer/render_urlrequest_impl.h"
#include "base/logging.h"
#include "base/notreached.h"
@ -39,13 +38,6 @@ CefRefPtr<CefURLRequest> CefURLRequest::Create(
if (impl->Start())
return impl.get();
return nullptr;
} else if (content_client->renderer()) {
// In the render process.
CefRefPtr<CefRenderURLRequest> impl =
new CefRenderURLRequest(nullptr, request, client);
if (impl->Start())
return impl.get();
return nullptr;
} else {
NOTREACHED() << "called in unsupported process";
return nullptr;

View File

@ -25,8 +25,8 @@
#include "content/public/common/content_switches.h"
#include "media/cdm/cdm_host_file.h"
#include "media/cdm/supported_cdm_versions.h"
#include "sandbox/policy/switches.h"
#include "services/service_manager/embedder/switches.h"
#include "services/service_manager/sandbox/switches.h"
#include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck
namespace {
@ -38,7 +38,7 @@ base::LazyInstance<CefWidevineLoader>::Leaky g_widevine_loader =
// Name of the Widevine CDM OS in the component manifest.
const char kWidevineCdmOs[] =
#if defined(OS_MACOSX)
#if defined(OS_MAC)
"mac";
#elif defined(OS_WIN)
"win";
@ -473,7 +473,7 @@ void CefWidevineLoader::AddContentDecryptionModules(
// load all plugins before initializing the sandbox.
if (command_line.GetSwitchValueASCII(switches::kProcessType) !=
service_manager::switches::kZygoteProcess ||
command_line.HasSwitch(service_manager::switches::kNoSandbox)) {
command_line.HasSwitch(sandbox::policy::switches::kNoSandbox)) {
return;
}

View File

@ -109,7 +109,7 @@
#include "third_party/blink/public/web/web_view.h"
#include "ui/base/l10n/l10n_util.h"
#if defined(OS_MACOSX)
#if defined(OS_MAC)
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
#endif
@ -359,7 +359,7 @@ void AlloyContentRendererClient::RunSingleProcessCleanup() {
}
void AlloyContentRendererClient::PostIOThreadCreated(
base::SingleThreadTaskRunner*) {
base::SingleThreadTaskRunner*) {
// TODO(cef): Enable these once the implementation supports it.
blink::WebRuntimeFeatures::EnableNotifications(false);
blink::WebRuntimeFeatures::EnablePushMessaging(false);
@ -390,10 +390,10 @@ void AlloyContentRendererClient::RenderThreadStarted() {
if (content::RenderProcessHost::run_renderer_in_process()) {
// When running in single-process mode register as a destruction observer
// on the render thread's MessageLoop.
base::MessageLoopCurrent::Get()->AddDestructionObserver(this);
base::CurrentThread::Get()->AddDestructionObserver(this);
}
#if defined(OS_MACOSX)
#if defined(OS_MAC)
{
base::ScopedCFTypeRef<CFStringRef> key(
base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding"));
@ -408,7 +408,7 @@ void AlloyContentRendererClient::RenderThreadStarted() {
CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication);
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
}
#endif // defined(OS_MACOSX)
#endif // defined(OS_MAC)
if (extensions::PdfExtensionEnabled()) {
pdf_print_client_.reset(new ChromePDFPrintClient());
@ -749,7 +749,7 @@ CefRefPtr<CefBrowserImpl> AlloyContentRendererClient::MaybeCreateBrowser(
return nullptr;
}
#if defined(OS_MACOSX)
#if defined(OS_MAC)
// FIXME: It would be better if this API would be a callback from the
// WebKit layer, or if it would be exposed as an WebView instance method; the
// current implementation uses a static variable, and WebKit needs to be

View File

@ -16,9 +16,9 @@
#include "libcef/renderer/browser_impl.h"
#include "base/compiler_specific.h"
#include "base/message_loop/message_loop_current.h"
#include "base/optional.h"
#include "base/sequenced_task_runner.h"
#include "base/task/current_thread.h"
#include "chrome/common/plugin.mojom.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/public/renderer/render_thread.h"
@ -52,7 +52,7 @@ class SpellCheck;
class AlloyContentRendererClient
: public content::ContentRendererClient,
public service_manager::LocalInterfaceProvider,
public base::MessageLoopCurrent::DestructionObserver {
public base::CurrentThread::DestructionObserver {
public:
AlloyContentRendererClient();
~AlloyContentRendererClient() override;

View File

@ -13,11 +13,8 @@
#include "third_party/blink/public/web/web_node.h"
#include "third_party/blink/public/web/web_view_client.h"
#include "third_party/blink/renderer/bindings/core/v8/referrer_script_info.h"
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
#include "third_party/blink/renderer/bindings/core/v8/script_source_code.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_code_cache.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/node.h"
@ -31,6 +28,7 @@
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
#include "third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h"
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
#undef LOG
@ -179,13 +177,6 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
if (start_line < 1)
start_line = 1;
const blink::ScriptSourceCode ssc = blink::ScriptSourceCode(
source, blink::ScriptSourceLocationType::kInternal,
nullptr, /* cache_handler */
blink::KURL(source_url),
WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line),
WTF::OrdinalNumber::FromZeroBasedInt(0)));
v8::MaybeLocal<v8::Value> result;
blink::LocalFrame* frame = blink::ToLocalFrameIfNotDetached(context);
@ -193,35 +184,25 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
return result;
blink::V8CacheOptions v8CacheOptions(blink::kV8CacheOptionsDefault);
if (frame && frame->GetSettings())
v8CacheOptions = frame->GetSettings()->GetV8CacheOptions();
if (const blink::Settings* settings = frame->GetSettings())
v8CacheOptions = settings->GetV8CacheOptions();
// Based on V8ScriptRunner::CompileAndRunInternalScript:
v8::ScriptCompiler::CompileOptions compile_options;
blink::V8CodeCache::ProduceCacheOptions produce_cache_options;
v8::ScriptCompiler::NoCacheReason no_cache_reason;
std::tie(compile_options, produce_cache_options, no_cache_reason) =
blink::V8CodeCache::GetCompileOptions(v8CacheOptions, ssc);
const blink::ScriptSourceCode ssc = blink::ScriptSourceCode(
source, blink::ScriptSourceLocationType::kInternal,
nullptr, /* cache_handler */
blink::KURL(source_url),
WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line),
WTF::OrdinalNumber::FromZeroBasedInt(0)));
// Currently internal scripts don't have cache handlers, so we should not
// produce cache for them.
DCHECK_EQ(produce_cache_options,
blink::V8CodeCache::ProduceCacheOptions::kNoProduceCache);
v8::Local<v8::Script> script;
// Use default ReferrerScriptInfo here:
// - nonce: empty for internal script, and
// - parser_state: always "not parser inserted" for internal scripts.
if (!blink::V8ScriptRunner::CompileScript(
blink::ScriptState::From(context), ssc, sanitizeScriptErrors,
compile_options, no_cache_reason, blink::ReferrerScriptInfo())
.ToLocal(&script)) {
result = blink::V8ScriptRunner::CompileAndRunScript(
isolate, blink::ScriptState::From(context), frame->DomWindow(), ssc,
ssc.Url(), sanitizeScriptErrors, blink::ScriptFetchOptions(),
v8CacheOptions);
if (result.IsEmpty()) {
DCHECK(tryCatch.HasCaught());
return result;
}
return blink::V8ScriptRunner::RunCompiledScript(
isolate, script, blink::ToExecutionContext(context));
return result;
}
bool IsScriptForbidden() {

View File

@ -76,7 +76,7 @@ void CefRenderFrameObserver::DidFinishLoad() {
}
}
void CefRenderFrameObserver::FrameDetached() {
void CefRenderFrameObserver::WillDetach() {
if (frame_) {
frame_->OnDetached();
frame_ = nullptr;

View File

@ -31,7 +31,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
void DidCommitProvisionalLoad(ui::PageTransition transition) override;
void DidFailProvisionalLoad() override;
void DidFinishLoad() override;
void FrameDetached() override;
void WillDetach() override;
void FocusedElementChanged(const blink::WebElement& element) override;
void DraggableRegionsChanged() override;
void DidCreateScriptContext(v8::Handle<v8::Context> context,

View File

@ -6,7 +6,6 @@
#include <stdint.h>
#include "libcef/common/app_manager.h"
#include "libcef/common/request_impl.h"
#include "libcef/common/response_impl.h"
#include "libcef/common/task_runner_impl.h"
@ -155,8 +154,8 @@ class CefRenderURLRequest::Context
factory = static_cast<CefFrameImpl*>(frame_.get())->GetURLLoaderFactory();
}
if (!factory) {
// This factory only supports unintercepted http(s) and blob requests.
factory = CefAppManager::Get()->GetDefaultURLLoaderFactory();
// Global requests are not supported.
return false;
}
loader_ = factory->CreateURLLoader(
@ -446,6 +445,9 @@ CefRenderURLRequest::CefRenderURLRequest(
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
CefRefPtr<CefURLRequestClient> client) {
DCHECK(frame);
DCHECK(request);
DCHECK(client);
context_ = new Context(this, frame, request, client);
}

View File

@ -4,8 +4,8 @@
# Append platform specific sources to a list of sources.
macro(LIBCEF_APPEND_PLATFORM_SOURCES name_of_list)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND ${name_of_list}_MACOSX)
list(APPEND ${name_of_list} ${${name_of_list}_MACOSX})
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND ${name_of_list}_MAC)
list(APPEND ${name_of_list} ${${name_of_list}_MAC})
endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND ${name_of_list}_LINUX)
list(APPEND ${name_of_list} ${${name_of_list}_LINUX})
@ -28,16 +28,16 @@ set(CEF_TARGET libcef_dll_wrapper)
'includes_capi',
'autogen_capi_includes',
'includes_wrapper',
'includes_wrapper_mac:MACOSX',
'includes_wrapper_mac:MAC',
'includes_win:WINDOWS',
'includes_win_capi:WINDOWS',
'includes_mac:MACOSX',
'includes_mac_capi:MACOSX',
'includes_mac:MAC',
'includes_mac_capi:MAC',
'includes_linux:LINUX',
'includes_linux_capi:LINUX',
'libcef_dll_wrapper_sources_base',
'libcef_dll_wrapper_sources_common',
'libcef_dll_wrapper_sources_mac:MACOSX',
'libcef_dll_wrapper_sources_mac:MAC',
'autogen_client_side',
],
}}

Some files were not shown because too many files have changed in this diff Show More