Compare commits

..

22 Commits
4951 ... 4692

Author SHA1 Message Date
Marshall Greenblatt
a00bca5aa5 alloy: Move ExtensionsBrowserClient ownership to BrowserProcess (fixes issue #3247)
Fixes a shutdown crash due to `ExtensionsBrowserClient::Set(nullptr)` being
called too early. Some code that may occasionally be triggered via
`content::ContentMainShutdown()` is expecting the extensions objects to still
be valid.

This new ownership pattern matches the code in chrome/.
2022-01-28 16:55:17 -05:00
Marshall Greenblatt
0e8afa73ed alloy: Fix shutdown assert if OneShotTimer is deleted on the wrong thread 2022-01-28 16:54:58 -05:00
Marshall Greenblatt
45ce54393e Fix notification for focused frame (fixes issue #3248) 2022-01-24 11:35:36 -05:00
Marshall Greenblatt
8961cdbbb2 Update to Chromium version 97.0.4692.99 2022-01-20 14:26:51 +00:00
Marshall Greenblatt
2b00258407 chrome: Fix crash when clicking Reading List sidebar link (fixes issue #3128) 2022-01-14 13:58:00 -05:00
Marshall Greenblatt
9738bf9a4a cefclient: Disable alert on space bar press (see issue #3184)
This will be reverted after issue #3184 is resolved.
2022-01-14 12:17:01 -05:00
Nick Mueller
1cbaee4868 Fix OSR resize issue when multiple monitors have different scale factors (fixes issue #3240) 2022-01-14 11:58:08 -05:00
Marshall Greenblatt
b821dc3532 Fix possible use after shutdown of BrowserContext (fixes issue #3193) 2022-01-10 17:18:03 -05:00
Marshall Greenblatt
50067f29ad Fix certificate errors with restarted/redirected requests (fixes issue #3200)
URLLoaderNetworkServiceObserver is used for routing certificate and
authentication callbacks from the NetworkService to the associated
StoragePartition instance. With request interception enabled this object was
previously only assigned for the initial request. This change adds assignment
for restarted/redirected requests as well.
2022-01-06 19:46:03 -05:00
Marshall Greenblatt
37ed8b9b53 Update copyright year in generated files 2022-01-06 13:06:48 -05:00
Marshall Greenblatt
342bd43f4c alloy: Disable bfcache in M97 (see issue #3237)
Disabled so as not to block promotion of M97 to the stable channel.
2022-01-06 12:54:06 -05:00
Marshall Greenblatt
695453b3df Update to Chromium version 97.0.4692.71 2021-12-31 21:36:40 +00:00
Marshall Greenblatt
6f35d008bf Update to Chromium version 97.0.4692.56 2021-12-16 16:40:24 +00:00
Marshall Greenblatt
b2e06a3503 Update to Chromium version 97.0.4692.45 2021-12-09 16:01:52 +00:00
Marshall Greenblatt
4eb2da6aac Update to Chromium version 97.0.4692.36 2021-12-03 17:21:32 +00:00
Marshall Greenblatt
ac129eb78e Add kPdfRenderer define for non-Windows platforms (see issue #3047)
This switch is currently only defined for Windows in
content/public/common/content_switches.h.
2021-12-02 12:50:41 -05:00
Marshall Greenblatt
0d91c82102 Skip GetNewBrowserInfo call for PDF renderer processes (see issue #3047)
With PdfUnseasoned the PDF file will be loaded in a dedicated renderer process.
We identify this process by adding the kPdfRenderer command-line flag (similar
to how kExtensionProcess is used to identify an extension renderer process). We
then avoid calling GetNewBrowserInfo for the PDF renderer process because we
know the request will otherwise time out.
2021-11-29 15:52:33 -05:00
Nicolas Dusart
444ce60075 Fix CefURLRequest crash with failing HEAD requests (fixes issue #3226) 2021-11-23 17:23:11 -05:00
Marshall Greenblatt
56e2edd14d alloy: Add support for the new non-PPAPI PDF viewer (see issue #3047)
Enable by passing `--enable-features=PdfUnseasoned` on the command line.
2021-11-23 17:23:11 -05:00
Sarah
c862dcc51f Prevent possible null dereference in ctocpp_ref_counted.h (fixes issue #3218) 2021-11-23 17:23:10 -05:00
Marshall Greenblatt
7111d35d3c Update to Chromium version 97.0.4692.20 2021-11-22 15:27:08 +00:00
Marshall Greenblatt
c1bc391357 Update to Chromium version 97.0.4692.8 2021-11-17 15:49:51 -05:00
594 changed files with 5831 additions and 6674 deletions

View File

@@ -96,7 +96,6 @@
import("//base/allocator/allocator.gni")
import("//build/config/features.gni")
import("//build/config/locales.gni")
import("//build/config/ozone.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//chrome/common/features.gni")
@@ -307,7 +306,7 @@ group("cef") {
":libcef_static_unittests",
]
if (!is_linux || ozone_platform_x11) {
if (!is_linux || use_x11) {
deps += [ ":cefclient" ]
}
}
@@ -489,8 +488,6 @@ static_library("libcef_static") {
"libcef/browser/download_manager_delegate.h",
"libcef/browser/extension_impl.cc",
"libcef/browser/extension_impl.h",
"libcef/browser/extensions/api/file_system/cef_file_system_delegate.cc",
"libcef/browser/extensions/api/file_system/cef_file_system_delegate.h",
"libcef/browser/extensions/api/storage/sync_value_store_cache.cc",
"libcef/browser/extensions/api/storage/sync_value_store_cache.h",
"libcef/browser/extensions/api/tabs/tabs_api.cc",
@@ -527,6 +524,8 @@ static_library("libcef_static") {
"libcef/browser/extensions/extension_web_contents_observer.h",
"libcef/browser/extensions/mime_handler_view_guest_delegate.cc",
"libcef/browser/extensions/mime_handler_view_guest_delegate.h",
"libcef/browser/extensions/pdf_web_contents_helper_client.cc",
"libcef/browser/extensions/pdf_web_contents_helper_client.h",
"libcef/browser/extensions/value_store/cef_value_store.cc",
"libcef/browser/extensions/value_store/cef_value_store.h",
"libcef/browser/extensions/value_store/cef_value_store_factory.cc",
@@ -659,6 +658,8 @@ static_library("libcef_static") {
"libcef/browser/thread_util.h",
"libcef/browser/web_contents_dialog_helper.cc",
"libcef/browser/web_contents_dialog_helper.h",
"libcef/browser/web_plugin_impl.cc",
"libcef/browser/web_plugin_impl.h",
"libcef/browser/x509_certificate_impl.cc",
"libcef/browser/x509_certificate_impl.h",
"libcef/browser/x509_cert_principal_impl.cc",
@@ -835,7 +836,8 @@ static_library("libcef_static") {
"//base:base_static",
"//base/third_party/dynamic_annotations",
"//cc",
"//chrome:dependencies",
"//chrome:browser_dependencies",
"//chrome:child_dependencies",
"//chrome:packed_resources",
"//chrome:resources",
"//chrome:strings",
@@ -847,6 +849,7 @@ static_library("libcef_static") {
"//components/content_settings/core/browser",
"//components/content_settings/core/common",
"//components/crx_file",
"//components/data_use_measurement/core",
"//components/google/core/common",
"//components/keyed_service/content:content",
"//components/keyed_service/core:core",
@@ -902,7 +905,6 @@ static_library("libcef_static") {
"//third_party/blink/public:blink",
"//third_party/brotli:dec",
"//third_party/cld_3/src/src:cld_3",
"//third_party/crashpad/crashpad/handler",
"//third_party/hunspell",
"//third_party/leveldatabase",
"//third_party/libxml:libxml",
@@ -942,6 +944,10 @@ static_library("libcef_static") {
"libcef/browser/native/native_menu_win.h",
"libcef/browser/osr/browser_platform_delegate_osr_win.cc",
"libcef/browser/osr/browser_platform_delegate_osr_win.h",
# Part of //chrome/utility.
"//chrome/utility/printing_handler.cc",
"//chrome/utility/printing_handler.h",
]
deps += [
@@ -975,11 +981,9 @@ static_library("libcef_static") {
"libcef/browser/osr/browser_platform_delegate_osr_linux.h",
"libcef/browser/printing/print_dialog_linux.cc",
"libcef/browser/printing/print_dialog_linux.h",
"libcef/common/util_linux.h",
"libcef/common/util_linux.cc",
]
if (ozone_platform_x11) {
if (use_x11) {
sources += [
"libcef/browser/native/window_x11.cc",
"libcef/browser/native/window_x11.h",
@@ -991,7 +995,7 @@ static_library("libcef_static") {
"//third_party/fontconfig",
]
if (is_linux && !ozone_platform_x11) {
if (is_linux && !use_x11) {
deps += [
"//third_party/angle:libEGL",
]
@@ -1019,10 +1023,26 @@ static_library("libcef_static") {
]
}
if (ozone_platform_x11) {
if (is_win || is_mac) {
deps += [ "//third_party/crashpad/crashpad/handler" ]
}
if (use_x11) {
deps += [ "//ui/events/devices/x11" ]
}
if (is_posix && !is_mac) {
sources += [
"libcef/common/cef_crash_report_utils.cc",
"libcef/common/cef_crash_report_utils.h",
]
deps += [
"//components/crash/core/app",
"//components/crash/content/browser",
]
}
if (v8_use_external_startup_data && use_v8_context_snapshot) {
deps += [ "//tools/v8_context_snapshot" ]
}
@@ -1181,7 +1201,7 @@ static_library("libcef_static") {
"//ui/ozone:generate_test_support_constructor_list",
]
if (ozone_platform_x11) {
if (use_x11) {
sources += [
# Support for UI input events.
# Part of //ui/base/x:test_support which is testingonly.
@@ -1276,8 +1296,6 @@ static_library("libcef_dll_wrapper") {
configs += [ ":libcef_dll_wrapper_config" ]
public_configs = [ ":libcef_dll_wrapper_config" ]
deps = [ ":cef_make_headers" ]
}
@@ -1316,7 +1334,7 @@ grit("cef_strings") {
outputs = [
"grit/cef_strings.h",
]
all_locales = platform_pak_locales + [ "fake-bidi" ]
all_locales = locales + [ "fake-bidi" ]
foreach(locale, all_locales) {
outputs += [ "cef_strings_${locale}.pak" ]
}
@@ -1339,6 +1357,7 @@ grit("cef_resources") {
template("make_pack_header") {
assert(defined(invoker.header))
assert(defined(invoker.inputs))
assert(defined(invoker.deps))
action("make_pack_header_${target_name}") {
script = "tools/make_pack_header.py"
@@ -1349,9 +1368,7 @@ template("make_pack_header") {
args = rebase_path(outputs, root_build_dir) +
rebase_path(inputs, root_build_dir)
if (defined(invoker.deps)) {
deps = invoker.deps
}
deps = invoker.deps
}
}
@@ -1365,7 +1382,6 @@ make_pack_header("resources") {
"$root_gen_dir/chrome/grit/common_resources.h",
"$root_gen_dir/chrome/grit/component_extension_resources.h",
"$root_gen_dir/chrome/grit/dev_ui_browser_resources.h",
"$root_gen_dir/chrome/grit/pdf_resources.h",
"$root_gen_dir/chrome/grit/renderer_resources.h",
"$root_gen_dir/components/grit/components_resources.h",
"$root_gen_dir/components/grit/dev_ui_components_resources.h",
@@ -1391,7 +1407,6 @@ make_pack_header("resources") {
"//chrome/browser:dev_ui_browser_resources",
"//chrome/browser:resources",
"//chrome/browser/resources:component_extension_resources",
"//chrome/browser/resources/pdf:resources",
"//chrome/common:resources",
"//chrome/renderer:resources",
"//components/resources:components_resources",
@@ -1432,7 +1447,6 @@ make_pack_header("strings") {
"$root_gen_dir/components/strings/grit/components_strings.h",
"$root_gen_dir/extensions/strings/grit/extensions_strings.h",
"$root_gen_dir/services/strings/grit/services_strings.h",
"$root_gen_dir/third_party/blink/public/strings/grit/blink_accessibility_strings.h",
"$root_gen_dir/third_party/blink/public/strings/grit/blink_strings.h",
"$root_gen_dir/ui/strings/grit/ui_strings.h",
]
@@ -1450,20 +1464,11 @@ make_pack_header("strings") {
"//extensions/strings",
"//services/strings",
"//third_party/blink/public/strings",
"//third_party/blink/public/strings:accessibility_strings",
"//ui/strings:app_locale_settings",
"//ui/strings:ui_strings",
]
}
# Generate cef_command_ids.h.
make_pack_header("command_ids") {
header = "$root_out_dir/includes/include/cef_command_ids.h"
inputs = [
"//chrome/app/chrome_command_ids.h",
]
}
# Generate cef_api_hash.h.
action("make_api_hash_header") {
script = "tools/make_api_hash_header.py"
@@ -1481,23 +1486,12 @@ action("make_api_hash_header") {
args = rebase_path(outputs + include_dir, root_build_dir)
}
# Generate cef_config.h.
action("make_config_header") {
script = "tools/make_config_header.py"
outputs = [ "$root_out_dir/includes/include/cef_config.h" ]
args = rebase_path(outputs + [ "$root_out_dir/args.gn" ], root_build_dir)
}
# Generate pack files and associated CEF header files.
group("cef_make_headers") {
deps = [
":make_pack_header_resources",
":make_pack_header_strings",
":make_pack_header_command_ids",
":make_api_hash_header",
":make_config_header",
]
}
@@ -2255,7 +2249,7 @@ if (is_mac) {
sources += includes_linux +
gypi_paths2.cefsimple_sources_linux
if (ozone_platform_x11) {
if (use_x11) {
libs = [
"X11",
]
@@ -2315,7 +2309,7 @@ if (is_mac) {
sources += gypi_paths2.shared_sources_linux +
gypi_paths2.ceftests_sources_linux
if (ozone_platform_x11) {
if (use_x11) {
libs = [
"X11",
]

View File

@@ -7,6 +7,6 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/101.0.4951.67',
'depot_tools_checkout': '7f02c0d981'
'chromium_checkout': 'refs/tags/97.0.4692.99',
'depot_tools_checkout': 'f7b8f8f3cd'
}

View File

@@ -45,11 +45,15 @@ The base CEF framework includes support for the C and C++ programming languages.
* .Net (CEF3) - https://github.com/cefsharp/CefSharp
* .Net (CEF1) - https://bitbucket.org/fddima/cefglue
* .Net/Mono (CEF3) - https://gitlab.com/xiliumhq/chromiumembedded/cefglue
* Delphi - https://github.com/hgourvest/dcef3
* Delphi - https://github.com/salvadordf/CEF4Delphi
* .Net/Mono (CEF3) - https://bitbucket.org/xilium/xilium.cefglue
* .Net (CEF3) - https://bitbucket.org/chromiumfx/chromiumfx
* Delphi (CEF1) - http://code.google.com/p/delphichromiumembedded/
* Delphi (CEF3) - https://github.com/hgourvest/dcef3
* Delphi (CEF3) - https://github.com/salvadordf/CEF4Delphi
* Go - https://github.com/richardwilkes/cef
* Go - https://github.com/CzarekTomczak/cef2go
* Java - https://bitbucket.org/chromiumembedded/java-cef
* Java - http://code.google.com/p/javacef/
* Python - http://code.google.com/p/cefpython/
If you're the maintainer of a project not listed above and would like your project listed here please either post to the [CEF Forum](http://www.magpcss.org/ceforum/) or contact Marshall directly.
@@ -78,6 +82,6 @@ If you would like to contribute source code changes to CEF please follow the bel
\- Submit a [pull request](https://bitbucket.org/chromiumembedded/cef/wiki/ContributingWithGit) or create a patch with your changes and attach it to the CEF issue. Changes should:
* Be submitted against the current [CEF master branch](https://bitbucket.org/chromiumembedded/cef/src/?at=master) unless explicitly fixing a bug in a CEF release branch.
* Follow the style of existing CEF source files. In general CEF uses the [Chromium C++ style guide](https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md).
* Follow the style of existing CEF source files. In general CEF uses the [Chromium coding style](http://www.chromium.org/developers/coding-style).
* Include new or modified unit tests as appropriate to the functionality.
* Not include unnecessary or unrelated changes.

View File

@@ -1,2 +1,2 @@
#!/bin/sh
python3 tools/gclient_hook.py
python tools/gclient_hook.py

View File

@@ -8,7 +8,7 @@
# by hand. See the translator.README.txt file in the tools directory for
# more information.
#
# $hash=5f2e9bf79ec768c0eb978ff5e1dd0178701dcc21$
# $hash=872dedb7e5a2f36745446c3d0c9ad8bd5850adb7$
#
{
@@ -22,7 +22,6 @@
'include/cef_browser_process_handler.h',
'include/cef_callback.h',
'include/cef_client.h',
'include/cef_command_handler.h',
'include/cef_command_line.h',
'include/cef_context_menu_handler.h',
'include/cef_cookie.h',
@@ -85,6 +84,7 @@
'include/cef_v8.h',
'include/cef_values.h',
'include/cef_waitable_event.h',
'include/cef_web_plugin.h',
'include/cef_x509_certificate.h',
'include/cef_xml_reader.h',
'include/cef_zip_reader.h',
@@ -121,7 +121,6 @@
'include/capi/cef_browser_process_handler_capi.h',
'include/capi/cef_callback_capi.h',
'include/capi/cef_client_capi.h',
'include/capi/cef_command_handler_capi.h',
'include/capi/cef_command_line_capi.h',
'include/capi/cef_context_menu_handler_capi.h',
'include/capi/cef_cookie_capi.h',
@@ -184,6 +183,7 @@
'include/capi/cef_v8_capi.h',
'include/capi/cef_values_capi.h',
'include/capi/cef_waitable_event_capi.h',
'include/capi/cef_web_plugin_capi.h',
'include/capi/cef_x509_certificate_capi.h',
'include/capi/cef_xml_reader_capi.h',
'include/capi/cef_zip_reader_capi.h',
@@ -244,8 +244,6 @@
'libcef_dll/cpptoc/callback_cpptoc.h',
'libcef_dll/ctocpp/client_ctocpp.cc',
'libcef_dll/ctocpp/client_ctocpp.h',
'libcef_dll/ctocpp/command_handler_ctocpp.cc',
'libcef_dll/ctocpp/command_handler_ctocpp.h',
'libcef_dll/cpptoc/command_line_cpptoc.cc',
'libcef_dll/cpptoc/command_line_cpptoc.h',
'libcef_dll/ctocpp/completion_callback_ctocpp.cc',
@@ -502,6 +500,12 @@
'libcef_dll/ctocpp/views/view_delegate_ctocpp.h',
'libcef_dll/cpptoc/waitable_event_cpptoc.cc',
'libcef_dll/cpptoc/waitable_event_cpptoc.h',
'libcef_dll/cpptoc/web_plugin_info_cpptoc.cc',
'libcef_dll/cpptoc/web_plugin_info_cpptoc.h',
'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc',
'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h',
'libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc',
'libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h',
'libcef_dll/cpptoc/views/window_cpptoc.cc',
'libcef_dll/cpptoc/views/window_cpptoc.h',
'libcef_dll/ctocpp/views/window_delegate_ctocpp.cc',
@@ -550,8 +554,6 @@
'libcef_dll/ctocpp/callback_ctocpp.h',
'libcef_dll/cpptoc/client_cpptoc.cc',
'libcef_dll/cpptoc/client_cpptoc.h',
'libcef_dll/cpptoc/command_handler_cpptoc.cc',
'libcef_dll/cpptoc/command_handler_cpptoc.h',
'libcef_dll/ctocpp/command_line_ctocpp.cc',
'libcef_dll/ctocpp/command_line_ctocpp.h',
'libcef_dll/cpptoc/completion_callback_cpptoc.cc',
@@ -808,6 +810,12 @@
'libcef_dll/cpptoc/views/view_delegate_cpptoc.h',
'libcef_dll/ctocpp/waitable_event_ctocpp.cc',
'libcef_dll/ctocpp/waitable_event_ctocpp.h',
'libcef_dll/ctocpp/web_plugin_info_ctocpp.cc',
'libcef_dll/ctocpp/web_plugin_info_ctocpp.h',
'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc',
'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h',
'libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc',
'libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h',
'libcef_dll/ctocpp/views/window_ctocpp.cc',
'libcef_dll/ctocpp/views/window_ctocpp.h',
'libcef_dll/cpptoc/views/window_delegate_cpptoc.cc',

View File

@@ -38,6 +38,7 @@
'include/base/internal/cef_thread_checker_impl.h',
'include/cef_api_hash.h',
'include/cef_base.h',
'include/cef_config.h',
'include/cef_version.h',
'include/internal/cef_export.h',
'include/internal/cef_ptr.h',
@@ -112,7 +113,6 @@
'libcef_dll/resource.h',
'libcef_dll/shutdown_checker.cc',
'libcef_dll/shutdown_checker.h',
'libcef_dll/template_util.h',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',
@@ -139,7 +139,6 @@
'libcef_dll/ctocpp/ctocpp_scoped.h',
'libcef_dll/shutdown_checker.cc',
'libcef_dll/shutdown_checker.h',
'libcef_dll/template_util.h',
'libcef_dll/transfer_util.cc',
'libcef_dll/transfer_util.h',
'libcef_dll/wrapper_types.h',

View File

@@ -45,6 +45,7 @@
#include <atomic>
#include "include/base/cef_macros.h"
#include "include/base/cef_thread_checker.h"
namespace base {
@@ -55,10 +56,6 @@ namespace base {
class AtomicFlag {
public:
AtomicFlag();
AtomicFlag(const AtomicFlag&) = delete;
AtomicFlag& operator=(const AtomicFlag&) = delete;
~AtomicFlag();
// Set the flag. Must always be called from the same thread.
@@ -79,6 +76,8 @@ class AtomicFlag {
private:
std::atomic<uint_fast8_t> flag_{0};
base::ThreadChecker set_thread_checker_;
DISALLOW_COPY_AND_ASSIGN(AtomicFlag);
};
} // namespace base

View File

@@ -32,7 +32,12 @@
#define CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_
#pragma once
#if defined(USING_CHROMIUM_INCLUDES)
#if defined(BASE_COMPILER_SPECIFIC_H_)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
// the Chromium header first to avoid type conflicts.
#elif defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/compiler_specific.h"
#else // !USING_CHROMIUM_INCLUDES
@@ -71,6 +76,23 @@
#define __has_attribute(x) 0
#endif // !defined(__has_attribute)
// Annotate a variable indicating it's ok if the variable is not used.
// (Typically used to silence a compiler warning when the assignment
// is important for some other reason.)
// Use like:
// int x = ...;
// ALLOW_UNUSED_LOCAL(x);
#define ALLOW_UNUSED_LOCAL(x) (void)x
// Annotate a typedef or function indicating it's ok if it's not used.
// Use like:
// typedef Foo Bar ALLOW_UNUSED_TYPE;
#if defined(COMPILER_GCC) || defined(__clang__)
#define ALLOW_UNUSED_TYPE __attribute__((unused))
#else
#define ALLOW_UNUSED_TYPE
#endif
// Annotate a function indicating it should not be inlined.
// Use like:
// NOINLINE void DoStuff() { ... }
@@ -131,6 +153,17 @@
#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
#endif
// Annotate a function indicating the caller must examine the return value.
// Use like:
// int foo() WARN_UNUSED_RESULT;
// To explicitly ignore a result, see |ignore_result()| in base/macros.h.
#undef WARN_UNUSED_RESULT
#if defined(COMPILER_GCC) || defined(__clang__)
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define WARN_UNUSED_RESULT
#endif
// In case the compiler supports it NO_UNIQUE_ADDRESS evaluates to the C++20
// attribute [[no_unique_address]]. This allows annotating data members so that
// they need not have an address distinct from all other non-static data members
@@ -387,25 +420,4 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
#endif // !USING_CHROMIUM_INCLUDES
// Annotate a function indicating the caller must examine the return value.
// Use like:
// int foo() WARN_UNUSED_RESULT;
// To explicitly ignore a result, use std::ignore from <tuple>.
// Alternately use `[[nodiscard]]` with code that supports C++17.
#undef WARN_UNUSED_RESULT
#if defined(COMPILER_GCC) || defined(__clang__)
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define WARN_UNUSED_RESULT
#endif
// Annotate a variable indicating it's ok if the variable is not used.
// (Typically used to silence a compiler warning when the assignment
// is important for some other reason.)
// Use like:
// int x = ...;
// ALLOW_UNUSED_LOCAL(x);
// Alternately use `[[maybe_unused]]` with code that supports C++17.
#define ALLOW_UNUSED_LOCAL(x) (void)x
#endif // CEF_INCLUDE_BASE_CEF_COMPILER_SPECIFIC_H_

View File

@@ -35,9 +35,17 @@
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/cxx17_backports.h"
// TODO(cef): Change to "base/cxx17_backports.h" in M93.
#include "base/stl_util.h"
#else // !USING_CHROMIUM_INCLUDES
// The following was removed from Chromium in https://crrev.com/78734f77be.
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
#include <array>
#include <initializer_list>
#include <memory>
#include <string>
namespace base {
@@ -53,6 +61,71 @@ constexpr size_t size(const T (&array)[N]) noexcept {
return N;
}
// C++14 implementation of C++17's std::empty():
// http://en.cppreference.com/w/cpp/iterator/empty
template <typename Container>
constexpr auto empty(const Container& c) -> decltype(c.empty()) {
return c.empty();
}
template <typename T, size_t N>
constexpr bool empty(const T (&array)[N]) noexcept {
return false;
}
template <typename T>
constexpr bool empty(std::initializer_list<T> il) noexcept {
return il.size() == 0;
}
// C++14 implementation of C++17's std::data():
// http://en.cppreference.com/w/cpp/iterator/data
template <typename Container>
constexpr auto data(Container& c) -> decltype(c.data()) {
return c.data();
}
// std::basic_string::data() had no mutable overload prior to C++17 [1].
// Hence this overload is provided.
// Note: str[0] is safe even for empty strings, as they are guaranteed to be
// null-terminated [2].
//
// [1] http://en.cppreference.com/w/cpp/string/basic_string/data
// [2] http://en.cppreference.com/w/cpp/string/basic_string/operator_at
template <typename CharT, typename Traits, typename Allocator>
CharT* data(std::basic_string<CharT, Traits, Allocator>& str) {
return std::addressof(str[0]);
}
template <typename Container>
constexpr auto data(const Container& c) -> decltype(c.data()) {
return c.data();
}
template <typename T, size_t N>
constexpr T* data(T (&array)[N]) noexcept {
return array;
}
template <typename T>
constexpr const T* data(std::initializer_list<T> il) noexcept {
return il.begin();
}
// std::array::data() was not constexpr prior to C++17 [1].
// Hence these overloads are provided.
//
// [1] https://en.cppreference.com/w/cpp/container/array/data
template <typename T, size_t N>
constexpr T* data(std::array<T, N>& array) noexcept {
return !array.empty() ? &array[0] : nullptr;
}
template <typename T, size_t N>
constexpr const T* data(const std::array<T, N>& array) noexcept {
return !array.empty() ? &array[0] : nullptr;
}
} // namespace base
#endif // !USING_CHROMIUM_INCLUDES

View File

@@ -41,6 +41,7 @@
// updated to match.
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_platform_thread.h"
#include "include/base/internal/cef_lock_impl.h"
@@ -54,10 +55,6 @@ class Lock {
public:
#if !DCHECK_IS_ON() // Optimized wrapper implementation
Lock() : lock_() {}
Lock(const Lock&) = delete;
Lock& operator=(const Lock&) = delete;
~Lock() {}
void Acquire() { lock_.Lock(); }
void Release() { lock_.Unlock(); }
@@ -114,6 +111,8 @@ class Lock {
// Platform specific underlying lock implementation.
LockImpl lock_;
DISALLOW_COPY_AND_ASSIGN(Lock);
};
// A helper class that acquires the given Lock while the AutoLock is in scope.
@@ -127,9 +126,6 @@ class AutoLock {
lock_.AssertAcquired();
}
AutoLock(const AutoLock&) = delete;
AutoLock& operator=(const AutoLock&) = delete;
~AutoLock() {
lock_.AssertAcquired();
lock_.Release();
@@ -137,6 +133,7 @@ class AutoLock {
private:
Lock& lock_;
DISALLOW_COPY_AND_ASSIGN(AutoLock);
};
// AutoUnlock is a helper that will Release() the |lock| argument in the
@@ -149,13 +146,11 @@ class AutoUnlock {
lock_.Release();
}
AutoUnlock(const AutoUnlock&) = delete;
AutoUnlock& operator=(const AutoUnlock&) = delete;
~AutoUnlock() { lock_.Acquire(); }
private:
Lock& lock_;
DISALLOW_COPY_AND_ASSIGN(AutoUnlock);
};
} // namespace cef_internal
@@ -163,9 +158,9 @@ class AutoUnlock {
// Implement classes in the cef_internal namespace and then expose them to the
// base namespace. This avoids conflicts with the base.lib implementation when
// linking sandbox support on Windows.
using cef_internal::Lock;
using cef_internal::AutoLock;
using cef_internal::AutoUnlock;
using cef_internal::Lock;
} // namespace base

View File

@@ -164,6 +164,7 @@
#include <string>
#include "include/base/cef_build.h"
#include "include/base/cef_macros.h"
#include "include/internal/cef_logging_internal.h"
namespace cef {
@@ -201,21 +202,21 @@ const LogSeverity LOG_DFATAL = LOG_FATAL;
// A few definitions of macros that don't generate much code. These are used
// by LOG() and LOG_IF, etc. Since these are used all over our code, it's
// better to have compact code for these operations.
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_INFO, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_WARNING, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_ERROR, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_FATAL, \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \
::cef::logging::ClassName(__FILE__, __LINE__, ::cef::logging::LOG_DFATAL, \
##__VA_ARGS__)
##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(LogMessage)
#define COMPACT_GOOGLE_LOG_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
@@ -582,9 +583,6 @@ class LogMessage {
LogSeverity severity,
std::string* result);
LogMessage(const LogMessage&) = delete;
LogMessage& operator=(const LogMessage&) = delete;
~LogMessage();
std::ostream& stream() { return stream_; }
@@ -616,6 +614,8 @@ class LogMessage {
SaveLastError last_error_;
#endif
DISALLOW_COPY_AND_ASSIGN(LogMessage);
};
// A non-macro interface to the log facility; (useful
@@ -655,9 +655,6 @@ class Win32ErrorLogMessage {
LogSeverity severity,
SystemErrorCode err);
Win32ErrorLogMessage(const Win32ErrorLogMessage&) = delete;
Win32ErrorLogMessage& operator=(const Win32ErrorLogMessage&) = delete;
// Appends the error message before destructing the encapsulated class.
~Win32ErrorLogMessage();
@@ -666,6 +663,8 @@ class Win32ErrorLogMessage {
private:
SystemErrorCode err_;
LogMessage log_message_;
DISALLOW_COPY_AND_ASSIGN(Win32ErrorLogMessage);
};
#elif defined(OS_POSIX)
// Appends a formatted system message of the errno type
@@ -676,9 +675,6 @@ class ErrnoLogMessage {
LogSeverity severity,
SystemErrorCode err);
ErrnoLogMessage(const ErrnoLogMessage&) = delete;
ErrnoLogMessage& operator=(const ErrnoLogMessage&) = delete;
// Appends the error message before destructing the encapsulated class.
~ErrnoLogMessage();
@@ -687,6 +683,8 @@ class ErrnoLogMessage {
private:
SystemErrorCode err_;
LogMessage log_message_;
DISALLOW_COPY_AND_ASSIGN(ErrnoLogMessage);
};
#endif // OS_WIN

View File

@@ -32,7 +32,11 @@
#define CEF_INCLUDE_BASE_CEF_MACROS_H_
#pragma once
#if !defined(USING_CHROMIUM_INCLUDES)
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/macros.h"
#else // !USING_CHROMIUM_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
@@ -58,6 +62,17 @@
TypeName() = delete; \
DISALLOW_COPY_AND_ASSIGN(TypeName)
// Used to explicitly mark the return value of a function as unused. If you are
// really sure you don't want to do anything with the return value of a function
// that has been marked WARN_UNUSED_RESULT, wrap it with this. Example:
//
// std::unique_ptr<MyType> my_var = ...;
// if (TakeOwnership(my_var.get()) == SUCCESS)
// ignore_result(my_var.release());
//
template <typename T>
inline void ignore_result(const T&) {}
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_MACROS_H_

View File

@@ -49,6 +49,7 @@
#include "include/base/cef_build.h"
#include "include/base/cef_compiler_specific.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_scoped_refptr.h"
#include "include/base/cef_template_util.h"
#include "include/base/cef_thread_checker.h"
@@ -75,9 +76,6 @@ class RefCountedBase {
#endif
}
RefCountedBase(const RefCountedBase&) = delete;
RefCountedBase& operator=(const RefCountedBase&) = delete;
~RefCountedBase() {
#if DCHECK_IS_ON()
DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()";
@@ -170,6 +168,8 @@ class RefCountedBase {
mutable bool in_dtor_ = false;
mutable ThreadChecker thread_checker_;
#endif
DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
};
class RefCountedThreadSafeBase {
@@ -186,9 +186,6 @@ class RefCountedThreadSafeBase {
#endif
}
RefCountedThreadSafeBase(const RefCountedThreadSafeBase&) = delete;
RefCountedThreadSafeBase& operator=(const RefCountedThreadSafeBase&) = delete;
#if DCHECK_IS_ON()
~RefCountedThreadSafeBase();
#else
@@ -262,6 +259,8 @@ class RefCountedThreadSafeBase {
mutable bool needs_adopt_ref_ = false;
mutable bool in_dtor_ = false;
#endif
DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafeBase);
};
// ScopedAllowCrossThreadRefCountAccess disables the check documented on
@@ -358,9 +357,6 @@ class RefCounted : public cef_subtle::RefCountedBase {
RefCounted() : cef_subtle::RefCountedBase(T::kRefCountPreference) {}
RefCounted(const RefCounted&) = delete;
RefCounted& operator=(const RefCounted&) = delete;
void AddRef() const { cef_subtle::RefCountedBase::AddRef(); }
void Release() const {
@@ -383,6 +379,8 @@ class RefCounted : public cef_subtle::RefCountedBase {
static void DeleteInternal(const U* x) {
delete x;
}
DISALLOW_COPY_AND_ASSIGN(RefCounted);
};
// Forward declaration.
@@ -426,9 +424,6 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
explicit RefCountedThreadSafe()
: cef_subtle::RefCountedThreadSafeBase(T::kRefCountPreference) {}
RefCountedThreadSafe(const RefCountedThreadSafe&) = delete;
RefCountedThreadSafe& operator=(const RefCountedThreadSafe&) = delete;
void AddRef() const { AddRefImpl(T::kRefCountPreference); }
void Release() const {
@@ -455,6 +450,8 @@ class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
void AddRefImpl(cef_subtle::StartRefCountFromOneTag) const {
cef_subtle::RefCountedThreadSafeBase::AddRefWithCheck();
}
DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafe);
};
//

View File

@@ -48,6 +48,7 @@
#include "include/base/cef_compiler_specific.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
template <class T>
class scoped_refptr;

View File

@@ -113,7 +113,7 @@ template <typename T>
struct SupportsToString<T, decltype(void(std::declval<T>().ToString()))>
: std::true_type {};
// Used to detect whether the given type is an iterator. This is normally used
// Used to detech whether the given type is an iterator. This is normally used
// with std::enable_if to provide disambiguation for functions that take
// templatzed iterators as input.
template <typename T, typename = void>
@@ -276,13 +276,8 @@ struct negation : bool_constant<!static_cast<bool>(B::value)> {};
// References:
// [1] https://en.cppreference.com/w/cpp/types/result_of
// [2] https://wg21.link/meta.trans.other#lib:invoke_result
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
template <typename Functor, typename... Args>
using invoke_result = std::invoke_result<Functor, Args...>;
#else
template <typename Functor, typename... Args>
using invoke_result = std::result_of<Functor && (Args && ...)>;
#endif
// Implementation of C++17's std::invoke_result_t.
//

View File

@@ -109,6 +109,7 @@
#include "include/base/cef_atomic_flag.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h"
#include "include/base/cef_thread_checker.h"
@@ -356,14 +357,9 @@ class WeakPtrFactoryBase {
template <class T>
class WeakPtrFactory : public internal::WeakPtrFactoryBase {
public:
WeakPtrFactory() = delete;
explicit WeakPtrFactory(T* ptr)
: WeakPtrFactoryBase(reinterpret_cast<uintptr_t>(ptr)) {}
WeakPtrFactory(const WeakPtrFactory&) = delete;
WeakPtrFactory& operator=(const WeakPtrFactory&) = delete;
~WeakPtrFactory() = default;
WeakPtr<T> GetWeakPtr() const {
@@ -382,6 +378,9 @@ class WeakPtrFactory : public internal::WeakPtrFactoryBase {
DCHECK(ptr_);
return weak_reference_owner_.HasRefs();
}
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(WeakPtrFactory);
};
// A class may extend from SupportsWeakPtr to let others take weak pointers to
@@ -394,9 +393,6 @@ class SupportsWeakPtr : public internal::SupportsWeakPtrBase {
public:
SupportsWeakPtr() = default;
SupportsWeakPtr(const SupportsWeakPtr&) = delete;
SupportsWeakPtr& operator=(const SupportsWeakPtr&) = delete;
WeakPtr<T> AsWeakPtr() {
return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(this));
}
@@ -406,6 +402,7 @@ class SupportsWeakPtr : public internal::SupportsWeakPtrBase {
private:
internal::WeakReferenceOwner weak_reference_owner_;
DISALLOW_COPY_AND_ASSIGN(SupportsWeakPtr);
};
// Helper function that uses type deduction to safely return a WeakPtr<Derived>

View File

@@ -1189,11 +1189,7 @@ struct AssertBindArgsValidity<std::index_sequence<Ns...>,
TypeList<Args...>,
TypeList<Unwrapped...>,
TypeList<Params...>>
: AssertConstructible<static_cast<int>(Ns),
Args,
std::decay_t<Args>,
Unwrapped,
Params>... {
: AssertConstructible<Ns, Args, std::decay_t<Args>, Unwrapped, Params>... {
static constexpr bool ok = true;
};

View File

@@ -40,6 +40,8 @@
#include <pthread.h>
#endif
#include "include/base/cef_macros.h"
namespace base {
namespace cef_internal {
@@ -55,10 +57,6 @@ class LockImpl {
#endif
LockImpl();
LockImpl(const LockImpl&) = delete;
LockImpl& operator=(const LockImpl&) = delete;
~LockImpl();
// If the lock is not held, take it and return true. If the lock is already
@@ -79,6 +77,8 @@ class LockImpl {
private:
NativeHandle native_handle_;
DISALLOW_COPY_AND_ASSIGN(LockImpl);
};
} // namespace cef_internal

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=665709ecf3ebad59e85285d319eae72197b9766f$
// $hash=adfba3dd6479b96a95639c13ee1e07bed7b335d0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
@@ -145,7 +145,7 @@ CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args,
// This function should be called on the main application thread to shut down
// the CEF browser process before the application exits.
///
CEF_EXPORT void cef_shutdown(void);
CEF_EXPORT void cef_shutdown();
///
// Perform a single iteration of CEF message loop processing. This function is
@@ -162,7 +162,7 @@ CEF_EXPORT void cef_shutdown(void);
// CefSettings.multi_threaded_message_loop value of false (0). This function
// will not block.
///
CEF_EXPORT void cef_do_message_loop_work(void);
CEF_EXPORT void cef_do_message_loop_work();
///
// Run the CEF message loop. Use this function instead of an application-
@@ -172,14 +172,14 @@ CEF_EXPORT void cef_do_message_loop_work(void);
// CefSettings.multi_threaded_message_loop value of false (0). This function
// will block until a quit message is received by the system.
///
CEF_EXPORT void cef_run_message_loop(void);
CEF_EXPORT void cef_run_message_loop();
///
// Quit the CEF message loop that was started by calling cef_run_message_loop().
// This function should only be called on the main application thread and only
// if cef_run_message_loop() was used.
///
CEF_EXPORT void cef_quit_message_loop(void);
CEF_EXPORT void cef_quit_message_loop();
///
// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a
@@ -192,7 +192,7 @@ CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop);
// Older versions of Windows should be left DPI-unaware because they do not
// support DirectWrite and GDI fonts are kerned very badly.
///
CEF_EXPORT void cef_enable_highdpi_support(void);
CEF_EXPORT void cef_enable_highdpi_support();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=62f58ab826b8a3d436655bf0855848632f2a73b5$
// $hash=fd8d34089842ee8f8490ef1828c3091d12052e28$
//
#ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
@@ -68,7 +68,7 @@ typedef struct _cef_audio_handler_t {
///
// Called on a browser audio capture thread when the browser starts streaming
// audio. OnAudioStreamStopped will always be called after
// audio. OnAudioSteamStopped will always be called after
// OnAudioStreamStarted; both functions may be called multiple times for the
// same browser. |params| contains the audio parameters like sample rate and
// channel layout. |channels| is the number of channels.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b80e84c0039ab45d5c4562d64b67a84766c0dab3$
// $hash=8af93d03e0b2a6b50d7612b145599600285b76d4$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
@@ -450,15 +450,18 @@ typedef struct _cef_browser_host_t {
struct _cef_pdf_print_callback_t* callback);
///
// Search for |searchText|. |forward| indicates whether to search forward or
// backward within the page. |matchCase| indicates whether the search should
// be case-sensitive. |findNext| indicates whether this is the first request
// or a follow-up. The search will be restarted if |searchText| or |matchCase|
// change. The search will be stopped if |searchText| is NULL. The
// cef_find_handler_t instance, if any, returned via
// cef_client_t::GetFindHandler will be called to report find results.
// Search for |searchText|. |identifier| must be a unique ID and these IDs
// must strictly increase so that newer requests always have greater IDs than
// older requests. If |identifier| is zero or less than the previous ID value
// then it will be automatically assigned a new valid ID. |forward| indicates
// whether to search forward or backward within the page. |matchCase|
// indicates whether the search should be case-sensitive. |findNext| indicates
// whether this is the first request or a follow-up. The cef_find_handler_t
// instance, if any, returned via cef_client_t::GetFindHandler will be called
// to report find results.
///
void(CEF_CALLBACK* find)(struct _cef_browser_host_t* self,
int identifier,
const cef_string_t* searchText,
int forward,
int matchCase,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ad0a78715daff99c1ec987800b7e5d62196e7100$
// $hash=8c97f9b58c642c144cc37824ad820192640307cb$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
@@ -70,9 +70,9 @@ typedef struct _cef_browser_process_handler_t {
///
// Called before a child process is launched. Will be called on the browser
// process UI thread when launching a render process and on the browser
// process IO thread when launching a GPU process. Provides an opportunity to
// modify the child process command line. Do not keep a reference to
// |command_line| outside of this function.
// process IO thread when launching a GPU or plugin process. Provides an
// opportunity to modify the child process command line. Do not keep a
// reference to |command_line| outside of this function.
///
void(CEF_CALLBACK* on_before_child_process_launch)(
struct _cef_browser_process_handler_t* self,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7df3c13b75072c2ad5061cd3a344811222798903$
// $hash=8b099ca3b9cfbd41840cdf64586a0b884abaffae$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
@@ -42,7 +42,6 @@
#include "include/capi/cef_audio_handler_capi.h"
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_command_handler_capi.h"
#include "include/capi/cef_context_menu_handler_capi.h"
#include "include/capi/cef_dialog_handler_capi.h"
#include "include/capi/cef_display_handler_capi.h"
@@ -79,13 +78,6 @@ typedef struct _cef_client_t {
struct _cef_audio_handler_t*(CEF_CALLBACK* get_audio_handler)(
struct _cef_client_t* self);
///
// Return the handler for commands. If no handler is provided the default
// implementation will be used.
///
struct _cef_command_handler_t*(CEF_CALLBACK* get_command_handler)(
struct _cef_client_t* self);
///
// Return the handler for context menus. If no handler is provided the default
// implementation will be used.

View File

@@ -1,80 +0,0 @@
// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=54332b79c057df9c8f3be56cc77f1daf877b3ac1$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_browser_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
// Implement this structure to handle events related to commands. The functions
// of this structure will be called on the UI thread.
///
typedef struct _cef_command_handler_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Called to execute a Chrome command triggered via menu selection or keyboard
// shortcut. Values for |command_id| can be found in the cef_command_ids.h
// file. |disposition| provides information about the intended command target.
// Return true (1) if the command was handled or false (0) for the default
// implementation. For context menu commands this will be called after
// cef_context_menu_handler_t::OnContextMenuCommand. Only used with the Chrome
// runtime.
///
int(CEF_CALLBACK* on_chrome_command)(
struct _cef_command_handler_t* self,
struct _cef_browser_t* browser,
int command_id,
cef_window_open_disposition_t disposition);
} cef_command_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=3049c9960a95d32d61cc57ae998c0eba12820673$
// $hash=93f3d769c0d48ed6e1d91ad8a8e2f95d4ee54287$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
@@ -200,13 +200,13 @@ typedef struct _cef_command_line_t {
///
// Create a new cef_command_line_t instance.
///
CEF_EXPORT cef_command_line_t* cef_command_line_create(void);
CEF_EXPORT cef_command_line_t* cef_command_line_create();
///
// Returns the singleton global cef_command_line_t object. The returned object
// will be read-only.
///
CEF_EXPORT cef_command_line_t* cef_command_line_get_global(void);
CEF_EXPORT cef_command_line_t* cef_command_line_get_global();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d007b3dc26f3f049bf67623da8fae59dc75a193b$
// $hash=fd33ce439e4379d231b6be16bdc1786f314d98e4$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
@@ -290,7 +290,8 @@ typedef struct _cef_context_menu_params_t {
///
// Returns true (1) if the context menu contains items specified by the
// renderer process.
// renderer process (for example, plugin placeholder or pepper plugin menu
// items).
///
int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self);
} cef_context_menu_params_t;

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5d111a67218403f78737f2c4dc92d2fd96dc125d$
// $hash=0460e68eb7d1b1188706c42d14beafbf9a6f7126$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
@@ -136,7 +136,7 @@ extern "C" {
// CefSetCrashKeyValue function. These key/value pairs will be sent to the crash
// server along with the crash dump file.
///
CEF_EXPORT int cef_crash_reporting_enabled(void);
CEF_EXPORT int cef_crash_reporting_enabled();
///
// Sets or clears a specific key-value pair from the crash metadata.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=33862915eb4156a70794a346a090154c468763e2$
// $hash=ec13ec3e2819e4ac49792c3a1c57bc60b45fb95b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
@@ -103,18 +103,6 @@ typedef struct _cef_download_handler_t {
///
cef_base_ref_counted_t base;
///
// Called before a download begins in response to a user-initiated action
// (e.g. alt + link click or link click that returns a `Content-Disposition:
// attachment` response from the server). |url| is the target download URL and
// |request_function| is the target function (GET, POST, etc). Return true (1)
// to proceed with the download or false (0) to cancel the download.
///
int(CEF_CALLBACK* can_download)(struct _cef_download_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* url,
const cef_string_t* request_method);
///
// Called before a download begins. |suggested_name| is the suggested name for
// the download file. By default the download will be canceled. Execute

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c99e9efb74fea2a2a99b25a694c59256f59238ab$
// $hash=b6e3236a062cd25ec26c3daeb1940d1e1bf0d96a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
@@ -199,11 +199,6 @@ typedef struct _cef_drag_data_t {
const cef_string_t* path,
const cef_string_t* display_name);
///
// Clear list of filenames.
///
void(CEF_CALLBACK* clear_filenames)(struct _cef_drag_data_t* self);
///
// Get the image representation of drag data. May return NULL if no image
// representation is available.
@@ -224,7 +219,7 @@ typedef struct _cef_drag_data_t {
///
// Create a new cef_drag_data_t object.
///
CEF_EXPORT cef_drag_data_t* cef_drag_data_create(void);
CEF_EXPORT cef_drag_data_t* cef_drag_data_create();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f2e80b8637b07f19adea666e554269de4627e399$
// $hash=b1fe7f7db5ab92c6ae64dc1288b6fd47c80f9423$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
@@ -59,12 +59,11 @@ typedef struct _cef_find_handler_t {
///
// Called to report find results returned by cef_browser_host_t::find().
// |identifer| is a unique incremental identifier for the currently active
// search, |count| is the number of matches currently identified,
// |selectionRect| is the location of where the match was found (in window
// coordinates), |activeMatchOrdinal| is the current position in the search
// results, and |finalUpdate| is true (1) if this is the last find
// notification.
// |identifer| is the identifier passed to find(), |count| is the number of
// matches currently identified, |selectionRect| is the location of where the
// match was found (in window coordinates), |activeMatchOrdinal| is the
// current position in the search results, and |finalUpdate| is true (1) if
// this is the last find notification.
///
void(CEF_CALLBACK* on_find_result)(struct _cef_find_handler_t* self,
struct _cef_browser_t* browser,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c063e5f0e0c9fef71bdb56e7cc3ea775de17a3ea$
// $hash=b6168013910802cf6d7603892741385958026dcd$
//
#ifndef CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_
@@ -49,7 +49,7 @@ extern "C" {
///
// Returns true (1) if the application text direction is right-to-left.
///
CEF_EXPORT int cef_is_rtl(void);
CEF_EXPORT int cef_is_rtl();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=bbc87eb4ecaf92c900193afef7059caedbe8ab3a$
// $hash=b5a36ef39ff250c9d3cb1e9a8c7ee38d7e0f8b3f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
@@ -196,7 +196,7 @@ typedef struct _cef_image_t {
// Create a new cef_image_t. It will initially be NULL. Use the Add*() functions
// to add representations at different scale factors.
///
CEF_EXPORT cef_image_t* cef_image_create(void);
CEF_EXPORT cef_image_t* cef_image_create();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=26fdd1f18f30d9e2a48aeeb5c69607d9d22d69ca$
// $hash=0939a44345bea8df7ca5f1dbd6afbe41972121f2$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
@@ -102,7 +102,7 @@ CEF_EXPORT int cef_remove_cross_origin_whitelist_entry(
// Remove all entries from the cross-origin access whitelist. Returns false (0)
// if the whitelist cannot be accessed.
///
CEF_EXPORT int cef_clear_cross_origin_whitelist(void);
CEF_EXPORT int cef_clear_cross_origin_whitelist();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1a9b9718367ec8d575fbb39b73b1085b17eb0a2b$
// $hash=fdbd26f9dd20dbd7813fc17a8c34650b2da19581$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
@@ -193,7 +193,7 @@ typedef struct _cef_print_settings_t {
///
// Create a new cef_print_settings_t object.
///
CEF_EXPORT cef_print_settings_t* cef_print_settings_create(void);
CEF_EXPORT cef_print_settings_t* cef_print_settings_create();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=246d07b9790ff6bd574c59b1c237c603deaf88bf$
// $hash=47b361878452f2a94e559782913d80beb0dba25a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
@@ -219,7 +219,7 @@ typedef struct _cef_request_t {
///
// Create a new cef_request_t object.
///
CEF_EXPORT cef_request_t* cef_request_create(void);
CEF_EXPORT cef_request_t* cef_request_create();
///
// Structure used to represent post data for a web request. The functions of
@@ -278,7 +278,7 @@ typedef struct _cef_post_data_t {
///
// Create a new cef_post_data_t object.
///
CEF_EXPORT cef_post_data_t* cef_post_data_create(void);
CEF_EXPORT cef_post_data_t* cef_post_data_create();
///
// Structure used to represent a single element in the request post data. The
@@ -344,7 +344,7 @@ typedef struct _cef_post_data_element_t {
///
// Create a new cef_post_data_element_t object.
///
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create(void);
CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=dcff1eaa0563cfb48e0232bf78786bb0126c4255$
// $hash=89e64a2db658ad560e85ea5d3e564a6505d4e914$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
@@ -357,7 +357,7 @@ typedef struct _cef_request_context_t {
///
// Returns the global context object.
///
CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context(void);
CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context();
///
// Creates a new context object with the specified |settings| and optional

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b2657a441a701c5ddaca68dc604fd94153a3220f$
// $hash=b44d320d5cceb5022543e8154170b8d276628c76$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
@@ -45,6 +45,7 @@
#include "include/capi/cef_frame_capi.h"
#include "include/capi/cef_request_capi.h"
#include "include/capi/cef_resource_request_handler_capi.h"
#include "include/capi/cef_web_plugin_capi.h"
#ifdef __cplusplus
extern "C" {

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=4e19e04de13949f20e63e44542bc0a0eeed46b43$
// $hash=4a05a0a7cd4a279ccf8455a3cb2f77de581b597a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
@@ -228,6 +228,14 @@ typedef struct _cef_request_handler_t {
struct _cef_x509certificate_t* const* certificates,
struct _cef_select_client_certificate_callback_t* callback);
///
// Called on the browser process UI thread when a plugin has crashed.
// |plugin_path| is the path of the plugin that crashed.
///
void(CEF_CALLBACK* on_plugin_crashed)(struct _cef_request_handler_t* self,
struct _cef_browser_t* browser,
const cef_string_t* plugin_path);
///
// Called on the browser process UI thread when the render view associated
// with |browser| is ready to receive/handle IPC messages in the render

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6d8a7e3c0ed66cad10e8a0c59fed51431ec82ce5$
// $hash=a9e35ca17785f77666db7650208cacfd9a85c3e0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
@@ -95,7 +95,7 @@ typedef struct _cef_resource_bundle_t {
///
// Returns the global resource bundle instance.
///
CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global(void);
CEF_EXPORT cef_resource_bundle_t* cef_resource_bundle_get_global();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ab8832420572dae95a601fb3170fcd3693473619$
// $hash=6ebf7adcdaee57772810c1528b27140ae95966d0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
@@ -168,7 +168,7 @@ typedef struct _cef_response_t {
///
// Create a new cef_response_t object.
///
CEF_EXPORT cef_response_t* cef_response_create(void);
CEF_EXPORT cef_response_t* cef_response_create();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=83cbe91e85d7ab2413f733b75457ce6689d3d0ae$
// $hash=df8c46dd19ef6a3964c49d79e770de6e4245e208$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
@@ -131,7 +131,7 @@ CEF_EXPORT int cef_register_scheme_handler_factory(
// ef_request_context_t::cef_request_context_get_global_context()->clear_scheme_
// handler_factories().
///
CEF_EXPORT int cef_clear_scheme_handler_factories(void);
CEF_EXPORT int cef_clear_scheme_handler_factories();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2502258e69820d070a9f094d5e587a38e96cc930$
// $hash=e943dd2af818e5a5f19f6cbd1648896684c666c6$
//
#ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_
@@ -122,7 +122,7 @@ typedef struct _cef_task_runner_t {
// task runners. An NULL reference will be returned if this function is called
// on an invalid thread.
///
CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_current_thread(void);
CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_current_thread();
///
// Returns the task runner for the specified CEF thread.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=0a206b1c12637c8b04b2815cb3b50f212768ba01$
// $hash=a7b4410e0a35eb0aba747014665419fb6b6fcb67$
//
#ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_
@@ -109,7 +109,7 @@ CEF_EXPORT int cef_end_tracing(const cef_string_t* tracing_file,
// high-res time. Can be used by clients to synchronize with the time
// information in trace events.
///
CEF_EXPORT int64 cef_now_from_system_trace_time(void);
CEF_EXPORT int64 cef_now_from_system_trace_time();
#ifdef __cplusplus
}

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b7dd2429f492a8f2dd978f9500c63dd0e01035d4$
// $hash=2bdcad7f8e3c03285a5e5ddb9a02a5a2182f254c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
@@ -143,17 +143,17 @@ typedef struct _cef_v8context_t {
///
// Returns the current (top) context object in the V8 context stack.
///
CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context(void);
CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context();
///
// Returns the entered (bottom) context object in the V8 context stack.
///
CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context(void);
CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context();
///
// Returns true (1) if V8 is currently inside a context.
///
CEF_EXPORT int cef_v8context_in_context(void);
CEF_EXPORT int cef_v8context_in_context();
///
// Structure that should be implemented to handle V8 function calls. The
@@ -733,12 +733,12 @@ typedef struct _cef_v8value_t {
///
// Create a new cef_v8value_t object of type undefined.
///
CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined(void);
CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined();
///
// Create a new cef_v8value_t object of type null.
///
CEF_EXPORT cef_v8value_t* cef_v8value_create_null(void);
CEF_EXPORT cef_v8value_t* cef_v8value_create_null();
///
// Create a new cef_v8value_t object of type bool.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ee899158c4f61cc3f85176174d6fd9cbe2a3db4c$
// $hash=c557496bdc1403b25b22ca9354a942478131c7ce$
//
#ifndef CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_
@@ -219,7 +219,7 @@ typedef struct _cef_value_t {
///
// Creates a new object.
///
CEF_EXPORT cef_value_t* cef_value_create(void);
CEF_EXPORT cef_value_t* cef_value_create();
///
// Structure representing a binary value. Can be used on any process and thread.
@@ -523,7 +523,7 @@ typedef struct _cef_dictionary_value_t {
///
// Creates a new object that is not owned by any other object.
///
CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create(void);
CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create();
///
// Structure representing a list value. Can be used on any process and thread.
@@ -744,7 +744,7 @@ typedef struct _cef_list_value_t {
///
// Creates a new object that is not owned by any other object.
///
CEF_EXPORT cef_list_value_t* cef_list_value_create(void);
CEF_EXPORT cef_list_value_t* cef_list_value_create();
#ifdef __cplusplus
}

View File

@@ -0,0 +1,171 @@
// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=51060280dee57104eaef7b774e4b4895970c0057$
//
#ifndef CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_
#pragma once
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _cef_browser_t;
///
// Information about a specific web plugin.
///
typedef struct _cef_web_plugin_info_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Returns the plugin name.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_name)(
struct _cef_web_plugin_info_t* self);
///
// Returns the plugin file path (DLL/bundle/library).
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_path)(
struct _cef_web_plugin_info_t* self);
///
// Returns the version of the plugin (may be OS-specific).
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_version)(
struct _cef_web_plugin_info_t* self);
///
// Returns a description of the plugin from the version information.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_description)(
struct _cef_web_plugin_info_t* self);
} cef_web_plugin_info_t;
///
// Structure to implement for visiting web plugin information. The functions of
// this structure will be called on the browser process UI thread.
///
typedef struct _cef_web_plugin_info_visitor_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Method that will be called once for each plugin. |count| is the 0-based
// index for the current plugin. |total| is the total number of plugins.
// Return false (0) to stop visiting plugins. This function may never be
// called if no plugins are found.
///
int(CEF_CALLBACK* visit)(struct _cef_web_plugin_info_visitor_t* self,
struct _cef_web_plugin_info_t* info,
int count,
int total);
} cef_web_plugin_info_visitor_t;
///
// Structure to implement for receiving unstable plugin information. The
// functions of this structure will be called on the browser process IO thread.
///
typedef struct _cef_web_plugin_unstable_callback_t {
///
// Base structure.
///
cef_base_ref_counted_t base;
///
// Method that will be called for the requested plugin. |unstable| will be
// true (1) if the plugin has reached the crash count threshold of 3 times in
// 120 seconds.
///
void(CEF_CALLBACK* is_unstable)(
struct _cef_web_plugin_unstable_callback_t* self,
const cef_string_t* path,
int unstable);
} cef_web_plugin_unstable_callback_t;
///
// Visit web plugin information. Can be called on any thread in the browser
// process.
///
CEF_EXPORT void cef_visit_web_plugin_info(
cef_web_plugin_info_visitor_t* visitor);
///
// Cause the plugin list to refresh the next time it is accessed regardless of
// whether it has already been loaded. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_refresh_web_plugins();
///
// Unregister an internal plugin. This may be undone the next time
// cef_refresh_web_plugins() is called. Can be called on any thread in the
// browser process.
///
CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path);
///
// Register a plugin crash. Can be called on any thread in the browser process
// but will be executed on the IO thread.
///
CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path);
///
// Query if a plugin is unstable. Can be called on any thread in the browser
// process.
///
CEF_EXPORT void cef_is_web_plugin_unstable(
const cef_string_t* path,
cef_web_plugin_unstable_callback_t* callback);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=33a684b03178472bdf93e70043304cce8bc32d05$
// $hash=d70d5b74890e3ca91f01333ebdb4f3298caeb619$
//
#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_
@@ -530,7 +530,7 @@ typedef struct _cef_translator_test_t {
///
// Create the test object.
///
CEF_EXPORT cef_translator_test_t* cef_translator_test_create(void);
CEF_EXPORT cef_translator_test_t* cef_translator_test_create();
///
// Library-side test object for RefPtr.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5e383d792ce9dc1809d3d3fdeabb9c60fb9ff1ba$
// $hash=2fd0db428ce5902d59a7802c901e1c13b2367b5a$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_
@@ -108,7 +108,7 @@ typedef struct _cef_display_t {
///
// Returns the primary Display.
///
CEF_EXPORT cef_display_t* cef_display_get_primary(void);
CEF_EXPORT cef_display_t* cef_display_get_primary();
///
// Returns the Display nearest |point|. Set |input_pixel_coords| to true (1) if
@@ -131,7 +131,7 @@ CEF_EXPORT cef_display_t* cef_display_get_matching_bounds(
// Returns the total number of Displays. Mirrored displays are excluded; this
// function is intended to return the number of distinct, usable displays.
///
CEF_EXPORT size_t cef_display_get_count(void);
CEF_EXPORT size_t cef_display_get_count();
///
// Returns all Displays. Mirrored displays are excluded; this function is

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "34a42688778747c68f31e0194fea8323bc5388dc"
#define CEF_API_HASH_UNIVERSAL "6f6a9c0f3b420cd3120cf4f5924cbc91f5095abd"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "c78306ad4768dc6c4ca1c376fa4c3799db8fd0eb"
#define CEF_API_HASH_PLATFORM "5835e67ed251fec96837b475df44248a286e422f"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "c25d8bb5b7118a8f50c84e8a2746b2a14d7193ef"
#define CEF_API_HASH_PLATFORM "b8187d9f99b028d767dfd6a40490190c25a3d901"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "742fc8a47e757e34a87c7c814fc884591d5e9f98"
#define CEF_API_HASH_PLATFORM "d7199dfd396052e1517e55f18ea75d3d61336538"
#endif
#ifdef __cplusplus

View File

@@ -63,7 +63,7 @@ class CefAudioHandler : public virtual CefBaseRefCounted {
///
// Called on a browser audio capture thread when the browser starts
// streaming audio. OnAudioStreamStopped will always be called after
// streaming audio. OnAudioSteamStopped will always be called after
// OnAudioStreamStarted; both methods may be called multiple times
// for the same browser. |params| contains the audio parameters like
// sample rate and channel layout. |channels| is the number of channels.

View File

@@ -90,10 +90,7 @@ class CefBaseScoped {
///
class CefRefCount {
public:
CefRefCount() = default;
CefRefCount(const CefRefCount&) = delete;
CefRefCount& operator=(const CefRefCount&) = delete;
CefRefCount() {}
///
// Increment the reference count.
@@ -117,6 +114,7 @@ class CefRefCount {
private:
mutable base::AtomicRefCount ref_count_{0};
DISALLOW_COPY_AND_ASSIGN(CefRefCount);
};
///

View File

@@ -479,16 +479,19 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
CefRefPtr<CefPdfPrintCallback> callback) = 0;
///
// Search for |searchText|. |forward| indicates whether to search forward or
// backward within the page. |matchCase| indicates whether the search should
// be case-sensitive. |findNext| indicates whether this is the first request
// or a follow-up. The search will be restarted if |searchText| or |matchCase|
// change. The search will be stopped if |searchText| is empty. The
// CefFindHandler instance, if any, returned via CefClient::GetFindHandler
// will be called to report find results.
// Search for |searchText|. |identifier| must be a unique ID and these IDs
// must strictly increase so that newer requests always have greater IDs than
// older requests. If |identifier| is zero or less than the previous ID value
// then it will be automatically assigned a new valid ID. |forward| indicates
// whether to search forward or backward within the page. |matchCase|
// indicates whether the search should be case-sensitive. |findNext| indicates
// whether this is the first request or a follow-up. The CefFindHandler
// instance, if any, returned via CefClient::GetFindHandler will be called to
// report find results.
///
/*--cef()--*/
virtual void Find(const CefString& searchText,
virtual void Find(int identifier,
const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) = 0;

View File

@@ -60,9 +60,9 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
///
// Called before a child process is launched. Will be called on the browser
// process UI thread when launching a render process and on the browser
// process IO thread when launching a GPU process. Provides an opportunity to
// modify the child process command line. Do not keep a reference to
// |command_line| outside of this method.
// process IO thread when launching a GPU or plugin process. Provides an
// opportunity to modify the child process command line. Do not keep a
// reference to |command_line| outside of this method.
///
/*--cef()--*/
virtual void OnBeforeChildProcessLaunch(

View File

@@ -40,7 +40,6 @@
#include "include/cef_audio_handler.h"
#include "include/cef_base.h"
#include "include/cef_command_handler.h"
#include "include/cef_context_menu_handler.h"
#include "include/cef_dialog_handler.h"
#include "include/cef_display_handler.h"
@@ -70,13 +69,6 @@ class CefClient : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual CefRefPtr<CefAudioHandler> GetAudioHandler() { return nullptr; }
///
// Return the handler for commands. If no handler is provided the default
// implementation will be used.
///
/*--cef()--*/
virtual CefRefPtr<CefCommandHandler> GetCommandHandler() { return nullptr; }
///
// Return the handler for context menus. If no handler is provided the default
// implementation will be used.

View File

@@ -1,68 +0,0 @@
// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// The contents of this file must follow a specific format in order to
// support the CEF translator tool. See the translator.README.txt file in the
// tools directory for more information.
//
#ifndef CEF_INCLUDE_CEF_COMMAND_HANDLER_H_
#define CEF_INCLUDE_CEF_COMMAND_HANDLER_H_
#pragma once
#include "include/cef_base.h"
#include "include/cef_browser.h"
///
// Implement this interface to handle events related to commands. The methods of
// this class will be called on the UI thread.
///
/*--cef(source=client)--*/
class CefCommandHandler : public virtual CefBaseRefCounted {
public:
///
// Called to execute a Chrome command triggered via menu selection or keyboard
// shortcut. Values for |command_id| can be found in the cef_command_ids.h
// file. |disposition| provides information about the intended command target.
// Return true if the command was handled or false for the default
// implementation. For context menu commands this will be called after
// CefContextMenuHandler::OnContextMenuCommand. Only used with the Chrome
// runtime.
///
/*--cef()--*/
virtual bool OnChromeCommand(CefRefPtr<CefBrowser> browser,
int command_id,
cef_window_open_disposition_t disposition) {
return false;
}
};
#endif // CEF_INCLUDE_CEF_COMMAND_HANDLER_H_

View File

@@ -277,7 +277,7 @@ class CefContextMenuParams : public virtual CefBaseRefCounted {
///
// Returns true if the context menu contains items specified by the renderer
// process.
// process (for example, plugin placeholder or pepper plugin menu items).
///
/*--cef()--*/
virtual bool IsCustomMenu() = 0;

View File

@@ -90,20 +90,6 @@ class CefDownloadItemCallback : public virtual CefBaseRefCounted {
/*--cef(source=client)--*/
class CefDownloadHandler : public virtual CefBaseRefCounted {
public:
///
// Called before a download begins in response to a user-initiated action
// (e.g. alt + link click or link click that returns a `Content-Disposition:
// attachment` response from the server). |url| is the target download URL and
// |request_method| is the target method (GET, POST, etc). Return true to
// proceed with the download or false to cancel the download.
///
/*--cef()--*/
virtual bool CanDownload(CefRefPtr<CefBrowser> browser,
const CefString& url,
const CefString& request_method) {
return true;
}
///
// Called before a download begins. |suggested_name| is the suggested name for
// the download file. By default the download will be canceled. Execute

View File

@@ -196,12 +196,6 @@ class CefDragData : public virtual CefBaseRefCounted {
virtual void AddFile(const CefString& path,
const CefString& display_name) = 0;
///
// Clear list of filenames.
///
/*--cef()--*/
virtual void ClearFilenames() = 0;
///
// Get the image representation of drag data. May return NULL if no image
// representation is available.

View File

@@ -50,11 +50,11 @@ class CefFindHandler : public virtual CefBaseRefCounted {
public:
///
// Called to report find results returned by CefBrowserHost::Find().
// |identifer| is a unique incremental identifier for the currently active
// search, |count| is the number of matches currently identified,
// |selectionRect| is the location of where the match was found (in window
// coordinates), |activeMatchOrdinal| is the current position in the search
// results, and |finalUpdate| is true if this is the last find notification.
// |identifer| is the identifier passed to Find(), |count| is the number of
// matches currently identified, |selectionRect| is the location of where the
// match was found (in window coordinates), |activeMatchOrdinal| is the
// current position in the search results, and |finalUpdate| is true if this
// is the last find notification.
///
/*--cef()--*/
virtual void OnFindResult(CefRefPtr<CefBrowser> browser,

View File

@@ -43,6 +43,7 @@
#include "include/cef_frame.h"
#include "include/cef_request.h"
#include "include/cef_resource_request_handler.h"
#include "include/cef_web_plugin.h"
///
// Implement this interface to provide handler implementations. The handler
@@ -52,6 +53,8 @@
/*--cef(source=client,no_debugct_check)--*/
class CefRequestContextHandler : public virtual CefBaseRefCounted {
public:
typedef cef_plugin_policy_t PluginPolicy;
///
// Called on the browser process UI thread immediately after the request
// context has been initialized.

View File

@@ -228,6 +228,14 @@ class CefRequestHandler : public virtual CefBaseRefCounted {
return false;
}
///
// Called on the browser process UI thread when a plugin has crashed.
// |plugin_path| is the path of the plugin that crashed.
///
/*--cef()--*/
virtual void OnPluginCrashed(CefRefPtr<CefBrowser> browser,
const CefString& plugin_path) {}
///
// Called on the browser process UI thread when the render view associated
// with |browser| is ready to receive/handle IPC messages in the render

View File

@@ -40,11 +40,11 @@
extern "C" {
#endif
// The sandbox is used to restrict sub-processes (renderer, GPU, etc) from
// directly accessing system resources. This helps to protect the user from
// untrusted and potentially malicious Web content. See
// http://www.chromium.org/developers/design-documents/sandbox for complete
// details.
// The sandbox is used to restrict sub-processes (renderer, plugin, GPU, etc)
// from directly accessing system resources. This helps to protect the user
// from untrusted and potentially malicious Web content.
// See http://www.chromium.org/developers/design-documents/sandbox for
// complete details.
//
// To enable the sandbox on macOS the following requirements must be met:
// 1. Link the helper process executable with the cef_sandbox static library.

View File

@@ -39,26 +39,26 @@
extern "C" {
#endif
// The sandbox is used to restrict sub-processes (renderer, GPU, etc) from
// directly accessing system resources. This helps to protect the user from
// untrusted and potentially malicious Web content. See
// http://www.chromium.org/developers/design-documents/sandbox for complete
// details.
// The sandbox is used to restrict sub-processes (renderer, plugin, GPU, etc)
// from directly accessing system resources. This helps to protect the user
// from untrusted and potentially malicious Web content.
// See http://www.chromium.org/developers/design-documents/sandbox for
// complete details.
//
// To enable the sandbox on Windows the following requirements must be met:
// 1. Use the same executable for the browser process and all sub-processes.
// 2. Link the executable with the cef_sandbox static library.
// 3. Call the cef_sandbox_info_create() function from within the executable
// (not from a separate DLL) and pass the resulting pointer into both the
// CefExecuteProcess() and CefInitialize() functions via the
// CefExecutProcess() and CefInitialize() functions via the
// |windows_sandbox_info| parameter.
///
// Create the sandbox information object for this process. It is safe to create
// multiple of this object and to destroy the object immediately after passing
// into the CefExecuteProcess() and/or CefInitialize() functions.
// into the CefExecutProcess() and/or CefInitialize() functions.
///
void* cef_sandbox_info_create(void);
void* cef_sandbox_info_create();
///
// Destroy the specified sandbox information object.

148
include/cef_web_plugin.h Normal file
View File

@@ -0,0 +1,148 @@
// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// The contents of this file must follow a specific format in order to
// support the CEF translator tool. See the translator.README.txt file in the
// tools directory for more information.
//
#ifndef CEF_INCLUDE_CEF_WEB_PLUGIN_H_
#define CEF_INCLUDE_CEF_WEB_PLUGIN_H_
#include "include/cef_base.h"
class CefBrowser;
///
// Information about a specific web plugin.
///
/*--cef(source=library)--*/
class CefWebPluginInfo : public virtual CefBaseRefCounted {
public:
///
// Returns the plugin name.
///
/*--cef()--*/
virtual CefString GetName() = 0;
///
// Returns the plugin file path (DLL/bundle/library).
///
/*--cef()--*/
virtual CefString GetPath() = 0;
///
// Returns the version of the plugin (may be OS-specific).
///
/*--cef()--*/
virtual CefString GetVersion() = 0;
///
// Returns a description of the plugin from the version information.
///
/*--cef()--*/
virtual CefString GetDescription() = 0;
};
///
// Interface to implement for visiting web plugin information. The methods of
// this class will be called on the browser process UI thread.
///
/*--cef(source=client)--*/
class CefWebPluginInfoVisitor : public virtual CefBaseRefCounted {
public:
///
// Method that will be called once for each plugin. |count| is the 0-based
// index for the current plugin. |total| is the total number of plugins.
// Return false to stop visiting plugins. This method may never be called if
// no plugins are found.
///
/*--cef()--*/
virtual bool Visit(CefRefPtr<CefWebPluginInfo> info,
int count,
int total) = 0;
};
///
// Visit web plugin information. Can be called on any thread in the browser
// process.
///
/*--cef()--*/
void CefVisitWebPluginInfo(CefRefPtr<CefWebPluginInfoVisitor> visitor);
///
// Cause the plugin list to refresh the next time it is accessed regardless
// of whether it has already been loaded. Can be called on any thread in the
// browser process.
///
/*--cef()--*/
void CefRefreshWebPlugins();
///
// Unregister an internal plugin. This may be undone the next time
// CefRefreshWebPlugins() is called. Can be called on any thread in the browser
// process.
///
/*--cef()--*/
void CefUnregisterInternalWebPlugin(const CefString& path);
///
// Register a plugin crash. Can be called on any thread in the browser process
// but will be executed on the IO thread.
///
/*--cef()--*/
void CefRegisterWebPluginCrash(const CefString& path);
///
// Interface to implement for receiving unstable plugin information. The methods
// of this class will be called on the browser process IO thread.
///
/*--cef(source=client)--*/
class CefWebPluginUnstableCallback : public virtual CefBaseRefCounted {
public:
///
// Method that will be called for the requested plugin. |unstable| will be
// true if the plugin has reached the crash count threshold of 3 times in 120
// seconds.
///
/*--cef()--*/
virtual void IsUnstable(const CefString& path, bool unstable) = 0;
};
///
// Query if a plugin is unstable. Can be called on any thread in the browser
// process.
///
/*--cef()--*/
void CefIsWebPluginUnstable(const CefString& path,
CefRefPtr<CefWebPluginUnstableCallback> callback);
#endif // CEF_INCLUDE_CEF_WEB_PLUGIN_H_

View File

@@ -44,7 +44,7 @@ extern "C" {
///
// Gets the current log level.
///
CEF_EXPORT int cef_get_min_log_level(void);
CEF_EXPORT int cef_get_min_log_level();
///
// Gets the current vlog level for the given file (usually taken from

View File

@@ -46,7 +46,7 @@ typedef void* cef_string_list_t;
///
// Allocate a new string map.
///
CEF_EXPORT cef_string_list_t cef_string_list_alloc(void);
CEF_EXPORT cef_string_list_t cef_string_list_alloc();
///
// Return the number of elements in the string list.

View File

@@ -46,7 +46,7 @@ typedef void* cef_string_map_t;
///
// Allocate a new string map.
///
CEF_EXPORT cef_string_map_t cef_string_map_alloc(void);
CEF_EXPORT cef_string_map_t cef_string_map_alloc();
///
// Return the number of elements in the string map.

View File

@@ -47,7 +47,7 @@ typedef void* cef_string_multimap_t;
///
// Allocate a new string multimap.
///
CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc(void);
CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc();
///
// Return the number of elements in the string multimap.

View File

@@ -175,9 +175,9 @@ typedef cef_string_utf16_t* cef_string_userfree_utf16_t;
// calling the associated free function.
///
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc(void);
CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc(void);
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc(void);
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc();
CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc();
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc();
///
// These functions free the string structure allocated by the associated

View File

@@ -584,16 +584,10 @@ class CefStringBase {
return NULL;
userfree_struct_type str = traits::userfree_alloc();
if (owner_) {
// Transfer ownership of the data to |str|.
memcpy(str, string_, sizeof(struct_type));
// Free this class' structure but not the data.
memset(string_, 0, sizeof(struct_type));
} else {
// Copy the data to |str|.
traits::set(string_->str, string_->length, str, /*copy=*/true);
}
memcpy(str, string_, sizeof(struct_type));
// Free this class' structure but not the data.
memset(string_, 0, sizeof(struct_type));
ClearAndFree();
return str;

View File

@@ -55,7 +55,7 @@ typedef pid_t cef_platform_thread_id_t;
///
// Returns the current platform thread ID.
///
CEF_EXPORT cef_platform_thread_id_t cef_get_current_platform_thread_id(void);
CEF_EXPORT cef_platform_thread_id_t cef_get_current_platform_thread_id();
#if defined(OS_WIN)
typedef DWORD cef_platform_thread_handle_t;
@@ -69,7 +69,7 @@ typedef pthread_t cef_platform_thread_handle_t;
// Returns the current platform thread handle.
///
CEF_EXPORT cef_platform_thread_handle_t
cef_get_current_platform_thread_handle(void);
cef_get_current_platform_thread_handle();
#ifdef __cplusplus
}

View File

@@ -202,7 +202,7 @@ typedef struct _cef_settings_t {
///
// Set to true (1) to have the browser process message loop run in a separate
// thread. If false (0) then the CefDoMessageLoopWork() function must be
// thread. If false (0) than the CefDoMessageLoopWork() function must be
// called from your application message loop. This option is only supported on
// Windows and Linux.
///
@@ -374,11 +374,10 @@ typedef struct _cef_settings_t {
///
// Set to a value between 1024 and 65535 to enable remote debugging on the
// specified port. Also configurable using the "remote-debugging-port"
// command-line switch. Remote debugging can be accessed by loading the
// chrome://inspect page in Google Chrome. Port numbers 9222 and 9229 are
// discoverable by default. Other port numbers may need to be configured via
// "Discover network targets" on the Devices tab.
// specified port. For example, if 8080 is specified the remote debugging URL
// will be http://localhost:8080. CEF can be remotely debugged from any CEF or
// Chrome browser window. Also configurable using the "remote-debugging-port"
// command-line switch.
///
int remote_debugging_port;
@@ -426,6 +425,14 @@ typedef struct _cef_settings_t {
///
cef_string_t cookieable_schemes_list;
int cookieable_schemes_exclude_defaults;
///
// GUID string used for identifying the application. This is passed to the
// system AV function for scanning downloaded files. By default, the GUID
// will be an empty string and the file will be treated as an untrusted
// file when the GUID is empty.
///
cef_string_t application_client_id_for_file_scanning;
} cef_settings_t;
///
@@ -512,7 +519,7 @@ typedef struct _cef_browser_settings_t {
///
int windowless_frame_rate;
// BEGIN values that map to WebPreferences settings.
// The below values map to WebPreferences settings.
///
// Font settings.
@@ -569,6 +576,12 @@ typedef struct _cef_browser_settings_t {
///
cef_state_t javascript_dom_paste;
///
// Controls whether any plugins will be loaded. Also configurable using the
// "disable-plugins" command-line switch.
///
cef_state_t plugins;
///
// Controls whether image URLs will be loaded from the network. A cached image
// will still be rendered if requested. Also configurable using the
@@ -614,8 +627,6 @@ typedef struct _cef_browser_settings_t {
///
cef_state_t webgl;
// END values that map to WebPreferences settings.
///
// Background color used for the browser before a document is loaded and when
// no document color is specified. The alpha component must be either fully
@@ -635,13 +646,6 @@ typedef struct _cef_browser_settings_t {
// empty then "en-US,en" will be used.
///
cef_string_t accept_language_list;
///
// Controls whether the Chrome status bubble will be used. Only supported with
// the Chrome runtime. For details about the status bubble see
// https://www.chromium.org/user-experience/status-bubble/
///
cef_state_t chrome_status_bubble;
} cef_browser_settings_t;
///
@@ -947,66 +951,15 @@ typedef enum {
///
typedef enum {
WOD_UNKNOWN,
///
// Current tab. This is the default in most cases.
///
WOD_CURRENT_TAB,
///
// Indicates that only one tab with the url should exist in the same window.
///
WOD_SINGLETON_TAB,
///
// Shift key + Middle mouse button or meta/ctrl key while clicking.
///
WOD_NEW_FOREGROUND_TAB,
///
// Middle mouse button or meta/ctrl key while clicking.
///
WOD_NEW_BACKGROUND_TAB,
///
// New popup window.
///
WOD_NEW_POPUP,
///
// Shift key while clicking.
///
WOD_NEW_WINDOW,
///
// Alt key while clicking.
///
WOD_SAVE_TO_DISK,
///
// New off-the-record (incognito) window.
///
WOD_OFF_THE_RECORD,
///
// Special case error condition from the renderer.
///
WOD_IGNORE_ACTION,
///
// Activates an existing tab containing the url, rather than navigating.
// This is similar to SINGLETON_TAB, but searches across all windows from
// the current profile and anonymity (instead of just the current one);
// closes the current tab on switching if the current tab was the NTP with
// no session history; and behaves like CURRENT_TAB instead of
// NEW_FOREGROUND_TAB when no existing tab is found.
///
WOD_SWITCH_TO_TAB,
///
// Creates a new document picture-in-picture window showing a child WebView.
///
WOD_NEW_PICTURE_IN_PICTURE,
WOD_IGNORE_ACTION
} cef_window_open_disposition_t;
///
@@ -1075,8 +1028,7 @@ typedef enum {
} cef_postdataelement_type_t;
///
// Resource type for a request. These constants match their equivalents in
// Chromium's ResourceType and should not be renumbered.
// Resource type for a request.
///
typedef enum {
///
@@ -1199,12 +1151,6 @@ typedef enum {
///
TT_EXPLICIT = 1,
///
// User got to this page through a suggestion in the UI (for example, via the
// destinations page). Chrome runtime only.
///
TT_AUTO_BOOKMARK = 2,
///
// Source is a subframe navigation. This is any content that is automatically
// loaded in a non-toplevel frame. For example, if a page consists of several
@@ -1223,25 +1169,6 @@ typedef enum {
///
TT_MANUAL_SUBFRAME = 4,
///
// User got to this page by typing in the URL bar and selecting an entry
// that did not look like a URL. For example, a match might have the URL
// of a Google search result page, but appear like "Search Google for ...".
// These are not quite the same as EXPLICIT navigations because the user
// didn't type or see the destination URL. Chrome runtime only.
// See also TT_KEYWORD.
///
TT_GENERATED = 5,
///
// This is a toplevel navigation. This is any content that is automatically
// loaded in a toplevel frame. For example, opening a tab to show the ASH
// screen saver, opening the devtools window, opening the NTP after the safe
// browsing warning, opening web-based dialog boxes are examples of
// AUTO_TOPLEVEL navigations. Chrome runtime only.
///
TT_AUTO_TOPLEVEL = 6,
///
// Source is a form submission by the user. NOTE: In some situations
// submitting a form does not result in this transition type. This can happen
@@ -1256,25 +1183,6 @@ typedef enum {
///
TT_RELOAD = 8,
///
// The url was generated from a replaceable keyword other than the default
// search provider. If the user types a keyword (which also applies to
// tab-to-search) in the omnibox this qualifier is applied to the transition
// type of the generated url. TemplateURLModel then may generate an
// additional visit with a transition type of TT_KEYWORD_GENERATED against the
// url 'http://' + keyword. For example, if you do a tab-to-search against
// wikipedia the generated url has a transition qualifer of TT_KEYWORD, and
// TemplateURLModel generates a visit for 'wikipedia.org' with a transition
// type of TT_KEYWORD_GENERATED. Chrome runtime only.
///
TT_KEYWORD = 9,
///
// Corresponds to a visit generated for a keyword. See description of
// TT_KEYWORD for more details. Chrome runtime only.
///
TT_KEYWORD_GENERATED = 10,
///
// General mask defining the bits used for the source values.
///
@@ -1300,18 +1208,6 @@ typedef enum {
///
TT_DIRECT_LOAD_FLAG = 0x02000000,
///
// User is navigating to the home page. Chrome runtime only.
///
TT_HOME_PAGE_FLAG = 0x04000000,
///
// The transition originated from an external application; the exact
// definition of this is embedder dependent. Chrome runtime and
// extension system only.
///
TT_FROM_API_FLAG = 0x08000000,
///
// The beginning of a navigation chain.
///
@@ -1720,7 +1616,8 @@ typedef enum {
MENU_ID_NO_SPELLING_SUGGESTIONS = 205,
MENU_ID_ADD_TO_DICTIONARY = 206,
// Custom menu items originating from the renderer process.
// Custom menu items originating from the renderer process. For example,
// plugin placeholder menu items.
MENU_ID_CUSTOM_FIRST = 220,
MENU_ID_CUSTOM_LAST = 250,
@@ -1922,8 +1819,7 @@ typedef enum {
} cef_context_menu_type_flags_t;
///
// Supported context menu media types. These constants match their equivalents
// in Chromium's ContextMenuDataMediaType and should not be renumbered.
// Supported context menu media types.
///
typedef enum {
///
@@ -1943,10 +1839,6 @@ typedef enum {
///
CM_MEDIATYPE_AUDIO,
///
// An canvas node is selected.
///
CM_MEDIATYPE_CANVAS,
///
// A file node is selected.
///
CM_MEDIATYPE_FILE,
@@ -1957,31 +1849,24 @@ typedef enum {
} cef_context_menu_media_type_t;
///
// Supported context menu media state bit flags. These constants match their
// equivalents in Chromium's ContextMenuData::MediaFlags and should not be
// renumbered.
// Supported context menu media state bit flags.
///
typedef enum {
CM_MEDIAFLAG_NONE = 0,
CM_MEDIAFLAG_IN_ERROR = 1 << 0,
CM_MEDIAFLAG_ERROR = 1 << 0,
CM_MEDIAFLAG_PAUSED = 1 << 1,
CM_MEDIAFLAG_MUTED = 1 << 2,
CM_MEDIAFLAG_LOOP = 1 << 3,
CM_MEDIAFLAG_CAN_SAVE = 1 << 4,
CM_MEDIAFLAG_HAS_AUDIO = 1 << 5,
CM_MEDIAFLAG_CAN_TOGGLE_CONTROLS = 1 << 6,
CM_MEDIAFLAG_CONTROLS = 1 << 7,
CM_MEDIAFLAG_HAS_VIDEO = 1 << 6,
CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7,
CM_MEDIAFLAG_CAN_PRINT = 1 << 8,
CM_MEDIAFLAG_CAN_ROTATE = 1 << 9,
CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE = 1 << 10,
CM_MEDIAFLAG_PICTURE_IN_PICTURE = 1 << 11,
CM_MEDIAFLAG_CAN_LOOP = 1 << 12,
} cef_context_menu_media_state_flags_t;
///
// Supported context menu edit state bit flags. These constants match their
// equivalents in Chromium's ContextMenuDataEditFlags and should not be
// renumbered.
// Supported context menu edit state bit flags.
///
typedef enum {
CM_EDITFLAG_NONE = 0,
@@ -1993,7 +1878,6 @@ typedef enum {
CM_EDITFLAG_CAN_DELETE = 1 << 5,
CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6,
CM_EDITFLAG_CAN_TRANSLATE = 1 << 7,
CM_EDITFLAG_CAN_EDIT_RICHLY = 1 << 8,
} cef_context_menu_edit_state_flags_t;
///
@@ -2574,6 +2458,32 @@ typedef enum {
SCALE_FACTOR_300P,
} cef_scale_factor_t;
///
// Plugin policies supported by CefRequestContextHandler::OnBeforePluginLoad.
///
typedef enum {
///
// Allow the content.
///
PLUGIN_POLICY_ALLOW,
///
// Allow important content and block unimportant content based on heuristics.
// The user can manually load blocked content.
///
PLUGIN_POLICY_DETECT_IMPORTANT,
///
// Block the content. The user can manually load blocked content.
///
PLUGIN_POLICY_BLOCK,
///
// Disable the content. The user cannot load disabled content.
///
PLUGIN_POLICY_DISABLE,
} cef_plugin_policy_t;
///
// Policy for how the Referrer HTTP header value will be sent during navigation.
// If the `--no-referrers` command-line flag is specified then the policy value

View File

@@ -69,7 +69,7 @@ extern "C" {
// thread-safe and must only be accessed on the browser process UI thread.
///
#if defined(CEF_X11)
CEF_EXPORT XDisplay* cef_get_xdisplay(void);
CEF_EXPORT XDisplay* cef_get_xdisplay();
#endif
///

View File

@@ -546,6 +546,7 @@ struct CefSettingsTraits {
cef_string_clear(&s->locales_dir_path);
cef_string_clear(&s->accept_language_list);
cef_string_clear(&s->cookieable_schemes_list);
cef_string_clear(&s->application_client_id_for_file_scanning);
}
static inline void set(const struct_type* src,
@@ -604,6 +605,10 @@ struct CefSettingsTraits {
&target->cookieable_schemes_list, copy);
target->cookieable_schemes_exclude_defaults =
src->cookieable_schemes_exclude_defaults;
cef_string_set(src->application_client_id_for_file_scanning.str,
src->application_client_id_for_file_scanning.length,
&target->application_client_id_for_file_scanning, copy);
}
};
@@ -699,6 +704,7 @@ struct CefBrowserSettingsTraits {
target->javascript_close_windows = src->javascript_close_windows;
target->javascript_access_clipboard = src->javascript_access_clipboard;
target->javascript_dom_paste = src->javascript_dom_paste;
target->plugins = src->plugins;
target->image_loading = src->image_loading;
target->image_shrink_standalone_to_fit =
src->image_shrink_standalone_to_fit;
@@ -713,8 +719,6 @@ struct CefBrowserSettingsTraits {
cef_string_set(src->accept_language_list.str,
src->accept_language_list.length,
&target->accept_language_list, copy);
target->chrome_status_bubble = src->chrome_status_bubble;
}
};

View File

@@ -38,6 +38,7 @@
#pragma once
#include "include/base/cef_lock.h"
#include "include/base/cef_macros.h"
#include "include/cef_base.h"
#include "include/cef_stream.h"
@@ -56,9 +57,6 @@ class CefByteReadHandler : public CefReadHandler {
size_t size,
CefRefPtr<CefBaseRefCounted> source);
CefByteReadHandler(const CefByteReadHandler&) = delete;
CefByteReadHandler& operator=(const CefByteReadHandler&) = delete;
// CefReadHandler methods.
virtual size_t Read(void* ptr, size_t size, size_t n) override;
virtual int Seek(int64 offset, int whence) override;
@@ -75,6 +73,7 @@ class CefByteReadHandler : public CefReadHandler {
base::Lock lock_;
IMPLEMENT_REFCOUNTING(CefByteReadHandler);
DISALLOW_COPY_AND_ASSIGN(CefByteReadHandler);
};
#endif // CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_

View File

@@ -38,6 +38,7 @@
#pragma once
#include "include/base/cef_callback_forward.h"
#include "include/base/cef_macros.h"
#include "include/cef_task.h"
///

View File

@@ -43,6 +43,7 @@
#include "include/base/cef_bind.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/cef_task.h"
#define CEF_REQUIRE_UI_THREAD() DCHECK(CefCurrentlyOn(TID_UI));
@@ -139,10 +140,6 @@ class CefScopedArgArray {
}
array_[argc] = NULL;
}
CefScopedArgArray(const CefScopedArgArray&) = delete;
CefScopedArgArray& operator=(const CefScopedArgArray&) = delete;
~CefScopedArgArray() { delete[] array_; }
char** array() const { return array_; }
@@ -153,6 +150,8 @@ class CefScopedArgArray {
// Keep values in a vector separate from |array_| because various users may
// modify |array_| and we still want to clean up memory properly.
std::vector<std::string> values_;
DISALLOW_COPY_AND_ASSIGN(CefScopedArgArray);
};
#endif // CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_

View File

@@ -36,6 +36,8 @@
#ifdef __cplusplus
#include <string>
#include "include/base/cef_macros.h"
extern "C" {
#endif // __cplusplus
@@ -49,7 +51,7 @@ int cef_load_library(const char* path);
// Unload the CEF library that was previously loaded. Returns true (1)
// on success and false (0) on failure.
///
int cef_unload_library(void);
int cef_unload_library();
#ifdef __cplusplus
}
@@ -97,10 +99,6 @@ int cef_unload_library(void);
class CefScopedLibraryLoader {
public:
CefScopedLibraryLoader();
CefScopedLibraryLoader(const CefScopedLibraryLoader&) = delete;
CefScopedLibraryLoader& operator=(const CefScopedLibraryLoader&) = delete;
~CefScopedLibraryLoader();
///
@@ -121,6 +119,7 @@ class CefScopedLibraryLoader {
bool Load(bool helper);
bool loaded_;
DISALLOW_COPY_AND_ASSIGN(CefScopedLibraryLoader);
};
#endif // defined(OS_MAC)

View File

@@ -78,7 +78,7 @@
// with an error code of -1.
//
// Queries can be either persistent or non-persistent. If the query is
// persistent then the callbacks will remain registered until one of the
// persistent than the callbacks will remain registered until one of the
// following conditions are met:
//
// A. The query is canceled in JavaScript using the |window.cefQueryCancel|
@@ -245,7 +245,7 @@ class CefMessageRouterBrowserSide
///
class Handler {
public:
using Callback = CefMessageRouterBrowserSide::Callback;
typedef CefMessageRouterBrowserSide::Callback Callback;
///
// Executed when a new query is received. |query_id| uniquely identifies the

View File

@@ -41,6 +41,7 @@
#include <memory>
#include "include/base/cef_callback.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h"
#include "include/base/cef_weak_ptr.h"
#include "include/cef_request_handler.h"
@@ -100,9 +101,6 @@ class CefResourceManager
///
class Request : public base::RefCountedThreadSafe<Request> {
public:
Request(const Request&) = delete;
Request& operator=(const Request&) = delete;
///
// Returns the URL associated with this request. The returned value will be
// fully qualified but will not contain query or fragment components. It
@@ -178,9 +176,11 @@ class CefResourceManager
// Params that stay with this request object. Safe to access on any thread.
RequestParams params_;
DISALLOW_COPY_AND_ASSIGN(Request);
};
using RequestList = std::list<scoped_refptr<Request>>;
typedef std::list<scoped_refptr<Request>> RequestList;
///
// Interface implemented by resource providers. A provider may be created on
@@ -210,9 +210,6 @@ class CefResourceManager
CefResourceManager();
CefResourceManager(const CefResourceManager&) = delete;
CefResourceManager& operator=(const CefResourceManager&) = delete;
///
// Add a provider that maps requests for |url| to |content|. |url| should be
// fully qualified but not include a query or fragment component. If
@@ -319,7 +316,7 @@ class CefResourceManager
// Provider and associated information.
struct ProviderEntry;
using ProviderEntryList = std::list<ProviderEntry*>;
typedef std::list<ProviderEntry*> ProviderEntryList;
// Values associated with the pending request only. Ownership will be passed
// between requests and the resource manager as request handling proceeds.
@@ -360,7 +357,7 @@ class CefResourceManager
ProviderEntryList providers_;
// Map of response ID to pending CefResourceHandler object.
using PendingHandlersMap = std::map<uint64, CefRefPtr<CefResourceHandler>>;
typedef std::map<uint64, CefRefPtr<CefResourceHandler>> PendingHandlersMap;
PendingHandlersMap pending_handlers_;
UrlFilter url_filter_;
@@ -368,6 +365,8 @@ class CefResourceManager
// Must be the last member. Created and accessed on the IO thread.
std::unique_ptr<base::WeakPtrFactory<CefResourceManager>> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefResourceManager);
};
#endif // CEF_INCLUDE_WRAPPER_CEF_RESOURCE_MANAGER_H_

View File

@@ -39,6 +39,7 @@
#pragma once
#include "include/base/cef_build.h"
#include "include/base/cef_macros.h"
#include "include/cef_base.h"
///
@@ -59,9 +60,6 @@ class CefScopedTempDir {
///
CefScopedTempDir();
CefScopedTempDir(const CefScopedTempDir&) = delete;
CefScopedTempDir& operator=(const CefScopedTempDir&) = delete;
///
// Recursively delete path.
///
@@ -113,6 +111,8 @@ class CefScopedTempDir {
private:
CefString path_;
DISALLOW_COPY_AND_ASSIGN(CefScopedTempDir);
};
#endif // CEF_INCLUDE_SCOPED_TEMP_DIR_H_

View File

@@ -37,6 +37,7 @@
#define CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_
#pragma once
#include "include/base/cef_macros.h"
#include "include/cef_resource_handler.h"
#include "include/cef_response.h"
#include "include/cef_stream.h"
@@ -60,9 +61,6 @@ class CefStreamResourceHandler : public CefResourceHandler {
CefResponse::HeaderMap header_map,
CefRefPtr<CefStreamReader> stream);
CefStreamResourceHandler(const CefStreamResourceHandler&) = delete;
CefStreamResourceHandler& operator=(const CefStreamResourceHandler&) = delete;
// CefResourceHandler methods.
bool Open(CefRefPtr<CefRequest> request,
bool& handle_request,
@@ -84,6 +82,7 @@ class CefStreamResourceHandler : public CefResourceHandler {
const CefRefPtr<CefStreamReader> stream_;
IMPLEMENT_REFCOUNTING(CefStreamResourceHandler);
DISALLOW_COPY_AND_ASSIGN(CefStreamResourceHandler);
};
#endif // CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_

View File

@@ -41,6 +41,7 @@
#include <vector>
#include "include/base/cef_lock.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h"
#include "include/cef_base.h"
#include "include/cef_xml_reader.h"
@@ -72,8 +73,8 @@ class CefStreamReader;
///
class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
public:
using ObjectVector = std::vector<CefRefPtr<CefXmlObject>>;
using AttributeMap = std::map<CefString, CefString>;
typedef std::vector<CefRefPtr<CefXmlObject>> ObjectVector;
typedef std::map<CefString, CefString> AttributeMap;
///
// Create a new object with the specified name. An object name must always be
@@ -81,9 +82,6 @@ class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
///
explicit CefXmlObject(const CefString& name);
CefXmlObject(const CefXmlObject&) = delete;
CefXmlObject& operator=(const CefXmlObject&) = delete;
///
// Load the contents of the specified XML stream into this object. The
// existing children and attributes, if any, will first be cleared.
@@ -192,6 +190,8 @@ class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
ObjectVector children_;
base::Lock lock_;
DISALLOW_COPY_AND_ASSIGN(CefXmlObject);
};
#endif // CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_

View File

@@ -40,6 +40,7 @@
#include <map>
#include "include/base/cef_lock.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h"
#include "include/cef_base.h"
@@ -79,16 +80,13 @@ class CefZipArchive : public base::RefCountedThreadSafe<CefZipArchive> {
virtual CefRefPtr<CefStreamReader> GetStreamReader() const = 0;
};
using FileMap = std::map<CefString, CefRefPtr<File>>;
typedef std::map<CefString, CefRefPtr<File>> FileMap;
///
// Create a new object.
///
CefZipArchive();
CefZipArchive(const CefZipArchive&) = delete;
CefZipArchive& operator=(const CefZipArchive&) = delete;
///
// Load the contents of the specified zip archive stream into this object.
// If the zip archive requires a password then provide it via |password|.
@@ -138,6 +136,8 @@ class CefZipArchive : public base::RefCountedThreadSafe<CefZipArchive> {
FileMap contents_;
mutable base::Lock lock_;
DISALLOW_COPY_AND_ASSIGN(CefZipArchive);
};
#endif // CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_

View File

@@ -55,9 +55,6 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkWriter::Listener {
public:
CefVisitedLinkListener() { DCHECK(listener_map_.empty()); }
CefVisitedLinkListener(const CefVisitedLinkListener&) = delete;
CefVisitedLinkListener& operator=(const CefVisitedLinkListener&) = delete;
void CreateListenerForContext(content::BrowserContext* context) {
CEF_REQUIRE_UIT();
auto listener =
@@ -97,10 +94,12 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkWriter::Listener {
private:
// Map of AlloyBrowserContext to the associated VisitedLinkEventListener.
using ListenerMap =
std::map<const content::BrowserContext*,
std::unique_ptr<visitedlink::VisitedLinkEventListener>>;
typedef std::map<const content::BrowserContext*,
std::unique_ptr<visitedlink::VisitedLinkEventListener>>
ListenerMap;
ListenerMap listener_map_;
DISALLOW_COPY_AND_ASSIGN(CefVisitedLinkListener);
};
AlloyBrowserContext::AlloyBrowserContext(

View File

@@ -39,9 +39,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
public:
explicit AlloyBrowserContext(const CefRequestContextSettings& settings);
AlloyBrowserContext(const AlloyBrowserContext&) = delete;
AlloyBrowserContext& operator=(const AlloyBrowserContext&) = delete;
// CefBrowserContext overrides.
content::BrowserContext* AsBrowserContext() override { return this; }
Profile* AsProfile() override { return this; }
@@ -145,6 +142,8 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
std::unique_ptr<content::ResourceContext> resource_context_;
scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_;
DISALLOW_COPY_AND_ASSIGN(AlloyBrowserContext);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_

View File

@@ -9,7 +9,6 @@
#include <utility>
#include "libcef/browser/alloy/alloy_browser_context.h"
#include "libcef/browser/alloy/browser_platform_delegate_alloy.h"
#include "libcef/browser/audio_capturer.h"
#include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_info.h"
@@ -100,9 +99,6 @@ class CefWidgetHostInterceptor
render_widget_host_->AddObserver(this);
}
CefWidgetHostInterceptor(const CefWidgetHostInterceptor&) = delete;
CefWidgetHostInterceptor& operator=(const CefWidgetHostInterceptor&) = delete;
blink::mojom::WidgetHost* GetForwardingInterface() override { return impl_; }
// WidgetHostInterceptorForTesting method:
@@ -126,6 +122,8 @@ class CefWidgetHostInterceptor
AlloyBrowserHostImpl* const browser_;
content::RenderWidgetHostImpl* const render_widget_host_;
blink::mojom::WidgetHost* const impl_;
DISALLOW_COPY_AND_ASSIGN(CefWidgetHostInterceptor);
};
static constexpr base::TimeDelta kRecentlyAudibleTimeout = base::Seconds(2);
@@ -451,19 +449,21 @@ void AlloyBrowserHostImpl::PrintToPDF(const CefString& path,
}
}
void AlloyBrowserHostImpl::Find(const CefString& searchText,
void AlloyBrowserHostImpl::Find(int identifier,
const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT,
base::BindOnce(&AlloyBrowserHostImpl::Find, this, searchText,
forward, matchCase, findNext));
base::BindOnce(&AlloyBrowserHostImpl::Find, this, identifier,
searchText, forward, matchCase, findNext));
return;
}
if (platform_delegate_) {
platform_delegate_->Find(searchText, forward, matchCase, findNext);
platform_delegate_->Find(identifier, searchText, forward, matchCase,
findNext);
}
}
@@ -665,7 +665,7 @@ void AlloyBrowserHostImpl::SendCaptureLostEvent() {
}
void AlloyBrowserHostImpl::NotifyMoveOrResizeStarted() {
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC))
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(
CEF_UIT,
@@ -859,21 +859,13 @@ void AlloyBrowserHostImpl::FindReply(content::WebContents* web_contents,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) {
auto alloy_delegate =
static_cast<CefBrowserPlatformDelegateAlloy*>(platform_delegate());
if (alloy_delegate->HandleFindReply(request_id, number_of_matches,
selection_rect, active_match_ordinal,
final_update)) {
if (client_) {
if (auto handler = client_->GetFindHandler()) {
const auto& details = alloy_delegate->last_search_result();
CefRect rect(details.selection_rect().x(), details.selection_rect().y(),
details.selection_rect().width(),
details.selection_rect().height());
handler->OnFindResult(
this, details.request_id(), details.number_of_matches(), rect,
details.active_match_ordinal(), details.final_update());
}
if (client_.get()) {
CefRefPtr<CefFindHandler> handler = client_->GetFindHandler();
if (handler.get()) {
CefRect rect(selection_rect.x(), selection_rect.y(),
selection_rect.width(), selection_rect.height());
handler->OnFindResult(this, request_id, number_of_matches, rect,
active_match_ordinal, final_update);
}
}
}
@@ -1133,8 +1125,8 @@ void AlloyBrowserHostImpl::AddNewContents(
}
void AlloyBrowserHostImpl::LoadingStateChanged(content::WebContents* source,
bool should_show_loading_ui) {
contents_delegate_->LoadingStateChanged(source, should_show_loading_ui);
bool to_different_document) {
contents_delegate_->LoadingStateChanged(source, to_different_document);
}
void AlloyBrowserHostImpl::CloseContents(content::WebContents* source) {
@@ -1225,13 +1217,6 @@ bool AlloyBrowserHostImpl::HandleContextMenu(
return HandleContextMenu(web_contents(), params);
}
void AlloyBrowserHostImpl::CanDownload(
const GURL& url,
const std::string& request_method,
base::OnceCallback<void(bool)> callback) {
contents_delegate_->CanDownload(url, request_method, std::move(callback));
}
KeyboardEventProcessingResult AlloyBrowserHostImpl::PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
@@ -1367,7 +1352,7 @@ bool AlloyBrowserHostImpl::HandleContextMenu(
void AlloyBrowserHostImpl::UpdatePreferredSize(content::WebContents* source,
const gfx::Size& pref_size) {
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC))
#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());
@@ -1463,13 +1448,15 @@ bool AlloyBrowserHostImpl::IsNeverComposited(
}
content::PictureInPictureResult AlloyBrowserHostImpl::EnterPictureInPicture(
content::WebContents* web_contents) {
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
if (!IsPictureInPictureSupported()) {
return content::PictureInPictureResult::kNotSupported;
}
return PictureInPictureWindowManager::GetInstance()
->EnterVideoPictureInPicture(web_contents);
return PictureInPictureWindowManager::GetInstance()->EnterPictureInPicture(
web_contents, surface_id, natural_size);
}
void AlloyBrowserHostImpl::ExitPictureInPicture() {
@@ -1482,8 +1469,7 @@ bool AlloyBrowserHostImpl::IsBackForwardCacheSupported() {
return false;
}
bool AlloyBrowserHostImpl::IsPrerender2Supported(
content::WebContents& web_contents) {
bool AlloyBrowserHostImpl::IsPrerender2Supported() {
return true;
}

View File

@@ -94,7 +94,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
void PrintToPDF(const CefString& path,
const CefPdfPrintSettings& settings,
CefRefPtr<CefPdfPrintCallback> callback) override;
void Find(const CefString& searchText,
void Find(int identifier,
const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) override;
@@ -211,7 +212,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
bool user_gesture,
bool* was_blocked) override;
void LoadingStateChanged(content::WebContents* source,
bool should_show_loading_ui) override;
bool to_different_document) override;
void CloseContents(content::WebContents* source) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
bool DidAddMessageToConsole(content::WebContents* source,
@@ -225,9 +226,6 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
bool TakeFocus(content::WebContents* source, bool reverse) override;
bool HandleContextMenu(content::RenderFrameHost& render_frame_host,
const content::ContextMenuParams& params) override;
void CanDownload(const GURL& url,
const std::string& request_method,
base::OnceCallback<void(bool)> callback) override;
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
@@ -286,10 +284,12 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
blink::mojom::MediaStreamType type) override;
bool IsNeverComposited(content::WebContents* web_contents) override;
content::PictureInPictureResult EnterPictureInPicture(
content::WebContents* web_contents) override;
content::WebContents* web_contents,
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
void ExitPictureInPicture() override;
bool IsBackForwardCacheSupported() override;
bool IsPrerender2Supported(content::WebContents& web_contents) override;
bool IsPrerender2Supported() override;
// content::WebContentsObserver methods.
using content::WebContentsObserver::BeforeUnloadFired;

View File

@@ -39,12 +39,9 @@
#include "third_party/widevine/cdm/buildflags.h"
#include "ui/base/resource/resource_bundle.h"
#if BUILDFLAG(IS_LINUX)
#include "ui/ozone/buildflags.h"
#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11)
#if defined(USE_AURA) && defined(USE_X11)
#include "ui/events/devices/x11/touch_factory_x11.h"
#endif
#endif
#if defined(USE_AURA)
#include "ui/aura/env.h"
@@ -52,14 +49,15 @@
#include "ui/views/widget/desktop_aura/desktop_screen.h"
#include "ui/wm/core/wm_state.h"
#if BUILDFLAG(IS_WIN)
#if defined(OS_WIN)
#include "chrome/browser/chrome_browser_main_win.h"
#include "chrome/browser/win/parental_controls.h"
#include "components/os_crypt/os_crypt.h"
#endif
#endif // defined(USE_AURA)
#if defined(TOOLKIT_VIEWS)
#if BUILDFLAG(IS_MAC)
#if defined(OS_MAC)
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_views_delegate.h"
#else
@@ -67,22 +65,13 @@
#endif
#endif // defined(TOOLKIT_VIEWS)
#if defined(USE_AURA) && BUILDFLAG(IS_LINUX)
#if defined(USE_AURA) && defined(OS_LINUX)
#include "ui/base/ime/init/input_method_initializer.h"
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
#include "components/os_crypt/os_crypt.h"
#endif
#if BUILDFLAG(IS_LINUX)
#include "base/path_service.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/grit/chromium_strings.h"
#include "components/os_crypt/key_storage_config_linux.h"
#if defined(OS_LINUX)
#include "libcef/browser/printing/print_dialog_linux.h"
#include "ui/base/l10n/l10n_util.h"
#endif // BUILDFLAG(IS_LINUX)
#endif
#if BUILDFLAG(ENABLE_MEDIA_FOUNDATION_WIDEVINE_CDM)
#include "chrome/browser/component_updater/media_foundation_widevine_cdm_component_installer.h"
@@ -93,15 +82,15 @@
#endif
AlloyBrowserMainParts::AlloyBrowserMainParts(
content::MainFunctionParams parameters)
: BrowserMainParts(), parameters_(std::move(parameters)) {}
const content::MainFunctionParams& parameters)
: BrowserMainParts(), devtools_delegate_(nullptr) {}
AlloyBrowserMainParts::~AlloyBrowserMainParts() {
constrained_window::SetConstrainedWindowViewsClient(nullptr);
}
int AlloyBrowserMainParts::PreEarlyInitialization() {
#if defined(USE_AURA) && BUILDFLAG(IS_LINUX)
#if defined(USE_AURA) && defined(OS_LINUX)
// TODO(linux): Consider using a real input method or
// views::LinuxUI::SetInstance.
ui::InitializeInputMethodForTesting();
@@ -119,7 +108,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
#endif // defined(USE_AURA)
#if defined(TOOLKIT_VIEWS)
#if BUILDFLAG(IS_MAC)
#if defined(OS_MAC)
views_delegate_ = std::make_unique<ChromeViewsDelegate>();
layout_provider_ = ChromeLayoutProvider::CreateLayoutProvider();
#else
@@ -129,13 +118,11 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
}
void AlloyBrowserMainParts::PreCreateMainMessageLoop() {
#if BUILDFLAG(IS_LINUX)
#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11)
#if defined(USE_AURA) && defined(USE_X11)
ui::TouchFactory::SetTouchDeviceListFromCommandLine();
#endif
#endif
#if BUILDFLAG(IS_WIN)
#if defined(OS_WIN)
// Initialize the OSCrypt.
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
@@ -145,44 +132,22 @@ void AlloyBrowserMainParts::PreCreateMainMessageLoop() {
// installer_util references strings that are normally compiled into
// setup.exe. In Chrome, these strings are in the locale files.
ChromeBrowserMainPartsWin::SetupInstallerUtilStrings();
#endif // BUILDFLAG(IS_WIN)
#endif // defined(OS_WIN)
media_router::ChromeMediaRouterFactory::DoPlatformInit();
}
void AlloyBrowserMainParts::PostCreateMainMessageLoop() {
#if BUILDFLAG(IS_LINUX)
#if defined(OS_LINUX)
printing::PrintingContextLinux::SetCreatePrintDialogFunction(
&CefPrintDialogLinux::CreatePrintDialog);
printing::PrintingContextLinux::SetPdfPaperSizeFunction(
&CefPrintDialogLinux::GetPdfPaperSize);
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
// Set up crypt config. This needs to be done before anything starts the
// network service, as the raw encryption key needs to be shared with the
// network service for encrypted cookie storage.
// Based on ChromeBrowserMainPartsLinux::PostCreateMainMessageLoop.
std::unique_ptr<os_crypt::Config> config =
std::make_unique<os_crypt::Config>();
// Forward to os_crypt the flag to use a specific password store.
config->store = command_line->GetSwitchValueASCII(switches::kPasswordStore);
// Forward the product name (defaults to "Chromium").
config->product_name = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME);
// OSCrypt may target keyring, which requires calls from the main thread.
config->main_thread_runner = content::GetUIThreadTaskRunner({});
// OSCrypt can be disabled in a special settings file.
config->should_use_preference =
command_line->HasSwitch(switches::kEnableEncryptionSelection);
base::PathService::Get(chrome::DIR_USER_DATA, &config->user_data_path);
DCHECK(!config->user_data_path.empty());
OSCrypt::SetConfig(std::move(config));
#endif // BUILDFLAG(IS_LINUX)
#endif
}
int AlloyBrowserMainParts::PreCreateThreads() {
#if BUILDFLAG(IS_WIN)
#if defined(OS_WIN)
PlatformInitialize();
#endif
@@ -235,7 +200,7 @@ int AlloyBrowserMainParts::PreMainMessageLoopRun() {
CefDevToolsManagerDelegate::StartHttpHandler(browser_context);
#if BUILDFLAG(IS_WIN)
#if defined(OS_WIN)
// Windows parental controls calls can be slow, so we do an early init here
// that calculates this value off of the UI thread.
InitializeWinParentalControls();
@@ -279,7 +244,7 @@ void AlloyBrowserMainParts::PostMainMessageLoopRun() {
void AlloyBrowserMainParts::PostDestroyThreads() {
#if defined(TOOLKIT_VIEWS)
views_delegate_.reset();
#if BUILDFLAG(IS_MAC)
#if defined(OS_MAC)
layout_provider_.reset();
#endif
#endif // defined(TOOLKIT_VIEWS)

View File

@@ -9,11 +9,15 @@
#include "libcef/browser/request_context_impl.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "build/build_config.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_main_parts.h"
#include "content/public/common/main_function_params.h"
namespace content {
struct MainFunctionParams;
}
#if defined(USE_AURA)
namespace display {
@@ -27,7 +31,7 @@ class WMState;
#if defined(TOOLKIT_VIEWS)
namespace views {
class ViewsDelegate;
#if BUILDFLAG(IS_MAC)
#if defined(OS_MAC)
class LayoutProvider;
#endif
} // namespace views
@@ -37,11 +41,7 @@ class CefDevToolsDelegate;
class AlloyBrowserMainParts : public content::BrowserMainParts {
public:
explicit AlloyBrowserMainParts(content::MainFunctionParams parameters);
AlloyBrowserMainParts(const AlloyBrowserMainParts&) = delete;
AlloyBrowserMainParts& operator=(const AlloyBrowserMainParts&) = delete;
explicit AlloyBrowserMainParts(const content::MainFunctionParams& parameters);
~AlloyBrowserMainParts() override;
int PreEarlyInitialization() override;
@@ -70,14 +70,12 @@ class AlloyBrowserMainParts : public content::BrowserMainParts {
}
private:
#if BUILDFLAG(IS_WIN)
#if defined(OS_WIN)
void PlatformInitialize();
#endif // BUILDFLAG(IS_WIN)
content::MainFunctionParams parameters_;
#endif // defined(OS_WIN)
CefRefPtr<CefRequestContextImpl> global_request_context_;
CefDevToolsDelegate* devtools_delegate_ = nullptr; // Deletes itself.
CefDevToolsDelegate* devtools_delegate_; // Deletes itself.
// Blocking task runners exposed via CefTaskRunner. For consistency with
// previous named thread behavior always execute all pending tasks before
@@ -94,10 +92,12 @@ class AlloyBrowserMainParts : public content::BrowserMainParts {
#if defined(TOOLKIT_VIEWS)
std::unique_ptr<views::ViewsDelegate> views_delegate_;
#if BUILDFLAG(IS_MAC)
#if defined(OS_MAC)
std::unique_ptr<views::LayoutProvider> layout_provider_;
#endif
#endif // defined(TOOLKIT_VIEWS)
DISALLOW_COPY_AND_ASSIGN(AlloyBrowserMainParts);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_

View File

@@ -5,7 +5,6 @@
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include <algorithm>
#include <tuple>
#include <utility>
#include "include/cef_version.h"
@@ -108,14 +107,13 @@
#include "content/public/common/storage_quota_params.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/user_agent.h"
#include "crypto/crypto_buildflags.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_message_filter.h"
#include "extensions/browser/extension_protocols.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_web_contents_observer.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/guest_view/extensions_guest_view.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"
@@ -143,22 +141,25 @@
#include "ui/base/ui_base_switches.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_MAC)
#include "net/ssl/client_cert_store_mac.h"
#include "services/video_capture/public/mojom/constants.mojom.h"
#elif BUILDFLAG(IS_POSIX)
#include "components/crash/core/app/crash_switches.h"
#include "components/crash/core/app/crashpad.h"
#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"
#include "components/crash/core/app/breakpad_linux.h"
#include "content/public/common/content_descriptors.h"
#include "libcef/common/crash_reporting.h"
#endif
#if BUILDFLAG(IS_WIN)
#if defined(OS_MAC)
#include "net/ssl/client_cert_store_mac.h"
#include "services/video_capture/public/mojom/constants.mojom.h"
#endif
#if defined(OS_WIN)
#include "net/ssl/client_cert_store_win.h"
#include "sandbox/win/src/sandbox_policy.h"
#endif
#if BUILDFLAG(USE_NSS_CERTS)
#if defined(USE_NSS_CERTS)
#include "net/ssl/client_cert_store_nss.h"
#endif
@@ -175,9 +176,6 @@ class CefQuotaCallbackImpl : public CefCallback {
explicit CefQuotaCallbackImpl(CallbackType callback)
: callback_(std::move(callback)) {}
CefQuotaCallbackImpl(const CefQuotaCallbackImpl&) = delete;
CefQuotaCallbackImpl& operator=(const CefQuotaCallbackImpl&) = delete;
~CefQuotaCallbackImpl() {
if (!callback_.is_null()) {
// The callback is still pending. Cancel it now.
@@ -194,7 +192,7 @@ class CefQuotaCallbackImpl : public CefCallback {
void Cancel() override { ContinueNow(false); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
private:
void ContinueNow(bool allow) {
@@ -219,21 +217,17 @@ class CefQuotaCallbackImpl : public CefCallback {
CallbackType callback_;
IMPLEMENT_REFCOUNTING(CefQuotaCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefQuotaCallbackImpl);
};
class CefAllowCertificateErrorCallbackImpl : public CefCallback {
public:
using CallbackType =
base::OnceCallback<void(content::CertificateRequestResultType)>;
typedef base::OnceCallback<void(content::CertificateRequestResultType)>
CallbackType;
explicit CefAllowCertificateErrorCallbackImpl(CallbackType callback)
: callback_(std::move(callback)) {}
CefAllowCertificateErrorCallbackImpl(
const CefAllowCertificateErrorCallbackImpl&) = delete;
CefAllowCertificateErrorCallbackImpl& operator=(
const CefAllowCertificateErrorCallbackImpl&) = delete;
~CefAllowCertificateErrorCallbackImpl() {
if (!callback_.is_null()) {
// The callback is still pending. Cancel it now.
@@ -252,7 +246,7 @@ class CefAllowCertificateErrorCallbackImpl : public CefCallback {
void Cancel() override { ContinueNow(false); }
[[nodiscard]] CallbackType Disconnect() { return std::move(callback_); }
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
private:
void ContinueNow(bool allow) {
@@ -278,6 +272,7 @@ class CefAllowCertificateErrorCallbackImpl : public CefCallback {
CallbackType callback_;
IMPLEMENT_REFCOUNTING(CefAllowCertificateErrorCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefAllowCertificateErrorCallbackImpl);
};
class CefSelectClientCertificateCallbackImpl
@@ -287,11 +282,6 @@ class CefSelectClientCertificateCallbackImpl
std::unique_ptr<content::ClientCertificateDelegate> delegate)
: delegate_(std::move(delegate)) {}
CefSelectClientCertificateCallbackImpl(
const CefSelectClientCertificateCallbackImpl&) = delete;
CefSelectClientCertificateCallbackImpl& operator=(
const CefSelectClientCertificateCallbackImpl&) = delete;
~CefSelectClientCertificateCallbackImpl() {
// If Select has not been called, call it with NULL to continue without any
// client certificate.
@@ -352,15 +342,12 @@ class CefSelectClientCertificateCallbackImpl
std::unique_ptr<content::ClientCertificateDelegate> delegate_;
IMPLEMENT_REFCOUNTING(CefSelectClientCertificateCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(CefSelectClientCertificateCallbackImpl);
};
class CefQuotaPermissionContext : public content::QuotaPermissionContext {
public:
CefQuotaPermissionContext() = default;
CefQuotaPermissionContext(const CefQuotaPermissionContext&) = delete;
CefQuotaPermissionContext& operator=(const CefQuotaPermissionContext&) =
delete;
CefQuotaPermissionContext() {}
// The callback will be dispatched on the IO thread.
void RequestQuotaPermission(const content::StorageQuotaParams& params,
@@ -402,19 +389,67 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
}
private:
~CefQuotaPermissionContext() override = default;
~CefQuotaPermissionContext() override {}
DISALLOW_COPY_AND_ASSIGN(CefQuotaPermissionContext);
};
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
int GetCrashSignalFD() {
if (!crash_reporting::Enabled())
#if defined(OS_POSIX) && !defined(OS_MAC)
breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost(
const std::string& process_type) {
base::FilePath dumps_path;
base::PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path);
{
ANNOTATE_SCOPED_MEMORY_LEAK;
// Uploads will only occur if a non-empty crash URL is specified in
// AlloyMainDelegate::InitCrashReporter.
breakpad::CrashHandlerHostLinux* crash_handler =
new breakpad::CrashHandlerHostLinux(process_type, dumps_path,
true /* upload */);
crash_handler->StartUploaderThread();
return crash_handler;
}
}
int GetCrashSignalFD(const base::CommandLine& command_line) {
if (!breakpad::IsCrashReporterEnabled())
return -1;
int fd;
pid_t pid;
return crash_reporter::GetHandlerSocket(&fd, &pid) ? fd : -1;
// Extensions have the same process type as renderers.
if (command_line.HasSwitch(extensions::switches::kExtensionProcess)) {
static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost("extension");
return crash_handler->GetDeathSignalSocket();
}
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
if (process_type == switches::kRendererProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket();
}
if (process_type == switches::kPpapiPluginProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket();
}
if (process_type == switches::kGpuProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket();
}
return -1;
}
#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
#endif // defined(OS_POSIX) && !defined(OS_MAC)
// From chrome/browser/plugins/chrome_content_browser_client_plugins_part.cc.
void BindPluginInfoHost(
@@ -460,8 +495,8 @@ AlloyContentBrowserClient::~AlloyContentBrowserClient() = default;
std::unique_ptr<content::BrowserMainParts>
AlloyContentBrowserClient::CreateBrowserMainParts(
content::MainFunctionParams parameters) {
browser_main_parts_ = new AlloyBrowserMainParts(std::move(parameters));
const content::MainFunctionParams& parameters) {
browser_main_parts_ = new AlloyBrowserMainParts(parameters);
return base::WrapUnique(browser_main_parts_);
}
@@ -472,6 +507,8 @@ void AlloyContentBrowserClient::RenderProcessWillLaunch(
if (extensions::ExtensionsEnabled()) {
host->AddFilter(new extensions::ExtensionMessageFilter(id, profile));
host->AddFilter(
new extensions::ExtensionsGuestViewMessageFilter(id, profile));
}
// If the renderer process crashes then the host may already have
@@ -526,6 +563,18 @@ bool AlloyContentBrowserClient::DoesSiteRequireDedicatedProcess(
browser_context, effective_site_url);
}
bool AlloyContentBrowserClient::ShouldLockProcessToSite(
content::BrowserContext* browser_context,
const GURL& effective_site_url) {
if (extensions::ExtensionsEnabled()) {
return extensions::ChromeContentBrowserClientExtensionsPart::
ShouldLockProcessToSite(browser_context, effective_site_url);
}
return content::ContentBrowserClient::ShouldLockProcessToSite(
browser_context, effective_site_url);
}
bool AlloyContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
base::StringPiece scheme,
bool is_embedded_origin_secure) {
@@ -582,7 +631,6 @@ void AlloyContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
additional_allowed_schemes);
additional_allowed_schemes->push_back(content::kChromeDevToolsScheme);
additional_allowed_schemes->push_back(content::kChromeUIScheme);
additional_allowed_schemes->push_back(content::kChromeUIUntrustedScheme);
}
bool AlloyContentBrowserClient::IsWebUIAllowedToMakeNetworkRequests(
@@ -679,7 +727,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
// associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {
switches::kDisablePackLoading,
#if BUILDFLAG(IS_MAC)
#if defined(OS_MAC)
switches::kFrameworkDirPath,
switches::kMainBundlePath,
#endif
@@ -690,7 +738,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kUserAgentProductAndVersion,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
base::size(kSwitchNames));
}
const std::string& process_type =
@@ -701,6 +749,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
static const char* const kSwitchNames[] = {
switches::kDisableExtensions,
switches::kDisablePdfExtension,
switches::kDisablePlugins,
switches::kDisablePrintPreview,
switches::kDisableScrollBounce,
switches::kDisableSpellChecking,
@@ -709,11 +758,19 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
network::switches::kUnsafelyTreatInsecureOriginAsSecure,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
base::size(kSwitchNames));
if (extensions::ExtensionsEnabled()) {
content::RenderProcessHost* process =
content::RenderProcessHost::FromID(child_process_id);
#if !defined(OS_WIN)
// kPdfRenderer will be set for Windows in
// RenderProcessHostImpl::AppendRendererCommandLine.
if (process && process->IsPdf()) {
command_line->AppendSwitch(switches::kPdfRenderer);
}
#endif // !defined(OS_WIN)
auto browser_context = process->GetBrowserContext();
CefBrowserContext* cef_browser_context =
process ? CefBrowserContext::FromBrowserContext(browser_context)
@@ -738,7 +795,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kLang,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
base::size(kSwitchNames));
}
// Necessary to populate DIR_USER_DATA in sub-processes.
@@ -748,7 +805,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir);
}
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
#if defined(OS_LINUX)
if (process_type == switches::kZygoteProcess) {
if (browser_cmd->HasSwitch(switches::kBrowserSubprocessPath)) {
// Force use of the sub-process executable path for the zygote process.
@@ -764,19 +821,9 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kLogFile,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
base::size(kSwitchNames));
}
if (crash_reporting::Enabled()) {
int fd;
pid_t pid;
if (crash_reporter::GetHandlerSocket(&fd, &pid)) {
command_line->AppendSwitchASCII(
crash_reporter::switches::kCrashpadHandlerPid,
base::NumberToString(pid));
}
}
#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
#endif // defined(OS_LINUX)
CefRefPtr<CefApp> app = CefAppManager::Get()->GetApplication();
if (app.get()) {
@@ -786,7 +833,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
CefRefPtr<CefCommandLineImpl> commandLinePtr(
new CefCommandLineImpl(command_line, false, false));
handler->OnBeforeChildProcessLaunch(commandLinePtr.get());
std::ignore = commandLinePtr->Detach(nullptr);
ignore_result(commandLinePtr->Detach(nullptr));
}
}
}
@@ -995,35 +1042,33 @@ AlloyContentBrowserClient::CreateDevToolsManagerDelegate() {
return std::make_unique<CefDevToolsManagerDelegate>();
}
void AlloyContentBrowserClient::
RegisterAssociatedInterfaceBindersForRenderFrameHost(
content::RenderFrameHost& render_frame_host,
blink::AssociatedInterfaceRegistry& associated_registry) {
associated_registry.AddInterface(base::BindRepeating(
[](content::RenderFrameHost* render_frame_host,
mojo::PendingAssociatedReceiver<extensions::mojom::LocalFrameHost>
receiver) {
extensions::ExtensionWebContentsObserver::BindLocalFrameHost(
std::move(receiver), render_frame_host);
},
&render_frame_host));
bool AlloyContentBrowserClient::BindAssociatedReceiverFromFrame(
content::RenderFrameHost* render_frame_host,
const std::string& interface_name,
mojo::ScopedInterfaceEndpointHandle* handle) {
if (interface_name == extensions::mojom::LocalFrameHost::Name_) {
extensions::ExtensionWebContentsObserver::BindLocalFrameHost(
mojo::PendingAssociatedReceiver<extensions::mojom::LocalFrameHost>(
std::move(*handle)),
render_frame_host);
return true;
}
if (interface_name == printing::mojom::PrintManagerHost::Name_) {
printing::CefPrintViewManager::BindPrintManagerHost(
mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost>(
std::move(*handle)),
render_frame_host);
return true;
}
if (interface_name == pdf::mojom::PdfService::Name_) {
pdf::PDFWebContentsHelper::BindPdfService(
mojo::PendingAssociatedReceiver<pdf::mojom::PdfService>(
std::move(*handle)),
render_frame_host);
return true;
}
associated_registry.AddInterface(base::BindRepeating(
[](content::RenderFrameHost* render_frame_host,
mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost>
receiver) {
printing::CefPrintViewManager::BindPrintManagerHost(std::move(receiver),
render_frame_host);
},
&render_frame_host));
associated_registry.AddInterface(base::BindRepeating(
[](content::RenderFrameHost* render_frame_host,
mojo::PendingAssociatedReceiver<pdf::mojom::PdfService> receiver) {
pdf::PDFWebContentsHelper::BindPdfService(std::move(receiver),
render_frame_host);
},
&render_frame_host));
return false;
}
std::vector<std::unique_ptr<content::NavigationThrottle>>
@@ -1093,17 +1138,17 @@ AlloyContentBrowserClient::WillCreateURLLoaderRequestInterceptors(
return interceptors;
}
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
#if defined(OS_LINUX)
void AlloyContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
content::PosixFileDescriptorInfo* mappings) {
int crash_signal_fd = GetCrashSignalFD();
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
mappings->Share(kCrashDumpSignal, crash_signal_fd);
}
}
#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
#endif // defined(OS_LINUX)
void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
service_manager::BinderRegistry* registry,
@@ -1115,10 +1160,6 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
if (extensions::ExtensionsEnabled()) {
associated_registry->AddInterface(base::BindRepeating(
&extensions::EventRouter::BindForRenderer, host->GetID()));
associated_registry->AddInterface(base::BindRepeating(
&extensions::ExtensionsGuestView::CreateForComponents, host->GetID()));
associated_registry->AddInterface(base::BindRepeating(
&extensions::ExtensionsGuestView::CreateForExtensions, host->GetID()));
}
CefBrowserManager::ExposeInterfacesToRenderer(registry, associated_registry,
@@ -1129,13 +1170,13 @@ std::unique_ptr<net::ClientCertStore>
AlloyContentBrowserClient::CreateClientCertStore(
content::BrowserContext* browser_context) {
// Match the logic in ProfileNetworkContextService::CreateClientCertStore.
#if BUILDFLAG(USE_NSS_CERTS)
#if defined(USE_NSS_CERTS)
// TODO: Add support for client implementation of crypto password dialog.
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(
net::ClientCertStoreNSS::PasswordDelegateFactory()));
#elif BUILDFLAG(IS_WIN)
#elif defined(OS_WIN)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
#elif BUILDFLAG(IS_MAC)
#elif defined(OS_MAC)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
#else
#error Unknown platform.
@@ -1176,7 +1217,6 @@ void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,
int render_frame_id,
const absl::optional<url::Origin>& request_initiator_origin,
NonNetworkURLLoaderFactoryMap* factories) {
if (!extensions::ExtensionsEnabled())
return;
@@ -1324,15 +1364,14 @@ AlloyContentBrowserClient::GetNetworkContextsParentDirectory() {
bool AlloyContentBrowserClient::HandleExternalProtocol(
const GURL& url,
content::WebContents::Getter web_contents_getter,
int child_id,
int frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,
bool is_main_frame,
network::mojom::WebSandboxFlags sandbox_flags,
ui::PageTransition page_transition,
bool has_user_gesture,
const absl::optional<url::Origin>& initiating_origin,
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
// Call the other HandleExternalProtocol variant.
return false;
@@ -1342,12 +1381,8 @@ bool AlloyContentBrowserClient::HandleExternalProtocol(
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,
network::mojom::WebSandboxFlags sandbox_flags,
const network::ResourceRequest& resource_request,
const absl::optional<url::Origin>& initiating_origin,
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver =
out_factory->InitWithNewPipeAndPassReceiver();
@@ -1363,29 +1398,19 @@ bool AlloyContentBrowserClient::HandleExternalProtocol(
web_contents_getter, std::move(receiver), std::move(request_handler));
return true;
}
std::unique_ptr<content::VideoOverlayWindow>
AlloyContentBrowserClient::CreateWindowForVideoPictureInPicture(
content::VideoPictureInPictureWindowController* controller) {
// Note: content::VideoOverlayWindow::Create() is defined by platform-specific
std::unique_ptr<content::OverlayWindow>
AlloyContentBrowserClient::CreateWindowForPictureInPicture(
content::PictureInPictureWindowController* controller) {
// Note: content::OverlayWindow::Create() is defined by platform-specific
// implementation in chrome/browser/ui/views. This layering hack, which goes
// through //content and ContentBrowserClient, allows us to work around the
// dependency constraints that disallow directly calling
// chrome/browser/ui/views code either from here or from other code in
// chrome/browser.
return content::VideoOverlayWindow::Create(controller);
return content::OverlayWindow::Create(controller);
}
std::unique_ptr<content::DocumentOverlayWindow>
AlloyContentBrowserClient::CreateWindowForDocumentPictureInPicture(
content::DocumentPictureInPictureWindowController* controller) {
// Note: content::DocumentOverlayWindow::Create() is defined by
// platform-specific implementation in chrome/browser/ui/views. This layering
// hack, which goes through //content and ContentBrowserClient, allows us to
// work around the dependency constraints that disallow directly calling
// chrome/browser/ui/views code either from here or from other code in
// chrome/browser.
return content::DocumentOverlayWindow::Create(controller);
}
void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) {
@@ -1422,7 +1447,7 @@ AlloyContentBrowserClient::GetSandboxedStorageServiceDataDirectory() {
}
std::string AlloyContentBrowserClient::GetProduct() {
return GetChromeProduct();
return embedder_support::GetProduct();
}
std::string AlloyContentBrowserClient::GetChromeProduct() {
@@ -1433,10 +1458,6 @@ std::string AlloyContentBrowserClient::GetUserAgent() {
return embedder_support::GetUserAgent();
}
std::string AlloyContentBrowserClient::GetFullUserAgent() {
return embedder_support::GetFullUserAgent();
}
std::string AlloyContentBrowserClient::GetReducedUserAgent() {
return embedder_support::GetReducedUserAgent();
}
@@ -1463,7 +1484,8 @@ AlloyContentBrowserClient::GetPluginMimeTypesWithExternalHandlers(
auto map = PluginUtils::GetMimeTypeToExtensionIdMap(browser_context);
for (const auto& pair : map)
mime_types.insert(pair.first);
mime_types.insert(pdf::kInternalPluginMimeType);
if (pdf::IsInternalPluginExternallyHandled())
mime_types.insert(pdf::kInternalPluginMimeType);
return mime_types;
}
@@ -1488,23 +1510,12 @@ bool AlloyContentBrowserClient::ShouldAllowPluginCreation(
return true;
}
void AlloyContentBrowserClient::OnWebContentsCreated(
content::WebContents* web_contents) {
// Attach universal WebContentsObservers. These are quite rare, and in most
// cases CefBrowserPlatformDelegateAlloy::BrowserCreated and/or
// CefExtensionsAPIClient::AttachWebContentsHelpers should be used instead.
if (extensions::ExtensionsEnabled()) {
extensions::CefExtensionWebContentsObserver::CreateForWebContents(
web_contents);
}
}
bool AlloyContentBrowserClient::IsFindInPageDisabledForOrigin(
const url::Origin& origin) {
// For PDF viewing with the PPAPI-free PDF Viewer, find-in-page should only
// display results from the PDF content, and not from the UI.
return IsPdfExtensionOrigin(origin);
return base::FeatureList::IsEnabled(chrome_pdf::features::kPdfUnseasoned) &&
IsPdfExtensionOrigin(origin);
}
CefRefPtr<CefRequestContextImpl> AlloyContentBrowserClient::request_context()

View File

@@ -12,6 +12,7 @@
#include "include/cef_request_context_handler.h"
#include "libcef/browser/request_context_impl.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "content/public/browser/content_browser_client.h"
@@ -35,7 +36,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
// ContentBrowserClient implementation.
std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(
content::MainFunctionParams parameters) override;
const content::MainFunctionParams& parameters) override;
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
const GURL& site_url) override;
@@ -43,6 +44,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
const GURL& site_url) override;
bool DoesSiteRequireDedicatedProcess(content::BrowserContext* browser_context,
const GURL& effective_site_url) override;
bool ShouldLockProcessToSite(content::BrowserContext* browser_context,
const GURL& effective_site_url) override;
bool ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
base::StringPiece scheme,
bool is_embedded_origin_secure) override;
@@ -117,9 +120,10 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
std::unique_ptr<content::DevToolsManagerDelegate>
CreateDevToolsManagerDelegate() override;
void RegisterAssociatedInterfaceBindersForRenderFrameHost(
content::RenderFrameHost& render_frame_host,
blink::AssociatedInterfaceRegistry& associated_registry) override;
bool BindAssociatedReceiverFromFrame(
content::RenderFrameHost* render_frame_host,
const std::string& interface_name,
mojo::ScopedInterfaceEndpointHandle* handle) override;
std::vector<std::unique_ptr<content::NavigationThrottle>>
CreateThrottlesForNavigation(
content::NavigationHandle* navigation_handle) override;
@@ -137,7 +141,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
const scoped_refptr<network::SharedURLLoaderFactory>&
network_loader_factory) override;
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
#if defined(OS_LINUX)
void GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
@@ -166,7 +170,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
void RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,
int render_frame_id,
const absl::optional<url::Origin>& request_initiator_origin,
NonNetworkURLLoaderFactoryMap* factories) override;
bool WillCreateURLLoaderFactory(
content::BrowserContext* browser_context,
@@ -195,35 +198,26 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
bool HandleExternalProtocol(
const GURL& url,
content::WebContents::Getter web_contents_getter,
int child_id,
int frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,
bool is_main_frame,
network::mojom::WebSandboxFlags sandbox_flags,
ui::PageTransition page_transition,
bool has_user_gesture,
const absl::optional<url::Origin>& initiating_origin,
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
override;
bool HandleExternalProtocol(
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,
network::mojom::WebSandboxFlags sandbox_flags,
const network::ResourceRequest& request,
const absl::optional<url::Origin>& initiating_origin,
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
override;
std::unique_ptr<content::VideoOverlayWindow>
CreateWindowForVideoPictureInPicture(
content::VideoPictureInPictureWindowController* controller) override;
std::unique_ptr<content::DocumentOverlayWindow>
CreateWindowForDocumentPictureInPicture(
content::DocumentPictureInPictureWindowController* controller) override;
std::unique_ptr<content::OverlayWindow> CreateWindowForPictureInPicture(
content::PictureInPictureWindowController* controller) override;
void RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) override;
@@ -231,7 +225,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
std::string GetProduct() override;
std::string GetChromeProduct() override;
std::string GetUserAgent() override;
std::string GetFullUserAgent() override;
std::string GetReducedUserAgent() override;
blink::UserAgentMetadata GetUserAgentMetadata() override;
base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(
@@ -244,7 +237,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
bool ShouldAllowPluginCreation(
const url::Origin& embedder_origin,
const content::PepperPluginInfo& plugin_info) override;
void OnWebContentsCreated(content::WebContents* web_contents) override;
bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override;
CefRefPtr<CefRequestContextImpl> request_context() const;

View File

@@ -5,8 +5,6 @@
#include "libcef/browser/alloy/alloy_dialog_util.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/extensions/browser_extensions_util.h"
#include "libcef/browser/file_dialog_runner.h"
#include "base/strings/utf_string_conversions.h"
@@ -15,12 +13,9 @@ namespace alloy {
void RunFileChooser(content::WebContents* web_contents,
const blink::mojom::FileChooserParams& params,
RunFileChooserCallback callback) {
CefRefPtr<AlloyBrowserHostImpl> browser = static_cast<AlloyBrowserHostImpl*>(
extensions::GetOwnerBrowserForHost(web_contents->GetRenderViewHost(),
nullptr)
.get());
CefRefPtr<AlloyBrowserHostImpl> browser =
AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
if (!browser) {
LOG(ERROR) << "Failed to identify browser; canceling file dialog";
std::move(callback).Run(-1, {});
return;
}
@@ -36,9 +31,9 @@ void RunFileChooser(content::WebContents* web_contents,
// Based on net/base/filename_util_internal.cc FilePathToString16().
std::u16string FilePathTypeToString16(const base::FilePath::StringType& str) {
std::u16string result;
#if BUILDFLAG(IS_WIN)
#if defined(OS_WIN)
result.assign(str.begin(), str.end());
#elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
if (!str.empty()) {
base::UTF8ToUTF16(str.c_str(), str.size(), &result);
}

View File

@@ -17,17 +17,13 @@
#include "base/logging.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/printing/print_view_manager_common.h"
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
#include "components/find_in_page/find_tab_helper.h"
#include "components/find_in_page/find_types.h"
#include "components/zoom/zoom_controller.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "extensions/browser/process_manager.h"
#include "pdf/pdf_features.h"
#include "printing/mojom/print.mojom.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
@@ -112,7 +108,6 @@ void CefBrowserPlatformDelegateAlloy::WebContentsCreated(
content::WebContents* web_contents,
bool owned) {
CefBrowserPlatformDelegate::WebContentsCreated(web_contents, owned);
find_in_page::FindTabHelper::CreateForWebContents(web_contents);
if (owned) {
SetOwnedWebContents(web_contents);
@@ -184,6 +179,9 @@ void CefBrowserPlatformDelegateAlloy::BrowserCreated(
printing::CefPrintViewManager::CreateForWebContents(web_contents_);
if (extensions::ExtensionsEnabled()) {
extensions::CefExtensionWebContentsObserver::CreateForWebContents(
web_contents_);
// Used by the tabs extension API.
zoom::ZoomController::CreateForWebContents(web_contents_);
}
@@ -259,13 +257,16 @@ void CefBrowserPlatformDelegateAlloy::SendCaptureLostEvent() {
widget->LostCapture();
}
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC))
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
void CefBrowserPlatformDelegateAlloy::NotifyMoveOrResizeStarted() {
if (!web_contents_)
if (!browser_)
return;
// Dismiss any existing popups.
web_contents_->ClearFocusedElement();
auto frame = browser_->GetMainFrame();
if (frame && frame->IsValid()) {
static_cast<CefFrameHostImpl*>(frame.get())->NotifyMoveOrResizeStarted();
}
}
#endif
@@ -340,30 +341,33 @@ void CefBrowserPlatformDelegateAlloy::SetAccessibilityState(
bool CefBrowserPlatformDelegateAlloy::IsPrintPreviewSupported() const {
REQUIRE_ALLOY_RUNTIME();
// Print preview is not currently supported with OSR.
if (IsWindowless())
auto actionable_contents = GetActionableWebContents();
if (!actionable_contents)
return false;
auto cef_browser_context =
CefBrowserContext::FromBrowserContext(web_contents_->GetBrowserContext());
return cef_browser_context->IsPrintPreviewSupported();
auto cef_browser_context = CefBrowserContext::FromBrowserContext(
actionable_contents->GetBrowserContext());
if (!cef_browser_context->IsPrintPreviewSupported()) {
return false;
}
// Print preview is not currently supported with OSR.
return !IsWindowless();
}
void CefBrowserPlatformDelegateAlloy::Print() {
REQUIRE_ALLOY_RUNTIME();
auto contents_to_use = printing::GetWebContentsToUse(web_contents_);
if (!contents_to_use)
auto actionable_contents = GetActionableWebContents();
if (!actionable_contents)
return;
auto rfh_to_use = printing::GetRenderFrameHostToUse(contents_to_use);
if (!rfh_to_use)
return;
auto rfh = actionable_contents->GetMainFrame();
if (IsPrintPreviewSupported()) {
GetPrintViewManager(contents_to_use)->PrintPreviewNow(rfh_to_use, false);
GetPrintViewManager(actionable_contents)->PrintPreviewNow(rfh, false);
} else {
GetPrintViewManager(contents_to_use)->PrintNow(rfh_to_use);
GetPrintViewManager(actionable_contents)->PrintNow(rfh);
}
}
@@ -373,65 +377,50 @@ void CefBrowserPlatformDelegateAlloy::PrintToPDF(
CefRefPtr<CefPdfPrintCallback> callback) {
REQUIRE_ALLOY_RUNTIME();
auto contents_to_use = printing::GetWebContentsToUse(web_contents_);
if (!contents_to_use)
content::WebContents* actionable_contents = GetActionableWebContents();
if (!actionable_contents)
return;
auto rfh_to_use = printing::GetRenderFrameHostToUse(contents_to_use);
if (!rfh_to_use)
return;
printing::CefPrintViewManager::PdfPrintCallback pdf_callback;
if (callback.get()) {
pdf_callback = base::BindOnce(&CefPdfPrintCallback::OnPdfPrintFinished,
callback.get(), path);
}
GetPrintViewManager(contents_to_use)
->PrintToPDF(rfh_to_use, base::FilePath(path), settings,
std::move(pdf_callback));
GetPrintViewManager(actionable_contents)
->PrintToPDF(actionable_contents->GetMainFrame(), base::FilePath(path),
settings, std::move(pdf_callback));
}
void CefBrowserPlatformDelegateAlloy::Find(const CefString& searchText,
void CefBrowserPlatformDelegateAlloy::Find(int identifier,
const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) {
if (!web_contents_)
return;
find_in_page::FindTabHelper::FromWebContents(web_contents_)
->StartFinding(searchText.ToString16(), forward, matchCase, findNext,
/*run_synchronously_for_testing=*/false);
// Every find request must have a unique ID and these IDs must strictly
// increase so that newer requests always have greater IDs than older
// requests.
if (identifier <= find_request_id_counter_)
identifier = ++find_request_id_counter_;
else
find_request_id_counter_ = identifier;
auto options = blink::mojom::FindOptions::New();
options->forward = forward;
options->match_case = matchCase;
options->find_match = findNext;
web_contents_->Find(identifier, searchText, std::move(options));
}
void CefBrowserPlatformDelegateAlloy::StopFinding(bool clearSelection) {
if (!web_contents_)
return;
last_search_result_ = find_in_page::FindNotificationDetails();
find_in_page::FindTabHelper::FromWebContents(web_contents_)
->StopFinding(clearSelection ? find_in_page::SelectionAction::kClear
: find_in_page::SelectionAction::kKeep);
}
bool CefBrowserPlatformDelegateAlloy::HandleFindReply(
int request_id,
int number_of_matches,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) {
if (!web_contents_)
return false;
auto find_in_page =
find_in_page::FindTabHelper::FromWebContents(web_contents_);
find_in_page->HandleFindReply(request_id, number_of_matches, selection_rect,
active_match_ordinal, final_update);
if (!(find_in_page->find_result() == last_search_result_)) {
last_search_result_ = find_in_page->find_result();
return true;
}
return false;
content::StopFindAction action =
clearSelection ? content::STOP_FIND_ACTION_CLEAR_SELECTION
: content::STOP_FIND_ACTION_KEEP_SELECTION;
web_contents_->StopFinding(action);
}
base::RepeatingClosure
@@ -443,6 +432,17 @@ CefBrowserPlatformDelegateAlloy::GetBoundsChangedCallback() {
return base::RepeatingClosure();
}
content::WebContents*
CefBrowserPlatformDelegateAlloy::GetActionableWebContents() const {
if (web_contents_ && extensions::ExtensionsEnabled()) {
content::WebContents* guest_contents =
extensions::GetFullPageGuestForOwnerContents(web_contents_);
if (guest_contents)
return guest_contents;
}
return web_contents_;
}
void CefBrowserPlatformDelegateAlloy::SetOwnedWebContents(
content::WebContents* owned_contents) {
DCHECK(primary_);

View File

@@ -10,18 +10,12 @@
#include "libcef/browser/web_contents_dialog_helper.h"
#include "base/memory/weak_ptr.h"
#include "components/find_in_page/find_notification_details.h"
#include "content/public/browser/web_contents.h"
#include "ui/gfx/geometry/size.h"
// Implementation of Alloy-based browser functionality.
class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
public:
CefBrowserPlatformDelegateAlloy(const CefBrowserPlatformDelegateAlloy&) =
delete;
CefBrowserPlatformDelegateAlloy& operator=(
const CefBrowserPlatformDelegateAlloy&) = delete;
content::WebContents* CreateWebContents(CefBrowserCreateParams& create_params,
bool& own_web_contents) override;
void WebContentsCreated(content::WebContents* web_contents,
@@ -44,7 +38,7 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
extensions::ExtensionHost* GetExtensionHost() const override;
void BrowserDestroyed(CefBrowserHostBase* browser) override;
void SendCaptureLostEvent() override;
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC))
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC))
void NotifyMoveOrResizeStarted() override;
#endif
bool PreHandleGestureEvent(content::WebContents* source,
@@ -59,28 +53,24 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
void PrintToPDF(const CefString& path,
const CefPdfPrintSettings& settings,
CefRefPtr<CefPdfPrintCallback> callback) override;
void Find(const CefString& searchText,
void Find(int identifier,
const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) override;
void StopFinding(bool clearSelection) override;
// Called from AlloyBrowserHostImpl::FindReply().
bool HandleFindReply(int request_id,
int number_of_matches,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update);
const find_in_page::FindNotificationDetails& last_search_result() const {
return last_search_result_;
}
protected:
CefBrowserPlatformDelegateAlloy();
base::RepeatingClosure GetBoundsChangedCallback();
// Returns the WebContents most likely to handle an action. If extensions are
// enabled and this browser has a full-page guest (for example, a full-page
// PDF viewer extension) then the guest's WebContents will be returned.
// Otherwise, the browser's WebContents will be returned.
content::WebContents* GetActionableWebContents() const;
// Called from BrowserPlatformDelegateNative::set_windowless_handler().
void set_as_secondary() { primary_ = false; }
@@ -101,9 +91,8 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
// Used for the print preview dialog.
std::unique_ptr<CefWebContentsDialogHelper> web_contents_dialog_helper_;
// The last find result. This object contains details about the number of
// matches, the find selection rectangle, etc.
find_in_page::FindNotificationDetails last_search_result_;
// Used to provide unique incremental IDs for each find request.
int find_request_id_counter_ = 0;
// Used when the browser is hosting an extension.
extensions::ExtensionHost* extension_host_ = nullptr;
@@ -119,6 +108,8 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate {
bool primary_ = true;
base::WeakPtrFactory<CefBrowserPlatformDelegateAlloy> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegateAlloy);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_BROWSER_PLATFORM_DELEGATE_ALLOY_H_

View File

@@ -160,6 +160,11 @@ ChromeBrowserProcessAlloy::network_quality_tracker() {
return nullptr;
}
WatchDogThread* ChromeBrowserProcessAlloy::watchdog_thread() {
NOTREACHED();
return nullptr;
}
ProfileManager* ChromeBrowserProcessAlloy::profile_manager() {
DCHECK(context_initialized_);
return profile_manager_.get();
@@ -329,12 +334,18 @@ ChromeBrowserProcessAlloy::subresource_filter_ruleset_service() {
return nullptr;
}
federated_learning::FlocSortingLshClustersService*
ChromeBrowserProcessAlloy::floc_sorting_lsh_clusters_service() {
NOTREACHED();
return nullptr;
}
StartupData* ChromeBrowserProcessAlloy::startup_data() {
NOTREACHED();
return nullptr;
}
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
#if defined(OS_WIN) || defined(OS_LINUX)
void ChromeBrowserProcessAlloy::StartAutoupdateTimer() {}
#endif
@@ -354,7 +365,7 @@ ChromeBrowserProcessAlloy::component_updater() {
component_updater::MakeChromeComponentUpdaterConfigurator(
base::CommandLine::ForCurrentProcess(),
g_browser_process->local_state()),
std::move(scheduler), /*brand=*/std::string());
std::move(scheduler));
return component_updater_.get();
}
@@ -403,12 +414,6 @@ ChromeBrowserProcessAlloy::serial_policy_allowed_ports() {
return nullptr;
}
HidPolicyAllowedDevices*
ChromeBrowserProcessAlloy::hid_policy_allowed_devices() {
NOTREACHED();
return nullptr;
}
breadcrumbs::BreadcrumbPersistentStorageManager*
ChromeBrowserProcessAlloy::GetBreadcrumbPersistentStorageManager() {
NOTREACHED();

View File

@@ -12,6 +12,7 @@
#include <memory>
#include <string>
#include "base/compiler_specific.h"
#include "base/metrics/field_trial.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/event_router_forwarder.h"
@@ -27,21 +28,15 @@ class ChromeProfileManagerAlloy;
class BackgroundModeManager {
public:
BackgroundModeManager();
BackgroundModeManager(const BackgroundModeManager&) = delete;
BackgroundModeManager& operator=(const BackgroundModeManager&) = delete;
virtual ~BackgroundModeManager();
private:
DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager);
};
class ChromeBrowserProcessAlloy : public BrowserProcess {
public:
ChromeBrowserProcessAlloy();
ChromeBrowserProcessAlloy(const ChromeBrowserProcessAlloy&) = delete;
ChromeBrowserProcessAlloy& operator=(const ChromeBrowserProcessAlloy&) =
delete;
~ChromeBrowserProcessAlloy() override;
void Initialize();
@@ -56,6 +51,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
metrics::MetricsService* metrics_service() override;
SystemNetworkContextManager* system_network_context_manager() override;
network::NetworkQualityTracker* network_quality_tracker() override;
WatchDogThread* watchdog_thread() override;
ProfileManager* profile_manager() override;
PrefService* local_state() override;
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory()
@@ -90,9 +86,11 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
subresource_filter::RulesetService* subresource_filter_ruleset_service()
override;
federated_learning::FlocSortingLshClustersService*
floc_sorting_lsh_clusters_service() override;
StartupData* startup_data() override;
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
#if defined(OS_WIN) || defined(OS_LINUX)
void StartAutoupdateTimer() override;
#endif
@@ -106,7 +104,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
override;
BuildState* GetBuildState() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
HidPolicyAllowedDevices* hid_policy_allowed_devices() override;
breadcrumbs::BreadcrumbPersistentStorageManager*
GetBreadcrumbPersistentStorageManager() override;
@@ -134,6 +131,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
std::unique_ptr<base::FieldTrialList> field_trial_list_;
std::unique_ptr<component_updater::ComponentUpdateService> component_updater_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProcessAlloy);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_

View File

@@ -108,6 +108,10 @@ const Profile* ChromeProfileAlloy::GetOriginalProfile() const {
return this;
}
bool ChromeProfileAlloy::IsSupervised() const {
return false;
}
bool ChromeProfileAlloy::IsChild() const {
return false;
}

View File

@@ -16,10 +16,6 @@
class ChromeProfileAlloy : public Profile {
public:
ChromeProfileAlloy();
ChromeProfileAlloy(const ChromeProfileAlloy&) = delete;
ChromeProfileAlloy& operator=(const ChromeProfileAlloy&) = delete;
~ChromeProfileAlloy() override;
protected:
@@ -39,6 +35,7 @@ class ChromeProfileAlloy : public Profile {
bool HasAnyOffTheRecordProfile() override;
Profile* GetOriginalProfile() override;
const Profile* GetOriginalProfile() const override;
bool IsSupervised() const override;
bool IsChild() const override;
ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override;
bool IsSameOrParent(Profile* profile) override;
@@ -54,6 +51,8 @@ class ChromeProfileAlloy : public Profile {
private:
std::unique_ptr<variations::VariationsClient> variations_client_;
DISALLOW_COPY_AND_ASSIGN(ChromeProfileAlloy);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_

View File

@@ -14,15 +14,13 @@
class ChromeProfileManagerAlloy : public ProfileManager {
public:
ChromeProfileManagerAlloy();
ChromeProfileManagerAlloy(const ChromeProfileManagerAlloy&) = delete;
ChromeProfileManagerAlloy& operator=(const ChromeProfileManagerAlloy&) =
delete;
~ChromeProfileManagerAlloy() override;
Profile* GetProfile(const base::FilePath& profile_dir) override;
bool IsValidProfile(const void* profile) override;
private:
DISALLOW_COPY_AND_ASSIGN(ChromeProfileManagerAlloy);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_MANAGER_ALLOY_H_

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