@@ -104,13 +104,12 @@ group("gn_all") {
"//url:url_unittests",
]
- deps += [ "//ohos_nweb:libnweb_adapter" ]
-
#ifdef OHOS_NWEB_EX
if (defined(ohos_nweb_ex) && ohos_nweb_ex) {
deps += [
"//ohos_browser_shell",
"//ohos_nweb_ex/browser_service",
+ "//ohos_nweb_ex/test:ohos_nweb_ex_unittests",
"//ohos_nweb_hap",
]
} # endif // OHOS_NWEB_EX
@@ -985,6 +985,19 @@ _BANNED_CPP_FUNCTIONS = (
r'^base[\\/]win[\\/]scoped_winrt_initializer\.cc$'
),
),
+ (
+ r'\bchartorune\b',
+ (
+ 'chartorune is not memory-safe, unless you can guarantee the input ',
+ 'string is always null-terminated. Otherwise, please use charntorune ',
+ 'from libphonenumber instead.'
+ ),
+ True,
+ [
+ _THIRD_PARTY_EXCEPT_BLINK,
+ # Exceptions to this rule should have a fuzzer.
+ ],
+ ),
)
# Format: Sequence of tuples containing:
@@ -570,12 +570,6 @@ bool ExecutableExistsInPath(Environment* env,
#if !BUILDFLAG(IS_APPLE)
// This is implemented in file_util_mac.mm for Mac.
bool GetTempDir(FilePath* path) {
- const char* tmp = getenv("TMPDIR");
- if (tmp) {
- *path = FilePath(tmp);
- return true;
- }
-
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_OHOS)
return PathService::Get(DIR_CACHE, path);
#else
@@ -28,7 +28,20 @@ bool MemoryMappedFile::Region::operator!=(
}
MemoryMappedFile::~MemoryMappedFile() {
+#if BUILDFLAG(IS_OHOS)
+ if (!customizeData_) {
+ CloseHandles();
+ return;
+ }
+
+ if (data_) {
+ delete [] data_;
+ data_ = nullptr;
+ }
+ length_ = 0;
+#else
CloseHandles();
+#endif
}
#if !BUILDFLAG(IS_NACL)
@@ -111,6 +111,17 @@ class BASE_EXPORT MemoryMappedFile {
// Is file_ a valid file handle that points to an open, memory mapped file?
bool IsValid() const;
+#if BUILDFLAG(IS_OHOS)
+ void SetDataAndLength(std::unique_ptr<uint8_t[]> &data, size_t length) {
+ if (IsValid() && !customizeData_) {
+ CloseHandles();
+ }
+ customizeData_ = true;
+ data_ = data.release();
+ length_ = length;
+ }
+#endif
+
private:
// Given the arbitrarily aligned memory region [start, size], returns the
// boundaries of the region aligned to the granularity specified by the OS,
@@ -140,6 +151,9 @@ class BASE_EXPORT MemoryMappedFile {
File file_;
uint8_t* data_;
size_t length_;
+#if BUILDFLAG(IS_OHOS)
+ bool customizeData_ = false;
+#endif
#if BUILDFLAG(IS_WIN)
win::ScopedHandle file_mapping_;
@@ -57,6 +57,12 @@
#include "third_party/icu/source/i18n/unicode/timezone.h"
#endif
+#if BUILDFLAG(IS_OHOS)
+#include "base/command_line.h"
+#include "content/public/common/content_switches.h"
+#include "ohos_adapter_helper.h"
+#endif
+
namespace base {
namespace i18n {
@@ -265,6 +271,34 @@ int LoadIcuData(PlatformFile data_fd,
return 0;
}
+#if BUILDFLAG(IS_OHOS)
+const char kIcuDataFileNameHap[] = "resources/rawfile/icudtl.dat";
+int LoadIcuDataByHap(PlatformFile data_fd,
+ const MemoryMappedFile::Region& data_region,
+ std::unique_ptr<MemoryMappedFile>* out_mapped_data_file,
+ UErrorCode* out_error_code) {
+ size_t length = 0;
+ std::unique_ptr<uint8_t[]> data;
+ auto resourceInstance = OHOS::NWeb::OhosAdapterHelper::GetInstance().GetResourceAdapter();
+ if (!resourceInstance->GetRawFileData(kIcuDataFileNameHap, length, data, true)) {
+ LOG(ERROR) << "Couldn't mmap icu data file by hap: " << kIcuDataFileNameHap;
+ return 1;
+ }
+
+ *out_mapped_data_file = std::make_unique<MemoryMappedFile>();
+ (*out_error_code) = U_ZERO_ERROR;
+ InitializeExternalTimeZoneData();
+ (*out_mapped_data_file)->SetDataAndLength(data, length);
+ LOG(INFO) << "icu data file length: " << length;
+ udata_setCommonData(const_cast<uint8_t*>((*out_mapped_data_file)->data()), out_error_code);
+ if (U_FAILURE(*out_error_code)) {
+ LOG(ERROR) << "Failed to initialize ICU with data file: " << u_errorName(*out_error_code);
+ return 3;
+ }
+ return 0;
+}
+#endif
+
bool InitializeICUWithFileDescriptorInternal(
PlatformFile data_fd,
const MemoryMappedFile::Region& data_region) {
@@ -276,7 +310,15 @@ bool InitializeICUWithFileDescriptorInternal(
std::unique_ptr<MemoryMappedFile> mapped_file;
UErrorCode err;
+#if BUILDFLAG(IS_OHOS)
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kOhosHapPath)) {
+ g_debug_icu_load = LoadIcuDataByHap(data_fd, data_region, &mapped_file, &err);
+ } else {
+ g_debug_icu_load = LoadIcuData(data_fd, data_region, &mapped_file, &err);
+ }
+#else
g_debug_icu_load = LoadIcuData(data_fd, data_region, &mapped_file, &err);
+#endif
if (g_debug_icu_load == 1 || g_debug_icu_load == 2) {
return false;
}
@@ -298,7 +340,7 @@ bool InitializeICUFromDataFile() {
// cause any problems.
LazyOpenIcuDataFile();
bool result =
- InitializeICUWithFileDescriptorInternal(g_icudtl_pf, g_icudtl_region);
+ InitializeICUWithFileDescriptorInternal(g_icudtl_pf, g_icudtl_region);
#if BUILDFLAG(IS_WIN)
int debug_icu_load = g_debug_icu_load;
@@ -146,7 +146,7 @@ namespace {
VlogInfo* g_vlog_info = nullptr;
VlogInfo* g_vlog_info_prev = nullptr;
-const char* const log_severity_names[] = {"INFO", "WARNING", "ERROR", "FATAL"};
+const char* const log_severity_names[] = {"INFO", "WARNING", "ERROR", "FATAL", "DEBUG"};
static_assert(LOGGING_NUM_SEVERITIES == base::size(log_severity_names),
"Incorrect number of log_severity_names");
@@ -850,6 +850,8 @@ LogMessage::~LogMessage() {
case LOGGING_FATAL:
priority = LogLevel::LOG_FATAL;
break;
+ case LOGGING_DEBUG:
+ priority = LogLevel::LOG_DEBUG;
}
const char kOHOSLogTag[] = "chromium";
HiLogPrintOHOS(LOG_CORE, priority, 0xD004500, kOHOSLogTag, str_newline.c_str());
@@ -359,7 +359,8 @@ constexpr LogSeverity LOGGING_INFO = 0;
constexpr LogSeverity LOGGING_WARNING = 1;
constexpr LogSeverity LOGGING_ERROR = 2;
constexpr LogSeverity LOGGING_FATAL = 3;
-constexpr LogSeverity LOGGING_NUM_SEVERITIES = 4;
+constexpr LogSeverity LOGGING_DEBUG = 4;
+constexpr LogSeverity LOGGING_NUM_SEVERITIES = 5;
// LOGGING_DFATAL is LOGGING_FATAL in DCHECK-enabled builds, ERROR in normal
// mode.
@@ -373,6 +374,7 @@ constexpr LogSeverity LOGGING_DFATAL = LOGGING_ERROR;
// from LOG_FOO to LOGGING_FOO.
// TODO(thestig): Convert existing users to LOGGING_FOO and remove this block.
constexpr LogSeverity LOG_VERBOSE = LOGGING_VERBOSE;
+constexpr LogSeverity LOG_DEBUG = LOGGING_DEBUG;
constexpr LogSeverity LOG_INFO = LOGGING_INFO;
constexpr LogSeverity LOG_WARNING = LOGGING_WARNING;
constexpr LogSeverity LOG_ERROR = LOGGING_ERROR;
@@ -382,6 +384,9 @@ constexpr LogSeverity LOG_DFATAL = LOGGING_DFATAL;
// 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_DEBUG(ClassName, ...) \
+ ::logging::ClassName(__FILE__, __LINE__, ::logging::LOGGING_DEBUG, \
+ ##__VA_ARGS__)
#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \
::logging::ClassName(__FILE__, __LINE__, ::logging::LOGGING_INFO, \
##__VA_ARGS__)
@@ -401,6 +406,7 @@ constexpr LogSeverity LOG_DFATAL = LOGGING_DFATAL;
::logging::ClassName(__FILE__, __LINE__, ::logging::LOGGING_DCHECK, \
##__VA_ARGS__)
+#define COMPACT_GOOGLE_LOG_DEBUG COMPACT_GOOGLE_LOG_EX_DEBUG(LogMessage)
#define COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(LogMessage)
#define COMPACT_GOOGLE_LOG_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage)
#define COMPACT_GOOGLE_LOG_ERROR COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage)
@@ -238,7 +238,7 @@ config("default_include_dirs") {
# the executable they are loaded into, so they are unresolved at link-time.
config("no_unresolved_symbols") {
if (!using_sanitizer &&
- (is_linux || is_chromeos || is_android || is_fuchsia)) {
+ (is_linux || is_chromeos || is_android || is_fuchsia || is_ohos)) {
ldflags = [
"-Wl,-z,defs",
"-Wl,--as-needed",
@@ -692,6 +692,10 @@ config("compiler") {
# TODO(thakis): Check if '=0' (that is, number of cores, instead
# of "all" which means number of hardware threads) is faster.
ldflags += [ "-Wl,--thinlto-jobs=all" ]
+ if (is_ohos && !use_musl) {
+ ldflags -= [ "-Wl,--thinlto-jobs=all" ]
+ ldflags += [ "-Wl,--thinlto-jobs=8" ]
+ }
if (is_mac) {
ldflags +=
[ "-Wl,-cache_path_lto," +
@@ -720,7 +724,7 @@ config("compiler") {
}
# TODO(https://crbug.com/1211155): investigate why this isn't effective on arm32.
- if ((!is_android && !is_ohos) || current_cpu == "arm64") {
+ if (!is_android || current_cpu == "arm64") {
cflags += [ "-fwhole-program-vtables" ]
if (!is_win) {
ldflags += [ "-fwhole-program-vtables" ]
@@ -74,7 +74,7 @@ declare_args() {
use_thin_lto =
is_cfi ||
(is_clang && is_official_build && chrome_pgo_phase != 1 &&
- (is_linux || is_win || is_mac ||
+ (is_linux || is_win || is_mac || is_ohos ||
(is_android && target_os != "chromeos") ||
((is_chromeos_ash || is_chromeos_lacros) && is_chromeos_device)))
@@ -259,7 +259,11 @@ config("runtime_library") {
}
config("lld_pack_relocations") {
- ldflags = [ "-Wl,--pack-dyn-relocs=android" ]
+ if (use_musl) {
+ ldflags = [ "-Wl,--pack-dyn-relocs=relr" ]
+ } else {
+ ldflags = [ "-Wl,--pack-dyn-relocs=android" ]
+ }
}
# Used for instrumented build to generate the orderfile.
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/cxx17_backports.h"
+#include "base/logging.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/scroll_node.h"
@@ -12,6 +12,10 @@
#include "cc/layers/layer.h"
#include "cc/layers/layer_impl.h"
#include "cc/trees/layer_tree_settings.h"
+#if BUILDFLAG(IS_OHOS)
+#include "display_manager_adapter.h"
+#include "ohos_adapter_helper.h"
+#endif
namespace cc {
@@ -115,6 +119,13 @@ class CC_EXPORT ScrollbarLayerImplBase : public LayerImpl {
ScrollbarOrientation orientation_;
bool is_left_side_vertical_scrollbar_;
+#if BUILDFLAG(IS_OHOS)
+ std::unique_ptr<OHOS::NWeb::DisplayManagerAdapter> display_manager_adapter_ =
+ nullptr;
+ float initial_layout_size_ratio_ = 2.0f;
+ void SetInitalLayoutRatio();
+#endif
+
// Difference between the clip layer's height and the visible viewport
// height (which may differ in the presence of top-controls hiding).
float vertical_adjust_;
@@ -249,7 +249,7 @@ if (is_linux) {
# Set ENABLE_PRINTING=1 ENABLE_BASIC_PRINTING=1.
assert(enable_basic_printing)
-assert(enable_print_preview)
+assert(enable_print_preview || is_ohos)
# Enable support for Widevine CDM.
assert(enable_widevine || is_ohos)
@@ -259,6 +259,13 @@ if (is_clang) {
assert(!clang_use_chrome_plugins)
}
+if (is_ohos) {
+ import("//pdf/features.gni")
+ declare_args() {
+ ohos_enable_cef_chrome_runtime = false
+ }
+}
+
#
# Local variables.
#
@@ -449,6 +456,8 @@ static_library("libcef_static") {
"libcef/browser/browser_platform_delegate_create.cc",
"libcef/browser/browser_util.cc",
"libcef/browser/browser_util.h",
+ "libcef/browser/navigation_state_serializer.cc",
+ "libcef/browser/navigation_state_serializer.h",
"libcef/browser/chrome/browser_delegate.h",
"libcef/browser/chrome/browser_platform_delegate_chrome.cc",
"libcef/browser/chrome/browser_platform_delegate_chrome.h",
@@ -863,6 +872,75 @@ static_library("libcef_static") {
"//third_party/crashpad/crashpad",
]
+ if (defined(ohos_enable_cef_chrome_runtime) &&
+ !ohos_enable_cef_chrome_runtime) {
+ sources -= [
+ "//chrome/app/chrome_main_delegate.cc",
+ "//chrome/app/chrome_main_delegate.h",
+ "libcef/browser/chrome/browser_delegate.h",
+ "libcef/browser/chrome/browser_platform_delegate_chrome.cc",
+ "libcef/browser/chrome/browser_platform_delegate_chrome.h",
+ "libcef/browser/chrome/chrome_browser_context.cc",
+ "libcef/browser/chrome/chrome_browser_context.h",
+ "libcef/browser/chrome/chrome_browser_delegate.cc",
+ "libcef/browser/chrome/chrome_browser_delegate.h",
+ "libcef/browser/chrome/chrome_browser_host_impl.cc",
+ "libcef/browser/chrome/chrome_browser_host_impl.h",
+ "libcef/browser/chrome/chrome_browser_main_extra_parts_cef.cc",
+ "libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h",
+ "libcef/browser/chrome/chrome_content_browser_client_cef.cc",
+ "libcef/browser/chrome/chrome_content_browser_client_cef.h",
+ "libcef/browser/chrome/chrome_context_menu_handler.cc",
+ "libcef/browser/chrome/chrome_context_menu_handler.h",
+ "libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.cc",
+ "libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.h",
+ "libcef/browser/chrome_crash_reporter_client_stub.cc",
+ "libcef/browser/net/chrome_scheme_handler.cc",
+ "libcef/browser/net/chrome_scheme_handler.h",
+ "libcef/common/chrome/chrome_content_client_cef.cc",
+ "libcef/common/chrome/chrome_content_client_cef.h",
+ "libcef/common/chrome/chrome_main_delegate_cef.cc",
+ "libcef/common/chrome/chrome_main_delegate_cef.h",
+ "libcef/common/chrome/chrome_main_runner_delegate.cc",
+ "libcef/common/chrome/chrome_main_runner_delegate.h",
+ "libcef/renderer/chrome/chrome_content_renderer_client_cef.cc",
+ "libcef/renderer/chrome/chrome_content_renderer_client_cef.h",
+ ]
+ }
+
+ if (is_ohos && !enable_print_preview) {
+ sources -= [
+ "libcef/browser/printing/constrained_window_views_client.cc",
+ "libcef/browser/printing/constrained_window_views_client.h",
+ "libcef/browser/printing/print_view_manager.cc",
+ "libcef/browser/printing/print_view_manager.h",
+ "libcef/renderer/extensions/print_render_frame_helper_delegate.cc",
+ "libcef/renderer/extensions/print_render_frame_helper_delegate.h",
+ ]
+ }
+
+ if (is_ohos && !enable_plugins) {
+ sources -= [
+ "libcef/browser/web_plugin_impl.cc",
+ "libcef/browser/web_plugin_impl.h",
+ ]
+ }
+
+ if (is_ohos && !ohos_enable_media_router) {
+ sources -= [
+ "libcef/browser/media_router/media_route_impl.cc",
+ "libcef/browser/media_router/media_route_impl.h",
+ "libcef/browser/media_router/media_router_impl.cc",
+ "libcef/browser/media_router/media_router_impl.h",
+ "libcef/browser/media_router/media_router_manager.cc",
+ "libcef/browser/media_router/media_router_manager.h",
+ "libcef/browser/media_router/media_sink_impl.cc",
+ "libcef/browser/media_router/media_sink_impl.h",
+ "libcef/browser/media_router/media_source_impl.cc",
+ "libcef/browser/media_router/media_source_impl.h",
+ ]
+ }
+
public_deps = [
# Bring in feature flag defines.
"//cef/libcef/features",
@@ -974,6 +1052,42 @@ static_library("libcef_static") {
"//v8",
]
+ if (defined(ohos_enable_cef_chrome_runtime) &&
+ !ohos_enable_cef_chrome_runtime) {
+ deps -= [
+ "//chrome:packed_resources",
+ "//chrome:resources",
+ "//chrome:strings",
+ "//chrome/services/printing:lib",
+ ]
+ }
+
+ if (is_ohos && !enable_print_preview) {
+ deps -= [
+ "//components/printing/browser",
+ "//components/printing/common",
+ "//components/printing/renderer",
+ "//components/services/print_compositor/public/cpp",
+ "//components/services/print_compositor/public/mojom",
+ ]
+ }
+
+ if (is_ohos && !enable_plugins) {
+ deps -= [ "//components/plugins/renderer" ]
+ }
+
+ if (is_ohos && !enable_pdf) {
+ deps -= [
+ "//components/pdf/browser",
+ "//components/pdf/renderer",
+ "//pdf",
+ ]
+ }
+
+ if (is_ohos && !ohos_enable_media_router) {
+ deps -= [ "//components/media_router/common/mojom:media_router" ]
+ }
+
if (defined(ohos_nweb_ex) && ohos_nweb_ex) {
deps += [ "//ohos_nweb_ex/overrides/cef" ]
}
@@ -1113,7 +1227,7 @@ static_library("libcef_static") {
deps += [ "//tools/v8_context_snapshot" ]
}
- if (toolkit_views || is_ohos) {
+ if (toolkit_views) {
sources += [
"libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc",
"libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h",
@@ -1330,6 +1444,58 @@ static_library("libcef_static") {
"libcef_dll/views_stub.cc",
]
}
+
+ if (is_ohos) {
+ sources += [
+ "libcef/browser/chrome/views/chrome_views_util.cc",
+ "libcef/browser/chrome/views/chrome_views_util.h",
+ "libcef/browser/views/view_util.cc",
+ "libcef/browser/views/view_util.h",
+ ]
+
+ if (use_aura) {
+ sources += [
+ "libcef/browser/native/browser_platform_delegate_native_aura.cc",
+ "libcef/browser/native/browser_platform_delegate_native_aura.h",
+ "libcef/browser/views/view_util_aura.cc",
+
+ # Part of //ui/views:test_support which is testingonly.
+ "//ui/views/test/desktop_test_views_delegate_aura.cc",
+ "//ui/views/test/test_views_delegate_aura.cc",
+
+ # Support for UI input events.
+ # Part of //ui/base:test_support which is testingonly.
+ "//ui/aura/test/ui_controls_factory_aura.h",
+ "//ui/base/test/ui_controls_aura.cc",
+ ]
+
+ deps += [
+ "//ui/aura",
+ "//ui/wm",
+ "//ui/wm/public",
+ ]
+
+ if (is_ohos) {
+ sources += [
+ # Support for UI input events.
+ # Part of //ui/aura:test_support which is testingonly.
+ "//ui/aura/test/aura_test_utils.cc",
+ "//ui/aura/test/aura_test_utils.h",
+
+ # Part of //ui/events:test_support which is testingonly.
+ # "//ui/events/test/x11_event_waiter.cc",
+ # "//ui/events/test/x11_event_waiter.h",
+ ]
+
+ deps += [
+ "//ui/events",
+ "//ui/strings",
+ "//ui/views",
+ "//ui/views/controls/webview",
+ ]
+ }
+ }
+ }
}
#
@@ -1519,7 +1685,27 @@ make_pack_header("resources") {
"//ui/resources:webui_resources_grd",
]
- if (toolkit_views || is_ohos) {
+ if (defined(ohos_enable_cef_chrome_runtime) &&
+ !ohos_enable_cef_chrome_runtime) {
+ inputs -= [
+ "$root_gen_dir/chrome/grit/browser_resources.h",
+ "$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",
+ ]
+ deps -= [
+ "//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",
+ ]
+ }
+
+ if (toolkit_views) {
inputs += [ "$root_gen_dir/ui/views/resources/grit/views_resources.h" ]
deps += [ "//ui/views/resources:resources_grd" ]
}
@@ -1561,6 +1747,22 @@ make_pack_header("strings") {
"//ui/strings:app_locale_settings",
"//ui/strings:ui_strings",
]
+
+ if (defined(ohos_enable_cef_chrome_runtime) &&
+ !ohos_enable_cef_chrome_runtime) {
+ inputs -= [
+ "$root_gen_dir/chrome/grit/chromium_strings.h",
+ "$root_gen_dir/chrome/grit/generated_resources.h",
+ "$root_gen_dir/chrome/grit/locale_settings.h",
+ "$root_gen_dir/chrome/grit/platform_locale_settings.h",
+ ]
+ deps -= [
+ "//chrome/app:chromium_strings",
+ "//chrome/app:generated_resources",
+ "//chrome/app/resources:locale_settings",
+ "//chrome/app/resources:platform_locale_settings",
+ ]
+ }
}
# Generate cef_api_hash.h.
@@ -1753,6 +1955,18 @@ if (is_mac) {
ldflags = [ "-Wl,--version-script=" +
rebase_path("//cef/libcef_dll/libcef.lst") ]
}
+
+ if (is_ohos) {
+ deps += [ "//ohos_nweb:nweb_sources" ]
+ if (defined(ohos_nweb_ex) && ohos_nweb_ex) {
+ deps += [ "//ohos_nweb_ex:nweb_ex" ]
+ }
+ configs += [ "//build/config/ohos:lld_pack_relocations" ]
+ if (!(defined(testonly) && testonly)) {
+ configs -= [ "//build/config/compiler:thinlto_optimize_default" ]
+ configs += [ "//build/config/compiler:thinlto_optimize_max" ]
+ }
+ }
}
}
@@ -1,4 +1,4 @@
-# Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+# Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
#
@@ -8,7 +8,7 @@
# by hand. See the translator.README.txt file in the tools directory for
# more information.
#
-# $hash=6509e4ab15ca15cfbe46f0e54693db2dcb590810$
+# $hash=c0184bbfa08d5b1a2168f3886235203d2fa5b758$
#
{
@@ -48,7 +48,6 @@
'include/cef_keyboard_handler.h',
'include/cef_life_span_handler.h',
'include/cef_load_handler.h',
- 'include/cef_media_router.h',
'include/cef_menu_model.h',
'include/cef_menu_model_delegate.h',
'include/cef_navigation_entry.h',
@@ -86,7 +85,6 @@
'include/cef_v8.h',
'include/cef_values.h',
'include/cef_waitable_event.h',
- 'include/cef_web_plugin.h',
'include/cef_web_storage.h',
'include/cef_x509_certificate.h',
'include/cef_xml_reader.h',
@@ -150,7 +148,6 @@
'include/capi/cef_keyboard_handler_capi.h',
'include/capi/cef_life_span_handler_capi.h',
'include/capi/cef_load_handler_capi.h',
- 'include/capi/cef_media_router_capi.h',
'include/capi/cef_menu_model_capi.h',
'include/capi/cef_menu_model_delegate_capi.h',
'include/capi/cef_navigation_entry_capi.h',
@@ -188,7 +185,6 @@
'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_web_storage_capi.h',
'include/capi/cef_x509_certificate_capi.h',
'include/capi/cef_xml_reader_capi.h',
@@ -348,20 +344,6 @@
'libcef_dll/cpptoc/list_value_cpptoc.h',
'libcef_dll/ctocpp/load_handler_ctocpp.cc',
'libcef_dll/ctocpp/load_handler_ctocpp.h',
- 'libcef_dll/ctocpp/media_observer_ctocpp.cc',
- 'libcef_dll/ctocpp/media_observer_ctocpp.h',
- 'libcef_dll/cpptoc/media_route_cpptoc.cc',
- 'libcef_dll/cpptoc/media_route_cpptoc.h',
- 'libcef_dll/ctocpp/media_route_create_callback_ctocpp.cc',
- 'libcef_dll/ctocpp/media_route_create_callback_ctocpp.h',
- 'libcef_dll/cpptoc/media_router_cpptoc.cc',
- 'libcef_dll/cpptoc/media_router_cpptoc.h',
- 'libcef_dll/cpptoc/media_sink_cpptoc.cc',
- 'libcef_dll/cpptoc/media_sink_cpptoc.h',
- 'libcef_dll/ctocpp/media_sink_device_info_callback_ctocpp.cc',
- 'libcef_dll/ctocpp/media_sink_device_info_callback_ctocpp.h',
- 'libcef_dll/cpptoc/media_source_cpptoc.cc',
- 'libcef_dll/cpptoc/media_source_cpptoc.h',
'libcef_dll/cpptoc/views/menu_button_cpptoc.cc',
'libcef_dll/cpptoc/views/menu_button_cpptoc.h',
'libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc',
@@ -452,6 +434,8 @@
'libcef_dll/cpptoc/views/scroll_view_cpptoc.h',
'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc',
'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h',
+ 'libcef_dll/cpptoc/select_popup_callback_cpptoc.cc',
+ 'libcef_dll/cpptoc/select_popup_callback_cpptoc.h',
'libcef_dll/cpptoc/server_cpptoc.cc',
'libcef_dll/cpptoc/server_cpptoc.h',
'libcef_dll/ctocpp/server_handler_ctocpp.cc',
@@ -528,12 +512,8 @@
'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/ctocpp/web_message_receiver_ctocpp.cc',
+ 'libcef_dll/ctocpp/web_message_receiver_ctocpp.h',
'libcef_dll/cpptoc/web_storage_cpptoc.cc',
'libcef_dll/cpptoc/web_storage_cpptoc.h',
'libcef_dll/cpptoc/views/window_cpptoc.cc',
@@ -682,20 +662,6 @@
'libcef_dll/ctocpp/list_value_ctocpp.h',
'libcef_dll/cpptoc/load_handler_cpptoc.cc',
'libcef_dll/cpptoc/load_handler_cpptoc.h',
- 'libcef_dll/cpptoc/media_observer_cpptoc.cc',
- 'libcef_dll/cpptoc/media_observer_cpptoc.h',
- 'libcef_dll/ctocpp/media_route_ctocpp.cc',
- 'libcef_dll/ctocpp/media_route_ctocpp.h',
- 'libcef_dll/cpptoc/media_route_create_callback_cpptoc.cc',
- 'libcef_dll/cpptoc/media_route_create_callback_cpptoc.h',
- 'libcef_dll/ctocpp/media_router_ctocpp.cc',
- 'libcef_dll/ctocpp/media_router_ctocpp.h',
- 'libcef_dll/ctocpp/media_sink_ctocpp.cc',
- 'libcef_dll/ctocpp/media_sink_ctocpp.h',
- 'libcef_dll/cpptoc/media_sink_device_info_callback_cpptoc.cc',
- 'libcef_dll/cpptoc/media_sink_device_info_callback_cpptoc.h',
- 'libcef_dll/ctocpp/media_source_ctocpp.cc',
- 'libcef_dll/ctocpp/media_source_ctocpp.h',
'libcef_dll/ctocpp/views/menu_button_ctocpp.cc',
'libcef_dll/ctocpp/views/menu_button_ctocpp.h',
'libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc',
@@ -786,6 +752,8 @@
'libcef_dll/ctocpp/views/scroll_view_ctocpp.h',
'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc',
'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h',
+ 'libcef_dll/ctocpp/select_popup_callback_ctocpp.cc',
+ 'libcef_dll/ctocpp/select_popup_callback_ctocpp.h',
'libcef_dll/ctocpp/server_ctocpp.cc',
'libcef_dll/ctocpp/server_ctocpp.h',
'libcef_dll/cpptoc/server_handler_cpptoc.cc',
@@ -862,12 +830,8 @@
'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/cpptoc/web_message_receiver_cpptoc.cc',
+ 'libcef_dll/cpptoc/web_message_receiver_cpptoc.h',
'libcef_dll/ctocpp/web_storage_ctocpp.cc',
'libcef_dll/ctocpp/web_storage_ctocpp.h',
'libcef_dll/ctocpp/views/window_ctocpp.cc',
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=306e44d49ab6198a0fa1bcea50e8a25ee18672be$
+// $hash=5dc54f9c45e2a1df857f114a11c97509da95db34$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=adfba3dd6479b96a95639c13ee1e07bed7b335d0$
+// $hash=7713ef16c0c137b67ad926fafe2dfae35d187b48$
//
#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=fd8d34089842ee8f8490ef1828c3091d12052e28$
+// $hash=dca41618f6b4b8c5623912b0637918ab10c61846$
//
#ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=0938c1802b077b2b17708c6a8ee305984e079d64$
+// $hash=5b63adedf123da2990eef1445830f221e557ce95$
//
#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=e13b741eb5cb983fde79d62937d9eb8a55dd6ebb$
+// $hash=097fc69d7b712dde294d45394bc0eff518a34689$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
@@ -59,6 +59,7 @@ struct _cef_browser_host_t;
struct _cef_client_t;
struct _cef_java_script_result_callback_t;
struct _cef_store_web_archive_result_callback_t;
+struct _cef_web_message_receiver_t;
///
// Structure used to represent a browser. When used in the browser process the
@@ -864,7 +865,7 @@ typedef struct _cef_browser_host_t {
///
void(CEF_CALLBACK* post_port_message)(struct _cef_browser_host_t* self,
cef_string_t* port_handle,
- cef_string_t* data);
+ struct _cef_value_t* message);
///
// Set the callback of the port.
@@ -872,7 +873,7 @@ typedef struct _cef_browser_host_t {
void(CEF_CALLBACK* set_port_message_callback)(
struct _cef_browser_host_t* self,
cef_string_t* port_handle,
- struct _cef_java_script_result_callback_t* callback);
+ struct _cef_web_message_receiver_t* callback);
///
// Gets the latest hitdata
@@ -1195,6 +1196,65 @@ typedef struct _cef_browser_host_t {
///
void(CEF_CALLBACK* remove_cache)(struct _cef_browser_host_t* self,
int include_disk_files);
+
+ ///
+ // Scroll page up or down
+ ///
+ void(CEF_CALLBACK* scroll_page_up_down)(struct _cef_browser_host_t* self,
+ int is_up,
+ int is_half,
+ float view_height);
+
+ ///
+ // Get web history state
+ ///
+ struct _cef_binary_value_t*(CEF_CALLBACK* get_web_state)(
+ struct _cef_browser_host_t* self);
+
+ ///
+ // Restore web history state
+ ///
+ int(CEF_CALLBACK* restore_web_state)(struct _cef_browser_host_t* self,
+ struct _cef_binary_value_t* state);
+
+ ///
+ // Scroll to the position.
+ ///
+ void(CEF_CALLBACK* scroll_to)(struct _cef_browser_host_t* self,
+ float x,
+ float y);
+
+ ///
+ // Scroll by the delta distance.
+ ///
+ void(CEF_CALLBACK* scroll_by)(struct _cef_browser_host_t* self,
+ float delta_x,
+ float delta_y);
+
+ ///
+ // Slide Scroll by the speed.
+ ///
+ void(CEF_CALLBACK* slide_scroll)(struct _cef_browser_host_t* self,
+ float vx,
+ float vy);
+
+ ///
+ // Set whether webview can access files
+ ///
+ void(CEF_CALLBACK* set_file_access)(struct _cef_browser_host_t* self,
+ int falg);
+
+ ///
+ // Set whether webview can access network
+ ///
+ void(CEF_CALLBACK* set_block_network)(struct _cef_browser_host_t* self,
+ int falg);
+
+ ///
+ // Set the cache mode of webview
+ ///
+ void(CEF_CALLBACK* set_cache_mode)(struct _cef_browser_host_t* self,
+ int falg);
} cef_browser_host_t;
///
@@ -1269,6 +1329,23 @@ typedef struct _cef_store_web_archive_result_callback_t {
const cef_string_t* result);
} cef_store_web_archive_result_callback_t;
+///
+// Structure to implement to be notified of asynchronous web message channel.
+///
+typedef struct _cef_web_message_receiver_t {
+ ///
+ // Base structure.
+ ///
+ cef_base_ref_counted_t base;
+
+ ///
+ // Method that will be called upon |PostPortMessage|. |message| will be sent
+ // to another end of web message channel.
+ ///
+ void(CEF_CALLBACK* on_message)(struct _cef_web_message_receiver_t* self,
+ struct _cef_value_t* message);
+} cef_web_message_receiver_t;
+
#ifdef __cplusplus
}
#endif
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=8c97f9b58c642c144cc37824ad820192640307cb$
+// $hash=e56e9d7bc7bd7d42f768a845cb3dc8ead6475fcd$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=6dabadb8090f82aa929beda6f4724bac4cd17020$
+// $hash=a48ae6711d03e12ddfe94aa3b54a46fbd41bd179$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=d69368574610ae29c8b17bf71174c237fb01ca28$
+// $hash=100836d9c768fb63da4c355cb0571e34d0c6a8dd$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
@@ -76,133 +76,137 @@ typedef struct _cef_client_t {
///
// Return the handler for audio rendering events.
///
- struct _cef_audio_handler_t *(CEF_CALLBACK *get_audio_handler)(
- struct _cef_client_t *self);
+ struct _cef_audio_handler_t*(CEF_CALLBACK* get_audio_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for context menus. If no handler is provided the default
// implementation will be used.
///
- struct _cef_context_menu_handler_t *(CEF_CALLBACK *get_context_menu_handler)(
- struct _cef_client_t *self);
+ struct _cef_context_menu_handler_t*(CEF_CALLBACK* get_context_menu_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for dialogs. If no handler is provided the default
// implementation will be used.
///
- struct _cef_dialog_handler_t *(CEF_CALLBACK *get_dialog_handler)(
- struct _cef_client_t *self);
+ struct _cef_dialog_handler_t*(CEF_CALLBACK* get_dialog_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for browser display state events.
///
- struct _cef_display_handler_t *(CEF_CALLBACK *get_display_handler)(
- struct _cef_client_t *self);
+ struct _cef_display_handler_t*(CEF_CALLBACK* get_display_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for download events. If no handler is returned downloads
// will not be allowed.
///
- struct _cef_download_handler_t *(CEF_CALLBACK *get_download_handler)(
- struct _cef_client_t *self);
+ struct _cef_download_handler_t*(CEF_CALLBACK* get_download_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for drag events.
///
- struct _cef_drag_handler_t *(CEF_CALLBACK *get_drag_handler)(
- struct _cef_client_t *self);
+ struct _cef_drag_handler_t*(CEF_CALLBACK* get_drag_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for find result events.
///
- struct _cef_find_handler_t *(CEF_CALLBACK *get_find_handler)(
- struct _cef_client_t *self);
+ struct _cef_find_handler_t*(CEF_CALLBACK* get_find_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for focus events.
///
- struct _cef_focus_handler_t *(CEF_CALLBACK *get_focus_handler)(
- struct _cef_client_t *self);
+ struct _cef_focus_handler_t*(CEF_CALLBACK* get_focus_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for events related to cef_frame_t lifespan. This
// function will be called once during cef_browser_t creation and the result
// will be cached for performance reasons.
///
- struct _cef_frame_handler_t *(CEF_CALLBACK *get_frame_handler)(
- struct _cef_client_t *self);
+ struct _cef_frame_handler_t*(CEF_CALLBACK* get_frame_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for JavaScript dialogs. If no handler is provided the
// default implementation will be used.
///
- struct _cef_jsdialog_handler_t *(CEF_CALLBACK *get_jsdialog_handler)(
- struct _cef_client_t *self);
+ struct _cef_jsdialog_handler_t*(CEF_CALLBACK* get_jsdialog_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for keyboard events.
///
- struct _cef_keyboard_handler_t *(CEF_CALLBACK *get_keyboard_handler)(
- struct _cef_client_t *self);
+ struct _cef_keyboard_handler_t*(CEF_CALLBACK* get_keyboard_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for browser life span events.
///
- struct _cef_life_span_handler_t *(CEF_CALLBACK *get_life_span_handler)(
- struct _cef_client_t *self);
+ struct _cef_life_span_handler_t*(CEF_CALLBACK* get_life_span_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for browser load status events.
///
- struct _cef_load_handler_t *(CEF_CALLBACK *get_load_handler)(
- struct _cef_client_t *self);
+ struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for printing on Linux. If a print handler is not
// provided then printing will not be supported on the Linux platform.
///
- struct _cef_print_handler_t *(CEF_CALLBACK *get_print_handler)(
- struct _cef_client_t *self);
+ struct _cef_print_handler_t*(CEF_CALLBACK* get_print_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for off-screen rendering events.
///
- struct _cef_render_handler_t *(CEF_CALLBACK *get_render_handler)(
- struct _cef_client_t *self);
+ struct _cef_render_handler_t*(CEF_CALLBACK* get_render_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for browser request events.
///
- struct _cef_request_handler_t *(CEF_CALLBACK *get_request_handler)(
- struct _cef_client_t *self);
+ struct _cef_request_handler_t*(CEF_CALLBACK* get_request_handler)(
+ struct _cef_client_t* self);
///
// Return the handler for browser geolocation permission request events.
///
- struct _cef_permission_request_t *(CEF_CALLBACK *get_permission_request)(
- struct _cef_client_t *self);
+ struct _cef_permission_request_t*(CEF_CALLBACK* get_permission_request)(
+ struct _cef_client_t* self);
///
// Called when a new message is received from a different process. Return true
// (1) if the message was handled or false (0) otherwise. It is safe to keep
// a reference to |message| outside of this callback.
///
- int(CEF_CALLBACK *on_process_message_received)(
- struct _cef_client_t *self, struct _cef_browser_t *browser,
- struct _cef_frame_t *frame, cef_process_id_t source_process,
- struct _cef_process_message_t *message);
+ int(CEF_CALLBACK* on_process_message_received)(
+ struct _cef_client_t* self,
+ struct _cef_browser_t* browser,
+ struct _cef_frame_t* frame,
+ cef_process_id_t source_process,
+ struct _cef_process_message_t* message);
///
// Returns the list of arguments NotifyJavaScriptResult.
///
- int(CEF_CALLBACK *notify_java_script_result)(
- struct _cef_client_t *self, struct _cef_list_value_t *args,
- const cef_string_t *method, const cef_string_t *object_name,
- struct _cef_list_value_t *result);
+ int(CEF_CALLBACK* notify_java_script_result)(
+ struct _cef_client_t* self,
+ struct _cef_list_value_t* args,
+ const cef_string_t* method,
+ const cef_string_t* object_name,
+ struct _cef_list_value_t* result);
} cef_client_t;
#ifdef __cplusplus
}
#endif
-#endif // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
+#endif // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=93f3d769c0d48ed6e1d91ad8a8e2f95d4ee54287$
+// $hash=deb97d81f206e08a6f78510e7f8f1985aef98ff0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=07baaa2ecbddce012a9ef020766e4cb40ff8b9b0$
+// $hash=351828c559518eeefb3b74bb24558ae51a49f2a5$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
@@ -373,6 +373,20 @@ typedef struct _cef_context_menu_params_t {
// items).
///
int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self);
+
+ ///
+ // Returns the input field type of context node that the context menu was
+ // invoked on.
+ ///
+ cef_context_menu_input_field_type_t(CEF_CALLBACK* get_input_field_type)(
+ struct _cef_context_menu_params_t* self);
+
+ ///
+ // Returns the source type of context node that the context menu was invoked
+ // on.
+ ///
+ cef_context_menu_source_type_t(CEF_CALLBACK* get_source_type)(
+ struct _cef_context_menu_params_t* self);
} cef_context_menu_params_t;
#ifdef __cplusplus
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=76bce0d14b3cfcc4afb47d59936e4f2e0932566b$
+// $hash=fcda5b9ec03f8bae722fa681f0cde144caf6c929$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=0460e68eb7d1b1188706c42d14beafbf9a6f7126$
+// $hash=dd437f3b8022c0c92074a0d1d9aa5b2cef40e109$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=d2a63576b59c75e748b5a725af9a4337414c82b9$
+// $hash=99bb61cf23fa49b4a7ce08c77d0c98980bc07a1f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DATA_BASE_CAPI_H_
@@ -78,11 +78,12 @@ typedef struct _cef_data_base_t {
///
// get http auth data by host and realm.
///
- void(CEF_CALLBACK* get_http_auth_credentials)(
- struct _cef_data_base_t* self,
- const cef_string_t* host,
- const cef_string_t* realm,
- cef_string_list_t username_password);
+ void(CEF_CALLBACK* get_http_auth_credentials)(struct _cef_data_base_t* self,
+ const cef_string_t* host,
+ const cef_string_t* realm,
+ cef_string_t* username,
+ char* password,
+ uint32_t passwordSize);
///
// gets whether the instance holds the specified permissions for the specified
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=ec62239c2b24ff512b64ca758be825ff57fb3b6b$
+// $hash=bd660c767a942fc27ea2ede0343e029ac8b7c603$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=abdbb4a150fc310df31ec08d1618e1e557dfe3e2$
+// $hash=999efab317d9de20cf31c967a7facaed253ced56$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_
@@ -73,6 +73,30 @@ typedef struct _cef_file_dialog_callback_t {
void(CEF_CALLBACK* cancel)(struct _cef_file_dialog_callback_t* self);
} cef_file_dialog_callback_t;
+///
+// Callback structure for asynchronous continuation of <select> selection.
+///
+typedef struct _cef_select_popup_callback_t {
+ ///
+ // Base structure.
+ ///
+ cef_base_ref_counted_t base;
+
+ ///
+ // Continue the <select> selection. |indices| should be the 0-based array
+ // index of the value selected from the <select> array passed to
+ // cef_dialog_handler_t::ShowSelectPopup.
+ ///
+ void(CEF_CALLBACK* cont)(struct _cef_select_popup_callback_t* self,
+ size_t indicesCount,
+ int const* indices);
+
+ ///
+ // Cancel <select> selection.
+ ///
+ void(CEF_CALLBACK* cancel)(struct _cef_select_popup_callback_t* self);
+} cef_select_popup_callback_t;
+
///
// Implement this structure to handle dialog events. The functions of this
// structure will be called on the browser process UI thread.
@@ -108,6 +132,22 @@ typedef struct _cef_dialog_handler_t {
int selected_accept_filter,
int capture,
struct _cef_file_dialog_callback_t* callback);
+
+ ///
+ // Show <select> popup menu.
+ ///
+ void(CEF_CALLBACK* on_select_popup_menu)(
+ struct _cef_dialog_handler_t* self,
+ struct _cef_browser_t* browser,
+ const cef_rect_t* bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ size_t menu_itemsCount,
+ cef_select_popup_item_t const* menu_items,
+ int right_aligned,
+ int allow_multiple_selection,
+ struct _cef_select_popup_callback_t* callback);
} cef_dialog_handler_t;
#ifdef __cplusplus
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=98444bfe2f513889b45f8a8c7d047cb21b110243$
+// $hash=a7d326ca19b9ac03c15ed63eed59e0a7f763456b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=c6de3fb4d64a2b2ad06a4b9c5e9d7625d40b5bb6$
+// $hash=b01f97e4395b8da428df01f58d8301b3b8c41cc0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=ec13ec3e2819e4ac49792c3a1c57bc60b45fb95b$
+// $hash=8c9afdb42e9045fad9c6c3a901552f67a69e3f34$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=b9f0d91dd2fdb3625365ff8b332b08e1f0ea1187$
+// $hash=91273857318c2755502ed75f36dd9cca4cf3beb1$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=b6e3236a062cd25ec26c3daeb1940d1e1bf0d96a$
+// $hash=319451cc942ceffde5c1b4f5e19972e5132ee71e$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=5b2051c42c1d4c41b85ca823d34b26bfa5de6777$
+// $hash=3c99a3db33be866a89d9600248b9b6ebcc48fbcb$
//
#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=fcfe34c1517ebdb3f00c1f737b91361e771b820d$
+// $hash=75dd531ede2169c637c969db447761ca7e59aac9$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=768e2436e54cceb2675ddd03ebdc61b5c0785bdc$
+// $hash=90bd893bc1fdd605330bcfabcab9faeab419c42a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=e76fa23e9682bf0865319d93e4009752ac8f854f$
+// $hash=42b3783846c1c99e91e4f69e8d8df2be2c823251$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=f2e80b8637b07f19adea666e554269de4627e399$
+// $hash=25230ddd8f70b87fd98ba72581e99c3428344f89$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=a136a2679c8af339b21a89e8ae3090a9dbb8daa7$
+// $hash=dd317f470d2f7096459be0c0fc2cadfd483633b0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=33259e318960845a94c06bca658b46bfb335a23f$
+// $hash=1f592012807b171ad5177d991d53c972559ea56a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=8f791b2d1d5bea27f9e6ca5e0db731a0a76d181c$
+// $hash=3d27496e328f3e76fb05bde7b0da65563604c073$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=b6168013910802cf6d7603892741385958026dcd$
+// $hash=4fa59a60e9138f66bf3f290a499f7fc5a69041ae$
//
#ifndef CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=b5a36ef39ff250c9d3cb1e9a8c7ee38d7e0f8b3f$
+// $hash=51ec70e713506e02d7157fc9d8268d02e91d80a3$
//
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=c68332a779bab425aa2e6a858d20a43448631890$
+// $hash=f8dc9d32c3f345e1c3b7d02a098bebaafad7e81f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=140d3a3ce78f5e8ab50a24a2fd6377e7a8ea3256$
+// $hash=4ef92123de5221aa1ad5959d004e293d6a966fbd$
//
#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=205d56bf87a049ce7ac21b111d42a99659ad7c76$
+// $hash=f9ae882bb6092d1f94b7c78dc6b45369c8b0ec2e$
//
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=812538f84d327ea24469bcfc50957df699dc6edd$
+// $hash=bf5522dc1385a750cad8b9197a588045beaaba58$
//
#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=9f30f2caa9eedc0d4fe963dbf0127602ffcbec61$
+// $hash=a64d72dbd200dfb6a03a2a370b756e559422e97f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=bdb670bcaa9eb9f5748900ad25bcc061155d6076$
+// $hash=5525030c1b87ab3430a11e7e12db71505531f548$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=bdaa64de1cef6de3abdcff88b64b32afc718b238$
+// $hash=0e0d367fabdb12792de5ba8c588fe4bbc035b7a9$
//
#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=0939a44345bea8df7ca5f1dbd6afbe41972121f2$
+// $hash=41e29ffa7778537b0bfec9d7094babf6b3f6db69$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=f5e1c0fc43c6e85dbafa66975d9dc5e2bc7be69f$
+// $hash=de8e3f97b060588604ec89b3cb5e2ddcd9e11499$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=41ddd04d4efb147b05eb93816af1591ec3b61b76$
+// $hash=9955c85f6282d1ee103791206079c1d2100ab7be$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=e930f6445aaeb80ff2f6b1a3077d7d0d4bbd7109$
+// $hash=51af1ce96096db7ed212692b5915a74a18e0222d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PERMISSION_REQUEST_CAPI_H_
@@ -60,18 +60,18 @@ typedef struct _cef_access_request_t {
// Get the origin that is trying to acess the resource.
///
// The resulting string must be freed by calling cef_string_userfree_free().
- cef_string_userfree_t(CEF_CALLBACK *origin)(
- struct _cef_access_request_t *self);
+ cef_string_userfree_t(CEF_CALLBACK* origin)(
+ struct _cef_access_request_t* self);
///
// Get the resource that the origin is trying to acess.
///
- int(CEF_CALLBACK *resource_acess_id)(struct _cef_access_request_t *self);
+ int(CEF_CALLBACK* resource_acess_id)(struct _cef_access_request_t* self);
///
// Report whether the origin is allowed to acess the resource.
///
- void(CEF_CALLBACK *report_request_result)(struct _cef_access_request_t *self,
+ void(CEF_CALLBACK* report_request_result)(struct _cef_access_request_t* self,
int allowed);
} cef_access_request_t;
@@ -90,14 +90,15 @@ typedef struct _cef_permission_request_t {
// set for that origin. The host application should invoke the specified
// callback with the desired permission state.
///
- void(CEF_CALLBACK *on_geolocation_show)(
- struct _cef_permission_request_t *self, const cef_string_t *origin);
+ void(CEF_CALLBACK* on_geolocation_show)(
+ struct _cef_permission_request_t* self,
+ const cef_string_t* origin);
///
// Revert the operation in the OnGeolocationShow.
///
- void(CEF_CALLBACK *on_geolocation_hide)(
- struct _cef_permission_request_t *self);
+ void(CEF_CALLBACK* on_geolocation_hide)(
+ struct _cef_permission_request_t* self);
///
// Notify the host application that web content from the specified origin is
@@ -105,16 +106,16 @@ typedef struct _cef_permission_request_t {
// set for that origin. The host application should invoke the specified
// callback with the desired permission state.
///
- void(CEF_CALLBACK *on_permission_request)(
- struct _cef_permission_request_t *self,
- struct _cef_access_request_t *request);
+ void(CEF_CALLBACK* on_permission_request)(
+ struct _cef_permission_request_t* self,
+ struct _cef_access_request_t* request);
///
// Revert the operation in the OnPermissionRequest.
///
- void(CEF_CALLBACK *on_permission_request_canceled)(
- struct _cef_permission_request_t *self,
- struct _cef_access_request_t *request);
+ void(CEF_CALLBACK* on_permission_request_canceled)(
+ struct _cef_permission_request_t* self,
+ struct _cef_access_request_t* request);
} cef_permission_request_t;
///
@@ -129,51 +130,55 @@ typedef struct _cef_browser_permission_request_delegate_t {
///
// Handle the Geolocation permission requests.
///
- void(CEF_CALLBACK *ask_geolocation_permission)(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin, cef_permission_callback_t callback);
+ void(CEF_CALLBACK* ask_geolocation_permission)(
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin,
+ cef_permission_callback_t callback);
///
// Cancel the Geolocation permission requests.
///
- void(CEF_CALLBACK *abort_ask_geolocation_permission)(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin);
+ void(CEF_CALLBACK* abort_ask_geolocation_permission)(
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin);
///
// Handle the Protected Media Identifier permission requests.
///
- void(CEF_CALLBACK *ask_protected_media_identifier_permission)(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin, cef_permission_callback_t callback);
+ void(CEF_CALLBACK* ask_protected_media_identifier_permission)(
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin,
+ cef_permission_callback_t callback);
///
// Cancel the Protected Media Identifier permission requests.
///
- void(CEF_CALLBACK *abort_ask_protected_media_identifier_permission)(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin);
+ void(CEF_CALLBACK* abort_ask_protected_media_identifier_permission)(
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin);
///
// Handle the MIDI Sysex permission requests.
///
- void(CEF_CALLBACK *ask_midisysex_permission)(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin, cef_permission_callback_t callback);
+ void(CEF_CALLBACK* ask_midisysex_permission)(
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin,
+ cef_permission_callback_t callback);
///
// Cancel the MIDI Sysex permission requests.
///
- void(CEF_CALLBACK *abort_ask_midisysex_permission)(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin);
+ void(CEF_CALLBACK* abort_ask_midisysex_permission)(
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin);
///
// The callback for the Geolocation permission requests.
///
- void(CEF_CALLBACK *notify_geolocation_permission)(
- struct _cef_browser_permission_request_delegate_t *self, int value,
- const cef_string_t *origin);
+ void(CEF_CALLBACK* notify_geolocation_permission)(
+ struct _cef_browser_permission_request_delegate_t* self,
+ int value,
+ const cef_string_t* origin);
} cef_browser_permission_request_delegate_t;
///
@@ -190,32 +195,33 @@ typedef struct _cef_geolocation_acess_t {
// Return true (1) if the geolocation permission state is set for the
// specified origin.
///
- int(CEF_CALLBACK *contain_origin)(struct _cef_geolocation_acess_t *self,
- const cef_string_t *origin);
+ int(CEF_CALLBACK* contain_origin)(struct _cef_geolocation_acess_t* self,
+ const cef_string_t* origin);
///
// Return true (1) if the geolocation permission state set for the specified
// origin is true (1).
///
- int(CEF_CALLBACK *is_origin_access_enabled)(
- struct _cef_geolocation_acess_t *self, const cef_string_t *origin);
+ int(CEF_CALLBACK* is_origin_access_enabled)(
+ struct _cef_geolocation_acess_t* self,
+ const cef_string_t* origin);
///
// Set the geolocation permission state to true (1) for the specified origin.
///
- void(CEF_CALLBACK *enabled)(struct _cef_geolocation_acess_t *self,
- const cef_string_t *origin);
+ void(CEF_CALLBACK* enabled)(struct _cef_geolocation_acess_t* self,
+ const cef_string_t* origin);
///
// Set the geolocation permission state to false (0) for the specified
// origin.
///
- void(CEF_CALLBACK *disabled)(struct _cef_geolocation_acess_t *self,
- const cef_string_t *origin);
+ void(CEF_CALLBACK* disabled)(struct _cef_geolocation_acess_t* self,
+ const cef_string_t* origin);
} cef_geolocation_acess_t;
#ifdef __cplusplus
}
#endif
-#endif // CEF_INCLUDE_CAPI_CEF_PERMISSION_REQUEST_CAPI_H_
+#endif // CEF_INCLUDE_CAPI_CEF_PERMISSION_REQUEST_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=e26be3efc18d8c79d019c02b1d73a7ec2866b142$
+// $hash=3a9d7294c9a4c3aeafe1231c7a3ba5afd7fad0b5$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=fdbd26f9dd20dbd7813fc17a8c34650b2da19581$
+// $hash=eef0d62c1e839660037f32600f5a396d3dce3019$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=2549ea10cd3a41bc04ab81bad24eb12787de68b9$
+// $hash=12e4604521c186e03d984931e66613d33fc32ffd$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=1f2b752c4e314b240ce95cb3b87863c2f99534a8$
+// $hash=230303a48ff28b79f289c199b06a4d3540cb36af$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=d5efa37953d0f0097fef20bc18f4938621c6b168$
+// $hash=9dbe775fa78723fa6695c778fbe8cdbd36b0a888$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=50df1cb9393d36c975aecddb2775ada0d8b9eeec$
+// $hash=3a236866417ec98ad3fb5f325b07250a31c0183c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=0b8abb0e55cb56fcb778ced72a61a108c2b28011$
+// $hash=5827d7a0ee7343daab5fc2a36bdbfabb9d85bb37$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=47b361878452f2a94e559782913d80beb0dba25a$
+// $hash=77ebea253e3607ed44c60791bb461a202d95c222$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=d2ccf65028b87821b92eda7e8d715ec98f8e1623$
+// $hash=c6c04067690990978ca3bbbbc6ddd6f5a0186f91$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
@@ -45,7 +45,6 @@
#include "include/capi/cef_data_base_capi.h"
#include "include/capi/cef_extension_capi.h"
#include "include/capi/cef_extension_handler_capi.h"
-#include "include/capi/cef_media_router_capi.h"
#include "include/capi/cef_values_capi.h"
#include "include/capi/cef_web_storage_capi.h"
@@ -370,15 +369,6 @@ typedef struct _cef_request_context_t {
struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
struct _cef_request_context_t* self,
const cef_string_t* extension_id);
-
- ///
- // Returns the MediaRouter object associated with this context. If |callback|
- // is non-NULL it will be executed asnychronously on the UI thread after the
- // manager's context has been initialized.
- ///
- struct _cef_media_router_t*(CEF_CALLBACK* get_media_router)(
- struct _cef_request_context_t* self,
- struct _cef_completion_callback_t* callback);
} cef_request_context_t;
///
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=b44d320d5cceb5022543e8154170b8d276628c76$
+// $hash=f517370ae17962732a0894555330fd002860b83a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
@@ -45,12 +45,13 @@
#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" {
#endif
+// #include "include/cef_web_plugin.h" // !enable_plugins
+
///
// Implement this structure to provide handler implementations. The handler
// instance will not be released until all objects related to the context have
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=0a47add5335ff2d73e08d1e491f2561356f63fcd$
+// $hash=76ffdecdfc2fb8b6956b936d0a5762e4f7b122a1$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=a9e35ca17785f77666db7650208cacfd9a85c3e0$
+// $hash=d45529ccb797163f6ff0b790d4959e7644355a8b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=3d7b3d4702c8d35dc8780f9e87eb7560d6ce1dee$
+// $hash=0436aa15546615fe9252d46ea89887ec59c0e85d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=67df3d56f0cc0f58d2b0a2fe884bbb2c1c39813f$
+// $hash=443ce8d80b80b55337069a9a118fb0eb645faba3$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=3d5c3c54c9f7eedc5cd1dd61c0f69edcd6a1143a$
+// $hash=d95bcd8d70029011eb9e0f2c64febb627939d121$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=6ebf7adcdaee57772810c1528b27140ae95966d0$
+// $hash=0b0b89911503aeb4fc52afa8d0d0f4e103181b6c$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=fb06b9630b95fedb5d202aab7814d914ab7c943b$
+// $hash=557c259e90896df250dafa16c1205a817204dc22$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=df8c46dd19ef6a3964c49d79e770de6e4245e208$
+// $hash=2dd528ca9ff88be60782b87036f464a6bd6e69a5$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=72c2b4f976016cea50e54a386c09a786973c01a3$
+// $hash=58c1f77a5342d836003a2246fcbe501a6f05086b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=d72f3b34b4150f29f1491b2c729f4a8afc4a33f4$
+// $hash=9a4618d543430a0818201958879d89a6b082019b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=1bc8a73a196fbbb6cec3dd1738b817575b17706d$
+// $hash=60394d189c5dfa8625f7e5fdab03eeda1fce7c5a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=87f6cad177614ece33d9574f0f2964e5bb97d613$
+// $hash=3c7df6e11c46a966f2bb7d2e751927779ddf4dd2$
//
#ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=398537ec88bfe902c49908db4a549da297594b70$
+// $hash=215af99d25f001165995c9fa88c59d6e8a05f28f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=e943dd2af818e5a5f19f6cbd1648896684c666c6$
+// $hash=be97992f2fd5e08cf5483c55a1db72a74a1fa5c6$
//
#ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=d99ffc2270c1cf8b0f06dd08c1b6e9b27cee4bc8$
+// $hash=6ef25dfdc109d397dd9ac685605c143ed453843d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_THREAD_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=a7b4410e0a35eb0aba747014665419fb6b6fcb67$
+// $hash=95fee99cebd49941b0016a94fe1377a273df875f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=a14d77cd7756797afb4db3d28a2359da53011bfa$
+// $hash=1a7f7266ca653ae00fda873d7b1161fda5be5655$
//
#ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=2bdcad7f8e3c03285a5e5ddb9a02a5a2182f254c$
+// $hash=515a6f62bb5217ba8ec2f7d39ab80c8309969a36$
//
#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=c557496bdc1403b25b22ca9354a942478131c7ce$
+// $hash=ddc15ea7b9330cf163a23d502e104084469fceee$
//
#ifndef CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=aff380a4fa3f1a26063170381d47c67971511f1d$
+// $hash=5f8073d54b2908fb4257e39f9a7ec377c904607d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=4f98d594eaa1a0b41b534f51da2639bfc9a12778$
+// $hash=94416352092795abfea395fe1b6853fea26edf5e$
//
#ifndef CEF_INCLUDE_CAPI_CEF_WEB_STORAGE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=32b942f6b50b842ddec08addc2b5794f2a272dbe$
+// $hash=50344d992070d4f7c39071988e3df72aa1eab9df$
//
#ifndef CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=c3bdf957dfd307568842b95599e3259d4c8d8f44$
+// $hash=48faeb26812f4fa6d8965c47acc96e635c45d27a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=ac91bcd40e1439ee1e742cc47989530b112c99bd$
+// $hash=28f7ff6c3af903a645adc15ad4b696939e79df19$
//
#ifndef CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=584acfdb7be699b0192c46ac9fa88084f141e845$
+// $hash=cd0ff16b2ea4d2d973ca9b7c7f503e7c1df0ad26$
//
#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TEST_HELPERS_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=d70d5b74890e3ca91f01333ebdb4f3298caeb619$
+// $hash=1f8029c1907d5e1097d7347f03618bec25388f9b$
//
#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=bf1d1dc95fa2053645a348d6f554688b9d06c83a$
+// $hash=5e9d3854f9d31ac72038fb24aa9ef5944691a4ca$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BOX_LAYOUT_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=9ae10b92eed7495112c94825521ac46fb9327ef7$
+// $hash=90e42cb56ab7b8b752ddaf9526cb3b6e5af0d0fb$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=520df1f3e00efbffc9d499149f2f797bf0f85c99$
+// $hash=ec5c49d383e69a87b525c6e1ec3e2c779db6ab78$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=5ebbf84a506d3d4d0bfb3d8db48f060a682f1ac9$
+// $hash=ce7101147c7a834842e1b4006f3d830aa58cfc91$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=9f1752ee949e98662a718de764e83f26ce06ec26$
+// $hash=cd06431dcfeb4f0907a478695ff1690da701fa8c$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_DELEGATE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=2fd0db428ce5902d59a7802c901e1c13b2367b5a$
+// $hash=6cc3e2f52a4e8eab9690225cc085f726032c7bb1$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=13972453cdca328c6ee81249aeb202d80da6d290$
+// $hash=477dc88c896170d4b617be9f7ce0bc21ebbbccbe$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_FILL_LAYOUT_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=de3e738efca85a84422c92fa8504b24ed4efab8a$
+// $hash=e638b5ad0528625d06234d8a35b44eb11a79fc3c$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LABEL_BUTTON_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=6ef0d3d4390654fc1460a2ff586f2bbfd62e96b8$
+// $hash=8c78341b1803cdcba66c5e95d0eab1ce2dea4e02$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LAYOUT_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=925b09f77cd71327a447bf5c9601cc21a7eb7c3a$
+// $hash=6c4206291d525099e382ce8b39b5bc82655455fc$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=ca7948602a0d20a5bd0271065d79e8679898eff6$
+// $hash=357d6e0ba5823c66b72eae87696a33c0855134ee$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_DELEGATE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=14eaca76dba704ee64f454aaca821a6818012fc6$
+// $hash=55371efcc9d09b9205ce160174a85d1b345d56ea$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_OVERLAY_CONTROLLER_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=d5311ffa72e57d240f6963b1f45a278041bd33f4$
+// $hash=1aee6ef8b8b0c8d6a820f99a17a0d13b417cbe86$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=3b6b3ef725189debb1dd43db395a111f50dee60c$
+// $hash=0b27daf9b7ff1378a7404b913d6e7bf778ec4c46$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_DELEGATE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=374b16fddbbb8bedc2dbb2e03dcfaa8cddba6aeb$
+// $hash=bf4d81ab1ea8b9920e890161f32f805c5fcd0622$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_SCROLL_VIEW_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=798f84672412f544765b800d03cf284b066f818c$
+// $hash=3faf27fd1377ad64fe06aa30e69934b78102456e$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=44337fe515a5acf51829e1dd00a54f2c1230aba5$
+// $hash=c81f3ad4200af508ec18645f9a1c47ca137b2422$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_DELEGATE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=d2aadfa4159846c2719387e2814d5e108def4b81$
+// $hash=86f76917de91f297c2165a7e2311b8e1220a24ac$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=6a8166eca76513b59a4f6355f4f765dc1d77e4ee$
+// $hash=aae94169e63ebfb9223ef32a28eeeb03d5cc710f$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_DELEGATE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=1785245d89e84d5a27ce062208bc19a4031ce97f$
+// $hash=3ea36e131dbb52dbe2c80567e38835b6aab1613b$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
-// $hash=cd5d7c4e83237ceb39c5639489ca6004d2d69f0c$
+// $hash=e8f5a22c50d02ae662383e056d4bf64de235d68d$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2023 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
@@ -42,15 +42,15 @@
// 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 "c731adb5e5a7fdb5c827ccc611df6eb4d4b33717"
+#define CEF_API_HASH_UNIVERSAL "fa7171a110d7f5a06e06c770c9224972d99054ec"
#if defined(OS_WIN)
-#define CEF_API_HASH_PLATFORM "dc628cf4312be11edcb89422ce900cf7f773c1f0"
+#define CEF_API_HASH_PLATFORM "56a3fec8d1782d7f1bf12d13c6f61b5707282879"
#elif defined(OS_MAC)
-#define CEF_API_HASH_PLATFORM "f7c028130eb6fefadbb4874ca2b0dac73e8113e7"
+#define CEF_API_HASH_PLATFORM "c01d748bab5bbdd4b4ed03a6b91fddf28c5ce635"
#elif defined(OS_LINUX)
-#define CEF_API_HASH_PLATFORM "0533f1d7611266b46636c9c75fd4a908a6062f93"
+#define CEF_API_HASH_PLATFORM "61c970f2c3d3c064401adeb42d16a19566d577c2"
#elif defined(OS_OHOS)
-#define CEF_API_HASH_PLATFORM "0533f1d7611266b46636c9c75fd4a908a6062f93"
+#define CEF_API_HASH_PLATFORM "61c970f2c3d3c064401adeb42d16a19566d577c2"
#endif
#ifdef __cplusplus
@@ -53,6 +53,7 @@
class CefBrowserHost;
class CefClient;
class CefJavaScriptResultCallback;
+class CefWebMessageReceiver;
class CefStoreWebArchiveResultCallback;
///
@@ -237,7 +238,8 @@ class CefBrowser : public virtual CefBaseRefCounted {
// Returns the Permission Request Delegate object.
///
/*--cef()--*/
- virtual CefRefPtr<CefBrowserPermissionRequestDelegate> GetPermissionRequestDelegate() = 0;
+ virtual CefRefPtr<CefBrowserPermissionRequestDelegate>
+ GetPermissionRequestDelegate() = 0;
///
// Returns the Geolocation Permission handler object.
@@ -899,7 +901,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
// Post a message to the port.
///
/*--cef()--*/
- virtual void PostPortMessage(CefString& port_handle, CefString& data) = 0;
+ virtual void PostPortMessage(CefString& port_handle, CefRefPtr<CefValue> message) = 0;
///
// Set the callback of the port.
@@ -907,7 +909,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual void SetPortMessageCallback(
CefString& port_handle,
- CefRefPtr<CefJavaScriptResultCallback> callback) = 0;
+ CefRefPtr<CefWebMessageReceiver> callback) = 0;
///
// Gets the latest hitdata
@@ -953,7 +955,8 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
// Loads the given data into this WebView
// optional_param=data, optional_param=mimeType, optional_param=encoding,
///
- /*--cef(optional_param=data, optional_param=mimeType, optional_param=encoding,)--*/
+ /*--cef(optional_param=data, optional_param=mimeType,
+ optional_param=encoding,)--*/
virtual void LoadWithData(const CefString& data,
const CefString& mimeType,
const CefString& encoding) = 0;
@@ -1235,6 +1238,62 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void RemoveCache(bool include_disk_files) = 0;
+
+ ///
+ // Scroll page up or down
+ ///
+ /*--cef()--*/
+ virtual void ScrollPageUpDown(bool is_up,
+ bool is_half,
+ float view_height) = 0;
+
+ ///
+ // Get web history state
+ ///
+ /*--cef()--*/
+ virtual CefRefPtr<CefBinaryValue> GetWebState() = 0;
+
+ ///
+ // Restore web history state
+ ///
+ /*--cef()--*/
+ virtual bool RestoreWebState(const CefRefPtr<CefBinaryValue> state) = 0;
+
+ ///
+ // Scroll to the position.
+ ///
+ /*--cef()--*/
+ virtual void ScrollTo(float x, float y) = 0;
+
+ ///
+ // Scroll by the delta distance.
+ ///
+ /*--cef()--*/
+ virtual void ScrollBy(float delta_x, float delta_y) = 0;
+
+ ///
+ // Slide Scroll by the speed.
+ ///
+ /*--cef()--*/
+ virtual void SlideScroll(float vx, float vy) = 0;
+
+ ///
+ // Set whether webview can access files
+ ///
+ /*--cef()--*/
+ virtual void SetFileAccess(bool falg) = 0;
+
+ ///
+ // Set whether webview can access network
+ ///
+ /*--cef()--*/
+ virtual void SetBlockNetwork(bool falg) = 0;
+
+ ///
+ // Set the cache mode of webview
+ ///
+ /*--cef()--*/
+ virtual void SetCacheMode(int falg) = 0;
};
///
@@ -1268,6 +1327,20 @@ class CefStoreWebArchiveResultCallback : public virtual CefBaseRefCounted {
/*--cef(optional_param=result)--*/
virtual void OnStoreWebArchiveDone(const CefString& result) = 0;
};
+
+///
+// Interface to implement to be notified of asynchronous web message channel.
+///
+/*--cef(source=client)--*/
+class CefWebMessageReceiver : public virtual CefBaseRefCounted {
+ public:
+ ///
+ // Method that will be called upon |PostPortMessage|. |message| will be sent
+ // to another end of web message channel.
+ ///
+ /*--cef()--*/
+ virtual void OnMessage(CefRefPtr<CefValue> message) = 0;
+};
/* ---------- ohos webview add end --------- */
#endif // CEF_INCLUDE_CEF_BROWSER_H_
@@ -219,6 +219,8 @@ class CefContextMenuParams : public virtual CefBaseRefCounted {
typedef cef_context_menu_media_type_t MediaType;
typedef cef_context_menu_media_state_flags_t MediaStateFlags;
typedef cef_context_menu_edit_state_flags_t EditStateFlags;
+ typedef cef_context_menu_input_field_type_t InputFieldType;
+ typedef cef_context_menu_source_type_t SourceType;
///
// Returns the X coordinate of the mouse where the context menu was invoked.
@@ -356,6 +358,18 @@ class CefContextMenuParams : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual bool IsCustomMenu() = 0;
+
+ ///
+ // Returns the input field type of context node that the context menu was invoked on.
+ ///
+ /*--cef(default_retval=CM_INPUTFIELDTYPE_NONE)--*/
+ virtual InputFieldType GetInputFieldType() = 0;
+
+ ///
+ // Returns the source type of context node that the context menu was invoked on.
+ ///
+ /*--cef(default_retval=CM_SOURCETYPE_NONE)--*/
+ virtual SourceType GetSourceType() = 0;
};
#endif // CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_
@@ -81,7 +81,9 @@ class CefDataBase : public virtual CefBaseRefCounted {
virtual void GetHttpAuthCredentials(
const CefString& host,
const CefString& realm,
- std::vector<CefString>& username_password) = 0;
+ CefString& username,
+ char* password,
+ uint32_t passwordSize) = 0;
///
// gets whether the instance holds the specified permissions for the specified
@@ -66,6 +66,27 @@ class CefFileDialogCallback : public virtual CefBaseRefCounted {
virtual void Cancel() = 0;
};
+///
+// Callback interface for asynchronous continuation of <select> selection.
+///
+/*--cef(source=library)--*/
+class CefSelectPopupCallback : public virtual CefBaseRefCounted {
+ public:
+ ///
+ // Continue the <select> selection. |indices| should be the 0-based array
+ // index of the value selected from the <select> array passed to
+ // CefDialogHandler::ShowSelectPopup.
+ ///
+ /*--cef(capi_name=cont)--*/
+ virtual void Continue(const std::vector<int>& indices) = 0;
+
+ ///
+ // Cancel <select> selection.
+ ///
+ /*--cef()--*/
+ virtual void Cancel() = 0;
+};
+
///
// Implement this interface to handle dialog events. The methods of this class
// will be called on the browser process UI thread.
@@ -102,6 +123,20 @@ class CefDialogHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefFileDialogCallback> callback) {
return false;
}
+
+ ///
+ // Show <select> popup menu.
+ ///
+ /*--cef()--*/
+ virtual void OnSelectPopupMenu(CefRefPtr<CefBrowser> browser,
+ const CefRect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<CefSelectPopupItem>& menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection,
+ CefRefPtr<CefSelectPopupCallback> callback) {}
};
#endif // CEF_INCLUDE_CEF_DIALOG_HANDLER_H_
deleted file mode 100644
@@ -1,323 +0,0 @@
-// Copyright (c) 2020 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_MEDIA_ROUTER_H_
-#define CEF_INCLUDE_CEF_MEDIA_ROUTER_H_
-#pragma once
-
-#include <vector>
-#include "include/cef_base.h"
-#include "include/cef_callback.h"
-#include "include/cef_registration.h"
-
-class CefMediaObserver;
-class CefMediaRoute;
-class CefMediaRouteCreateCallback;
-class CefMediaSink;
-class CefMediaSinkDeviceInfoCallback;
-class CefMediaSource;
-
-///
-// Supports discovery of and communication with media devices on the local
-// network via the Cast and DIAL protocols. The methods of this class may be
-// called on any browser process thread unless otherwise indicated.
-///
-/*--cef(source=library)--*/
-class CefMediaRouter : public virtual CefBaseRefCounted {
- public:
- ///
- // Returns the MediaRouter object associated with the global request context.
- // If |callback| is non-NULL it will be executed asnychronously on the UI
- // thread after the manager's storage has been initialized. Equivalent to
- // calling CefRequestContext::GetGlobalContext()->GetMediaRouter().
- ///
- /*--cef(optional_param=callback)--*/
- static CefRefPtr<CefMediaRouter> GetGlobalMediaRouter(
- CefRefPtr<CefCompletionCallback> callback);
-
- ///
- // Add an observer for MediaRouter events. The observer will remain registered
- // until the returned Registration object is destroyed.
- ///
- /*--cef()--*/
- virtual CefRefPtr<CefRegistration> AddObserver(
- CefRefPtr<CefMediaObserver> observer) = 0;
-
- ///
- // Returns a MediaSource object for the specified media source URN. Supported
- // URN schemes include "cast:" and "dial:", and will be already known by the
- // client application (e.g. "cast:<appId>?clientId=<clientId>").
- ///
- /*--cef()--*/
- virtual CefRefPtr<CefMediaSource> GetSource(const CefString& urn) = 0;
-
- ///
- // Trigger an asynchronous call to CefMediaObserver::OnSinks on all
- // registered observers.
- ///
- /*--cef()--*/
- virtual void NotifyCurrentSinks() = 0;
-
- ///
- // Create a new route between |source| and |sink|. Source and sink must be
- // valid, compatible (as reported by CefMediaSink::IsCompatibleWith), and a
- // route between them must not already exist. |callback| will be executed
- // on success or failure. If route creation succeeds it will also trigger an
- // asynchronous call to CefMediaObserver::OnRoutes on all registered
- // observers.
- ///
- /*--cef()--*/
- virtual void CreateRoute(CefRefPtr<CefMediaSource> source,
- CefRefPtr<CefMediaSink> sink,
- CefRefPtr<CefMediaRouteCreateCallback> callback) = 0;
-
- ///
- // Trigger an asynchronous call to CefMediaObserver::OnRoutes on all
- // registered observers.
- ///
- /*--cef()--*/
- virtual void NotifyCurrentRoutes() = 0;
-};
-
-///
-// Implemented by the client to observe MediaRouter events and registered via
-// CefMediaRouter::AddObserver. The methods of this class will be called on the
-// browser process UI thread.
-///
-/*--cef(source=client)--*/
-class CefMediaObserver : public virtual CefBaseRefCounted {
- public:
- typedef cef_media_route_connection_state_t ConnectionState;
-
- ///
- // The list of available media sinks has changed or
- // CefMediaRouter::NotifyCurrentSinks was called.
- ///
- /*--cef()--*/
- virtual void OnSinks(const std::vector<CefRefPtr<CefMediaSink>>& sinks) = 0;
-
- ///
- // The list of available media routes has changed or
- // CefMediaRouter::NotifyCurrentRoutes was called.
- ///
- /*--cef()--*/
- virtual void OnRoutes(
- const std::vector<CefRefPtr<CefMediaRoute>>& routes) = 0;
-
- ///
- // The connection state of |route| has changed.
- ///
- /*--cef()--*/
- virtual void OnRouteStateChanged(CefRefPtr<CefMediaRoute> route,
- ConnectionState state) = 0;
-
- ///
- // A message was recieved over |route|. |message| is only valid for
- // the scope of this callback and should be copied if necessary.
- ///
- /*--cef()--*/
- virtual void OnRouteMessageReceived(CefRefPtr<CefMediaRoute> route,
- const void* message,
- size_t message_size) = 0;
-};
-
-///
-// Represents the route between a media source and sink. Instances of this
-// object are created via CefMediaRouter::CreateRoute and retrieved via
-// CefMediaObserver::OnRoutes. Contains the status and metadata of a
-// routing operation. The methods of this class may be called on any browser
-// process thread unless otherwise indicated.
-///
-/*--cef(source=library)--*/
-class CefMediaRoute : public virtual CefBaseRefCounted {
- public:
- ///
- // Returns the ID for this route.
- ///
- /*--cef()--*/
- virtual CefString GetId() = 0;
-
- ///
- // Returns the source associated with this route.
- ///
- /*--cef()--*/
- virtual CefRefPtr<CefMediaSource> GetSource() = 0;
-
- ///
- // Returns the sink associated with this route.
- ///
- /*--cef()--*/
- virtual CefRefPtr<CefMediaSink> GetSink() = 0;
-
- ///
- // Send a message over this route. |message| will be copied if necessary.
- ///
- /*--cef()--*/
- virtual void SendRouteMessage(const void* message, size_t message_size) = 0;
-
- ///
- // Terminate this route. Will result in an asynchronous call to
- // CefMediaObserver::OnRoutes on all registered observers.
- ///
- /*--cef()--*/
- virtual void Terminate() = 0;
-};
-
-///
-// Callback interface for CefMediaRouter::CreateRoute. The methods of this
-// class will be called on the browser process UI thread.
-///
-/*--cef(source=client)--*/
-class CefMediaRouteCreateCallback : public virtual CefBaseRefCounted {
- public:
- typedef cef_media_route_create_result_t RouteCreateResult;
-
- ///
- // Method that will be executed when the route creation has finished. |result|
- // will be CEF_MRCR_OK if the route creation succeeded. |error| will be a
- // description of the error if the route creation failed. |route| is the
- // resulting route, or empty if the route creation failed.
- ///
- /*--cef(optional_param=error,optional_param=route)--*/
- virtual void OnMediaRouteCreateFinished(RouteCreateResult result,
- const CefString& error,
- CefRefPtr<CefMediaRoute> route) = 0;
-};
-
-///
-// Represents a sink to which media can be routed. Instances of this object are
-// retrieved via CefMediaObserver::OnSinks. The methods of this class may
-// be called on any browser process thread unless otherwise indicated.
-///
-/*--cef(source=library)--*/
-class CefMediaSink : public virtual CefBaseRefCounted {
- public:
- typedef cef_media_sink_icon_type_t IconType;
-
- ///
- // Returns the ID for this sink.
- ///
- /*--cef()--*/
- virtual CefString GetId() = 0;
-
- ///
- // Returns the name of this sink.
- ///
- /*--cef()--*/
- virtual CefString GetName() = 0;
-
- ///
- // Returns the description of this sink.
- ///
- /*--cef()--*/
- virtual CefString GetDescription() = 0;
-
- ///
- // Returns the icon type for this sink.
- ///
- /*--cef(default_retval=CEF_MSIT_GENERIC)--*/
- virtual IconType GetIconType() = 0;
-
- ///
- // Asynchronously retrieves device info.
- ///
- /*--cef()--*/
- virtual void GetDeviceInfo(
- CefRefPtr<CefMediaSinkDeviceInfoCallback> callback) = 0;
-
- ///
- // Returns true if this sink accepts content via Cast.
- ///
- /*--cef()--*/
- virtual bool IsCastSink() = 0;
-
- ///
- // Returns true if this sink accepts content via DIAL.
- ///
- /*--cef()--*/
- virtual bool IsDialSink() = 0;
-
- ///
- // Returns true if this sink is compatible with |source|.
- ///
- /*--cef()--*/
- virtual bool IsCompatibleWith(CefRefPtr<CefMediaSource> source) = 0;
-};
-
-///
-// Callback interface for CefMediaSink::GetDeviceInfo. The methods of this
-// class will be called on the browser process UI thread.
-///
-/*--cef(source=client)--*/
-class CefMediaSinkDeviceInfoCallback : public virtual CefBaseRefCounted {
- public:
- ///
- // Method that will be executed asyncronously once device information has been
- // retrieved.
- ///
- /*--cef()--*/
- virtual void OnMediaSinkDeviceInfo(
- const CefMediaSinkDeviceInfo& device_info) = 0;
-};
-
-///
-// Represents a source from which media can be routed. Instances of this object
-// are retrieved via CefMediaRouter::GetSource. The methods of this class may be
-// called on any browser process thread unless otherwise indicated.
-///
-/*--cef(source=library)--*/
-class CefMediaSource : public virtual CefBaseRefCounted {
- public:
- ///
- // Returns the ID (media source URN or URL) for this source.
- ///
- /*--cef()--*/
- virtual CefString GetId() = 0;
-
- ///
- // Returns true if this source outputs its content via Cast.
- ///
- /*--cef()--*/
- virtual bool IsCastSource() = 0;
-
- ///
- // Returns true if this source outputs its content via DIAL.
- ///
- /*--cef()--*/
- virtual bool IsDialSource() = 0;
-};
-
-#endif // CEF_INCLUDE_CEF_MEDIA_ROUTER_H_
@@ -45,7 +45,6 @@
#include "include/cef_data_base.h"
#include "include/cef_extension.h"
#include "include/cef_extension_handler.h"
-#include "include/cef_media_router.h"
#include "include/cef_values.h"
#include "include/cef_web_storage.h"
@@ -380,15 +379,6 @@ class CefRequestContext : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual CefRefPtr<CefExtension> GetExtension(
const CefString& extension_id) = 0;
-
- ///
- // Returns the MediaRouter object associated with this context. If |callback|
- // is non-NULL it will be executed asnychronously on the UI thread after the
- // manager's context has been initialized.
- ///
- /*--cef(optional_param=callback)--*/
- virtual CefRefPtr<CefMediaRouter> GetMediaRouter(
- CefRefPtr<CefCompletionCallback> callback) = 0;
};
#endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_
@@ -43,7 +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"
+//#include "include/cef_web_plugin.h" // !enable_plugins
///
// Implement this interface to provide handler implementations. The handler
deleted file mode 100644
@@ -1,148 +0,0 @@
-// 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_
@@ -531,6 +531,16 @@ class CefStringBase {
owner_ = false;
}
+ ///
+ // Memset the data to zero.
+ ///
+ void MemsetToZero() {
+ if (!string_)
+ return;
+ if (string_->str != NULL)
+ memset(string_->str, 0, string_->length);
+ }
+
///
// Attach to the specified string structure. If |owner| is true this class
// will take ownership of the structure.
@@ -664,6 +664,7 @@ typedef struct _cef_browser_settings_t {
// Force the background color to be dark
///
cef_state_t force_dark_mode_enabled;
+ cef_state_t dark_prefer_color_scheme_enabled;
cef_state_t loads_images_automatically;
bool javascript_can_open_windows_automatically;
int text_size_percent;
@@ -677,6 +678,10 @@ typedef struct _cef_browser_settings_t {
bool viewport_meta_enabled;
bool user_gesture_required;
bool pinch_smooth_mode;
+#if BUILDFLAG(IS_OHOS)
+ cef_state_t hide_vertical_scrollbars;
+ cef_state_t hide_horizontal_scrollbars;
+#endif
/* ohos webview end */
} cef_browser_settings_t;
@@ -3308,6 +3313,197 @@ typedef struct _cef_touch_handle_state_t {
float edge_height;
} cef_touch_handle_state_t;
+///
+// Supported context menu input field types. These constants match their equivalents
+// in Chromium's ContextMenuDataInputFieldType and should not be renumbered.
+///
+typedef enum {
+ ///
+ // Not an input field.
+ ///
+ CM_INPUTFIELDTYPE_NONE,
+
+ ///
+ // type = text, search, email, url
+ ///
+ CM_INPUTFIELDTYPE_PLAINTEXT,
+
+ ///
+ // type = password
+ ///
+ CM_INPUTFIELDTYPE_PASSWORD,
+
+ ///
+ // type = number
+ ///
+ CM_INPUTFIELDTYPE_NUMBER,
+
+ ///
+ // type = tel
+ ///
+ CM_INPUTFIELDTYPE_TELEPHONE,
+
+ ///
+ // type = <etc.>
+ ///
+ CM_INPUTFIELDTYPE_OTHER,
+} cef_context_menu_input_field_type_t;
+
+///
+// Supported context menu source types. These constants match their equivalents
+// in Chromium's ui::MenuSourceType and should not be renumbered.
+///
+typedef enum {
+ ///
+ // type = none
+ ///
+ CM_SOURCETYPE_NONE,
+
+ ///
+ // type = mouse
+ ///
+ CM_SOURCETYPE_MOUSE,
+
+ ///
+ // type = keyboard
+ ///
+ CM_SOURCETYPE_KEYBOARD,
+
+ ///
+ // type = touch
+ ///
+ CM_SOURCETYPE_TOUCH,
+
+ ///
+ // type = touch edit menu
+ ///
+ CM_SOURCETYPE_TOUCH_EDIT_MENU,
+
+ ///
+ // type = long press
+ ///
+ CM_SOURCETYPE_LONG_PRESS,
+
+ ///
+ // type = long tap
+ ///
+ CM_SOURCETYPE_LONG_TAP,
+
+ ///
+ // type = number
+ ///
+ CM_SOURCETYPE_TOUCH_HANDLE,
+
+ ///
+ // type = stylus
+ ///
+ CM_SOURCETYPE_STYLUS,
+
+ ///
+ // type = adjust selection
+ ///
+ CM_SOURCETYPE_ADJUST_SELECTION,
+
+ ///
+ // type = selection reset
+ ///
+ CM_SOURCETYPE_SELECTION_RESET,
+} cef_context_menu_source_type_t;
+
+///
+// Supported text direction. See text_direction.mojom.
+///
+typedef enum {
+ ///
+ // type = unknown direction
+ ///
+ UNKNOWN,
+
+ ///
+ // type = right to left
+ ///
+ RTL,
+
+ ///
+ // type = left to right
+ ///
+ LTR,
+} cef_text_direction_t;
+
+///
+// Supported <select> item type. See popup_menu.mojom.
+///
+typedef enum {
+ ///
+ // type = kOption
+ ///
+ OPTION,
+
+ ///
+ // type = kCheckableOption
+ ///
+ CHECKABLE_OPTION,
+
+ ///
+ // type = kGruop
+ ///
+ GROUP,
+
+ ///
+ // type = kSeparator
+ ///
+ SEPARATOR,
+
+ ///
+ // type = kSubMenu
+ ///
+ SubMenu,
+} cef_select_popup_item_type_t;
+
+///
+// Supported <select> item.
+///
+typedef struct _cef_select_popup_item_t {
+ ///
+ // label name of item.
+ ///
+ cef_string_t label;
+
+ ///
+ // tool tip of item.
+ ///
+ cef_string_t tool_tip;
+
+ ///
+ // type of item.
+ ///
+ cef_select_popup_item_type_t type;
+
+ ///
+ // action of item.
+ ///
+ uint32_t action;
+
+ ///
+ // text direction of item.
+ ///
+ cef_text_direction_t text_direction;
+
+ ///
+ // whether item is enabled.
+ ///
+ bool enabled;
+
+ ///
+ // whether item has text direction overridel
+ ///
+ bool has_text_direction_override;
+
+ ///
+ // whether item is checked.
+ ///
+ bool checked;
+} cef_select_popup_item_t;
#ifdef __cplusplus
}
#endif
@@ -730,6 +730,7 @@ struct CefBrowserSettingsTraits {
/* ohos webview begin */
target->force_dark_mode_enabled = src->force_dark_mode_enabled;
+ target->dark_prefer_color_scheme_enabled = src->dark_prefer_color_scheme_enabled;
target->javascript_can_open_windows_automatically =
src->javascript_can_open_windows_automatically;
target->loads_images_automatically = src->loads_images_automatically;
@@ -746,6 +747,10 @@ struct CefBrowserSettingsTraits {
target->viewport_meta_enabled = src->viewport_meta_enabled;
target->user_gesture_required = src->user_gesture_required;
target->pinch_smooth_mode = src->pinch_smooth_mode;
+#if BUILDFLAG(IS_OHOS)
+ target->hide_vertical_scrollbars = src->hide_vertical_scrollbars;
+ target->hide_horizontal_scrollbars = src->hide_horizontal_scrollbars;
+#endif
/* ohos webview end */
}
};
@@ -1050,4 +1055,23 @@ struct CefMediaSinkDeviceInfoTraits {
///
typedef CefStructBase<CefMediaSinkDeviceInfoTraits> CefMediaSinkDeviceInfo;
+struct CefSelectPopupItemTraits {
+ typedef cef_select_popup_item_t struct_type;
+
+ static inline void init(struct_type* s) {}
+
+ static inline void clear(struct_type* s) {}
+
+ static inline void set(const struct_type* src,
+ struct_type* target,
+ bool copy) {
+ *target = *src;
+ }
+};
+
+///
+// Class representing select popup item.
+///
+typedef CefStructBase<CefSelectPopupItemTraits> CefSelectPopupItem;
+
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
@@ -24,7 +24,6 @@
#include "base/strings/string_util.h"
#include "chrome/browser/font_family_cache.h"
#include "chrome/browser/media/media_device_id_salt.h"
-#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h"
#include "chrome/common/pref_names.h"
@@ -49,6 +48,10 @@
#include "net/proxy_resolution/proxy_config_service.h"
#include "services/network/public/mojom/cors_origin_pattern.mojom.h"
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
+#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
+#endif
+
using content::BrowserThread;
// Creates and manages VisitedLinkEventListener objects for each
@@ -183,7 +186,9 @@ void AlloyBrowserContext::Initialize() {
if (extensions_enabled)
extension_system_->Init();
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
ChromePluginServiceFilter::GetInstance()->RegisterProfile(this);
+#endif
media_device_id_salt_ = new MediaDeviceIDSalt(pref_service);
}
@@ -194,7 +199,9 @@ void AlloyBrowserContext::Shutdown() {
// Send notifications to clean up objects associated with this Profile.
MaybeSendDestroyedNotification();
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
ChromePluginServiceFilter::GetInstance()->UnregisterProfile(this);
+#endif
// Remove any BrowserContextKeyedServiceFactory associations. This must be
// called before the ProxyService owned by AlloyBrowserContext is destroyed.
@@ -331,6 +331,13 @@ void AlloyBrowserHostImpl::CloseBrowser(bool force_close) {
// Will result in a call to BeforeUnloadFired() and, if the close isn't
// canceled, CloseContents().
contents->DispatchBeforeUnload(false /* auto_cancel */);
+#if BUILDFLAG(IS_OHOS)
+ // In cef_life_span_handler.h file show DoClose step.
+ // Step 1 to Step 3 is over.
+ // This will replace Step 4 : User approves the close. Beause both in
+ // Android and OH close will not be blocked by beforeunload event.
+ CloseContents(contents);
+#endif
} else {
CloseContents(contents);
}
@@ -1180,6 +1187,14 @@ void AlloyBrowserHostImpl::CloseContents(content::WebContents* source) {
if (handler.get()) {
close_browser = !handler->DoClose(this);
}
+#if BUILDFLAG(IS_OHOS)
+ // |DoClose| will notify the UI to close, |DESTRUCTION_STATE_NONE| means
+ // |CloseBrowser| has not been triggered by UI. We should close browser
+ // when received |CloseBrowser| request from UI.
+ if (destruction_state_ == DESTRUCTION_STATE_NONE) {
+ close_browser = false;
+ }
+#endif
}
if (close_browser) {
@@ -1254,7 +1269,6 @@ bool AlloyBrowserHostImpl::HandleContextMenu(
auto rvh = web_contents()->GetRenderViewHost();
CefRenderWidgetHostViewOSR* view =
static_cast<CefRenderWidgetHostViewOSR*>(rvh->GetWidget()->GetView());
- touch_insert_handle_menu_show_ = true;
if (view) {
CefTouchSelectionControllerClientOSR* touch_client =
static_cast<CefTouchSelectionControllerClientOSR*>(
@@ -1750,6 +1764,23 @@ void AlloyBrowserHostImpl::StartDragging(
}
}
+void AlloyBrowserHostImpl::ShowPopupMenu(
+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection) {
+ if (platform_delegate_) {
+ platform_delegate_->ShowPopupMenu(std::move(popup_client), bounds,
+ item_height, item_font_size, selected_item,
+ std::move(menu_items), right_aligned,
+ allow_multiple_selection);
+ }
+}
+
void AlloyBrowserHostImpl::UpdateDragCursor(
ui::mojom::DragOperation operation) {
if (platform_delegate_)
@@ -28,6 +28,7 @@
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#include "extensions/common/mojom/view_type.mojom-forward.h"
+#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
class CefAudioCapturer;
class CefBrowserInfo;
@@ -207,9 +208,20 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
/* ohos webview begin */
void SetBackgroundColor(int color) override;
void SetTouchInsertHandleMenuShow(bool show) {
- touch_insert_handle_menu_show_ = show;
+ web_contents()->SetTouchInsertHandleMenuShow(show);
}
- bool GetTouchInsertHandleMenuShow() { return touch_insert_handle_menu_show_; }
+ bool GetTouchInsertHandleMenuShow() {
+ return web_contents()->GetTouchInsertHandleMenuShow();
+ }
+ void ShowPopupMenu(
+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection);
/* ohos webview end */
// content::WebContentsDelegate methods.
@@ -13,8 +13,6 @@
#include "libcef/browser/context.h"
#include "libcef/browser/devtools/devtools_manager_delegate.h"
#include "libcef/browser/extensions/extension_system_factory.h"
-#include "libcef/browser/net/chrome_scheme_handler.h"
-#include "libcef/browser/printing/constrained_window_views_client.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/app_manager.h"
#include "libcef/common/extensions/extensions_util.h"
@@ -25,11 +23,8 @@
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/media/router/chrome_media_router_factory.h"
#include "chrome/browser/net/system_network_context_manager.h"
-#include "chrome/browser/plugins/plugin_finder.h"
#include "chrome/common/chrome_switches.h"
-#include "components/constrained_window/constrained_window_views.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/network_service_instance.h"
#include "content/public/common/result_codes.h"
@@ -92,12 +87,31 @@
#include "chrome/browser/component_updater/widevine_cdm_component_installer.h"
#endif
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+#include "libcef/browser/net/chrome_scheme_handler.h"
+#endif
+
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "components/constrained_window/constrained_window_views.h"
+#include "libcef/browser/printing/constrained_window_views_client.h"
+#endif
+
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
+#include "chrome/browser/plugins/plugin_finder.h"
+#endif
+
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/media/router/chrome_media_router_factory.h"
+#endif
+
AlloyBrowserMainParts::AlloyBrowserMainParts(
content::MainFunctionParams parameters)
: BrowserMainParts(), parameters_(std::move(parameters)) {}
AlloyBrowserMainParts::~AlloyBrowserMainParts() {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
constrained_window::SetConstrainedWindowViewsClient(nullptr);
+#endif
}
int AlloyBrowserMainParts::PreEarlyInitialization() {
@@ -111,7 +125,9 @@ int AlloyBrowserMainParts::PreEarlyInitialization() {
}
void AlloyBrowserMainParts::ToolkitInitialized() {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
SetConstrainedWindowViewsClient(CreateCefConstrainedWindowViewsClient());
+#endif
#if defined(USE_AURA)
CHECK(aura::Env::GetInstance());
@@ -147,7 +163,9 @@ void AlloyBrowserMainParts::PreCreateMainMessageLoop() {
ChromeBrowserMainPartsWin::SetupInstallerUtilStrings();
#endif // BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
media_router::ChromeMediaRouterFactory::DoPlatformInit();
+#endif
}
void AlloyBrowserMainParts::PostCreateMainMessageLoop() {
@@ -237,10 +255,14 @@ int AlloyBrowserMainParts::PreMainMessageLoopRun() {
InitializeWinParentalControls();
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
// Triggers initialization of the singleton instance on UI thread.
PluginFinder::GetInstance()->Init();
+#endif
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
scheme::RegisterWebUIControllerFactory();
+#endif
#if BUILDFLAG(ENABLE_MEDIA_FOUNDATION_WIDEVINE_CDM) || \
BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
@@ -28,7 +28,6 @@
#include "libcef/browser/extensions/extension_system.h"
#include "libcef/browser/extensions/extension_web_contents_observer.h"
#include "libcef/browser/media_capture_devices_dispatcher.h"
-#include "libcef/browser/net/chrome_scheme_handler.h"
#include "libcef/browser/net/throttle_handler.h"
#include "libcef/browser/net_service/cookie_manager_impl.h"
#include "libcef/browser/net_service/login_delegate.h"
@@ -36,7 +35,6 @@
#include "libcef/browser/net_service/resource_request_handler_wrapper.h"
#include "libcef/browser/net_service/restrict_cookie_manager.h"
#include "libcef/browser/prefs/renderer_prefs.h"
-#include "libcef/browser/printing/print_view_manager.h"
#include "libcef/browser/speech_recognition_manager_delegate.h"
#include "libcef/browser/ssl_info_impl.h"
#include "libcef/browser/thread_util.h"
@@ -66,36 +64,24 @@
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/profile_network_context_service_factory.h"
#include "chrome/browser/net/system_network_context_manager.h"
-#include "chrome/browser/pdf/chrome_pdf_stream_delegate.h"
-#include "chrome/browser/plugins/pdf_iframe_navigation_throttle.h"
-#include "chrome/browser/plugins/plugin_info_host_impl.h"
-#include "chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h"
#include "chrome/browser/plugins/plugin_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/renderer_updater.h"
#include "chrome/browser/profiles/renderer_updater_factory.h"
-#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/google_url_loader_throttle.h"
-#include "chrome/common/pdf_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
-#include "chrome/services/printing/printing_service.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/embedder_support/switches.h"
#include "components/embedder_support/user_agent_utils.h"
-#include "components/pdf/browser/pdf_navigation_throttle.h"
-#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
-#include "components/pdf/browser/pdf_web_contents_helper.h"
-#include "components/pdf/common/internal_plugin_helpers.h"
#include "components/spellcheck/common/spellcheck.mojom.h"
#include "components/version_info/version_info.h"
-#include "content/browser/plugin_service_impl.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_ppapi_host.h"
@@ -180,6 +166,37 @@
#include "chrome/browser/spellchecker/spell_check_panel_host_impl.h"
#endif
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+#include "libcef/browser/net/chrome_scheme_handler.h"
+#endif
+
+#if BUILDFLAG(IS_OHOS)
+#include "printing/buildflags/buildflags.h"
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "chrome/services/printing/printing_service.h"
+#include "libcef/browser/printing/print_view_manager.h"
+#endif
+#endif
+
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
+#include "chrome/browser/plugins/plugin_info_host_impl.h"
+#include "chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h"
+#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
+#include "content/browser/plugin_service_impl.h"
+#endif
+
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
+#include "chrome/browser/pdf/chrome_pdf_stream_delegate.h"
+#include "chrome/browser/plugins/pdf_iframe_navigation_throttle.h"
+#include "chrome/common/pdf_util.h"
+#include "components/pdf/browser/pdf_navigation_throttle.h"
+#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
+#include "components/pdf/browser/pdf_web_contents_helper.h"
+#include "components/pdf/common/internal_plugin_helpers.h"
+#else
+#include "content/public/browser/url_loader_request_interceptor.h"
+#endif
+
namespace {
void TransferVector(const std::vector<std::string>& source,
std::vector<CefString>& target) {
@@ -644,6 +661,7 @@ int GetCrashSignalFD(const base::CommandLine& command_line) {
}
#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
// From chrome/browser/plugins/chrome_content_browser_client_plugins_part.cc.
void BindPluginInfoHost(
int render_process_id,
@@ -659,6 +677,7 @@ void BindPluginInfoHost(
std::make_unique<PluginInfoHostImpl>(render_process_id, profile),
std::move(receiver));
}
+#endif
base::FilePath GetRootCachePath() {
// The CefContext::ValidateCachePath method enforces the requirement that all
@@ -817,7 +836,11 @@ void AlloyContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
bool AlloyContentBrowserClient::IsWebUIAllowedToMakeNetworkRequests(
const url::Origin& origin) {
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
return scheme::IsWebUIAllowedToMakeNetworkRequests(origin);
+#else
+ return false;
+#endif
}
bool AlloyContentBrowserClient::IsHandledURL(const GURL& url) {
@@ -1207,7 +1230,7 @@ bool AlloyContentBrowserClient::CanCreateWindow(
if (!browser_host) {
return false;
}
- if (!browser_host->settings().javascript_can_open_windows_automatically) {
+ if (!browser_host->settings().javascript_can_open_windows_automatically && !user_gesture) {
LOG(INFO) << "javascript_can_open_windows_automatically false";
return false;
}
@@ -1238,7 +1261,7 @@ bool AlloyContentBrowserClient::CanCreateWindow(
CefRefPtr<CefBrowserHostBase> browser_host =
CefBrowserHostBase::GetBrowserForContents(web_contents);
- if (!browser_host->settings().javascript_can_open_windows_automatically) {
+ if (!browser_host->settings().javascript_can_open_windows_automatically && !user_gesture) {
LOG(INFO) << "javascript_can_open_windows_automatically false";
return false;
}
@@ -1270,7 +1293,9 @@ bool AlloyContentBrowserClient::OverrideWebPreferencesAfterNavigation(
void AlloyContentBrowserClient::BrowserURLHandlerCreated(
content::BrowserURLHandler* handler) {
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
scheme::BrowserURLHandlerCreated(handler);
+#endif
}
std::string AlloyContentBrowserClient::GetDefaultDownloadName() {
@@ -1279,9 +1304,11 @@ std::string AlloyContentBrowserClient::GetDefaultDownloadName() {
void AlloyContentBrowserClient::DidCreatePpapiPlugin(
content::BrowserPpapiHost* browser_host) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
browser_host->GetPpapiHost()->AddHostFactoryFilter(
std::unique_ptr<ppapi::host::HostFactory>(
new ChromeBrowserPepperHostFactory(browser_host)));
+#endif
}
std::unique_ptr<content::DevToolsManagerDelegate>
@@ -1302,6 +1329,7 @@ void AlloyContentBrowserClient::
},
&render_frame_host));
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
associated_registry.AddInterface(base::BindRepeating(
[](content::RenderFrameHost* render_frame_host,
mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost>
@@ -1310,7 +1338,9 @@ void AlloyContentBrowserClient::
render_frame_host);
},
&render_frame_host));
+#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
associated_registry.AddInterface(base::BindRepeating(
[](content::RenderFrameHost* render_frame_host,
mojo::PendingAssociatedReceiver<pdf::mojom::PdfService> receiver) {
@@ -1318,6 +1348,7 @@ void AlloyContentBrowserClient::
render_frame_host);
},
&render_frame_host));
+#endif
}
std::vector<std::unique_ptr<content::NavigationThrottle>>
@@ -1325,6 +1356,7 @@ AlloyContentBrowserClient::CreateThrottlesForNavigation(
content::NavigationHandle* navigation_handle) {
throttle::NavigationThrottleList throttles;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
if (extensions::ExtensionsEnabled()) {
auto pdf_iframe_throttle =
PDFIFrameNavigationThrottle::MaybeCreateThrottleFor(navigation_handle);
@@ -1336,6 +1368,7 @@ AlloyContentBrowserClient::CreateThrottlesForNavigation(
if (pdf_throttle)
throttles.push_back(std::move(pdf_throttle));
}
+#endif
throttle::CreateThrottlesForNavigation(navigation_handle, throttles);
@@ -1351,9 +1384,11 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles(
int frame_tree_node_id) {
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
// Used to substitute View ID for PDF contents when using the PDF plugin.
result.push_back(std::make_unique<PluginResponseInterceptorURLLoaderThrottle>(
request.destination, frame_tree_node_id));
+#endif
Profile* profile = Profile::FromBrowserContext(browser_context);
@@ -1376,6 +1411,7 @@ AlloyContentBrowserClient::WillCreateURLLoaderRequestInterceptors(
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
interceptors;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
if (extensions::ExtensionsEnabled()) {
auto pdf_interceptor =
pdf::PdfURLLoaderRequestInterceptor::MaybeCreateInterceptor(
@@ -1383,6 +1419,7 @@ AlloyContentBrowserClient::WillCreateURLLoaderRequestInterceptors(
if (pdf_interceptor)
interceptors.push_back(std::move(pdf_interceptor));
}
+#endif
return interceptors;
}
@@ -1403,8 +1440,10 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
service_manager::BinderRegistry* registry,
blink::AssociatedInterfaceRegistry* associated_registry,
content::RenderProcessHost* host) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
associated_registry->AddInterface(
base::BindRepeating(&BindPluginInfoHost, host->GetID()));
+#endif
if (extensions::ExtensionsEnabled()) {
associated_registry->AddInterface(base::BindRepeating(
@@ -1490,6 +1529,10 @@ void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
content::CreateFileURLLoaderFactory(
browser_context->GetPath(),
browser_context->GetSharedCorsOriginAccessList()));
+ factories->emplace(url::kResourcesScheme,
+ content::CreateFileURLLoaderFactory(
+ browser_context->GetPath(),
+ browser_context->GetSharedCorsOriginAccessList()));
#endif
if (!extensions::ExtensionsEnabled())
return;
@@ -1621,6 +1664,11 @@ bool AlloyContentBrowserClient::ConfigureNetworkContextParams(
// TODO(cef): Remove this and add required NetworkIsolationKeys,
// this is currently not the case and this was not required pre M84.
network_context_params->require_network_isolation_key = false;
+#if BUILDFLAG(IS_OHOS)
+ network_context_params->initial_ssl_config = network::mojom::SSLConfig::New();
+ network_context_params->initial_ssl_config->version_min =
+ network::mojom::SSLVersion::kTLS1;
+#endif
return true;
}
@@ -1789,11 +1837,15 @@ base::flat_set<std::string>
AlloyContentBrowserClient::GetPluginMimeTypesWithExternalHandlers(
content::BrowserContext* browser_context) {
base::flat_set<std::string> mime_types;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
auto map = PluginUtils::GetMimeTypeToExtensionIdMap(browser_context);
for (const auto& pair : map)
mime_types.insert(pair.first);
+#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
if (pdf::IsInternalPluginExternallyHandled())
mime_types.insert(pdf::kInternalPluginMimeType);
+#endif
return mime_types;
}
@@ -1808,6 +1860,7 @@ bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed(
->IsFullCookieAccessAllowed(url, site_for_cookies, top_frame_origin);
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
bool AlloyContentBrowserClient::ShouldAllowPluginCreation(
const url::Origin& embedder_origin,
const content::PepperPluginInfo& plugin_info) {
@@ -1817,6 +1870,7 @@ bool AlloyContentBrowserClient::ShouldAllowPluginCreation(
return true;
}
+#endif
#if BUILDFLAG(IS_OHOS)
bool AlloyContentBrowserClient::ShouldTryToUseExistingProcessHost(
@@ -1895,10 +1949,14 @@ void AlloyContentBrowserClient::OnWebContentsCreated(
bool AlloyContentBrowserClient::IsFindInPageDisabledForOrigin(
const url::Origin& origin) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
// 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 base::FeatureList::IsEnabled(chrome_pdf::features::kPdfUnseasoned) &&
IsPdfExtensionOrigin(origin);
+#else
+ return false;
+#endif
}
CefRefPtr<CefRequestContextImpl> AlloyContentBrowserClient::request_context()
@@ -244,9 +244,11 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
const GURL& scope,
const net::SiteForCookies& site_for_cookies,
const absl::optional<url::Origin>& top_frame_origin) override;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
bool ShouldAllowPluginCreation(
const url::Origin& embedder_origin,
const content::PepperPluginInfo& plugin_info) override;
+#endif
void OnWebContentsCreated(content::WebContents* web_contents) override;
bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override;
@@ -10,14 +10,11 @@
#include "libcef/browser/extensions/extension_system.h"
#include "libcef/browser/extensions/extension_view_host.h"
#include "libcef/browser/extensions/extension_web_contents_observer.h"
-#include "libcef/browser/printing/print_view_manager.h"
#include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/net/url_util.h"
#include "libcef/features/runtime_checks.h"
#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"
@@ -31,12 +28,23 @@
#include "printing/mojom/print.mojom.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
+#if BUILDFLAG(IS_OHOS)
+#include "printing/buildflags/buildflags.h"
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "libcef/browser/printing/print_view_manager.h"
+#include "chrome/browser/printing/print_view_manager.h"
+#include "chrome/browser/printing/print_view_manager_common.h"
+#endif
+#endif
+
namespace {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
printing::CefPrintViewManager* GetPrintViewManager(
content::WebContents* web_contents) {
return printing::CefPrintViewManager::FromWebContents(web_contents);
}
+#endif
} // namespace
@@ -181,7 +189,9 @@ void CefBrowserPlatformDelegateAlloy::BrowserCreated(
web_contents_->SetDelegate(static_cast<AlloyBrowserHostImpl*>(browser));
PrefsTabHelper::CreateForWebContents(web_contents_);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
printing::CefPrintViewManager::CreateForWebContents(web_contents_);
+#endif
if (extensions::ExtensionsEnabled()) {
// Used by the tabs extension API.
@@ -363,6 +373,7 @@ bool CefBrowserPlatformDelegateAlloy::IsPrintPreviewSupported() const {
}
void CefBrowserPlatformDelegateAlloy::Print() {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
REQUIRE_ALLOY_RUNTIME();
auto contents_to_use = printing::GetWebContentsToUse(web_contents_);
@@ -378,12 +389,14 @@ void CefBrowserPlatformDelegateAlloy::Print() {
} else {
GetPrintViewManager(contents_to_use)->PrintNow(rfh_to_use);
}
+#endif
}
void CefBrowserPlatformDelegateAlloy::PrintToPDF(
const CefString& path,
const CefPdfPrintSettings& settings,
CefRefPtr<CefPdfPrintCallback> callback) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
REQUIRE_ALLOY_RUNTIME();
auto contents_to_use = printing::GetWebContentsToUse(web_contents_);
@@ -402,6 +415,7 @@ void CefBrowserPlatformDelegateAlloy::PrintToPDF(
GetPrintViewManager(contents_to_use)
->PrintToPDF(rfh_to_use, base::FilePath(path), settings,
std::move(pdf_callback));
+#endif
}
void CefBrowserPlatformDelegateAlloy::Find(const CefString& searchText,
@@ -19,9 +19,7 @@
#include "chrome/browser/component_updater/chrome_component_updater_configurator.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
-#include "chrome/browser/printing/background_printing_manager.h"
#include "chrome/browser/printing/print_job_manager.h"
-#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "chrome/browser/ui/prefs/pref_watcher.h"
#include "components/component_updater/component_updater_service.h"
#include "components/component_updater/timer_update_scheduler.h"
@@ -94,7 +92,9 @@ void ChromeBrowserProcessAlloy::CleanupOnUIThread() {
// tasks to run once teardown has started.
print_job_manager_->Shutdown();
print_job_manager_.reset(nullptr);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
print_preview_dialog_controller_ = nullptr;
+#endif
profile_manager_.reset();
event_router_forwarder_ = nullptr;
@@ -112,16 +112,20 @@ void ChromeBrowserProcessAlloy::CleanupOnUIThread() {
if (pref_watcher)
pref_watcher->Shutdown();
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Unregister observers for |background_printing_manager_|.
if (background_printing_manager_) {
background_printing_manager_->DeletePreviewContentsForBrowserContext(
profile);
}
+#endif
}
local_state_.reset();
browser_policy_connector_.reset();
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
background_printing_manager_.reset();
+#endif
field_trial_list_.reset();
component_updater_.reset();
@@ -259,20 +263,28 @@ printing::PrintJobManager* ChromeBrowserProcessAlloy::print_job_manager() {
printing::PrintPreviewDialogController*
ChromeBrowserProcessAlloy::print_preview_dialog_controller() {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (!print_preview_dialog_controller_.get()) {
print_preview_dialog_controller_ =
new printing::PrintPreviewDialogController();
}
return print_preview_dialog_controller_.get();
+#else
+ return nullptr;
+#endif
}
printing::BackgroundPrintingManager*
ChromeBrowserProcessAlloy::background_printing_manager() {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (!background_printing_manager_.get()) {
background_printing_manager_.reset(
new printing::BackgroundPrintingManager());
}
return background_printing_manager_.get();
+#else
+ return nullptr;
+#endif
}
IntranetRedirectDetector*
@@ -18,6 +18,14 @@
#include "chrome/browser/extensions/event_router_forwarder.h"
#include "media/media_buildflags.h"
+#if BUILDFLAG(IS_OHOS)
+#include "printing/buildflags/buildflags.h"
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "chrome/browser/printing/background_printing_manager.h"
+#include "chrome/browser/printing/print_preview_dialog_controller.h"
+#endif
+#endif
+
namespace extensions {
class ExtensionsBrowserClient;
class ExtensionsClient;
@@ -127,10 +135,12 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
std::unique_ptr<ChromeProfileManagerAlloy> profile_manager_;
scoped_refptr<extensions::EventRouterForwarder> event_router_forwarder_;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
scoped_refptr<printing::PrintPreviewDialogController>
print_preview_dialog_controller_;
std::unique_ptr<printing::BackgroundPrintingManager>
background_printing_manager_;
+#endif
std::unique_ptr<PrefService> local_state_;
// Must be destroyed after |local_state_|.
std::unique_ptr<policy::ChromeBrowserPolicyConnector>
@@ -8,7 +8,6 @@
#include <utility>
#include "libcef/browser/context.h"
-#include "libcef/browser/media_router/media_router_manager.h"
#include "libcef/browser/request_context_impl.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/cef_switches.h"
@@ -28,6 +27,10 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "libcef/browser/media_router/media_router_manager.h"
+#endif
+
using content::BrowserThread;
namespace {
@@ -212,8 +215,10 @@ void CefBrowserContext::Shutdown() {
// Unregister the context first to avoid re-entrancy during shutdown.
g_manager.Get().RemoveImpl(this, cache_path_);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
// Destroy objects that may hold references to the MediaRouter.
media_router_manager_.reset();
+#endif
// Invalidate any Getter references to this object.
weak_ptr_factory_.InvalidateWeakPtrs();
@@ -264,6 +269,7 @@ CefBrowserContext* CefBrowserContext::FromProfile(const Profile* profile) {
if (cef_context)
return cef_context;
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (cef::IsChromeRuntimeEnabled()) {
auto* original_profile = profile->GetOriginalProfile();
if (original_profile != profile) {
@@ -273,6 +279,7 @@ CefBrowserContext* CefBrowserContext::FromProfile(const Profile* profile) {
return FromBrowserContext(original_profile);
}
}
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
return nullptr;
}
@@ -403,6 +410,7 @@ network::mojom::NetworkContext* CefBrowserContext::GetNetworkContext() {
return browser_context->GetDefaultStoragePartition()->GetNetworkContext();
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
CefMediaRouterManager* CefBrowserContext::GetMediaRouterManager() {
CEF_REQUIRE_UIT();
if (!media_router_manager_) {
@@ -410,6 +418,7 @@ CefMediaRouterManager* CefBrowserContext::GetMediaRouterManager() {
}
return media_router_manager_.get();
}
+#endif
CefBrowserContext::CookieableSchemes CefBrowserContext::GetCookieableSchemes()
const {
@@ -22,6 +22,10 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/origin.h"
+#if BUILDFLAG(IS_OHOS)
+#include "media/media_buildflags.h"
+#endif
+
/*
// Classes used in request processing (network, storage, service, etc.):
//
@@ -220,7 +224,9 @@ class CefBrowserContext {
scoped_refptr<CefIOThreadState> iothread_state_;
CookieableSchemes cookieable_schemes_;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
std::unique_ptr<CefMediaRouterManager> media_router_manager_;
+#endif
// CefRequestContextImpl objects referencing this object.
std::set<CefRequestContextImpl*> request_context_set_;
@@ -6,8 +6,6 @@
#include "libcef/common/extensions/extensions_util.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
-#include "chrome/browser/media/router/chrome_media_router_factory.h"
-#include "chrome/browser/plugins/plugin_prefs_factory.h"
#include "chrome/browser/profiles/renderer_updater_factory.h"
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/themes/theme_service_factory.h"
@@ -16,12 +14,30 @@
#include "extensions/browser/api/storage/storage_frontend.h"
#include "extensions/browser/renderer_startup_helper.h"
+#if BUILDFLAG(IS_OHOS)
+#include "ppapi/buildflags/buildflags.h"
+#if BUILDFLAG(ENABLE_PLUGINS)
+#include "chrome/browser/plugins/plugin_prefs_factory.h"
+#endif
+#endif
+
+#if BUILDFLAG(IS_OHOS)
+#include "media/media_buildflags.h"
+#if BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/media/router/chrome_media_router_factory.h"
+#endif
+#endif
+
namespace cef {
void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
CookieSettingsFactory::GetInstance();
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
media_router::ChromeMediaRouterFactory::GetInstance();
+#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
PluginPrefsFactory::GetInstance();
+#endif
PrefsTabHelper::GetServiceInstance();
RendererUpdaterFactory::GetInstance();
SpellcheckServiceFactory::GetInstance();
@@ -50,6 +50,7 @@
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/browser_process.h"
#include "content/public/common/mhtml_generation_params.h"
+#include "libcef/browser/navigation_state_serializer.h"
#include "libcef/browser/javascript/oh_javascript_injector.h"
#include "ui/base/resource/resource_bundle.h"
#endif
@@ -498,6 +499,7 @@ void CefBrowserHostBase::UpdateBrowserSettings(
// browser_settings.file_access_from_file_urls;
/* ohos webview add*/
settings_.force_dark_mode_enabled = browser_settings.force_dark_mode_enabled;
+ settings_.dark_prefer_color_scheme_enabled = browser_settings.dark_prefer_color_scheme_enabled;
settings_.javascript_can_open_windows_automatically =
browser_settings.javascript_can_open_windows_automatically;
settings_.loads_images_automatically =
@@ -519,6 +521,10 @@ void CefBrowserHostBase::UpdateBrowserSettings(
settings_.viewport_meta_enabled = browser_settings.viewport_meta_enabled;
settings_.user_gesture_required = browser_settings.user_gesture_required;
settings_.pinch_smooth_mode = browser_settings.pinch_smooth_mode;
+#if BUILDFLAG(IS_OHOS)
+ settings_.hide_vertical_scrollbars = browser_settings.hide_vertical_scrollbars;
+ settings_.hide_horizontal_scrollbars = browser_settings.hide_horizontal_scrollbars;
+#endif
}
void CefBrowserHostBase::SetWebPreferences(
@@ -721,8 +727,7 @@ CefString CefBrowserHostBase::GetOriginalUrl() {
void CefBrowserHostBase::PutNetworkAvailable(bool available) {
auto frame = GetMainFrame();
if (frame && frame->IsValid()) {
- static_cast<CefFrameHostImpl*>(frame.get())
- ->SetJsOnlineProperty(available);
+ static_cast<CefFrameHostImpl*>(frame.get())->SetJsOnlineProperty(available);
}
}
@@ -767,7 +772,8 @@ void CefBrowserHostBase::ExitFullScreen() {
return;
}
wc->GetMainFrame()->AllowInjectingJavaScript();
- std::string jscode("{if(document.fullscreenElement){document.exitFullscreen()}}");
+ std::string jscode(
+ "{if(document.fullscreenElement){document.exitFullscreen()}}");
wc->GetMainFrame()->ExecuteJavaScript(base::UTF8ToUTF16(jscode),
base::NullCallback());
}
@@ -975,6 +981,59 @@ void CefBrowserHostBase::RemoveCache(bool include_disk_files) {
return;
}
}
+void CefBrowserHostBase::ScrollPageUpDown(bool is_up,
+ bool is_half,
+ float view_height) {
+ auto frame = GetMainFrame();
+ if (frame && frame->IsValid()) {
+ static_cast<CefFrameHostImpl*>(frame.get())
+ ->ScrollPageUpDown(is_up, is_half, view_height);
+ }
+}
+
+void CefBrowserHostBase::ScrollTo(float x,
+ float y) {
+ auto frame = GetMainFrame();
+ if (frame && frame->IsValid()) {
+ static_cast<CefFrameHostImpl*>(frame.get())
+ ->ScrollTo(x, y);
+ }
+}
+
+void CefBrowserHostBase::ScrollBy(float delta_x,
+ float delta_y) {
+ auto frame = GetMainFrame();
+ if (frame && frame->IsValid()) {
+ static_cast<CefFrameHostImpl*>(frame.get())
+ ->ScrollBy(delta_x, delta_y);
+ }
+}
+
+void CefBrowserHostBase::SlideScroll(float vx,
+ float vy) {
+ auto frame = GetMainFrame();
+ if (frame && frame->IsValid()) {
+ static_cast<CefFrameHostImpl*>(frame.get())
+ ->SlideScroll(vx, vy);
+ }
+}
+
+CefRefPtr<CefBinaryValue> CefBrowserHostBase::GetWebState() {
+ auto web_contents = GetWebContents();
+ if (!web_contents) {
+ return nullptr;
+ }
+
+ return NavigationStateSerializer::WriteNavigationStatus(*web_contents);
+}
+
+bool CefBrowserHostBase::RestoreWebState(const CefRefPtr<CefBinaryValue> state) {
+ auto web_contents = GetWebContents();
+ if (!web_contents || !state) {
+ return false;
+ }
+ return NavigationStateSerializer::RestoreNavigationStatus(*web_contents, state);
+}
#endif // IS_OHOS
void CefBrowserHostBase::StopLoad() {
@@ -1539,19 +1598,32 @@ void CefBrowserHostBase::ClosePort(CefString& portHandle) {
}
void CefBrowserHostBase::PostPortMessage(CefString& portHandle,
- CefString& data) {
+ CefRefPtr<CefValue> data) {
auto web_contents = GetWebContents();
if (!web_contents) {
LOG(ERROR) << "GetWebContents null";
return;
}
- std::u16string message(base::UTF8ToUTF16(data.ToString()));
+ blink::WebMessagePort::Message message;
+ if (data->GetType() == VTYPE_STRING) {
+ message = blink::WebMessagePort::Message(base::UTF8ToUTF16(data->GetString().ToString()));
+ } else if (data->GetType() == VTYPE_BINARY) {
+ CefRefPtr<CefBinaryValue> binValue = data->GetBinary();
+ size_t len = binValue->GetSize();
+ std::vector<uint8_t> arr(len);
+ binValue->GetData(&arr[0], len, 0);
+ message = blink::WebMessagePort::Message(std::move(arr));
+ } else {
+ LOG(ERROR) << "CefBrowserHostBase::PostPortMessage not support type";
+ return;
+ }
+
// find the WebMessagePort in map
for (auto iter = portMap_.begin(); iter != portMap_.end(); ++iter) {
if (portHandle.ToString().compare(std::to_string(iter->first.first)) == 0) {
if (iter->second.first.CanPostMessage()) {
- iter->second.first.PostMessage(blink::WebMessagePort::Message(message));
+ iter->second.first.PostMessage(std::move(message));
} else {
LOG(ERROR) << "port can not post messsage";
}
@@ -1559,8 +1631,7 @@ void CefBrowserHostBase::PostPortMessage(CefString& portHandle,
} else if (portHandle.ToString().compare(
std::to_string(iter->first.second)) == 0) {
if (iter->second.second.CanPostMessage()) {
- iter->second.second.PostMessage(
- blink::WebMessagePort::Message(message));
+ iter->second.second.PostMessage(std::move(message));
} else {
LOG(ERROR) << "port can not post messsage";
}
@@ -1574,7 +1645,7 @@ void CefBrowserHostBase::PostPortMessage(CefString& portHandle,
// WebMessagePort of the pipe.
void CefBrowserHostBase::SetPortMessageCallback(
CefString& portHandle,
- CefRefPtr<CefJavaScriptResultCallback> callback) {
+ CefRefPtr<CefWebMessageReceiver> callback) {
auto web_contents = GetWebContents();
if (!web_contents) {
LOG(ERROR) << "GetWebContents null";
@@ -1640,7 +1711,7 @@ WebMessageReceiverImpl::~WebMessageReceiverImpl() {
}
void WebMessageReceiverImpl::SetOnMessageCallback(
- CefRefPtr<CefJavaScriptResultCallback> callback) {
+ CefRefPtr<CefWebMessageReceiver> callback) {
LOG(INFO) << "WebMessageReceiverImpl::SetOnMessageCallback ";
callback_ = callback;
}
@@ -1650,9 +1721,17 @@ bool WebMessageReceiverImpl::OnMessage(blink::WebMessagePort::Message message) {
LOG(INFO) << "OnMessage start";
// Pass the message on to the receiver.
if (callback_) {
- LOG(INFO) << "OnMessage:" << message.data;
- std::u16string data = message.data;
- callback_->OnJavaScriptExeResult(base::UTF16ToUTF8(data));
+ CefRefPtr<CefValue> data = CefValue::Create();
+ if (!message.data.empty()) {
+ data->SetString(base::UTF16ToUTF8(message.data));
+ } else {
+ std::vector<uint8_t> vecBinary = message.array_buffer;
+ CefRefPtr<CefBinaryValue> value =
+ CefBinaryValue::Create(vecBinary.data(), vecBinary.size());
+ data->SetBinary(value);
+ }
+
+ callback_->OnMessage(data);
} else {
LOG(ERROR) << "u should set callback to receive message";
}
@@ -1717,8 +1796,10 @@ void CefBrowserHostBase::LoadWithDataAndBaseUrl(const CefString& baseUrl,
const CefString& encoding,
const CefString& historyUrl) {
if (!CEF_CURRENTLY_ON_UIT()) {
- CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefBrowserHostBase::LoadWithDataAndBaseUrl,
- this, baseUrl, data, mimeType, encoding, historyUrl));
+ CEF_POST_TASK(
+ CEF_UIT,
+ base::BindOnce(&CefBrowserHostBase::LoadWithDataAndBaseUrl, this,
+ baseUrl, data, mimeType, encoding, historyUrl));
return;
}
std::string dataBase = data.empty() ? "" : data;
@@ -1761,7 +1842,7 @@ void CefBrowserHostBase::LoadWithData(const CefString& data,
const CefString& encoding) {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefBrowserHostBase::LoadWithData,
- this, data, mimeType, encoding));
+ this, data, mimeType, encoding));
return;
}
std::string dataBase = data.empty() ? "" : data;
@@ -1835,6 +1916,48 @@ bool CefBrowserHostBase::GetWebDebuggingAccess() {
return is_web_debugging_access_;
}
+#if BUILDFLAG(IS_OHOS)
+void CefBrowserHostBase::SetFileAccess(bool flag) {
+ base::AutoLock lock_scope(state_lock_);
+ if (file_access_ == flag) {
+ return;
+ }
+ file_access_ = flag;
+}
+
+void CefBrowserHostBase::SetBlockNetwork(bool flag) {
+ base::AutoLock lock_scope(state_lock_);
+ if (network_blocked_ == flag) {
+ return;
+ }
+ network_blocked_ = flag;
+}
+
+void CefBrowserHostBase::SetCacheMode(int flag) {
+ base::AutoLock lock_scope(state_lock_);
+ if (cache_mode_ == flag) {
+ return;
+ }
+ cache_mode_ = flag;
+}
+
+
+bool CefBrowserHostBase::GetFileAccess() {
+ base::AutoLock lock_scope(state_lock_);
+ return file_access_;
+}
+
+bool CefBrowserHostBase::GetBlockNetwork() {
+ base::AutoLock lock_scope(state_lock_);
+ return network_blocked_;
+}
+
+int CefBrowserHostBase::GetCacheMode() {
+ base::AutoLock lock_scope(state_lock_);
+ return cache_mode_;
+}
+#endif
+
void CefBrowserHostBase::GetImageForContextNode() {
auto frame = GetMainFrame();
if (frame && frame->IsValid()) {
@@ -108,10 +108,10 @@ class WebMessageReceiverImpl : public blink::WebMessagePort::MessageReceiver {
// WebMessagePort::MessageReceiver implementation:
bool OnMessage(blink::WebMessagePort::Message message) override;
- void SetOnMessageCallback(CefRefPtr<CefJavaScriptResultCallback> callback);
+ void SetOnMessageCallback(CefRefPtr<CefWebMessageReceiver> callback);
private:
- CefRefPtr<CefJavaScriptResultCallback> callback_;
+ CefRefPtr<CefWebMessageReceiver> callback_;
};
struct CefHitData {
@@ -239,6 +239,12 @@ class CefBrowserHostBase : public CefBrowserHost,
CefString GetOriginalUrl() override;
void PutNetworkAvailable(bool available) override;
void RemoveCache(bool include_disk_files) override;
+ CefRefPtr<CefBinaryValue> GetWebState() override;
+ bool RestoreWebState(const CefRefPtr<CefBinaryValue> state) override;
+ void ScrollPageUpDown(bool is_up, bool is_half, float view_height) override;
+ void ScrollTo(float x, float y) override;
+ void ScrollBy(float delta_x, float delta_y) override;
+ void SlideScroll(float vx, float vy) override;
/* ohos webview end */
#endif
@@ -276,10 +282,10 @@ class CefBrowserHostBase : public CefBrowserHost,
std::vector<CefString>& ports,
CefString& targetUri) override;
void ClosePort(CefString& port_handle) override;
- void PostPortMessage(CefString& port_handle, CefString& data) override;
+ void PostPortMessage(CefString& port_handle, CefRefPtr<CefValue> message) override;
void SetPortMessageCallback(
CefString& port_handle,
- CefRefPtr<CefJavaScriptResultCallback> callback) override;
+ CefRefPtr<CefWebMessageReceiver> callback) override;
void DestroyAllWebMessagePorts() override;
#endif
CefString Title() override;
@@ -409,6 +415,18 @@ class CefBrowserHostBase : public CefBrowserHost,
void SetWebDebuggingAccess(bool isEnableDebug) override;
bool GetWebDebuggingAccess() override;
+#if BUILDFLAG(IS_OHOS)
+ void SetFileAccess(bool flag) override;
+ void SetBlockNetwork(bool flag) override;
+ void SetCacheMode(int flag) override;
+ bool GetFileAccess();
+ bool GetBlockNetwork();
+ int GetCacheMode();
+ bool file_access_ = false;
+ bool network_blocked_ = false;
+ int cache_mode_ = 0;
+#endif
+
#if BUILDFLAG(IS_OHOS)
bool ShouldShowLoadingUI() override;
#endif
@@ -5,11 +5,14 @@
#include "include/cef_browser.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
-#include "libcef/browser/chrome/chrome_browser_host_impl.h"
#include "libcef/browser/context.h"
#include "libcef/browser/thread_util.h"
#include "libcef/features/runtime.h"
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+#include "libcef/browser/chrome/chrome_browser_host_impl.h"
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+
namespace {
class CreateBrowserHelper {
@@ -138,10 +141,12 @@ CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync(
// static
CefRefPtr<CefBrowserHostBase> CefBrowserHostBase::Create(
CefBrowserCreateParams& create_params) {
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (cef::IsChromeRuntimeEnabled()) {
auto browser = ChromeBrowserHostImpl::Create(create_params);
return browser.get();
}
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
auto browser = AlloyBrowserHostImpl::Create(create_params);
return browser.get();
@@ -393,6 +393,18 @@ void CefBrowserPlatformDelegate::StopFinding(bool clearSelection) {
NOTIMPLEMENTED();
}
+void CefBrowserPlatformDelegate::ShowPopupMenu(
+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection) {
+ NOTIMPLEMENTED();
+}
+
// static
int CefBrowserPlatformDelegate::TranslateWebEventModifiers(
uint32 cef_modifiers) {
@@ -17,6 +17,7 @@
#include "base/callback_forward.h"
#include "extensions/common/mojom/view_type.mojom-forward.h"
#include "third_party/blink/public/common/page/drag_operation.h"
+#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
#include "third_party/blink/public/mojom/drag/drag.mojom-forward.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h"
@@ -359,6 +360,15 @@ class CefBrowserPlatformDelegate {
bool findNext,
bool newSession);
virtual void StopFinding(bool clearSelection);
+ virtual void ShowPopupMenu(
+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection);
protected:
// Allow deletion via std::unique_ptr only.
@@ -12,7 +12,6 @@
#include "build/build_config.h"
#include "libcef/browser/browser_host_base.h"
-#include "libcef/browser/chrome/browser_platform_delegate_chrome.h"
#include "libcef/browser/extensions/browser_platform_delegate_background.h"
#include "libcef/features/runtime_checks.h"
@@ -30,10 +29,16 @@
#endif
#if defined(TOOLKIT_VIEWS)
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
#include "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h"
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
#include "libcef/browser/views/browser_platform_delegate_views.h"
#endif
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+#include "libcef/browser/chrome/browser_platform_delegate_chrome.h"
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+
namespace {
std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
@@ -79,6 +84,7 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
const SkColor background_color = CefContext::Get()->GetBackgroundColor(
&create_params.settings, is_windowless ? STATE_ENABLED : STATE_DISABLED);
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (cef::IsChromeRuntimeEnabled()) {
// CefWindowInfo is not used in this case.
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
@@ -94,6 +100,7 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
return std::make_unique<CefBrowserPlatformDelegateChrome>(
std::move(native_delegate));
}
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (create_params.window_info) {
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
@@ -147,3 +147,14 @@ bool CefContextMenuParamsImpl::IsCustomMenu() {
CEF_VALUE_VERIFY_RETURN(false, false);
return !const_value().custom_items.empty();
}
+
+CefContextMenuParamsImpl::InputFieldType CefContextMenuParamsImpl::GetInputFieldType() {
+ CEF_VALUE_VERIFY_RETURN(false, CM_INPUTFIELDTYPE_NONE);
+ return static_cast<InputFieldType>(const_value().input_field_type);
+}
+
+CefContextMenuParamsImpl::SourceType CefContextMenuParamsImpl::GetSourceType() {
+ CEF_VALUE_VERIFY_RETURN(false, CM_SOURCETYPE_NONE);
+ return static_cast<SourceType>(const_value().source_type);
+}
+
@@ -41,6 +41,8 @@ class CefContextMenuParamsImpl
bool IsSpellCheckEnabled() override;
EditStateFlags GetEditStateFlags() override;
bool IsCustomMenu() override;
+ InputFieldType GetInputFieldType() override;
+ SourceType GetSourceType() override;
};
#endif // CEF_LIBCEF_BROWSER_CONTEXT_MENU_PARAMS_IMPL_H_
@@ -23,6 +23,10 @@
#include "content/public/browser/render_view_host.h"
#include "extensions/browser/extension_registry.h"
+#if BUILDFLAG(IS_OHOS)
+#include "printing/buildflags/buildflags.h"
+#endif
+
namespace extensions {
namespace {
@@ -52,10 +56,14 @@ content::WebContents* GetOwnerForGuestContents(content::WebContents* guest) {
return plugin_guest->owner_web_contents();
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Maybe it's a print preview dialog.
auto print_preview_controller =
g_browser_process->print_preview_dialog_controller();
return print_preview_controller->GetInitiator(guest);
+#else
+ return nullptr;
+#endif
}
CefRefPtr<CefBrowserHostBase> GetOwnerBrowserForGlobalId(
@@ -8,23 +8,33 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/values.h"
-#include "chrome/browser/pdf/pdf_extension_util.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/grit/component_extension_resources_map.h"
-#include "chrome/grit/pdf_resources_map.h"
#include "extensions/common/constants.h"
+#if BUILDFLAG(IS_OHOS)
+#include "pdf/buildflags.h"
+#if BUILDFLAG(ENABLE_PDF)
+#include "chrome/browser/pdf/pdf_extension_util.h"
+#include "chrome/grit/pdf_resources_map.h"
+#endif
+#endif
+
namespace extensions {
CefComponentExtensionResourceManager::CefComponentExtensionResourceManager() {
AddComponentResourceEntries(kComponentExtensionResources,
kComponentExtensionResourcesSize);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
AddComponentResourceEntries(kPdfResources, kPdfResourcesSize);
+#endif
base::Value dict(base::Value::Type::DICTIONARY);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
pdf_extension_util::AddStrings(
pdf_extension_util::PdfViewerContext::kPdfViewer, &dict);
pdf_extension_util::AddAdditionalData(/*enable_annotations=*/true, &dict);
+#endif
ui::TemplateReplacements pdf_viewer_replacements;
ui::TemplateReplacementsFromDictionaryValue(
@@ -21,7 +21,6 @@
#include "base/strings/string_tokenizer.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
-#include "chrome/browser/pdf/pdf_extension_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
#include "components/crx_file/id_util.h"
@@ -31,7 +30,6 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
-#include "content/public/browser/plugin_service.h"
#include "content/public/browser/render_process_host.h"
#include "extensions/browser/api/app_runtime/app_runtime_api.h"
#include "extensions/browser/extension_prefs.h"
@@ -52,6 +50,20 @@
#include "extensions/common/switches.h"
#include "net/base/mime_util.h"
+#if BUILDFLAG(IS_OHOS)
+#include "ppapi/buildflags/buildflags.h"
+#if BUILDFLAG(ENABLE_PLUGINS)
+#include "content/public/browser/plugin_service.h"
+#endif
+#endif
+
+#if BUILDFLAG(IS_OHOS)
+#include "pdf/buildflags.h"
+#if BUILDFLAG(ENABLE_PDF)
+#include "chrome/browser/pdf/pdf_extension_util.h"
+#endif
+#endif
+
using content::BrowserContext;
namespace extensions {
@@ -263,11 +275,13 @@ void CefExtensionSystem::Init() {
// the guest WebContents will be destroyed. This triggers a call to
// CefMimeHandlerViewGuestDelegate::OnGuestDetached which removes the
// routing ID association with the owner CefBrowser.
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
if (PdfExtensionEnabled()) {
LoadExtension(ParseManifest(pdf_extension_util::GetManifest()),
base::FilePath(FILE_PATH_LITERAL("pdf")), true /* internal */,
nullptr, nullptr);
}
+#endif
initialized_ = true;
}
@@ -683,10 +697,12 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) {
}
info.mime_types.push_back(mime_type_info);
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
content::PluginService* plugin_service =
content::PluginService::GetInstance();
plugin_service->RefreshPlugins();
plugin_service->RegisterInternalPlugin(info, true);
+#endif
}
}
@@ -707,10 +723,12 @@ void CefExtensionSystem::NotifyExtensionUnloaded(
if (handler && !handler->handler_url().empty()) {
base::FilePath path =
base::FilePath::FromUTF8Unsafe(extension->url().spec());
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
content::PluginService* plugin_service =
content::PluginService::GetInstance();
plugin_service->UnregisterInternalPlugin(path);
plugin_service->RefreshPlugins();
+#endif
}
registry_->TriggerOnUnloaded(extension, reason);
@@ -11,16 +11,29 @@
#include "libcef/browser/extensions/api/storage/sync_value_store_cache.h"
#include "libcef/browser/extensions/extension_web_contents_observer.h"
#include "libcef/browser/extensions/mime_handler_view_guest_delegate.h"
-#include "libcef/browser/printing/print_view_manager.h"
#include "base/memory/ptr_util.h"
-#include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h"
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
-#include "components/pdf/browser/pdf_web_contents_helper.h"
#include "components/zoom/zoom_controller.h"
#include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h"
#include "printing/mojom/print.mojom.h"
+#if BUILDFLAG(IS_OHOS)
+#include "printing/buildflags/buildflags.h"
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "libcef/browser/printing/print_view_manager.h"
+#endif
+#endif
+
+#if BUILDFLAG(IS_OHOS)
+#include "pdf/buildflags.h"
+#endif
+
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
+#include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h"
+#include "components/pdf/browser/pdf_web_contents_helper.h"
+#endif
+
namespace extensions {
CefExtensionsAPIClient::CefExtensionsAPIClient() {}
@@ -51,12 +64,16 @@ CefExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate(
void CefExtensionsAPIClient::AttachWebContentsHelpers(
content::WebContents* web_contents) const {
PrefsTabHelper::CreateForWebContents(web_contents);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
printing::CefPrintViewManager::CreateForWebContents(web_contents);
+#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
// Used by the PDF extension.
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>(
new ChromePDFWebContentsHelperClient()));
+#endif
// Used by the tabs extension API.
zoom::ZoomController::CreateForWebContents(web_contents);
@@ -294,11 +294,12 @@ void CefFrameHostImpl::RefreshAttributes() {
}
void CefFrameHostImpl::UpdateLocale(const CefString& locale) {
- SendToRenderFrame(__FUNCTION__,
- base::BindOnce([](const std::string& locale,
- const RenderFrameType& render_frame) {
- render_frame->UpdateLocale(locale);
- }, locale.ToString()));
+ SendToRenderFrame(__FUNCTION__, base::BindOnce(
+ [](const std::string& locale,
+ const RenderFrameType& render_frame) {
+ render_frame->UpdateLocale(locale);
+ },
+ locale.ToString()));
}
void CefFrameHostImpl::NotifyMoveOrResizeStarted() {
@@ -779,12 +780,13 @@ void CefFrameHostImpl::SetInitialScale(float scale) {
}
void CefFrameHostImpl::SetJsOnlineProperty(bool network_up) {
- SendToRenderFrame(__FUNCTION__,
- base::BindOnce(
- [](bool network_up, const RenderFrameType& render_frame) {
- render_frame->SetJsOnlineProperty(network_up);
- },
- network_up));
+ SendToRenderFrame(
+ __FUNCTION__,
+ base::BindOnce(
+ [](bool network_up, const RenderFrameType& render_frame) {
+ render_frame->SetJsOnlineProperty(network_up);
+ },
+ network_up));
}
void CefFrameHostImpl::GetImageForContextNode() {
@@ -804,16 +806,17 @@ void CefFrameHostImpl::PutZoomingForTextFactor(float factor) {
factor));
}
-void CefFrameHostImpl::GetImagesCallback(CefRefPtr<CefFrameHostImpl> frame,
- CefRefPtr<CefGetImagesCallback> callback, bool response) {
+void CefFrameHostImpl::GetImagesCallback(
+ CefRefPtr<CefFrameHostImpl> frame,
+ CefRefPtr<CefGetImagesCallback> callback,
+ bool response) {
if (auto browser = frame->GetBrowser()) {
callback->GetImages(response);
}
}
void CefFrameHostImpl::GetImagesWithResponse(
- cef::mojom::RenderFrame::GetImagesWithResponseCallback
- response_callback) {
+ cef::mojom::RenderFrame::GetImagesWithResponseCallback response_callback) {
SendToRenderFrame(
__FUNCTION__,
base::BindOnce(
@@ -826,17 +829,16 @@ void CefFrameHostImpl::GetImagesWithResponse(
}
void CefFrameHostImpl::GetImages(CefRefPtr<CefGetImagesCallback> callback) {
- GetImagesWithResponse(
- base::BindOnce(&CefFrameHostImpl::GetImagesCallback, base::Unretained(this),
- CefRefPtr<CefFrameHostImpl>(this), callback));
+ GetImagesWithResponse(base::BindOnce(
+ &CefFrameHostImpl::GetImagesCallback, base::Unretained(this),
+ CefRefPtr<CefFrameHostImpl>(this), callback));
}
void CefFrameHostImpl::RemoveCache(bool include_disk_files) {
SendToRenderFrame(__FUNCTION__,
- base::BindOnce(
- [](const RenderFrameType& render_frame) {
- render_frame->RemoveCache();
- }));
+ base::BindOnce([](const RenderFrameType& render_frame) {
+ render_frame->RemoveCache();
+ }));
if (include_disk_files) {
auto browser = GetBrowserHostBase();
@@ -857,9 +859,55 @@ void CefFrameHostImpl::RemoveCache(bool include_disk_files) {
base::Time(), base::Time::Max(),
content::BrowsingDataRemover::DATA_TYPE_CACHE,
content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB |
- content::BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB);
+ content::BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB);
}
}
+
+void CefFrameHostImpl::ScrollPageUpDown(bool is_up,
+ bool is_half,
+ float view_height) {
+ SendToRenderFrame(__FUNCTION__,
+ base::BindOnce(
+ [](bool is_up, bool is_half, float view_height,
+ const RenderFrameType& render_frame) {
+ render_frame->ScrollPageUpDown(is_up, is_half,
+ view_height);
+ },
+ is_up, is_half, view_height));
+}
+
+void CefFrameHostImpl::ScrollTo(float x,
+ float y) {
+ SendToRenderFrame(__FUNCTION__,
+ base::BindOnce(
+ [](float x, float y,
+ const RenderFrameType& render_frame) {
+ render_frame->ScrollTo(x, y);
+ },
+ x, y));
+}
+
+void CefFrameHostImpl::ScrollBy(float delta_x,
+ float delta_y) {
+ SendToRenderFrame(__FUNCTION__,
+ base::BindOnce(
+ [](float delta_x, float delta_y,
+ const RenderFrameType& render_frame) {
+ render_frame->ScrollBy(delta_x, delta_y);
+ },
+ delta_x, delta_y));
+}
+
+void CefFrameHostImpl::SlideScroll(float vx,
+ float vy) {
+ SendToRenderFrame(__FUNCTION__,
+ base::BindOnce(
+ [](float vx, float vy,
+ const RenderFrameType& render_frame) {
+ render_frame->SlideScroll(vx, vy);
+ },
+ vx, vy));
+}
#endif // BUILDFLAG(IS_OHOS)
void CefExecuteJavaScriptWithUserGestureForTests(CefRefPtr<CefFrame> frame,
@@ -169,7 +169,10 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
response_callback);
void GetImages(CefRefPtr<CefGetImagesCallback> callback) override;
void RemoveCache(bool include_disk_files);
-
+ void ScrollPageUpDown(bool is_up, bool is_half, float view_height);
+ void ScrollTo(float x, float y);
+ void ScrollBy(float delta_x, float delta_y);
+ void SlideScroll(float vx, float vy);
#endif // BUILDFLAG(IS_OHOS)
static const int64_t kMainFrameId;
@@ -9,7 +9,6 @@
#include "libcef/browser/thread_util.h"
#include "libcef/common/alloy/alloy_main_runner_delegate.h"
#include "libcef/common/cef_switches.h"
-#include "libcef/common/chrome/chrome_main_runner_delegate.h"
#include "libcef/features/runtime.h"
#include "base/at_exit.h"
@@ -40,12 +39,18 @@
#include "third_party/crashpad/crashpad/handler/handler_main.h"
#endif
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+#include "libcef/common/chrome/chrome_main_runner_delegate.h"
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+
namespace {
enum class RuntimeType {
UNINITIALIZED,
ALLOY,
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
CHROME,
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
};
RuntimeType g_runtime_type = RuntimeType::UNINITIALIZED;
@@ -54,6 +59,7 @@ std::unique_ptr<CefMainRunnerDelegate> MakeDelegate(
CefMainRunnerHandler* runner,
CefSettings* settings,
CefRefPtr<CefApp> application) {
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (type == RuntimeType::ALLOY) {
g_runtime_type = RuntimeType::ALLOY;
return std::make_unique<AlloyMainRunnerDelegate>(runner, settings,
@@ -63,6 +69,11 @@ std::unique_ptr<CefMainRunnerDelegate> MakeDelegate(
return std::make_unique<ChromeMainRunnerDelegate>(runner, settings,
application);
}
+#else
+ g_runtime_type = RuntimeType::ALLOY;
+ return std::make_unique<AlloyMainRunnerDelegate>(runner, settings,
+ application);
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
}
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
@@ -229,9 +240,13 @@ bool CefMainRunner::Initialize(CefSettings* settings,
bool* initialized,
base::OnceClosure context_initialized) {
DCHECK(!main_delegate_);
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
main_delegate_ = MakeDelegate(
settings->chrome_runtime ? RuntimeType::CHROME : RuntimeType::ALLOY, this,
settings, application);
+#else
+ main_delegate_ = MakeDelegate(RuntimeType::ALLOY, this, settings, application);
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
const int exit_code =
ContentMainInitialize(args, windows_sandbox_info, &settings->no_sandbox);
@@ -318,9 +333,13 @@ int CefMainRunner::RunAsHelperProcess(const CefMainArgs& args,
if (process_type.empty())
return -1;
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
auto runtime_type = command_line.HasSwitch(switches::kEnableChromeRuntime)
? RuntimeType::CHROME
: RuntimeType::ALLOY;
+#else
+ auto runtime_type = RuntimeType::ALLOY;
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
auto main_delegate = MakeDelegate(runtime_type, /*runner=*/nullptr,
/*settings=*/nullptr, application);
main_delegate->BeforeExecuteProcess(args);
@@ -536,7 +555,11 @@ bool IsAlloyRuntimeEnabled() {
}
bool IsChromeRuntimeEnabled() {
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
return g_runtime_type == RuntimeType::CHROME;
+#else
+ return false;
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
}
} // namespace cef
@@ -21,9 +21,15 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h"
+#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/data_transfer_policy/data_transfer_endpoint.h"
namespace {
+constexpr cef_context_menu_edit_state_flags_t kMenuCommands[] = {
+ CM_EDITFLAG_CAN_CUT, CM_EDITFLAG_CAN_COPY, CM_EDITFLAG_CAN_PASTE,
+ CM_EDITFLAG_CAN_DELETE, CM_EDITFLAG_CAN_SELECT_ALL};
+
CefString GetLabel(int message_id) {
std::u16string label =
CefAppManager::Get()->GetContentClient()->GetLocalizedString(message_id);
@@ -120,6 +126,53 @@ bool CefMenuManager::IsShowingContextMenu() {
return web_contents()->IsShowingContextMenu();
}
+bool CefMenuManager::IsCommandIdEnabled(int command_id,
+ content::ContextMenuParams& params) const {
+ bool editable = params.is_editable;
+ bool readable = params.input_field_type != blink::mojom::ContextMenuDataInputFieldType::kPassword;
+ bool has_selection = !params.selection_text.empty();
+ bool has_image_contents = params.has_image_contents;
+
+ switch (command_id) {
+ case CM_EDITFLAG_CAN_CUT:
+ case CM_EDITFLAG_CAN_DELETE:
+ return editable && readable && has_selection;
+ case CM_EDITFLAG_CAN_COPY:
+ return readable && (has_selection || has_image_contents);
+ case CM_EDITFLAG_CAN_PASTE: {
+ std::u16string result;
+ bool can_paste = false;
+ ui::DataTransferEndpoint data_dst = ui::DataTransferEndpoint(
+ ui::EndpointType::kDefault, false);
+ ui::Clipboard::GetForCurrentThread()->ReadText(
+ ui::ClipboardBuffer::kCopyPaste, &data_dst, &result);
+
+ if (result.empty()) {
+ can_paste = ui::Clipboard::GetForCurrentThread()->IsFormatAvailable(
+ ui::ClipboardFormatType::BitmapType(),
+ ui::ClipboardBuffer::kCopyPaste, &data_dst);
+ }
+ can_paste = can_paste ? can_paste : !result.empty();
+ return editable && can_paste;
+ }
+ case CM_EDITFLAG_CAN_SELECT_ALL:
+ return editable || readable;
+ default:
+ return false;
+ }
+}
+
+void CefMenuManager::UpdateMenuEditStateFlags(content::ContextMenuParams& params) {
+ int menu_flags = 0;
+ for (const auto& command : kMenuCommands) {
+ if (IsCommandIdEnabled(command, params)) {
+ menu_flags |= command;
+ }
+ }
+
+ params.edit_flags = menu_flags;
+}
+
bool CefMenuManager::CreateContextMenu(
const content::ContextMenuParams& params) {
// The renderer may send the "show context menu" message multiple times, one
@@ -134,6 +187,7 @@ bool CefMenuManager::CreateContextMenu(
params_ = params;
model_->Clear();
+ UpdateMenuEditStateFlags(params_);
// Create the default menu model.
CreateDefaultModel();
@@ -63,6 +63,11 @@ class CefMenuManager : public CefMenuModelImpl::Delegate,
// Returns true if the specified id is a custom context menu command.
bool IsCustomContextMenuCommand(int command_id);
+ bool IsCommandIdEnabled(int command_id,
+ content::ContextMenuParams& params) const;
+
+ void UpdateMenuEditStateFlags(content::ContextMenuParams& params);
+
// AlloyBrowserHostImpl pointer is guaranteed to outlive this object.
AlloyBrowserHostImpl* browser_;
new file mode 100755
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "libcef/browser/navigation_state_serializer.h"
+
+#include "base/logging.h"
+#include "third_party/blink/public/common/page_state/page_state.h"
+
+CefRefPtr<CefBinaryValue>
+NavigationStateSerializer::WriteNavigationStatus(
+ content::WebContents& web_contents) {
+ content::NavigationController& controller = web_contents.GetController();
+ if (!web_contents.GetController().GetLastCommittedEntry() ||
+ web_contents.GetController().GetLastCommittedEntry()->IsInitialEntry()) {
+ LOG(ERROR) << "navigation controller invalid";
+ return nullptr;
+ }
+ base::Pickle pickle;
+ int entry_count = controller.GetEntryCount();
+ int entry_index = controller.GetLastCommittedEntryIndex();
+ pickle.WriteInt(entry_count);
+ pickle.WriteInt(entry_index);
+ for (int index = 0; index < entry_count; ++index) {
+ WriteNavigationEntry(*controller.GetEntryAtIndex(index), &pickle);
+ }
+ return CefBinaryValue::Create(pickle.data(), pickle.size());
+}
+
+void NavigationStateSerializer::WriteNavigationEntry(
+ content::NavigationEntry& entry,
+ base::Pickle* pickle) {
+ if (!pickle)
+ return;
+ pickle->WriteString(entry.GetURL().spec());
+ pickle->WriteString(entry.GetVirtualURL().spec());
+
+ const content::Referrer& referrer = entry.GetReferrer();
+ pickle->WriteString(referrer.url.spec());
+ pickle->WriteInt(static_cast<int>(referrer.policy));
+ pickle->WriteString16(entry.GetTitle());
+ pickle->WriteString(entry.GetPageState().ToEncodedData());
+ pickle->WriteBool(static_cast<int>(entry.GetHasPostData()));
+ pickle->WriteString(entry.GetOriginalRequestURL().spec());
+ pickle->WriteString(entry.GetBaseURLForDataURL().spec());
+ pickle->WriteBool(static_cast<int>(entry.GetIsOverridingUserAgent()));
+ pickle->WriteInt64(entry.GetTimestamp().ToInternalValue());
+ pickle->WriteInt(entry.GetHttpStatusCode());
+}
+
+bool NavigationStateSerializer::RestoreNavigationStatus(
+ content::WebContents& web_contents,
+ const CefRefPtr<CefBinaryValue>& state) {
+ if (!state) {
+ LOG(ERROR) << "web state is nullptr.";
+ return false;
+ }
+ size_t state_size = state->GetSize();
+ if (state_size <= 0) {
+ LOG(ERROR) << "web state size invalid.";
+ return false;
+ }
+ uint8_t temp_buffer[state_size];
+ state->GetData(temp_buffer, state_size, 0);
+ base::Pickle pickle(reinterpret_cast<const char*>(temp_buffer),
+ state->GetSize());
+ base::PickleIterator iterator(pickle);
+ int entry_count = -1;
+ int entry_index = -2;
+ if (!iterator.ReadInt(&entry_count) || !iterator.ReadInt(&entry_index) ||
+ entry_index >= entry_count) {
+ LOG(ERROR) << "web state size invalid.";
+ return false;
+ }
+
+ std::unique_ptr<content::NavigationEntryRestoreContext> context =
+ content::NavigationEntryRestoreContext::Create();
+ std::vector<std::unique_ptr<content::NavigationEntry>> entries;
+ entries.reserve(entry_count);
+ for (int i = 0; i < entry_count; ++i) {
+ std::unique_ptr<content::NavigationEntry> entry =
+ content::NavigationEntry::Create();
+ if (!RestoreNavigationEntry(&iterator, entry, context.get()))
+ return false;
+ entries.push_back(std::move(entry));
+ }
+
+ content::NavigationController& controller = web_contents.GetController();
+ controller.Restore(entry_index, content::RestoreType::kRestored, &entries);
+ controller.LoadIfNecessary();
+ return true;
+}
+
+bool NavigationStateSerializer::RestoreNavigationEntry(
+ base::PickleIterator* iterator,
+ std::unique_ptr<content::NavigationEntry>& entry,
+ content::NavigationEntryRestoreContext* context) {
+ if (!iterator || !entry || !context) {
+ return false;
+ }
+ std::string url;
+ std::string virtual_url;
+ std::string original_request_url;
+ std::string base_url_for_data_url;
+ std::string referrer_url;
+ int policy;
+ std::u16string title;
+ std::string content_state;
+ bool has_post_data;
+ bool is_overriding_user_agent;
+ int64_t timestamp;
+ int http_status_code;
+
+ if (!iterator->ReadString(&url) || !iterator->ReadString(&virtual_url) ||
+ !iterator->ReadString(&referrer_url) || !iterator->ReadInt(&policy) ||
+ !iterator->ReadString16(&title) ||
+ !iterator->ReadString(&content_state) ||
+ !iterator->ReadBool(&has_post_data) ||
+ !iterator->ReadString(&original_request_url) ||
+ !iterator->ReadString(&base_url_for_data_url) ||
+ !iterator->ReadBool(&is_overriding_user_agent) ||
+ !iterator->ReadInt64(×tamp) ||
+ !iterator->ReadInt(&http_status_code)) {
+ LOG(ERROR) << "restore navigation entry failed.";
+ return false;
+ }
+
+ GURL deserialized_url;
+ entry->SetURL(deserialized_url);
+ entry->SetVirtualURL(GURL(virtual_url));
+ entry->SetTitle(title);
+ content::Referrer deserialized_referrer;
+ deserialized_referrer.url = GURL(referrer_url);
+ deserialized_referrer.policy = content::Referrer::ConvertToPolicy(policy);
+ if (content_state.empty()) {
+ entry->SetPageState(blink::PageState::CreateFromURL(deserialized_url),
+ context);
+ entry->SetReferrer(deserialized_referrer);
+ } else {
+ entry->SetPageState(blink::PageState::CreateFromEncodedData(content_state),
+ context);
+ }
+ entry->SetHasPostData(has_post_data);
+ entry->SetOriginalRequestURL(GURL(original_request_url));
+ entry->SetBaseURLForDataURL(GURL(base_url_for_data_url));
+ entry->SetIsOverridingUserAgent(is_overriding_user_agent);
+ entry->SetTimestamp(base::Time::FromInternalValue(timestamp));
+ entry->SetHttpStatusCode(http_status_code);
+ return true;
+}
\ No newline at end of file
new file mode 100755
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef NAVIGATION_STATE_SERIALIZER_H
+#define NAVIGATION_STATE_SERIALIZER_H
+#pragma once
+
+#include <memory>
+#include <vector>
+
+#include "base/pickle.h"
+#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_entry_restore_context.h"
+#include "content/public/browser/web_contents.h"
+#include "include/cef_values.h"
+
+class NavigationStateSerializer {
+ public:
+ static CefRefPtr<CefBinaryValue> WriteNavigationStatus(
+ content::WebContents& web_contents);
+ static bool RestoreNavigationStatus(content::WebContents& web_contents,
+ const CefRefPtr<CefBinaryValue>& state);
+
+ private:
+ static void WriteNavigationEntry(content::NavigationEntry& entry,
+ base::Pickle* pickle);
+ static bool RestoreNavigationEntry(
+ base::PickleIterator* iterator,
+ std::unique_ptr<content::NavigationEntry>& entry,
+ content::NavigationEntryRestoreContext* context);
+};
+
+#endif
\ No newline at end of file
@@ -166,9 +166,11 @@ bool IsUnlistedHost(const std::string& host) {
// Returns true if a host is WebUI and should be allowed to load.
bool IsAllowedWebUIHost(const std::string& host) {
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
// Chrome runtime allows all WebUI hosts.
if (cef::IsChromeRuntimeEnabled())
return true;
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
// Explicitly whitelisted WebUI hosts.
for (size_t i = 0;
@@ -293,6 +295,7 @@ class TemplateParser {
bool OnExtensionsSupportUI(std::string* mime_type, std::string* output) {
*mime_type = "text/html";
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (cef::IsChromeRuntimeEnabled()) {
// Redirect to the Chrome documentation.
*output =
@@ -302,6 +305,7 @@ bool OnExtensionsSupportUI(std::string* mime_type, std::string* output) {
"</head></html>\n";
return true;
}
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
static const char kDevURL[] = "https://developer.chrome.com/extensions/";
@@ -6,13 +6,16 @@
#include <string>
-#include "libcef/browser/net/chrome_scheme_handler.h"
#include "libcef/browser/net/devtools_scheme_handler.h"
#include "libcef/common/net/scheme_registration.h"
#include "libcef/features/runtime.h"
#include "content/public/common/url_constants.h"
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+#include "libcef/browser/net/chrome_scheme_handler.h"
+#endif
+
namespace scheme {
void RegisterInternalHandlers(CefIOThreadState* iothread_state) {
@@ -57,17 +57,19 @@ void CefDataBaseImpl::SaveHttpAuthCredentials(const CefString& host,
void CefDataBaseImpl::GetHttpAuthCredentials(
const CefString& host,
const CefString& realm,
- std::vector<CefString>& username_password) {
+ CefString& username,
+ char* password,
+ uint32_t passwordSize) {
if (host.empty() || realm.empty()) {
return;
}
- std::vector<std::string> result;
+ std::string usernameStr;
OHOS::NWeb::OhosWebDataBaseAdapter& databaseAdapter =
OHOS::NWeb::OhosAdapterHelper::GetInstance()
.GetOhosWebDataBaseAdapterInstance();
- databaseAdapter.GetHttpAuthCredentials(host, realm, result);
- TransferVector(result, username_password);
+ databaseAdapter.GetHttpAuthCredentials(host, realm, usernameStr, password, passwordSize);
+ username = usernameStr;
return;
}
@@ -28,7 +28,9 @@ class CefDataBaseImpl : public CefDataBase {
void GetHttpAuthCredentials(
const CefString& host,
const CefString& realm,
- std::vector<CefString>& username_password) override;
+ CefString& username,
+ char* password,
+ uint32_t passwordSize) override;
bool ExistPermissionByOrigin(const CefString& origin, int type) override;
@@ -4,49 +4,48 @@
#include "cef_dns_data_base.h"
+#include <set>
#include "base/logging.h"
#include "net/base/ip_endpoint.h"
#include "nweb_pre_dns_adapter.h"
#include "ohos_adapter_helper.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
+namespace {
+std::set<const std::string> g_hostname;
+}
void CacheHostName(const std::string& hostname) {
- OHOS::NWeb::OhosWebDnsDataBaseAdapter& dnsDatabaseAdapter =
- OHOS::NWeb::OhosAdapterHelper::GetInstance().GetWebDnsDataBaseInstance();
- if (dnsDatabaseAdapter.ExistHostname(hostname)) {
- return;
+ if (g_hostname.count(hostname) == 0) {
+ g_hostname.insert(hostname);
+ auto& dnsDatabaseAdapter = OHOS::NWeb::OhosAdapterHelper::GetInstance().GetWebDnsDataBaseInstance();
+ dnsDatabaseAdapter.InsertHostname(hostname);
}
-
- dnsDatabaseAdapter.InsertHostname(hostname);
}
net::AddressList GetAddrList(const std::string& hostname) {
using OHOS::NWeb::g_AddrInfoMap;
- net::AddressList addr_list;
- if (g_AddrInfoMap.empty()) {
- return addr_list;
- }
-
- addrinfo* addrInfo;
auto it = g_AddrInfoMap.find(hostname);
if (it == g_AddrInfoMap.end()) {
- return addr_list;
+ return net::AddressList();
}
- addrInfo = it->second;
- auto canonical_name = (addrInfo->ai_canonname != nullptr)
- ? absl::optional<std::string>(std::string(addrInfo->ai_canonname))
- : absl::optional<std::string>();
+
+ net::AddressList addr_list;
+ addrinfo* addrInfo = it->second;
+ auto canonical_name =
+ addrInfo->ai_canonname
+ ? absl::make_optional(std::string(addrInfo->ai_canonname))
+ : absl::nullopt;
if (canonical_name) {
- std::vector<std::string> aliases({*canonical_name});
- addr_list.SetDnsAliases(std::move(aliases));
+ addr_list.SetDnsAliases({*canonical_name});
}
- for (auto ai = addrInfo; ai != NULL; ai = ai->ai_next) {
+ for (auto ai = addrInfo; ai != nullptr; ai = ai->ai_next) {
net::IPEndPoint ipe;
// NOTE: Ignoring non-INET* families.
- if (ipe.FromSockAddr(ai->ai_addr, ai->ai_addrlen))
+ if (ipe.FromSockAddr(ai->ai_addr, ai->ai_addrlen)) {
addr_list.push_back(ipe);
- else
+ } else {
LOG(INFO) << "Unknown family found in addrinfo: " << ai->ai_family;
+ }
}
return addr_list;
}
\ No newline at end of file
@@ -4,6 +4,8 @@
#include "libcef/browser/net_service/login_delegate.h"
+#include <securec.h>
+
#include "libcef/browser/browser_host_base.h"
#include "libcef/browser/net_database/cef_data_base_impl.h"
#include "libcef/browser/net_service/browser_urlrequest_impl.h"
@@ -17,8 +19,6 @@
namespace net_service {
namespace {
-const int USERNAME_PASSWORD_VECTOR_NUM = 2;
-
class AuthCallbackImpl : public CefAuthCallback {
public:
explicit AuthCallbackImpl(base::WeakPtr<LoginDelegate> delegate,
@@ -68,6 +68,7 @@ class AuthCallbackImpl : public CefAuthCallback {
}
bool IsHttpAuthInfoSaved() override {
+ constexpr int32_t MAX_PWD_LENGTH = 256;
auto dataBase = CefDataBase::GetGlobalDataBase();
if (dataBase == nullptr) {
return false;
@@ -75,25 +76,29 @@ class AuthCallbackImpl : public CefAuthCallback {
if (!dataBase->ExistHttpAuthCredentials()) {
return false;
}
- std::vector<CefString> usernamePassword;
- usernamePassword.clear();
- dataBase->GetHttpAuthCredentials(host_, realm_, usernamePassword);
- if (usernamePassword.size() < USERNAME_PASSWORD_VECTOR_NUM) {
+ CefString username;
+ char password[MAX_PWD_LENGTH + 1] = {0};
+ dataBase->GetHttpAuthCredentials(host_, realm_, username, password, MAX_PWD_LENGTH + 1);
+ if (username.empty() || strlen(password) == 0) {
+ (void)memset_s(password, MAX_PWD_LENGTH + 1, 0, MAX_PWD_LENGTH + 1);
return false;
}
- CefString username = usernamePassword[0];
- CefString password = usernamePassword[1];
+ CefString passwordCef(password, strlen(password));
+ (void)memset_s(password, MAX_PWD_LENGTH + 1, 0, MAX_PWD_LENGTH + 1);
if (!task_runner_->RunsTasksInCurrentSequence()) {
task_runner_->PostTask(
FROM_HERE, base::BindOnce(&AuthCallbackImpl::Continue, this, username,
- password));
+ passwordCef));
+ passwordCef.MemsetToZero();
return true;
}
if (delegate_) {
- delegate_->Continue(username, password);
+ delegate_->Continue(username, passwordCef);
delegate_ = nullptr;
+ passwordCef.MemsetToZero();
return true;
}
+ passwordCef.MemsetToZero();
return false;
}
@@ -38,8 +38,8 @@ bool NetHelpers::ShouldBlockContentUrls() {
return !allow_content_access;
}
-bool NetHelpers::ShouldBlockFileUrls() {
- return !allow_file_access;
+bool NetHelpers::ShouldBlockFileUrls(struct NetHelperSetting setting) {
+ return !setting.file_access;
}
bool NetHelpers::IsAllowAcceptCookies() {
@@ -77,33 +77,33 @@ bool IsSpecialFileUrl(const GURL& url) {
return false;
}
-bool IsURLBlocked(const GURL& url) {
+bool IsURLBlocked(const GURL& url, struct NetHelperSetting setting) {
// Part of implementation of NWebPreference.allowContentAccess.
if (url.SchemeIs(url::kContentScheme) && NetHelpers::ShouldBlockContentUrls())
return true;
// Part of implementation of NWebPreference.allowFileAccess.
- if (url.SchemeIsFile() && NetHelpers::ShouldBlockFileUrls()) {
+ if (url.SchemeIsFile() && NetHelpers::ShouldBlockFileUrls(setting)) {
// Appdatas are always available.
return !IsSpecialFileUrl(url);
}
- return NetHelpers::is_network_blocked && url.SchemeIs(url::kFtpScheme);
+ return setting.block_network && url.SchemeIs(url::kFtpScheme);
}
-int UpdateLoadFlags(int load_flags) {
- if (NetHelpers::is_network_blocked) {
+int UpdateLoadFlags(int load_flags, NetHelperSetting setting) {
+ if (setting.block_network) {
LOG(INFO) << "Update cache control flag to block network.";
return UpdateCacheLoadFlags(
load_flags,
net::LOAD_ONLY_FROM_CACHE | net::LOAD_SKIP_CACHE_VALIDATION);
}
- if (!NetHelpers::cache_mode) {
+ if (!setting.cache_mode) {
return load_flags;
}
- return UpdateCacheLoadFlags(load_flags, NetHelpers::cache_mode);
+ return UpdateCacheLoadFlags(load_flags, setting.cache_mode);
}
} // namespace net_service
@@ -11,10 +11,16 @@ namespace net_service {
#define NETHELPERS_EXPORT __attribute__((visibility("default")))
+struct NetHelperSetting {
+ bool file_access;
+ bool block_network;
+ int cache_mode;
+};
+
class NETHELPERS_EXPORT NetHelpers {
public:
static bool ShouldBlockContentUrls();
- static bool ShouldBlockFileUrls();
+ static bool ShouldBlockFileUrls(struct NetHelperSetting setting);
static bool IsAllowAcceptCookies();
static bool IsThirdPartyCookieAllowed();
@@ -29,11 +35,11 @@ class NETHELPERS_EXPORT NetHelpers {
bool IsSpecialFileUrl(const GURL& url);
// Update request's |load_flags| based on the settings.
-int UpdateLoadFlags(int load_flags);
+int UpdateLoadFlags(int load_flags, struct NetHelperSetting setting);
// Returns true if the given URL should be aborted with
// net::ERR_ACCESS_DENIED.
-bool IsURLBlocked(const GURL& url);
+bool IsURLBlocked(const GURL& url, struct NetHelperSetting setting);
} // namespace net_service
@@ -500,13 +500,15 @@ void InterceptedRequest::Restart() {
}
}
- if (IsURLBlocked(request_.url)) {
+ struct NetHelperSetting setting;
+ factory_->request_handler_->GetSettingOfNetHelper(setting);
+ if (IsURLBlocked(request_.url, setting)) {
SendErrorAndCompleteImmediately(net::ERR_ACCESS_DENIED);
LOG(INFO) << "File url access denied! url=" << request_.url.spec();
return;
}
- request_.load_flags = UpdateLoadFlags(request_.load_flags);
+ request_.load_flags = UpdateLoadFlags(request_.load_flags, setting);
const GURL original_url = request_.url;
@@ -612,11 +614,7 @@ void InterceptedRequest::OnReceiveResponse(
request->SetURL(CefString(request_.url.spec()));
request->SetMethod(CefString(request_.method));
request->Set(request_.headers);
- content::GetUIThreadTaskRunner({})->PostTask(
- FROM_HERE, base::BindOnce(&InterceptedRequest::OnHttpErrorForUIThread,
- base::Unretained(this), id_, request,
- request_.is_main_frame,
- request_.has_user_gesture, error_reponse));
+ OnHttpErrorForUIThread(id_, request, request_.is_main_frame, request_.has_user_gesture, error_reponse);
}
if (current_request_uses_header_client_) {
@@ -140,6 +140,9 @@ class InterceptedRequestHandler {
bool is_main_frame,
bool has_user_gesture,
CefRefPtr<CefResponse> error_response) {}
+
+ // To get setting of net helper.
+ virtual void GetSettingOfNetHelper(struct NetHelperSetting& setting) {}
};
// URL Loader Factory that supports request/response interception, processing
@@ -1200,6 +1200,27 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
error_response);
}
+ void GetSettingOfNetHelper(struct NetHelperSetting& setting) override {
+ CEF_REQUIRE_UIT();
+ if (!init_state_) {
+ // set the default value
+ setting.file_access = false;
+ setting.block_network = false;
+ setting.cache_mode = 0;
+ return;
+ }
+ if (!init_state_->browser_) {
+ // set the default value
+ setting.file_access = false;
+ setting.block_network = false;
+ setting.cache_mode = 0;
+ return;
+ }
+ setting.file_access = init_state_->browser_->GetFileAccess();
+ setting.block_network = init_state_->browser_->GetBlockNetwork();
+ setting.cache_mode = init_state_->browser_->GetCacheMode();
+ }
+
private:
void CallHandlerOnComplete(RequestState* state,
const network::URLLoaderCompletionStatus& status) {
@@ -18,6 +18,48 @@
#include "content/public/browser/render_view_host.h"
#include "ui/events/base_event_utils.h"
+namespace {
+void ConvertSelectPopupItem(const blink::mojom::MenuItemPtr& menu_ptr,
+ CefSelectPopupItem& menu_item) {
+ CefString label = CefString(menu_ptr->label.value_or(""));
+ CefString tool_tip = CefString(menu_ptr->tool_tip.value_or(""));
+ cef_string_set(label.c_str(), label.length(), &(menu_item.label), true);
+ cef_string_set(tool_tip.c_str(), tool_tip.length(), &(menu_item.tool_tip),
+ true);
+ menu_item.action = menu_ptr->action;
+ menu_item.enabled = menu_ptr->enabled;
+ menu_item.checked = menu_ptr->checked;
+ menu_item.type = static_cast<cef_select_popup_item_type_t>(menu_ptr->type);
+ menu_item.text_direction =
+ static_cast<cef_text_direction_t>(menu_ptr->text_direction);
+ menu_item.has_text_direction_override = menu_ptr->has_text_direction_override;
+}
+} // namespace
+
+class CefSelectPopupCallbackImpl : public CefSelectPopupCallback {
+ public:
+ explicit CefSelectPopupCallbackImpl(
+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client) {
+ popup_client_.Bind(std::move(popup_client));
+ }
+
+ void Continue(const std::vector<int>& indices) override {
+ if (popup_client_) {
+ popup_client_->DidAcceptIndices(indices);
+ }
+ }
+
+ void Cancel() override {
+ if (popup_client_) {
+ popup_client_->DidCancel();
+ }
+ }
+
+ private:
+ mojo::Remote<blink::mojom::PopupMenuClient> popup_client_;
+ IMPLEMENT_REFCOUNTING(CefSelectPopupCallbackImpl);
+};
+
CefBrowserPlatformDelegateOsr::CefBrowserPlatformDelegateOsr(
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate,
bool use_shared_texture,
@@ -495,6 +537,34 @@ void CefBrowserPlatformDelegateOsr::StartDragging(
DragSourceSystemDragEnded();
}
+void CefBrowserPlatformDelegateOsr::ShowPopupMenu(
+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection) {
+ CefRefPtr<CefDialogHandler> handler =
+ browser_->GetClient()->GetDialogHandler();
+ if (handler.get()) {
+ std::vector<CefSelectPopupItem> item_list;
+ for (int i = 0; i < menu_items.size(); i++) {
+ CefSelectPopupItem menu_item;
+ ConvertSelectPopupItem(menu_items[i], menu_item);
+ item_list.push_back(menu_item);
+ }
+ CefRefPtr<CefSelectPopupCallback> callback =
+ new CefSelectPopupCallbackImpl(std::move(popup_client));
+ handler->OnSelectPopupMenu(
+ browser_,
+ CefRect(bounds.x(), bounds.y(), bounds.width(), bounds.height()),
+ item_height, item_font_size, selected_item, item_list, right_aligned,
+ allow_multiple_selection, callback);
+ }
+}
+
void CefBrowserPlatformDelegateOsr::UpdateDragCursor(
ui::mojom::DragOperation operation) {
CefRefPtr<CefRenderHandler> handler =
@@ -609,4 +679,4 @@ CefRenderWidgetHostViewOSR* CefBrowserPlatformDelegateOsr::GetOSRHostView()
}
return nullptr;
-}
+}
\ No newline at end of file
@@ -89,6 +89,15 @@ class CefBrowserPlatformDelegateOsr
void AccessibilityLocationChangesReceived(
const std::vector<content::AXLocationChangeNotificationDetails>& locData)
override;
+ void ShowPopupMenu(
+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection) override;
// CefBrowserPlatformDelegateNative::WindowlessHandler methods:
CefWindowHandle GetParentWindowHandle() const override;
@@ -1173,10 +1173,9 @@ void CefRenderWidgetHostViewOSR::OnScaleChanged(float old_page_scale_factor,
CefRefPtr<CefDisplayHandler> handler =
browser_impl_->client()->GetDisplayHandler();
CHECK(handler);
- float ratio = browser_impl_->GetVirtualPixelRatio();
handler->OnScaleChanged(browser_impl_.get(),
- std::round(old_page_scale_factor * (100 / ratio)),
- std::round(nwe_page_scale_factor * (100 / ratio)));
+ std::round(old_page_scale_factor * 100),
+ std::round(nwe_page_scale_factor * 100));
}
}
@@ -1599,6 +1598,9 @@ void CefRenderWidgetHostViewOSR::SetFocus(bool focus) {
if (focus) {
widget->GotFocus();
widget->SetActive(true);
+ if (selection_controller_client_) {
+ selection_controller_client_->SetTemporarilyHidden(false);
+ }
} else {
#if !BUILDFLAG(IS_OHOS)
if (browser_impl_.get())
@@ -1619,7 +1621,7 @@ void CefRenderWidgetHostViewOSR::OnUpdateTextInputStateCalled(
bool did_update_state) {
const auto state = text_input_manager->GetTextInputState();
if (state && !state->show_ime_if_needed) {
- LOG(INFO) << "OnUpdateTextInputStateCalled no need to show ime";
+ return;
}
CefRenderHandler::TextInputMode mode = CEF_TEXT_INPUT_MODE_NONE;
@@ -1641,6 +1643,21 @@ void CefRenderWidgetHostViewOSR::OnUpdateTextInputStateCalled(
show_keyboard);
}
+void CefRenderWidgetHostViewOSR::FocusedNodeChanged(bool is_editable_node,
+ const gfx::Rect& node_bounds_in_screen)
+{
+ CefRefPtr<CefRenderHandler> handler =
+ browser_impl_->GetClient()->GetRenderHandler();
+ CHECK(handler);
+ if (is_editable_node) {
+ handler->OnVirtualKeyboardRequested(browser_impl_->GetBrowser(),
+ CEF_TEXT_INPUT_MODE_DEFAULT, false);
+ } else {
+ handler->OnVirtualKeyboardRequested(browser_impl_->GetBrowser(),
+ CEF_TEXT_INPUT_MODE_NONE, false);
+ }
+}
+
void CefRenderWidgetHostViewOSR::ProcessAckedTouchEvent(
const content::TouchEventWithLatencyInfo& touch,
blink::mojom::InputEventResultState ack_result) {
@@ -1967,8 +1984,13 @@ void CefRenderWidgetHostViewOSR::OnScrollOffsetChanged() {
CefRefPtr<CefRenderHandler> handler =
browser_impl_->client()->GetRenderHandler();
CHECK(handler);
+ #if BUILDFLAG(IS_OHOS)
+ handler->OnScrollOffsetChanged(browser_impl_.get(), std::round(last_scroll_offset_.x()),
+ std::round(last_scroll_offset_.y()));
+ #else
handler->OnScrollOffsetChanged(browser_impl_.get(), last_scroll_offset_.x(),
last_scroll_offset_.y());
+ #endif
}
is_scroll_offset_changed_pending_ = false;
}
@@ -225,6 +225,9 @@ class CefRenderWidgetHostViewOSR
RenderWidgetHostViewBase* updated_view,
bool did_update_state) override;
+ void FocusedNodeChanged(bool is_editable_node,
+ const gfx::Rect& node_bounds_in_screen) override;
+
// ui::GestureProviderClient implementation.
void ProcessAckedTouchEvent(
const content::TouchEventWithLatencyInfo& touch,
@@ -21,6 +21,7 @@
#include "ui/base/pointer/touch_editing_controller.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
+#include "base/logging.h"
namespace {
@@ -125,7 +126,22 @@ CefTouchSelectionControllerClientOSR::~CefTouchSelectionControllerClientOSR() {
void CefTouchSelectionControllerClientOSR::CloseQuickMenuAndHideHandles() {
CloseQuickMenu();
- rwhv_->selection_controller()->HideAndDisallowShowingAutomatically();
+ auto controller = rwhv_->selection_controller();
+ if (controller) {
+ if (!controller->GetInsertHandle() || !controller->GetInsertHandle()->GetEnabled()) {
+ rwhv_->selection_controller()->HideAndDisallowShowingAutomatically();
+ } else if (controller->GetInsertHandle()->GetEnabled()) {
+ rwhv_->selection_controller()->SetTemporarilyHidden(true);
+ NotifyTouchSelectionChanged(true);
+ }
+ }
+}
+
+void CefTouchSelectionControllerClientOSR::SetTemporarilyHidden(bool hidden) {
+ if (rwhv_ && rwhv_->selection_controller()) {
+ rwhv_->selection_controller()->SetTemporarilyHidden(hidden);
+ NotifyTouchSelectionChanged(false);
+ }
}
void CefTouchSelectionControllerClientOSR::OnWindowMoved() {
@@ -290,7 +306,6 @@ void CefTouchSelectionControllerClientOSR::ShowQuickMenu() {
new CefRunQuickMenuCallbackImpl(base::BindOnce(
&CefTouchSelectionControllerClientOSR::ExecuteCommand,
weak_ptr_factory_.GetWeakPtr())));
-
quick_menu_running_ = true;
if (!handler->RunQuickMenu(
browser, browser->GetFocusedFrame(),
@@ -307,6 +322,7 @@ void CefTouchSelectionControllerClientOSR::ShowQuickMenu() {
if (browser->web_contents()) {
browser->web_contents()->SetShowingContextMenu(true);
}
+ browser->SetTouchInsertHandleMenuShow(false);
}
}
}
@@ -404,6 +420,7 @@ void CefTouchSelectionControllerClientOSR::OnSelectionEvent(
ui::SelectionEventType event) {
// This function (implicitly) uses active_menu_client_, so we don't go to the
// active view for this.
+ auto browser = rwhv_->browser_impl();
switch (event) {
case ui::SELECTION_HANDLES_SHOWN:
quick_menu_requested_ = true;
@@ -416,7 +433,9 @@ void CefTouchSelectionControllerClientOSR::OnSelectionEvent(
rwhv_->browser_impl()->GetTouchInsertHandleMenuShow();
}
NotifyTouchSelectionChanged(true);
- UpdateQuickMenu();
+ if (quick_menu_requested_) {
+ ShowQuickMenu();
+ }
break;
case ui::SELECTION_HANDLES_CLEARED:
case ui::INSERTION_HANDLE_CLEARED:
@@ -433,11 +452,10 @@ void CefTouchSelectionControllerClientOSR::OnSelectionEvent(
handle_drag_in_progress_ = false;
break;
case ui::SELECTION_HANDLES_MOVED:
+ case ui::INSERTION_HANDLE_MOVED:
if (!handle_drag_in_progress_) {
UpdateQuickMenu();
}
- [[fallthrough]];
- case ui::INSERTION_HANDLE_MOVED:
NotifyTouchSelectionChanged(true);
break;
case ui::INSERTION_HANDLE_TAPPED:
@@ -450,9 +468,6 @@ void CefTouchSelectionControllerClientOSR::OnSelectionEvent(
}
break;
}
- if (rwhv_ && rwhv_->browser_impl()) {
- rwhv_->browser_impl()->SetTouchInsertHandleMenuShow(false);
- }
}
void CefTouchSelectionControllerClientOSR::InternalClient::OnSelectionEvent(
@@ -616,4 +631,4 @@ bool CefTouchSelectionControllerClientOSR::
return true;
}
return false;
-}
+}
\ No newline at end of file
@@ -41,6 +41,7 @@ class CefTouchSelectionControllerClientOSR
~CefTouchSelectionControllerClientOSR() override;
void CloseQuickMenuAndHideHandles();
+ void SetTemporarilyHidden(bool hidden);
void OnWindowMoved();
@@ -148,6 +148,8 @@ bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() {
}
#endif // BUILDFLAG(IS_MAC)
+void CefWebContentsViewOSR::FullscreenStateChanged(bool is_fullscreen) {}
+
void CefWebContentsViewOSR::StartDragging(
const content::DropData& drop_data,
blink::DragOperationsMask allowed_ops,
@@ -172,6 +174,27 @@ void CefWebContentsViewOSR::UpdateDragCursor(
browser->UpdateDragCursor(operation);
}
+#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
+void CefWebContentsViewOSR::ShowPopupMenu(
+ content::RenderFrameHost* render_frame_host,
+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection) {
+ CefRefPtr<AlloyBrowserHostImpl> browser = GetBrowser();
+ if (browser.get()) {
+ browser->ShowPopupMenu(std::move(popup_client), bounds,
+ item_height, item_font_size, selected_item,
+ std::move(menu_items), right_aligned,
+ allow_multiple_selection);
+ }
+}
+#endif
+
CefRenderWidgetHostViewOSR* CefWebContentsViewOSR::GetView() const {
if (web_contents_) {
return static_cast<CefRenderWidgetHostViewOSR*>(
@@ -65,6 +65,8 @@ class CefWebContentsViewOSR : public content::WebContentsView,
bool CloseTabAfterEventTrackingIfNeeded() override;
#endif
+ void FullscreenStateChanged(bool is_fullscreen) override;
+
// RenderViewHostDelegateView methods.
void StartDragging(const content::DropData& drop_data,
blink::DragOperationsMask allowed_ops,
@@ -78,6 +80,18 @@ class CefWebContentsViewOSR : public content::WebContentsView,
virtual void LostFocus(
content::RenderWidgetHostImpl* render_widget_host) override;
virtual void TakeFocus(bool reverse) override;
+#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
+ void ShowPopupMenu(
+ content::RenderFrameHost* render_frame_host,
+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client,
+ const gfx::Rect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ std::vector<blink::mojom::MenuItemPtr> menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection) override;
+#endif
private:
CefRenderWidgetHostViewOSR* GetView() const;
@@ -10,7 +10,9 @@ AlloyAccessRequest::AlloyAccessRequest(const CefString& origin,
: origin_(origin), resources_(resources), callback_(std::move(callback)) {}
AlloyAccessRequest::~AlloyAccessRequest() {
- std::move(callback_).Run(false);
+ if (!callback_.is_null()) {
+ std::move(callback_).Run(false);
+ }
}
CefString AlloyAccessRequest::Origin() {
@@ -22,5 +24,7 @@ int AlloyAccessRequest::ResourceAcessId() {
}
void AlloyAccessRequest::ReportRequestResult(bool allowed) {
- std::move(callback_).Run(allowed);
+ if (!callback_.is_null()) {
+ std::move(callback_).Run(allowed);
+ }
}
\ No newline at end of file
@@ -22,10 +22,8 @@
#include "chrome/browser/accessibility/accessibility_ui.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/media/media_device_id_salt.h"
-#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/system_network_context_manager.h"
-#include "chrome/browser/plugins/plugin_info_host_impl.h"
#include "chrome/browser/prefetch/prefetch_prefs.h"
#include "chrome/browser/prefs/chrome_command_line_pref_store.h"
#include "chrome/browser/printing/print_preview_sticky_settings.h"
@@ -75,6 +73,14 @@
#include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h"
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
+#include "chrome/browser/plugins/plugin_info_host_impl.h"
+#endif
+
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/media/router/media_router_feature.h"
+#endif
+
namespace browser_prefs {
namespace {
@@ -223,8 +229,12 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
CefMediaCaptureDevicesDispatcher::RegisterPrefs(registry.get());
certificate_transparency::prefs::RegisterPrefs(registry.get());
flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry.get());
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
media_router::RegisterLocalStatePrefs(registry.get());
+#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
PluginInfoHostImpl::RegisterUserPrefs(registry.get());
+#endif
PrefProxyConfigTrackerImpl::RegisterPrefs(registry.get());
ProfileNetworkContextService::RegisterLocalStatePrefs(registry.get());
SSLConfigServiceManager::RegisterPrefs(registry.get());
@@ -266,7 +276,9 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
extensions::ExtensionPrefs::RegisterProfilePrefs(registry.get());
HostContentSettingsMap::RegisterProfilePrefs(registry.get());
language::LanguagePrefs::RegisterProfilePrefs(registry.get());
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
media_router::RegisterProfilePrefs(registry.get());
+#endif
MediaDeviceIDSalt::RegisterProfilePrefs(registry.get());
prefetch::RegisterPredictionOptionsProfilePrefs(registry.get());
ProfileNetworkContextService::RegisterProfilePrefs(registry.get());
@@ -291,8 +303,10 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
prefs::kPrintPreviewDefaultDestinationSelectionRules, std::string());
registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, false);
registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
printing::PolicySettings::RegisterProfilePrefs(registry.get());
printing::PrintPreviewStickySettings::RegisterProfilePrefs(registry.get());
+#endif
DownloadPrefs::RegisterProfilePrefs(registry.get());
// Cache preferences.
@@ -184,6 +184,7 @@ void SetBool(CommandLinePrefStore* prefs, const std::string& key, bool value) {
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
}
+#if !BUILDFLAG(IS_OHOS)
blink::mojom::PreferredColorScheme ToBlinkPreferredColorScheme(
ui::NativeTheme::PreferredColorScheme native_theme_scheme) {
switch (native_theme_scheme) {
@@ -195,6 +196,7 @@ blink::mojom::PreferredColorScheme ToBlinkPreferredColorScheme(
NOTREACHED();
}
+#endif
// From chrome/browser/chrome_content_browser_client.cc
// Returns true if preferred color scheme is modified based on at least one of
@@ -207,8 +209,10 @@ bool UpdatePreferredColorScheme(blink::web_pref::WebPreferences* web_prefs,
auto old_preferred_color_scheme = web_prefs->preferred_color_scheme;
// Update based on native theme scheme.
+#if !BUILDFLAG(IS_OHOS)
web_prefs->preferred_color_scheme =
ToBlinkPreferredColorScheme(native_theme->GetPreferredColorScheme());
+#endif
// Force a light preferred color scheme on certain URLs if kWebUIDarkMode is
// disabled; some of the UI is not yet correctly themed.
@@ -359,6 +363,11 @@ void SetCefPrefs(const CefBrowserSettings& cef,
/* ohos webview begin*/
SET_STATE(cef.force_dark_mode_enabled, web.force_dark_mode_enabled);
+ if (cef.dark_prefer_color_scheme_enabled == STATE_ENABLED) {
+ web.preferred_color_scheme = blink::mojom::PreferredColorScheme::kDark;
+ } else {
+ web.preferred_color_scheme = blink::mojom::PreferredColorScheme::kLight;
+ }
SET_STATE(cef.loads_images_automatically, web.loads_images_automatically);
SET_STATE(cef.allow_running_insecure_content,
web.allow_running_insecure_content);
@@ -367,6 +376,10 @@ void SetCefPrefs(const CefBrowserSettings& cef,
SET_STATE(cef.allow_mixed_content_upgrades, web.allow_mixed_content_upgrades);
SET_STATE(cef.initialize_at_minimum_page_scale,
web.initialize_at_minimum_page_scale);
+#if BUILDFLAG(IS_OHOS)
+ SET_STATE(cef.hide_vertical_scrollbars, web.hide_vertical_scrollbars);
+ SET_STATE(cef.hide_horizontal_scrollbars, web.hide_horizontal_scrollbars);
+#endif
web.viewport_meta_enabled = cef.viewport_meta_enabled;
web.autoplay_policy =
cef.user_gesture_required
@@ -421,6 +434,7 @@ void PopulateWebPreferences(content::RenderViewHost* rvh,
}
auto* native_theme = ui::NativeTheme::GetInstanceForWeb();
+#if !BUILDFLAG(IS_OHOS)
switch (native_theme->GetPreferredColorScheme()) {
case ui::NativeTheme::PreferredColorScheme::kDark:
web.preferred_color_scheme = blink::mojom::PreferredColorScheme::kDark;
@@ -429,6 +443,7 @@ void PopulateWebPreferences(content::RenderViewHost* rvh,
web.preferred_color_scheme = blink::mojom::PreferredColorScheme::kLight;
break;
}
+#endif
switch (native_theme->GetPreferredContrast()) {
case ui::NativeTheme::PreferredContrast::kNoPreference:
@@ -579,12 +579,14 @@ CefRefPtr<CefExtension> CefRequestContextImpl::GetExtension(
return browser_context()->GetExtension(extension_id);
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
CefRefPtr<CefMediaRouter> CefRequestContextImpl::GetMediaRouter(
CefRefPtr<CefCompletionCallback> callback) {
CefRefPtr<CefMediaRouterImpl> media_router = new CefMediaRouterImpl();
InitializeMediaRouterInternal(media_router, callback);
return media_router.get();
}
+#endif
void CefRequestContextImpl::OnRenderFrameCreated(
const content::GlobalRenderFrameHostId& global_id,
@@ -805,6 +807,7 @@ void CefRequestContextImpl::InitializeWebStorageInternal(
web_storage, callback));
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
void CefRequestContextImpl::InitializeMediaRouterInternal(
CefRefPtr<CefMediaRouterImpl> media_router,
CefRefPtr<CefCompletionCallback> callback) {
@@ -818,6 +821,7 @@ void CefRequestContextImpl::InitializeMediaRouterInternal(
},
media_router, callback));
}
+#endif
CefBrowserContext* CefRequestContextImpl::browser_context() const {
return browser_context_;
@@ -8,12 +8,15 @@
#include "include/cef_request_context.h"
#include "libcef/browser/browser_context.h"
-#include "libcef/browser/media_router/media_router_impl.h"
#include "libcef/browser/net_database/cef_data_base_impl.h"
#include "libcef/browser/net_service/cookie_manager_impl.h"
#include "libcef/browser/storage/web_storage_impl.h"
#include "libcef/browser/thread_util.h"
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "libcef/browser/media_router/media_router_impl.h"
+#endif
+
namespace content {
struct GlobalRenderFrameHostId;
}
@@ -100,8 +103,10 @@ class CefRequestContextImpl : public CefRequestContext {
bool HasExtension(const CefString& extension_id) override;
bool GetExtensions(std::vector<CefString>& extension_ids) override;
CefRefPtr<CefExtension> GetExtension(const CefString& extension_id) override;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
CefRefPtr<CefMediaRouter> GetMediaRouter(
CefRefPtr<CefCompletionCallback> callback) override;
+#endif
const CefRequestContextSettings& settings() const { return config_.settings; }
@@ -174,8 +179,10 @@ class CefRequestContextImpl : public CefRequestContext {
CefRefPtr<CefCompletionCallback> callback);
void InitializeWebStorageInternal(CefRefPtr<CefWebStorageImpl> web_storage,
CefRefPtr<CefCompletionCallback> callback);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
void InitializeMediaRouterInternal(CefRefPtr<CefMediaRouterImpl> media_router,
CefRefPtr<CefCompletionCallback> callback);
+#endif
CefBrowserContext* browser_context() const;
@@ -71,6 +71,7 @@ void GetStorageKeysTask::OnStorageKeysObtained(
blink::mojom::StorageType type,
const std::set<blink::StorageKey>& storage_keys) {
DCHECK(CEF_CURRENTLY_ON_IOT());
+ LOG(INFO) << "OnStorageKeysObtained storage_keys size: " << storage_keys.size();
num_callbacks_to_wait_ = storage_keys.size();
num_callbacks_received_ = 0u;
for (const blink::StorageKey& storage_key : storage_keys) {
@@ -6,7 +6,6 @@
#include "libcef/browser/browser_host_base.h"
#include "libcef/browser/browser_util.h"
-#include "libcef/browser/chrome/views/chrome_browser_view.h"
#include "libcef/browser/context.h"
#include "libcef/browser/request_context_impl.h"
#include "libcef/browser/thread_util.h"
@@ -15,6 +14,10 @@
#include "content/public/browser/native_web_keyboard_event.h"
#include "ui/content_accelerators/accelerator_util.h"
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+#include "libcef/browser/chrome/views/chrome_browser_view.h"
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+
// static
CefRefPtr<CefBrowserView> CefBrowserView::CreateBrowserView(
CefRefPtr<CefClient> client,
@@ -138,9 +141,11 @@ CefRefPtr<CefBrowser> CefBrowserViewImpl::GetBrowser() {
CefRefPtr<CefView> CefBrowserViewImpl::GetChromeToolbar() {
CEF_REQUIRE_VALID_RETURN(nullptr);
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (cef::IsChromeRuntimeEnabled()) {
return static_cast<ChromeBrowserView*>(root_view())->cef_toolbar();
}
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
return nullptr;
}
@@ -232,25 +237,33 @@ void CefBrowserViewImpl::SetDefaults(const CefBrowserSettings& settings) {
}
views::View* CefBrowserViewImpl::CreateRootView() {
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (cef::IsChromeRuntimeEnabled()) {
return new ChromeBrowserView(delegate(), this);
}
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
return new CefBrowserViewView(delegate(), this);
}
void CefBrowserViewImpl::InitializeRootView() {
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (cef::IsChromeRuntimeEnabled()) {
static_cast<ChromeBrowserView*>(root_view())->Initialize();
} else {
static_cast<CefBrowserViewView*>(root_view())->Initialize();
}
+#else
+ static_cast<CefBrowserViewView*>(root_view())->Initialize();
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
}
views::WebView* CefBrowserViewImpl::web_view() const {
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
if (cef::IsChromeRuntimeEnabled()) {
return static_cast<ChromeBrowserView*>(root_view())->contents_web_view();
}
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
return static_cast<CefBrowserViewView*>(root_view());
}
@@ -4,7 +4,6 @@
#include "libcef/browser/views/window_view.h"
-#include "libcef/browser/chrome/views/chrome_browser_frame.h"
#include "libcef/browser/image_impl.h"
#include "libcef/browser/views/window_impl.h"
#include "libcef/features/runtime.h"
@@ -29,6 +28,10 @@
#include "ui/aura/window.h"
#endif
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+#include "libcef/browser/chrome/views/chrome_browser_frame.h"
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
+
namespace {
// Specialize ClientView to handle Widget-related events.
@@ -259,8 +262,12 @@ void CefWindowView::CreateWidget() {
// |widget| is owned by the NativeWidget and will be destroyed in response to
// a native destruction message.
+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
views::Widget* widget = cef::IsChromeRuntimeEnabled() ? new ChromeBrowserFrame
: new views::Widget;
+#else
+ views::Widget* widget = new views::Widget;
+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME)
views::Widget::InitParams params;
params.delegate = this;
@@ -32,7 +32,6 @@
#include "content/public/common/cdm_info.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
-#include "content/public/common/pepper_plugin_info.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#include "third_party/widevine/cdm/buildflags.h"
#include "ui/base/l10n/l10n_util.h"
@@ -42,8 +41,13 @@
#include "chrome/common/media/cdm_host_file_path.h"
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
+#include "content/public/common/pepper_plugin_info.h"
+#endif
+
namespace {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
// The following plugin-related methods are from
// chrome/common/chrome_content_client.cc
@@ -80,16 +84,19 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
plugins->push_back(pdf_info);
}
}
+#endif
} // namespace
AlloyContentClient::AlloyContentClient() = default;
AlloyContentClient::~AlloyContentClient() = default;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
void AlloyContentClient::AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) {
ComputeBuiltInPlugins(plugins);
}
+#endif
void AlloyContentClient::AddContentDecryptionModules(
std::vector<content::CdmInfo>* cdms,
@@ -158,6 +165,7 @@ gfx::Image& AlloyContentClient::GetNativeImageNamed(int resource_id) {
return value;
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
// static
void AlloyContentClient::SetPDFEntryFunctions(
content::PepperPluginInfo::GetInterfaceFunc get_interface,
@@ -167,3 +175,4 @@ void AlloyContentClient::SetPDFEntryFunctions(
g_pdf_initialize_module = initialize_module;
g_pdf_shutdown_module = shutdown_module;
}
+#endif
@@ -9,7 +9,13 @@
#include "base/compiler_specific.h"
#include "content/public/common/content_client.h"
+
+#if BUILDFLAG(IS_OHOS)
+#include "ppapi/buildflags/buildflags.h"
+#if BUILDFLAG(ENABLE_PLUGINS)
#include "content/public/common/pepper_plugin_info.h"
+#endif
+#endif
class AlloyContentClient : public content::ContentClient {
public:
@@ -17,8 +23,10 @@ class AlloyContentClient : public content::ContentClient {
~AlloyContentClient() override;
// content::ContentClient overrides.
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
void AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) override;
+#endif
void AddContentDecryptionModules(
std::vector<content::CdmInfo>* cdms,
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) override;
@@ -32,10 +40,12 @@ class AlloyContentClient : public content::ContentClient {
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
gfx::Image& GetNativeImageNamed(int resource_id) override;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
static void SetPDFEntryFunctions(
content::PepperPluginInfo::GetInterfaceFunc get_interface,
content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module,
content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module);
+#endif
};
#endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_CONTENT_CLIENT_H_
@@ -25,7 +25,6 @@
#include "base/strings/string_util.h"
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/child/pdf_child_init.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -41,7 +40,6 @@
#include "content/public/common/url_constants.h"
#include "extensions/common/constants.h"
#include "net/base/features.h"
-#include "pdf/pdf_ppapi.h"
#include "sandbox/policy/switches.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/switches.h"
@@ -58,6 +56,14 @@
#include "ui/base/resource/resource_bundle_win.h"
#endif
+#if BUILDFLAG(IS_OHOS)
+#include "pdf/buildflags.h"
+#if BUILDFLAG(ENABLE_PDF)
+#include "chrome/child/pdf_child_init.h"
+#include "pdf/pdf_ppapi.h"
+#endif
+#endif
+
namespace {
const char* const kNonWildcardDomainNonPortSchemes[] = {
@@ -379,13 +385,17 @@ void AlloyMainDelegate::PreSandboxStartup() {
chrome::DIR_USER_DATA);
InitializeResourceBundle();
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
MaybePatchGdiGetFontData();
+#endif
}
void AlloyMainDelegate::SandboxInitialized(const std::string& process_type) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
AlloyContentClient::SetPDFEntryFunctions(chrome_pdf::PPP_GetInterface,
chrome_pdf::PPP_InitializeModule,
chrome_pdf::PPP_ShutdownModule);
+#endif
}
absl::variant<int, content::MainFunctionParams> AlloyMainDelegate::RunProcess(
@@ -548,7 +558,6 @@ void AlloyMainDelegate::InitializeResourceBundle() {
std::string locale = command_line->GetSwitchValueASCII(switches::kLang);
DCHECK(!locale.empty());
-
const std::string loaded_locale =
ui::ResourceBundle::InitSharedInstanceWithLocale(
locale, &resource_bundle_delegate_,
@@ -562,33 +571,47 @@ void AlloyMainDelegate::InitializeResourceBundle() {
LOG(ERROR) << "Could not load locale pak for " << locale;
resource_bundle_delegate_.set_allow_pack_file_load(true);
-
+#if BUILDFLAG(IS_OHOS)
+ resource_bundle.AddDataPackFromPath(resources_pak_file,
+ ui::kScaleFactorNone);
+#else
if (base::PathExists(resources_pak_file)) {
resource_bundle.AddDataPackFromPath(resources_pak_file,
ui::kScaleFactorNone);
} else {
LOG(ERROR) << "Could not load resources.pak";
}
+#endif
// Always load the 1x data pack first as the 2x data pack contains both 1x
// and 2x images. The 1x data pack only has 1x images, thus passes in an
// accurate scale factor to gfx::ImageSkia::AddRepresentation.
if (resource_util::IsScaleFactorSupported(ui::k100Percent)) {
+#if BUILDFLAG(IS_OHOS)
+ resource_bundle.AddDataPackFromPath(chrome_100_percent_pak_file,
+ ui::k100Percent);
+#else
if (base::PathExists(chrome_100_percent_pak_file)) {
resource_bundle.AddDataPackFromPath(chrome_100_percent_pak_file,
ui::k100Percent);
} else {
LOG(ERROR) << "Could not load chrome_100_percent.pak";
}
+#endif
}
if (resource_util::IsScaleFactorSupported(ui::k200Percent)) {
+#if BUILDFLAG(IS_OHOS)
+ resource_bundle.AddDataPackFromPath(chrome_200_percent_pak_file,
+ ui::k200Percent);
+#else
if (base::PathExists(chrome_200_percent_pak_file)) {
resource_bundle.AddDataPackFromPath(chrome_200_percent_pak_file,
ui::k200Percent);
} else {
LOG(ERROR) << "Could not load chrome_200_percent.pak";
}
+#endif
}
// Skip the default pak file loading that would otherwise occur in
@@ -12,6 +12,7 @@ import "services/network/public/mojom/url_request.mojom";
import "third_party/blink/public/mojom/loader/referrer.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "url/mojom/url.mojom";
+import "mojo/public/mojom/base/time.mojom";
[EnableIf=is_ohos]
import "skia/public/mojom/bitmap.mojom";
@@ -130,6 +131,18 @@ interface RenderFrame {
[EnableIf=is_ohos]
RemoveCache();
+
+ [EnableIf=is_ohos]
+ ScrollPageUpDown(bool is_up, bool move_half, float view_height);
+
+ [EnableIf=is_ohos]
+ ScrollTo(float x, float y);
+
+ [EnableIf=is_ohos]
+ ScrollBy(float delta_x, float delta_y);
+
+ [EnableIf=is_ohos]
+ SlideScroll(float vx, float vy);
};
// Interface for communicating with a frame in the browser process.
@@ -69,6 +69,7 @@ bool IsInternalHandledScheme(const std::string& scheme) {
url::kJavaScriptScheme,
url::kWsScheme,
url::kWssScheme,
+ url::kResourcesScheme,
};
for (size_t i = 0; i < sizeof(schemes) / sizeof(schemes[0]); ++i) {
@@ -20,22 +20,48 @@ base::Time SocPerUtil::last_time_boost_timestamp;
namespace {
const int SOC_PERF_CONFIG_ID = 10020;
+const int SOC_PERF_SLIDE_NORMAL_CONFIG_ID = 10025;
+const int SOC_PERF_WEB_GUSTURE_ID = 10012;
const int MIN_LAYER_NUM = 50;
const int MIN_VIDEO_LAYOUT_NUM = 1;
const int MAX_BOOST_RUN_TIME_IN_SECOND = 10;
const int REST_TIME_IN_SECOND = 2;
} // namespace
-void SocPerUtil::ApplySocConfig() {
- TRACE_EVENT2("soc_perf", "SocPerUtil::ApplySocConfig", "layout_num",
+void SocPerUtil::EnableFlingBoost() {
+ TRACE_EVENT2("soc_perf", "SocPerUtil::EnableFlingBoost2", "layout_num",
video_layout_num, "layer_num", layer_num);
+ OHOS::NWeb::OhosAdapterHelper::GetInstance()
+ .CreateSocPerfClientAdapter()
+ ->ApplySocPerfConfigByIdEx(SOC_PERF_WEB_GUSTURE_ID, false);
+
+ OHOS::NWeb::OhosAdapterHelper::GetInstance()
+ .CreateSocPerfClientAdapter()
+ ->ApplySocPerfConfigByIdEx(SOC_PERF_SLIDE_NORMAL_CONFIG_ID, true);
+
if (video_layout_num >= MIN_VIDEO_LAYOUT_NUM || layer_num >= MIN_LAYER_NUM) {
OHOS::NWeb::OhosAdapterHelper::GetInstance()
.CreateSocPerfClientAdapter()
- ->ApplySocPerfConfigById(SOC_PERF_CONFIG_ID);
+ ->ApplySocPerfConfigByIdEx(SOC_PERF_CONFIG_ID, true);
}
}
+void SocPerUtil::DisableFlingBoost() {
+ TRACE_EVENT0("soc_perf", "SocPerUtil::DisableFlingBoost");
+
+ OHOS::NWeb::OhosAdapterHelper::GetInstance()
+ .CreateSocPerfClientAdapter()
+ ->ApplySocPerfConfigByIdEx(SOC_PERF_SLIDE_NORMAL_CONFIG_ID, false);
+
+ OHOS::NWeb::OhosAdapterHelper::GetInstance()
+ .CreateSocPerfClientAdapter()
+ ->ApplySocPerfConfigByIdEx(SOC_PERF_CONFIG_ID, false);
+
+ OHOS::NWeb::OhosAdapterHelper::GetInstance()
+ .CreateSocPerfClientAdapter()
+ ->ApplySocPerfConfigByIdEx(SOC_PERF_WEB_GUSTURE_ID, false);
+}
+
void SocPerUtil::TryRunSocPerf() {
if ((base::Time().Now() - first_time_boost_timestamp).InSeconds() >=
MAX_BOOST_RUN_TIME_IN_SECOND) {
@@ -14,7 +14,8 @@ extern int layer_num;
class SocPerUtil {
public:
- static void ApplySocConfig();
+ static void EnableFlingBoost();
+ static void DisableFlingBoost();
static void StartBoost();
private:
@@ -33,7 +33,6 @@
#include "libcef/renderer/alloy/url_loader_throttle_provider_impl.h"
#include "libcef/renderer/browser_impl.h"
#include "libcef/renderer/extensions/extensions_renderer_client.h"
-#include "libcef/renderer/extensions/print_render_frame_helper_delegate.h"
#include "libcef/renderer/render_frame_observer.h"
#include "libcef/renderer/render_manager.h"
#include "libcef/renderer/thread_util.h"
@@ -53,14 +52,9 @@
#include "chrome/renderer/chrome_content_renderer_client.h"
#include "chrome/renderer/extensions/chrome_extensions_renderer_client.h"
#include "chrome/renderer/loadtimes_extension_bindings.h"
-#include "chrome/renderer/pepper/chrome_pdf_print_client.h"
-#include "chrome/renderer/pepper/pepper_helper.h"
#include "chrome/renderer/plugins/chrome_plugin_placeholder.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/nacl/common/nacl_constants.h"
-#include "components/pdf/common/internal_plugin_helpers.h"
-#include "components/pdf/renderer/internal_plugin_renderer_helpers.h"
-#include "components/pdf/renderer/pdf_find_in_page.h"
#include "components/printing/renderer/print_render_frame_helper.h"
#include "components/spellcheck/renderer/spellcheck.h"
#include "components/spellcheck/renderer/spellcheck_provider.h"
@@ -109,6 +103,21 @@
#include "base/strings/sys_string_conversions.h"
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "libcef/renderer/extensions/print_render_frame_helper_delegate.h"
+#endif
+
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
+#include "chrome/renderer/pepper/pepper_helper.h"
+#endif
+
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
+#include "chrome/renderer/pepper/chrome_pdf_print_client.h"
+#include "components/pdf/common/internal_plugin_helpers.h"
+#include "components/pdf/renderer/internal_plugin_renderer_helpers.h"
+#include "components/pdf/renderer/pdf_find_in_page.h"
+#endif
+
AlloyContentRendererClient::AlloyContentRendererClient()
: main_entry_time_(base::TimeTicks::Now()),
render_manager_(new CefRenderManager) {
@@ -232,10 +241,12 @@ void AlloyContentRendererClient::RenderThreadStarted() {
}
#endif // BUILDFLAG(IS_MAC)
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
if (extensions::PdfExtensionEnabled()) {
pdf_print_client_.reset(new ChromePDFPrintClient());
pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get());
}
+#endif
if (extensions::ExtensionsEnabled())
extensions_renderer_client_->RenderThreadStarted();
@@ -276,7 +287,9 @@ void AlloyContentRendererClient::RenderFrameCreated(
content::RenderFrame* render_frame) {
auto render_frame_observer = new CefRenderFrameObserver(render_frame);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
new PepperHelper(render_frame);
+#endif
if (extensions::ExtensionsEnabled()) {
extensions_renderer_client_->RenderFrameCreated(
@@ -302,18 +315,22 @@ void AlloyContentRendererClient::RenderFrameCreated(
OnBrowserCreated(render_frame->GetRenderView(), is_windowless);
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (is_windowless.has_value()) {
new printing::PrintRenderFrameHelper(
render_frame,
base::WrapUnique(
new extensions::CefPrintRenderFrameHelperDelegate(*is_windowless)));
}
+#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
if (base::FeatureList::IsEnabled(chrome_pdf::features::kPdfUnseasoned)) {
render_frame_observer->associated_interfaces()->AddInterface(
base::BindRepeating(&pdf::PdfFindInPageFactory::BindReceiver,
render_frame->GetRoutingID()));
}
+#endif
}
void AlloyContentRendererClient::WebViewCreated(blink::WebView* web_view) {
@@ -332,6 +349,7 @@ bool AlloyContentRendererClient::IsPluginHandledExternally(
const blink::WebElement& plugin_element,
const GURL& original_url,
const std::string& mime_type) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
if (!extensions::ExtensionsEnabled())
return false;
@@ -373,12 +391,16 @@ bool AlloyContentRendererClient::IsPluginHandledExternally(
return ChromeExtensionsRendererClient::MaybeCreateMimeHandlerView(
plugin_element, original_url, plugin_info->actual_mime_type,
plugin_info->plugin);
+#else
+ return false;
+#endif
}
bool AlloyContentRendererClient::OverrideCreatePlugin(
content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
blink::WebPlugin** plugin) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
std::string orig_mime_type = params.mime_type.Utf8();
if (extensions::ExtensionsEnabled() &&
!extensions_renderer_client_->OverrideCreatePlugin(render_frame,
@@ -394,6 +416,7 @@ bool AlloyContentRendererClient::OverrideCreatePlugin(
&plugin_info);
*plugin = ChromeContentRendererClient::CreatePlugin(render_frame, params,
*plugin_info);
+#endif
return true;
}
@@ -25,6 +25,10 @@
#include "mojo/public/cpp/bindings/generic_pending_receiver.h"
#include "services/service_manager/public/cpp/local_interface_provider.h"
+#if BUILDFLAG(IS_OHOS)
+#include "pdf/buildflags.h"
+#endif
+
namespace extensions {
class CefExtensionsRendererClient;
class Dispatcher;
@@ -152,7 +156,9 @@ class AlloyContentRendererClient
std::unique_ptr<SpellCheck> spellcheck_;
std::unique_ptr<visitedlink::VisitedLinkReader> visited_link_slave_;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF)
std::unique_ptr<ChromePDFPrintClient> pdf_print_client_;
+#endif
std::unique_ptr<extensions::ExtensionsClient> extensions_client_;
std::unique_ptr<extensions::CefExtensionsRendererClient>
@@ -71,6 +71,17 @@ const std::string kAddressPrefix = "geo:0,0?q=";
const std::string kEmailPrefix = "mailto:";
const std::string kPhoneNumberPrefix = "tel:";
+// The amount of content to overlap between two screens when using
+// pageUp/pageDown methiods. static int PAGE_SCROLL_OVERLAP = 24; Standard
+// animated scroll speed.
+static int STD_SCROLL_ANIMATION_SPEED_PIX_PER_SEC = 480;
+// Time for the longest scroll animation.
+static int MAX_SCROLL_ANIMATION_DURATION_MILLISEC = 750;
+
+static int DEFAULT_SCROLL_ANIMATION_DURATION_MILLISEC = 600;
+
+static double POSITION_RATIO = 138.9;
+
enum HitTestDataType {
kUnknown = 0,
kPhone = 2,
@@ -81,6 +92,17 @@ enum HitTestDataType {
kSrcImageLink = 8,
kEditText = 9,
};
+
+int computeDurationInMilliSec(int dx, int dy) {
+ int distance = std::max(std::abs(dx), std::abs(dy));
+ int duration = distance * 1000 / STD_SCROLL_ANIMATION_SPEED_PIX_PER_SEC;
+ return std::min(duration, MAX_SCROLL_ANIMATION_DURATION_MILLISEC);
+}
+
+float computeSlidePosition(float v) {
+ return (v * POSITION_RATIO / 1000);
+}
+
#endif // BUILDFLAG(IS_OHOS)
} // namespace
@@ -808,39 +830,38 @@ void CefFrameImpl::PutZoomingForTextFactor(float factor) {
auto render_frame = content::RenderFrame::FromWebFrame(frame_);
DCHECK(render_frame->IsMainFrame());
blink::WebView* webview = render_frame->GetRenderView()->GetWebView();
-
+
if (!webview)
return;
// Hide selection and autofill popups.
webview->CancelPagePopup();
-
+
render_frame->GetWebFrame()->FrameWidget()->SetTextZoomFactor(factor);
}
-
+
void CefFrameImpl::GetImageForContextNode() {
if (!frame_) {
LOG(ERROR) << "GetImageForContextNode frame is nullptr";
return;
}
cef::mojom::GetImageForContextNodeParamsPtr params =
- cef::mojom::GetImageForContextNodeParams::New();
+ cef::mojom::GetImageForContextNodeParams::New();
blink::WebNode context_node = frame_->ContextMenuImageNode();
std::vector<uint8_t> image_data;
gfx::Size original_size;
std::string image_extension;
if (context_node.IsNull() || !context_node.IsElementNode()) {
- SendToBrowserFrame(
- __FUNCTION__,
- base::BindOnce(
- [](cef::mojom::GetImageForContextNodeParamsPtr data,
- const BrowserFrameType& browser_frame) {
- browser_frame->OnGetImageForContextNodeNull();
- },
- std::move(params)));
+ SendToBrowserFrame(__FUNCTION__,
+ base::BindOnce(
+ [](cef::mojom::GetImageForContextNodeParamsPtr data,
+ const BrowserFrameType& browser_frame) {
+ browser_frame->OnGetImageForContextNodeNull();
+ },
+ std::move(params)));
return;
}
-
+
blink::WebElement web_element = context_node.To<blink::WebElement>();
original_size = web_element.GetImageSize();
@@ -963,8 +984,7 @@ void CefFrameImpl::UpdateLocale(const std::string& locale) {
return;
}
std::string result =
- ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources(
- locale);
+ ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources(locale);
if (result.empty()) {
LOG(ERROR) << "CefFrameImpl update locale failed";
}
@@ -977,13 +997,83 @@ void CefFrameImpl::GetImagesWithResponse(
base::BindOnce(
[](cef::mojom::RenderFrame::GetImagesWithResponseCallback callback,
blink::WebLocalFrame* frame) {
- blink::WebElementCollection collection = frame->GetDocument().GetElementsByHTMLTagName("img");
+ blink::WebElementCollection collection =
+ frame->GetDocument().GetElementsByHTMLTagName("img");
DCHECK(!collection.IsNull());
bool response = !(collection.FirstItem()).IsNull();
std::move(callback).Run(response);
},
std::move(callback)));
}
+
+void CefFrameImpl::ScrollPageUpDown(bool is_up,
+ bool is_half,
+ float view_height) {
+ auto render_frame = content::RenderFrame::FromWebFrame(frame_);
+ DCHECK(render_frame->IsMainFrame());
+ blink::WebView* webview = render_frame->GetRenderView()->GetWebView();
+ if (!webview) {
+ LOG(ERROR) << "scorll page up down get webview failed";
+ return;
+ }
+ auto scroll_offset = webview->GetScrollOffset();
+ float dy;
+ if (is_up) {
+ dy = is_half ? -view_height : -scroll_offset.y();
+ } else {
+ if (!is_half) {
+ float bottom_y = webview->GetScrollBottom();
+ if (bottom_y <= 0) {
+ LOG(ERROR) << "get scroll bottom offset failed.";
+ return;
+ }
+ dy = bottom_y - scroll_offset.y();
+ } else {
+ dy = view_height;
+ }
+ }
+ webview->SmoothScroll(scroll_offset.x(), scroll_offset.y() + dy,
+ base::Milliseconds(computeDurationInMilliSec(0, dy)));
+}
+
+void CefFrameImpl::ScrollTo(float x, float y) {
+ auto render_frame = content::RenderFrame::FromWebFrame(frame_);
+ DCHECK(render_frame->IsMainFrame());
+ blink::WebView* webview = render_frame->GetRenderView()->GetWebView();
+ if (!webview) {
+ LOG(ERROR) << "scrollto get webview failed";
+ return;
+ }
+ webview->SetScrollOffset(gfx::PointF(x, y));
+}
+
+void CefFrameImpl::ScrollBy(float delta_x, float delta_y) {
+ auto render_frame = content::RenderFrame::FromWebFrame(frame_);
+ DCHECK(render_frame->IsMainFrame());
+ blink::WebView* webview = render_frame->GetRenderView()->GetWebView();
+ if (!webview) {
+ LOG(ERROR) << "scrollby get webview failed";
+ return;
+ }
+ auto scroll_offset = webview->GetScrollOffset();
+ webview->SetScrollOffset(gfx::PointF(delta_x + scroll_offset.x(),
+ delta_y + scroll_offset.y()));
+}
+
+void CefFrameImpl::SlideScroll(float vx, float vy) {
+ auto render_frame = content::RenderFrame::FromWebFrame(frame_);
+ DCHECK(render_frame->IsMainFrame());
+ blink::WebView* webview = render_frame->GetRenderView()->GetWebView();
+ if (!webview) {
+ LOG(ERROR) << "scrollby get webview failed";
+ return;
+ }
+ float dx = vx == 0 ? 0 : computeSlidePosition(vx);
+ float dy = vy == 0 ? 0 : computeSlidePosition(vy);
+ auto scroll_offset = webview->GetScrollOffset();
+ webview->SmoothScroll(dx + scroll_offset.x(), dy + scroll_offset.y(),
+ base::Milliseconds(DEFAULT_SCROLL_ANIMATION_DURATION_MILLISEC));
+}
#endif // BUILDFLAG(IS_OHOS)
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
@@ -159,7 +159,10 @@ class CefFrameImpl : public CefFrame, public cef::mojom::RenderFrame {
void GetImagesWithResponse(
cef::mojom::RenderFrame::GetImagesWithResponseCallback callback) override;
void RemoveCache() override;
-
+ void ScrollPageUpDown(bool is_up, bool is_half, float view_height) override;
+ void ScrollTo(float x, float y) override;
+ void ScrollBy(float delta_x, float delta_y) override;
+ void SlideScroll(float vx, float vy) override;
GURL GetAbsoluteUrl(const blink::WebNode& node,
const std::u16string& url_fragment);
GURL GetAbsoluteSrcUrl(const blink::WebElement& element);
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6b186aa2b1640034df797d439745503309071680$
+// $hash=43f719c6388e6fb2ee41d8502b7f47983313cfc9$
//
#include "libcef_dll/cpptoc/access_request_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7f780d77c50f8f64713a51f886c76adc70e44357$
+// $hash=44c32953a5dc70e64d35222732817d6b065f0e33$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_ACCESS_REQUEST_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f20a2530c9b5ad72cccd301ee4234a16132c487d$
+// $hash=63799a16d1ff311eb185eb57bae7d682d150d376$
//
#include "libcef_dll/cpptoc/accessibility_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0605de17534cba62d36fc1160997660c4a38e40b$
+// $hash=0d1469b1473cbef38092a2b0624ac33faa6e1d89$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_ACCESSIBILITY_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ee267b6567062246b9f82b4b50b68d82d2cc939f$
+// $hash=04b98a2d9c374132d2149fd8e3cf8b110acba86f$
//
#include "libcef_dll/cpptoc/app_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=601455da6a16a7212debdb8184b8f731be4e2f8d$
+// $hash=a4d3edb584e87581659ded4e0bb20739b2b0efea$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=519a82bbea84ea39cadc72c55291e15cb2a74072$
+// $hash=56d4812b8f81cbda67550a8b03e8b7af911e5e28$
//
#include "libcef_dll/cpptoc/audio_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=352ed71e6c70ef8e5f38e635ed8fc17b2fcc2b4e$
+// $hash=6d31cfb9774514e0a15c999903fa4eb9ce76634d$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_AUDIO_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1c155d75ccb34c91336d15446c10b7e476f23c44$
+// $hash=b71adaa7f64de4164420e0f28f1c1064813c2beb$
//
#include "libcef_dll/cpptoc/auth_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=036ebbbaaa86b497dda11ef6371e5bc6c9171b04$
+// $hash=be94cb2e319c4a42e8bc9ee41b78935834e8a59c$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_AUTH_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0f0475ffcd9ea6ca7f91616c52c21b3e51b075f3$
+// $hash=5b940bd6e4a7e6a9cabd42b87ae9ff89eb1a0c5d$
//
#include "libcef_dll/cpptoc/before_download_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=53a024e4e503f7e107c19ed638684c5708efd6e6$
+// $hash=76dfadaa2d0f5ef6cdb8621cad3136e89b33ae25$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_BEFORE_DOWNLOAD_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fd59a248f99060800fc3bab5c381784eb3309a57$
+// $hash=b1f1f6a65560c0607e7eb3c4a57dbc40cab0b811$
//
#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=83361bb9395a566ef5bfcd9d87eade8df222d075$
+// $hash=bdc631b2bd2c0a68146e823e0ff23e1b3a455023$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_BINARY_VALUE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c1509a4a06a744e423e92c8d75b17128fd0601e1$
+// $hash=de6d56ff06c32a54e999d9309218c6a546eaa146$
//
#include "libcef_dll/cpptoc/browser_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=68e6a8ff4e47ec0c3c767d80746091550b9d11dc$
+// $hash=01e044c521a174528e137e4b131d9df95875eb65$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,10 +9,11 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1d35c0dce6fb6b92779d45000924a5c0992e5ce7$
+// $hash=fbbfbf396665393a59e2487e84880bafe3568174$
//
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
+#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
#include "libcef_dll/cpptoc/browser_cpptoc.h"
#include "libcef_dll/cpptoc/dictionary_value_cpptoc.h"
#include "libcef_dll/cpptoc/drag_data_cpptoc.h"
@@ -20,6 +21,7 @@
#include "libcef_dll/cpptoc/navigation_entry_cpptoc.h"
#include "libcef_dll/cpptoc/registration_cpptoc.h"
#include "libcef_dll/cpptoc/request_context_cpptoc.h"
+#include "libcef_dll/cpptoc/value_cpptoc.h"
#include "libcef_dll/ctocpp/client_ctocpp.h"
#include "libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.h"
#include "libcef_dll/ctocpp/download_image_callback_ctocpp.h"
@@ -29,6 +31,7 @@
#include "libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h"
#include "libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.h"
#include "libcef_dll/ctocpp/task_ctocpp.h"
+#include "libcef_dll/ctocpp/web_message_receiver_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
#include "libcef_dll/transfer_util.h"
@@ -1251,7 +1254,7 @@ browser_host_destroy_all_web_message_ports(struct _cef_browser_host_t* self) {
void CEF_CALLBACK
browser_host_post_port_message(struct _cef_browser_host_t* self,
cef_string_t* port_handle,
- cef_string_t* data) {
+ struct _cef_value_t* message) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -1263,24 +1266,23 @@ browser_host_post_port_message(struct _cef_browser_host_t* self,
DCHECK(port_handle);
if (!port_handle)
return;
- // Verify param: data; type: string_byref
- DCHECK(data);
- if (!data)
+ // Verify param: message; type: refptr_same
+ DCHECK(message);
+ if (!message)
return;
// Translate param: port_handle; type: string_byref
CefString port_handleStr(port_handle);
- // Translate param: data; type: string_byref
- CefString dataStr(data);
// Execute
- CefBrowserHostCppToC::Get(self)->PostPortMessage(port_handleStr, dataStr);
+ CefBrowserHostCppToC::Get(self)->PostPortMessage(
+ port_handleStr, CefValueCppToC::Unwrap(message));
}
void CEF_CALLBACK browser_host_set_port_message_callback(
struct _cef_browser_host_t* self,
cef_string_t* port_handle,
- struct _cef_java_script_result_callback_t* callback) {
+ struct _cef_web_message_receiver_t* callback) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -1302,7 +1304,7 @@ void CEF_CALLBACK browser_host_set_port_message_callback(
// Execute
CefBrowserHostCppToC::Get(self)->SetPortMessageCallback(
- port_handleStr, CefJavaScriptResultCallbackCToCpp::Wrap(callback));
+ port_handleStr, CefWebMessageReceiverCToCpp::Wrap(callback));
}
void CEF_CALLBACK browser_host_get_hit_data(struct _cef_browser_host_t* self,
@@ -1985,6 +1987,152 @@ void CEF_CALLBACK browser_host_remove_cache(struct _cef_browser_host_t* self,
: false);
}
+void CEF_CALLBACK
+browser_host_scroll_page_up_down(struct _cef_browser_host_t* self,
+ int is_up,
+ int is_half,
+ float view_height) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+
+ // Execute
+ CefBrowserHostCppToC::Get(self)->ScrollPageUpDown(
+ is_up ? true : false, is_half ? true : false, view_height);
+}
+
+struct _cef_binary_value_t* CEF_CALLBACK
+browser_host_get_web_state(struct _cef_browser_host_t* self) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return NULL;
+
+ // Execute
+ CefRefPtr<CefBinaryValue> _retval =
+ CefBrowserHostCppToC::Get(self)->GetWebState();
+
+ // Return type: refptr_same
+ return CefBinaryValueCppToC::Wrap(_retval);
+}
+
+int CEF_CALLBACK
+browser_host_restore_web_state(struct _cef_browser_host_t* self,
+ struct _cef_binary_value_t* state) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return 0;
+ // Verify param: state; type: refptr_same
+ DCHECK(state);
+ if (!state)
+ return 0;
+
+ // Execute
+ bool _retval = CefBrowserHostCppToC::Get(self)->RestoreWebState(
+ CefBinaryValueCppToC::Unwrap(state));
+
+ // Return type: bool
+ return _retval;
+}
+
+void CEF_CALLBACK browser_host_scroll_to(struct _cef_browser_host_t* self,
+ float x,
+ float y) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+
+ // Execute
+ CefBrowserHostCppToC::Get(self)->ScrollTo(x, y);
+}
+
+void CEF_CALLBACK browser_host_scroll_by(struct _cef_browser_host_t* self,
+ float delta_x,
+ float delta_y) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+
+ // Execute
+ CefBrowserHostCppToC::Get(self)->ScrollBy(delta_x, delta_y);
+}
+
+void CEF_CALLBACK browser_host_slide_scroll(struct _cef_browser_host_t* self,
+ float vx,
+ float vy) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+
+ // Execute
+ CefBrowserHostCppToC::Get(self)->SlideScroll(vx, vy);
+}
+
+void CEF_CALLBACK browser_host_set_file_access(struct _cef_browser_host_t* self,
+ int falg) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+
+ // Execute
+ CefBrowserHostCppToC::Get(self)->SetFileAccess(falg ? true : false);
+}
+
+void CEF_CALLBACK
+browser_host_set_block_network(struct _cef_browser_host_t* self, int falg) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+
+ // Execute
+ CefBrowserHostCppToC::Get(self)->SetBlockNetwork(falg ? true : false);
+}
+
+void CEF_CALLBACK browser_host_set_cache_mode(struct _cef_browser_host_t* self,
+ int falg) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+
+ // Execute
+ CefBrowserHostCppToC::Get(self)->SetCacheMode(falg);
+}
+
} // namespace
// CONSTRUCTOR - Do not edit by hand.
@@ -2098,6 +2246,15 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() {
GetStruct()->get_original_url = browser_host_get_original_url;
GetStruct()->put_network_available = browser_host_put_network_available;
GetStruct()->remove_cache = browser_host_remove_cache;
+ GetStruct()->scroll_page_up_down = browser_host_scroll_page_up_down;
+ GetStruct()->get_web_state = browser_host_get_web_state;
+ GetStruct()->restore_web_state = browser_host_restore_web_state;
+ GetStruct()->scroll_to = browser_host_scroll_to;
+ GetStruct()->scroll_by = browser_host_scroll_by;
+ GetStruct()->slide_scroll = browser_host_slide_scroll;
+ GetStruct()->set_file_access = browser_host_set_file_access;
+ GetStruct()->set_block_network = browser_host_set_block_network;
+ GetStruct()->set_cache_mode = browser_host_set_cache_mode;
}
// DESTRUCTOR - Do not edit by hand.
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=244bcb519cd21d6febf70c4ce40fbc1cbb18176c$
+// $hash=e51f496e40bd2b3b9573d2ca084e578bb1df1407$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_HOST_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2f9f0ebd4c8a44fb9c2d2136e0791770fc72dfe0$
+// $hash=4200c2184c268c8a81967053abedbff5fcbc7582$
//
#include "libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.h"
@@ -21,8 +21,9 @@ namespace {
void CEF_CALLBACK
browser_permission_request_delegate_ask_geolocation_permission(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin, cef_permission_callback_t callback) {
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin,
+ cef_permission_callback_t callback) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -42,8 +43,8 @@ browser_permission_request_delegate_ask_geolocation_permission(
void CEF_CALLBACK
browser_permission_request_delegate_abort_ask_geolocation_permission(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin) {
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -63,8 +64,9 @@ browser_permission_request_delegate_abort_ask_geolocation_permission(
void CEF_CALLBACK
browser_permission_request_delegate_ask_protected_media_identifier_permission(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin, cef_permission_callback_t callback) {
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin,
+ cef_permission_callback_t callback) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -84,8 +86,8 @@ browser_permission_request_delegate_ask_protected_media_identifier_permission(
void CEF_CALLBACK
browser_permission_request_delegate_abort_ask_protected_media_identifier_permission(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin) {
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -104,8 +106,9 @@ browser_permission_request_delegate_abort_ask_protected_media_identifier_permiss
}
void CEF_CALLBACK browser_permission_request_delegate_ask_midisysex_permission(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin, cef_permission_callback_t callback) {
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin,
+ cef_permission_callback_t callback) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -125,8 +128,8 @@ void CEF_CALLBACK browser_permission_request_delegate_ask_midisysex_permission(
void CEF_CALLBACK
browser_permission_request_delegate_abort_ask_midisysex_permission(
- struct _cef_browser_permission_request_delegate_t *self,
- const cef_string_t *origin) {
+ struct _cef_browser_permission_request_delegate_t* self,
+ const cef_string_t* origin) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -146,8 +149,9 @@ browser_permission_request_delegate_abort_ask_midisysex_permission(
void CEF_CALLBACK
browser_permission_request_delegate_notify_geolocation_permission(
- struct _cef_browser_permission_request_delegate_t *self, int value,
- const cef_string_t *origin) {
+ struct _cef_browser_permission_request_delegate_t* self,
+ int value,
+ const cef_string_t* origin) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -165,7 +169,7 @@ browser_permission_request_delegate_notify_geolocation_permission(
->NotifyGeolocationPermission(value ? true : false, CefString(origin));
}
-} // namespace
+} // namespace
// CONSTRUCTOR - Do not edit by hand.
@@ -200,7 +204,7 @@ CefCppToCRefCounted<CefBrowserPermissionRequestDelegateCppToC,
CefBrowserPermissionRequestDelegate,
cef_browser_permission_request_delegate_t>::
UnwrapDerived(CefWrapperType type,
- cef_browser_permission_request_delegate_t *s) {
+ cef_browser_permission_request_delegate_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=56d5e14a811fca57a762921bdef1270c44af6b4c$
+// $hash=add424cc39b4f5c546f8333e3c25dc8090880a81$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_PERMISSION_REQUEST_DELEGATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=452f119327aff2ec0aaed162adf85bbd239b9033$
+// $hash=a872b0755d60861a2ccf93526ba6b05a74274e7d$
//
#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ebbabaa3d73f0266003818a764f8ca677a9ec6b2$
+// $hash=508373dbbfcb411f218ad9688d56b49380d8ca75$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=01b8f661ca054d4a48ee00f1163011688b32e9f1$
+// $hash=c692df579a3b5f6d780c1e26013c91e2eb2098c8$
//
#include "libcef_dll/cpptoc/callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5b2fa7fef3cde7efde7df615769b6361ea81ce46$
+// $hash=f0c92901c6462ad03d3c95c0ba92129784c808e1$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=be6ffc497bb625fc087fa38352b8f173f1de3d6d$
+// $hash=9d36943180a6382a12e74a92d9d9967039f14ad3$
//
#include "libcef_dll/cpptoc/client_cpptoc.h"
@@ -39,8 +39,8 @@ namespace {
// MEMBER FUNCTIONS - Body may be edited by hand.
-cef_audio_handler_t *CEF_CALLBACK
-client_get_audio_handler(struct _cef_client_t *self) {
+cef_audio_handler_t* CEF_CALLBACK
+client_get_audio_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -55,8 +55,8 @@ client_get_audio_handler(struct _cef_client_t *self) {
return CefAudioHandlerCppToC::Wrap(_retval);
}
-struct _cef_context_menu_handler_t *CEF_CALLBACK
-client_get_context_menu_handler(struct _cef_client_t *self) {
+struct _cef_context_menu_handler_t* CEF_CALLBACK
+client_get_context_menu_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -71,8 +71,8 @@ client_get_context_menu_handler(struct _cef_client_t *self) {
return CefContextMenuHandlerCppToC::Wrap(_retval);
}
-struct _cef_dialog_handler_t *CEF_CALLBACK
-client_get_dialog_handler(struct _cef_client_t *self) {
+struct _cef_dialog_handler_t* CEF_CALLBACK
+client_get_dialog_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -87,8 +87,8 @@ client_get_dialog_handler(struct _cef_client_t *self) {
return CefDialogHandlerCppToC::Wrap(_retval);
}
-struct _cef_display_handler_t *CEF_CALLBACK
-client_get_display_handler(struct _cef_client_t *self) {
+struct _cef_display_handler_t* CEF_CALLBACK
+client_get_display_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -103,8 +103,8 @@ client_get_display_handler(struct _cef_client_t *self) {
return CefDisplayHandlerCppToC::Wrap(_retval);
}
-struct _cef_download_handler_t *CEF_CALLBACK
-client_get_download_handler(struct _cef_client_t *self) {
+struct _cef_download_handler_t* CEF_CALLBACK
+client_get_download_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -119,8 +119,8 @@ client_get_download_handler(struct _cef_client_t *self) {
return CefDownloadHandlerCppToC::Wrap(_retval);
}
-struct _cef_drag_handler_t *CEF_CALLBACK
-client_get_drag_handler(struct _cef_client_t *self) {
+struct _cef_drag_handler_t* CEF_CALLBACK
+client_get_drag_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -135,8 +135,8 @@ client_get_drag_handler(struct _cef_client_t *self) {
return CefDragHandlerCppToC::Wrap(_retval);
}
-struct _cef_find_handler_t *CEF_CALLBACK
-client_get_find_handler(struct _cef_client_t *self) {
+struct _cef_find_handler_t* CEF_CALLBACK
+client_get_find_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -151,8 +151,8 @@ client_get_find_handler(struct _cef_client_t *self) {
return CefFindHandlerCppToC::Wrap(_retval);
}
-struct _cef_focus_handler_t *CEF_CALLBACK
-client_get_focus_handler(struct _cef_client_t *self) {
+struct _cef_focus_handler_t* CEF_CALLBACK
+client_get_focus_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -167,8 +167,8 @@ client_get_focus_handler(struct _cef_client_t *self) {
return CefFocusHandlerCppToC::Wrap(_retval);
}
-struct _cef_frame_handler_t *CEF_CALLBACK
-client_get_frame_handler(struct _cef_client_t *self) {
+struct _cef_frame_handler_t* CEF_CALLBACK
+client_get_frame_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -183,8 +183,8 @@ client_get_frame_handler(struct _cef_client_t *self) {
return CefFrameHandlerCppToC::Wrap(_retval);
}
-struct _cef_jsdialog_handler_t *CEF_CALLBACK
-client_get_jsdialog_handler(struct _cef_client_t *self) {
+struct _cef_jsdialog_handler_t* CEF_CALLBACK
+client_get_jsdialog_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -199,8 +199,8 @@ client_get_jsdialog_handler(struct _cef_client_t *self) {
return CefJSDialogHandlerCppToC::Wrap(_retval);
}
-struct _cef_keyboard_handler_t *CEF_CALLBACK
-client_get_keyboard_handler(struct _cef_client_t *self) {
+struct _cef_keyboard_handler_t* CEF_CALLBACK
+client_get_keyboard_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -215,8 +215,8 @@ client_get_keyboard_handler(struct _cef_client_t *self) {
return CefKeyboardHandlerCppToC::Wrap(_retval);
}
-struct _cef_life_span_handler_t *CEF_CALLBACK
-client_get_life_span_handler(struct _cef_client_t *self) {
+struct _cef_life_span_handler_t* CEF_CALLBACK
+client_get_life_span_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -231,8 +231,8 @@ client_get_life_span_handler(struct _cef_client_t *self) {
return CefLifeSpanHandlerCppToC::Wrap(_retval);
}
-struct _cef_load_handler_t *CEF_CALLBACK
-client_get_load_handler(struct _cef_client_t *self) {
+struct _cef_load_handler_t* CEF_CALLBACK
+client_get_load_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -247,8 +247,8 @@ client_get_load_handler(struct _cef_client_t *self) {
return CefLoadHandlerCppToC::Wrap(_retval);
}
-struct _cef_print_handler_t *CEF_CALLBACK
-client_get_print_handler(struct _cef_client_t *self) {
+struct _cef_print_handler_t* CEF_CALLBACK
+client_get_print_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -263,8 +263,8 @@ client_get_print_handler(struct _cef_client_t *self) {
return CefPrintHandlerCppToC::Wrap(_retval);
}
-struct _cef_render_handler_t *CEF_CALLBACK
-client_get_render_handler(struct _cef_client_t *self) {
+struct _cef_render_handler_t* CEF_CALLBACK
+client_get_render_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -279,8 +279,8 @@ client_get_render_handler(struct _cef_client_t *self) {
return CefRenderHandlerCppToC::Wrap(_retval);
}
-struct _cef_request_handler_t *CEF_CALLBACK
-client_get_request_handler(struct _cef_client_t *self) {
+struct _cef_request_handler_t* CEF_CALLBACK
+client_get_request_handler(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -295,8 +295,8 @@ client_get_request_handler(struct _cef_client_t *self) {
return CefRequestHandlerCppToC::Wrap(_retval);
}
-struct _cef_permission_request_t *CEF_CALLBACK
-client_get_permission_request(struct _cef_client_t *self) {
+struct _cef_permission_request_t* CEF_CALLBACK
+client_get_permission_request(struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -311,10 +311,12 @@ client_get_permission_request(struct _cef_client_t *self) {
return CefPermissionRequestCppToC::Wrap(_retval);
}
-int CEF_CALLBACK client_on_process_message_received(
- struct _cef_client_t *self, cef_browser_t *browser,
- struct _cef_frame_t *frame, cef_process_id_t source_process,
- struct _cef_process_message_t *message) {
+int CEF_CALLBACK
+client_on_process_message_received(struct _cef_client_t* self,
+ cef_browser_t* browser,
+ struct _cef_frame_t* frame,
+ cef_process_id_t source_process,
+ struct _cef_process_message_t* message) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -342,10 +344,12 @@ int CEF_CALLBACK client_on_process_message_received(
return _retval;
}
-int CEF_CALLBACK client_notify_java_script_result(
- struct _cef_client_t *self, struct _cef_list_value_t *args,
- const cef_string_t *method, const cef_string_t *object_name,
- struct _cef_list_value_t *result) {
+int CEF_CALLBACK
+client_notify_java_script_result(struct _cef_client_t* self,
+ struct _cef_list_value_t* args,
+ const cef_string_t* method,
+ const cef_string_t* object_name,
+ struct _cef_list_value_t* result) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -377,7 +381,7 @@ int CEF_CALLBACK client_notify_java_script_result(
return _retval;
}
-} // namespace
+} // namespace
// CONSTRUCTOR - Do not edit by hand.
@@ -410,11 +414,12 @@ CefClientCppToC::~CefClientCppToC() {}
template <>
CefRefPtr<CefClient>
CefCppToCRefCounted<CefClientCppToC, CefClient, cef_client_t>::UnwrapDerived(
- CefWrapperType type, cef_client_t *s) {
+ CefWrapperType type,
+ cef_client_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
-CefWrapperType CefCppToCRefCounted<CefClientCppToC, CefClient,
- cef_client_t>::kWrapperType = WT_CLIENT;
+CefWrapperType CefCppToCRefCounted<CefClientCppToC, CefClient, cef_client_t>::
+ kWrapperType = WT_CLIENT;
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=30d4264433606a5e29f5ec2a325f630b278d4be9$
+// $hash=6dd8a3977d8a7d75da7399a9c15a160afbfcf744$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fec108946a9d826210e4fa3746839b56a123316c$
+// $hash=69cdcccdd0b005cb929d250a0ccfe287d1df37ed$
//
#include "libcef_dll/cpptoc/command_line_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=395fccd246892782a1c4a26a87baa43f75436bd8$
+// $hash=f8af58d9e62d25a46593ccebc487734730f6a1a3$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_COMMAND_LINE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c16d5dc361785c620c9066fc473a443651afa7ab$
+// $hash=0d30202496e04b3b51a914a480dca377de198807$
//
#include "libcef_dll/cpptoc/completion_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7ac48d4ac56f3e31947f8f3b9d9bf54a3bc3383c$
+// $hash=407df18b90244b245e73c4f69a199663df079f0d$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9652f02b935b2e77b689283cbc0b61e2efc95c17$
+// $hash=2a6026a4c3f2190e968af0d43bf5a96ce3335c32$
//
#include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=51d213cb8d40ba1f608944422e0522749e433a6f$
+// $hash=68dd3aa1b0a216bdc63aa9ed3008b0b5815f8040$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e2f6dee4f74c0eb0979d7a557b007fb8e495bcbb$
+// $hash=b086ddccc396ae8b81f8847a2942325ea7b68faf$
//
#include "libcef_dll/cpptoc/context_menu_params_cpptoc.h"
@@ -383,6 +383,43 @@ context_menu_params_is_custom_menu(struct _cef_context_menu_params_t* self) {
return _retval;
}
+cef_context_menu_input_field_type_t CEF_CALLBACK
+context_menu_params_get_input_field_type(
+ struct _cef_context_menu_params_t* self) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return CM_INPUTFIELDTYPE_NONE;
+
+ // Execute
+ cef_context_menu_input_field_type_t _retval =
+ CefContextMenuParamsCppToC::Get(self)->GetInputFieldType();
+
+ // Return type: simple
+ return _retval;
+}
+
+cef_context_menu_source_type_t CEF_CALLBACK
+context_menu_params_get_source_type(struct _cef_context_menu_params_t* self) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return CM_SOURCETYPE_NONE;
+
+ // Execute
+ cef_context_menu_source_type_t _retval =
+ CefContextMenuParamsCppToC::Get(self)->GetSourceType();
+
+ // Return type: simple
+ return _retval;
+}
+
} // namespace
// CONSTRUCTOR - Do not edit by hand.
@@ -412,6 +449,8 @@ CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() {
context_menu_params_is_spell_check_enabled;
GetStruct()->get_edit_state_flags = context_menu_params_get_edit_state_flags;
GetStruct()->is_custom_menu = context_menu_params_is_custom_menu;
+ GetStruct()->get_input_field_type = context_menu_params_get_input_field_type;
+ GetStruct()->get_source_type = context_menu_params_get_source_type;
}
// DESTRUCTOR - Do not edit by hand.
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9612bbf58cbf1ee4c41d9cec79267e473d130172$
+// $hash=289e9100aeb329f9ec7d1696354e31f2eb7d8ce9$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_PARAMS_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8a64cdcb148bd7c9cad278d57c353ebf48386a16$
+// $hash=714da2b623c625391a0ca8415f5dcc3a434e212e$
//
#include "libcef_dll/cpptoc/cookie_access_filter_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=16e58fb5b73a0c13602b01a14afb4f6a882c094d$
+// $hash=e0b8da1120abbbb306c6cc789ec94e38dc07ceb0$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_ACCESS_FILTER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e2ce6d109390673bbfa660a9a43b8f7ce2e3adf7$
+// $hash=2efc0918bc483be69599cf2cd08c0f3894b560d0$
//
#include "libcef_dll/cpptoc/cookie_manager_cpptoc.h"
@@ -20,8 +20,8 @@
// GLOBAL FUNCTIONS - Body may be edited by hand.
-CEF_EXPORT cef_cookie_manager_t *
-cef_cookie_manager_get_global_manager(cef_completion_callback_t *callback) {
+CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
+ cef_completion_callback_t* callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Unverified params: callback
@@ -34,10 +34,10 @@ cef_cookie_manager_get_global_manager(cef_completion_callback_t *callback) {
return CefCookieManagerCppToC::Wrap(_retval);
}
-CEF_EXPORT int
-cef_cookie_manager_create_cef_cookie(const cef_string_t *url,
- const cef_string_t *value,
- struct _cef_cookie_t *cef_cookie) {
+CEF_EXPORT int cef_cookie_manager_create_cef_cookie(
+ const cef_string_t* url,
+ const cef_string_t* value,
+ struct _cef_cookie_t* cef_cookie) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: url; type: string_byref_const
@@ -75,7 +75,7 @@ namespace {
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK
-cookie_manager_is_accept_cookie_allowed(struct _cef_cookie_manager_t *self) {
+cookie_manager_is_accept_cookie_allowed(struct _cef_cookie_manager_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -89,8 +89,9 @@ cookie_manager_is_accept_cookie_allowed(struct _cef_cookie_manager_t *self) {
return _retval;
}
-void CEF_CALLBACK cookie_manager_put_accept_cookie_enabled(
- struct _cef_cookie_manager_t *self, int accept) {
+void CEF_CALLBACK
+cookie_manager_put_accept_cookie_enabled(struct _cef_cookie_manager_t* self,
+ int accept) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -103,7 +104,7 @@ void CEF_CALLBACK cookie_manager_put_accept_cookie_enabled(
}
int CEF_CALLBACK cookie_manager_is_third_party_cookie_allowed(
- struct _cef_cookie_manager_t *self) {
+ struct _cef_cookie_manager_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -118,7 +119,8 @@ int CEF_CALLBACK cookie_manager_is_third_party_cookie_allowed(
}
void CEF_CALLBACK cookie_manager_put_accept_third_party_cookie_enabled(
- struct _cef_cookie_manager_t *self, int accept) {
+ struct _cef_cookie_manager_t* self,
+ int accept) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -131,7 +133,7 @@ void CEF_CALLBACK cookie_manager_put_accept_third_party_cookie_enabled(
}
int CEF_CALLBACK cookie_manager_is_file_urlscheme_cookies_allowed(
- struct _cef_cookie_manager_t *self) {
+ struct _cef_cookie_manager_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -147,7 +149,8 @@ int CEF_CALLBACK cookie_manager_is_file_urlscheme_cookies_allowed(
}
void CEF_CALLBACK cookie_manager_put_accept_file_urlscheme_cookies_enabled(
- struct _cef_cookie_manager_t *self, int allow) {
+ struct _cef_cookie_manager_t* self,
+ int allow) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -159,8 +162,9 @@ void CEF_CALLBACK cookie_manager_put_accept_file_urlscheme_cookies_enabled(
allow ? true : false);
}
-int CEF_CALLBACK cookie_manager_visit_all_cookies(
- struct _cef_cookie_manager_t *self, struct _cef_cookie_visitor_t *visitor) {
+int CEF_CALLBACK
+cookie_manager_visit_all_cookies(struct _cef_cookie_manager_t* self,
+ struct _cef_cookie_visitor_t* visitor) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -179,9 +183,11 @@ int CEF_CALLBACK cookie_manager_visit_all_cookies(
return _retval;
}
-int CEF_CALLBACK cookie_manager_visit_url_cookies(
- struct _cef_cookie_manager_t *self, const cef_string_t *url,
- int includeHttpOnly, struct _cef_cookie_visitor_t *visitor) {
+int CEF_CALLBACK
+cookie_manager_visit_url_cookies(struct _cef_cookie_manager_t* self,
+ const cef_string_t* url,
+ int includeHttpOnly,
+ struct _cef_cookie_visitor_t* visitor) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -205,10 +211,11 @@ int CEF_CALLBACK cookie_manager_visit_url_cookies(
return _retval;
}
-int CEF_CALLBACK cookie_manager_set_cookie(
- struct _cef_cookie_manager_t *self, const cef_string_t *url,
- const struct _cef_cookie_t *cookie,
- struct _cef_set_cookie_callback_t *callback) {
+int CEF_CALLBACK
+cookie_manager_set_cookie(struct _cef_cookie_manager_t* self,
+ const cef_string_t* url,
+ const struct _cef_cookie_t* cookie,
+ struct _cef_set_cookie_callback_t* callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -237,10 +244,12 @@ int CEF_CALLBACK cookie_manager_set_cookie(
return _retval;
}
-int CEF_CALLBACK cookie_manager_delete_cookies(
- struct _cef_cookie_manager_t *self, const cef_string_t *url,
- const cef_string_t *cookie_name, int is_session,
- struct _cef_delete_cookies_callback_t *callback) {
+int CEF_CALLBACK
+cookie_manager_delete_cookies(struct _cef_cookie_manager_t* self,
+ const cef_string_t* url,
+ const cef_string_t* cookie_name,
+ int is_session,
+ struct _cef_delete_cookies_callback_t* callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -257,8 +266,9 @@ int CEF_CALLBACK cookie_manager_delete_cookies(
return _retval;
}
-int CEF_CALLBACK cookie_manager_flush_store(
- struct _cef_cookie_manager_t *self, cef_completion_callback_t *callback) {
+int CEF_CALLBACK
+cookie_manager_flush_store(struct _cef_cookie_manager_t* self,
+ cef_completion_callback_t* callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -274,7 +284,7 @@ int CEF_CALLBACK cookie_manager_flush_store(
return _retval;
}
-} // namespace
+} // namespace
// CONSTRUCTOR - Do not edit by hand.
@@ -303,16 +313,17 @@ CefCookieManagerCppToC::CefCookieManagerCppToC() {
CefCookieManagerCppToC::~CefCookieManagerCppToC() {}
template <>
-CefRefPtr<CefCookieManager>
-CefCppToCRefCounted<CefCookieManagerCppToC, CefCookieManager,
- cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type,
- cef_cookie_manager_t
- *s) {
+CefRefPtr<CefCookieManager> CefCppToCRefCounted<
+ CefCookieManagerCppToC,
+ CefCookieManager,
+ cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type,
+ cef_cookie_manager_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
-CefWrapperType CefCppToCRefCounted<CefCookieManagerCppToC, CefCookieManager,
+CefWrapperType CefCppToCRefCounted<CefCookieManagerCppToC,
+ CefCookieManager,
cef_cookie_manager_t>::kWrapperType =
WT_COOKIE_MANAGER;
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=75170ff033e8e382ba463d350493fab6e12e4192$
+// $hash=3c70ed00438c00d85c27407d1c0947d2b310f401$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_MANAGER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=07483aea0b811fedba3da36f7a598f06edd22faf$
+// $hash=399d62b7dd532222ab5e208d95acbd46985cc1aa$
//
#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2c087a5613a69038aa9bba45c46a56d96c6a60ba$
+// $hash=45985eb9f0544a0c90fea396ec66c921e44f55a5$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5cc7dfcfeb969f00a01d13456464b2811bda3a85$
+// $hash=8781ffbbab1b14d126dd8e91270e04628354940e$
//
#include "libcef_dll/cpptoc/data_base_cpptoc.h"
@@ -95,7 +95,9 @@ void CEF_CALLBACK
data_base_get_http_auth_credentials(struct _cef_data_base_t* self,
const cef_string_t* host,
const cef_string_t* realm,
- cef_string_list_t username_password) {
+ cef_string_t* username,
+ char* password,
+ uint32_t passwordSize) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -109,26 +111,27 @@ data_base_get_http_auth_credentials(struct _cef_data_base_t* self,
DCHECK(realm);
if (!realm)
return;
- // Verify param: username_password; type: string_vec_byref
- DCHECK(username_password);
- if (!username_password)
+ // Verify param: username; type: string_byref
+ DCHECK(username);
+ if (!username)
+ return;
+ // Verify param: password; type: simple_byaddr
+ DCHECK(password);
+ if (!password)
return;
- // Translate param: username_password; type: string_vec_byref
- std::vector<CefString> username_passwordList;
- transfer_string_list_contents(username_password, username_passwordList);
+ // Translate param: username; type: string_byref
+ CefString usernameStr(username);
// Execute
CefDataBaseCppToC::Get(self)->GetHttpAuthCredentials(
- CefString(host), CefString(realm), username_passwordList);
-
- // Restore param: username_password; type: string_vec_byref
- cef_string_list_clear(username_password);
- transfer_string_list_contents(username_passwordList, username_password);
+ CefString(host), CefString(realm), usernameStr, password, passwordSize);
}
-int CEF_CALLBACK data_base_exist_permission_by_origin(
- struct _cef_data_base_t *self, const cef_string_t *origin, int type) {
+int CEF_CALLBACK
+data_base_exist_permission_by_origin(struct _cef_data_base_t* self,
+ const cef_string_t* origin,
+ int type) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -147,9 +150,11 @@ int CEF_CALLBACK data_base_exist_permission_by_origin(
return _retval;
}
-int CEF_CALLBACK data_base_get_permission_result_by_origin(
- struct _cef_data_base_t *self, const cef_string_t *origin, int type,
- int *result) {
+int CEF_CALLBACK
+data_base_get_permission_result_by_origin(struct _cef_data_base_t* self,
+ const cef_string_t* origin,
+ int type,
+ int* result) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -179,9 +184,11 @@ int CEF_CALLBACK data_base_get_permission_result_by_origin(
return _retval;
}
-void CEF_CALLBACK data_base_set_permission_by_origin(
- struct _cef_data_base_t *self, const cef_string_t *origin, int type,
- int result) {
+void CEF_CALLBACK
+data_base_set_permission_by_origin(struct _cef_data_base_t* self,
+ const cef_string_t* origin,
+ int type,
+ int result) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -197,8 +204,10 @@ void CEF_CALLBACK data_base_set_permission_by_origin(
result ? true : false);
}
-void CEF_CALLBACK data_base_clear_permission_by_origin(
- struct _cef_data_base_t *self, const cef_string_t *origin, int type) {
+void CEF_CALLBACK
+data_base_clear_permission_by_origin(struct _cef_data_base_t* self,
+ const cef_string_t* origin,
+ int type) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -214,7 +223,7 @@ void CEF_CALLBACK data_base_clear_permission_by_origin(
type);
}
-void CEF_CALLBACK data_base_clear_all_permission(struct _cef_data_base_t *self,
+void CEF_CALLBACK data_base_clear_all_permission(struct _cef_data_base_t* self,
int type) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -226,8 +235,10 @@ void CEF_CALLBACK data_base_clear_all_permission(struct _cef_data_base_t *self,
CefDataBaseCppToC::Get(self)->ClearAllPermission(type);
}
-void CEF_CALLBACK data_base_get_origins_by_permission(
- struct _cef_data_base_t *self, int type, cef_string_list_t origins) {
+void CEF_CALLBACK
+data_base_get_origins_by_permission(struct _cef_data_base_t* self,
+ int type,
+ cef_string_list_t origins) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=556a51c2b0295892b98e2c6f62b27b99eba39286$
+// $hash=bcd06269b419de539f58d0d17f5e568d370641ac$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DATA_BASE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0d2b19ca10e7a4ad389d3ce8de83addc1cad4b63$
+// $hash=67304c5e02c51d987d2a4b4f0a03e019f44018ea$
//
#include "libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=424b81efdcb5b86629d8388df5df13b1229155bb$
+// $hash=9ef76b4e16c9ee12b2c5956a3e4789fe2e40d9f0$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DELETE_COOKIES_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a8a10af1258edd37dbb8d079a10943070c1e9c4c$
+// $hash=c39b7ad0cee7f051f5b2f374917910aae6e9a96a$
//
#include "libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=309236e96bdbd2d39e63f94872d2de18552bec80$
+// $hash=4f034b01b5709e8012ff089e000216008f6232b6$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DEV_TOOLS_MESSAGE_OBSERVER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,12 +9,13 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2f925fbe5bb419b6adf14c4b508c7330ec8dd84a$
+// $hash=3c71c8ae9b8f6ae947bfccd7e018137d7f30737c$
//
#include "libcef_dll/cpptoc/dialog_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h"
+#include "libcef_dll/ctocpp/select_popup_callback_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
#include "libcef_dll/transfer_util.h"
@@ -67,12 +68,68 @@ dialog_handler_on_file_dialog(struct _cef_dialog_handler_t* self,
return _retval;
}
+void CEF_CALLBACK
+dialog_handler_on_select_popup_menu(struct _cef_dialog_handler_t* self,
+ cef_browser_t* browser,
+ const cef_rect_t* bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ size_t menu_itemsCount,
+ cef_select_popup_item_t const* menu_items,
+ int right_aligned,
+ int allow_multiple_selection,
+ cef_select_popup_callback_t* callback) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+ // Verify param: browser; type: refptr_diff
+ DCHECK(browser);
+ if (!browser)
+ return;
+ // Verify param: bounds; type: simple_byref_const
+ DCHECK(bounds);
+ if (!bounds)
+ return;
+ // Verify param: menu_items; type: simple_vec_byref_const
+ DCHECK(menu_itemsCount == 0 || menu_items);
+ if (menu_itemsCount > 0 && !menu_items)
+ return;
+ // Verify param: callback; type: refptr_diff
+ DCHECK(callback);
+ if (!callback)
+ return;
+
+ // Translate param: bounds; type: simple_byref_const
+ CefRect boundsVal = bounds ? *bounds : CefRect();
+ // Translate param: menu_items; type: simple_vec_byref_const
+ std::vector<CefSelectPopupItem> menu_itemsList;
+ if (menu_itemsCount > 0) {
+ for (size_t i = 0; i < menu_itemsCount; ++i) {
+ CefSelectPopupItem menu_itemsVal = menu_items[i];
+ menu_itemsList.push_back(menu_itemsVal);
+ }
+ }
+
+ // Execute
+ CefDialogHandlerCppToC::Get(self)->OnSelectPopupMenu(
+ CefBrowserCToCpp::Wrap(browser), boundsVal, item_height, item_font_size,
+ selected_item, menu_itemsList, right_aligned ? true : false,
+ allow_multiple_selection ? true : false,
+ CefSelectPopupCallbackCToCpp::Wrap(callback));
+}
+
} // namespace
// CONSTRUCTOR - Do not edit by hand.
CefDialogHandlerCppToC::CefDialogHandlerCppToC() {
GetStruct()->on_file_dialog = dialog_handler_on_file_dialog;
+ GetStruct()->on_select_popup_menu = dialog_handler_on_select_popup_menu;
}
// DESTRUCTOR - Do not edit by hand.
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=52c108ee7b518b733b331b7d172f16bf3126fe3d$
+// $hash=fca3fb90b8a74c5cdf3dc16e1489668ce80c7c07$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DIALOG_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c55e53ae76eba8e90a364cd6768764a4c56967ff$
+// $hash=a3293282e7d3c476dc68b315b9d698d8c62768b6$
//
#include "libcef_dll/cpptoc/dictionary_value_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ddb7429c3059bb7af3a285adde53aab78a99d39d$
+// $hash=dd73e5b97103c4ad27620af89886e49bfbdc8d21$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DICTIONARY_VALUE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=dcec0d8e6a9a0d393173112aa81e0f9dc70f73db$
+// $hash=a6d58b8140f21ae5130189a75c283510d7e712fd$
//
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=db9ca0d224aa971d8912fc577c53cc9abe52fe58$
+// $hash=8ba6fb9ce96e92ba80a05258060e530ddf822264$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c4cad301694f35ea716d7c4376252140fcb0d78f$
+// $hash=66706283cc184aece537eb9df570f7bd8a3281a5$
//
#include "libcef_dll/cpptoc/domdocument_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8aea7ead4b6cbdefba65a1234213fee4eb4a1952$
+// $hash=6a5b9bb0155acb8c5e6f796e68463825e00a8e53$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMDOCUMENT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d352693e8728b1ed586dc62d69a91dd92667760a$
+// $hash=a83ee414291415564391c48a351d4ea2691d8358$
//
#include "libcef_dll/cpptoc/domnode_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e5c97231e7d369e8fb4bd73611ec49d7289af076$
+// $hash=18f223a2671334b8bd8d463a94b5a3c0191141e8$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMNODE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f809bcb5a3f1246b3a94aebe14ad36bbb7e185c7$
+// $hash=7426be91c0a1a5d650b24d18f23cc5f559c9971e$
//
#include "libcef_dll/cpptoc/domvisitor_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=974358c3bab311f8a19af125f5ccf2dfd13ad8e7$
+// $hash=2a64ff6edd81d5158997158c91e75b85dbd8da39$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=496b226297ba7d5fa5e7e7bd4117c417e26fae59$
+// $hash=ed4452d7a096e5dfbd091bbcaeac61f3851d943a$
//
#include "libcef_dll/cpptoc/download_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d8c8f94bad7ee32841d16658b106158880edb5e0$
+// $hash=1b301493e2f905a2761858e2d6623765a540f918$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9313088260606d8b5a57b7e75c1d37e724924a40$
+// $hash=83a570d6d3a6b45d9d7502bbeba9e2e8fa726d0e$
//
#include "libcef_dll/cpptoc/download_image_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c5f83abc0a8e18b3f0c87d39f83df687dfff22e1$
+// $hash=9a9250d7e4f3d2018c4b441e6616930627625b59$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_IMAGE_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7cb000dca30be501541fc16036c585a3cd6618cb$
+// $hash=dad2dfff457e4c1ad5b2a8722f79b5dd74bc5448$
//
#include "libcef_dll/cpptoc/download_item_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d0baa6c264292da99e5c909d18450486435c9a8e$
+// $hash=1c85860b0d21f2efc1610ed47af70ed570f63926$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=64b3cee6b2de98140a1dc6f6aabff6b2c4ac7d78$
+// $hash=86d4cf7d9ddcc2e20f09a6a7270b376e7de4fef8$
//
#include "libcef_dll/cpptoc/download_item_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=72609007d48530320ae4a0f210c4604108d896d9$
+// $hash=3817a67cd4da8a318fe118f775a86a3daa22af67$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2a39ab30ca26c5c63ce557b31f86a5557cd96ebc$
+// $hash=6fbfc46d229413699c26e2e8d669e04c5ce776b1$
//
#include "libcef_dll/cpptoc/drag_data_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c267ab21bb2e49ecade7ba3c7545003d7e072373$
+// $hash=4ce3b8cfc691f8cb7aa224a00d7835283c5039ab$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DRAG_DATA_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=53febc1355422739c9de942f67f52fb4de462571$
+// $hash=7569af91eb9b0d7bc5af403a6733d06ada294955$
//
#include "libcef_dll/cpptoc/drag_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=39ab6f4e1f88efb2d726995d7075c904e11091e6$
+// $hash=9d82217b402aa41686392b0ba81169f4b41035e7$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=67836a9b2dfec98cab93231cb7e07ca2b9696123$
+// $hash=d1cdc1747a3caa4b8aa4cc385c1164bc066bbefb$
//
#include "libcef_dll/cpptoc/end_tracing_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0769e0fec9a6f3c0e33d35b23ebf1bec4a205844$
+// $hash=81dc12ded9752671497f775c397ca120632c4ddb$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_END_TRACING_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5ae76b861609dc9f1b0d033dcebf514d8ef68a57$
+// $hash=e62a7361febcdb3a9608051a0e4902a571e94ebc$
//
#include "libcef_dll/cpptoc/extension_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=46725937bd7ba35ca8ea8fb2d1bbdeac0c53dc80$
+// $hash=924265d65cc81f721d9757d8b4a325260e1848d1$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_EXTENSION_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7cdd0564d9b129bf9f068764d4d1588645445d5b$
+// $hash=d75d766c210dd2b55be991f962651b25047a14cf$
//
#include "libcef_dll/cpptoc/extension_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b695266a9c10c4fc0b68f96b64a77cc5c0235827$
+// $hash=db012b196983395c9684bf1275b638e9ccc57949$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_EXTENSION_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d334e579f498ad7727721dfe4e10ad810b81035a$
+// $hash=d226e92e69207d76675dc52b7ab5f4e68262ee7d$
//
#include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2b6c5e5bd0bb44f1c916b317bccb0e0794c28f91$
+// $hash=2db275ca5be351037a0e19531fb2ed4c3af4498d$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_FILE_DIALOG_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=022bd3d1f8fd0eb3de156647dd4f50d688747534$
+// $hash=dec97de981cccf1e47dae36336011071a1a8e80b$
//
#include "libcef_dll/cpptoc/find_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c6408d6714984291379f0113e7806cac21aee934$
+// $hash=fd8c0866622e63f6564c0b00107ebcb0c82d60fe$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6d554e767e9e5eea0d9caefba61e35fbe4fff231$
+// $hash=baed9b712645a466ab9c52ae814f31eb10c0ef3b$
//
#include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=def50c909d368ef1d03f1932f2b0283c3cbf8165$
+// $hash=b4e1894b64083f0045302da4840abf664c5a2429$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d9d33c576ca1d7bef983c275e8b115767237f69c$
+// $hash=ebf943663fb2988ca0b2a0cd40d4dea389678604$
//
#include "libcef_dll/cpptoc/frame_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5154f627049509d38f098549ea08fb26a0712963$
+// $hash=e2af583c7a4b0b6b071e9e96ce8645375902673d$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_FRAME_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=276f4b15ecef989b38c2a6dd9cac5be7df5cb844$
+// $hash=92d9c5512725c0532baa33ab9f324f18af40a641$
//
#include "libcef_dll/cpptoc/frame_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d0f6aac72a7795b0221831ffe475fa8b5062ab1a$
+// $hash=72b035624f1edff425da000635d111f72186fffc$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_FRAME_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a21b3afd08841726e90bdc044e0dd0d22b277264$
+// $hash=901fb04c00bd650e2e0bdff347fdd3ad460f5a21$
//
#include "libcef_dll/cpptoc/geolocation_acess_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=42966754a9927c84debb6edfd37f8c41873ee268$
+// $hash=66a1438642f8ff3dd315b9535336be8d6b2c3e99$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_ACESS_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3f24789c79862889b5a0454c743bf70f71a98faf$
+// $hash=b129eeac4e3e5ce621b58018d7516127f7a85aed$
//
#include "libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8e0f89043319ecad378af6125bd4fcdbd8bdd34e$
+// $hash=76b58a0d3f719bb4899c87ec701d89a96a45ae31$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_GET_EXTENSION_RESOURCE_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=aa8ce20cabfc1a45e42b70040c2de7fa540d9466$
+// $hash=c8fcd18ac761a259a3dc23799f2b7ca3863b2ff2$
//
#include "libcef_dll/cpptoc/get_images_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6902a0c4f13668d55f729924580a7bd25c7c3718$
+// $hash=d5b18c7be26bf71b47bb68718126ef89fad457d3$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_GET_IMAGES_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8c21d39cfec72fe99c8317906941d00cd3cbf0d0$
+// $hash=4bf000010f6c757be8d561c82ebc8c6142f31a3d$
//
#include "libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6ba873fdbcca40051dd14bd26bc4a4c7a8999b5f$
+// $hash=79d42142140e6b820264a3d723ee0f1ffa1747f2$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_GET_ORIGIN_USAGE_OR_QUOTA_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=aff05076c3fad1702ba17a27a4e4713ae1593596$
+// $hash=c2fd30c49290abe08881da439bab727b9504b3da$
//
#include "libcef_dll/cpptoc/get_origins_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=86239d3281ad43ad93dcbe67a82a713044ab885d$
+// $hash=a0d4dd8ca32ce2f249a5f36f798be8dfa594d25a$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_GET_ORIGINS_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e9ee6df7e0e77e54dea7e2c1e4b24cdc88b79344$
+// $hash=fce97ac2600da10ad5349abe49c2cf80aaa6b55d$
//
#include "libcef_dll/cpptoc/image_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e82ca8d18a0367d4061f67afd33a8a486f338238$
+// $hash=4ce026e90daa0a4d5d4be0baf1e8dbd3ede5974f$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_IMAGE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b98959cda67200ef6a434297c5e9de53a2e948fb$
+// $hash=98a8f58c5379ac345b36c7cde9ba25d31837447b$
//
#include "libcef_dll/cpptoc/java_script_result_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fe951e9554ef1ba97fc78a2caac2f154497bde3f$
+// $hash=d2e376ccc88d8547a4b4aca415a638f8b5fe6eab$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_JAVA_SCRIPT_RESULT_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8a66dc7024a4d368e8368b1be42deff60f4966dc$
+// $hash=9486b9a33142d7af6d5635bef96621238ceadd5d$
//
#include "libcef_dll/cpptoc/jsdialog_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5bc7b389cab53db3487532fbcae4ad156c814710$
+// $hash=37aac75252a6f35a8abe927ca603849ce98ac1e1$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=41c06df7feb0288f02c644bd633cce3f1754beba$
+// $hash=93d039a400e46cc0b87bbab7a9b68b61e6dd6a66$
//
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=507a9b3192b98d0fad632714a8a4a4f97e5c19a3$
+// $hash=c6a25a7ceb346f562302df398305f3d09a7c587d$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9f55775c0fcff5993efe9d8c9db75001d4335743$
+// $hash=c1ff97a2d1992f704d02e1afc689a7d0b5426b6f$
//
#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5d3509b80dac95b50b7d3c7053562169055ad361$
+// $hash=0798f508afacf2ed239982052247da9cd7f366e9$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=46fab68760ab49b9a282aafb0e55d81de9cca943$
+// $hash=402f069391e367a81c76fc24b1081e713acabcae$
//
#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=85c8f684b4799cf1410174b0e29a41b192eaf7a4$
+// $hash=74c66feec24c563e6f3f32230dcb0dbf45ed9350$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2d2041c7571bd613f92c2d80c100e92e7439df6e$
+// $hash=b62e31a8e177869cf33c37c48d158802700a0080$
//
#include "libcef_dll/cpptoc/list_value_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=85db2149d4c843eae2145e9015c2062d8ad45695$
+// $hash=bb4f6bacea8366b11d1526059c5ad4c3df495630$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_LIST_VALUE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1c8a4ef9964effea5d8f02abc6890794c7a22df7$
+// $hash=c0c0bf119990d7ce088a2c9c7fc0fc4a0a378460$
//
#include "libcef_dll/cpptoc/load_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=67a49693f79a526ebb12c8352c13de8bf7c64784$
+// $hash=60feef3855499ffd313c9e10fe4e8a6304acc871$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=587be50ef3aefc00fadcf6fec431ebecc305b3eb$
+// $hash=d5b8daec5b6d6a6632d664143e27361425c00212$
//
#include "libcef_dll/cpptoc/menu_model_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8c46e7f774742f9834a61bc7657fdc03a0ed580c$
+// $hash=5f39f05bb39da5ede094d0e9789c5ef1dee1cf7f$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_MENU_MODEL_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d46082f24a6ad01677700ac68ad424cc4951efed$
+// $hash=57f03a43b0143d9f4f52cd110400c2fbe06d72e9$
//
#include "libcef_dll/cpptoc/menu_model_delegate_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c48cb7ff4b3e506b4e1ca8b1442bfe91d260ec67$
+// $hash=2277b8692532f706316bb97ffe611394a00e1023$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_MENU_MODEL_DELEGATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1e8f06cdecbf10a9b95fd1be4e6d4a0154f4aff0$
+// $hash=a55e8468667740e9e121e0d553a416d2337c15f6$
//
#include "libcef_dll/cpptoc/navigation_entry_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=888591dac662cceb022bc320c159fcba58fc6e24$
+// $hash=213e6404f2260e81c41b20a42ae7788af80710dc$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=dc5e1a5dece19a5168915d1a6816ac4a52c1078f$
+// $hash=bb3302d31f5fe2e81cde418da8c25d16138ce3b7$
//
#include "libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=112f7c12c88d09e4d300cd3d8bf1f72b1be54596$
+// $hash=e2fe9b1846135732e7596c2ff7ab6efadbb5a519$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=388a87f728a292dc4e2101724656ac09b8fdaa1d$
+// $hash=7f58256b38894ba0a8bf514cbdd2719e75bca5c3$
//
#include "libcef_dll/cpptoc/pdf_print_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0dfa6d58ed63c1e3be9992486e404a642df6e32a$
+// $hash=5e9c671740881e345231547607160ce167d37728$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_PDF_PRINT_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a0c1e9d26c0b0129b85719532cd7312019c2d5f3$
+// $hash=26d002adb41352f89861e1da149863a378f00a1e$
//
#include "libcef_dll/cpptoc/permission_request_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b4bca43d1905283a291f6df6cf1a15bccf569618$
+// $hash=8ef60b5e6629947be455e0c402c9170bf7848cff$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_PERMISSION_REQUEST_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=935efc8f333c6df95b783e1e80bb84aa26d55b9b$
+// $hash=0de557ec053dbe8fd6ae4e455450549ff322e195$
//
#include "libcef_dll/cpptoc/post_data_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c73c8a6c74113ead0251ca0afb007d2baa02030b$
+// $hash=784458fd59458b07ba3c6eacac3803b9901c354c$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_POST_DATA_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6148547c3504062984362b43db9e95ee68ef1358$
+// $hash=eb33ec601cd24711837575d3bc19dc603a2d939a$
//
#include "libcef_dll/cpptoc/post_data_element_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e29b5318c16ccbffa354d79176698d1709048e32$
+// $hash=6d48d5f01f5cebcdca0fcfa7ce2b39a049fdc9cd$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_POST_DATA_ELEMENT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5332b8cb609fa0f5b98e607878678808d21da3a4$
+// $hash=bca20d1cfd7f00c65784d4532b02f8a05cf06068$
//
#include "libcef_dll/cpptoc/print_dialog_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=88e44e22bb56d51ba9a60f38f59b89bb3e372748$
+// $hash=ee6fd2ddae3899be82feca1e37cce919363bae99$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_DIALOG_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9c26e4bf9952a26541915f64dad82080f09dfd58$
+// $hash=b23eaa74cd7c6a1075d6a8c4b7d1ecbc9effe142$
//
#include "libcef_dll/cpptoc/print_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=49bb73be2c56a31fff2e88875360591dd31bdd8c$
+// $hash=cd0bb4e9c12f53896be544b28ae3c6f38b3504e2$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3becd112f5c17b36328e77fcdcd296cdf73291a3$
+// $hash=e631d13c43819555aabf52b015d40ab9cd532b91$
//
#include "libcef_dll/cpptoc/print_job_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d3c680caf88e14fa8cd3c846fe44870900f82ea1$
+// $hash=54a355e9511b5d0956f1a7269ee21766fa7f8c87$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_JOB_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8840518039eff950764302105148c5da0b0c996a$
+// $hash=fe89e407154f3696538e128f07da6d26767b7f5c$
//
#include "libcef_dll/cpptoc/print_settings_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ab8680da4bc909d2c1a6cf723fafc1a561bfeb44$
+// $hash=596144335f97b41394808d0de0908c2a69d04d7a$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_SETTINGS_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b63f665e68e4dc6269c3e88b81068190ea90abb3$
+// $hash=380c4fce89031ac6da4de226f3007d1a8a1b26ef$
//
#include "libcef_dll/cpptoc/process_message_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e70a96835042a2ebf0a60f2130f31d24f1ca59fd$
+// $hash=6d4c104d51d4d34c0ec8b767a13db58a6fb0fef8$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_PROCESS_MESSAGE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a0976edc09e822700d8f402b2dae7af4c434d86f$
+// $hash=dead2ddfaea0555af195b8bb7bb858a57e96f25b$
//
#include "libcef_dll/cpptoc/read_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3c16def2c698c26a175b1087db819d3894a264fa$
+// $hash=8a5eb8ffc9a8857ac10a6586e954dc532d10618a$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=bfa5ab4142b6fe56939a45241a39bb74f3a84acb$
+// $hash=9256f12f40a70c8a2e6100882473516f80c097c4$
//
#include "libcef_dll/cpptoc/registration_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=edd002ac63a0564820617ad44c5c30f9674b8122$
+// $hash=461d6b9297ebd61bf8d2df2e3960458a9a3705f6$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_REGISTRATION_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c83f5f49a5411a5071750e238c12e22bfa82c48a$
+// $hash=5da07c9f36d3f52ef73ea85ebd73fecb31838536$
//
#include "libcef_dll/cpptoc/render_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=18b7f5398b817f5d20f26aa4e139faa4f91cfe0b$
+// $hash=a0cdfb84f8b30f01dd01556ad3e1725e043641e0$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=08f14fa621595f247e87853c39c3375fce2c9326$
+// $hash=05c223f2568d1c7deb34613ae3838bdcf6fdb0ee$
//
#include "libcef_dll/cpptoc/render_process_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8d832edacd5ccc0baac1314aaa9424ba2ab4837c$
+// $hash=1686827d48e7c0d75a603a2b6b8ca05b4f158340$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RENDER_PROCESS_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f895effb80d27ea9ae57687c81df2f8871e2ea53$
+// $hash=8b3881774a33c2efa32765341a72e050d321db58$
//
#include "libcef_dll/cpptoc/request_context_cpptoc.h"
@@ -17,7 +17,6 @@
#include "libcef_dll/cpptoc/data_base_cpptoc.h"
#include "libcef_dll/cpptoc/dictionary_value_cpptoc.h"
#include "libcef_dll/cpptoc/extension_cpptoc.h"
-#include "libcef_dll/cpptoc/media_router_cpptoc.h"
#include "libcef_dll/cpptoc/value_cpptoc.h"
#include "libcef_dll/cpptoc/web_storage_cpptoc.h"
#include "libcef_dll/ctocpp/completion_callback_ctocpp.h"
@@ -579,25 +578,6 @@ request_context_get_extension(struct _cef_request_context_t* self,
return CefExtensionCppToC::Wrap(_retval);
}
-cef_media_router_t* CEF_CALLBACK
-request_context_get_media_router(struct _cef_request_context_t* self,
- cef_completion_callback_t* callback) {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- DCHECK(self);
- if (!self)
- return NULL;
- // Unverified params: callback
-
- // Execute
- CefRefPtr<CefMediaRouter> _retval =
- CefRequestContextCppToC::Get(self)->GetMediaRouter(
- CefCompletionCallbackCToCpp::Wrap(callback));
-
- // Return type: refptr_same
- return CefMediaRouterCppToC::Wrap(_retval);
-}
-
} // namespace
// CONSTRUCTOR - Do not edit by hand.
@@ -633,7 +613,6 @@ CefRequestContextCppToC::CefRequestContextCppToC() {
GetStruct()->has_extension = request_context_has_extension;
GetStruct()->get_extensions = request_context_get_extensions;
GetStruct()->get_extension = request_context_get_extension;
- GetStruct()->get_media_router = request_context_get_media_router;
}
// DESTRUCTOR - Do not edit by hand.
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7350e36d25125a3560d0e0da5b46daa60295c7a7$
+// $hash=07ccff0f6993fe1634467a76d9996081fca0ec3a$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2e085c019a8e5c4701db0ee23fbd06b275e6342b$
+// $hash=43bd770ac450f9f61d50ddebd85b209953c2fce0$
//
#include "libcef_dll/cpptoc/request_context_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e1cebce8a08c570f02235a53bab5f6aa0b13699c$
+// $hash=0985ec29d8f7825abf5542f7bff3a0477431fc1a$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b1a7f857e453a625325a1a2847e60990eecc61ea$
+// $hash=4f55af31ee0cf2bde8f353e26283210430f2d871$
//
#include "libcef_dll/cpptoc/request_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=25a489e9a54195be43325a811956c66f578fbeb0$
+// $hash=406c30cba514a450568bc341a7facf5495ab58a5$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=162a493c73858bd96eb41016a031932bb23d4a70$
+// $hash=bd54d0dce483d6e05e564e7fbe6a2743f4d6b277$
//
#include "libcef_dll/cpptoc/request_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4cda9dc12a20ead4f6889fd26a176da22ca67c50$
+// $hash=0167d427e72426d439b11b2655caac2b79a7b8de$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d6f5224414a15d32a42ed2862b30c0076d0b5d95$
+// $hash=0a182976f79666acbe49e7bc5fe2e8b07b3afe7c$
//
#include "libcef_dll/cpptoc/resolve_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=659df5decaf5cab4624f6f15b8bceeed0bd2d228$
+// $hash=aea5c318f99d23b06478b765f81720890aa098b3$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RESOLVE_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5081aa41e87ea1a44df19f1df060a478b3b902d8$
+// $hash=99b8484b086c9f3d26e56621610e7761ba5d4f5e$
//
#include "libcef_dll/cpptoc/resource_bundle_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=808eba3682873dd7b948ed9f572d9960df9a1b2d$
+// $hash=c126e6379765b577e7251c418bd3fe4dbe392522$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=486d1b31ccfd53e10dec622d3ae024c23b50e2c2$
+// $hash=d7cb40bc1f7bbdf092b3c80b162f134f24253359$
//
#include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=26b5dfed49b7182c1bdf52f50547ccb26c4850fe$
+// $hash=f6e9e2a12912ea7b9ab5060481e323c180698725$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=72d9dc0e438de96161f262353c153c11b76f8ad0$
+// $hash=19b5f403a0a77dfb38a0200046b35cf5d2053cfd$
//
#include "libcef_dll/cpptoc/resource_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a2b9dcc0ff22bd3f1b0ecb70a3e10b6c1c7a0ed7$
+// $hash=3853a8b89137fdd6c71bc86f801536517bde7c88$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9d07f53404d3b90d1e386e37b0ed4535afb57b39$
+// $hash=cf89b317501cd267ef18b96d934297412e7ddf5c$
//
#include "libcef_dll/cpptoc/resource_read_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7cd5016181dd61511cb1c1d3176d8aff5e5fba82$
+// $hash=f5efbaafb5a54dfb9deb422cf31a0908c8a4cfc3$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_READ_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=57f1a169f2b2efb6ff3f1ca71aa390fb1d82ed2d$
+// $hash=477291aae432b368ed8195975c5d93b5e19da36e$
//
#include "libcef_dll/cpptoc/resource_request_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a8c2b0d3df6a4c6b336084598084d14f62860a53$
+// $hash=0b8d614a76b9027970354dc850f7b491348a2941$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_REQUEST_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3b4968443aafd1ee42fcc9a5e7b466b38fb98d28$
+// $hash=ce7cc4f550ea769a9d8c3b757c19f9c48e0240d6$
//
#include "libcef_dll/cpptoc/resource_skip_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=decf49c2d8a337c353d149e9b9392065740eb06d$
+// $hash=5e756fb08a289333025a894573332555a1ab8e1f$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_SKIP_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1dc0f59d37e6979ba3f431463671f0feefc45c31$
+// $hash=09e7052fafc6202fa043603c97c56ae4b917a291$
//
#include "libcef_dll/cpptoc/response_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9bd9fdb8fe353f1af3ac543074cb74b12cdab0c5$
+// $hash=624d1cb515a9f5f44d6e63574021689ccfe09b76$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RESPONSE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b6721a12a6b018187b3ccc87557beb29be130100$
+// $hash=490594608437694d853b132444163af6352eb1e5$
//
#include "libcef_dll/cpptoc/response_filter_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6ef35ca53f2bd4523397d3f56b02ca9b40a811f9$
+// $hash=55d4dc0a6467d6d084de5e1114be0fcd36ae89b9$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RESPONSE_FILTER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d76ba7de3a561c71b88250340676e56dc7a9f84a$
+// $hash=ee06834316c98179b98e7226f89b8a630a11de2b$
//
#include "libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d8003b6de1b89c64b2d5b53ea1665dda982effb9$
+// $hash=a41928b718004e3e8cc92ba620b20f76ad9181b7$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RUN_CONTEXT_MENU_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2e6aa9015192a3704df073f7dad0c6fa3b05f76c$
+// $hash=9b4502e14a4597158e56d4a5ea3307e9798499f9$
//
#include "libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6542e83e5f1a6694575c89e628ee11da17bb6624$
+// $hash=7f45e5e5b3772e10b2eb6901c3e27e835a873163$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RUN_FILE_DIALOG_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=51e850e2768a6ec8ec7d764830d27138334d82ac$
+// $hash=2695b1c7532d10e5f337c353a51d1e5e97667b9e$
//
#include "libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b641fe8119fa5ab3e3a635105ca25985dec40bd0$
+// $hash=acc845289f80273062c7fde7d81e0c034a80f4e1$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_RUN_QUICK_MENU_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=abd81866575f873556b4ae40313ea65c89219756$
+// $hash=96fb6718f22acb2425f9fe31f64bd7c71531a2a8$
//
#include "libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b119c6e375aee04bc83623c73f61b7eb39af16f5$
+// $hash=746b9d06b417c9730fa98fa456a08e5c53e5475b$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c028de29ae5b48ed41d4e8b8ae3df9a0ee765e14$
+// $hash=aef6d4c3a2016f1cfd4c9aff12d59302b2dba3a8$
//
#include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f14ceae023fe1f52e53b26edb60667203b919178$
+// $hash=92c5fb1f7d14753510b029f71579a26970f0304c$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_REGISTRAR_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d20b8b121892f6d2fe0f944c4447464ab6657feb$
+// $hash=09750a65f47197298e8600d97c627fb6ee233800$
//
#include "libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3cfa40dde5fccdecbb2d598b20e1d76cc13f4c34$
+// $hash=31869f5383d73caf6fa9b3fede9f2e47f54a01ae$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_SELECT_CLIENT_CERTIFICATE_CALLBACK_CPPTOC_H_
new file mode 100644
@@ -0,0 +1,95 @@
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool. If making changes by
+// hand only do so within the body of existing method and function
+// implementations. See the translator.README.txt file in the tools directory
+// for more information.
+//
+// $hash=8d79b93a23482ece6217a0a113578c32e6926f94$
+//
+
+#include "libcef_dll/cpptoc/select_popup_callback_cpptoc.h"
+#include "libcef_dll/shutdown_checker.h"
+
+namespace {
+
+// MEMBER FUNCTIONS - Body may be edited by hand.
+
+void CEF_CALLBACK
+select_popup_callback_cont(struct _cef_select_popup_callback_t* self,
+ size_t indicesCount,
+ int const* indices) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+ // Verify param: indices; type: simple_vec_byref_const
+ DCHECK(indicesCount == 0 || indices);
+ if (indicesCount > 0 && !indices)
+ return;
+
+ // Translate param: indices; type: simple_vec_byref_const
+ std::vector<int> indicesList;
+ if (indicesCount > 0) {
+ for (size_t i = 0; i < indicesCount; ++i) {
+ int indicesVal = indices[i];
+ indicesList.push_back(indicesVal);
+ }
+ }
+
+ // Execute
+ CefSelectPopupCallbackCppToC::Get(self)->Continue(indicesList);
+}
+
+void CEF_CALLBACK
+select_popup_callback_cancel(struct _cef_select_popup_callback_t* self) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+
+ // Execute
+ CefSelectPopupCallbackCppToC::Get(self)->Cancel();
+}
+
+} // namespace
+
+// CONSTRUCTOR - Do not edit by hand.
+
+CefSelectPopupCallbackCppToC::CefSelectPopupCallbackCppToC() {
+ GetStruct()->cont = select_popup_callback_cont;
+ GetStruct()->cancel = select_popup_callback_cancel;
+}
+
+// DESTRUCTOR - Do not edit by hand.
+
+CefSelectPopupCallbackCppToC::~CefSelectPopupCallbackCppToC() {
+ shutdown_checker::AssertNotShutdown();
+}
+
+template <>
+CefRefPtr<CefSelectPopupCallback> CefCppToCRefCounted<
+ CefSelectPopupCallbackCppToC,
+ CefSelectPopupCallback,
+ cef_select_popup_callback_t>::UnwrapDerived(CefWrapperType type,
+ cef_select_popup_callback_t*
+ s) {
+ NOTREACHED() << "Unexpected class type: " << type;
+ return nullptr;
+}
+
+template <>
+CefWrapperType CefCppToCRefCounted<CefSelectPopupCallbackCppToC,
+ CefSelectPopupCallback,
+ cef_select_popup_callback_t>::kWrapperType =
+ WT_SELECT_POPUP_CALLBACK;
new file mode 100644
@@ -0,0 +1,38 @@
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool. If making changes by
+// hand only do so within the body of existing method and function
+// implementations. See the translator.README.txt file in the tools directory
+// for more information.
+//
+// $hash=38cd12caaee1fc018d0fd04eee914774eec7c41c$
+//
+
+#ifndef CEF_LIBCEF_DLL_CPPTOC_SELECT_POPUP_CALLBACK_CPPTOC_H_
+#define CEF_LIBCEF_DLL_CPPTOC_SELECT_POPUP_CALLBACK_CPPTOC_H_
+#pragma once
+
+#if !defined(BUILDING_CEF_SHARED)
+#error This file can be included DLL-side only
+#endif
+
+#include "include/capi/cef_dialog_handler_capi.h"
+#include "include/cef_dialog_handler.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
+
+// Wrap a C++ class with a C structure.
+// This class may be instantiated and accessed DLL-side only.
+class CefSelectPopupCallbackCppToC
+ : public CefCppToCRefCounted<CefSelectPopupCallbackCppToC,
+ CefSelectPopupCallback,
+ cef_select_popup_callback_t> {
+ public:
+ CefSelectPopupCallbackCppToC();
+ virtual ~CefSelectPopupCallbackCppToC();
+};
+
+#endif // CEF_LIBCEF_DLL_CPPTOC_SELECT_POPUP_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d0cfc5e4c052a2d1fe43d1c0ae264642db03c04c$
+// $hash=abf39f5a0fa0be81e8c8fbd743ea6f4f4c2e14c3$
//
#include "libcef_dll/cpptoc/server_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a36274939df284287ac49a8ec9321f8188d4fddb$
+// $hash=edf9787173ef035101e1d1805f2926b6028530f8$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_SERVER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2ef239c7779477feb8808f2198e7d2063ab74156$
+// $hash=37a840b566aadeeddaa21af7fa5fda4c222b5571$
//
#include "libcef_dll/cpptoc/server_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=754575fa090b971fc9105fecda97a407ef0d2484$
+// $hash=ba72a7b9571b7e2d9d490a02972855eca1ff987f$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_SERVER_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=99f02c8911b913161cfd3834e19bbdc0ba542409$
+// $hash=1672096b07c52bafaa15e3e195116c2a4b30f938$
//
#include "libcef_dll/cpptoc/set_cookie_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3e86bf9e36a3ef63e6777dcafee8847bd4965a60$
+// $hash=886b832f912900c89787888566d4d5e803c91ebc$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_SET_COOKIE_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=78b529fc88b9701f7cf8d40097576704b0ef35fc$
+// $hash=bd192e23b1985c9413ec6b09b7b1854ea65b5590$
//
#include "libcef_dll/cpptoc/sslinfo_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=00ab5a37c56c5bd5f14ae97f72338a32615214b7$
+// $hash=2eaaaeef70817cde9783efe192d0f57cb73ddfad$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_SSLINFO_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8596e5de45842c1e1de8e6377c2b7d932218c370$
+// $hash=f645a1528c4091733cdd8b93c7d076c11cb8a329$
//
#include "libcef_dll/cpptoc/sslstatus_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8f0a00c305a6defdcbf4caa2ea437cefe49a191f$
+// $hash=dba266754e189de39172bddaacf0dfa3fdd79351$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_SSLSTATUS_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=63e0d5c68603a8478c9b8a638618c9b6554665cb$
+// $hash=018aea8a22d2cd56b94fdb4afe6cda26e5267e50$
//
#include "libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1471041bc8e9230b7bef9e42aabaf441e641ab96$
+// $hash=a9b06d8d2a8a85752732cfdc632a1c67070f2a3a$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_STORE_WEB_ARCHIVE_RESULT_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fcbdc299c4f34868f817a9b77777a9b88f3cf07b$
+// $hash=5301e5393a92345b12208721df602fd8f9d25abe$
//
#include "libcef_dll/cpptoc/stream_reader_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c98bd38e350a4b24d11039a326e8df7fb86bfc75$
+// $hash=6482aca1d5d2c06d39d226f2d085580abc8eee99$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_STREAM_READER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ac20659d83a6efb764f3b55756dbc8c686fc5363$
+// $hash=5f8cba4541a5f92cbbe2c9aad2ec270528f597cb$
//
#include "libcef_dll/cpptoc/stream_writer_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9204925136614f1d4e4f4609ea6ee30dad0c2782$
+// $hash=7b95fc6bea4023038075ee6712eaceb6c0a153a8$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_STREAM_WRITER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cad58a7370ef2b36aacb2fdf527fe1c061f4a868$
+// $hash=5e22146a6ab1326e04c4de9d822b663e9ce6dee4$
//
#include "libcef_dll/cpptoc/string_visitor_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4cf29c1d2d715dee4855acda840ca47d5f1fabbf$
+// $hash=8f717e4df178cef8f90d5af081094a4952fcc90e$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_STRING_VISITOR_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=47bacb389bbb262f0be39b49c5d6251b8bf1c507$
+// $hash=d9ce29d70c61b486d32a45e8908b317f3b191a8b$
//
#include "libcef_dll/cpptoc/task_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a22ba7af43964082c9e8570da140389ca9953a12$
+// $hash=32859b75e638cd76a9319561b675fa3583818905$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7c1bd7fe9f9c91bc488299a2278f83a0850befe7$
+// $hash=cc3f60147bbed7acd8e4d111a53bf519757687b2$
//
#include "libcef_dll/cpptoc/task_runner_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3422c7340cee9aaf51c62fa1868b3e665ef34b2f$
+// $hash=66efea72ce623fbf542496f15d0b5fe33d426286$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TASK_RUNNER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0192ac51914013c4452ffbb99c3a2589137f7c78$
+// $hash=4117623ecedbef67bdfc9346f89208255798688e$
//
#include "libcef_dll/cpptoc/test/translator_test_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=aeae16842d711fd6e5d54cd14333d27cbc06c400$
+// $hash=5f0f8e9729af10fb258c197facf57ae150969f1a$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5eb9ef23f60f99db031e0e3da6cdfc81c979f5ff$
+// $hash=e673b289ae45b277af9c33ee74fe9056cff6e265$
//
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f84f12aa3e444b6ae98c620147bdacf6c32af8df$
+// $hash=b6731cceb5f02011f2bafe6afa336b95355a1bf0$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f331b4d8e20683281cee5cf873950c236fc6cffd$
+// $hash=7bbb368ca482601286a12f0ab7cc652fd16a1929$
//
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=abcdf3e219cfeac25ddf87a82c173189d0707bbd$
+// $hash=871a3626f0e6928f2b1094b6fd01175f2bc82a29$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=693175fcf035e056074e56a8a5e39e3f5d1c218d$
+// $hash=3c88df3fd064a4d053a17e1db85c95f2faa0f55a$
//
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=602040c56e366821ec632f5675d22d5b1787d046$
+// $hash=c578229af8491c038b4a036ca870c5dd268b9244$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8331f68f4339fbe375428550af8c793d455ef432$
+// $hash=1f115b393d5226e9be5216e8209cdd9d1a8df345$
//
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=80d99f15db9d7a39f51b24769104d2daeb100ef7$
+// $hash=f138313a94a2c2943926df60ee5293f5dc9f62b8$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=215ecf50a38a26a660ebd9c9784ddba9ef9ac336$
+// $hash=bf4d4b7f5a7395de486eeab67d16ad48310b0771$
//
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cf13344b75658fdc4d727598a1ca9cf1d2d9aebe$
+// $hash=f431a7518ff642f5b307dbd716bfcd75c5bcb37a$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ba3de8f4ffca578355877eb66e19a61e337fab63$
+// $hash=6bcfc2738c1acbf4476fe6fcdb62d3bb7f14f44b$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3a46ac0b98d0a79f8506ffc09a5c3cdcca353f29$
+// $hash=7a7900759a192fa0586d1ab7e2706c513ed9b715$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=da43c88a9d20786247371fa3a69230862f8619a6$
+// $hash=9d7c60f524e97dfb4ef831ee5c00037372d42673$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c639d2f671cbfeb508e95a481c0d81ee92b87c29$
+// $hash=bf705a17d41da4d434c122928b0f55c8760d3689$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=428d7bab8b87fe39bf70e53c8bf1d0a50bf88c33$
+// $hash=b1ca84e5a38b7d473cdd8386868c9cc7372e1ebf$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=26db238e377ea4db7b6c005d00dcaf270be64ce6$
+// $hash=333a572bf8bb3cde5058ae36410b571d777cd157$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c7dafd30c4f75e38e507feabdc40dc234d21a06b$
+// $hash=603f865fe40c123657e8d8213b6c03cb9fea36ad$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=87924524eab4c309d13dc3e9656c601fd65c7449$
+// $hash=df48c52988d69bfd94bc4245d1c2069f45512f7a$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=442b86286b5b3126fd0a0f0849ca661ef7487fb3$
+// $hash=481e41d324069dcb26cfc0c69b51ad4281e95144$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=43b0a0576a86ba1d2dda27c83af22554da773221$
+// $hash=029af2aa3f312b751ca30b039f22e5c4fbd42295$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9975067d09206080d5237a7d1e8dd70155deb554$
+// $hash=d8f0260fca4ead50ef8cfc5856fa94e835844846$
//
#include "libcef_dll/cpptoc/thread_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=820a6a8e017c6ba2a19f5c0b8db0f8aa628a0cfa$
+// $hash=684bc72317e634d7357bdea53bf7dfe81d9d536b$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_THREAD_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=db92b5330f0b984051a202144f77b389501a260e$
+// $hash=e5112f59f64307d7059920de8a59527494dad903$
//
#include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6ab5f8f6ff4a68382bd5e239ad2c8e2c12c39c6d$
+// $hash=da593bcc58bec4b7dc1159fdc2fd2b8f472a6c93$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6193670d2d0577eaf226bd1825cde7b3f70c0f68$
+// $hash=baa94bdc57a09aa7dfd6b040963510d037a6e37c$
//
#include "libcef_dll/cpptoc/urlrequest_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1902918d90c40d3b524c0f7adcb56dc9a565df4d$
+// $hash=f870036a626bd6ba126425b586b0a3116030c8d6$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=35161ccb0b72898e250d905b4b245b4839fe7ecc$
+// $hash=ff5e74bff88361fed356300624c8ee8deab15554$
//
#include "libcef_dll/cpptoc/v8accessor_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cbf062496a14d367e643c3e52afd460df4176fde$
+// $hash=b8975b107d5912bdcc3e66229119fed6316d269c$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0a7885c5553c99c1ff7539c8aba3a340aa6f3d08$
+// $hash=2b44fa06894c671a055dfbba079bc3373902fcb9$
//
#include "libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=aa87e37fdfa915cb160cb4b7577c46b9e903a698$
+// $hash=f3cb7f220bf24ad178eed9b14d8b6e3d1baed6d5$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8ARRAY_BUFFER_RELEASE_CALLBACK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5fb43e3f68ef5f431fe6d6f84d399dc0cd292d7d$
+// $hash=cf1f345f1f55c603ab3d5fb7dad775152bed8bd5$
//
#include "libcef_dll/cpptoc/v8context_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e0d02da9f3e8216559bd80e50b0e3d061455b0af$
+// $hash=251051522f71e61a56b0844596a6ca2d858915c8$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=bcf73c22701825bb552e78ece2e62c1e6b8da282$
+// $hash=be0ac1aa2ae8d92bf3e2552497345e4559776b6f$
//
#include "libcef_dll/cpptoc/v8exception_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8d6ac0b98bc8a8efc173365c7542907fe1d229ae$
+// $hash=438f4efa56776c515c7c42c6a7dae68937729fef$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8EXCEPTION_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7a072d883f46856cf79bf868560689797b31e362$
+// $hash=116eee182be2336fac01047c154a177dd5c6de49$
//
#include "libcef_dll/cpptoc/v8handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8a1d3087cb27c365c8972bc22f712c8433db37a7$
+// $hash=25ab4ee4f4c72c6be2e4df28dfaa8bbe5ec522d6$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fd651a7fef9dbbce9765c8200660c4057808e6cc$
+// $hash=acc06c29fd11d4eecb3d8114c48f4f3f0548abce$
//
#include "libcef_dll/cpptoc/v8interceptor_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ea56a3340775acdee89516a9e1107f725e0f8c47$
+// $hash=17704763b12cf8c125a358d2db96037f13613b17$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8INTERCEPTOR_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=bcf0ccd2d4220eaa8f31b1f4f9b64440f81f563e$
+// $hash=d57266ae37abe823a7a91d36416da50f75e7c663$
//
#include "libcef_dll/cpptoc/v8stack_frame_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=08e9e87d39ea58ed8bd7edc6dbf7cf2873218eee$
+// $hash=a804ebb160de9a40b1e8ce65e1dfca67e5ffb658$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8STACK_FRAME_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=69faf917e01945c29e5f20a00abbcc69aac7c0a7$
+// $hash=c9f42c7ec65dbe45094126c7668ecab5bc0dba4a$
//
#include "libcef_dll/cpptoc/v8stack_trace_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=01a737cd8e6ea8e747d0a404c4b370a620eada94$
+// $hash=7d064189557bf22631a1daf8a757128680743960$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8STACK_TRACE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0cb915346153880872b44bd1f857c24787ed52af$
+// $hash=9a17d4cb73ff68c45251d606252cbcb84ddffbff$
//
#include "libcef_dll/cpptoc/v8value_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0d07225656f5400129aca5cef75bbefcaaacb70d$
+// $hash=5b314dd35111aa303aa5d695e75839076f874c90$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=680adcc74e385af7d83fa8b28b36b2215bc20f2b$
+// $hash=610af325d95f1242db8993e38da62713feafe0a7$
//
#include "libcef_dll/cpptoc/value_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=108679f1ab32ec8b2e0ffe77602e89603f6c279f$
+// $hash=19a491010366c91259449297ea4fb37414ae2a8e$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VALUE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=95678987551b26755e5dc718c3cad2e975b574c7$
+// $hash=0603aa2ef3dd35d5630bafc47763307f77f64c8e$
//
#include "libcef_dll/cpptoc/views/box_layout_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e665defe8e51c3405d75a3f1d9f382f6e9e9f81f$
+// $hash=3f9e4984c1e1eff7e51ab13f9f7fe2ab249657ec$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BOX_LAYOUT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ed2a9f38555ed559f342f6fd39f21192611771ee$
+// $hash=a07b2f308b7192403cc92086f11545fd6adca28d$
//
#include "libcef_dll/cpptoc/views/browser_view_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=dc07da6d436a7d99817045690a3932010cd1acfd$
+// $hash=f981c5f7247ec57926549c145c47a7cdcbdd80a0$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BROWSER_VIEW_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8f3129779912a325240795e05610d6190997e028$
+// $hash=d2fdb9e5fa608211f3583bafc74602d0573421c1$
//
#include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5bd6bbfbc74b0059f073463c28b74c9b31916e59$
+// $hash=b091e620040d148171ce5c99d5376cb00356eb37$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BROWSER_VIEW_DELEGATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f002c60074ac76bb3e4db3d070b5ea1b430e620d$
+// $hash=d1d8ab075e6ac6cf29e2284f21b17a7e0648af71$
//
#include "libcef_dll/cpptoc/views/button_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=60660c0973fee97e850fcf4026b57a6f367ea294$
+// $hash=3fc906cb8937c58418501c33ba81462806b26860$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BUTTON_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4e776c8db93f07efd47e80fe380071539e94ec81$
+// $hash=4bcd9e786dcddeb99de73e14839f121a211f0e2d$
//
#include "libcef_dll/cpptoc/views/button_delegate_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f3b8ad78e8614f873ee581697ac29cad49a19260$
+// $hash=455b4eb400cc642cfb4cf0089b12059b8be31af6$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BUTTON_DELEGATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=546b8f890852fb4df26a85aec6b83effe1bdc6e6$
+// $hash=19b9c4f4c94c1109c599ccda41440f573c966009$
//
#include "libcef_dll/cpptoc/views/display_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5918cca150c476ead77121bb93599c763a3e13e7$
+// $hash=73811073aeb490787e777b5e7f8e41ef34cd6369$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_DISPLAY_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=304f5db25f7e2a1e4cf169f7cc205013bb06f861$
+// $hash=04718b744aa511fa8917dbcc464aecf6cda4550a$
//
#include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e2bad567245e3e1bdf240be33a3b0008ec0e3b18$
+// $hash=88b95199af576610e6ce7e71603fb3c8b1426046$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_FILL_LAYOUT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c32cf44685b993619659ae5f6fb681e40d0b4cd9$
+// $hash=c71d13ab650b2516ba6ae3b3cfda6b2f67b45e97$
//
#include "libcef_dll/cpptoc/views/label_button_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=60d980037705be97fb1113e0b23b0e4bdd29b801$
+// $hash=8e86fa292ee6e5debd2525e71eaa3ae8e42c8e55$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_LABEL_BUTTON_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=91327244b4a4c037841a54ea2a06ebe42efe5477$
+// $hash=ef68f133e06458b067d4768ea64360b48f6f7b76$
//
#include "libcef_dll/cpptoc/views/layout_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8044bcf51ec6feacc1a186f6780c9076f5c1ec74$
+// $hash=d0adda3ed7bbb825b0c9959960f832d23f75ccdc$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_LAYOUT_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=be533dcd2dd95060259a8baaece87bf2c6df0c27$
+// $hash=b40df03337901e30bbd3db00a852dedc7ea500d8$
//
#include "libcef_dll/cpptoc/views/menu_button_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d3b01ef1bca22e454dd4375df90a5a3fbd0f11f3$
+// $hash=f2f44594e4cbcb3ef1ee3eb39d3d498f7a6cafbc$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=269173ab9f81796dec4b732e2050e26a177d8387$
+// $hash=869a0291457438cf60cb7464dcc63dd0ac7a8cfc$
//
#include "libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=670b8f7f67a5eacd3288724ec6439c56248477ec$
+// $hash=9178b58c1b03965fc20636f3efd97c2385618574$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_DELEGATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c6db7f8e7c031a323e9da96aed3aee7fd7a4f558$
+// $hash=2dc6b6ba5f4b65f25877aa56083d0e6dea42e7ae$
//
#include "libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=072279b56eeeaf089107f5f78ee431c907afda46$
+// $hash=5d7f30f1265294fc8617b444bd35bee3da172746$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_PRESSED_LOCK_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6cf61c4e2900a7776278d4a0542f2b3e32d4420b$
+// $hash=eec6e92443829047f908febc6d9ce7e6eafc6566$
//
#include "libcef_dll/cpptoc/views/overlay_controller_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=15c5e3c251b7a4f882b2e49e9a2ee6e84deb21e1$
+// $hash=8d50609d2e79539752a8118f831e853b845892f4$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_OVERLAY_CONTROLLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fbec1a9b566580497409a7dbd3382e7c51db61ae$
+// $hash=27650c566e4a7c056e5bb87a76df335ba641ab0f$
//
#include "libcef_dll/cpptoc/views/panel_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4fd7a58485d8ef00e6b2dff8ffdfcb1405eb4fcc$
+// $hash=2c4b5c88fc2a00039dc5eb01aaa90ecd7c2ea0ad$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_PANEL_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=03a39472314a6cb7cf93fb0196be57e9ae308c53$
+// $hash=7b91896f42ce5d096e4278d9e96dc3ac99a9e86b$
//
#include "libcef_dll/cpptoc/views/panel_delegate_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=821d48d74b437c7a0387b1d0ac1875621873b2e4$
+// $hash=1eedf21b5a9e1edb24e6c24de55c991388b50c7c$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_PANEL_DELEGATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=02f2588f9c40c510115d3279fbffdb9bf2f4dcfb$
+// $hash=9d80193629328eede62d0da7ed5bf06b16781f52$
//
#include "libcef_dll/cpptoc/views/scroll_view_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a5d02fd363950248101f5113ceeee2c280dd831c$
+// $hash=f0b7e40e7ec1e3870dbc7f25430978c46eb1a51f$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_SCROLL_VIEW_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1fab78c3e307dcdcdfbcc5d458121f50e23bf626$
+// $hash=f21462763c1f6f19e8c0a18c100edb60cb13660c$
//
#include "libcef_dll/cpptoc/views/textfield_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2e8b2aebc574d685d1c39e7cb96b2e8c724a6d9c$
+// $hash=0b5018c0b9d42f4ee100098365c46e0ea723ea29$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_TEXTFIELD_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0009ced13fa9f1e26064455df0c9f5043d7618cf$
+// $hash=e9c21f1320ea2c7c750afbe1901f273f71df8213$
//
#include "libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=157e47e42dbb25aa2effd5bd085228d1dc3ad061$
+// $hash=33ba2bd44c946bf204f2f7a929b8d208768ca3dd$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_TEXTFIELD_DELEGATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=48694fa56762351ccd3369dca9e679efbda61160$
+// $hash=4808be531e96aa028463b2713f2141d9d1d7cd8b$
//
#include "libcef_dll/cpptoc/views/view_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=725abc7d1f25861799c54c827de37617b23a1bd5$
+// $hash=0d24d12448e97907667f8347a38818e0a4d713ed$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_VIEW_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=43217c47279478323050eef44d6403cb4b5c62a6$
+// $hash=58ecca3b863657322cdb1280298486167d55bdfe$
//
#include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ebd265b4907f2531eacce52bd6cfd1f8848b7abf$
+// $hash=384b7d1f2df446d35d6ba46e62d89976d88fef7c$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_VIEW_DELEGATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=360b248f7f43cd62a111f59a79fc81b40f8d4023$
+// $hash=e89c6c2ef5a7af05e58a2a7e76097910e97c9db4$
//
#include "libcef_dll/cpptoc/views/window_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5b14236c7e00a7dafa47fdc32ce78d347de477a1$
+// $hash=12ff3d7d14f9977ff1f62e9a35b04b153a135480$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_WINDOW_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9a65c4a9e35ba40f01a3d27c772ef9b736eb75ea$
+// $hash=cd7d5a65be4a9c5b983b390ec08670baf6f82be2$
//
#include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=594a3ff498c14872187e0ae8d466a023664c92b6$
+// $hash=b4d82958ac79ac843f904c4aa8010a6909ca06fa$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_WINDOW_DELEGATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ea0c4c4d8c202a47a9b5b63a57525dc726c1e40e$
+// $hash=c74bf87e609f7e27581c49144f0c751199f7c2cb$
//
#include "libcef_dll/cpptoc/waitable_event_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f19f05824d06a9aadd3ad10b58e2041eb855a66e$
+// $hash=c3d08738052ecc67921493df15ea0df38c040314$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_WAITABLE_EVENT_CPPTOC_H_
new file mode 100644
@@ -0,0 +1,71 @@
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool. If making changes by
+// hand only do so within the body of existing method and function
+// implementations. See the translator.README.txt file in the tools directory
+// for more information.
+//
+// $hash=4a0b96e9541249b0a756bb5709359fade8df76f6$
+//
+
+#include "libcef_dll/cpptoc/web_message_receiver_cpptoc.h"
+#include "libcef_dll/ctocpp/value_ctocpp.h"
+#include "libcef_dll/shutdown_checker.h"
+
+namespace {
+
+// MEMBER FUNCTIONS - Body may be edited by hand.
+
+void CEF_CALLBACK
+web_message_receiver_on_message(struct _cef_web_message_receiver_t* self,
+ struct _cef_value_t* message) {
+ shutdown_checker::AssertNotShutdown();
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ DCHECK(self);
+ if (!self)
+ return;
+ // Verify param: message; type: refptr_diff
+ DCHECK(message);
+ if (!message)
+ return;
+
+ // Execute
+ CefWebMessageReceiverCppToC::Get(self)->OnMessage(
+ CefValueCToCpp::Wrap(message));
+}
+
+} // namespace
+
+// CONSTRUCTOR - Do not edit by hand.
+
+CefWebMessageReceiverCppToC::CefWebMessageReceiverCppToC() {
+ GetStruct()->on_message = web_message_receiver_on_message;
+}
+
+// DESTRUCTOR - Do not edit by hand.
+
+CefWebMessageReceiverCppToC::~CefWebMessageReceiverCppToC() {
+ shutdown_checker::AssertNotShutdown();
+}
+
+template <>
+CefRefPtr<CefWebMessageReceiver> CefCppToCRefCounted<
+ CefWebMessageReceiverCppToC,
+ CefWebMessageReceiver,
+ cef_web_message_receiver_t>::UnwrapDerived(CefWrapperType type,
+ cef_web_message_receiver_t* s) {
+ NOTREACHED() << "Unexpected class type: " << type;
+ return nullptr;
+}
+
+template <>
+CefWrapperType CefCppToCRefCounted<CefWebMessageReceiverCppToC,
+ CefWebMessageReceiver,
+ cef_web_message_receiver_t>::kWrapperType =
+ WT_WEB_MESSAGE_RECEIVER;
new file mode 100644
@@ -0,0 +1,40 @@
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool. If making changes by
+// hand only do so within the body of existing method and function
+// implementations. See the translator.README.txt file in the tools directory
+// for more information.
+//
+// $hash=849fd01178757316d7b9a87fcc89d7a862186798$
+//
+
+#ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_MESSAGE_RECEIVER_CPPTOC_H_
+#define CEF_LIBCEF_DLL_CPPTOC_WEB_MESSAGE_RECEIVER_CPPTOC_H_
+#pragma once
+
+#if !defined(WRAPPING_CEF_SHARED)
+#error This file can be included wrapper-side only
+#endif
+
+#include "include/capi/cef_browser_capi.h"
+#include "include/capi/cef_client_capi.h"
+#include "include/cef_browser.h"
+#include "include/cef_client.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
+
+// Wrap a C++ class with a C structure.
+// This class may be instantiated and accessed wrapper-side only.
+class CefWebMessageReceiverCppToC
+ : public CefCppToCRefCounted<CefWebMessageReceiverCppToC,
+ CefWebMessageReceiver,
+ cef_web_message_receiver_t> {
+ public:
+ CefWebMessageReceiverCppToC();
+ virtual ~CefWebMessageReceiverCppToC();
+};
+
+#endif // CEF_LIBCEF_DLL_CPPTOC_WEB_MESSAGE_RECEIVER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=959e73af8a9517a5a2381606195efc0fde114317$
+// $hash=53c636c06989583d0ad24c92f4aedce825e5e8ad$
//
#include "libcef_dll/cpptoc/web_storage_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e96ec830a2f1b20fc1ec99664ce7a2df266b73dc$
+// $hash=811b936281434fdc17bbb33dc50640bfc8d5dd33$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_STORAGE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=208b9651cb7a357f7665e6d449c6ba974dfae9e3$
+// $hash=9c53b2b7086bf095aa4a4b39fbf5beb6b89b8ea7$
//
#include "libcef_dll/cpptoc/write_handler_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b6360b7899237a1d616dd8c1cff016d397acbcd3$
+// $hash=94c67ea9a0a7a44b92ef2d322f7dd34490f5b8e6$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=08b0ac0ef8621f8ce81753616044a5e04dc4a191$
+// $hash=513c53172ce1c11c036ff200d1ea73c4015b7f3d$
//
#include "libcef_dll/cpptoc/x509cert_principal_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2041bbbdcbf9434c1a5205ebae8438d47725aa1f$
+// $hash=6e97a51d6d111d04e88c67e98eff127d7ca09dc1$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_X509CERT_PRINCIPAL_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cac3e88ea15965e3a7786500606845b0b6157212$
+// $hash=42a3effdf914b981136faef4528708ea47aba8c1$
//
#include "libcef_dll/cpptoc/x509certificate_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6eb11abb213e5b3e50494c956c51d6286020ca39$
+// $hash=11090b23faf77d87bde0a603e74a0697be58fa7c$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_X509CERTIFICATE_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3ac5f5c45a59bad3310db431653227ceac42186e$
+// $hash=e4ec9a462bd52b87a605d8c2c677b278943e55f9$
//
#include "libcef_dll/cpptoc/xml_reader_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=397fee4bf9eb4c1dc2117bba9ac2b63542335196$
+// $hash=1305b95acf584a0a0e5fd412e948f195233f476b$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_XML_READER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9fe9e9199e284af22669ba2abfb715d0e7ae8de3$
+// $hash=1fdbab5695a0c6e3eb026cd78dda309b620c75a7$
//
#include "libcef_dll/cpptoc/zip_reader_cpptoc.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=10530d641ffc50165b89d16e76230b9ab3f9aca5$
+// $hash=488ca93df16ff22fdd9d397aab117990f01f3331$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_ZIP_READER_CPPTOC_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=05b34b1c04c69b654aad9a8136efbe83693d255f$
+// $hash=1e70efca41e4964cb02f68b5f93dc4a4567b60da$
//
#include "libcef_dll/ctocpp/access_request_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9a6a1dd32258b15f1694c3070c61bf0d0092f18f$
+// $hash=08c6bc8913ed7dcf8134fe99745d8f9a4fbc7fa4$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_ACCESS_REQUEST_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ced6517a7c7149502b418c5fb06386ff30777630$
+// $hash=0613e7faeb146728fa191bcb163f5d2a7386378f$
//
#include "libcef_dll/ctocpp/accessibility_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7ab53ef41cd69320ac6441e514582fd583203207$
+// $hash=3bfebc6542251128247e89a55fba8cbb3bc7061d$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_ACCESSIBILITY_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9986455b9b29bd88504e9b4c2b73bfebc87cfc61$
+// $hash=60ccdb3fa2c50678bc2ba4aeb04a6ed9428f0671$
//
#include "libcef_dll/ctocpp/app_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b1a38565477fd1c436d8a62bfa9d41747f7fe30f$
+// $hash=ea433c4f09f9cc1c432e3406dacfe27ec81c20cb$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_APP_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e2df55073d0fb809dcd4cf0f6bb7ed36dcd4f73c$
+// $hash=de4ec961ee7ee01943cf5a21b7e0729109d74d31$
//
#include "libcef_dll/ctocpp/audio_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9de91dcf5136e07c0d5c06ad9be8173b918f668a$
+// $hash=761b05f6a7cd2f0cfc1968a3902bd874060ad79b$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_AUDIO_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e7ec4903d06110c27d271a7e946c90231b8d3f08$
+// $hash=1397d65bac566cf536f65f10709e0cd0448692fa$
//
#include "libcef_dll/ctocpp/auth_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=74b470ef09c99a7d2ccbe7e9134e0b4d1f11be03$
+// $hash=b21ded769da39fdf3e0ae7991bdc6a2175a4113d$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_AUTH_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=dab6c53c94db70fbeb54b440584a5147c52fe082$
+// $hash=70cd50b1ed22e0b0068a90539de1f00ddd0511dd$
//
#include "libcef_dll/ctocpp/before_download_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f2b6a61b2459566fef19ee3824d7c155bf7f25d1$
+// $hash=743f5b5893055b96eb373b93368c727b3d36d3c6$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BEFORE_DOWNLOAD_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=80a91b8a85dc537cb49cbd5eaea974f92fbf9cde$
+// $hash=50f74bf4eaafce6b10c91af2a9bf516fac113cf5$
//
#include "libcef_dll/ctocpp/binary_value_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e9e56607998130280b093c45987aa294c06f1912$
+// $hash=b6f011a6c26b4264084eb68dae0d63032c07013c$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BINARY_VALUE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8a99c30f78379c8bac224637139db4110d8801cb$
+// $hash=ab991c66f7028ebb53acbd5cf350c89a880f4383$
//
#include "libcef_dll/ctocpp/browser_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4e74199d2ef640e3276988dc06a53ff84140b3fc$
+// $hash=66aac50bedd02f309bb3715b0d4cafb0cd824c4d$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=da4be0653a8e67000f1c6e34219ee3f7b288ca58$
+// $hash=4912cb91f0c5d4e550ab1441c8848477bc787a11$
//
#include "libcef_dll/ctocpp/browser_host_ctocpp.h"
@@ -22,6 +22,8 @@
#include "libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h"
#include "libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.h"
#include "libcef_dll/cpptoc/task_cpptoc.h"
+#include "libcef_dll/cpptoc/web_message_receiver_cpptoc.h"
+#include "libcef_dll/ctocpp/binary_value_ctocpp.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
#include "libcef_dll/ctocpp/drag_data_ctocpp.h"
@@ -29,6 +31,7 @@
#include "libcef_dll/ctocpp/navigation_entry_ctocpp.h"
#include "libcef_dll/ctocpp/registration_ctocpp.h"
#include "libcef_dll/ctocpp/request_context_ctocpp.h"
+#include "libcef_dll/ctocpp/value_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
#include "libcef_dll/transfer_util.h"
@@ -1122,7 +1125,7 @@ void CefBrowserHostCToCpp::DestroyAllWebMessagePorts() {
NO_SANITIZE("cfi-icall")
void CefBrowserHostCToCpp::PostPortMessage(CefString& port_handle,
- CefString& data) {
+ CefRefPtr<CefValue> message) {
shutdown_checker::AssertNotShutdown();
cef_browser_host_t* _struct = GetStruct();
@@ -1131,15 +1134,20 @@ void CefBrowserHostCToCpp::PostPortMessage(CefString& port_handle,
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+ // Verify param: message; type: refptr_same
+ DCHECK(message.get());
+ if (!message.get())
+ return;
+
// Execute
_struct->post_port_message(_struct, port_handle.GetWritableStruct(),
- data.GetWritableStruct());
+ CefValueCToCpp::Unwrap(message));
}
NO_SANITIZE("cfi-icall")
void CefBrowserHostCToCpp::SetPortMessageCallback(
CefString& port_handle,
- CefRefPtr<CefJavaScriptResultCallback> callback) {
+ CefRefPtr<CefWebMessageReceiver> callback) {
shutdown_checker::AssertNotShutdown();
cef_browser_host_t* _struct = GetStruct();
@@ -1156,7 +1164,7 @@ void CefBrowserHostCToCpp::SetPortMessageCallback(
// Execute
_struct->set_port_message_callback(
_struct, port_handle.GetWritableStruct(),
- CefJavaScriptResultCallbackCppToC::Wrap(callback));
+ CefWebMessageReceiverCppToC::Wrap(callback));
}
NO_SANITIZE("cfi-icall")
@@ -1758,6 +1766,143 @@ void CefBrowserHostCToCpp::RemoveCache(bool include_disk_files) {
_struct->remove_cache(_struct, include_disk_files);
}
+NO_SANITIZE("cfi-icall")
+void CefBrowserHostCToCpp::ScrollPageUpDown(bool is_up,
+ bool is_half,
+ float view_height) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_browser_host_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, scroll_page_up_down))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ _struct->scroll_page_up_down(_struct, is_up, is_half, view_height);
+}
+
+NO_SANITIZE("cfi-icall")
+CefRefPtr<CefBinaryValue> CefBrowserHostCToCpp::GetWebState() {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_browser_host_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, get_web_state))
+ return nullptr;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ cef_binary_value_t* _retval = _struct->get_web_state(_struct);
+
+ // Return type: refptr_same
+ return CefBinaryValueCToCpp::Wrap(_retval);
+}
+
+NO_SANITIZE("cfi-icall")
+bool CefBrowserHostCToCpp::RestoreWebState(
+ const CefRefPtr<CefBinaryValue> state) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_browser_host_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, restore_web_state))
+ return false;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Verify param: state; type: refptr_same
+ DCHECK(state.get());
+ if (!state.get())
+ return false;
+
+ // Execute
+ int _retval =
+ _struct->restore_web_state(_struct, CefBinaryValueCToCpp::Unwrap(state));
+
+ // Return type: bool
+ return _retval ? true : false;
+}
+
+NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::ScrollTo(float x, float y) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_browser_host_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, scroll_to))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ _struct->scroll_to(_struct, x, y);
+}
+
+NO_SANITIZE("cfi-icall")
+void CefBrowserHostCToCpp::ScrollBy(float delta_x, float delta_y) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_browser_host_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, scroll_by))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ _struct->scroll_by(_struct, delta_x, delta_y);
+}
+
+NO_SANITIZE("cfi-icall")
+void CefBrowserHostCToCpp::SlideScroll(float vx, float vy) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_browser_host_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, slide_scroll))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ _struct->slide_scroll(_struct, vx, vy);
+}
+
+NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::SetFileAccess(bool falg) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_browser_host_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, set_file_access))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ _struct->set_file_access(_struct, falg);
+}
+
+NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::SetBlockNetwork(bool falg) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_browser_host_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, set_block_network))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ _struct->set_block_network(_struct, falg);
+}
+
+NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::SetCacheMode(int falg) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_browser_host_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, set_cache_mode))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ _struct->set_cache_mode(_struct, falg);
+}
+
// CONSTRUCTOR - Do not edit by hand.
CefBrowserHostCToCpp::CefBrowserHostCToCpp() {}
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7d2cea734649b808710e6c44ee7eab4f5e5b47cc$
+// $hash=29c3bfce4a45f38ec3fd21096e13addeb83f6310$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
@@ -129,10 +129,11 @@ class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp,
CefString& targetUri) override;
void ClosePort(CefString& port_handle) override;
void DestroyAllWebMessagePorts() override;
- void PostPortMessage(CefString& port_handle, CefString& data) override;
+ void PostPortMessage(CefString& port_handle,
+ CefRefPtr<CefValue> message) override;
void SetPortMessageCallback(
CefString& port_handle,
- CefRefPtr<CefJavaScriptResultCallback> callback) override;
+ CefRefPtr<CefWebMessageReceiver> callback) override;
void GetHitData(int& type, CefString& extra_data) override;
void SetInitialScale(float scale) override;
int PageLoadProgress() override;
@@ -186,6 +187,15 @@ class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp,
CefString GetOriginalUrl() override;
void PutNetworkAvailable(bool available) override;
void RemoveCache(bool include_disk_files) override;
+ void ScrollPageUpDown(bool is_up, bool is_half, float view_height) override;
+ CefRefPtr<CefBinaryValue> GetWebState() override;
+ bool RestoreWebState(const CefRefPtr<CefBinaryValue> state) override;
+ void ScrollTo(float x, float y) override;
+ void ScrollBy(float delta_x, float delta_y) override;
+ void SlideScroll(float vx, float vy) override;
+ void SetFileAccess(bool falg) override;
+ void SetBlockNetwork(bool falg) override;
+ void SetCacheMode(int falg) override;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4a9c34d8dd8e49725dd7288c3a8c3e2a978c977c$
+// $hash=7af372362be16cd5150da026dbbf41c85daeba88$
//
#include "libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.h"
@@ -19,10 +19,11 @@
NO_SANITIZE("cfi-icall")
void CefBrowserPermissionRequestDelegateCToCpp::AskGeolocationPermission(
- const CefString &origin, cef_permission_callback_t callback) {
+ const CefString& origin,
+ cef_permission_callback_t callback) {
shutdown_checker::AssertNotShutdown();
- cef_browser_permission_request_delegate_t *_struct = GetStruct();
+ cef_browser_permission_request_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, ask_geolocation_permission))
return;
@@ -39,10 +40,10 @@ void CefBrowserPermissionRequestDelegateCToCpp::AskGeolocationPermission(
NO_SANITIZE("cfi-icall")
void CefBrowserPermissionRequestDelegateCToCpp::AbortAskGeolocationPermission(
- const CefString &origin) {
+ const CefString& origin) {
shutdown_checker::AssertNotShutdown();
- cef_browser_permission_request_delegate_t *_struct = GetStruct();
+ cef_browser_permission_request_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, abort_ask_geolocation_permission))
return;
@@ -59,11 +60,11 @@ void CefBrowserPermissionRequestDelegateCToCpp::AbortAskGeolocationPermission(
NO_SANITIZE("cfi-icall")
void CefBrowserPermissionRequestDelegateCToCpp::
- AskProtectedMediaIdentifierPermission(const CefString &origin,
+ AskProtectedMediaIdentifierPermission(const CefString& origin,
cef_permission_callback_t callback) {
shutdown_checker::AssertNotShutdown();
- cef_browser_permission_request_delegate_t *_struct = GetStruct();
+ cef_browser_permission_request_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, ask_protected_media_identifier_permission))
return;
@@ -81,10 +82,10 @@ void CefBrowserPermissionRequestDelegateCToCpp::
NO_SANITIZE("cfi-icall")
void CefBrowserPermissionRequestDelegateCToCpp::
- AbortAskProtectedMediaIdentifierPermission(const CefString &origin) {
+ AbortAskProtectedMediaIdentifierPermission(const CefString& origin) {
shutdown_checker::AssertNotShutdown();
- cef_browser_permission_request_delegate_t *_struct = GetStruct();
+ cef_browser_permission_request_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct,
abort_ask_protected_media_identifier_permission))
return;
@@ -103,10 +104,11 @@ void CefBrowserPermissionRequestDelegateCToCpp::
NO_SANITIZE("cfi-icall")
void CefBrowserPermissionRequestDelegateCToCpp::AskMIDISysexPermission(
- const CefString &origin, cef_permission_callback_t callback) {
+ const CefString& origin,
+ cef_permission_callback_t callback) {
shutdown_checker::AssertNotShutdown();
- cef_browser_permission_request_delegate_t *_struct = GetStruct();
+ cef_browser_permission_request_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, ask_midisysex_permission))
return;
@@ -123,10 +125,10 @@ void CefBrowserPermissionRequestDelegateCToCpp::AskMIDISysexPermission(
NO_SANITIZE("cfi-icall")
void CefBrowserPermissionRequestDelegateCToCpp::AbortAskMIDISysexPermission(
- const CefString &origin) {
+ const CefString& origin) {
shutdown_checker::AssertNotShutdown();
- cef_browser_permission_request_delegate_t *_struct = GetStruct();
+ cef_browser_permission_request_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, abort_ask_midisysex_permission))
return;
@@ -143,10 +145,11 @@ void CefBrowserPermissionRequestDelegateCToCpp::AbortAskMIDISysexPermission(
NO_SANITIZE("cfi-icall")
void CefBrowserPermissionRequestDelegateCToCpp::NotifyGeolocationPermission(
- bool value, const CefString &origin) {
+ bool value,
+ const CefString& origin) {
shutdown_checker::AssertNotShutdown();
- cef_browser_permission_request_delegate_t *_struct = GetStruct();
+ cef_browser_permission_request_delegate_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, notify_geolocation_permission))
return;
@@ -174,11 +177,11 @@ CefBrowserPermissionRequestDelegateCToCpp::
}
template <>
-cef_browser_permission_request_delegate_t *
+cef_browser_permission_request_delegate_t*
CefCToCppRefCounted<CefBrowserPermissionRequestDelegateCToCpp,
CefBrowserPermissionRequestDelegate,
cef_browser_permission_request_delegate_t>::
- UnwrapDerived(CefWrapperType type, CefBrowserPermissionRequestDelegate *c) {
+ UnwrapDerived(CefWrapperType type, CefBrowserPermissionRequestDelegate* c) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c9c5f759ffc22b4c39e35c6273d17966ec357b35$
+// $hash=a2e7c9e77ee45cef4da269e9e613fd4fdef5f9ac$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PERMISSION_REQUEST_DELEGATE_CTOCPP_H_
@@ -30,23 +30,24 @@ class CefBrowserPermissionRequestDelegateCToCpp
: public CefCToCppRefCounted<CefBrowserPermissionRequestDelegateCToCpp,
CefBrowserPermissionRequestDelegate,
cef_browser_permission_request_delegate_t> {
-public:
+ public:
CefBrowserPermissionRequestDelegateCToCpp();
virtual ~CefBrowserPermissionRequestDelegateCToCpp();
// CefBrowserPermissionRequestDelegate methods.
- void AskGeolocationPermission(const CefString &origin,
+ void AskGeolocationPermission(const CefString& origin,
cef_permission_callback_t callback) override;
- void AbortAskGeolocationPermission(const CefString &origin) override;
+ void AbortAskGeolocationPermission(const CefString& origin) override;
void AskProtectedMediaIdentifierPermission(
- const CefString &origin, cef_permission_callback_t callback) override;
- void
- AbortAskProtectedMediaIdentifierPermission(const CefString &origin) override;
- void AskMIDISysexPermission(const CefString &origin,
+ const CefString& origin,
+ cef_permission_callback_t callback) override;
+ void AbortAskProtectedMediaIdentifierPermission(
+ const CefString& origin) override;
+ void AskMIDISysexPermission(const CefString& origin,
cef_permission_callback_t callback) override;
- void AbortAskMIDISysexPermission(const CefString &origin) override;
+ void AbortAskMIDISysexPermission(const CefString& origin) override;
void NotifyGeolocationPermission(bool value,
- const CefString &origin) override;
+ const CefString& origin) override;
};
-#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_PERMISSION_REQUEST_DELEGATE_CTOCPP_H_
+#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_PERMISSION_REQUEST_DELEGATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3302f28c60da03b9f5ba5fa110523b353765d1a3$
+// $hash=a2e2cd65794078959c9d31ee3a294fb937d6f802$
//
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7a13d15a99d1c92a757b776bb00d932296012054$
+// $hash=66b5c3e001c23a720ae8a8e6d98afeb2419e5038$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ef330e0d61e143966544b8a80f04b72dc32ec4e3$
+// $hash=669523b79dbdfe2fff4015e8a1b247e7f90e62e0$
//
#include "libcef_dll/ctocpp/callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4a884b7737dd5ba552273873e63dd4df51a632b7$
+// $hash=33a36c40703e1a794c2d8365f0ed692bad529e4b$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6c7761f17f60e6c3db928ffc15b373b0c50dfb47$
+// $hash=d090744e28308c8ad6b47906ee231b4fe52fa6a2$
//
#include "libcef_dll/ctocpp/client_ctocpp.h"
@@ -39,14 +39,14 @@
NO_SANITIZE("cfi-icall")
CefRefPtr<CefAudioHandler> CefClientCToCpp::GetAudioHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_audio_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_audio_handler_t *_retval = _struct->get_audio_handler(_struct);
+ cef_audio_handler_t* _retval = _struct->get_audio_handler(_struct);
// Return type: refptr_same
return CefAudioHandlerCToCpp::Wrap(_retval);
@@ -54,14 +54,14 @@ CefRefPtr<CefAudioHandler> CefClientCToCpp::GetAudioHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefContextMenuHandler> CefClientCToCpp::GetContextMenuHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_context_menu_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_context_menu_handler_t *_retval =
+ cef_context_menu_handler_t* _retval =
_struct->get_context_menu_handler(_struct);
// Return type: refptr_same
@@ -70,14 +70,14 @@ CefRefPtr<CefContextMenuHandler> CefClientCToCpp::GetContextMenuHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefDialogHandler> CefClientCToCpp::GetDialogHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_dialog_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_dialog_handler_t *_retval = _struct->get_dialog_handler(_struct);
+ cef_dialog_handler_t* _retval = _struct->get_dialog_handler(_struct);
// Return type: refptr_same
return CefDialogHandlerCToCpp::Wrap(_retval);
@@ -85,14 +85,14 @@ CefRefPtr<CefDialogHandler> CefClientCToCpp::GetDialogHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefDisplayHandler> CefClientCToCpp::GetDisplayHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_display_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_display_handler_t *_retval = _struct->get_display_handler(_struct);
+ cef_display_handler_t* _retval = _struct->get_display_handler(_struct);
// Return type: refptr_same
return CefDisplayHandlerCToCpp::Wrap(_retval);
@@ -100,14 +100,14 @@ CefRefPtr<CefDisplayHandler> CefClientCToCpp::GetDisplayHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefDownloadHandler> CefClientCToCpp::GetDownloadHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_download_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_download_handler_t *_retval = _struct->get_download_handler(_struct);
+ cef_download_handler_t* _retval = _struct->get_download_handler(_struct);
// Return type: refptr_same
return CefDownloadHandlerCToCpp::Wrap(_retval);
@@ -115,14 +115,14 @@ CefRefPtr<CefDownloadHandler> CefClientCToCpp::GetDownloadHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefDragHandler> CefClientCToCpp::GetDragHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_drag_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_drag_handler_t *_retval = _struct->get_drag_handler(_struct);
+ cef_drag_handler_t* _retval = _struct->get_drag_handler(_struct);
// Return type: refptr_same
return CefDragHandlerCToCpp::Wrap(_retval);
@@ -130,14 +130,14 @@ CefRefPtr<CefDragHandler> CefClientCToCpp::GetDragHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefFindHandler> CefClientCToCpp::GetFindHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_find_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_find_handler_t *_retval = _struct->get_find_handler(_struct);
+ cef_find_handler_t* _retval = _struct->get_find_handler(_struct);
// Return type: refptr_same
return CefFindHandlerCToCpp::Wrap(_retval);
@@ -145,14 +145,14 @@ CefRefPtr<CefFindHandler> CefClientCToCpp::GetFindHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefFocusHandler> CefClientCToCpp::GetFocusHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_focus_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_focus_handler_t *_retval = _struct->get_focus_handler(_struct);
+ cef_focus_handler_t* _retval = _struct->get_focus_handler(_struct);
// Return type: refptr_same
return CefFocusHandlerCToCpp::Wrap(_retval);
@@ -160,14 +160,14 @@ CefRefPtr<CefFocusHandler> CefClientCToCpp::GetFocusHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefFrameHandler> CefClientCToCpp::GetFrameHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_frame_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_frame_handler_t *_retval = _struct->get_frame_handler(_struct);
+ cef_frame_handler_t* _retval = _struct->get_frame_handler(_struct);
// Return type: refptr_same
return CefFrameHandlerCToCpp::Wrap(_retval);
@@ -175,14 +175,14 @@ CefRefPtr<CefFrameHandler> CefClientCToCpp::GetFrameHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefJSDialogHandler> CefClientCToCpp::GetJSDialogHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_jsdialog_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_jsdialog_handler_t *_retval = _struct->get_jsdialog_handler(_struct);
+ cef_jsdialog_handler_t* _retval = _struct->get_jsdialog_handler(_struct);
// Return type: refptr_same
return CefJSDialogHandlerCToCpp::Wrap(_retval);
@@ -190,14 +190,14 @@ CefRefPtr<CefJSDialogHandler> CefClientCToCpp::GetJSDialogHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefKeyboardHandler> CefClientCToCpp::GetKeyboardHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_keyboard_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_keyboard_handler_t *_retval = _struct->get_keyboard_handler(_struct);
+ cef_keyboard_handler_t* _retval = _struct->get_keyboard_handler(_struct);
// Return type: refptr_same
return CefKeyboardHandlerCToCpp::Wrap(_retval);
@@ -205,14 +205,14 @@ CefRefPtr<CefKeyboardHandler> CefClientCToCpp::GetKeyboardHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefLifeSpanHandler> CefClientCToCpp::GetLifeSpanHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_life_span_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_life_span_handler_t *_retval = _struct->get_life_span_handler(_struct);
+ cef_life_span_handler_t* _retval = _struct->get_life_span_handler(_struct);
// Return type: refptr_same
return CefLifeSpanHandlerCToCpp::Wrap(_retval);
@@ -220,14 +220,14 @@ CefRefPtr<CefLifeSpanHandler> CefClientCToCpp::GetLifeSpanHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefLoadHandler> CefClientCToCpp::GetLoadHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_load_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_load_handler_t *_retval = _struct->get_load_handler(_struct);
+ cef_load_handler_t* _retval = _struct->get_load_handler(_struct);
// Return type: refptr_same
return CefLoadHandlerCToCpp::Wrap(_retval);
@@ -235,14 +235,14 @@ CefRefPtr<CefLoadHandler> CefClientCToCpp::GetLoadHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefPrintHandler> CefClientCToCpp::GetPrintHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_print_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_print_handler_t *_retval = _struct->get_print_handler(_struct);
+ cef_print_handler_t* _retval = _struct->get_print_handler(_struct);
// Return type: refptr_same
return CefPrintHandlerCToCpp::Wrap(_retval);
@@ -250,14 +250,14 @@ CefRefPtr<CefPrintHandler> CefClientCToCpp::GetPrintHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefRenderHandler> CefClientCToCpp::GetRenderHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_render_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_render_handler_t *_retval = _struct->get_render_handler(_struct);
+ cef_render_handler_t* _retval = _struct->get_render_handler(_struct);
// Return type: refptr_same
return CefRenderHandlerCToCpp::Wrap(_retval);
@@ -265,14 +265,14 @@ CefRefPtr<CefRenderHandler> CefClientCToCpp::GetRenderHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefRequestHandler> CefClientCToCpp::GetRequestHandler() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_request_handler))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_request_handler_t *_retval = _struct->get_request_handler(_struct);
+ cef_request_handler_t* _retval = _struct->get_request_handler(_struct);
// Return type: refptr_same
return CefRequestHandlerCToCpp::Wrap(_retval);
@@ -280,14 +280,14 @@ CefRefPtr<CefRequestHandler> CefClientCToCpp::GetRequestHandler() {
NO_SANITIZE("cfi-icall")
CefRefPtr<CefPermissionRequest> CefClientCToCpp::GetPermissionRequest() {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_permission_request))
return nullptr;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
- cef_permission_request_t *_retval = _struct->get_permission_request(_struct);
+ cef_permission_request_t* _retval = _struct->get_permission_request(_struct);
// Return type: refptr_same
return CefPermissionRequestCToCpp::Wrap(_retval);
@@ -295,9 +295,11 @@ CefRefPtr<CefPermissionRequest> CefClientCToCpp::GetPermissionRequest() {
NO_SANITIZE("cfi-icall")
bool CefClientCToCpp::OnProcessMessageReceived(
- CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
- CefProcessId source_process, CefRefPtr<CefProcessMessage> message) {
- cef_client_t *_struct = GetStruct();
+ CefRefPtr<CefBrowser> browser,
+ CefRefPtr<CefFrame> frame,
+ CefProcessId source_process,
+ CefRefPtr<CefProcessMessage> message) {
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, on_process_message_received))
return false;
@@ -327,10 +329,10 @@ bool CefClientCToCpp::OnProcessMessageReceived(
NO_SANITIZE("cfi-icall")
int CefClientCToCpp::NotifyJavaScriptResult(CefRefPtr<CefListValue> args,
- const CefString &method,
- const CefString &object_name,
+ const CefString& method,
+ const CefString& object_name,
CefRefPtr<CefListValue> result) {
- cef_client_t *_struct = GetStruct();
+ cef_client_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, notify_java_script_result))
return 0;
@@ -371,13 +373,14 @@ CefClientCToCpp::CefClientCToCpp() {}
CefClientCToCpp::~CefClientCToCpp() {}
template <>
-cef_client_t *
+cef_client_t*
CefCToCppRefCounted<CefClientCToCpp, CefClient, cef_client_t>::UnwrapDerived(
- CefWrapperType type, CefClient *c) {
+ CefWrapperType type,
+ CefClient* c) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
-CefWrapperType CefCToCppRefCounted<CefClientCToCpp, CefClient,
- cef_client_t>::kWrapperType = WT_CLIENT;
+CefWrapperType CefCToCppRefCounted<CefClientCToCpp, CefClient, cef_client_t>::
+ kWrapperType = WT_CLIENT;
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7516e646aea8db0ff68ea79041e05ebb9a320cf2$
+// $hash=13d421c7598593f4bee5b3e62cb8aaf348a350f9$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_
@@ -28,7 +28,7 @@
// This class may be instantiated and accessed DLL-side only.
class CefClientCToCpp
: public CefCToCppRefCounted<CefClientCToCpp, CefClient, cef_client_t> {
-public:
+ public:
CefClientCToCpp();
virtual ~CefClientCToCpp();
@@ -55,9 +55,9 @@ public:
CefProcessId source_process,
CefRefPtr<CefProcessMessage> message) override;
int NotifyJavaScriptResult(CefRefPtr<CefListValue> args,
- const CefString &method,
- const CefString &object_name,
+ const CefString& method,
+ const CefString& object_name,
CefRefPtr<CefListValue> result) override;
};
-#endif // CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_
+#endif // CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cc3c62b07c8e4d6f019637a0338673ac21ffa017$
+// $hash=2f7f88a79dc5c9bb4c7af27e6abac4b4e7ba3d76$
//
#include "libcef_dll/ctocpp/command_line_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6dffc109a4a5bdc10bda0a03950f1a8b81f964b7$
+// $hash=c91f76be5a60016fa78afe2813b0d4df3bb422e7$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f65d432f0ca5891aa466010183e437ba5e2007be$
+// $hash=bc0832e0b26f161d96d699a1922df4144ae6cf2d$
//
#include "libcef_dll/ctocpp/completion_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d8c3f928349e064d8afe7853d4a47c90c1ed0114$
+// $hash=bbdf6c23d87122deb5d3100430547b2c608497a9$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_COMPLETION_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e251b197b3369b44f3d66ce414094ac24ba1db10$
+// $hash=074448a6721865377653c8625a38925aef5f3c7d$
//
#include "libcef_dll/ctocpp/context_menu_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=533df2bb508d88d0828f0da6284732c2ecbbafab$
+// $hash=0d0bcb30d9e8b5894158c9ecf80fa710e4ce6b7d$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=233d530cb984468703b97752bda1178191d4ba75$
+// $hash=bc04acf3a86598987676f33a6d39c10435dded70$
//
#include "libcef_dll/ctocpp/context_menu_params_ctocpp.h"
@@ -230,7 +230,7 @@ CefContextMenuParams::MediaType CefContextMenuParamsCToCpp::GetMediaType() {
NO_SANITIZE("cfi-icall")
CefContextMenuParams::MediaStateFlags
-CefContextMenuParamsCToCpp::GetMediaStateFlags() {
+ CefContextMenuParamsCToCpp::GetMediaStateFlags() {
shutdown_checker::AssertNotShutdown();
cef_context_menu_params_t* _struct = GetStruct();
@@ -351,7 +351,7 @@ bool CefContextMenuParamsCToCpp::IsSpellCheckEnabled() {
NO_SANITIZE("cfi-icall")
CefContextMenuParams::EditStateFlags
-CefContextMenuParamsCToCpp::GetEditStateFlags() {
+ CefContextMenuParamsCToCpp::GetEditStateFlags() {
shutdown_checker::AssertNotShutdown();
cef_context_menu_params_t* _struct = GetStruct();
@@ -384,6 +384,42 @@ NO_SANITIZE("cfi-icall") bool CefContextMenuParamsCToCpp::IsCustomMenu() {
return _retval ? true : false;
}
+NO_SANITIZE("cfi-icall")
+CefContextMenuParams::InputFieldType
+ CefContextMenuParamsCToCpp::GetInputFieldType() {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_context_menu_params_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, get_input_field_type))
+ return CM_INPUTFIELDTYPE_NONE;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ cef_context_menu_input_field_type_t _retval =
+ _struct->get_input_field_type(_struct);
+
+ // Return type: simple
+ return _retval;
+}
+
+NO_SANITIZE("cfi-icall")
+CefContextMenuParams::SourceType CefContextMenuParamsCToCpp::GetSourceType() {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_context_menu_params_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, get_source_type))
+ return CM_SOURCETYPE_NONE;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ cef_context_menu_source_type_t _retval = _struct->get_source_type(_struct);
+
+ // Return type: simple
+ return _retval;
+}
+
// CONSTRUCTOR - Do not edit by hand.
CefContextMenuParamsCToCpp::CefContextMenuParamsCToCpp() {}
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=de83ca0067722af09407abc0b7723a8d91d083ad$
+// $hash=fd06aad327c518573e68c645f3facd55fea2da34$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_
@@ -56,6 +56,8 @@ class CefContextMenuParamsCToCpp
bool IsSpellCheckEnabled() override;
EditStateFlags GetEditStateFlags() override;
bool IsCustomMenu() override;
+ InputFieldType GetInputFieldType() override;
+ SourceType GetSourceType() override;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b1ae8622378ad8661289554e6c542e970850aaed$
+// $hash=d24bf7fb06a84dfbe57aa7bfe49cbb0de242a840$
//
#include "libcef_dll/ctocpp/cookie_access_filter_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7a3357796fd02da5a233d4dfa6b8c7194ba8f969$
+// $hash=b325a81a438e8e510eb826bc4e6acf5df04281c8$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_ACCESS_FILTER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6e1bd6af22e730b6d6a12a7296414250bf415979$
+// $hash=3a8702e5b54310d93f9f43d60dd4d6d77b83da9d$
//
#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h"
@@ -28,7 +28,7 @@ CefRefPtr<CefCookieManager> CefCookieManager::GetGlobalManager(
// Unverified params: callback
// Execute
- cef_cookie_manager_t *_retval = cef_cookie_manager_get_global_manager(
+ cef_cookie_manager_t* _retval = cef_cookie_manager_get_global_manager(
CefCompletionCallbackCppToC::Wrap(callback));
// Return type: refptr_same
@@ -36,9 +36,9 @@ CefRefPtr<CefCookieManager> CefCookieManager::GetGlobalManager(
}
NO_SANITIZE("cfi-icall")
-bool CefCookieManager::CreateCefCookie(const CefString &url,
- const CefString &value,
- CefCookie &cef_cookie) {
+bool CefCookieManager::CreateCefCookie(const CefString& url,
+ const CefString& value,
+ CefCookie& cef_cookie) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: url; type: string_byref_const
@@ -61,7 +61,7 @@ bool CefCookieManager::CreateCefCookie(const CefString &url,
// VIRTUAL METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall") bool CefCookieManagerCToCpp::IsAcceptCookieAllowed() {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_accept_cookie_allowed))
return false;
@@ -76,7 +76,7 @@ NO_SANITIZE("cfi-icall") bool CefCookieManagerCToCpp::IsAcceptCookieAllowed() {
NO_SANITIZE("cfi-icall")
void CefCookieManagerCToCpp::PutAcceptCookieEnabled(bool accept) {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, put_accept_cookie_enabled))
return;
@@ -88,7 +88,7 @@ void CefCookieManagerCToCpp::PutAcceptCookieEnabled(bool accept) {
NO_SANITIZE("cfi-icall")
bool CefCookieManagerCToCpp::IsThirdPartyCookieAllowed() {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_third_party_cookie_allowed))
return false;
@@ -103,7 +103,7 @@ bool CefCookieManagerCToCpp::IsThirdPartyCookieAllowed() {
NO_SANITIZE("cfi-icall")
void CefCookieManagerCToCpp::PutAcceptThirdPartyCookieEnabled(bool accept) {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, put_accept_third_party_cookie_enabled))
return;
@@ -115,7 +115,7 @@ void CefCookieManagerCToCpp::PutAcceptThirdPartyCookieEnabled(bool accept) {
NO_SANITIZE("cfi-icall")
bool CefCookieManagerCToCpp::IsFileURLSchemeCookiesAllowed() {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_file_urlscheme_cookies_allowed))
return false;
@@ -130,7 +130,7 @@ bool CefCookieManagerCToCpp::IsFileURLSchemeCookiesAllowed() {
NO_SANITIZE("cfi-icall")
void CefCookieManagerCToCpp::PutAcceptFileURLSchemeCookiesEnabled(bool allow) {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, put_accept_file_urlscheme_cookies_enabled))
return;
@@ -143,7 +143,7 @@ void CefCookieManagerCToCpp::PutAcceptFileURLSchemeCookiesEnabled(bool allow) {
NO_SANITIZE("cfi-icall")
bool CefCookieManagerCToCpp::VisitAllCookies(
CefRefPtr<CefCookieVisitor> visitor) {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, visit_all_cookies))
return false;
@@ -164,9 +164,10 @@ bool CefCookieManagerCToCpp::VisitAllCookies(
NO_SANITIZE("cfi-icall")
bool CefCookieManagerCToCpp::VisitUrlCookies(
- const CefString &url, bool includeHttpOnly,
+ const CefString& url,
+ bool includeHttpOnly,
CefRefPtr<CefCookieVisitor> visitor) {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, visit_url_cookies))
return false;
@@ -192,9 +193,10 @@ bool CefCookieManagerCToCpp::VisitUrlCookies(
NO_SANITIZE("cfi-icall")
bool CefCookieManagerCToCpp::SetCookie(
- const CefString &url, const CefCookie &cookie,
+ const CefString& url,
+ const CefCookie& cookie,
CefRefPtr<CefSetCookieCallback> callback) {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, set_cookie))
return false;
@@ -216,9 +218,11 @@ bool CefCookieManagerCToCpp::SetCookie(
NO_SANITIZE("cfi-icall")
bool CefCookieManagerCToCpp::DeleteCookies(
- const CefString &url, const CefString &cookie_name, bool is_session,
+ const CefString& url,
+ const CefString& cookie_name,
+ bool is_session,
CefRefPtr<CefDeleteCookiesCallback> callback) {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, delete_cookies))
return false;
@@ -238,7 +242,7 @@ bool CefCookieManagerCToCpp::DeleteCookies(
NO_SANITIZE("cfi-icall")
bool CefCookieManagerCToCpp::FlushStore(
CefRefPtr<CefCompletionCallback> callback) {
- cef_cookie_manager_t *_struct = GetStruct();
+ cef_cookie_manager_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, flush_store))
return false;
@@ -263,15 +267,17 @@ CefCookieManagerCToCpp::CefCookieManagerCToCpp() {}
CefCookieManagerCToCpp::~CefCookieManagerCToCpp() {}
template <>
-cef_cookie_manager_t *
-CefCToCppRefCounted<CefCookieManagerCToCpp, CefCookieManager,
+cef_cookie_manager_t*
+CefCToCppRefCounted<CefCookieManagerCToCpp,
+ CefCookieManager,
cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type,
- CefCookieManager *c) {
+ CefCookieManager* c) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
-CefWrapperType CefCToCppRefCounted<CefCookieManagerCToCpp, CefCookieManager,
+CefWrapperType CefCToCppRefCounted<CefCookieManagerCToCpp,
+ CefCookieManager,
cef_cookie_manager_t>::kWrapperType =
WT_COOKIE_MANAGER;
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f92d6bb66153459fd6906db5e1fe32781dfafa2d$
+// $hash=23d749e39a04142c1e7d09579460dba887d31d9b$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_MANAGER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=46632d6c9d6e3c6891abc90323313bea54d7419e$
+// $hash=708c4aeb30bed97847155c90b86fecc6388b0a60$
//
#include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c1dca55691f6d564ad2a69b38acd141982368895$
+// $hash=1824342f14e23ea975b7faed0406036568d88ba8$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_VISITOR_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3ab167d92ecbdc7c4c52483058038ed50a68231a$
+// $hash=2cf79925fe0507a777cba65aadf5d72f57e38a3c$
//
#include "libcef_dll/ctocpp/data_base_ctocpp.h"
@@ -90,10 +90,11 @@ void CefDataBaseCToCpp::SaveHttpAuthCredentials(const CefString& host,
}
NO_SANITIZE("cfi-icall")
-void CefDataBaseCToCpp::GetHttpAuthCredentials(
- const CefString& host,
- const CefString& realm,
- std::vector<CefString>& username_password) {
+void CefDataBaseCToCpp::GetHttpAuthCredentials(const CefString& host,
+ const CefString& realm,
+ CefString& username,
+ char* password,
+ uint32_t passwordSize) {
cef_data_base_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_http_auth_credentials))
return;
@@ -108,29 +109,21 @@ void CefDataBaseCToCpp::GetHttpAuthCredentials(
DCHECK(!realm.empty());
if (realm.empty())
return;
-
- // Translate param: username_password; type: string_vec_byref
- cef_string_list_t username_passwordList = cef_string_list_alloc();
- DCHECK(username_passwordList);
- if (username_passwordList)
- transfer_string_list_contents(username_password, username_passwordList);
+ // Verify param: password; type: simple_byaddr
+ DCHECK(password);
+ if (!password)
+ return;
// Execute
- _struct->get_http_auth_credentials(_struct, host.GetStruct(),
- realm.GetStruct(), username_passwordList);
-
- // Restore param:username_password; type: string_vec_byref
- if (username_passwordList) {
- username_password.clear();
- transfer_string_list_contents(username_passwordList, username_password);
- cef_string_list_free(username_passwordList);
- }
+ _struct->get_http_auth_credentials(
+ _struct, host.GetStruct(), realm.GetStruct(),
+ username.GetWritableStruct(), password, passwordSize);
}
NO_SANITIZE("cfi-icall")
-bool CefDataBaseCToCpp::ExistPermissionByOrigin(const CefString &origin,
+bool CefDataBaseCToCpp::ExistPermissionByOrigin(const CefString& origin,
int type) {
- cef_data_base_t *_struct = GetStruct();
+ cef_data_base_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, exist_permission_by_origin))
return false;
@@ -150,9 +143,10 @@ bool CefDataBaseCToCpp::ExistPermissionByOrigin(const CefString &origin,
}
NO_SANITIZE("cfi-icall")
-bool CefDataBaseCToCpp::GetPermissionResultByOrigin(const CefString &origin,
- int type, bool &result) {
- cef_data_base_t *_struct = GetStruct();
+bool CefDataBaseCToCpp::GetPermissionResultByOrigin(const CefString& origin,
+ int type,
+ bool& result) {
+ cef_data_base_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_permission_result_by_origin))
return false;
@@ -178,9 +172,10 @@ bool CefDataBaseCToCpp::GetPermissionResultByOrigin(const CefString &origin,
}
NO_SANITIZE("cfi-icall")
-void CefDataBaseCToCpp::SetPermissionByOrigin(const CefString &origin, int type,
+void CefDataBaseCToCpp::SetPermissionByOrigin(const CefString& origin,
+ int type,
bool result) {
- cef_data_base_t *_struct = GetStruct();
+ cef_data_base_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, set_permission_by_origin))
return;
@@ -196,9 +191,9 @@ void CefDataBaseCToCpp::SetPermissionByOrigin(const CefString &origin, int type,
}
NO_SANITIZE("cfi-icall")
-void CefDataBaseCToCpp::ClearPermissionByOrigin(const CefString &origin,
+void CefDataBaseCToCpp::ClearPermissionByOrigin(const CefString& origin,
int type) {
- cef_data_base_t *_struct = GetStruct();
+ cef_data_base_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, clear_permission_by_origin))
return;
@@ -214,7 +209,7 @@ void CefDataBaseCToCpp::ClearPermissionByOrigin(const CefString &origin,
}
NO_SANITIZE("cfi-icall") void CefDataBaseCToCpp::ClearAllPermission(int type) {
- cef_data_base_t *_struct = GetStruct();
+ cef_data_base_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, clear_all_permission))
return;
@@ -226,8 +221,9 @@ NO_SANITIZE("cfi-icall") void CefDataBaseCToCpp::ClearAllPermission(int type) {
NO_SANITIZE("cfi-icall")
void CefDataBaseCToCpp::GetOriginsByPermission(
- int type, std::vector<CefString> &origins) {
- cef_data_base_t *_struct = GetStruct();
+ int type,
+ std::vector<CefString>& origins) {
+ cef_data_base_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_origins_by_permission))
return;
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7b5c7ec8ac08f9547744baa38e840cf35a3e7a25$
+// $hash=0a76a650645cbe773c0109fd95ce88ff4c0841e5$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DATA_BASE_CTOCPP_H_
@@ -41,10 +41,11 @@ class CefDataBaseCToCpp : public CefCToCppRefCounted<CefDataBaseCToCpp,
const CefString& realm,
const CefString& username,
const char* password) override;
- void GetHttpAuthCredentials(
- const CefString& host,
- const CefString& realm,
- std::vector<CefString>& username_password) override;
+ void GetHttpAuthCredentials(const CefString& host,
+ const CefString& realm,
+ CefString& username,
+ char* password,
+ uint32_t passwordSize) override;
bool ExistPermissionByOrigin(const CefString& origin, int type) override;
bool GetPermissionResultByOrigin(const CefString& origin,
int type,
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=765b5a3f3e0ac077f2ff72541ae26ca342c4ca78$
+// $hash=55be7ac3ac6c4e07af7c20c920c6c83b7d0a25d3$
//
#include "libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cd33af6263f686958bccf5907e1c4622950a7a40$
+// $hash=e064baa776ef2fb9b70d51ec556613859a222067$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DELETE_COOKIES_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=610f96da1baaa48d1aa7fcff8a4c4fb33d2965ab$
+// $hash=dc9df8e6b51991e751cb5f6607db87d3d9b3bb18$
//
#include "libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3b8cfdd8e4bc8e1981634fdd6a78f8eb9a23da4b$
+// $hash=13f5ab113bea9ee958f3d92e1c10898fd182c14e$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DEV_TOOLS_MESSAGE_OBSERVER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,12 +9,13 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=df2505130721df8255b0d5bd511fb8ef394a7d8e$
+// $hash=2ce0bd2dda4afb008613b357545251c4e498dd53$
//
#include "libcef_dll/ctocpp/dialog_handler_ctocpp.h"
#include "libcef_dll/cpptoc/browser_cpptoc.h"
#include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h"
+#include "libcef_dll/cpptoc/select_popup_callback_cpptoc.h"
#include "libcef_dll/shutdown_checker.h"
#include "libcef_dll/transfer_util.h"
@@ -72,6 +73,59 @@ bool CefDialogHandlerCToCpp::OnFileDialog(
return _retval ? true : false;
}
+NO_SANITIZE("cfi-icall")
+void CefDialogHandlerCToCpp::OnSelectPopupMenu(
+ CefRefPtr<CefBrowser> browser,
+ const CefRect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<CefSelectPopupItem>& menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection,
+ CefRefPtr<CefSelectPopupCallback> callback) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_dialog_handler_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, on_select_popup_menu))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Verify param: browser; type: refptr_diff
+ DCHECK(browser.get());
+ if (!browser.get())
+ return;
+ // Verify param: callback; type: refptr_diff
+ DCHECK(callback.get());
+ if (!callback.get())
+ return;
+
+ // Translate param: menu_items; type: simple_vec_byref_const
+ const size_t menu_itemsCount = menu_items.size();
+ cef_select_popup_item_t* menu_itemsList = NULL;
+ if (menu_itemsCount > 0) {
+ menu_itemsList = new cef_select_popup_item_t[menu_itemsCount];
+ DCHECK(menu_itemsList);
+ if (menu_itemsList) {
+ for (size_t i = 0; i < menu_itemsCount; ++i) {
+ menu_itemsList[i] = menu_items[i];
+ }
+ }
+ }
+
+ // Execute
+ _struct->on_select_popup_menu(_struct, CefBrowserCppToC::Wrap(browser),
+ &bounds, item_height, item_font_size,
+ selected_item, menu_itemsCount, menu_itemsList,
+ right_aligned, allow_multiple_selection,
+ CefSelectPopupCallbackCppToC::Wrap(callback));
+
+ // Restore param:menu_items; type: simple_vec_byref_const
+ if (menu_itemsList)
+ delete[] menu_itemsList;
+}
+
// CONSTRUCTOR - Do not edit by hand.
CefDialogHandlerCToCpp::CefDialogHandlerCToCpp() {}
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fb268437c35b6a412dc6305ae83798d4d1db56d6$
+// $hash=9d70e8e88a252b29a7157b30e487ce44b6d77404$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DIALOG_HANDLER_CTOCPP_H_
@@ -44,6 +44,15 @@ class CefDialogHandlerCToCpp
int selected_accept_filter,
bool capture,
CefRefPtr<CefFileDialogCallback> callback) override;
+ void OnSelectPopupMenu(CefRefPtr<CefBrowser> browser,
+ const CefRect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<CefSelectPopupItem>& menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection,
+ CefRefPtr<CefSelectPopupCallback> callback) override;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_DIALOG_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=70aa25f8ab57f0c152666a730aff4247684108f9$
+// $hash=aa3f8a292eeec9a65ab219958a3706b40500faa5$
//
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ad04d2893bd8949c1384a4dcd68c9acb0f2b967d$
+// $hash=68a7aff9f01e57edaeaa53bfbbc4c6121ebb3a1b$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DICTIONARY_VALUE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=dcdaebfe8fdc44caf9f4903321577b155b2ec959$
+// $hash=c3f669584e3f282ce2eb05b3aca53e97e0548d8a$
//
#include "libcef_dll/ctocpp/display_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=dc1b9dda1a8f57d46d2c0049cd62a57dd5f56868$
+// $hash=b242381316d4973e89fe4ae2c9f41e2ef7be2242$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e5f17a1d61c8211bcf16be848e8aaf48934c5b0c$
+// $hash=4dddf3528abafd3fce06482308a76df0a056cd3c$
//
#include "libcef_dll/ctocpp/domdocument_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=50b7c300f95667c483dcb19c13f274fbc352f7d1$
+// $hash=987816a9b106341068d08f3cd9254c98cf77f6ad$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=64846f6de30a56d2aaed093cbfd9959c7cc2f1af$
+// $hash=bc1d300ce01b57d299dff3b67d54508fa827489e$
//
#include "libcef_dll/ctocpp/domnode_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a824395854fca10143c0329a0f95dcfc837c6d86$
+// $hash=343a5f84d09a6933f005c3915582c73c43bda406$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c3351e11fd6ae488bd77aeba4b4c8485f24119ad$
+// $hash=7379b70849292e5b7709d2ff0a4e2541869c86a5$
//
#include "libcef_dll/ctocpp/domvisitor_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=950252a2903cd57d097fb9dcd4eacf0761914e7a$
+// $hash=9f8a534b9feef5b972259d972bf30ad838e1a788$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c4e47ffd023b528b9c5b658126f4a1d9fd05cf98$
+// $hash=9fc07deae728fc443a569cc273456e5c5b98af4a$
//
#include "libcef_dll/ctocpp/download_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=172a12dd9e68b65afff9eef5b93f0e480beaf904$
+// $hash=2a8f0822ec7ffa38dc5a712c913a48adc216eead$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8568e306d0db860b1cd222f7c6dba344f349cb2d$
+// $hash=b838fd3af2c144711044cae354ea86e336ce39a8$
//
#include "libcef_dll/ctocpp/download_image_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fa13abafcf97f6a71d08ca7ec67d45a71d636603$
+// $hash=c281c09951a9b4f85556d0a9008b2524326254dd$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_IMAGE_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=092e50c318b7d1c933ffb293ff062df17bfbb736$
+// $hash=c7e4d15ade6e97ad9019c493941a06a5807b3e25$
//
#include "libcef_dll/ctocpp/download_item_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=dc38ebb20863207084498e6d14e8a5e8fde59eea$
+// $hash=013ef6edbf734cdf4e6d00ba5b8be6c46284e2ca$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=05c6527a7cdeb9495bca9da965956fb3006a7bdd$
+// $hash=b99a604e59d6759cf17a05dbdb8e7dbf6080f43c$
//
#include "libcef_dll/ctocpp/download_item_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=800621bf853598aa11673f3c38e5f30858aa1ff1$
+// $hash=30923eaf63fab5b36c95a1a8da4a2e229a794a86$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=57352ff85ca98fc34a0f2c58afbb1224ce1a1f09$
+// $hash=a9a85999cc0792beae39e7b2796eedf435a88a1b$
//
#include "libcef_dll/ctocpp/drag_data_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0814e8ced30cbbd7c5867464550da973395b385b$
+// $hash=acf7963e32fc361fd12874da55d86e4b0f9090d1$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=83bbaf05bb87f369d819d4202110581c3bbe60a1$
+// $hash=19cc3c5f296c806db31572ecc826788ba6d8e837$
//
#include "libcef_dll/ctocpp/drag_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=87c40d04da449f1144f962dff8b3e0b5a1d70db7$
+// $hash=a8523e82439b30828b0774d2eff240ea215b96d6$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7f660f5500f6e299ef56d598c71ade363f5581b9$
+// $hash=57b26c7374b16644439f70555241a061fa08c617$
//
#include "libcef_dll/ctocpp/end_tracing_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=43c23da2432e1336afcd21889ae744bcc109e3ed$
+// $hash=d798b3255a8ad2aea9d4afbe3492eaad538d8d0a$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_END_TRACING_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=de6b935b77168bd9b44f26643c510f360f8b6ebd$
+// $hash=7bee2237c6ee537f23635d3fc6d1d62ca7eaf5c4$
//
#include "libcef_dll/ctocpp/extension_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8e52bd30f4ec56b17b163c2daf4981ae55e72993$
+// $hash=07a08b9dd260059e77dfb433f43686cbc5569bea$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_EXTENSION_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=befb9e9bd438e431bb55b7c67413d9d7a7b263f2$
+// $hash=f2661cdc6ea68b840409c2fcf84fb31c25e0f1b8$
//
#include "libcef_dll/ctocpp/extension_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=147ef76bff631531a075ac9a2c823d3e9f84c409$
+// $hash=5e432e7dd8e10b681b96bad3694ba2d0bf79fad6$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_EXTENSION_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8fecb808fb6a84d630d1e8c5380a5ffd900b3654$
+// $hash=ae1de0166e8b2c1f50d4ed5da69ae63a5bb8ebaf$
//
#include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d84ac439b3372160aa3886b28b3ff81e49f05a6d$
+// $hash=190953cb1d900d253258bbbaae2220512509c3a9$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_FILE_DIALOG_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=22af1e946668e89411cc87596b88c8a47880a78a$
+// $hash=fbb70e4dd2af2d9cbc4377c0f62097933f26cea9$
//
#include "libcef_dll/ctocpp/find_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d6ed1e4a341c9deecc217c49ecd52f444d18e236$
+// $hash=8b86bd425ab5e9283d8fc8ac96b54740bf495cbb$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fe5dc43b11c24ea7a1e9a1c31846cd433a425a48$
+// $hash=adf870620ee814a41457a906d12265a23cd71bc1$
//
#include "libcef_dll/ctocpp/focus_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7a41bfc84063e89ae6a9a02ad4252b6145e06d48$
+// $hash=6a454cd9846e772380a72c5429d114f73cc3c1f5$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_FOCUS_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5bfee30715aa6f371b446b195cba6e5e05f7793f$
+// $hash=01a4bfc4420c23325504191dfa18a83e0e6d344f$
//
#include "libcef_dll/ctocpp/frame_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=922843bbc541ce7c7c8e1aa93e23bc7dde770d68$
+// $hash=617aa71107c0089df6f4b832a7dd30c850abc171$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2c1533712df282ba8ab092a2b42e69296c4d4771$
+// $hash=805b22d1d623b4b536d2aa1f71ad05cc32e23fc2$
//
#include "libcef_dll/ctocpp/frame_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=caae9971af64aba87b484e5024603dd53c406df0$
+// $hash=a1366f78329888eadf9121d7df819687d82a40c7$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_FRAME_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3997657ceba0e011684fe481bdcc221dacd24369$
+// $hash=dec8ab50f7084f8ea2bd48d74173c91134bc6d92$
//
#include "libcef_dll/ctocpp/geolocation_acess_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cfc297c4453970267ed52cecbc2469423ba4540f$
+// $hash=d405020431caf6f891ba21f967b35cc9d08da93a$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_ACESS_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2747a6d847a7abbc8adcde347308ff7826918884$
+// $hash=de3ebaabf9a63c53433469d01241fd97197d7c60$
//
#include "libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f86929f0ec5dc6292a33e6f4d05b788e503bdad1$
+// $hash=fd92d3650c1f3f04b84d9a0847631463b9e9ca2c$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_GET_EXTENSION_RESOURCE_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a8eda6ac0b338e7a41d207927a67fa2c83045449$
+// $hash=d5ba12d9fa862751e9c07d8b13afb7131c45c365$
//
#include "libcef_dll/ctocpp/get_images_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6708fab47b851dda8fd97a3d425f673186906b4c$
+// $hash=5569d10c20b8f19c8907133c7b21e293ebe9a2bd$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_GET_IMAGES_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=070d1f0064cc25f4e3e13d9b2931a4ba1c8341d4$
+// $hash=ffc3258b25dcb01dccb60e75f4d3f4b10e3224f8$
//
#include "libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=128e55210f65fe29b0d2d84160fd2a9427bc6429$
+// $hash=5a32e1b78e328e377d937e5f3d53afb869e153d9$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_GET_ORIGIN_USAGE_OR_QUOTA_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c81051ff9ec3bd7b14f89c09f00eea970ed14b14$
+// $hash=42082bd4962aa5bd8556918888da73635e4b36c5$
//
#include "libcef_dll/ctocpp/get_origins_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=308fccc205e0e4ac146d6affbe48559dc1a27a5a$
+// $hash=feb219add5c02bf679128a2abdf6817ba47c1b25$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_GET_ORIGINS_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=33aeaefa103664f5cead6898d2f957d8a9a97a92$
+// $hash=a36ffa56b60291c4fb99a00413950d2315ddfc13$
//
#include "libcef_dll/ctocpp/image_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=30ebbc8a004b2e371be3ee2bc305858c303f37fd$
+// $hash=13afe421110fa07e94c1724d21302b018a71a633$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_IMAGE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d54225cb81f976412f5924f0342241e5e1c15604$
+// $hash=ec746fb1184b4ac8124e90ddcb226035a06bfeb2$
//
#include "libcef_dll/ctocpp/java_script_result_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2e761fc082e89fe46754e498234c96e873d519dc$
+// $hash=17a3f0d9b77b19f01a9c147f900dc30016fa9e6e$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_JAVA_SCRIPT_RESULT_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8fa9cd400d5a9ecce87183cdbbee8673845b2228$
+// $hash=a328cc485e128abc40fa08e69633f3d6be490ad0$
//
#include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8f505c768b727bd821e5d619227533b45fd6029b$
+// $hash=5e91e201bc50f771d1ded89088fffcb0da8d34d7$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cf3f4ea060216018445b03ed1626f0698c01839b$
+// $hash=c95849f5069d934dcca81e86a11e76931582a22b$
//
#include "libcef_dll/ctocpp/jsdialog_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d486b4a8044df978ea21be7c6a48841ea48d7ad7$
+// $hash=55b3bcb925cfaf44f79c0e03fc55878d748f55ce$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d5ba873aeb2b734e753d47420bbe10e290e8658d$
+// $hash=e6cddc00cf20f1abd640865c61a70dd54dc54d95$
//
#include "libcef_dll/ctocpp/keyboard_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ab70636733b9287db1e87f11f8c73610afa35337$
+// $hash=a25080ecb1a098b748d8384bc5af591ea773deff$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_KEYBOARD_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1c8c2d9b0eff1833a030f2e75515f7d7c60cada4$
+// $hash=873c979fdd4b48e65375437e6a70a900de50840d$
//
#include "libcef_dll/ctocpp/life_span_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=bfe3eba26049a9f15b7922d979395bc7b0ac4055$
+// $hash=580b424b488c3974143484a05df444e91edfca5c$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_LIFE_SPAN_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=93f45c1e39dc2ba72a6cb44bc3d762f3870f2ef2$
+// $hash=531f5719300934d7a039855559835715de9c765a$
//
#include "libcef_dll/ctocpp/list_value_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2c6664443a865936b74fcea903f131011736d689$
+// $hash=99b478c698261aa2aaf566b283fc938aacf3b2bf$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6be01fd6f359ff9960cea2ec422a489673b72bd6$
+// $hash=710979924c3b6f6b6f1479dd75ed0e3c6dd02126$
//
#include "libcef_dll/ctocpp/load_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1ae727d2a86654472d0312033fe4bd5df06556fe$
+// $hash=12b88b0080727a6c6abf49b8ab17b8c18dc4e2f5$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_LOAD_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=16bf2696e26746eddb06f7c6003eec81d3fc1c23$
+// $hash=042362d0195aca3ce86ceea3d2f42e34c1ad2f03$
//
#include "libcef_dll/ctocpp/menu_model_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4cb6a46bc1c8fa0d912c04d58a07afddd250d9b9$
+// $hash=f7d0cf26743b3559f4e826452f3cb2c561dd75d1$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=09421982fe76735de86b67b1f7d8828a1cc36f6e$
+// $hash=9445255c84ab78ee3b9b61cbd10abe5233f0688b$
//
#include "libcef_dll/ctocpp/menu_model_delegate_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0dcaca76119b9db970c61a30ba90d841f2fb7186$
+// $hash=6ac8a9990cf50850d8f8716096094d1180215be9$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_DELEGATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2356b5283bbfa5a587b5db964b281dff6fb8233d$
+// $hash=47dac2be50c91cdd5c314a6d78a64ad90fa6b1a3$
//
#include "libcef_dll/ctocpp/navigation_entry_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=dd86b1cd3bb9fb67f7e7dfdee204fd752e27e410$
+// $hash=a76314c5c7b7732bcc2b87df342cbdf78f36b8d6$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=057910c31bf56f3bb5def469638942802300c7d8$
+// $hash=606184483441192c6ede228dd014eca4baa1e2ac$
//
#include "libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=478d39c2ee5c0e2dcd0e0923d47b20bc05e8a3b7$
+// $hash=3dbe29abccbfa1d1cc7014630bbe312d9de42ac8$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_VISITOR_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=970ecf239bb133f5c62c372762e00ba913e492a2$
+// $hash=296e7ba74dedad13612fea5dfbc09163a5b15872$
//
#include "libcef_dll/ctocpp/pdf_print_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6ec768e5cc0ef58766105bee24c3841367995a1e$
+// $hash=0387fbd8f6ad59dac67959eeded82630a2bba935$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_PDF_PRINT_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=12f03dbc264ba05a28f5dc8273117ca6c6c74b8b$
+// $hash=62fd641af7c0e8767c775f3e5d0148103822d62d$
//
#include "libcef_dll/ctocpp/permission_request_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d3dcf1dc594597e78adcd93c64e185a6223992d1$
+// $hash=8600f1096fac8d37c3506fce7d76157ae067b427$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_PERMISSION_REQUEST_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7a24d4020666f0277e76e190926df2081637a174$
+// $hash=16d0f97a19f6cab36f8a40bb7a5db900bc74c872$
//
#include "libcef_dll/ctocpp/post_data_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7f744704ab0c6d50b814469b168b610f74a118d8$
+// $hash=e70d58d7c779528d03b49ead50c162ebf0eb0ca7$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=027842b89846614ba6d0e3056db65004bc3a6b06$
+// $hash=21bd5d7adae7aad41bf500eb30bfb917f33f1750$
//
#include "libcef_dll/ctocpp/post_data_element_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7f8d7ce807aae88cd94eb0bf8fed88208b052dce$
+// $hash=a81732545889a9d401edb7f5540e0762bb787526$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2e3cda6569368540518b84119205e1e5f6e0d36b$
+// $hash=a251f867872c76ea64f247d745b7eb895f24e477$
//
#include "libcef_dll/ctocpp/print_dialog_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7d1df66731aeda9ede696254998eb6531a5d3531$
+// $hash=7c49e07c9ba8bfc8f7620952b19140828a3bf011$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_DIALOG_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f81708853d5cb6ee2fb397f401787068b722b060$
+// $hash=d1160c71777c77bffaaef2db26b53d3a4ab269b3$
//
#include "libcef_dll/ctocpp/print_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=861bf98595a13f8c42a23b5742471332c066b57a$
+// $hash=b1d082ab9bea88f46372a371b68b9b4c25a96ca2$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c952b7985eb56fd18e552e4905a5563380277bac$
+// $hash=a3bb609c6cbc5d38d8359a427664780c8e8a5625$
//
#include "libcef_dll/ctocpp/print_job_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6e70e242c6ffef77f0c3ceeeb5773f0b8037395e$
+// $hash=6ac2e8d5475582b66e40e297b192bdbdc8acbeed$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_JOB_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=70eeeda85eb67d546066854051f2f921fadcca18$
+// $hash=953bf2909c532598f70a4f7ad09c16d774dad5f8$
//
#include "libcef_dll/ctocpp/print_settings_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e74e75adf68001ef29e441fa1bbac27e3aa5c3c1$
+// $hash=75238f577e768438cead970fa7362e4b04856894$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_SETTINGS_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7ab779c6c98a1bd2385f14d514304a28ef58717f$
+// $hash=c68e571b03dfbb3e50a989f5e8abde1fe21837e2$
//
#include "libcef_dll/ctocpp/process_message_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=39bf2321370b32cf02bf502529568e935b303550$
+// $hash=ce134ef72dcd3df8303e202db7489cc2920a3ad2$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_PROCESS_MESSAGE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0332caff5ce6230d2cb2d7663fc0bbfac8e45069$
+// $hash=a0abf42da8392486549644489052218f494ae8dd$
//
#include "libcef_dll/ctocpp/read_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f3d43ae771f8e17084fd9397fd4e2bef9471ea73$
+// $hash=d4b05ef2f8edd18da8b5ed9c5d4afe8162f81069$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_READ_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=36f275457b15025ac7b979eca3179cd127f45ffb$
+// $hash=e1eade4ceaefc7079366e8b0d29d499590273e8c$
//
#include "libcef_dll/ctocpp/registration_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=84ca9a25ae345642994cc1b44cd71f90e7406f19$
+// $hash=8b9f37f2e0d395e737bc158d7d4bfb5f5e85e5c4$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_REGISTRATION_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4542e0e52791a8d283c997922779ab33d40ad54c$
+// $hash=f2f817e11a4ff708bf3e1be68b75527681387d39$
//
#include "libcef_dll/ctocpp/render_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f70633e6b53acb79709008ad6aaa692c77f7d136$
+// $hash=db2cc3ecd0fa1658ae8ce19b1347175a1902daec$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a75829d0f47e772086a586f213cfdfe54ff5554c$
+// $hash=7e1d2051125a7c9845153bb1ed978e92c00d101b$
//
#include "libcef_dll/ctocpp/render_process_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c87a2a5637615d6b7994f80cef17651c73cdb8e2$
+// $hash=1e5030658a4775df8e1eb8bbd54c43cdacf4572a$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_PROCESS_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=30c4985c5d42f2b4409c2650ded5265209f210f4$
+// $hash=dc0625b92b6258aa5bad4b5407431a7fff11124b$
//
#include "libcef_dll/ctocpp/request_context_ctocpp.h"
@@ -22,7 +22,6 @@
#include "libcef_dll/ctocpp/data_base_ctocpp.h"
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
#include "libcef_dll/ctocpp/extension_ctocpp.h"
-#include "libcef_dll/ctocpp/media_router_ctocpp.h"
#include "libcef_dll/ctocpp/value_ctocpp.h"
#include "libcef_dll/ctocpp/web_storage_ctocpp.h"
#include "libcef_dll/transfer_util.h"
@@ -566,25 +565,6 @@ CefRefPtr<CefExtension> CefRequestContextCToCpp::GetExtension(
return CefExtensionCToCpp::Wrap(_retval);
}
-NO_SANITIZE("cfi-icall")
-CefRefPtr<CefMediaRouter> CefRequestContextCToCpp::GetMediaRouter(
- CefRefPtr<CefCompletionCallback> callback) {
- cef_request_context_t* _struct = GetStruct();
- if (CEF_MEMBER_MISSING(_struct, get_media_router))
- return nullptr;
-
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Unverified params: callback
-
- // Execute
- cef_media_router_t* _retval = _struct->get_media_router(
- _struct, CefCompletionCallbackCppToC::Wrap(callback));
-
- // Return type: refptr_same
- return CefMediaRouterCToCpp::Wrap(_retval);
-}
-
// CONSTRUCTOR - Do not edit by hand.
CefRequestContextCToCpp::CefRequestContextCToCpp() {}
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=caa6b1e4b3ff4716bb47e181b96c9483342b28de$
+// $hash=178710b8193986502c91eff7bbe6cbfe0e158055$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_
@@ -79,8 +79,6 @@ class CefRequestContextCToCpp
bool HasExtension(const CefString& extension_id) override;
bool GetExtensions(std::vector<CefString>& extension_ids) override;
CefRefPtr<CefExtension> GetExtension(const CefString& extension_id) override;
- CefRefPtr<CefMediaRouter> GetMediaRouter(
- CefRefPtr<CefCompletionCallback> callback) override;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a57c9c762ed21459113a931ad31387aa1ab2c441$
+// $hash=8a94f1c67a481d85041012d944a85e9a1bcce7c8$
//
#include "libcef_dll/ctocpp/request_context_handler_ctocpp.h"
@@ -41,15 +41,14 @@ void CefRequestContextHandlerCToCpp::OnRequestContextInitialized(
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefResourceRequestHandler>
-CefRequestContextHandlerCToCpp::GetResourceRequestHandler(
- CefRefPtr<CefBrowser> browser,
- CefRefPtr<CefFrame> frame,
- CefRefPtr<CefRequest> request,
- bool is_navigation,
- bool is_download,
- const CefString& request_initiator,
- bool& disable_default_handling) {
+CefRefPtr<CefResourceRequestHandler> CefRequestContextHandlerCToCpp::
+ GetResourceRequestHandler(CefRefPtr<CefBrowser> browser,
+ CefRefPtr<CefFrame> frame,
+ CefRefPtr<CefRequest> request,
+ bool is_navigation,
+ bool is_download,
+ const CefString& request_initiator,
+ bool& disable_default_handling) {
cef_request_context_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_resource_request_handler))
return nullptr;
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f1c0285ef66144b395f364bf1e6d211634028df7$
+// $hash=8f4c9ab7910a1497890d9bb3bc7aef80e23b7306$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b1dd4486a797ac139f453e02e3a49c74b7568ca8$
+// $hash=0cd351db644cd18b1cde6adf5355d2ceff949827$
//
#include "libcef_dll/ctocpp/request_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6a1638068718eb98ce3311395809c7da4c9f7422$
+// $hash=7e87acb36c494058615248f36c7536368d3d5fb5$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1622488c5f5a264c0672564c1862e3d64b87e8e8$
+// $hash=f65a730888f266775539eaa278925d619b5a4be2$
//
#include "libcef_dll/ctocpp/request_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=da31c462d342652746056a6a1013bcf5f4f5155c$
+// $hash=e407bf6537c825d8fe5e340aa3e29b61f78574ae$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c71d6fd8b0ee493102fdae90612f15b01e4a9f6b$
+// $hash=e8659cb8919878e3ad14e22b9c30b61eae0fe71d$
//
#include "libcef_dll/ctocpp/resolve_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=493826dcfb1c8e1b46489225a74332552d591d63$
+// $hash=648f3d66272798ab00f7a97d33126aef193d5fa5$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESOLVE_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a62aa669321b0f86ea3508ce31ea5b1a0bc3f9b5$
+// $hash=8ac944f0c572916a56506165359595f4c607a66c$
//
#include "libcef_dll/ctocpp/resource_bundle_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=faa11d38d989eb250f28646485cd2f0d38438807$
+// $hash=e18e48353500f27c27160812032cadc398fe00f9$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=12556834893a7ae50b8f8bef2b71915fa1a141ca$
+// $hash=dd0ca54416131ada6010e1e578eaff359488f11a$
//
#include "libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ba179fe7fc169637ab6f1727351a81952c82826d$
+// $hash=52b1821c0ed82e859eddbb113d4a73ba2b178548$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=16d3a6bd2555917b295d7dbb3ccd95ccfc35b111$
+// $hash=8641dd9a90013088eb4840c691effe87c7a38348$
//
#include "libcef_dll/ctocpp/resource_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2b60744909728ffbff2e846438bf122a61fec5c7$
+// $hash=8cf5fea5fc1d33f8268a4608417a75ef6ee9bf51$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c251aa59688ffe5c12d2ec3c8a4a896d016e86a0$
+// $hash=4f01fc764e74bb4a40a53b43ddc4e4857e51e4e2$
//
#include "libcef_dll/ctocpp/resource_read_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b655936b8ea2584164546d261263876bf9d3f0ac$
+// $hash=aeb2eaecc30bb2498b709af0ec45dd6b5dc9b392$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_READ_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=76e8ba6d6c7860c2a1b630dd632f5c647391f564$
+// $hash=7a1e7b377527ff331e4950f3f52c85f2a341517d$
//
#include "libcef_dll/ctocpp/resource_request_handler_ctocpp.h"
@@ -25,11 +25,10 @@
// VIRTUAL METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefCookieAccessFilter>
-CefResourceRequestHandlerCToCpp::GetCookieAccessFilter(
- CefRefPtr<CefBrowser> browser,
- CefRefPtr<CefFrame> frame,
- CefRefPtr<CefRequest> request) {
+CefRefPtr<CefCookieAccessFilter> CefResourceRequestHandlerCToCpp::
+ GetCookieAccessFilter(CefRefPtr<CefBrowser> browser,
+ CefRefPtr<CefFrame> frame,
+ CefRefPtr<CefRequest> request) {
cef_resource_request_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_cookie_access_filter))
return nullptr;
@@ -53,11 +52,11 @@ CefResourceRequestHandlerCToCpp::GetCookieAccessFilter(
NO_SANITIZE("cfi-icall")
CefResourceRequestHandler::ReturnValue
-CefResourceRequestHandlerCToCpp::OnBeforeResourceLoad(
- CefRefPtr<CefBrowser> browser,
- CefRefPtr<CefFrame> frame,
- CefRefPtr<CefRequest> request,
- CefRefPtr<CefCallback> callback) {
+ CefResourceRequestHandlerCToCpp::OnBeforeResourceLoad(
+ CefRefPtr<CefBrowser> browser,
+ CefRefPtr<CefFrame> frame,
+ CefRefPtr<CefRequest> request,
+ CefRefPtr<CefCallback> callback) {
cef_resource_request_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, on_before_resource_load))
return RV_CONTINUE;
@@ -84,11 +83,10 @@ CefResourceRequestHandlerCToCpp::OnBeforeResourceLoad(
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefResourceHandler>
-CefResourceRequestHandlerCToCpp::GetResourceHandler(
- CefRefPtr<CefBrowser> browser,
- CefRefPtr<CefFrame> frame,
- CefRefPtr<CefRequest> request) {
+CefRefPtr<CefResourceHandler> CefResourceRequestHandlerCToCpp::
+ GetResourceHandler(CefRefPtr<CefBrowser> browser,
+ CefRefPtr<CefFrame> frame,
+ CefRefPtr<CefRequest> request) {
cef_resource_request_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_resource_handler))
return nullptr;
@@ -172,12 +170,11 @@ bool CefResourceRequestHandlerCToCpp::OnResourceResponse(
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefResponseFilter>
-CefResourceRequestHandlerCToCpp::GetResourceResponseFilter(
- CefRefPtr<CefBrowser> browser,
- CefRefPtr<CefFrame> frame,
- CefRefPtr<CefRequest> request,
- CefRefPtr<CefResponse> response) {
+CefRefPtr<CefResponseFilter> CefResourceRequestHandlerCToCpp::
+ GetResourceResponseFilter(CefRefPtr<CefBrowser> browser,
+ CefRefPtr<CefFrame> frame,
+ CefRefPtr<CefRequest> request,
+ CefRefPtr<CefResponse> response) {
cef_resource_request_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_resource_response_filter))
return nullptr;
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2a3124a23f18f81fe2effd7df7848aa999370f31$
+// $hash=4564ea5efd8c4be32e2df7c98fd70a645eb9f696$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_REQUEST_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=df7b14a723e4f2b9dd7946fddfbe8dc9652ccb75$
+// $hash=9b1ffc7f2bb483a6657867c8369e56b821b44684$
//
#include "libcef_dll/ctocpp/resource_skip_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=de37dc0b6e8570fc2f0d1912a5ac9e264ef5d6dc$
+// $hash=ace627f34f6c16512fb0d7a9a4ebb96e9c00c78d$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_SKIP_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ac30aa16fee147cd041b64db7f2743d578dc6384$
+// $hash=85da34bbec6032ab48c11a9c64927c9da40fa5dc$
//
#include "libcef_dll/ctocpp/response_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8e61de9ab82c665913039fa45903fa8b2213d3c2$
+// $hash=3ec4c709bcd18d24997d554134b1b01e17bbd0fb$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ddb4710d1e5bc73df68f132d56661b0d22520ad9$
+// $hash=dc1f2774aa0a5d586afb09a77cd4fdf5022af04a$
//
#include "libcef_dll/ctocpp/response_filter_ctocpp.h"
@@ -34,13 +34,13 @@ NO_SANITIZE("cfi-icall") bool CefResponseFilterCToCpp::InitFilter() {
}
NO_SANITIZE("cfi-icall")
-CefResponseFilter::FilterStatus CefResponseFilterCToCpp::Filter(
- void* data_in,
- size_t data_in_size,
- size_t& data_in_read,
- void* data_out,
- size_t data_out_size,
- size_t& data_out_written) {
+CefResponseFilter::FilterStatus
+ CefResponseFilterCToCpp::Filter(void* data_in,
+ size_t data_in_size,
+ size_t& data_in_read,
+ void* data_out,
+ size_t data_out_size,
+ size_t& data_out_written) {
shutdown_checker::AssertNotShutdown();
cef_response_filter_t* _struct = GetStruct();
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3e7c6b0f991e335db755172d65e2a03e5e00a270$
+// $hash=b9ca51a2ee848580b14c1a06b49b2b9e048ab798$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESPONSE_FILTER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=427fe84b74eec6346d7da729cba2fdf52d1c0fd7$
+// $hash=be8368d8aea24196357d54e79c935ad40b5e7d9d$
//
#include "libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ffa640e35d08dd0f9b8c0ea291db190947826915$
+// $hash=7663b13ecb057bba0158685bc34783f37ef2f030$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RUN_CONTEXT_MENU_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cb29585261ed25ddd2ee1b4b5c890565e72e5d22$
+// $hash=2e7f10559c5c3458ee2a5055d55ec4df6be246cf$
//
#include "libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=63d2d1da715395296899acc4ed165cf7dae4d78c$
+// $hash=85e5a1624f1ed7c3a154f55edc0682f723374197$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RUN_FILE_DIALOG_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c0d516016a14eeed0c73bde99e2495ae691c2326$
+// $hash=7d0f87f5e909c52e5424e018ff46f806960f7df2$
//
#include "libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=519977d5976a7486e0fda9d9b9b0d6fd0fd9b44f$
+// $hash=c079137f43167df4c21e63f38cdd8c33f4423445$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RUN_QUICK_MENU_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5e94a999784332a91c40a4608644bf7dc36e0729$
+// $hash=ea86d74aea74e67a896aa51760e61219743a478f$
//
#include "libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ff0cb366799a5abce0f4e43bd98fcaf993fad77d$
+// $hash=8553de031f140b9c850e487863fc91b97633314b$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_FACTORY_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3f55a43485f2833e5000e7444d57ef47ff7af0e9$
+// $hash=722531dae407df607f2454823d375a34db168075$
//
#include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6c522fb5e064daeea21350a548af4bee6c0a2acf$
+// $hash=a30e0b019ab6b34998563c8bf46f7b0c8089c3ba$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f77cbb1874239eff164c3654befdc0f4fe81fed9$
+// $hash=6fd8a2097b3275a73b28725e5747cc8e5c895a63$
//
#include "libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0de5941ff724adcd6ca8fcb5e1a5266143afa820$
+// $hash=3ab940de86fd7e4fd434758c7064f4eea9a3de47$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_SELECT_CLIENT_CERTIFICATE_CALLBACK_CTOCPP_H_
new file mode 100644
@@ -0,0 +1,88 @@
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool. If making changes by
+// hand only do so within the body of existing method and function
+// implementations. See the translator.README.txt file in the tools directory
+// for more information.
+//
+// $hash=79f5a4ff76eac8f4149c11465623c3b177887128$
+//
+
+#include "libcef_dll/ctocpp/select_popup_callback_ctocpp.h"
+#include "libcef_dll/shutdown_checker.h"
+
+// VIRTUAL METHODS - Body may be edited by hand.
+
+NO_SANITIZE("cfi-icall")
+void CefSelectPopupCallbackCToCpp::Continue(const std::vector<int>& indices) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_select_popup_callback_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, cont))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Translate param: indices; type: simple_vec_byref_const
+ const size_t indicesCount = indices.size();
+ int* indicesList = NULL;
+ if (indicesCount > 0) {
+ indicesList = new int[indicesCount];
+ DCHECK(indicesList);
+ if (indicesList) {
+ for (size_t i = 0; i < indicesCount; ++i) {
+ indicesList[i] = indices[i];
+ }
+ }
+ }
+
+ // Execute
+ _struct->cont(_struct, indicesCount, indicesList);
+
+ // Restore param:indices; type: simple_vec_byref_const
+ if (indicesList)
+ delete[] indicesList;
+}
+
+NO_SANITIZE("cfi-icall") void CefSelectPopupCallbackCToCpp::Cancel() {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_select_popup_callback_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, cancel))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Execute
+ _struct->cancel(_struct);
+}
+
+// CONSTRUCTOR - Do not edit by hand.
+
+CefSelectPopupCallbackCToCpp::CefSelectPopupCallbackCToCpp() {}
+
+// DESTRUCTOR - Do not edit by hand.
+
+CefSelectPopupCallbackCToCpp::~CefSelectPopupCallbackCToCpp() {
+ shutdown_checker::AssertNotShutdown();
+}
+
+template <>
+cef_select_popup_callback_t* CefCToCppRefCounted<
+ CefSelectPopupCallbackCToCpp,
+ CefSelectPopupCallback,
+ cef_select_popup_callback_t>::UnwrapDerived(CefWrapperType type,
+ CefSelectPopupCallback* c) {
+ NOTREACHED() << "Unexpected class type: " << type;
+ return nullptr;
+}
+
+template <>
+CefWrapperType CefCToCppRefCounted<CefSelectPopupCallbackCToCpp,
+ CefSelectPopupCallback,
+ cef_select_popup_callback_t>::kWrapperType =
+ WT_SELECT_POPUP_CALLBACK;
new file mode 100644
@@ -0,0 +1,43 @@
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool. If making changes by
+// hand only do so within the body of existing method and function
+// implementations. See the translator.README.txt file in the tools directory
+// for more information.
+//
+// $hash=511a4146e38cfe2e2242f3d79950cf67415fe4d5$
+//
+
+#ifndef CEF_LIBCEF_DLL_CTOCPP_SELECT_POPUP_CALLBACK_CTOCPP_H_
+#define CEF_LIBCEF_DLL_CTOCPP_SELECT_POPUP_CALLBACK_CTOCPP_H_
+#pragma once
+
+#if !defined(WRAPPING_CEF_SHARED)
+#error This file can be included wrapper-side only
+#endif
+
+#include <vector>
+#include "include/capi/cef_dialog_handler_capi.h"
+#include "include/cef_dialog_handler.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
+
+// Wrap a C structure with a C++ class.
+// This class may be instantiated and accessed wrapper-side only.
+class CefSelectPopupCallbackCToCpp
+ : public CefCToCppRefCounted<CefSelectPopupCallbackCToCpp,
+ CefSelectPopupCallback,
+ cef_select_popup_callback_t> {
+ public:
+ CefSelectPopupCallbackCToCpp();
+ virtual ~CefSelectPopupCallbackCToCpp();
+
+ // CefSelectPopupCallback methods.
+ void Continue(const std::vector<int>& indices) override;
+ void Cancel() override;
+};
+
+#endif // CEF_LIBCEF_DLL_CTOCPP_SELECT_POPUP_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d8cfb6cafc2a9aa0cffe4a998071e8a96b04740b$
+// $hash=31e56774368e5a843a41c99e9446d8d97d6fc9da$
//
#include "libcef_dll/ctocpp/server_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ed13956e5941bbb0885224ef57016cf7f34d389c$
+// $hash=efb9652f9e2a17079ff20457264e8b0ecfd19499$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_SERVER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a14c40cc86f5fd61d548d981c99c59a559619eda$
+// $hash=eff1ec14b02da387e1504034a7eace1325a4ee94$
//
#include "libcef_dll/ctocpp/server_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b9b38b204c2b9d385ebefb11aa0b45efcd684cbc$
+// $hash=0bed1f616f1ae42a7eb755dba59b329cd600abff$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_SERVER_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5767c600167159c0ad3f5d10461f1bf107c668cc$
+// $hash=0114a4f38f6355d772659f7a3d83e086ef2079c3$
//
#include "libcef_dll/ctocpp/set_cookie_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=83c8143e3d126fca9a02f8e5ffa75bf99d291518$
+// $hash=26be0ed7d7165630ee23b480419768f1fd9b95fe$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_SET_COOKIE_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=67037943cdfae2a56924694d302a4b5697dc9a22$
+// $hash=ca0daba10b2ed5ebb9610092967d60efde837706$
//
#include "libcef_dll/ctocpp/sslinfo_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=bd6c2733149181808f331fa69f9c6199a43eb730$
+// $hash=d08212eed1df4078ed5bb72dd7fc6d478f476ecb$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_SSLINFO_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=18492d14d83b0dfd272ddd9dd95a2fc292bf8904$
+// $hash=82f44b0f9739a59e0d9cfad14282998f281dd0a8$
//
#include "libcef_dll/ctocpp/sslstatus_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=75331cb462e0944adffd05e9138561eb1cd68226$
+// $hash=af612f99d0ccc287b152a20b3e9956af223f82e0$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_SSLSTATUS_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3ea3777da287fb256c81d7659000104b85d99c45$
+// $hash=ef42fcbe56e93182d9f4b5063d55b33ce9086e55$
//
#include "libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ad8ad631ed5942baa7ae146fe31316d0952d3d36$
+// $hash=13d8e7ac8493bcf02b39067e63e0d9fe3e7e8e65$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_STORE_WEB_ARCHIVE_RESULT_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=964179bd73f8b5fa8d8adbd955deb7e720caaca7$
+// $hash=7a5ee0caa0def472edae4f8fee336bf1db392071$
//
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e512b79f803ab83f9f67e677ea916dd9f6bb8868$
+// $hash=8a1cd61b67d54a528ac936415fa11ff1936cd628$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e32b4745b887e33f589cb04e8b46a7317686e4c2$
+// $hash=af95b6ab0679c220a35569ae4dc4c11907d30084$
//
#include "libcef_dll/ctocpp/stream_writer_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=76a03eb8bf25cc337e838994c2bf4fe3f677aa6c$
+// $hash=f1156f9657858024d8d0dc20af0b5f53e82b5d74$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=97c52e0e29be9e4452825fb57d4014221c537baa$
+// $hash=ae0e93265c6fa1d984a669177c162602f99be475$
//
#include "libcef_dll/ctocpp/string_visitor_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=470dd514d2a3091216588819ee28296424649b57$
+// $hash=6e693b6dd1a72803aa7243d7cd5de54354338c37$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_STRING_VISITOR_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b99582b454aa33c5e9b2fa3f891ed0754621c377$
+// $hash=26d9172375112a2aa89c76d7a371796c5a7b9892$
//
#include "libcef_dll/ctocpp/task_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ec78aa696165cd02a3b7f19e877b89d58518d5ad$
+// $hash=e722a5b9ae2bb6e3d3236a199930600dc3b5e0f8$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TASK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c4e54b985b45c9cf57f70a3c560fb1d6c5230f9a$
+// $hash=9d367936047c38f9b70488ef5caf6d8ca081bb50$
//
#include "libcef_dll/ctocpp/task_runner_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=795e78c45943dd3c23d95ed1b85e889288f2dcf1$
+// $hash=372cc40047bb36d78f80f4d1edbbba30faad2c7f$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TASK_RUNNER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a28e85dbec92b031978a0d4c998c9cb1a853c9f8$
+// $hash=fd81a3bbebda49174033f19fe2eafd501b367837$
//
#include "libcef_dll/ctocpp/test/translator_test_ctocpp.h"
@@ -692,8 +692,8 @@ NO_SANITIZE("cfi-icall") size_t CefTranslatorTestCToCpp::GetPointListSize() {
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefTranslatorTestRefPtrLibrary>
-CefTranslatorTestCToCpp::GetRefPtrLibrary(int val) {
+CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp::
+ GetRefPtrLibrary(int val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -735,9 +735,8 @@ int CefTranslatorTestCToCpp::SetRefPtrLibrary(
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefTranslatorTestRefPtrLibrary>
-CefTranslatorTestCToCpp::SetRefPtrLibraryAndReturn(
- CefRefPtr<CefTranslatorTestRefPtrLibrary> val) {
+CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp::
+ SetRefPtrLibraryAndReturn(CefRefPtr<CefTranslatorTestRefPtrLibrary> val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -785,9 +784,9 @@ int CefTranslatorTestCToCpp::SetChildRefPtrLibrary(
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefTranslatorTestRefPtrLibrary>
-CefTranslatorTestCToCpp::SetChildRefPtrLibraryAndReturnParent(
- CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) {
+CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp::
+ SetChildRefPtrLibraryAndReturnParent(
+ CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -937,9 +936,8 @@ int CefTranslatorTestCToCpp::SetRefPtrClient(
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefTranslatorTestRefPtrClient>
-CefTranslatorTestCToCpp::SetRefPtrClientAndReturn(
- CefRefPtr<CefTranslatorTestRefPtrClient> val) {
+CefRefPtr<CefTranslatorTestRefPtrClient> CefTranslatorTestCToCpp::
+ SetRefPtrClientAndReturn(CefRefPtr<CefTranslatorTestRefPtrClient> val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -987,9 +985,9 @@ int CefTranslatorTestCToCpp::SetChildRefPtrClient(
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefTranslatorTestRefPtrClient>
-CefTranslatorTestCToCpp::SetChildRefPtrClientAndReturnParent(
- CefRefPtr<CefTranslatorTestRefPtrClientChild> val) {
+CefRefPtr<CefTranslatorTestRefPtrClient> CefTranslatorTestCToCpp::
+ SetChildRefPtrClientAndReturnParent(
+ CefRefPtr<CefTranslatorTestRefPtrClientChild> val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -1127,8 +1125,8 @@ size_t CefTranslatorTestCToCpp::GetRefPtrClientListSize() {
}
NO_SANITIZE("cfi-icall")
-CefOwnPtr<CefTranslatorTestScopedLibrary>
-CefTranslatorTestCToCpp::GetOwnPtrLibrary(int val) {
+CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::
+ GetOwnPtrLibrary(int val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -1170,9 +1168,8 @@ int CefTranslatorTestCToCpp::SetOwnPtrLibrary(
}
NO_SANITIZE("cfi-icall")
-CefOwnPtr<CefTranslatorTestScopedLibrary>
-CefTranslatorTestCToCpp::SetOwnPtrLibraryAndReturn(
- CefOwnPtr<CefTranslatorTestScopedLibrary> val) {
+CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::
+ SetOwnPtrLibraryAndReturn(CefOwnPtr<CefTranslatorTestScopedLibrary> val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -1222,9 +1219,9 @@ int CefTranslatorTestCToCpp::SetChildOwnPtrLibrary(
}
NO_SANITIZE("cfi-icall")
-CefOwnPtr<CefTranslatorTestScopedLibrary>
-CefTranslatorTestCToCpp::SetChildOwnPtrLibraryAndReturnParent(
- CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) {
+CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::
+ SetChildOwnPtrLibraryAndReturnParent(
+ CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -1273,9 +1270,8 @@ int CefTranslatorTestCToCpp::SetOwnPtrClient(
}
NO_SANITIZE("cfi-icall")
-CefOwnPtr<CefTranslatorTestScopedClient>
-CefTranslatorTestCToCpp::SetOwnPtrClientAndReturn(
- CefOwnPtr<CefTranslatorTestScopedClient> val) {
+CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp::
+ SetOwnPtrClientAndReturn(CefOwnPtr<CefTranslatorTestScopedClient> val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -1325,9 +1321,9 @@ int CefTranslatorTestCToCpp::SetChildOwnPtrClient(
}
NO_SANITIZE("cfi-icall")
-CefOwnPtr<CefTranslatorTestScopedClient>
-CefTranslatorTestCToCpp::SetChildOwnPtrClientAndReturnParent(
- CefOwnPtr<CefTranslatorTestScopedClientChild> val) {
+CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp::
+ SetChildOwnPtrClientAndReturnParent(
+ CefOwnPtr<CefTranslatorTestScopedClientChild> val) {
shutdown_checker::AssertNotShutdown();
cef_translator_test_t* _struct = GetStruct();
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=774d22a8a54e71a2511ce6a66491d9563302f0bf$
+// $hash=915917340262b6243b06022fe96cc1e96625cac9$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6aacf410858db1defe08179c985f4466fca2751f$
+// $hash=aa0f3c0f4378474dbd62f65751378c4402bd591c$
//
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f3c4158147b008b8fff038ff6f731419a9950c4d$
+// $hash=971a30d8a2814ecdddb08763016621ce94b9da92$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ca187683ddab3822fcf3d957c76ed27db6e8e433$
+// $hash=06ef08d535f3cc8b9ac7da2cb38711b01c58ca8e$
//
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2e2a98039972801804b3b4d7b1d1220406489ad3$
+// $hash=a083f0198c6c93ee0fccdb262dce8dc567abbf9c$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5e599a9605e47372695d89a86eab37827e5971f2$
+// $hash=ed0f0c476f97fffa6f0b29c005508b475268f4c2$
//
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h"
@@ -18,10 +18,9 @@
// STATIC METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefTranslatorTestRefPtrLibraryChildChild>
-CefTranslatorTestRefPtrLibraryChildChild::Create(int value,
- int other_value,
- int other_other_value) {
+CefRefPtr<
+ CefTranslatorTestRefPtrLibraryChildChild> CefTranslatorTestRefPtrLibraryChildChild::
+ Create(int value, int other_value, int other_other_value) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=32cd86770e8fac3498f23bff1a0efac7a875997e$
+// $hash=49af27e043172c178c3ef4f37805069e6af739e6$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8559b9fd1e73bb91333d687174f5730e67f1f0f2$
+// $hash=f6e8f53e06ca266f08582a01a75da91669335bb4$
//
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h"
@@ -19,8 +19,9 @@
// STATIC METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefTranslatorTestRefPtrLibraryChild>
-CefTranslatorTestRefPtrLibraryChild::Create(int value, int other_value) {
+CefRefPtr<
+ CefTranslatorTestRefPtrLibraryChild> CefTranslatorTestRefPtrLibraryChild::
+ Create(int value, int other_value) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9d4419c7bdfefd05f890a65b0660459aaf2d09b5$
+// $hash=ef77c876031b14fdee487305c5cfded6a9cb910f$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f320ce71f5396e28767dfdb2292c87a8c2396cf8$
+// $hash=9350838bdab0fb5944a83d88f3cdd07485934de3$
//
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h"
@@ -20,8 +20,8 @@
// STATIC METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefTranslatorTestRefPtrLibrary>
-CefTranslatorTestRefPtrLibrary::Create(int value) {
+CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestRefPtrLibrary::
+ Create(int value) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=231daa6fa72550190c115cce1bd560cb6c1bff3d$
+// $hash=9fa8897ee5081b7cd95a6cb791fb69871f61406e$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fa5ba1bf14400032e49a447b7fe9dbe9cf1ba397$
+// $hash=80f2c8ea70fc27532676263174c3bb9dab73cd7f$
//
#include "libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4ab24d3002067939ef0106a8686ca59559b2270e$
+// $hash=ec4bff6137c66581b34dc2ef11beb02276de163a$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=64d48341c3629153282b16d20e858e8166f6dbbd$
+// $hash=d4be1c7299a237b9c5fc3ef0629e4fc502bd94d5$
//
#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d0a9d6ca17834c09fbd63e06ebb38c337dc64f62$
+// $hash=d511f3a8273e4d9c6acff3d183b7bfa84e1385e3$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=2663f92f7373738d13ee8d194684e6f818afa950$
+// $hash=48599a7413e48d0e2f053aa6fdfdec866387e149$
//
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h"
@@ -17,10 +17,9 @@
// STATIC METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
-CefOwnPtr<CefTranslatorTestScopedLibraryChildChild>
-CefTranslatorTestScopedLibraryChildChild::Create(int value,
- int other_value,
- int other_other_value) {
+CefOwnPtr<
+ CefTranslatorTestScopedLibraryChildChild> CefTranslatorTestScopedLibraryChildChild::
+ Create(int value, int other_value, int other_other_value) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d430f8b9888494995d534bac8a61d809acb5fde7$
+// $hash=b6fc182f3444ce3926bff6d2b30d14aeca4cb9ba$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=cf0153094b5c99af0d2ff0f278da810e13a6d889$
+// $hash=b591e72d8eb23b5ed62a7d877e5a498211fd029f$
//
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h"
@@ -18,8 +18,9 @@
// STATIC METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
-CefOwnPtr<CefTranslatorTestScopedLibraryChild>
-CefTranslatorTestScopedLibraryChild::Create(int value, int other_value) {
+CefOwnPtr<
+ CefTranslatorTestScopedLibraryChild> CefTranslatorTestScopedLibraryChild::
+ Create(int value, int other_value) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=76f7b6c6e70c1a0e516bb840287553e4163866b7$
+// $hash=954fc390e3b474eedcf0bbb3df41e717c00449d3$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a3fd73f0bc089be47e4ebaf9db033d51bebe1498$
+// $hash=75d382a064212122a7aba39519a9ab4bf8e36160$
//
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h"
@@ -19,8 +19,8 @@
// STATIC METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
-CefOwnPtr<CefTranslatorTestScopedLibrary>
-CefTranslatorTestScopedLibrary::Create(int value) {
+CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestScopedLibrary::
+ Create(int value) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0c47852a4585753b8775a38b380be6f38fe45027$
+// $hash=5fafb4986f557d448f6f234fd49ea899eac81af1$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=207fe292d5fec167e20971c9948d0b183e6b3b20$
+// $hash=20ac33e64e1f0d3ada4403665da43b34c2ae635d$
//
#include "libcef_dll/ctocpp/thread_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=44235fe8d735fdbbb7482c647f7779247f43a2f5$
+// $hash=63729fa2f06672498bde63eaa8151b20db9e6fd8$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_THREAD_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=54962c13fcad1a38aaad37a7dae6744090ebee97$
+// $hash=aff88b737847eb0217c13f396e450ce68c554bb7$
//
#include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=31b2f537bea0b8088a861224b42c313ee87927d6$
+// $hash=50740eddae0ae234cf24d2b73eadcfdb16fcf0f0$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CLIENT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d3d0a83754df9a39d8f951ea488dd5417d20e9b2$
+// $hash=eb0b6de22dac921f6fc10121ca33f3dd31ddf6c9$
//
#include "libcef_dll/ctocpp/urlrequest_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=896c3b5eea61c12c9101ddc5795ed63125ec3445$
+// $hash=8c953a3dd5cdec5cba6160e848884c2f7c9b3ac6$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c2815712e9960e6850bb646ba0009fe42e8a2624$
+// $hash=5bcd3bf00cfea75a32f61b539fd3232a87b0ccdc$
//
#include "libcef_dll/ctocpp/v8accessor_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0c7b83fe013c87d35cf3c944e53ec7afef0ac11a$
+// $hash=1d8a3afd0e6a0344a9c5f6e301b517e5f906c186$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8ACCESSOR_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=04697e01edeb16ce60053867fa2b11d03dec3427$
+// $hash=517e771ec058ffae390f595c0d6d0ff96a24a061$
//
#include "libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e494919a69c37ed2aa5dcd0f8ddfcbbdafba2ebb$
+// $hash=4f9c4bb702d2824ee94dd334244cd9ba14609025$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8ARRAY_BUFFER_RELEASE_CALLBACK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8d8c4cf20f877a5eb60b47fb55d938940bb10c82$
+// $hash=ff70a3aece6add8f9947070688135e60258a1f9c$
//
#include "libcef_dll/ctocpp/v8context_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b3339627f92d31a68d36574fdd7c85db0842ea63$
+// $hash=c5159f67aa8d77aca23153cf6c35468af27dba14$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=49589f2e4ad8e5598df9411f613dd717fe6a3852$
+// $hash=d3a5834490a381e43d7e56469d850a0dd83b0876$
//
#include "libcef_dll/ctocpp/v8exception_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4292e466b2740037ad1ce26147fef3138e8d34aa$
+// $hash=ed15db160fa19964fe5c9902c279fa1b44bd0dbe$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=365e5e2b4e3ced4e615fa504a0cb68c66854fc37$
+// $hash=da3489ef2967a060306d913e06e63759eb7e08d9$
//
#include "libcef_dll/ctocpp/v8handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0207510d301deece41373f5693eaed1a8fd185b8$
+// $hash=442444a8b361b3ce3f599181fe8057d175e1cc20$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d466cd3a17a35074eedcb222b9acd2063c297fe2$
+// $hash=12c8d274bc607478d378c501c4c28d6bf61af93b$
//
#include "libcef_dll/ctocpp/v8interceptor_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=301ccb6fb65513bc2e6197c7fa1712c5e33f2bcf$
+// $hash=11fbbb5b1de3f96d332ec3653780826677ffcdf2$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8INTERCEPTOR_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5dad5940fbf85e63683112a937d47dbe52f1b64a$
+// $hash=4b7b77ed27848ada4ef09c9a372d42972e179930$
//
#include "libcef_dll/ctocpp/v8stack_frame_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e088f626fec9b9848e532d704c34ceabb46df3be$
+// $hash=366d110fdfaf3d241c26e9ec276f7c363ecd313f$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8STACK_FRAME_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=bf78c133604e1535633ac8c93ca153bcefe2718d$
+// $hash=2bd6f8998f43d4212da6b28ac4863763087310ce$
//
#include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f2f275b83841463cf102c60380e2b0561f3a749c$
+// $hash=361eefa5a258faf92d09e28787293fa29bbed742$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8STACK_TRACE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7863f5701d466f8d5a5c91962e14b14b500315a3$
+// $hash=44cb0b037d9dab3bf00531c0bd6e88feb41c6416$
//
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
@@ -847,8 +847,8 @@ NO_SANITIZE("cfi-icall") int CefV8ValueCToCpp::GetArrayLength() {
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefV8ArrayBufferReleaseCallback>
-CefV8ValueCToCpp::GetArrayBufferReleaseCallback() {
+CefRefPtr<CefV8ArrayBufferReleaseCallback> CefV8ValueCToCpp::
+ GetArrayBufferReleaseCallback() {
cef_v8value_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_array_buffer_release_callback))
return nullptr;
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=c9725eb41d50cd0bdbe6f84280e0ed7b62012136$
+// $hash=c8329f6a0ffd01d3e0e3fcb3e07913ac355a508d$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9f75af2c3d5e4411027b6f26bcc0d31728baed34$
+// $hash=8ef5da831e8fef358361365f434a5719a0829c08$
//
#include "libcef_dll/ctocpp/value_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4fbbd168e0d26ec54abf2e46808ab98da1900f5c$
+// $hash=80621c9fcd1e112984ddb490da40034e9731d530$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VALUE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=40ce0ebcedcd5995a5a3147049e5b34c016b8519$
+// $hash=af4061bbf8813e143420ebc4a45b81e43acc6803$
//
#include "libcef_dll/ctocpp/views/box_layout_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0d208d785b4fa84ba2e9f8245911d1a47f5e206c$
+// $hash=c14b6372ec4705cdcbcebc6d7367fe0c3c544001$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BOX_LAYOUT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d7787cf791b4b19620257f295112feb3d3c40f24$
+// $hash=fcf1f54e5758c61ccbaea88fc133c88755915eaa$
//
#include "libcef_dll/ctocpp/views/browser_view_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8744854c12c6ea110a5a6eb4f15ccd5b5867c1d1$
+// $hash=3369ae36dfebd0283661566cf91fa57dbfec29e4$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=379974b466cf5b511906b6492c7fa594a26e4d33$
+// $hash=cef68f9f361591f91495436c08d0f5e07738a594$
//
#include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h"
@@ -75,12 +75,11 @@ void CefBrowserViewDelegateCToCpp::OnBrowserDestroyed(
}
NO_SANITIZE("cfi-icall")
-CefRefPtr<CefBrowserViewDelegate>
-CefBrowserViewDelegateCToCpp::GetDelegateForPopupBrowserView(
- CefRefPtr<CefBrowserView> browser_view,
- const CefBrowserSettings& settings,
- CefRefPtr<CefClient> client,
- bool is_devtools) {
+CefRefPtr<CefBrowserViewDelegate> CefBrowserViewDelegateCToCpp::
+ GetDelegateForPopupBrowserView(CefRefPtr<CefBrowserView> browser_view,
+ const CefBrowserSettings& settings,
+ CefRefPtr<CefClient> client,
+ bool is_devtools) {
shutdown_checker::AssertNotShutdown();
cef_browser_view_delegate_t* _struct = GetStruct();
@@ -141,7 +140,7 @@ bool CefBrowserViewDelegateCToCpp::OnPopupBrowserViewCreated(
NO_SANITIZE("cfi-icall")
CefBrowserViewDelegate::ChromeToolbarType
-CefBrowserViewDelegateCToCpp::GetChromeToolbarType() {
+ CefBrowserViewDelegateCToCpp::GetChromeToolbarType() {
shutdown_checker::AssertNotShutdown();
cef_browser_view_delegate_t* _struct = GetStruct();
@@ -158,8 +157,8 @@ CefBrowserViewDelegateCToCpp::GetChromeToolbarType() {
}
NO_SANITIZE("cfi-icall")
-CefSize CefBrowserViewDelegateCToCpp::GetPreferredSize(
- CefRefPtr<CefView> view) {
+CefSize
+ CefBrowserViewDelegateCToCpp::GetPreferredSize(CefRefPtr<CefView> view) {
shutdown_checker::AssertNotShutdown();
cef_view_delegate_t* _struct =
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5aabb450064c183478e8cbcd7b96a9d308bc5c59$
+// $hash=ae219b09b69d7a49f48878a5d2f94b25c9b4150b$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9b1509d1105e3075a13563aa5e892833abcda54a$
+// $hash=b36bf494f49f9a3e0af4388a2c9121c6647b847e$
//
#include "libcef_dll/ctocpp/views/button_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b09c6865b321dbc52440a306dabdf0357bf41a12$
+// $hash=d6be48f8326ec9e541ace36d0b467cf6b1fbc065$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e7844e97f29fe0bcda8380932ceaa7581539d0e3$
+// $hash=5466f1b16dbdad0fc520275d84d73310bf31e963$
//
#include "libcef_dll/ctocpp/views/button_delegate_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3c5fbabd7adf7390101cc03058bdcac3077c26c8$
+// $hash=13140a32b465eaf52f13693cd244a9b47eda5068$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_DELEGATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ba41b36a0cdd335f2a964665576aaf50d8be9c55$
+// $hash=accae5014ef5a4a426a88ae7bed580523b9f336c$
//
#include "libcef_dll/ctocpp/views/display_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=adc1770d93c4e52a56e98f105877cbad5c76194a$
+// $hash=a05d5f989630c0c031cbe9cc04150a6e1e54c4d4$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_DISPLAY_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=dafea3abdc32cc7dd8552bbdf5bd2bb32e816c5f$
+// $hash=ef008b233715e98fdf22b4bf4ca1017f010eff85$
//
#include "libcef_dll/ctocpp/views/fill_layout_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=effe4fbabbcfadf905b0161c564956213ee435e5$
+// $hash=5d52b0af136f7ac008cb89a29ce65942932b9f64$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_FILL_LAYOUT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f9884f731b221f0c84234fd775cd480ab9ae9869$
+// $hash=64550f9a864524533748f687a69fc0511096fc3a$
//
#include "libcef_dll/ctocpp/views/label_button_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=db354914ca0dfe61f4adcc196c25c38b2ad13239$
+// $hash=e54619e16a7a8f21cdeeb4ddfcedf3504c258d35$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_LABEL_BUTTON_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6607a4c252dafd39ba695b5d4ecfb14286d70672$
+// $hash=3d1194096844ca83c22e87918069ece5d50385ee$
//
#include "libcef_dll/ctocpp/views/layout_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=383da9e4acb10aa03e8e250505cae2738bbe7fec$
+// $hash=f50cae9c7f44f282497cff43e8b89fc76f60e51b$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_LAYOUT_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6821e9d7130f828fba356cd7a7980f638c8ecf3e$
+// $hash=69ea7e37a9c8d66f5347571ae8064ccc15c20d2d$
//
#include "libcef_dll/ctocpp/views/menu_button_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=41f123659afc521684bb6b273ab831944efc4611$
+// $hash=0323c84d6099ab582a71a40f8065013cecc126cd$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=795437425153e56d1c82e30510922399fef0c673$
+// $hash=0bf2d621b4aa5a6dbb14596ddded68005327afa7$
//
#include "libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7f1b296579f263cdcb5ac00105e53c32e2d89f4c$
+// $hash=962c2d2bc800670d19838fa2a34ab4faa8203531$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_DELEGATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=684914b489c5d322b41d61d46f5d387675da2c30$
+// $hash=52df98f1359e9a8e231ec9e2555bc883e1fa84b5$
//
#include "libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ea81c8b651b803c0d78b06a850c409da3e632b44$
+// $hash=8c0bc19bcd5b9f53b0ee556fb0117e9a6115eb7f$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_PRESSED_LOCK_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=60978f71bb9089d32a89bed17af584bd83a4678d$
+// $hash=2c07307d7ad63e5a1bc7a223f8135f01d2d967a8$
//
#include "libcef_dll/ctocpp/views/overlay_controller_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7e1c98d4417c831dc850f36bc6ac20d95cd03dab$
+// $hash=a8dd9d8eb796f499231143866c2d8f45e9b25d0c$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_OVERLAY_CONTROLLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7989301b819a52e8c965774e5c073d5c480a599b$
+// $hash=a96ee723ef03fc68ba5be2ca18eb9865ad7af01d$
//
#include "libcef_dll/ctocpp/views/panel_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=409d4b16fb5d1dcc66c8553ed2fdd8b6465c8664$
+// $hash=c0c4823d1084bd1ea4f2065e93b51a56718bed87$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=ed477592fb540c789eef4309e7af5f40319bc4b9$
+// $hash=fd199dc9e98a7880b1f5c057bb0f16934809223d$
//
#include "libcef_dll/ctocpp/views/panel_delegate_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=0a0bf21c7be5169ab5ba891ba25b7b78b317e9aa$
+// $hash=dcad633b9f91da4e5b08cfa8be122b6797211b46$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_DELEGATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=177ae72af2cb2658ab48041dfefde9f492e4a5d5$
+// $hash=0d4d7202f3053150bfee7380d3dbc9ef596683f9$
//
#include "libcef_dll/ctocpp/views/scroll_view_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6160a050b665423f41dfea54b38fade96dc2031f$
+// $hash=3a3c2eee1765f8a1d86044eadc75eca9c6fae25f$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_SCROLL_VIEW_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=3268a6e6475c3fbddcf6c83016ca3aae1d4a7c4c$
+// $hash=be5f51e38820266a08248e602443902b3e2e3d78$
//
#include "libcef_dll/ctocpp/views/textfield_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=d96b3c829c698c7919bcaa4dd9b4f94d8800e6dc$
+// $hash=cdc3237fbd889409f8e9aa2116689a3e1c1229c7$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a7787d39e5f102f937542ace81de0277affab1a4$
+// $hash=a449fb206fdd029cb72f6ad02b87b6285a5b8e1f$
//
#include "libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=63cc6f84be6ad62ccba2b91cc6159275e1cd7dd8$
+// $hash=65dedd950d154a0125b094bb1488e787726545cb$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_DELEGATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=61c3b208f3a1907b483198a0a62ae9b45d9e56a3$
+// $hash=b4edd50d32a796ff0b2eb2a735e2ce2c9ff6e147$
//
#include "libcef_dll/ctocpp/views/view_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=8f99bf38ab96b2ffa22f43891d01c61f73aafaf3$
+// $hash=5af9a065bd30e46fad816250442dd6b3d31834fd$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=394bf2a5f6f5898787c498b91bcf8375099eae47$
+// $hash=9a731e4edfb8ed9c3a03fa56597f02cae87c1972$
//
#include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9202d1b2cd26906df4c5574f9f3a1c662ab2e82f$
+// $hash=c433d8e9462e7a948338bfe9192f247fdc253614$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_DELEGATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=a71d84e671749331e5ad99c84ef790f09613b145$
+// $hash=a4c6dd54b71d800640730d4bc5d643c4293d783d$
//
#include "libcef_dll/ctocpp/views/window_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5afd032b23745d114bc95d45139cf5d92a82f89a$
+// $hash=a16d73107ffbbcdb06153c0bfcc5e4ac43bbadb0$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=557b305c33b5975b197bf930cc223f76b3032288$
+// $hash=675b3f340d14d93d1de6b340c862bdce4893a067$
//
#include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h"
@@ -128,8 +128,8 @@ CefRect CefWindowDelegateCToCpp::GetInitialBounds(CefRefPtr<CefWindow> window) {
}
NO_SANITIZE("cfi-icall")
-cef_show_state_t CefWindowDelegateCToCpp::GetInitialShowState(
- CefRefPtr<CefWindow> window) {
+cef_show_state_t
+ CefWindowDelegateCToCpp::GetInitialShowState(CefRefPtr<CefWindow> window) {
shutdown_checker::AssertNotShutdown();
cef_window_delegate_t* _struct = GetStruct();
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=e61d67d8295c9fcc3e801bf61f4381434924940c$
+// $hash=0cf526c263eb14e6cc17a0664ffe57ca476c4e81$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4d16f6afcc06cee186ba3aa5752dc5933e6b57f4$
+// $hash=f090fd5026cecf6e847f27909418f1dd76fec64f$
//
#include "libcef_dll/ctocpp/waitable_event_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=519f7aab2913629ad5ac8ebcf228abd14b816ade$
+// $hash=ea92b8c5871694e9c32c29a5d554774afe7aa3dd$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_WAITABLE_EVENT_CTOCPP_H_
new file mode 100644
@@ -0,0 +1,64 @@
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool. If making changes by
+// hand only do so within the body of existing method and function
+// implementations. See the translator.README.txt file in the tools directory
+// for more information.
+//
+// $hash=d9376a2376082b68ec98decd89eb8100fdf7093c$
+//
+
+#include "libcef_dll/ctocpp/web_message_receiver_ctocpp.h"
+#include "libcef_dll/cpptoc/value_cpptoc.h"
+#include "libcef_dll/shutdown_checker.h"
+
+// VIRTUAL METHODS - Body may be edited by hand.
+
+NO_SANITIZE("cfi-icall")
+void CefWebMessageReceiverCToCpp::OnMessage(CefRefPtr<CefValue> message) {
+ shutdown_checker::AssertNotShutdown();
+
+ cef_web_message_receiver_t* _struct = GetStruct();
+ if (CEF_MEMBER_MISSING(_struct, on_message))
+ return;
+
+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
+
+ // Verify param: message; type: refptr_diff
+ DCHECK(message.get());
+ if (!message.get())
+ return;
+
+ // Execute
+ _struct->on_message(_struct, CefValueCppToC::Wrap(message));
+}
+
+// CONSTRUCTOR - Do not edit by hand.
+
+CefWebMessageReceiverCToCpp::CefWebMessageReceiverCToCpp() {}
+
+// DESTRUCTOR - Do not edit by hand.
+
+CefWebMessageReceiverCToCpp::~CefWebMessageReceiverCToCpp() {
+ shutdown_checker::AssertNotShutdown();
+}
+
+template <>
+cef_web_message_receiver_t* CefCToCppRefCounted<
+ CefWebMessageReceiverCToCpp,
+ CefWebMessageReceiver,
+ cef_web_message_receiver_t>::UnwrapDerived(CefWrapperType type,
+ CefWebMessageReceiver* c) {
+ NOTREACHED() << "Unexpected class type: " << type;
+ return nullptr;
+}
+
+template <>
+CefWrapperType CefCToCppRefCounted<CefWebMessageReceiverCToCpp,
+ CefWebMessageReceiver,
+ cef_web_message_receiver_t>::kWrapperType =
+ WT_WEB_MESSAGE_RECEIVER;
new file mode 100644
@@ -0,0 +1,43 @@
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+//
+// ---------------------------------------------------------------------------
+//
+// This file was generated by the CEF translator tool. If making changes by
+// hand only do so within the body of existing method and function
+// implementations. See the translator.README.txt file in the tools directory
+// for more information.
+//
+// $hash=89209c202ff223f2f20cb3490518bfaceda224ca$
+//
+
+#ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_MESSAGE_RECEIVER_CTOCPP_H_
+#define CEF_LIBCEF_DLL_CTOCPP_WEB_MESSAGE_RECEIVER_CTOCPP_H_
+#pragma once
+
+#if !defined(BUILDING_CEF_SHARED)
+#error This file can be included DLL-side only
+#endif
+
+#include "include/capi/cef_browser_capi.h"
+#include "include/capi/cef_client_capi.h"
+#include "include/cef_browser.h"
+#include "include/cef_client.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
+
+// Wrap a C structure with a C++ class.
+// This class may be instantiated and accessed DLL-side only.
+class CefWebMessageReceiverCToCpp
+ : public CefCToCppRefCounted<CefWebMessageReceiverCToCpp,
+ CefWebMessageReceiver,
+ cef_web_message_receiver_t> {
+ public:
+ CefWebMessageReceiverCToCpp();
+ virtual ~CefWebMessageReceiverCToCpp();
+
+ // CefWebMessageReceiver methods.
+ void OnMessage(CefRefPtr<CefValue> message) override;
+};
+
+#endif // CEF_LIBCEF_DLL_CTOCPP_WEB_MESSAGE_RECEIVER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=4b81eb5261e185b3360dd7de90e5f97dcb6aef86$
+// $hash=c0cf10fdd538681da58a94edcfce6bc4e093df52$
//
#include "libcef_dll/ctocpp/web_storage_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=444c0aee423697f9d2747ae46d11d9f28ad01b3d$
+// $hash=f01cdd91598d151bee833a80f50f550adda82d37$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_STORAGE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=728e5a2aa03b7884d5001f784dcf6bc6fb79254a$
+// $hash=511240eb698a1c0d5f0f75884aaad8658e5a4987$
//
#include "libcef_dll/ctocpp/write_handler_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f6c9ec7aa1916be4cc120149c9e174751fc3ea77$
+// $hash=56728a12a3e14ab71d1dee991a7912d5d3c111f6$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_WRITE_HANDLER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1799aec02f9d2491056fbf3042b4ba89498adaf4$
+// $hash=43754e6fc947d6f008c9471a7a86218fafa84c82$
//
#include "libcef_dll/ctocpp/x509cert_principal_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=5462ba22f05a8e8a05aac6cac9d23004767049db$
+// $hash=26c06425ee3d75470177631cff1348e5dc26f946$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_X509CERT_PRINCIPAL_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=b5ab278c54b7ed9046b43a7f362a18ebc8bde146$
+// $hash=db3bb173e77431908f255b12791ced7ecf80bd14$
//
#include "libcef_dll/ctocpp/x509certificate_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=eb95efa4bb7e2ca0696f86390fa32f269eedf9f3$
+// $hash=b4c1192c28884415b9f175cde389237b9c8d33da$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_X509CERTIFICATE_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=9fc59c7d9a9acbf92fde0cfceda151c4936c136b$
+// $hash=e5e2325d96c340e29a99e622df97eb792a5dd776$
//
#include "libcef_dll/ctocpp/xml_reader_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=1f6c29938591312a257cfe1b77de830c90b4a6c3$
+// $hash=5f87c82093a6a16e03df00673d2ff20a9f0490d5$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=f01ac0e38723b8786f115a14dbca8d4d3d1a57bf$
+// $hash=221ec55fd792b8af2ce239763e909b9c61584a5a$
//
#include "libcef_dll/ctocpp/zip_reader_ctocpp.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=995930b1262a99fb14a57dc0af908d292434e00b$
+// $hash=ac375946e782fc0665bfd75850bd1f3ce388f186$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=fa04fba704658b02675380bd63d91005c6757d4e$
+// $hash=b4f718eaa15556b762af4f0e6dbc1b55c8e2d83f$
//
#include "include/capi/cef_app_capi.h"
@@ -25,7 +25,6 @@
#include "include/capi/cef_task_capi.h"
#include "include/capi/cef_trace_capi.h"
#include "include/capi/cef_v8_capi.h"
-#include "include/capi/cef_web_plugin_capi.h"
#include "include/capi/test/cef_test_helpers_capi.h"
#include "include/cef_app.h"
#include "include/cef_crash_util.h"
@@ -40,7 +39,6 @@
#include "include/cef_task.h"
#include "include/cef_trace.h"
#include "include/cef_v8.h"
-#include "include/cef_web_plugin.h"
#include "include/test/cef_test_helpers.h"
#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
#include "libcef_dll/cpptoc/command_line_cpptoc.h"
@@ -52,8 +50,6 @@
#include "libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h"
#include "libcef_dll/ctocpp/task_ctocpp.h"
#include "libcef_dll/ctocpp/v8handler_ctocpp.h"
-#include "libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h"
-#include "libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
#include "libcef_dll/transfer_util.h"
@@ -840,69 +836,6 @@ CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name,
return _retval;
}
-CEF_EXPORT void cef_visit_web_plugin_info(
- struct _cef_web_plugin_info_visitor_t* visitor) {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Verify param: visitor; type: refptr_diff
- DCHECK(visitor);
- if (!visitor)
- return;
-
- // Execute
- CefVisitWebPluginInfo(CefWebPluginInfoVisitorCToCpp::Wrap(visitor));
-}
-
-CEF_EXPORT void cef_refresh_web_plugins() {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Execute
- CefRefreshWebPlugins();
-}
-
-CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path) {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Verify param: path; type: string_byref_const
- DCHECK(path);
- if (!path)
- return;
-
- // Execute
- CefUnregisterInternalWebPlugin(CefString(path));
-}
-
-CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path) {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Verify param: path; type: string_byref_const
- DCHECK(path);
- if (!path)
- return;
-
- // Execute
- CefRegisterWebPluginCrash(CefString(path));
-}
-
-CEF_EXPORT void cef_is_web_plugin_unstable(
- const cef_string_t* path,
- struct _cef_web_plugin_unstable_callback_t* callback) {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Verify param: path; type: string_byref_const
- DCHECK(path);
- if (!path)
- return;
- // Verify param: callback; type: refptr_diff
- DCHECK(callback);
- if (!callback)
- return;
-
- // Execute
- CefIsWebPluginUnstable(CefString(path),
- CefWebPluginUnstableCallbackCToCpp::Wrap(callback));
-}
-
CEF_EXPORT void cef_execute_java_script_with_user_gesture_for_tests(
struct _cef_frame_t* frame,
const cef_string_t* javascript) {
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=892496158fbb51c0534dfbdfd4597daef6b21da7$
+// $hash=4e28ddb86e7157c4f04b43c02080c12b0001c6e0$
//
#include "include/views/cef_browser_view.h"
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=7185f14aad39a002663816fe05a4990f76d8ad6f$
+// $hash=577c6334f41f1be591969c7789081b002e86b91c$
//
#include <dlfcn.h>
@@ -26,7 +26,6 @@
#include "include/capi/cef_file_util_capi.h"
#include "include/capi/cef_i18n_util_capi.h"
#include "include/capi/cef_image_capi.h"
-#include "include/capi/cef_media_router_capi.h"
#include "include/capi/cef_menu_model_capi.h"
#include "include/capi/cef_origin_whitelist_capi.h"
#include "include/capi/cef_parser_capi.h"
@@ -49,7 +48,6 @@
#include "include/capi/cef_v8_capi.h"
#include "include/capi/cef_values_capi.h"
#include "include/capi/cef_waitable_event_capi.h"
-#include "include/capi/cef_web_plugin_capi.h"
#include "include/capi/cef_web_storage_capi.h"
#include "include/capi/cef_xml_reader_capi.h"
#include "include/capi/cef_zip_reader_capi.h"
@@ -173,14 +171,6 @@ typedef int64 (*cef_now_from_system_trace_time_ptr)();
typedef int (*cef_register_extension_ptr)(const cef_string_t*,
const cef_string_t*,
struct _cef_v8handler_t*);
-typedef void (*cef_visit_web_plugin_info_ptr)(
- struct _cef_web_plugin_info_visitor_t*);
-typedef void (*cef_refresh_web_plugins_ptr)();
-typedef void (*cef_unregister_internal_web_plugin_ptr)(const cef_string_t*);
-typedef void (*cef_register_web_plugin_crash_ptr)(const cef_string_t*);
-typedef void (*cef_is_web_plugin_unstable_ptr)(
- const cef_string_t*,
- struct _cef_web_plugin_unstable_callback_t*);
typedef void (*cef_execute_java_script_with_user_gesture_for_tests_ptr)(
struct _cef_frame_t*,
const cef_string_t*);
@@ -209,8 +199,6 @@ typedef int (*cef_cookie_manager_create_cef_cookie_ptr)(const cef_string_t*,
typedef struct _cef_data_base_t* (*cef_data_base_get_global_ptr)();
typedef struct _cef_drag_data_t* (*cef_drag_data_create_ptr)();
typedef struct _cef_image_t* (*cef_image_create_ptr)();
-typedef struct _cef_media_router_t* (*cef_media_router_get_global_ptr)(
- struct _cef_completion_callback_t*);
typedef struct _cef_menu_model_t* (*cef_menu_model_create_ptr)(
struct _cef_menu_model_delegate_t*);
typedef struct _cef_print_settings_t* (*cef_print_settings_create_ptr)();
@@ -573,11 +561,6 @@ struct libcef_pointers {
cef_end_tracing_ptr cef_end_tracing;
cef_now_from_system_trace_time_ptr cef_now_from_system_trace_time;
cef_register_extension_ptr cef_register_extension;
- cef_visit_web_plugin_info_ptr cef_visit_web_plugin_info;
- cef_refresh_web_plugins_ptr cef_refresh_web_plugins;
- cef_unregister_internal_web_plugin_ptr cef_unregister_internal_web_plugin;
- cef_register_web_plugin_crash_ptr cef_register_web_plugin_crash;
- cef_is_web_plugin_unstable_ptr cef_is_web_plugin_unstable;
cef_execute_java_script_with_user_gesture_for_tests_ptr
cef_execute_java_script_with_user_gesture_for_tests;
cef_browser_host_create_browser_ptr cef_browser_host_create_browser;
@@ -590,7 +573,6 @@ struct libcef_pointers {
cef_data_base_get_global_ptr cef_data_base_get_global;
cef_drag_data_create_ptr cef_drag_data_create;
cef_image_create_ptr cef_image_create;
- cef_media_router_get_global_ptr cef_media_router_get_global;
cef_menu_model_create_ptr cef_menu_model_create;
cef_print_settings_create_ptr cef_print_settings_create;
cef_process_message_create_ptr cef_process_message_create;
@@ -793,11 +775,6 @@ int libcef_init_pointers(const char* path) {
INIT_ENTRY(cef_end_tracing);
INIT_ENTRY(cef_now_from_system_trace_time);
INIT_ENTRY(cef_register_extension);
- INIT_ENTRY(cef_visit_web_plugin_info);
- INIT_ENTRY(cef_refresh_web_plugins);
- INIT_ENTRY(cef_unregister_internal_web_plugin);
- INIT_ENTRY(cef_register_web_plugin_crash);
- INIT_ENTRY(cef_is_web_plugin_unstable);
INIT_ENTRY(cef_execute_java_script_with_user_gesture_for_tests);
INIT_ENTRY(cef_browser_host_create_browser);
INIT_ENTRY(cef_browser_host_create_browser_sync);
@@ -808,7 +785,6 @@ int libcef_init_pointers(const char* path) {
INIT_ENTRY(cef_data_base_get_global);
INIT_ENTRY(cef_drag_data_create);
INIT_ENTRY(cef_image_create);
- INIT_ENTRY(cef_media_router_get_global);
INIT_ENTRY(cef_menu_model_create);
INIT_ENTRY(cef_print_settings_create);
INIT_ENTRY(cef_process_message_create);
@@ -1112,8 +1088,8 @@ int cef_create_url(const struct _cef_urlparts_t* parts, cef_string_t* url) {
}
NO_SANITIZE("cfi-icall")
-cef_string_userfree_t cef_format_url_for_security_display(
- const cef_string_t* origin_url) {
+cef_string_userfree_t
+ cef_format_url_for_security_display(const cef_string_t* origin_url) {
return g_libcef_pointers.cef_format_url_for_security_display(origin_url);
}
@@ -1246,32 +1222,6 @@ int cef_register_extension(const cef_string_t* extension_name,
javascript_code, handler);
}
-NO_SANITIZE("cfi-icall")
-void cef_visit_web_plugin_info(struct _cef_web_plugin_info_visitor_t* visitor) {
- g_libcef_pointers.cef_visit_web_plugin_info(visitor);
-}
-
-NO_SANITIZE("cfi-icall") void cef_refresh_web_plugins() {
- g_libcef_pointers.cef_refresh_web_plugins();
-}
-
-NO_SANITIZE("cfi-icall")
-void cef_unregister_internal_web_plugin(const cef_string_t* path) {
- g_libcef_pointers.cef_unregister_internal_web_plugin(path);
-}
-
-NO_SANITIZE("cfi-icall")
-void cef_register_web_plugin_crash(const cef_string_t* path) {
- g_libcef_pointers.cef_register_web_plugin_crash(path);
-}
-
-NO_SANITIZE("cfi-icall")
-void cef_is_web_plugin_unstable(
- const cef_string_t* path,
- struct _cef_web_plugin_unstable_callback_t* callback) {
- g_libcef_pointers.cef_is_web_plugin_unstable(path, callback);
-}
-
NO_SANITIZE("cfi-icall")
void cef_execute_java_script_with_user_gesture_for_tests(
struct _cef_frame_t* frame,
@@ -1339,12 +1289,6 @@ NO_SANITIZE("cfi-icall") struct _cef_image_t* cef_image_create() {
return g_libcef_pointers.cef_image_create();
}
-NO_SANITIZE("cfi-icall")
-struct _cef_media_router_t* cef_media_router_get_global(
- struct _cef_completion_callback_t* callback) {
- return g_libcef_pointers.cef_media_router_get_global(callback);
-}
-
NO_SANITIZE("cfi-icall")
struct _cef_menu_model_t* cef_menu_model_create(
struct _cef_menu_model_delegate_t* delegate) {
@@ -1611,46 +1555,54 @@ struct _cef_translator_test_t* cef_translator_test_create() {
}
NO_SANITIZE("cfi-icall")
-struct _cef_translator_test_ref_ptr_library_t*
-cef_translator_test_ref_ptr_library_create(int value) {
+struct
+ _cef_translator_test_ref_ptr_library_t* cef_translator_test_ref_ptr_library_create(
+ int value) {
return g_libcef_pointers.cef_translator_test_ref_ptr_library_create(value);
}
NO_SANITIZE("cfi-icall")
-struct _cef_translator_test_ref_ptr_library_child_t*
-cef_translator_test_ref_ptr_library_child_create(int value, int other_value) {
+struct
+ _cef_translator_test_ref_ptr_library_child_t* cef_translator_test_ref_ptr_library_child_create(
+ int value,
+ int other_value) {
return g_libcef_pointers.cef_translator_test_ref_ptr_library_child_create(
value, other_value);
}
NO_SANITIZE("cfi-icall")
-struct _cef_translator_test_ref_ptr_library_child_child_t*
-cef_translator_test_ref_ptr_library_child_child_create(int value,
- int other_value,
- int other_other_value) {
+struct
+ _cef_translator_test_ref_ptr_library_child_child_t* cef_translator_test_ref_ptr_library_child_child_create(
+ int value,
+ int other_value,
+ int other_other_value) {
return g_libcef_pointers
.cef_translator_test_ref_ptr_library_child_child_create(
value, other_value, other_other_value);
}
NO_SANITIZE("cfi-icall")
-struct _cef_translator_test_scoped_library_t*
-cef_translator_test_scoped_library_create(int value) {
+struct
+ _cef_translator_test_scoped_library_t* cef_translator_test_scoped_library_create(
+ int value) {
return g_libcef_pointers.cef_translator_test_scoped_library_create(value);
}
NO_SANITIZE("cfi-icall")
-struct _cef_translator_test_scoped_library_child_t*
-cef_translator_test_scoped_library_child_create(int value, int other_value) {
+struct
+ _cef_translator_test_scoped_library_child_t* cef_translator_test_scoped_library_child_create(
+ int value,
+ int other_value) {
return g_libcef_pointers.cef_translator_test_scoped_library_child_create(
value, other_value);
}
NO_SANITIZE("cfi-icall")
-struct _cef_translator_test_scoped_library_child_child_t*
-cef_translator_test_scoped_library_child_child_create(int value,
- int other_value,
- int other_other_value) {
+struct
+ _cef_translator_test_scoped_library_child_child_t* cef_translator_test_scoped_library_child_child_create(
+ int value,
+ int other_value,
+ int other_other_value) {
return g_libcef_pointers
.cef_translator_test_scoped_library_child_child_create(value, other_value,
other_other_value);
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=180ca5b8f789625a725e004aa6768fd5046a3753$
+// $hash=45e769535f300e227783606b108546a49d9aa953$
//
#include "include/capi/cef_app_capi.h"
@@ -25,7 +25,6 @@
#include "include/capi/cef_task_capi.h"
#include "include/capi/cef_trace_capi.h"
#include "include/capi/cef_v8_capi.h"
-#include "include/capi/cef_web_plugin_capi.h"
#include "include/capi/test/cef_test_helpers_capi.h"
#include "include/cef_api_hash.h"
#include "include/cef_app.h"
@@ -41,7 +40,6 @@
#include "include/cef_task.h"
#include "include/cef_trace.h"
#include "include/cef_v8.h"
-#include "include/cef_web_plugin.h"
#include "include/test/cef_test_helpers.h"
#include "libcef_dll/cpptoc/app_cpptoc.h"
#include "libcef_dll/cpptoc/completion_callback_cpptoc.h"
@@ -49,8 +47,6 @@
#include "libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h"
#include "libcef_dll/cpptoc/task_cpptoc.h"
#include "libcef_dll/cpptoc/v8handler_cpptoc.h"
-#include "libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h"
-#include "libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h"
#include "libcef_dll/ctocpp/binary_value_ctocpp.h"
#include "libcef_dll/ctocpp/command_line_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
@@ -168,7 +164,7 @@ NO_SANITIZE("cfi-icall") CEF_GLOBAL bool CefCrashReportingEnabled() {
NO_SANITIZE("cfi-icall")
CEF_GLOBAL
-void CefSetCrashKeyValue(const CefString& key, const CefString& value) {
+ void CefSetCrashKeyValue(const CefString& key, const CefString& value) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: key; type: string_byref_const
@@ -323,10 +319,10 @@ NO_SANITIZE("cfi-icall") CEF_GLOBAL bool CefIsRTL() {
NO_SANITIZE("cfi-icall")
CEF_GLOBAL
-bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
- const CefString& target_protocol,
- const CefString& target_domain,
- bool allow_target_subdomains) {
+ bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
+ const CefString& target_protocol,
+ const CefString& target_domain,
+ bool allow_target_subdomains) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: source_origin; type: string_byref_const
@@ -350,10 +346,10 @@ bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin,
NO_SANITIZE("cfi-icall")
CEF_GLOBAL
-bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin,
- const CefString& target_protocol,
- const CefString& target_domain,
- bool allow_target_subdomains) {
+ bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin,
+ const CefString& target_protocol,
+ const CefString& target_domain,
+ bool allow_target_subdomains) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: source_origin; type: string_byref_const
@@ -414,7 +410,7 @@ CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) {
NO_SANITIZE("cfi-icall")
CEF_GLOBAL CefString
-CefFormatUrlForSecurityDisplay(const CefString& origin_url) {
+ CefFormatUrlForSecurityDisplay(const CefString& origin_url) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: origin_url; type: string_byref_const
@@ -452,8 +448,8 @@ CEF_GLOBAL CefString CefGetMimeType(const CefString& extension) {
NO_SANITIZE("cfi-icall")
CEF_GLOBAL
-void CefGetExtensionsForMimeType(const CefString& mime_type,
- std::vector<CefString>& extensions) {
+ void CefGetExtensionsForMimeType(const CefString& mime_type,
+ std::vector<CefString>& extensions) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: mime_type; type: string_byref_const
@@ -607,8 +603,8 @@ CEF_GLOBAL CefRefPtr<CefValue> CefParseJSONAndReturnError(
}
NO_SANITIZE("cfi-icall")
-CEF_GLOBAL CefString CefWriteJSON(CefRefPtr<CefValue> node,
- cef_json_writer_options_t options) {
+CEF_GLOBAL CefString
+ CefWriteJSON(CefRefPtr<CefValue> node, cef_json_writer_options_t options) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: node; type: refptr_same
@@ -806,73 +802,6 @@ CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name,
return _retval ? true : false;
}
-NO_SANITIZE("cfi-icall")
-CEF_GLOBAL
-void CefVisitWebPluginInfo(CefRefPtr<CefWebPluginInfoVisitor> visitor) {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Verify param: visitor; type: refptr_diff
- DCHECK(visitor.get());
- if (!visitor.get())
- return;
-
- // Execute
- cef_visit_web_plugin_info(CefWebPluginInfoVisitorCppToC::Wrap(visitor));
-}
-
-NO_SANITIZE("cfi-icall") CEF_GLOBAL void CefRefreshWebPlugins() {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Execute
- cef_refresh_web_plugins();
-}
-
-NO_SANITIZE("cfi-icall")
-CEF_GLOBAL void CefUnregisterInternalWebPlugin(const CefString& path) {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Verify param: path; type: string_byref_const
- DCHECK(!path.empty());
- if (path.empty())
- return;
-
- // Execute
- cef_unregister_internal_web_plugin(path.GetStruct());
-}
-
-NO_SANITIZE("cfi-icall")
-CEF_GLOBAL void CefRegisterWebPluginCrash(const CefString& path) {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Verify param: path; type: string_byref_const
- DCHECK(!path.empty());
- if (path.empty())
- return;
-
- // Execute
- cef_register_web_plugin_crash(path.GetStruct());
-}
-
-NO_SANITIZE("cfi-icall")
-CEF_GLOBAL void CefIsWebPluginUnstable(
- const CefString& path,
- CefRefPtr<CefWebPluginUnstableCallback> callback) {
- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
-
- // Verify param: path; type: string_byref_const
- DCHECK(!path.empty());
- if (path.empty())
- return;
- // Verify param: callback; type: refptr_diff
- DCHECK(callback.get());
- if (!callback.get())
- return;
-
- // Execute
- cef_is_web_plugin_unstable(
- path.GetStruct(), CefWebPluginUnstableCallbackCppToC::Wrap(callback));
-}
-
NO_SANITIZE("cfi-icall")
CEF_GLOBAL void CefExecuteJavaScriptWithUserGestureForTests(
CefRefPtr<CefFrame> frame,
@@ -1,4 +1,4 @@
-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
-// $hash=6894c8a307f28f26de4baaf4f541637cef7c8d72$
+// $hash=dfb6a82e093895922f6f06700eb74d9d64493c24$
//
#ifndef CEF_LIBCEF_DLL_WRAPPER_TYPES_H_
@@ -84,13 +84,6 @@ enum CefWrapperType {
WT_LIFE_SPAN_HANDLER,
WT_LIST_VALUE,
WT_LOAD_HANDLER,
- WT_MEDIA_OBSERVER,
- WT_MEDIA_ROUTE,
- WT_MEDIA_ROUTE_CREATE_CALLBACK,
- WT_MEDIA_ROUTER,
- WT_MEDIA_SINK,
- WT_MEDIA_SINK_DEVICE_INFO_CALLBACK,
- WT_MEDIA_SOURCE,
WT_MENU_BUTTON,
WT_MENU_BUTTON_DELEGATE,
WT_MENU_BUTTON_PRESSED_LOCK,
@@ -136,6 +129,7 @@ enum CefWrapperType {
WT_SCHEME_REGISTRAR,
WT_SCROLL_VIEW,
WT_SELECT_CLIENT_CERTIFICATE_CALLBACK,
+ WT_SELECT_POPUP_CALLBACK,
WT_SERVER,
WT_SERVER_HANDLER,
WT_SET_COOKIE_CALLBACK,
@@ -174,9 +168,7 @@ enum CefWrapperType {
WT_VIEW,
WT_VIEW_DELEGATE,
WT_WAITABLE_EVENT,
- WT_WEB_PLUGIN_INFO,
- WT_WEB_PLUGIN_INFO_VISITOR,
- WT_WEB_PLUGIN_UNSTABLE_CALLBACK,
+ WT_WEB_MESSAGE_RECEIVER,
WT_WEB_STORAGE,
WT_WINDOW,
WT_WINDOW_DELEGATE,
@@ -406,7 +406,8 @@ _simpletypes = {
'CefDraggableRegion': ['cef_draggable_region_t', 'CefDraggableRegion()'],
'CefThreadId': ['cef_thread_id_t', 'TID_UI'],
'CefTime': ['cef_time_t', 'CefTime()'],
- 'CefAudioParameters': ['cef_audio_parameters_t', 'CefAudioParameters()']
+ 'CefAudioParameters': ['cef_audio_parameters_t', 'CefAudioParameters()'],
+ 'CefSelectPopupItem': ['cef_select_popup_item_t', 'CefSelectPopupItem()']
}
@@ -9,6 +9,10 @@
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#if BUILDFLAG(IS_OHOS)
+#include "media/media_buildflags.h"
+#endif
+
// This file lists all the command IDs understood by e.g. the browser.
// It is used by Windows RC files, Mac NIB files, and other platforms too.
@@ -105,7 +109,9 @@
#define IDC_SAVE_CREDIT_CARD_FOR_PAGE 35008
#define IDC_TRANSLATE_PAGE 35009
#define IDC_MANAGE_PASSWORDS_FOR_PAGE 35010
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
#define IDC_ROUTE_MEDIA 35011
+#endif
#define IDC_WINDOW_MUTE_SITE 35012
#define IDC_WINDOW_PIN_TAB 35013
#define IDC_WINDOW_GROUP_TAB 35014
@@ -2430,6 +2430,15 @@ static_library("browser") {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]
+ if (is_ohos && !ohos_enable_media_router) {
+ allow_circular_includes_from -= [ "//chrome/browser/media/router" ]
+ deps -= [
+ "//chrome/browser/media/router",
+ "//chrome/browser/media/router:media_router_feature",
+ "//chrome/browser/media/router/discovery/access_code:access_code_cast_feature",
+ ]
+ }
+
if (is_ohos && safe_browsing_mode == 0) {
deps -= [
"//chrome/browser/safe_browsing",
@@ -4571,6 +4580,12 @@ static_library("browser") {
"//chrome/browser/web_applications/app_service",
]
+ if (is_ohos && !ohos_enable_media_router) {
+ allow_circular_includes_from -=
+ [ "//chrome/browser/media/router/discovery:discovery" ]
+ deps -= [ "//chrome/browser/media/router/discovery:discovery" ]
+ }
+
if (!is_chromeos_ash) {
sources += [
"accessibility/soda_installer_impl.cc",
@@ -6215,7 +6230,7 @@ static_library("browser") {
]
}
- if (is_win || is_mac || is_linux || is_chromeos || is_fuchsia || is_ohos) {
+ if (is_win || is_mac || is_linux || is_chromeos || is_fuchsia) {
sources += [
"media/cast_mirroring_service_host.cc",
"media/cast_mirroring_service_host.h",
@@ -7986,7 +8001,7 @@ static_library("test_support") {
}
}
-if (!is_android) {
+if (!is_android && !is_ohos) {
static_library("test_support_ui") {
testonly = true
configs += [ "//build/config:precompiled_headers" ]
@@ -224,7 +224,9 @@
#include "components/power_scheduler/power_scheduler_features.h"
#include "components/webapps/browser/android/features.h"
#else // BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
#include "chrome/browser/media/router/media_router_feature.h"
+#endif
#include "chrome/browser/web_applications/preinstalled_app_install_features.h"
#endif // BUILDFLAG(IS_ANDROID)
@@ -3776,6 +3778,7 @@ const FeatureEntry kFeatureEntries[] = {
switches::kSyncServiceURL,
"https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
#if !BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
{"media-router-cast-allow-all-ips",
flag_descriptions::kMediaRouterCastAllowAllIPsName,
flag_descriptions::kMediaRouterCastAllowAllIPsDescription, kOsDesktop,
@@ -3790,6 +3793,7 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAllowAllSitesToInitiateMirroringDescription,
kOsDesktop,
FEATURE_VALUE_TYPE(media_router::kAllowAllSitesToInitiateMirroring)},
+#endif
{"enable-migrate-default-chrome-app-to-web-apps-gsuite",
flag_descriptions::kEnableMigrateDefaultChromeAppToWebAppsGSuiteName,
flag_descriptions::
@@ -5111,11 +5115,13 @@ const FeatureEntry kFeatureEntries[] = {
kEnableWebAuthenticationChromeOSAuthenticatorDescription,
kOsCrOS, FEATURE_VALUE_TYPE(device::kWebAuthCrosPlatformAuthenticator)},
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
#if BUILDFLAG(ENABLE_PDF)
{"accessible-pdf-form", flag_descriptions::kAccessiblePDFFormName,
flag_descriptions::kAccessiblePDFFormDescription, kOsDesktop,
FEATURE_VALUE_TYPE(chrome_pdf::features::kAccessiblePDFForm)},
#endif // BUILDFLAG(ENABLE_PDF)
+#endif
#if BUILDFLAG(ENABLE_PRINTING)
#if BUILDFLAG(IS_MAC)
@@ -3,6 +3,9 @@
# found in the LICENSE file.
import("//extensions/buildflags/buildflags.gni")
+if (is_ohos) {
+ import("//media/media_options.gni")
+}
assert(enable_extensions)
@@ -76,6 +79,10 @@ source_set("platform_apps") {
"//ui/gfx",
]
+ if (is_ohos && !ohos_enable_media_router) {
+ deps -= [ "//chrome/browser/media/router/discovery" ]
+ }
+
if (is_mac) {
deps += [ "//chrome/browser/apps/app_shim" ]
}
@@ -65,6 +65,11 @@ void CartHandler::RestoreRemovedCart(const GURL& cart_url,
void CartHandler::GetCartDataCallback(GetMerchantCartsCallback callback,
bool success,
std::vector<CartDB::KeyAndValue> res) {
+ DCHECK(success);
+ if (!success) {
+ std::move(callback).Run({});
+ return;
+ }
std::vector<chrome_cart::mojom::MerchantCartPtr> carts;
bool show_discount = cart_service_->IsCartDiscountEnabled();
for (CartDB::KeyAndValue proto_pair : res) {
@@ -679,6 +679,11 @@ bool CartService::ShouldSkip(const GURL& url) {
void CartService::OnLoadCarts(CartDB::LoadCallback callback,
bool success,
std::vector<CartDB::KeyAndValue> proto_pairs) {
+ DCHECK(success);
+ if (!success) {
+ std::move(callback).Run(success, {});
+ return;
+ }
if (cart_features::IsFakeDataEnabled()) {
std::sort(proto_pairs.begin(), proto_pairs.end(),
CompareTimeStampForProtoPair);
@@ -128,8 +128,6 @@
#include "chrome/browser/speech/speech_recognition_client_browser_interface.h"
#include "chrome/browser/speech/speech_recognition_client_browser_interface_factory.h"
#include "chrome/browser/speech/speech_recognition_service.h"
-#include "chrome/browser/ui/webui/access_code_cast/access_code_cast.mojom.h"
-#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h"
#include "chrome/browser/ui/webui/app_service_internals/app_service_internals.mojom.h"
#include "chrome/browser/ui/webui/app_service_internals/app_service_internals_ui.h"
#include "chrome/browser/ui/webui/downloads/downloads.mojom.h"
@@ -285,6 +283,11 @@
#include "chrome/browser/ui/webui/chromeos/chromebox_for_meetings/network_settings_dialog.h"
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/ui/webui/access_code_cast/access_code_cast.mojom.h"
+#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h"
+#endif
+
namespace chrome {
namespace internal {
@@ -810,8 +813,10 @@ void PopulateChromeWebUIFrameBinders(
::mojom::app_service_internals::AppServiceInternalsPageHandler,
AppServiceInternalsUI>(map);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
RegisterWebUIControllerInterfaceBinder<
access_code_cast::mojom::PageHandlerFactory, AccessCodeCastUI>(map);
+#endif
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
@@ -65,7 +65,6 @@
#include "chrome/browser/lifetime/browser_shutdown.h"
#include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h"
#include "chrome/browser/media/audio_service_util.h"
-#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/media/webrtc/audio_debug_recordings_handler.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
#include "chrome/browser/media/webrtc/webrtc_logging_controller.h"
@@ -199,8 +198,6 @@
#include "components/keep_alive_registry/scoped_keep_alive.h"
#include "components/language/core/browser/pref_names.h"
#include "components/live_caption/caption_util.h"
-#include "components/media_router/browser/presentation/presentation_service_delegate_impl.h"
-#include "components/media_router/browser/presentation/receiver_presentation_service_delegate_impl.h"
#include "components/metrics/client_info.h"
#include "components/metrics_services_manager/metrics_services_manager.h"
#include "components/net_log/chrome_net_log.h"
@@ -617,6 +614,12 @@
#include "base/win/windows_h_disallowed.h"
#endif // defined(_WINDOWS_)
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/media/router/media_router_feature.h"
+#include "components/media_router/browser/presentation/presentation_service_delegate_impl.h"
+#include "components/media_router/browser/presentation/receiver_presentation_service_delegate_impl.h"
+#endif
+
using blink::mojom::EffectiveConnectionType;
using blink::web_pref::WebPreferences;
using content::BrowserThread;
@@ -4090,16 +4093,19 @@ void ChromeContentBrowserClient::OpenURL(
content::ControllerPresentationServiceDelegate*
ChromeContentBrowserClient::GetControllerPresentationServiceDelegate(
content::WebContents* web_contents) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
return media_router::PresentationServiceDelegateImpl::
GetOrCreateForWebContents(web_contents);
}
+#endif
return nullptr;
}
content::ReceiverPresentationServiceDelegate*
ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate(
content::WebContents* web_contents) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
// ReceiverPresentationServiceDelegateImpl exists only for WebContents
// created for offscreen presentations. The WebContents must belong to
@@ -4110,6 +4116,7 @@ ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate(
return impl;
}
}
+#endif
return nullptr;
}
@@ -227,6 +227,10 @@ static_library("devtools") {
"device/cast_device_provider.h",
]
}
+
+ if (is_ohos && !ohos_enable_media_router) {
+ deps -= [ "//chrome/browser/media/router:media_router_feature" ]
+ }
}
if (is_mac) {
@@ -269,6 +273,17 @@ static_library("devtools") {
deps += [ "//components/printing/browser/print_to_pdf" ]
}
sources += rebase_path(_protocol_generated, ".", target_gen_dir)
+
+ if (is_ohos && !ohos_enable_media_router) {
+ sources -= [
+ "protocol/cast_handler.cc",
+ "protocol/cast_handler.h",
+ ]
+ deps -= [
+ "//components/media_router/browser",
+ "//components/media_router/common/mojom:media_router",
+ ]
+ }
}
if (enable_extensions) {
@@ -10,7 +10,6 @@
#include "base/strings/string_number_conversions.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/devtools/protocol/browser_handler.h"
-#include "chrome/browser/devtools/protocol/cast_handler.h"
#include "chrome/browser/devtools/protocol/page_handler.h"
#include "chrome/browser/devtools/protocol/security_handler.h"
#include "chrome/browser/devtools/protocol/target_handler.h"
@@ -24,6 +23,10 @@
#include "chrome/browser/devtools/protocol/window_manager_handler.h"
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/devtools/protocol/cast_handler.h"
+#endif
+
ChromeDevToolsSession::ChromeDevToolsSession(
content::DevToolsAgentHostClientChannel* channel)
: dispatcher_(this), client_channel_(channel) {
@@ -34,10 +37,12 @@ ChromeDevToolsSession::ChromeDevToolsSession(
agent_host, agent_host->GetWebContents(), &dispatcher_);
security_handler_ = std::make_unique<SecurityHandler>(
agent_host->GetWebContents(), &dispatcher_);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
if (channel->GetClient()->MayAttachToBrowser()) {
cast_handler_ = std::make_unique<CastHandler>(
agent_host->GetWebContents(), &dispatcher_);
}
+#endif
}
target_handler_ = std::make_unique<TargetHandler>(&dispatcher_);
if (channel->GetClient()->MayAttachToBrowser()) {
@@ -14,6 +14,10 @@
#include "chrome/browser/devtools/protocol/protocol.h"
#include "content/public/browser/devtools_manager_delegate.h"
+#if BUILDFLAG(IS_OHOS)
+#include "media/media_buildflags.h"
+#endif
+
namespace content {
class DevToolsAgentHostClientChannel;
} // namespace content
@@ -58,7 +62,9 @@ class ChromeDevToolsSession : public protocol::FrontendChannel {
protocol::UberDispatcher dispatcher_;
std::unique_ptr<BrowserHandler> browser_handler_;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
std::unique_ptr<CastHandler> cast_handler_;
+#endif
std::unique_ptr<PageHandler> page_handler_;
std::unique_ptr<SecurityHandler> security_handler_;
std::unique_ptr<TargetHandler> target_handler_;
@@ -13,6 +13,12 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
+namespace {
+
+const int64_t kDestroyProfileTimeoutSeconds = 60;
+
+} // namespace
+
DevToolsBrowserContextManager::DevToolsBrowserContextManager() {}
DevToolsBrowserContextManager::~DevToolsBrowserContextManager() = default;
@@ -87,7 +93,8 @@ void DevToolsBrowserContextManager::DisposeBrowserContext(
if (!has_opened_browser) {
otr_profiles_.erase(it);
profile->RemoveObserver(this);
- ProfileDestroyer::DestroyProfileWhenAppropriate(profile);
+ ProfileDestroyer::DestroyProfileWhenAppropriateWithTimeout(
+ profile, base::Seconds(kDestroyProfileTimeoutSeconds));
std::move(callback).Run(true, "");
return;
}
@@ -133,8 +140,10 @@ void DevToolsBrowserContextManager::OnBrowserRemoved(Browser* browser) {
// during the browser tear-down process.
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
- base::BindOnce(&ProfileDestroyer::DestroyProfileWhenAppropriate,
- base::Unretained(otr_profile)));
+ base::BindOnce(
+ &ProfileDestroyer::DestroyProfileWhenAppropriateWithTimeout,
+ base::Unretained(otr_profile),
+ base::Seconds(kDestroyProfileTimeoutSeconds)));
std::move(pending_disposal->second).Run(true, "");
pending_context_disposals_.erase(pending_disposal);
@@ -19,12 +19,18 @@
#include "chrome/browser/devtools/device/devtools_android_bridge.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/devtools/serialize_host_descriptions.h"
-#include "components/media_router/browser/presentation/local_presentation_manager.h"
-#include "components/media_router/browser/presentation/local_presentation_manager_factory.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_agent_host_observer.h"
+#if BUILDFLAG(IS_OHOS)
+#include "media/media_buildflags.h"
+#if BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "components/media_router/browser/presentation/local_presentation_manager.h"
+#include "components/media_router/browser/presentation/local_presentation_manager_factory.h"
+#endif
+#endif
+
using content::BrowserThread;
using content::DevToolsAgentHost;
@@ -85,7 +91,9 @@ private:
bool AllowDevToolsFor(DevToolsAgentHost* host);
Profile* profile_;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
media_router::LocalPresentationManager* local_presentation_manager_;
+#endif
std::unique_ptr<base::OneShotTimer> timer_;
base::WeakPtrFactory<LocalTargetsUIHandler> weak_factory_{this};
};
@@ -93,10 +101,15 @@ private:
LocalTargetsUIHandler::LocalTargetsUIHandler(const Callback& callback,
Profile* profile)
: DevToolsTargetsUIHandler(kTargetSourceLocal, callback),
- profile_(profile),
+ profile_(profile)
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+ ,
local_presentation_manager_(
media_router::LocalPresentationManagerFactory::
GetOrCreateForBrowserContext(profile_)) {
+#else
+ {
+#endif
DevToolsAgentHost::AddObserver(this);
UpdateTargets();
}
@@ -150,8 +163,12 @@ void LocalTargetsUIHandler::UpdateTargets() {
}
bool LocalTargetsUIHandler::AllowDevToolsFor(DevToolsAgentHost* host) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
return local_presentation_manager_->IsLocalPresentation(
host->GetWebContents()) ||
+#else
+ return
+#endif
(Profile::FromBrowserContext(host->GetBrowserContext()) == profile_ &&
DevToolsWindow::AllowDevToolsFor(profile_, host->GetWebContents()));
}
@@ -6,5 +6,5 @@ import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
declare_args() {
- enable_downgrade_processing = !is_android && !is_chromeos_ash
+ enable_downgrade_processing = !is_android && !is_chromeos_ash && !is_ohos
}
@@ -11,6 +11,7 @@
#include "base/location.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/task_runner_util.h"
@@ -61,6 +62,7 @@
#if BUILDFLAG(IS_WIN)
#include "chrome/browser/ui/pdf/adobe_reader_info_win.h"
+#include "ui/shell_dialogs/select_file_utils_win.h"
#endif
using content::BrowserThread;
@@ -89,6 +91,21 @@ void VisitCountsToVisitedBefore(base::OnceCallback<void(bool)> callback,
bool g_is_adobe_reader_up_to_date_ = false;
#endif
+// For the `new_path`, generates a new safe file name if needed. Keep its
+// extension if it is empty or matches that of the `old_extension`. Otherwise,
+// suggest a new safe extension.
+void GenerateSafeFileName(base::FilePath* new_path,
+ const base::FilePath::StringType& old_extension,
+ const std::string& mime_type) {
+ DCHECK(new_path);
+ if (new_path->Extension().empty() || new_path->Extension() == old_extension) {
+ net::GenerateSafeFileName(std::string() /*mime_type*/,
+ false /*ignore_extension*/, new_path);
+ } else {
+ net::GenerateSafeFileName(mime_type, true /*ignore_extension*/, new_path);
+ }
+}
+
} // namespace
DownloadTargetDeterminerDelegate::~DownloadTargetDeterminerDelegate() {
@@ -404,25 +421,22 @@ void DownloadTargetDeterminer::NotifyExtensionsDone(
suggested_path).NormalizePathSeparators());
// If this is a local file, don't allow extensions to override its
- // extension.
+ // name.
if (download_->GetURL().SchemeIsFile()) {
base::FilePath file_path;
net::FileURLToFilePath(download_->GetURL(), &file_path);
- new_path = new_path.ReplaceExtension(file_path.Extension());
+ base::FilePath file_name = file_path.BaseName();
+ // Check if file name is a dir.
+ if (file_name.BaseName() != file_name.DirName())
+ new_path = new_path.DirName().Append(file_name);
} else {
// If the (Chrome) extension does not suggest an file extension, or if the
// suggested extension matches that of the |virtual_path_|, do not
// pass a mime type to GenerateSafeFileName so that it does not force the
// filename to have an extension or generate a different one. Otherwise,
// correct the file extension in case it is wrongly given.
- if (new_path.Extension().empty() ||
- new_path.Extension() == virtual_path_.Extension()) {
- net::GenerateSafeFileName(std::string() /*mime_type*/,
- false /*ignore_extension*/, &new_path);
- } else {
- net::GenerateSafeFileName(download_->GetMimeType(),
- true /*ignore_extension*/, &new_path);
- }
+ GenerateSafeFileName(&new_path, virtual_path_.Extension(),
+ download_->GetMimeType());
}
virtual_path_ = new_path;
create_target_directory_ = true;
@@ -534,8 +548,24 @@ DownloadTargetDeterminer::DoRequestConfirmation() {
// If there is a non-neutral confirmation reason, prompt the user.
if (confirmation_reason_ != DownloadConfirmationReason::NONE) {
+ base::FilePath sanitized_path = virtual_path_;
+#if BUILDFLAG(IS_WIN)
+ // Windows prompt dialog will resolve all env variables in the file name,
+ // which may generate unexpected results. Remove env variables from the
+ // file name first.
+ std::wstring sanitized_name = ui::RemoveEnvVarFromFileName<wchar_t>(
+ virtual_path_.BaseName().value(), L"%");
+ if (sanitized_name.empty()) {
+ sanitized_name = base::UTF8ToWide(
+ l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
+ }
+ sanitized_path =
+ virtual_path_.DirName().Append(base::FilePath(sanitized_name));
+ GenerateSafeFileName(&sanitized_path, virtual_path_.Extension(),
+ download_->GetMimeType());
+#endif // BUILDFLAG(IS_WIN)
delegate_->RequestConfirmation(
- download_, virtual_path_, confirmation_reason_,
+ download_, sanitized_path, confirmation_reason_,
base::BindRepeating(
&DownloadTargetDeterminer::RequestConfirmationDone,
weak_ptr_factory_.GetWeakPtr()));
@@ -1772,6 +1772,32 @@ TEST_F(DownloadTargetDeterminerTest, NotifyExtensionsDefaultPath) {
RunTestCase(test_case, base::FilePath(), item.get());
}
+// Test that relative paths returned by extensions are always relative to the
+// default downloads path.
+TEST_F(DownloadTargetDeterminerTest, NotifyExtensionsLocalFile) {
+ const DownloadTestCase kNotifyExtensionsTestCases[] = {
+ {AUTOMATIC, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
+ DownloadFileType::NOT_DANGEROUS,
+#if BUILDFLAG(IS_WIN)
+ "file:///usr/local/xyz",
+#else
+ "file:///c:/usr/local/xyz",
+#endif // BUILDFLAG(IS_WIN)
+ "text/plain", FILE_PATH_LITERAL(""),
+
+ FILE_PATH_LITERAL("overridden/xyz"),
+ DownloadItem::TARGET_DISPOSITION_OVERWRITE,
+
+ EXPECT_CRDOWNLOAD}};
+
+ base::FilePath overridden_path(FILE_PATH_LITERAL("overridden/foo.txt"));
+ EXPECT_CALL(*delegate(), NotifyExtensions_(_, _, _))
+ .WillRepeatedly(WithArg<2>(ScheduleCallback2(
+ overridden_path, DownloadPathReservationTracker::UNIQUIFY)));
+ RunTestCasesWithActiveItem(kNotifyExtensionsTestCases,
+ std::size(kNotifyExtensionsTestCases));
+}
+
TEST_F(DownloadTargetDeterminerTest, InitialVirtualPathUnsafe) {
const base::FilePath::CharType* kInitialPath =
FILE_PATH_LITERAL("some_path/bar.html");
@@ -2433,6 +2459,43 @@ TEST_F(DownloadTargetDeterminerTest, TransientDownloadResumption) {
histogram_tester.ExpectTotalCount(kTransientPathValidationHistogram, 1);
}
+#if BUILDFLAG(IS_WIN)
+// Test that env variables will be removed from file name before prompting Save
+// As dialog.
+TEST_F(DownloadTargetDeterminerTest, TestSanitizeEnvVariable) {
+ const DownloadTestCase kSaveEnvPathTestCases[] = {
+ {// 0: File name contains env var delimits.
+ SAVE_AS, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
+ DownloadFileType::NOT_DANGEROUS, "http://example.com/f%oo%.tx%xyz%t",
+ "text/plain", FILE_PATH_LITERAL(""),
+
+ FILE_PATH_LITERAL("f.txt"), DownloadItem::TARGET_DISPOSITION_PROMPT,
+
+ EXPECT_CRDOWNLOAD},
+
+ {// 1: File name contains dangerous extensions after removing env var.
+ SAVE_AS, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
+ DownloadFileType::NOT_DANGEROUS, "http://example.com/foo.ln%xyz%k",
+ "application/octet-stream", FILE_PATH_LITERAL(""),
+
+ FILE_PATH_LITERAL("foo.download"),
+ DownloadItem::TARGET_DISPOSITION_PROMPT,
+
+ EXPECT_CRDOWNLOAD},
+ {// 2: File name is an env var.
+ SAVE_AS, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
+ DownloadFileType::NOT_DANGEROUS, "http://example.com/%foo.txt%",
+ "text/plain", FILE_PATH_LITERAL(""),
+
+ FILE_PATH_LITERAL("download"), DownloadItem::TARGET_DISPOSITION_PROMPT,
+
+ EXPECT_CRDOWNLOAD}};
+
+ RunTestCasesWithActiveItem(kSaveEnvPathTestCases,
+ std::size(kSaveEnvPathTestCases));
+}
+#endif // BUILDFLAG(IS_WIN)
+
#if BUILDFLAG(ENABLE_PLUGINS)
void DummyGetPluginsCallback(
@@ -938,6 +938,14 @@ static_library("extensions") {
"//url",
]
+ if (is_ohos && !ohos_enable_media_router) {
+ deps -= [
+ "//chrome/browser/media/router",
+ "//chrome/browser/media/router:media_router_feature",
+ "//chrome/browser/media/router/discovery",
+ ]
+ }
+
if (is_linux || is_mac || is_win) {
sources += [
"api/system_indicator/system_indicator_api.cc",
@@ -1029,19 +1029,19 @@ ExtensionFunction::ResponseAction DownloadsDownloadFunction::Run() {
download_params->set_prompt(*options.save_as);
if (options.headers.get()) {
- for (const downloads::HeaderNameValuePair& name_value : *options.headers) {
- if (!net::HttpUtil::IsValidHeaderName(name_value.name)) {
+ for (const downloads::HeaderNameValuePair& header : *options.headers) {
+ if (!net::HttpUtil::IsValidHeaderName(header.name)) {
return RespondNow(Error(download_extension_errors::kInvalidHeaderName));
}
- if (!net::HttpUtil::IsSafeHeader(name_value.name)) {
+ if (!net::HttpUtil::IsSafeHeader(header.name, header.value)) {
return RespondNow(
Error(download_extension_errors::kInvalidHeaderUnsafe));
}
- if (!net::HttpUtil::IsValidHeaderValue(name_value.value)) {
+ if (!net::HttpUtil::IsValidHeaderValue(header.value)) {
return RespondNow(
Error(download_extension_errors::kInvalidHeaderValue));
}
- download_params->add_request_header(name_value.name, name_value.value);
+ download_params->add_request_header(header.name, header.value);
}
}
@@ -2337,7 +2337,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
" \"filename\": {"
" \"previous\": \"\","
" \"current\": \"%s\"}}]",
- result_id, GetFilename("file").c_str())));
+ result_id, GetFilename("file.txt").c_str())));
ASSERT_TRUE(WaitFor(downloads::OnChanged::kEventName,
base::StringPrintf(
"[{\"id\": %d,"
@@ -28,6 +28,7 @@ namespace pdf_extension_util {
namespace {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
// Tags in the manifest to be replaced.
const char kNameTag[] = "<NAME>";
@@ -160,10 +161,12 @@ void AddPdfViewerStrings(base::Value* dict) {
webui::SetLoadTimeDataDefaults(g_browser_process->GetApplicationLocale(),
static_cast<base::DictionaryValue*>(dict));
}
+#endif // BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
} // namespace
std::string GetManifest() {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
std::string manifest_contents(
ui::ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_PDF_MANIFEST));
@@ -173,9 +176,13 @@ std::string GetManifest() {
ChromeContentClient::kPDFExtensionPluginName);
return manifest_contents;
+#else
+ return "";
+#endif
}
void AddStrings(PdfViewerContext context, base::Value* dict) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
AddCommonStrings(dict);
if (context == PdfViewerContext::kPdfViewer ||
context == PdfViewerContext::kAll) {
@@ -185,6 +192,7 @@ void AddStrings(PdfViewerContext context, base::Value* dict) {
context == PdfViewerContext::kAll) {
// Nothing to do yet, since there are no PrintPreview-only strings.
}
+#endif
}
void AddAdditionalData(bool enable_annotations, base::Value* dict) {
@@ -1038,7 +1038,9 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#else // BUILDFLAG(IS_ANDROID)
gcm::RegisterPrefs(registry);
IntranetRedirectDetector::RegisterPrefs(registry);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
media_router::RegisterLocalStatePrefs(registry);
+#endif
metrics::TabStatsTracker::RegisterPrefs(registry);
RegisterBrowserPrefs(registry);
speech::SodaInstaller::RegisterLocalStatePrefs(registry);
@@ -1352,8 +1354,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
gcm::RegisterProfilePrefs(registry);
HatsService::RegisterProfilePrefs(registry);
NtpCustomBackgroundService::RegisterProfilePrefs(registry);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
media_router::RegisterAccessCodeProfilePrefs(registry);
media_router::RegisterProfilePrefs(registry);
+#endif
NewTabPageHandler::RegisterProfilePrefs(registry);
NewTabPageUI::RegisterProfilePrefs(registry);
NewTabUI::RegisterProfilePrefs(registry);
@@ -5,6 +5,10 @@
import("//build/config/chromeos/ui_mode.gni")
import("//extensions/buildflags/buildflags.gni")
+if (is_ohos) {
+ import("//media/media_options.gni")
+}
+
# This target should be the default place for adding public interface things
# (ie, non-factory, non-impl). There will likely need to be a :factory or :impl
# target (maybe both) for those eventually.
@@ -60,6 +64,10 @@ source_set("profile") {
if (is_android) {
deps += [ "//chrome/browser/profiles/android:jni_headers" ]
}
+
+ if (is_ohos && !ohos_enable_media_router) {
+ deps -= [ "//components/media_router/common" ]
+ }
}
if (is_android) {
@@ -256,6 +256,10 @@ Profile* Profile::FromWebUI(content::WebUI* web_ui) {
}
void Profile::AddObserver(ProfileObserver* observer) {
+ // Instrumentation for https://crbug.com/1359689.
+ CHECK(observer);
+ CHECK(!observers_.HasObserver(observer));
+
observers_.AddObserver(observer);
}
@@ -364,7 +368,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
std::string());
#endif
-#if !BUILDFLAG(IS_ANDROID)
+#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
registry->RegisterBooleanPref(
media_router::prefs::kMediaRouterCloudServicesPrefSet, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
@@ -461,13 +465,19 @@ void Profile::MaybeSendDestroyedNotification() {
TRACE_EVENT1("shutdown", "Profile::MaybeSendDestroyedNotification", "profile",
this);
- if (!sent_destroyed_notification_) {
- sent_destroyed_notification_ = true;
+ if (sent_destroyed_notification_)
+ return;
+ sent_destroyed_notification_ = true;
+
+ // Instrumentation for https://crbug.com/1359689,
+ auto weak_this = GetWeakPtr();
- NotifyWillBeDestroyed();
+ NotifyWillBeDestroyed();
+ CHECK(weak_this);
- for (auto& observer : observers_)
- observer.OnProfileWillBeDestroyed(this);
+ for (auto& observer : observers_) {
+ observer.OnProfileWillBeDestroyed(this);
+ CHECK(weak_this);
}
}
@@ -543,3 +553,7 @@ variations::VariationsClient* Profile::GetVariationsClient() {
content::ResourceContext* Profile::GetResourceContext() {
return resource_context_.get();
}
+
+base::WeakPtr<Profile> Profile::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
@@ -12,6 +12,7 @@
#include <vector>
#include "base/memory/scoped_refptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -501,6 +502,10 @@ class Profile : public content::BrowserContext {
virtual bool IsSignedIn() = 0;
private:
+ friend class ProfileDestroyer;
+
+ base::WeakPtr<Profile> GetWeakPtr();
+
// Created on the UI thread, and returned by GetResourceContext(), but
// otherwise lives on and is destroyed on the IO thread.
//
@@ -523,6 +528,8 @@ class Profile : public content::BrowserContext {
class ChromeVariationsClient;
std::unique_ptr<variations::VariationsClient> chrome_variations_client_;
+
+ base::WeakPtrFactory<Profile> weak_factory_{this};
};
// The comparator for profile pointers as key in a map.
@@ -44,7 +44,15 @@ enum class ProfileDestructionType {
ProfileDestroyer::DestroyerSet* ProfileDestroyer::pending_destroyers_ = nullptr;
// static
-void ProfileDestroyer::DestroyProfileWhenAppropriate(Profile* const profile) {
+void ProfileDestroyer::DestroyProfileWhenAppropriate(Profile* profile) {
+ DestroyProfileWhenAppropriateWithTimeout(profile,
+ base::Seconds(kTimerDelaySeconds));
+}
+
+// static
+void ProfileDestroyer::DestroyProfileWhenAppropriateWithTimeout(
+ Profile* profile,
+ base::TimeDelta timeout) {
TRACE_EVENT("shutdown", "ProfileDestroyer::DestroyProfileWhenAppropriate",
[&](perfetto::EventContext ctx) {
auto* proto =
@@ -73,11 +81,11 @@ void ProfileDestroyer::DestroyProfileWhenAppropriate(Profile* const profile) {
// The instance will destroy itself once all (non-spare) render process
// hosts referring to it are properly terminated.
- new ProfileDestroyer(profile, &profile_hosts);
+ new ProfileDestroyer(profile, &profile_hosts, timeout);
}
// static
-void ProfileDestroyer::DestroyOffTheRecordProfileNow(Profile* const profile) {
+void ProfileDestroyer::DestroyOffTheRecordProfileNow(Profile* profile) {
DCHECK(profile);
DCHECK(profile->IsOffTheRecord());
TRACE_EVENT(
@@ -88,12 +96,6 @@ void ProfileDestroyer::DestroyOffTheRecordProfileNow(Profile* const profile) {
proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile));
proto->set_otr_profile_id(profile->GetOTRProfileID().ToString());
});
- if (ResetPendingDestroyers(profile)) {
- // We want to signal this in debug builds so that we don't lose sight of
- // these potential leaks, but we handle it in release so that we don't
- // crash or corrupt profile data on disk.
- NOTREACHED() << "A render process host wasn't destroyed early enough.";
- }
DCHECK(profile->GetOriginalProfile());
profile->GetOriginalProfile()->DestroyOffTheRecordProfile(profile);
UMA_HISTOGRAM_ENUMERATION("Profile.Destroyer.OffTheRecord",
@@ -101,7 +103,7 @@ void ProfileDestroyer::DestroyOffTheRecordProfileNow(Profile* const profile) {
}
// static
-void ProfileDestroyer::DestroyOriginalProfileNow(Profile* const profile) {
+void ProfileDestroyer::DestroyOriginalProfileNow(Profile* profile) {
DCHECK(profile);
DCHECK(!profile->IsOffTheRecord());
TRACE_EVENT("shutdown", "ProfileDestroyer::DestroyOriginalProfileNow",
@@ -158,22 +160,11 @@ void ProfileDestroyer::DestroyOriginalProfileNow(Profile* const profile) {
#endif // DCHECK_IS_ON()
}
-bool ProfileDestroyer::ResetPendingDestroyers(Profile* const profile) {
- DCHECK(profile);
- bool found = false;
- if (pending_destroyers_) {
- for (auto* i : *pending_destroyers_) {
- if (i->profile_ == profile) {
- i->profile_ = nullptr;
- found = true;
- }
- }
- }
- return found;
-}
-
-ProfileDestroyer::ProfileDestroyer(Profile* const profile, HostSet* hosts)
- : profile_(profile) {
+ProfileDestroyer::ProfileDestroyer(Profile* profile,
+ HostSet* hosts,
+ base::TimeDelta timeout)
+ : profile_(profile->GetWeakPtr()),
+ timeout_(timeout) {
TRACE_EVENT("shutdown", "ProfileDestroyer::ProfileDestroyer",
[&](perfetto::EventContext ctx) {
auto* proto =
@@ -190,7 +181,7 @@ ProfileDestroyer::ProfileDestroyer(Profile* const profile, HostSet* hosts)
// If we are going to wait for render process hosts, we don't want to do it
// for longer than kTimerDelaySeconds.
if (observations_.IsObservingAnySource()) {
- timer_.Start(FROM_HERE, base::Seconds(kTimerDelaySeconds),
+ timer_.Start(FROM_HERE, timeout,
base::BindOnce(&ProfileDestroyer::DestroyProfile,
weak_ptr_factory_.GetWeakPtr()));
}
@@ -202,7 +193,7 @@ ProfileDestroyer::~ProfileDestroyer() {
auto* proto =
ctx.event<perfetto::protos::pbzero::ChromeTrackEvent>()
->set_chrome_profile_destroyer();
- proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile_));
+ proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile_.get()));
proto->set_host_count_at_destruction(
observations_.GetSourcesCount());
});
@@ -210,7 +201,7 @@ ProfileDestroyer::~ProfileDestroyer() {
// Check again, in case other render hosts were added while we were
// waiting for the previous ones to go away...
if (profile_)
- DestroyProfileWhenAppropriate(profile_);
+ DestroyProfileWhenAppropriateWithTimeout(profile_.get(), timeout_);
// Don't wait for pending registrations, if any, these hosts are buggy.
// Note: this can happen, but if so, it's better to crash here than wait
@@ -240,7 +231,7 @@ void ProfileDestroyer::RenderProcessHostDestroyed(
[&](perfetto::EventContext ctx) {
auto* proto = ctx.event<perfetto::protos::pbzero::ChromeTrackEvent>()
->set_chrome_profile_destroyer();
- proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile_));
+ proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile_.get()));
proto->set_render_process_host_ptr(reinterpret_cast<uint64_t>(host));
});
observations_.RemoveObservation(host);
@@ -262,7 +253,7 @@ void ProfileDestroyer::DestroyProfile() {
DCHECK(profile_->IsOffTheRecord());
DCHECK(profile_->GetOriginalProfile());
- profile_->GetOriginalProfile()->DestroyOffTheRecordProfile(profile_);
+ profile_->GetOriginalProfile()->DestroyOffTheRecordProfile(profile_.get());
#if BUILDFLAG(IS_ANDROID)
// It is possible on Android platform that more than one destroyer
@@ -281,7 +272,7 @@ void ProfileDestroyer::DestroyProfile() {
// static
ProfileDestroyer::HostSet ProfileDestroyer::GetHostsForProfile(
- void* const profile_ptr,
+ void* profile_ptr,
bool include_spare_rph) {
HostSet hosts;
for (content::RenderProcessHost::iterator iter(
@@ -15,6 +15,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_process_host_observer.h"
+class DevToolsBrowserContextManager;
class Profile;
class ProfileImpl;
@@ -26,7 +27,7 @@ class ProfileDestroyer : public content::RenderProcessHostObserver {
// for dependent renderer process hosts to destroy.
// Ownership of the profile is passed to profile destroyer and the profile
// should not be used after this call.
- static void DestroyProfileWhenAppropriate(Profile* const profile);
+ static void DestroyProfileWhenAppropriate(Profile* profile);
ProfileDestroyer(const ProfileDestroyer&) = delete;
ProfileDestroyer& operator=(const ProfileDestroyer&) = delete;
@@ -37,7 +38,18 @@ class ProfileDestroyer : public content::RenderProcessHostObserver {
friend class base::RefCounted<ProfileDestroyer>;
- ProfileDestroyer(Profile* const profile, HostSet* hosts);
+ // For custom timeout, see DestroyProfileWhenAppropriateWithTimeout.
+ friend class DevToolsBrowserContextManager;
+
+ // Same as DestroyProfileWhenAppropriate, but configures how long to wait
+ // for render process hosts to be destroyed. Intended for testing/automation
+ // scenarios, where default timeout is too short.
+ static void DestroyProfileWhenAppropriateWithTimeout(Profile* profile,
+ base::TimeDelta timeout);
+
+ ProfileDestroyer(Profile* profile,
+ HostSet* hosts,
+ base::TimeDelta timeout);
~ProfileDestroyer() override;
// content::RenderProcessHostObserver override.
@@ -52,20 +64,15 @@ class ProfileDestroyer : public content::RenderProcessHostObserver {
//
// If |include_spare_rph| is true, include spare render process hosts in the
// output.
- static HostSet GetHostsForProfile(void* const profile_ptr,
+ static HostSet GetHostsForProfile(void* profile_ptr,
bool include_spare_rph = false);
// Destroys an Original (non-off-the-record) profile immediately.
- static void DestroyOriginalProfileNow(Profile* const profile);
+ static void DestroyOriginalProfileNow(Profile* profile);
// Destroys an OffTheRecord profile immediately and removes it from all
// pending destroyers.
- static void DestroyOffTheRecordProfileNow(Profile* const profile);
-
- // Reset pending destroyers whose target profile matches the given one
- // to make it stop attempting to destroy it. Returns true if any object
- // object was found to match and get reset.
- static bool ResetPendingDestroyers(Profile* const profile);
+ static void DestroyOffTheRecordProfileNow(Profile* profile);
// We need access to all pending destroyers so we can cancel them.
static DestroyerSet* pending_destroyers_;
@@ -77,9 +84,27 @@ class ProfileDestroyer : public content::RenderProcessHostObserver {
content::RenderProcessHostObserver>
observations_{this};
- // The profile being destroyed. If it is set to NULL, it is a signal from
- // another instance of ProfileDestroyer that this instance is canceled.
- Profile* profile_;
+ // The profile being destroyed.
+ //
+ // Note: Ownership model of the Profile is not consistent. As a result, this
+ // variable sometimes represent ownership over the Profile, but sometimes
+ // this is just a weak reference, and the Profile might be destroyed outside
+ // of the ProfileDestroyer.
+ //
+ // [Regular profile]
+ // Owned by the ProfileManager. Ownership is transferred.
+ //
+ // [OTR profile]
+ // Owned by the original profile. Owner is NOT transferred. This is a weak
+ // pointer. Deleting the original Profile will delete its OTR profile under
+ // the hood.
+ //
+ // [Independent profile]
+ // It depends on the component. Most likely, the ownership is transferred.
+ base::WeakPtr<Profile> profile_;
+
+ // Force-destruction timeout.
+ const base::TimeDelta timeout_;
base::WeakPtrFactory<ProfileDestroyer> weak_ptr_factory_{this};
};
@@ -115,6 +115,33 @@ TEST_P(ProfileDestroyerTest, DelayedOTRProfileDestruction) {
EXPECT_TRUE(IsOTRProfileDestroyed());
}
+TEST_P(ProfileDestroyerTest, RenderProcessAddedAfterDestroyRequested) {
+ if (!IsScopedProfileKeepAliveSupported())
+ return;
+ CreateOriginalProfile();
+
+ content::RenderProcessHost* render_process_host_1 =
+ CreatedRendererProcessHost(original_profile());
+ StopKeepingAliveOriginalProfile();
+
+ ProfileDestroyer::DestroyProfileWhenAppropriate(original_profile());
+
+ EXPECT_TRUE(original_profile());
+ content::RenderProcessHost* render_process_host_2 =
+ CreatedRendererProcessHost(original_profile());
+
+ base::RunLoop().RunUntilIdle();
+ EXPECT_TRUE(original_profile()); // Waiting for 2 processes to be released
+
+ render_process_host_1->Cleanup();
+ base::RunLoop().RunUntilIdle();
+ EXPECT_TRUE(original_profile()); // Waiting for 1 process to be released.
+
+ render_process_host_2->Cleanup();
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(original_profile()); // Destroyed.
+}
+
INSTANTIATE_TEST_SUITE_P(AllOTRProfileTypes,
ProfileDestroyerTest,
/*is_primary_otr=*/testing::Bool());
@@ -118,8 +118,6 @@
#include "components/guest_view/browser/guest_view_base.h"
#include "components/language/core/browser/language_model_manager.h"
#include "components/lens/lens_features.h"
-#include "components/media_router/browser/media_router_dialog_controller.h"
-#include "components/media_router/browser/media_router_metrics.h"
#include "components/omnibox/browser/autocomplete_classifier.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/password_manager/content/browser/content_password_manager_driver.h"
@@ -265,6 +263,11 @@
#include "ui/aura/window.h"
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "components/media_router/browser/media_router_dialog_controller.h"
+#include "components/media_router/browser/media_router_metrics.h"
+#endif
+
using base::UserMetricsAction;
using blink::ContextMenuData;
using blink::ContextMenuDataEditFlags;
@@ -377,7 +380,9 @@ const std::map<int, int>& GetIdcToUmaMap(UmaEnumIdLookupType type) {
{IDC_WRITING_DIRECTION_LTR, 64},
{IDC_WRITING_DIRECTION_RTL, 65},
{IDC_CONTENT_CONTEXT_LOAD_IMAGE, 66},
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
{IDC_ROUTE_MEDIA, 68},
+#endif
{IDC_CONTENT_CONTEXT_COPYLINKTEXT, 69},
{IDC_CONTENT_CONTEXT_OPENLINKINPROFILE, 70},
{IDC_OPEN_LINK_IN_PROFILE_FIRST, 71},
@@ -1820,10 +1825,12 @@ void RenderViewContextMenu::AppendPrintItem() {
}
void RenderViewContextMenu::AppendMediaRouterItem() {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
if (media_router::MediaRouterEnabled(browser_context_)) {
menu_model_.AddItemWithStringId(IDC_ROUTE_MEDIA,
IDS_MEDIA_ROUTER_MENU_ITEM_TITLE);
}
+#endif
}
void RenderViewContextMenu::AppendRotationItems() {
@@ -2392,8 +2399,10 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
case IDC_CONTENT_CONTEXT_SHOWALLSAVEDPASSWORDS:
return true;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
case IDC_ROUTE_MEDIA:
return IsRouteMediaEnabled();
+#endif
case IDC_CONTENT_CONTEXT_EXIT_FULLSCREEN:
return true;
@@ -2653,9 +2662,11 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
ExecPrint();
break;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
case IDC_ROUTE_MEDIA:
ExecRouteMedia();
break;
+#endif
case IDC_CONTENT_CONTEXT_EXIT_FULLSCREEN:
ExecExitFullscreen();
@@ -3152,6 +3163,7 @@ RenderViewContextMenu::CreateDataEndpoint(bool notify_if_restricted) const {
return nullptr;
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
bool RenderViewContextMenu::IsRouteMediaEnabled() const {
if (!media_router::MediaRouterEnabled(browser_context_))
return false;
@@ -3173,6 +3185,7 @@ bool RenderViewContextMenu::IsRouteMediaEnabled() const {
web_modal::WebContentsModalDialogManager::FromWebContents(web_contents);
return !manager || !manager->IsDialogActive();
}
+#endif
bool RenderViewContextMenu::IsOpenLinkOTREnabled() const {
if (browser_context_->IsOffTheRecord() || !params_.link_url.is_valid())
@@ -3492,6 +3505,7 @@ void RenderViewContextMenu::ExecPrint() {
#endif // BUILDFLAG(ENABLE_PRINTING)
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
void RenderViewContextMenu::ExecRouteMedia() {
media_router::MediaRouterDialogController* dialog_controller =
media_router::MediaRouterDialogController::GetOrCreateForWebContents(
@@ -3504,6 +3518,7 @@ void RenderViewContextMenu::ExecRouteMedia() {
media_router::MediaRouterMetrics::RecordMediaRouterDialogOrigin(
media_router::MediaRouterDialogOpenOrigin::CONTEXTUAL_MENU);
}
+#endif
void RenderViewContextMenu::ExecTranslate() {
ChromeTranslateClient* chrome_translate_client =
@@ -43,6 +43,10 @@
#include "chrome/browser/extensions/menu_manager.h"
#endif
+#if BUILDFLAG(IS_OHOS)
+#include "media/media_buildflags.h"
+#endif
+
class AccessibilityLabelsMenuObserver;
class ClickToCallContextMenuObserver;
class LinkToTextMenuObserver;
@@ -265,7 +269,9 @@ class RenderViewContextMenu
bool IsPasteAndMatchStyleEnabled() const;
bool IsPrintPreviewEnabled() const;
bool IsQRCodeGeneratorEnabled() const;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
bool IsRouteMediaEnabled() const;
+#endif
bool IsOpenLinkOTREnabled() const;
bool IsSearchWebForEnabled() const;
bool IsRegionSearchEnabled() const;
@@ -295,7 +301,9 @@ class RenderViewContextMenu
void ExecReloadPackagedApp();
void ExecRestartPackagedApp();
void ExecPrint();
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
void ExecRouteMedia();
+#endif
void ExecTranslate();
void ExecLanguageSettings(int event_flags);
void ExecProtocolHandlerSettings(int event_flags);
@@ -189,7 +189,7 @@ void UpdateFromSystemSettings(blink::RendererPreferences* prefs,
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \
- BUILDFLAG(IS_WIN)
+ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_OHOS)
content::UpdateFontRendererPreferencesFromSystemSettings(prefs);
#endif
@@ -28,6 +28,10 @@
#include "chrome/app/packed_resources_integrity.h" // nogncheck
#endif
+#if BUILDFLAG(IS_OHOS)
+#include "ui/base/buildflags.h"
+#endif
+
namespace {
bool CheckResourceIntegrityInternal(
@@ -109,8 +113,10 @@ void CheckPakFileIntegrity() {
kSha256_resources_pak;
base::span<const uint8_t, crypto::kSHA256Length> chrome_100_hash =
kSha256_chrome_100_percent_pak;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_HIDPI)
base::span<const uint8_t, crypto::kSHA256Length> chrome_200_hash =
kSha256_chrome_200_percent_pak;
+#endif
#endif // BUILDFLAG(IS_WIN)
scoped_refptr<base::SequencedTaskRunner> task_runner =
@@ -126,9 +132,11 @@ void CheckPakFileIntegrity() {
chrome_100_hash, task_runner,
base::BindOnce(&ReportPakIntegrity,
"SafeBrowsing.PakIntegrity.Chrome100"));
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_HIDPI)
CheckResourceIntegrity(
resources_pack_path.DirName().AppendASCII("chrome_200_percent.pak"),
chrome_200_hash, task_runner,
base::BindOnce(&ReportPakIntegrity,
"SafeBrowsing.PakIntegrity.Chrome200"));
+#endif
}
@@ -180,6 +180,7 @@ void SharingHubModel::PopulateFirstPartyActions() {
&kQrcodeGeneratorIcon, true, gfx::ImageSkia(),
"SharingHubDesktop.QRCodeSelected"});
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
if (media_router::MediaRouterEnabled(context_)) {
first_party_action_list_.push_back(
{IDC_ROUTE_MEDIA,
@@ -187,6 +188,7 @@ void SharingHubModel::PopulateFirstPartyActions() {
&vector_icons::kMediaRouterIdleIcon, true, gfx::ImageSkia(),
"SharingHubDesktop.CastSelected"});
}
+#endif
first_party_action_list_.push_back(
{IDC_SAVE_PAGE,
@@ -6,6 +6,7 @@
#include <memory>
+#include "base/feature_list.h"
#include "chrome/browser/profiles/profile.h"
#include "components/live_caption/pref_names.h"
#include "components/prefs/pref_change_registrar.h"
@@ -60,6 +61,10 @@ void SpeechRecognitionClientBrowserInterface::
void SpeechRecognitionClientBrowserInterface::OnSodaInstalled() {
NotifyObservers(profile_prefs_->GetBoolean(prefs::kLiveCaptionEnabled));
+
+ if (base::FeatureList::IsEnabled(media::kLiveCaptionMultiLanguage)) {
+ OnSpeechRecognitionLanguageChanged();
+ }
}
void SpeechRecognitionClientBrowserInterface::
@@ -5,11 +5,13 @@
#include <algorithm>
#include "base/files/file_util.h"
+#include "base/files/scoped_temp_dir.h"
#include "base/notreached.h"
#include "base/path_service.h"
#include "base/sync_socket.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
+#include "base/threading/thread_restrictions.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
@@ -264,7 +266,7 @@ void SpeechRecognitionServiceTest::LaunchService() {
speech_recognition_client_receiver_.BindNewPipeAndPassRemote(),
media::mojom::SpeechRecognitionOptions::New(
media::mojom::SpeechRecognitionMode::kCaption,
- /*enable_formatting=*/true, "en-US"),
+ /*enable_formatting=*/true, kUsEnglishLocale),
base::BindOnce(
[](bool* p_is_multichannel_supported, base::RunLoop* run_loop,
bool is_multichannel_supported) {
@@ -296,7 +298,7 @@ void SpeechRecognitionServiceTest::LaunchServiceWithAudioSourceFetcher() {
speech_recognition_client_receiver_.BindNewPipeAndPassRemote(),
media::mojom::SpeechRecognitionOptions::New(
media::mojom::SpeechRecognitionMode::kIme,
- /*enable_formatting=*/false, "en-US"),
+ /*enable_formatting=*/false, kUsEnglishLocale),
base::BindOnce(
[](bool* p_is_multichannel_supported, base::RunLoop* run_loop,
bool is_multichannel_supported) {
@@ -502,4 +504,51 @@ IN_PROC_BROWSER_TEST_F(SpeechRecognitionServiceTest, CreateAudioSourceFetcher) {
base::RunLoop().RunUntilIdle();
}
+IN_PROC_BROWSER_TEST_F(SpeechRecognitionServiceTest, CompromisedRenderer) {
+ // Create temporary SODA files.
+ SetUpPrefs();
+ base::ScopedAllowBlockingForTesting allow_blocking;
+ base::FilePath config_dir =
+ GetSodaLanguagePacksDirectory()
+ .AppendASCII(kUsEnglishLocale)
+ .Append("1.1.1")
+ .Append(kSodaLanguagePackDirectoryRelativePath);
+ base::CreateDirectory(config_dir);
+ ASSERT_TRUE(base::PathExists(config_dir));
+ base::FilePath config_file_path = config_dir.Append("config_file");
+ ASSERT_EQ(base::WriteFile(config_file_path, nullptr, 0), 0);
+ ASSERT_TRUE(base::PathExists(config_file_path));
+ g_browser_process->local_state()->SetFilePath(prefs::kSodaEnUsConfigPath,
+ config_file_path);
+
+ // Launch the Speech Recognition service.
+ auto* browser_context =
+ static_cast<content::BrowserContext*>(browser()->profile());
+ auto* service = new ChromeSpeechRecognitionService(browser_context);
+ service->BindSpeechRecognitionContext(
+ speech_recognition_context_.BindNewPipeAndPassReceiver());
+
+ // Bind the recognizer pipes used to send audio and receive results.
+ auto run_loop = std::make_unique<base::RunLoop>();
+ speech_recognition_context_->BindRecognizer(
+ speech_recognition_recognizer_.BindNewPipeAndPassReceiver(),
+ speech_recognition_client_receiver_.BindNewPipeAndPassRemote(),
+ media::mojom::SpeechRecognitionOptions::New(
+ media::mojom::SpeechRecognitionMode::kCaption,
+ /*enable_formatting=*/true, kUsEnglishLocale,
+ /*is_server_based=*/false,
+ media::mojom::RecognizerClientType::kLiveCaption),
+ base::BindOnce([](base::RunLoop* run_loop,
+ bool is_multichannel_supported) { run_loop->Quit(); },
+ run_loop.get()));
+ run_loop->Run();
+
+ // Simulate a compromised renderer by changing the language and immediately
+ // resetting the recognizer and verify that the subsequent callbacks do not
+ // cause any crashes.
+ speech_recognition_recognizer_->OnLanguageChanged(kUsEnglishLocale);
+ speech_recognition_recognizer_.reset();
+ base::RunLoop().RunUntilIdle();
+}
+
} // namespace speech
@@ -14,7 +14,7 @@ sync_integration_tests_sources = [
"../browser/sync/test/integration/sync_exponential_backoff_test.cc",
]
-if (!is_android) {
+if (!is_android && !is_ohos) {
sync_integration_tests_sources += [
"../browser/sync/test/integration/enable_disable_test.cc",
"../browser/sync/test/integration/local_sync_test.cc",
@@ -667,6 +667,14 @@ static_library("ui") {
"//v8:v8_version",
]
+ if (is_ohos && !ohos_enable_media_router) {
+ deps -= [
+ "//chrome/browser/media/router:media_router_feature",
+ "//chrome/browser/media/router/discovery/access_code:access_code_cast_feature",
+ "//chrome/browser/media/router/discovery/access_code:discovery_resources_proto",
+ ]
+ }
+
if (is_ohos && safe_browsing_mode == 0) {
deps -=
[ "//components/safe_browsing/content/browser:client_side_detection" ]
@@ -1690,6 +1698,80 @@ static_library("ui") {
]
}
+ if (is_ohos && !ohos_enable_media_router) {
+ sources -= [
+ "media_router/cast_dialog_controller.h",
+ "media_router/cast_dialog_model.cc",
+ "media_router/cast_dialog_model.h",
+ "media_router/cast_modes_with_media_sources.cc",
+ "media_router/cast_modes_with_media_sources.h",
+ "media_router/cloud_services_dialog.h",
+ "media_router/media_cast_mode.cc",
+ "media_router/media_cast_mode.h",
+ "media_router/media_router_ui.cc",
+ "media_router/media_router_ui.h",
+ "media_router/media_router_ui_helper.cc",
+ "media_router/media_router_ui_helper.h",
+ "media_router/media_router_ui_service.cc",
+ "media_router/media_router_ui_service.h",
+ "media_router/media_router_ui_service_factory.cc",
+ "media_router/media_router_ui_service_factory.h",
+ "media_router/media_sink_with_cast_modes.cc",
+ "media_router/media_sink_with_cast_modes.h",
+ "media_router/presentation_receiver_window.h",
+ "media_router/presentation_receiver_window_controller.cc",
+ "media_router/presentation_receiver_window_controller.h",
+ "media_router/presentation_receiver_window_delegate.h",
+ "media_router/query_result_manager.cc",
+ "media_router/query_result_manager.h",
+ "media_router/ui_media_sink.cc",
+ "media_router/ui_media_sink.h",
+ "toolbar/media_router_action_controller.cc",
+ "toolbar/media_router_action_controller.h",
+ "toolbar/media_router_contextual_menu.cc",
+ "toolbar/media_router_contextual_menu.h",
+ "webui/access_code_cast/access_code_cast_handler.cc",
+ "webui/access_code_cast/access_code_cast_handler.h",
+ "webui/access_code_cast/access_code_cast_ui.cc",
+ "webui/access_code_cast/access_code_cast_ui.h",
+ "webui/media_router/media_router_internals_ui.cc",
+ "webui/media_router/media_router_internals_ui.h",
+ "webui/media_router/media_router_internals_webui_message_handler.cc",
+ "webui/media_router/media_router_internals_webui_message_handler.h",
+ "webui/media_router/web_contents_display_observer.h",
+ ]
+ }
+
+ if (is_ohos) {
+ sources -= [
+ "global_media_controls/cast_media_notification_item.cc",
+ "global_media_controls/cast_media_notification_item.h",
+ "global_media_controls/cast_media_notification_producer.cc",
+ "global_media_controls/cast_media_notification_producer.h",
+ "global_media_controls/cast_media_session_controller.cc",
+ "global_media_controls/cast_media_session_controller.h",
+ "global_media_controls/media_item_ui_device_selector_delegate.h",
+ "global_media_controls/media_notification_device_monitor.cc",
+ "global_media_controls/media_notification_device_monitor.h",
+ "global_media_controls/media_notification_device_provider.h",
+ "global_media_controls/media_notification_device_provider_impl.cc",
+ "global_media_controls/media_notification_device_provider_impl.h",
+ "global_media_controls/media_notification_service.cc",
+ "global_media_controls/media_notification_service.h",
+ "global_media_controls/media_notification_service_factory.cc",
+ "global_media_controls/media_notification_service_factory.h",
+ "global_media_controls/media_toolbar_button_controller.cc",
+ "global_media_controls/media_toolbar_button_controller.h",
+ "global_media_controls/media_toolbar_button_controller_delegate.cc",
+ "global_media_controls/media_toolbar_button_controller_delegate.h",
+ "global_media_controls/media_toolbar_button_observer.h",
+ "global_media_controls/presentation_request_notification_item.cc",
+ "global_media_controls/presentation_request_notification_item.h",
+ "global_media_controls/presentation_request_notification_producer.cc",
+ "global_media_controls/presentation_request_notification_producer.h",
+ ]
+ }
+
deps += [
"//base",
"//build:chromeos_buildflags",
@@ -1770,6 +1852,16 @@ static_library("ui") {
allow_circular_includes_from += [ "//chrome/browser/media/router" ]
+ if (is_ohos && !ohos_enable_media_router) {
+ deps -= [
+ "//chrome/browser/media/router",
+ "//chrome/browser/media/router/discovery:discovery",
+ "//chrome/browser/ui/webui/access_code_cast:mojo_bindings",
+ "//components/media_router/common/mojom:media_router",
+ ]
+ allow_circular_includes_from -= [ "//chrome/browser/media/router" ]
+ }
+
if (use_ozone && !is_chromeos_ash) {
deps += [
"//ui/base:features",
@@ -4862,6 +4954,58 @@ static_library("ui") {
allow_circular_includes_from += [ "//chrome/browser/ui/views" ]
+ if (is_ohos && !ohos_enable_media_router) {
+ sources -= [
+ "views/media_router/cast_dialog_access_code_cast_button.cc",
+ "views/media_router/cast_dialog_access_code_cast_button.h",
+ "views/media_router/cast_dialog_helper.cc",
+ "views/media_router/cast_dialog_helper.h",
+ "views/media_router/cast_dialog_metrics.cc",
+ "views/media_router/cast_dialog_metrics.h",
+ "views/media_router/cast_dialog_no_sinks_view.cc",
+ "views/media_router/cast_dialog_no_sinks_view.h",
+ "views/media_router/cast_dialog_sink_button.cc",
+ "views/media_router/cast_dialog_sink_button.h",
+ "views/media_router/cast_dialog_view.cc",
+ "views/media_router/cast_dialog_view.h",
+ "views/media_router/cast_toolbar_button.cc",
+ "views/media_router/cast_toolbar_button.h",
+ "views/media_router/media_remoting_dialog_view.cc",
+ "views/media_router/media_remoting_dialog_view.h",
+ "views/media_router/media_router_dialog_controller_views.cc",
+ "views/media_router/media_router_dialog_controller_views.h",
+ "views/media_router/presentation_receiver_window_factory.cc",
+ "views/media_router/presentation_receiver_window_frame.cc",
+ "views/media_router/presentation_receiver_window_frame.h",
+ "views/media_router/presentation_receiver_window_view.cc",
+ "views/media_router/presentation_receiver_window_view.h",
+ "views/media_router/web_contents_display_observer_view.cc",
+ "views/media_router/web_contents_display_observer_view.h",
+ ]
+ }
+
+ if (is_ohos) {
+ sources -= [
+ "views/global_media_controls/media_dialog_view.cc",
+ "views/global_media_controls/media_dialog_view.h",
+ "views/global_media_controls/media_dialog_view_observer.h",
+ "views/global_media_controls/media_item_ui_device_selector_observer.h",
+ "views/global_media_controls/media_item_ui_device_selector_view.cc",
+ "views/global_media_controls/media_item_ui_device_selector_view.h",
+ "views/global_media_controls/media_item_ui_footer_view.cc",
+ "views/global_media_controls/media_item_ui_footer_view.h",
+ "views/global_media_controls/media_item_ui_legacy_cast_footer_view.cc",
+ "views/global_media_controls/media_item_ui_legacy_cast_footer_view.h",
+ "views/global_media_controls/media_notification_device_entry_ui.cc",
+ "views/global_media_controls/media_notification_device_entry_ui.h",
+ "views/global_media_controls/media_toolbar_button_contextual_menu.cc",
+ "views/global_media_controls/media_toolbar_button_contextual_menu.h",
+ "views/global_media_controls/media_toolbar_button_view.cc",
+ "views/global_media_controls/media_toolbar_button_view.h",
+ ]
+ deps -= [ "//components/global_media_controls" ]
+ }
+
if (is_linux || is_chromeos_lacros || is_ohos) {
sources += [
"views/chrome_views_delegate_linux.cc",
@@ -5118,8 +5262,6 @@ static_library("ui") {
"extensions/extension_message_bubble_bridge.h",
"extensions/extension_message_bubble_factory.cc",
"extensions/extension_message_bubble_factory.h",
- "extensions/extension_removal_watcher.cc",
- "extensions/extension_removal_watcher.h",
"extensions/extension_settings_overridden_dialog.cc",
"extensions/extension_settings_overridden_dialog.h",
"extensions/extensions_container.h",
@@ -5481,7 +5623,7 @@ static_library("test_support") {
}
}
- if (!is_android) {
+ if (!is_android && !is_ohos) {
sources += [
"exclusive_access/exclusive_access_test.cc",
"exclusive_access/exclusive_access_test.h",
@@ -19,6 +19,7 @@
#include "chrome/browser/ssl/security_state_tab_helper.h"
#include "chrome/browser/vr/vr_tab_helper.h"
#include "chrome/common/url_constants.h"
+#include "components/permissions/permission_util.h"
#include "components/security_state/core/security_state.h"
#include "components/url_formatter/elide_url.h"
#include "content/public/browser/render_frame_host.h"
@@ -27,11 +28,44 @@
#include "ui/android/window_android.h"
#include "url/gurl.h"
+namespace {
+
+UsbChooserDialogAndroid::CreateJavaDialogCallback
+GetCreateJavaUsbChooserDialogCallback() {
+ return base::BindOnce(&Java_UsbChooserDialog_create);
+}
+
+} // namespace
+
// static
std::unique_ptr<UsbChooserDialogAndroid> UsbChooserDialogAndroid::Create(
content::RenderFrameHost* render_frame_host,
std::unique_ptr<permissions::ChooserController> controller,
base::OnceClosure on_close) {
+ return CreateInternal(render_frame_host, std::move(controller),
+ std::move(on_close),
+ GetCreateJavaUsbChooserDialogCallback());
+}
+
+// static
+std::unique_ptr<UsbChooserDialogAndroid>
+UsbChooserDialogAndroid::CreateForTesting(
+ content::RenderFrameHost* render_frame_host,
+ std::unique_ptr<permissions::ChooserController> controller,
+ base::OnceClosure on_close,
+ CreateJavaDialogCallback create_java_dialog_callback) {
+ return CreateInternal(render_frame_host, std::move(controller),
+ std::move(on_close),
+ std::move(create_java_dialog_callback));
+}
+
+// static
+std::unique_ptr<UsbChooserDialogAndroid>
+UsbChooserDialogAndroid::CreateInternal(
+ content::RenderFrameHost* render_frame_host,
+ std::unique_ptr<permissions::ChooserController> controller,
+ base::OnceClosure on_close,
+ CreateJavaDialogCallback create_java_dialog_callback) {
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
@@ -46,10 +80,14 @@ std::unique_ptr<UsbChooserDialogAndroid> UsbChooserDialogAndroid::Create(
base::android::ScopedJavaLocalRef<jobject> window_android =
web_contents->GetNativeView()->GetWindowAndroid()->GetJavaObject();
JNIEnv* env = base::android::AttachCurrentThread();
+ // Permission delegation means the permission request should be
+ // attributed to the main frame.
+ const auto origin = url::Origin::Create(
+ permissions::PermissionUtil::GetLastCommittedOriginAsURL(
+ render_frame_host->GetMainFrame()));
base::android::ScopedJavaLocalRef<jstring> origin_string =
base::android::ConvertUTF16ToJavaString(
- env, url_formatter::FormatOriginForSecurityDisplay(
- render_frame_host->GetLastCommittedOrigin()));
+ env, url_formatter::FormatOriginForSecurityDisplay(origin));
SecurityStateTabHelper* helper =
SecurityStateTabHelper::FromWebContents(web_contents);
DCHECK(helper);
@@ -64,9 +102,11 @@ std::unique_ptr<UsbChooserDialogAndroid> UsbChooserDialogAndroid::Create(
auto dialog = std::make_unique<UsbChooserDialogAndroid>(std::move(controller),
std::move(on_close));
- dialog->java_dialog_.Reset(Java_UsbChooserDialog_create(
- env, window_android, origin_string, helper->GetSecurityLevel(),
- j_profile_android, reinterpret_cast<intptr_t>(dialog.get())));
+
+ dialog->java_dialog_.Reset(
+ std::move(create_java_dialog_callback)
+ .Run(env, window_android, origin_string, helper->GetSecurityLevel(),
+ j_profile_android, reinterpret_cast<intptr_t>(dialog.get())));
if (dialog->java_dialog_.is_null())
return nullptr;
@@ -9,6 +9,9 @@
#include <string>
#include <vector>
+#include "base/android/jni_android.h"
+#include "base/android/jni_int_wrapper.h"
+#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/callback.h"
#include "components/permissions/chooser_controller.h"
@@ -21,6 +24,16 @@ class RenderFrameHost;
// options.
class UsbChooserDialogAndroid : public permissions::ChooserController::View {
public:
+ // The callback type for creating the java dialog object.
+ using CreateJavaDialogCallback =
+ base::OnceCallback<base::android::ScopedJavaLocalRef<jobject>(
+ JNIEnv*,
+ const base::android::JavaRef<jobject>&,
+ const base::android::JavaRef<jstring>&,
+ JniIntWrapper,
+ const base::android::JavaRef<jobject>&,
+ jlong)>;
+
// Creates and shows the dialog. Will return nullptr if the dialog was not
// displayed. Otherwise |on_close| will be called when the user closes the
// dialog.
@@ -29,6 +42,13 @@ class UsbChooserDialogAndroid : public permissions::ChooserController::View {
std::unique_ptr<permissions::ChooserController> controller,
base::OnceClosure on_close);
+ static std::unique_ptr<UsbChooserDialogAndroid> CreateForTesting(
+ content::RenderFrameHost* render_frame_host,
+ std::unique_ptr<permissions::ChooserController> controller,
+ base::OnceClosure on_close,
+ UsbChooserDialogAndroid::CreateJavaDialogCallback
+ create_java_dialog_callback);
+
explicit UsbChooserDialogAndroid(
std::unique_ptr<permissions::ChooserController> controller,
base::OnceClosure on_close);
@@ -56,6 +76,13 @@ class UsbChooserDialogAndroid : public permissions::ChooserController::View {
// Called when the chooser dialog is closed.
void Cancel();
+ static std::unique_ptr<UsbChooserDialogAndroid> CreateInternal(
+ content::RenderFrameHost* render_frame_host,
+ std::unique_ptr<permissions::ChooserController> controller,
+ base::OnceClosure on_close,
+ UsbChooserDialogAndroid::CreateJavaDialogCallback
+ create_java_dialog_callback);
+
std::unique_ptr<permissions::ChooserController> controller_;
base::OnceClosure on_close_;
new file mode 100644
@@ -0,0 +1,63 @@
+// Copyright 2022 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h"
+
+#include <string>
+
+#include "base/test/bind.h"
+#include "base/test/mock_callback.h"
+#include "chrome/browser/ssl/security_state_tab_helper.h"
+#include "chrome/browser/usb/usb_chooser_controller.h"
+#include "chrome/test/base/chrome_render_view_host_test_harness.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/test/navigation_simulator.h"
+#include "services/device/public/mojom/usb_enumeration_options.mojom.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/android/window_android.h"
+
+namespace {
+
+using UsbChooserDialogAndroidTest = ChromeRenderViewHostTestHarness;
+using testing::_;
+
+TEST_F(UsbChooserDialogAndroidTest, FrameTree) {
+ NavigateAndCommit(GURL("https://main-frame.com"));
+ content::RenderFrameHost* subframe =
+ content::NavigationSimulator::NavigateAndCommitFromDocument(
+ GURL("https://sub-frame.com"),
+ content::RenderFrameHostTester::For(main_rfh())
+ ->AppendChild("subframe"));
+
+ auto controller = std::make_unique<UsbChooserController>(
+ main_rfh(), std::vector<device::mojom::UsbDeviceFilterPtr>(),
+ base::BindLambdaForTesting(
+ [](device::mojom::UsbDeviceInfoPtr usb_device_info) {}));
+
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderFrameHost(main_rfh());
+ std::unique_ptr<ui::WindowAndroid::ScopedWindowAndroidForTesting> window =
+ ui::WindowAndroid::CreateForTesting();
+ window.get()->get()->AddChild(web_contents->GetNativeView());
+ SecurityStateTabHelper::CreateForWebContents(web_contents);
+
+ base::MockCallback<UsbChooserDialogAndroid::CreateJavaDialogCallback>
+ mock_callback;
+ auto origin_predicate =
+ [&](const base::android::JavaRef<jstring>& java_string) {
+ return base::android::ConvertJavaStringToUTF16(
+ base::android::AttachCurrentThread(), java_string) ==
+ u"https://main-frame.com";
+ };
+ EXPECT_CALL(mock_callback, Run(/*env=*/_, /*window_android=*/_,
+ testing::Truly(origin_predicate),
+ /*security_level=*/_, /*profile=*/_,
+ /*native_usb_chooser_dialog_ptr=*/_));
+ UsbChooserDialogAndroid::CreateForTesting(subframe, std::move(controller),
+ base::BindLambdaForTesting([]() {}),
+ mock_callback.Get());
+}
+
+} // namespace
@@ -3044,6 +3044,7 @@ bool Browser::ShouldCreateBackgroundContents(
content::SiteInstance* source_site_instance,
const GURL& opener_url,
const std::string& frame_name) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_BACKGROUND_CONTENTS)
extensions::ExtensionSystem* extension_system =
extensions::ExtensionSystem::Get(profile_);
@@ -3076,6 +3077,9 @@ bool Browser::ShouldCreateBackgroundContents(
}
return true;
+#else
+ return false;
+#endif
}
BackgroundContents* Browser::CreateBackgroundContents(
@@ -3087,6 +3091,7 @@ BackgroundContents* Browser::CreateBackgroundContents(
const GURL& target_url,
const content::StoragePartitionId& partition_id,
content::SessionStorageNamespace* session_storage_namespace) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_BACKGROUND_CONTENTS)
BackgroundContentsService* service =
BackgroundContentsServiceFactory::GetForProfile(profile_);
const Extension* extension = extensions::ExtensionRegistry::Get(profile_)
@@ -3130,4 +3135,7 @@ BackgroundContents* Browser::CreateBackgroundContents(
std::string()); // No extra headers.
return contents;
+#else
+ return nullptr;
+#endif
}
@@ -815,9 +815,11 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
case IDC_DISTILL_PAGE:
ToggleDistilledView(browser_);
break;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
case IDC_ROUTE_MEDIA:
RouteMediaInvokedFromAppMenu(browser_);
break;
+#endif
case IDC_WINDOW_MUTE_SITE:
MuteSite(browser_);
break;
@@ -1595,8 +1597,10 @@ void BrowserCommandController::UpdateCommandsForMediaRouter() {
if (is_locked_fullscreen_)
return;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
command_updater_.UpdateCommandEnabled(IDC_ROUTE_MEDIA,
CanRouteMedia(browser_));
+#endif
}
void BrowserCommandController::UpdateCommandsForTabKeyboardFocus(
@@ -31,7 +31,6 @@
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/favicon/favicon_utils.h"
#include "chrome/browser/lifetime/application_lifetime.h"
-#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_service.h"
@@ -105,8 +104,6 @@
#include "components/find_in_page/find_tab_helper.h"
#include "components/find_in_page/find_types.h"
#include "components/google/core/common/google_util.h"
-#include "components/media_router/browser/media_router_dialog_controller.h" // nogncheck
-#include "components/media_router/browser/media_router_metrics.h"
#include "components/omnibox/browser/omnibox_prefs.h"
#include "components/prefs/pref_service.h"
#include "components/reading_list/core/reading_list_entry.h"
@@ -175,6 +172,12 @@
#include "chromeos/lacros/lacros_service.h"
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/media/router/media_router_feature.h"
+#include "components/media_router/browser/media_router_dialog_controller.h" // nogncheck
+#include "components/media_router/browser/media_router_metrics.h"
+#endif
+
namespace {
const char kOsOverrideForTabletSite[] = "Linux; Android 9; Chrome tablet";
@@ -1402,13 +1405,18 @@ bool CanBasicPrint(Browser* browser) {
#endif // BUILDFLAG(ENABLE_PRINTING)
bool CanRouteMedia(Browser* browser) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
// Do not allow user to open Media Router dialog when there is already an
// active modal dialog. This avoids overlapping dialogs.
return media_router::MediaRouterEnabled(browser->profile()) &&
!IsShowingWebContentsModalDialog(browser);
+#else
+ return false;
+#endif
}
void RouteMediaInvokedFromAppMenu(Browser* browser) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
DCHECK(CanRouteMedia(browser));
media_router::MediaRouterDialogController* dialog_controller =
@@ -1419,6 +1427,7 @@ void RouteMediaInvokedFromAppMenu(Browser* browser) {
dialog_controller->ShowMediaRouterDialog(
media_router::MediaRouterDialogOpenOrigin::APP_MENU);
+#endif
}
void CutCopyPaste(Browser* browser, int command_id) {
@@ -496,7 +496,7 @@ void ShowExtensionInstallFrictionDialog(
// Returns a OnceClosure that client code can call to close the device chooser.
// This OnceClosure references the actual dialog as a WeakPtr, so it's safe to
// call at any point.
-#if defined(TOOLKIT_VIEWS)
+#if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_OHOS)
base::OnceClosure ShowDeviceChooserDialog(
content::RenderFrameHost* owner,
std::unique_ptr<permissions::ChooserController> controller);
@@ -40,15 +40,13 @@ ExtensionInstalledWaiter::ExtensionInstalledWaiter(
done_callback_(std::move(done_callback)) {
extension_registry_observation_.Observe(
extensions::ExtensionRegistry::Get(browser->profile()));
- removal_watcher_ = std::make_unique<ExtensionRemovalWatcher>(
- browser, extension,
- base::BindOnce(&ExtensionInstalledWaiter::OnExtensionRemoved,
- weak_factory_.GetWeakPtr()));
+ BrowserList::AddObserver(this);
}
ExtensionInstalledWaiter::~ExtensionInstalledWaiter() {
if (done_callback_ && g_giving_up_callback)
g_giving_up_callback->Run();
+ BrowserList::RemoveObserver(this);
}
void ExtensionInstalledWaiter::RunCallbackIfExtensionInstalled() {
@@ -79,6 +77,15 @@ void ExtensionInstalledWaiter::OnExtensionLoaded(
weak_factory_.GetWeakPtr()));
}
-void ExtensionInstalledWaiter::OnExtensionRemoved() {
- delete this;
+void ExtensionInstalledWaiter::OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UnloadedExtensionReason reason) {
+ if (extension == extension_.get())
+ delete this;
+}
+
+void ExtensionInstalledWaiter::OnBrowserClosing(Browser* browser) {
+ if (browser == browser_)
+ delete this;
}
@@ -9,7 +9,7 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/scoped_observation.h"
-#include "chrome/browser/ui/extensions/extension_removal_watcher.h"
+#include "chrome/browser/ui/browser_list_observer.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_registry_observer.h"
@@ -17,7 +17,8 @@ class Browser;
// ExtensionInstalledWaiter is used to wait for a given extension to be
// installed in a given browser's profile.
-class ExtensionInstalledWaiter : public extensions::ExtensionRegistryObserver {
+class ExtensionInstalledWaiter : public extensions::ExtensionRegistryObserver,
+ public BrowserListObserver {
public:
// Wait until both:
// 1. |extension| is installed into |browser|
@@ -57,8 +58,12 @@ class ExtensionInstalledWaiter : public extensions::ExtensionRegistryObserver {
// ExtensionRegistryObserver:
void OnExtensionLoaded(content::BrowserContext* browser_context,
const extensions::Extension* extension) override;
+ void OnExtensionUnloaded(content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UnloadedExtensionReason reason) override;
- void OnExtensionRemoved();
+ // BrowserListObserver:
+ void OnBrowserClosing(Browser* browser) override;
const scoped_refptr<const extensions::Extension> extension_;
const raw_ptr<const Browser> browser_;
@@ -68,8 +73,6 @@ class ExtensionInstalledWaiter : public extensions::ExtensionRegistryObserver {
extensions::ExtensionRegistryObserver>
extension_registry_observation_{this};
- std::unique_ptr<ExtensionRemovalWatcher> removal_watcher_;
-
base::WeakPtrFactory<ExtensionInstalledWaiter> weak_factory_{this};
};
deleted file mode 100644
@@ -1,36 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/extensions/extension_removal_watcher.h"
-
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_list.h"
-
-ExtensionRemovalWatcher::ExtensionRemovalWatcher(
- Browser* browser,
- scoped_refptr<const extensions::Extension> extension,
- base::OnceClosure callback)
- : browser_(browser), extension_(extension), callback_(std::move(callback)) {
- extension_registry_observation_.Observe(
- extensions::ExtensionRegistry::Get(browser->profile()));
- BrowserList::AddObserver(this);
-}
-
-ExtensionRemovalWatcher::~ExtensionRemovalWatcher() {
- BrowserList::RemoveObserver(this);
-}
-
-void ExtensionRemovalWatcher::OnBrowserClosing(Browser* browser) {
- if (browser == browser_ && callback_)
- std::move(callback_).Run();
-}
-
-void ExtensionRemovalWatcher::OnExtensionUnloaded(
- content::BrowserContext* browser_context,
- const extensions::Extension* extension,
- extensions::UnloadedExtensionReason reason) {
- if (extension == extension_.get() && callback_)
- std::move(callback_).Run();
-}
deleted file mode 100644
@@ -1,46 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_REMOVAL_WATCHER_H_
-#define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_REMOVAL_WATCHER_H_
-
-#include "base/callback.h"
-#include "base/memory/raw_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "base/scoped_observation.h"
-#include "chrome/browser/ui/browser_list_observer.h"
-#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/extension_registry_observer.h"
-
-// ExtensionRemovalWatcher watches a browser and an extension for either:
-// 1) The browser being closed, or
-// 2) The extension being uninstalled from the browser's profile
-// and in either case, invokes the provided callback.
-class ExtensionRemovalWatcher : public BrowserListObserver,
- public extensions::ExtensionRegistryObserver {
- public:
- ExtensionRemovalWatcher(Browser* browser,
- scoped_refptr<const extensions::Extension> extension,
- base::OnceClosure callback);
- ~ExtensionRemovalWatcher() override;
-
- private:
- // ExtensionRegistryObserver:
- void OnExtensionUnloaded(content::BrowserContext* browser_context,
- const extensions::Extension* extension,
- extensions::UnloadedExtensionReason reason) override;
-
- // BrowserListObserver:
- void OnBrowserClosing(Browser* browser) override;
-
- raw_ptr<const Browser> browser_;
- const scoped_refptr<const extensions::Extension> extension_;
- base::OnceClosure callback_;
-
- base::ScopedObservation<extensions::ExtensionRegistry,
- extensions::ExtensionRegistryObserver>
- extension_registry_observation_{this};
-};
-
-#endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_REMOVAL_WATCHER_H_
@@ -135,13 +135,11 @@ WellKnownChangePasswordNavigationThrottle::WillProcessResponse() {
// PostTask because the Throttle needs to be deferred before the status code
// is set. After setting the status code Resume() can be called synchronous
// and thereby before the throttle is deferred. This would result in a crash.
- // Unretained is safe because the NavigationThrottle is deferred and can only
- // be continued after the callback finished.
base::SequencedTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(
&WellKnownChangePasswordState::SetChangePasswordResponseCode,
- base::Unretained(&well_known_change_password_state_),
+ weak_ptr_factory_.GetWeakPtr(),
navigation_handle()->GetResponseHeaders()->response_code()));
return NavigationThrottle::DEFER;
}
@@ -66,6 +66,8 @@ class WellKnownChangePasswordNavigationThrottle
well_known_change_password_state_{this};
ukm::SourceId source_id_ = ukm::kInvalidSourceId;
raw_ptr<password_manager::AffiliationService> affiliation_service_ = nullptr;
+ base::WeakPtrFactory<password_manager::WellKnownChangePasswordState>
+ weak_ptr_factory_{&well_known_change_password_state_};
};
#endif // CHROME_BROWSER_UI_PASSWORDS_WELL_KNOWN_CHANGE_PASSWORD_NAVIGATION_THROTTLE_H_
@@ -60,7 +60,6 @@
#include "components/dom_distiller/content/browser/uma_helper.h"
#include "components/dom_distiller/core/dom_distiller_features.h"
#include "components/dom_distiller/core/url_utils.h"
-#include "components/media_router/browser/media_router_metrics.h"
#include "components/prefs/pref_service.h"
#include "components/profile_metrics/browser_profile_type.h"
#include "components/signin/public/base/signin_metrics.h"
@@ -104,6 +103,10 @@
#include "content/public/browser/gpu_data_manager.h"
#endif
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "components/media_router/browser/media_router_metrics.h"
+#endif
+
using base::UserMetricsAction;
using content::WebContents;
@@ -483,6 +486,7 @@ void AppMenuModel::LogMenuMetrics(int command_id) {
LogMenuAction(MENU_ACTION_PRINT);
break;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
case IDC_ROUTE_MEDIA:
if (!uma_action_recorded_)
UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Cast", delta);
@@ -492,6 +496,7 @@ void AppMenuModel::LogMenuMetrics(int command_id) {
media_router::MediaRouterMetrics::RecordMediaRouterDialogOrigin(
media_router::MediaRouterDialogOpenOrigin::APP_MENU);
break;
+#endif
// Edit menu.
case IDC_CUT:
@@ -826,8 +831,10 @@ void AppMenuModel::Build() {
AddItemWithStringId(IDC_PRINT, IDS_PRINT);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
if (media_router::MediaRouterEnabled(browser()->profile()))
AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE);
+#endif
AddItemWithStringId(IDC_FIND, IDS_FIND);
@@ -16,11 +16,9 @@
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_views_delegate.h"
#include "chrome/browser/ui/views/devtools_process_observer.h"
-#include "chrome/browser/ui/views/media_router/media_router_dialog_controller_views.h"
#include "chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller.h"
#include "chrome/common/chrome_paths.h"
#include "components/constrained_window/constrained_window_views.h"
-#include "components/media_router/browser/media_router_dialog_controller.h"
#include "components/ui_devtools/connector_delegate.h"
#include "components/ui_devtools/switches.h"
#include "components/ui_devtools/views/devtools_server_util.h"
@@ -53,6 +51,11 @@
#include "ui/base/l10n/l10n_util.h"
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/ui/views/media_router/media_router_dialog_controller_views.h"
+#include "components/media_router/browser/media_router_dialog_controller.h"
+#endif
+
namespace {
// Owned by ChromeBrowserMainParts.
@@ -121,6 +124,7 @@ void ChromeBrowserMainExtraPartsViews::PreProfileInit() {
CreateUiDevTools();
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
media_router::MediaRouterDialogController::SetGetOrCreate(
base::BindRepeating([](content::WebContents* web_contents) {
DCHECK(web_contents);
@@ -133,6 +137,7 @@ void ChromeBrowserMainExtraPartsViews::PreProfileInit() {
web_contents);
return controller;
}));
+#endif
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
@@ -11,10 +11,16 @@
#include <vector>
#include "base/memory/raw_ptr.h"
-#include "chrome/browser/ui/media_router/cast_dialog_controller.h"
#include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_bubble_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h"
+#if BUILDFLAG(IS_OHOS)
+#include "media/media_buildflags.h"
+#if BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/ui/media_router/cast_dialog_controller.h"
+#endif
+#endif
+
namespace content {
class WebContents;
} // namespace content
@@ -47,10 +47,7 @@
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/top_container_background.h"
-#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_contextual_menu.h"
-#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h"
#include "chrome/browser/ui/views/location_bar/star_view.h"
-#include "chrome/browser/ui/views/media_router/cast_toolbar_button.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_container.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_controller.h"
#include "chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_toolbar_icon_view.h"
@@ -130,6 +127,12 @@
#include "chrome/browser/ui/views/side_search/side_search_browser_controller.h"
#endif // BUILDFLAG(ENABLE_SIDE_SEARCH)
+#if !BUILDFLAG(IS_OHOS)
+#include "chrome/browser/ui/views/media_router/cast_toolbar_button.h"
+#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_contextual_menu.h"
+#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h"
+#endif
+
using base::UserMetricsAction;
using content::WebContents;
@@ -255,6 +258,7 @@ void ToolbarView::Init() {
extensions_container =
std::make_unique<ExtensionsToolbarContainer>(browser_);
}
+#if !BUILDFLAG(IS_OHOS)
std::unique_ptr<media_router::CastToolbarButton> cast;
if (media_router::MediaRouterEnabled(browser_->profile()))
cast = media_router::CastToolbarButton::Create(browser_);
@@ -264,6 +268,7 @@ void ToolbarView::Init() {
media_button = std::make_unique<MediaToolbarButtonView>(
browser_view_, MediaToolbarButtonContextualMenu::Create(browser_));
}
+#endif
std::unique_ptr<DownloadToolbarButtonView> download_button;
if (base::FeatureList::IsEnabled(features::kDownloadBubble)) {
@@ -345,11 +350,13 @@ void ToolbarView::Init() {
}
}
+#if !BUILDFLAG(IS_OHOS)
if (cast)
cast_ = AddChildView(std::move(cast));
if (media_button)
media_button_ = AddChildView(std::move(media_button));
+#endif
if (download_button)
download_button_ = AddChildView(std::move(download_button));
@@ -144,8 +144,10 @@ void WebAppMenuModel::Build() {
AddSeparator(ui::UPPER_SEPARATOR);
AddItemWithStringId(IDC_PRINT, IDS_PRINT);
AddItemWithStringId(IDC_FIND, IDS_FIND);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
if (media_router::MediaRouterEnabled(browser()->profile()))
AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE);
+#endif
AddSeparator(ui::LOWER_SEPARATOR);
CreateCutCopyPasteMenu();
}
@@ -120,9 +120,7 @@
#include "components/feed/buildflags.h"
#include "components/feed/feed_feature_list.h"
#else // BUILDFLAG(IS_ANDROID)
-#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/ui/ui_features.h"
-#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h"
#include "chrome/browser/ui/webui/app_service_internals/app_service_internals_ui.h"
#include "chrome/browser/ui/webui/bookmarks/bookmarks_ui.h"
#include "chrome/browser/ui/webui/commander/commander_ui.h"
@@ -135,7 +133,6 @@
#include "chrome/browser/ui/webui/image_editor/image_editor_ui.h"
#include "chrome/browser/ui/webui/inspect_ui.h"
#include "chrome/browser/ui/webui/management/management_ui.h"
-#include "chrome/browser/ui/webui/media_router/media_router_internals_ui.h"
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.h"
#include "chrome/browser/ui/webui/new_tab_page_third_party/new_tab_page_third_party_ui.h"
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
@@ -368,6 +365,12 @@
#include "chrome/browser/ui/webui/chromeos/chromebox_for_meetings/network_settings_dialog.h"
#endif // BUILDFLAG(PLATFORM_CFM)
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/media/router/media_router_feature.h"
+#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h"
+#include "chrome/browser/ui/webui/media_router/media_router_internals_ui.h"
+#endif
+
using content::WebUI;
using content::WebUIController;
using ui::WebDialogUI;
@@ -791,10 +794,12 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<SyncFileSystemInternalsUI>;
if (url.host_piece() == chrome::kChromeUISystemInfoHost)
return &NewWebUI<SystemInfoUI>;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
if (base::FeatureList::IsEnabled(features::kAccessCodeCastUI)) {
if (url.host_piece() == chrome::kChromeUIAccessCodeCastHost)
return &NewWebUI<AccessCodeCastUI>;
}
+#endif
if (base::FeatureList::IsEnabled(features::kSupportTool) &&
url.host_piece() == chrome::kChromeUISupportToolHost)
return &NewWebUI<SupportToolUI>;
@@ -1126,11 +1131,13 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
base::FeatureList::IsEnabled(features::kChromeWhatsNewUI)) {
return &NewWebUI<WhatsNewUI>;
}
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER)
if (url.host_piece() == chrome::kChromeUIMediaRouterInternalsHost &&
media_router::MediaRouterEnabled(profile)) {
return &NewWebUI<media_router::MediaRouterInternalsUI>;
}
#endif
+#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
BUILDFLAG(IS_ANDROID)
if (url.host_piece() == chrome::kChromeUISandboxHost) {
@@ -421,11 +421,13 @@ void InlineSigninHelper::OnClientOAuthSuccessAndBrowserOpened(
// Display a confirmation dialog to the user.
base::RecordAction(
base::UserMetricsAction("Signin_Show_UntrustedSigninPrompt"));
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN)
Browser* browser = chrome::FindLastActiveWithProfile(profile_);
browser->window()->ShowOneClickSigninConfirmation(
base::UTF8ToUTF16(email_),
base::BindOnce(&InlineSigninHelper::UntrustedSigninConfirmed,
base::Unretained(this), result.refresh_token));
+#endif
return;
}
CreateSyncStarter(result.refresh_token);
@@ -21,7 +21,7 @@
#include "base/enterprise_util.h"
#endif
-#if defined(TOOLKIT_VIEWS)
+#if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_OHOS)
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
@@ -66,7 +66,7 @@ bool IsEnterpriseManaged() {
#endif
}
-#if defined(TOOLKIT_VIEWS)
+#if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_OHOS)
ui::NativeTheme* GetNativeTheme(content::WebContents* web_contents) {
ui::NativeTheme* native_theme = nullptr;
@@ -39,7 +39,7 @@ void SetupWebUIDataSource(content::WebUIDataSource* source,
// false.
bool IsEnterpriseManaged();
-#if defined(TOOLKIT_VIEWS)
+#if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_OHOS)
// Returns whether WebContents should use dark mode colors depending on the
// theme.
ui::NativeTheme* GetNativeTheme(content::WebContents* web_contents);
@@ -58,7 +58,7 @@ template("chrome_repack_percent") {
deps += invoker.deps
}
- if (toolkit_views || is_ohos) {
+ if (toolkit_views) {
sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ]
deps += [ "//ui/views/resources" ]
}
@@ -143,7 +143,7 @@ template("chrome_extra_paks") {
deps += [ "//ohos_nweb_ex/overrides/ui/resources" ]
}
- if (!is_android) {
+ if (!is_android && !is_ohos) {
# New paks should be added here by default.
sources += [
"$root_gen_dir/chrome/access_code_cast_resources.pak",
@@ -326,7 +326,7 @@ template("chrome_extra_paks") {
sources += [ "$root_gen_dir/chrome/webui_js_error_resources.pak" ]
deps += [ "//chrome/browser/resources/webui_js_error:resources" ]
}
- if (!is_android && !is_chromeos_ash) {
+ if (!is_android && !is_chromeos_ash && !is_ohos) {
sources += [
"$root_gen_dir/chrome/apps_resources.pak",
"$root_gen_dir/chrome/profile_picker_resources.pak",
@@ -249,6 +249,10 @@ static_library("common") {
"//components/page_load_metrics/common:common",
]
+ if (is_ohos && !ohos_enable_media_router) {
+ public_deps -= [ "//components/cast_certificate" ]
+ }
+
if (enable_pdf) {
deps += [ "//components/pdf/common" ]
}
@@ -33,8 +33,9 @@ declare_args() {
builtin_cert_verifier_policy_supported = is_mac
# Enables support for background apps.
- enable_background_contents = !is_android && !is_chromecast
- enable_background_mode = !is_android && !is_chromecast && !is_chromeos
+ enable_background_contents = !is_android && !is_chromecast && !is_ohos
+ enable_background_mode =
+ !is_android && !is_chromecast && !is_chromeos && !is_ohos
# Enable the printing system dialog for platforms that support printing
# and have a system dialog.
@@ -53,7 +54,7 @@ declare_args() {
enable_one_click_signin = is_win || is_mac || is_fuchsia ||
((is_linux || is_chromeos_lacros) && !is_chromecast)
- enable_service_discovery = (enable_mdns && !is_android) || is_mac
+ enable_service_discovery = (enable_mdns && !is_android && !is_ohos) || is_mac
# Enables use of the session service, which is enabled by default.
# Android stores them separately on the Java side.
@@ -12,6 +12,9 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/metrics/histogram_functions.h"
+#include "base/task/task_runner.h"
+#include "base/task/task_traits.h"
+#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/services/speech/soda/proto/soda_api.pb.h"
@@ -190,7 +193,6 @@ SpeechRecognitionRecognizerImpl::SpeechRecognitionRecognizerImpl(
&SpeechRecognitionRecognizerImpl::OnRecognitionStoppedCallback,
weak_factory_.GetWeakPtr()));
- // Unretained is safe because |this| owns the mojo::Remote.
client_remote_.set_disconnect_handler(
base::BindOnce(&SpeechRecognitionRecognizerImpl::OnClientHostDisconnected,
weak_factory_.GetWeakPtr()));
@@ -300,13 +302,40 @@ void SpeechRecognitionRecognizerImpl::OnLanguageChanged(
if (language_code == language_ || language_code == LanguageCode::kNone)
return;
- language_ = language_component_config.value().language_code;
- base::FilePath config_path = GetLatestSodaLanguagePackDirectory(language);
- if (base::PathExists(config_path)) {
+ if (!task_runner_) {
+ task_runner_ = base::ThreadPool::CreateSequencedTaskRunner(
+ {base::MayBlock(), base::TaskPriority::BEST_EFFORT,
+ base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
+ }
+
+ // Changing the language requires a blocking call to check if the language
+ // pack exists on the device.
+ scoped_refptr<base::SequencedTaskRunner> current_task_runner =
+ base::SequencedTaskRunnerHandle::Get();
+
+ base::FilePath config_file_path =
+ GetLatestSodaLanguagePackDirectory(language);
+
+ task_runner_->PostTaskAndReplyWithResult(
+ FROM_HERE,
+ base::BindOnce(
+ [](base::FilePath config_path) {
+ return base::PathExists(config_path);
+ },
+ config_file_path),
+ base::BindOnce(&SpeechRecognitionRecognizerImpl::ResetSodaWithNewLanguage,
+ weak_factory_.GetWeakPtr(), config_file_path,
+ language_code));
+}
+
+void SpeechRecognitionRecognizerImpl::ResetSodaWithNewLanguage(
+ base::FilePath config_path,
+ speech::LanguageCode language_code,
+ bool config_exists) {
+ if (config_exists) {
config_path_ = config_path;
+ language_ = language_code;
ResetSoda();
- } else {
- NOTREACHED();
}
}
@@ -106,6 +106,9 @@ class SpeechRecognitionRecognizerImpl
private:
void OnLanguageChanged(const std::string& language) final;
+ void ResetSodaWithNewLanguage(base::FilePath config_path,
+ speech::LanguageCode language_code,
+ bool config_exists);
void RecordDuration();
// Called as a response to sending a SpeechRecognitionEvent to the client
@@ -145,6 +148,8 @@ class SpeechRecognitionRecognizerImpl
// Whether the client is still requesting speech recognition.
bool is_client_requesting_speech_recognition_ = true;
+ scoped_refptr<base::SequencedTaskRunner> task_runner_;
+
base::WeakPtrFactory<SpeechRecognitionRecognizerImpl> weak_factory_{this};
};
@@ -4958,6 +4958,7 @@ test("unit_tests") {
"../browser/search/contextual_search_policy_handler_android_unittest.cc",
"../browser/translate/android/translate_bridge_unittest.cc",
"../browser/ui/android/autofill/save_card_message_controller_android_unittest.cc",
+ "../browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc",
"../browser/ui/android/tab_model/tab_model_list_unittest.cc",
"../browser/ui/android/toolbar/location_bar_model_android_unittest.cc",
]
@@ -5875,6 +5876,7 @@ test("unit_tests") {
"//components/webapk:proto",
"//components/webapps/browser",
"//content/public/android:content_java",
+ "//ui/android",
"//ui/events/devices:test_support",
]
if (use_v8_context_snapshot) {
@@ -8007,7 +8009,11 @@ static_library("test_support_unit") {
}
}
-if (!is_android) {
+if (is_ohos) {
+ group("test_support_ui") {}
+}
+
+if (!is_android && !is_ohos) {
static_library("test_support_ui") {
defines = []
testonly = true
@@ -163,8 +163,7 @@ function testMulticast() {
var canceller = waitForMessage(serverSocketId, function (cancelled) {
clearTimeout(recvTimeout);
if (cancelled) {
- socket.destroy(serverSocketId);
- chrome.test.succeed();
+ leaveGroupAndDisconnect(serverSocketId);
} else {
chrome.test.fail("Received message after leaving the group");
socket.destroy(serverSocketId);
@@ -173,9 +172,20 @@ function testMulticast() {
testSendMessage(request);
recvTimeout = setTimeout(function () {
canceller();
+ }, 2000);
+ });
+ }
+
+ function leaveGroupAndDisconnect(serverSocketId) {
+ socket.joinGroup(serverSocketId, kMulticastAddress, function (result) {
+ chrome.test.assertNoLastError();
+ chrome.test.assertEq(0, result, "Join group failed.");
+ socket.leaveGroup(serverSocketId, kMulticastAddress, () => {
+ chrome.test.assertEq(0, result, "Leave group failed.");
socket.destroy(serverSocketId);
chrome.test.succeed();
- }, 2000);
+ });
+ socket.disconnect(serverSocketId);
});
}
@@ -195,4 +205,4 @@ function testMulticast() {
}
testMulticastSettings();
-}
\ No newline at end of file
+}
@@ -34,7 +34,14 @@ const char kHistogramsAttachmentName[] = "histograms.zip";
FeedbackData::FeedbackData(base::WeakPtr<feedback::FeedbackUploader> uploader,
TracingManager* tracing_manager)
- : uploader_(std::move(uploader)), tracing_manager_(tracing_manager) {}
+ : uploader_(std::move(uploader)) {
+ // If tracing is enabled, the tracing manager should have been created before
+ // sending the report. If it is created after this point, then the tracing is
+ // not relevant to this report.
+ if (tracing_manager) {
+ tracing_manager_ = base::AsWeakPtr(tracing_manager);
+ }
+}
FeedbackData::~FeedbackData() = default;
@@ -124,7 +124,7 @@ class FeedbackData : public FeedbackCommon {
std::string attached_file_uuid_ GUARDED_BY_CONTEXT(sequence_checker_);
std::string screenshot_uuid_ GUARDED_BY_CONTEXT(sequence_checker_);
- const raw_ptr<TracingManager> tracing_manager_ = nullptr; // Not owned.
+ base::WeakPtr<TracingManager> tracing_manager_;
int trace_id_ GUARDED_BY_CONTEXT(sequence_checker_) = 0;
int pending_op_count_ GUARDED_BY_CONTEXT(sequence_checker_) = 1;
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/memory/scoped_refptr.h"
+#include "base/memory/weak_ptr.h"
namespace base {
class RefCountedString;
@@ -24,7 +25,7 @@ using TraceDataCallback =
// of the performance data. That data can then be requested via GetTraceData().
// When the data is no longer needed, it should be discarded via
// DiscardTraceData().
-class TracingManager {
+class TracingManager : public base::SupportsWeakPtr<TracingManager> {
public:
virtual ~TracingManager();
@@ -14,7 +14,7 @@ declare_args() {
checkout_nacl && target_os != "ios" && !is_android && !is_fuchsia &&
!is_chromecast && current_cpu != "mipsel" && current_cpu != "mips64el" &&
target_cpu != "arm64" && !(is_win && host_os != "win") &&
- !(is_mac && (host_os != "mac" || target_cpu != "x64"))
+ !(is_mac && (host_os != "mac" || target_cpu != "x64")) && !is_ohos
}
assert(!(is_win && host_os != "win") || !enable_nacl,
@@ -5,7 +5,7 @@
declare_args() {
# Whether to enable OfflinePages support. Currently user-visible features
# are Android-only.
- enable_offline_pages = is_android || is_ohos
+ enable_offline_pages = is_android
# This enables test API for locally-built harness which is used for quality
# evaluations. Requires setting this variable manually at local environment.
@@ -8,7 +8,7 @@ declare_args() {
# This enables build with TFLite library.
# Currently only available for Desktop and Android.
build_with_tflite_lib = is_android || (is_win && target_cpu != "arm64") ||
- is_linux || is_mac || is_chromeos || is_fuchsia || is_ohos
+ is_linux || is_mac || is_chromeos || is_fuchsia
# You can set the variable 'build_with_internal_optimization_guide' to true
# even in a developer build in args.gn. Setting this variable explicitly to true will
@@ -25,5 +25,5 @@ declare_args() {
# Android and iOS should just work but are not included in the set we release for, so we do
# not needlessly increase the binary.
build_with_internal_optimization_guide =
- is_chrome_branded && !is_android && !is_ios && !is_fuchsia
+ is_chrome_branded && !is_android && !is_ios && !is_fuchsia && !is_ohos
}
@@ -665,9 +665,11 @@ class PdfAccessibilityTreeBuilder {
ax::mojom::Role::kPdfActionableHighlight,
ax::mojom::Restriction::kReadOnly, render_accessibility_, nodes_);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
highlight_node->AddStringAttribute(
ax::mojom::StringAttribute::kRoleDescription,
l10n_util::GetStringUTF8(IDS_AX_ROLE_DESCRIPTION_PDF_HIGHLIGHT));
+#endif
highlight_node->AddStringAttribute(ax::mojom::StringAttribute::kName,
std::string());
highlight_node->relative_bounds.bounds = highlight.bounds;
@@ -683,9 +685,11 @@ class PdfAccessibilityTreeBuilder {
CreateNode(ax::mojom::Role::kNote, ax::mojom::Restriction::kReadOnly,
render_accessibility_, nodes_);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
popup_note_node->AddStringAttribute(
ax::mojom::StringAttribute::kRoleDescription,
l10n_util::GetStringUTF8(IDS_AX_ROLE_DESCRIPTION_PDF_POPUP_NOTE));
+#endif
popup_note_node->relative_bounds.bounds = highlight.bounds;
ui::AXNodeData* static_popup_note_text_node = CreateNode(
@@ -1330,9 +1334,11 @@ void PdfAccessibilityTree::SetAccessibilityDocInfo(
doc_node_ =
CreateNode(ax::mojom::Role::kPdfRoot, ax::mojom::Restriction::kReadOnly,
render_accessibility, &nodes_);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
doc_node_->AddStringAttribute(ax::mojom::StringAttribute::kName,
l10n_util::GetPluralStringFUTF8(
IDS_PDF_DOCUMENT_PAGE_COUNT, page_count_));
+#endif
// Because all of the coordinates are expressed relative to the
// doc's coordinates, the origin of the doc must be (0, 0). Its
@@ -1371,9 +1377,11 @@ void PdfAccessibilityTree::SetAccessibilityPageInfo(
ui::AXNodeData* page_node =
CreateNode(ax::mojom::Role::kRegion, ax::mojom::Restriction::kReadOnly,
render_accessibility, &nodes_);
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
page_node->AddStringAttribute(
ax::mojom::StringAttribute::kName,
l10n_util::GetPluralStringFUTF8(IDS_PDF_PAGE_INDEX, page_index + 1));
+#endif
page_node->AddBoolAttribute(ax::mojom::BoolAttribute::kIsPageBreakingObject,
true);
@@ -123,7 +123,9 @@ int32_t PepperPDFHost::OnHostMsgDidStartLoading(
if (!render_frame)
return PP_ERROR_FAILED;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
render_frame->PluginDidStartLoading();
+#endif
return PP_OK;
}
@@ -133,7 +135,9 @@ int32_t PepperPDFHost::OnHostMsgDidStopLoading(
if (!render_frame)
return PP_ERROR_FAILED;
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
render_frame->PluginDidStopLoading();
+#endif
return PP_OK;
}
@@ -258,7 +258,11 @@ source_set("unit_tests") {
]
}
if (is_android) {
- sources += [ "android/permission_dialog_delegate_unittest.cc" ]
+ sources += [
+ "android/bluetooth_chooser_android_unittest.cc",
+ "android/bluetooth_scanning_prompt_android_unittest.cc",
+ "android/permission_dialog_delegate_unittest.cc"
+ ]
}
deps = [
":permissions",
@@ -271,6 +275,7 @@ source_set("unit_tests") {
"//components/content_settings/core/browser",
"//components/keyed_service/content",
"//components/prefs:test_support",
+ "//components/security_state/core",
"//components/strings:components_strings_grit",
"//components/ukm:test_support",
"//components/ukm/content",
@@ -289,6 +294,7 @@ source_set("unit_tests") {
"//components/location/android:location_settings_dialog_enums_java",
"//components/location/android:test_support",
"//components/permissions/android:test_support",
+ "//ui/android",
]
}
}
@@ -6,10 +6,12 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
+#include "base/functional/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "components/permissions/android/bluetooth_chooser_android_delegate.h"
#include "components/permissions/android/jni_headers/BluetoothChooserDialog_jni.h"
#include "components/permissions/constants.h"
+#include "components/permissions/permission_util.h"
#include "components/url_formatter/elide_url.h"
#include "content/public/browser/render_frame_host.h"
#include "ui/android/window_android.h"
@@ -22,14 +24,28 @@ using base::android::ScopedJavaLocalRef;
namespace permissions {
+namespace {
+
+BluetoothChooserAndroid::CreateJavaDialogCallback
+GetCreateJavaBluetoothChooserDialogCallback() {
+ return base::BindOnce(&Java_BluetoothChooserDialog_create);
+}
+
+} // namespace
+
BluetoothChooserAndroid::BluetoothChooserAndroid(
content::RenderFrameHost* frame,
const EventHandler& event_handler,
- std::unique_ptr<BluetoothChooserAndroidDelegate> delegate)
+ std::unique_ptr<BluetoothChooserAndroidDelegate> delegate,
+ CreateJavaDialogCallback create_java_dialog_callback)
: web_contents_(content::WebContents::FromRenderFrameHost(frame)),
event_handler_(event_handler),
delegate_(std::move(delegate)) {
- const url::Origin origin = frame->GetLastCommittedOrigin();
+ // Permission delegation means the permission request should be attributed to
+ // the main frame.
+ const url::Origin origin = url::Origin::Create(
+ permissions::PermissionUtil::GetLastCommittedOriginAsURL(
+ frame->GetMainFrame()));
DCHECK(!origin.opaque());
ScopedJavaLocalRef<jobject> window_android =
@@ -40,12 +56,22 @@ BluetoothChooserAndroid::BluetoothChooserAndroid(
ScopedJavaLocalRef<jstring> origin_string =
base::android::ConvertUTF16ToJavaString(
env, url_formatter::FormatOriginForSecurityDisplay(origin));
- java_dialog_.Reset(Java_BluetoothChooserDialog_create(
- env, window_android, origin_string,
- delegate_->GetSecurityLevel(web_contents_), delegate_->GetJavaObject(),
- reinterpret_cast<intptr_t>(this)));
+ java_dialog_.Reset(std::move(create_java_dialog_callback)
+ .Run(env, window_android, origin_string,
+ delegate_->GetSecurityLevel(web_contents_),
+ delegate_->GetJavaObject(),
+ reinterpret_cast<intptr_t>(this)));
}
+BluetoothChooserAndroid::BluetoothChooserAndroid(
+ content::RenderFrameHost* frame,
+ const EventHandler& event_handler,
+ std::unique_ptr<BluetoothChooserAndroidDelegate> delegate)
+ : BluetoothChooserAndroid(frame,
+ event_handler,
+ std::move(delegate),
+ GetCreateJavaBluetoothChooserDialogCallback()) {}
+
BluetoothChooserAndroid::~BluetoothChooserAndroid() {
if (!java_dialog_.is_null()) {
Java_BluetoothChooserDialog_closeDialog(AttachCurrentThread(),
@@ -7,7 +7,11 @@
#include <memory>
+#include "base/android/jni_android.h"
+#include "base/android/jni_int_wrapper.h"
+#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "content/public/browser/bluetooth_chooser.h"
#include "content/public/browser/web_contents.h"
@@ -20,6 +24,16 @@ class BluetoothChooserAndroidDelegate;
// options.
class BluetoothChooserAndroid : public content::BluetoothChooser {
public:
+ // The callback type for creating the java dialog object.
+ using CreateJavaDialogCallback =
+ base::OnceCallback<base::android::ScopedJavaLocalRef<jobject>(
+ JNIEnv*,
+ const base::android::JavaRef<jobject>&,
+ const base::android::JavaRef<jstring>&,
+ JniIntWrapper,
+ const base::android::JavaRef<jobject>&,
+ jlong)>;
+
// Both frame and event_handler must outlive the BluetoothChooserAndroid.
BluetoothChooserAndroid(
content::RenderFrameHost* frame,
@@ -52,8 +66,26 @@ class BluetoothChooserAndroid : public content::BluetoothChooser {
void ShowBluetoothAdapterOffLink(JNIEnv* env);
void ShowNeedLocationPermissionLink(JNIEnv* env);
+ static std::unique_ptr<BluetoothChooserAndroid> CreateForTesting(
+ content::RenderFrameHost* frame,
+ const EventHandler& event_handler,
+ std::unique_ptr<BluetoothChooserAndroidDelegate> delegate,
+ CreateJavaDialogCallback create_java_dialog_callback) {
+ // Using `new` to access a non-public constructor.
+ return base::WrapUnique(
+ new BluetoothChooserAndroid(frame, event_handler, std::move(delegate),
+ std::move(create_java_dialog_callback)));
+ }
+
private:
+ BluetoothChooserAndroid(
+ content::RenderFrameHost* frame,
+ const EventHandler& event_handler,
+ std::unique_ptr<BluetoothChooserAndroidDelegate> delegate,
+ CreateJavaDialogCallback create_java_dialog_callback);
+
void OpenURL(const char* url);
+
base::android::ScopedJavaGlobalRef<jobject> java_dialog_;
raw_ptr<content::WebContents> web_contents_;
new file mode 100644
@@ -0,0 +1,75 @@
+// Copyright 2022 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/permissions/android/bluetooth_chooser_android.h"
+
+#include <string>
+
+#include "base/test/bind.h"
+#include "base/test/mock_callback.h"
+#include "components/permissions/android/bluetooth_chooser_android_delegate.h"
+#include "components/security_state/core/security_state.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/test/navigation_simulator.h"
+#include "content/public/test/test_renderer_host.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/android/window_android.h"
+
+namespace permissions {
+
+namespace {
+
+using BluetoothChooserAndroidTest = content::RenderViewHostTestHarness;
+using testing::_;
+
+class FakeBluetoothChooserAndroidDelegate
+ : public BluetoothChooserAndroidDelegate {
+ base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override {
+ return base::android::ScopedJavaLocalRef<jobject>();
+ }
+ security_state::SecurityLevel GetSecurityLevel(
+ content::WebContents* web_contents) override {
+ return security_state::NONE;
+ }
+};
+
+TEST_F(BluetoothChooserAndroidTest, FrameTree) {
+ NavigateAndCommit(GURL("https://main-frame.com"));
+ content::RenderFrameHost* subframe =
+ content::NavigationSimulator::NavigateAndCommitFromDocument(
+ GURL("https://sub-frame.com"),
+ content::RenderFrameHostTester::For(main_rfh())
+ ->AppendChild("subframe"));
+
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderFrameHost(main_rfh());
+ std::unique_ptr<ui::WindowAndroid::ScopedWindowAndroidForTesting> window =
+ ui::WindowAndroid::CreateForTesting();
+ window.get()->get()->AddChild(web_contents->GetNativeView());
+
+ base::MockCallback<BluetoothChooserAndroid::CreateJavaDialogCallback>
+ mock_callback;
+ auto origin_predicate =
+ [&](const base::android::JavaRef<jstring>& java_string) {
+ return base::android::ConvertJavaStringToUTF16(
+ base::android::AttachCurrentThread(), java_string) ==
+ u"https://main-frame.com";
+ };
+ EXPECT_CALL(mock_callback, Run(/*env=*/_, /*window_android=*/_,
+ testing::Truly(origin_predicate),
+ /*security_level=*/_, /*delegate=*/_,
+ /*native_bluetooth_chooser_dialog_ptr=*/_));
+
+ BluetoothChooserAndroid::CreateForTesting(
+ subframe,
+ base::BindLambdaForTesting([](content::BluetoothChooserEvent evt,
+ const std::string& opt_device_id) {}),
+ std::make_unique<FakeBluetoothChooserAndroidDelegate>(),
+ mock_callback.Get());
+}
+
+} // namespace
+
+} // namespace permissions
@@ -9,6 +9,7 @@
#include "base/strings/utf_string_conversions.h"
#include "components/permissions/android/bluetooth_scanning_prompt_android_delegate.h"
#include "components/permissions/android/jni_headers/BluetoothScanningPermissionDialog_jni.h"
+#include "components/permissions/permission_util.h"
#include "components/url_formatter/elide_url.h"
#include "content/public/browser/render_frame_host.h"
#include "ui/android/window_android.h"
@@ -22,14 +23,28 @@ using base::android::ScopedJavaLocalRef;
namespace permissions {
+namespace {
+
+BluetoothScanningPromptAndroid::CreateJavaDialogCallback
+GetCreateJavaBluetoothScanningPromptCallback() {
+ return base::BindOnce(&Java_BluetoothScanningPermissionDialog_create);
+}
+
+} // namespace
+
BluetoothScanningPromptAndroid::BluetoothScanningPromptAndroid(
content::RenderFrameHost* frame,
const content::BluetoothScanningPrompt::EventHandler& event_handler,
- std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate)
+ std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate,
+ CreateJavaDialogCallback create_java_dialog_callback)
: web_contents_(content::WebContents::FromRenderFrameHost(frame)),
event_handler_(event_handler),
delegate_(std::move(delegate)) {
- const url::Origin origin = frame->GetLastCommittedOrigin();
+ // Permission delegation means the permission request should be attributed to
+ // the main frame.
+ const url::Origin origin = url::Origin::Create(
+ permissions::PermissionUtil::GetLastCommittedOriginAsURL(
+ frame->GetMainFrame()));
DCHECK(!origin.opaque());
ScopedJavaLocalRef<jobject> window_android =
@@ -39,12 +54,23 @@ BluetoothScanningPromptAndroid::BluetoothScanningPromptAndroid(
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jstring> origin_string = ConvertUTF16ToJavaString(
env, url_formatter::FormatUrlForSecurityDisplay(origin.GetURL()));
- java_dialog_.Reset(Java_BluetoothScanningPermissionDialog_create(
- env, window_android, origin_string,
- delegate_->GetSecurityLevel(web_contents_), delegate_->GetJavaObject(),
- reinterpret_cast<intptr_t>(this)));
+ java_dialog_.Reset(std::move(create_java_dialog_callback)
+ .Run(env, window_android, origin_string,
+ delegate_->GetSecurityLevel(web_contents_),
+ delegate_->GetJavaObject(),
+ reinterpret_cast<intptr_t>(this)));
}
+BluetoothScanningPromptAndroid::BluetoothScanningPromptAndroid(
+ content::RenderFrameHost* frame,
+ const content::BluetoothScanningPrompt::EventHandler& event_handler,
+ std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate)
+ : BluetoothScanningPromptAndroid(
+ frame,
+ event_handler,
+ std::move(delegate),
+ GetCreateJavaBluetoothScanningPromptCallback()) {}
+
BluetoothScanningPromptAndroid::~BluetoothScanningPromptAndroid() {
if (!java_dialog_.is_null()) {
Java_BluetoothScanningPermissionDialog_closeDialog(AttachCurrentThread(),
@@ -5,6 +5,9 @@
#ifndef COMPONENTS_PERMISSIONS_ANDROID_BLUETOOTH_SCANNING_PROMPT_ANDROID_H_
#define COMPONENTS_PERMISSIONS_ANDROID_BLUETOOTH_SCANNING_PROMPT_ANDROID_H_
+#include "base/android/jni_android.h"
+#include "base/android/jni_int_wrapper.h"
+#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/memory/raw_ptr.h"
#include "content/public/browser/bluetooth_scanning_prompt.h"
@@ -19,6 +22,16 @@ class BluetoothScanningPromptAndroidDelegate;
// devices. This implementation is for Android.
class BluetoothScanningPromptAndroid : public content::BluetoothScanningPrompt {
public:
+ // The callback type for creating the java dialog object.
+ using CreateJavaDialogCallback =
+ base::OnceCallback<base::android::ScopedJavaLocalRef<jobject>(
+ JNIEnv*,
+ const base::android::JavaRef<jobject>&,
+ const base::android::JavaRef<jstring>&,
+ JniIntWrapper,
+ const base::android::JavaRef<jobject>&,
+ jlong)>;
+
BluetoothScanningPromptAndroid(
content::RenderFrameHost* frame,
const content::BluetoothScanningPrompt::EventHandler& event_handler,
@@ -39,7 +52,24 @@ class BluetoothScanningPromptAndroid : public content::BluetoothScanningPrompt {
// Report the dialog's result.
void OnDialogFinished(JNIEnv* env, jint event_type);
+ static std::unique_ptr<BluetoothScanningPromptAndroid> CreateForTesting(
+ content::RenderFrameHost* frame,
+ const EventHandler& event_handler,
+ std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate,
+ CreateJavaDialogCallback create_java_dialog_callback) {
+ // Using `new` to access a non-public constructor.
+ return base::WrapUnique(new BluetoothScanningPromptAndroid(
+ frame, event_handler, std::move(delegate),
+ std::move(create_java_dialog_callback)));
+ }
+
private:
+ BluetoothScanningPromptAndroid(
+ content::RenderFrameHost* frame,
+ const content::BluetoothScanningPrompt::EventHandler& event_handler,
+ std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate,
+ CreateJavaDialogCallback create_java_dialog_callback);
+
base::android::ScopedJavaGlobalRef<jobject> java_dialog_;
raw_ptr<content::WebContents> web_contents_;
new file mode 100644
@@ -0,0 +1,77 @@
+// Copyright 2022 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/permissions/android/bluetooth_scanning_prompt_android.h"
+
+#include <string>
+
+#include "base/test/bind.h"
+#include "base/test/mock_callback.h"
+#include "components/permissions/android/bluetooth_scanning_prompt_android_delegate.h"
+#include "components/security_state/core/security_state.h"
+#include "content/public/browser/bluetooth_scanning_prompt.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/test/navigation_simulator.h"
+#include "content/public/test/test_renderer_host.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/android/window_android.h"
+
+namespace permissions {
+
+namespace {
+
+using BluetoothScanningPromptAndroidTest = content::RenderViewHostTestHarness;
+using testing::_;
+
+class FakeBluetoothChooserAndroidDelegate
+ : public BluetoothScanningPromptAndroidDelegate {
+ base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override {
+ return base::android::ScopedJavaLocalRef<jobject>();
+ }
+ security_state::SecurityLevel GetSecurityLevel(
+ content::WebContents* web_contents) override {
+ return security_state::NONE;
+ }
+};
+
+TEST_F(BluetoothScanningPromptAndroidTest, FrameTree) {
+ NavigateAndCommit(GURL("https://main-frame.com"));
+ content::RenderFrameHost* subframe =
+ content::NavigationSimulator::NavigateAndCommitFromDocument(
+ GURL("https://sub-frame.com"),
+ content::RenderFrameHostTester::For(main_rfh())
+ ->AppendChild("subframe"));
+
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderFrameHost(main_rfh());
+ std::unique_ptr<ui::WindowAndroid::ScopedWindowAndroidForTesting> window =
+ ui::WindowAndroid::CreateForTesting();
+ window.get()->get()->AddChild(web_contents->GetNativeView());
+
+ base::MockCallback<BluetoothScanningPromptAndroid::CreateJavaDialogCallback>
+ mock_callback;
+ auto origin_predicate =
+ [&](const base::android::JavaRef<jstring>& java_string) {
+ return base::android::ConvertJavaStringToUTF16(
+ base::android::AttachCurrentThread(), java_string) ==
+ u"https://main-frame.com";
+ };
+ EXPECT_CALL(
+ mock_callback,
+ Run(/*env=*/_, /*window_android=*/_, testing::Truly(origin_predicate),
+ /*security_level=*/_, /*delegate=*/_,
+ /*native_bluetooth_scanning_prompt_dialog_ptr=*/_));
+
+ BluetoothScanningPromptAndroid::CreateForTesting(
+ subframe,
+ base::BindLambdaForTesting(
+ [](content::BluetoothScanningPrompt::Event evt) {}),
+ std::make_unique<FakeBluetoothChooserAndroidDelegate>(),
+ mock_callback.Get());
+}
+
+} // namespace
+
+} // namespace permissions
@@ -95,6 +95,7 @@
#include "media/media_buildflags.h"
#include "mojo/core/embedder/embedder.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
+#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/system/dynamic_library_support.h"
#include "mojo/public/cpp/system/invitation.h"
@@ -1043,6 +1044,11 @@ int ContentMainRunnerImpl::RunBrowser(MainFunctionParams main_params,
if (is_browser_main_loop_started_)
return -1;
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSingleProcess)) {
+ mojo::SyncCallRestrictions::DisableSyncCallInterrupts();
+ }
+
bool should_start_minimal_browser = start_minimal_browser;
if (!mojo_ipc_support_) {
if (delegate_->ShouldCreateFeatureList()) {
@@ -1573,6 +1573,8 @@ source_set("browser") {
"renderer_host/navigation_entry_impl.h",
"renderer_host/navigation_entry_restore_context_impl.cc",
"renderer_host/navigation_entry_restore_context_impl.h",
+ "renderer_host/navigation_policy_container_builder.cc",
+ "renderer_host/navigation_policy_container_builder.h",
"renderer_host/navigation_request.cc",
"renderer_host/navigation_request.h",
"renderer_host/navigation_request_info.cc",
@@ -1598,8 +1600,6 @@ source_set("browser") {
"renderer_host/page_lifecycle_state_manager.h",
"renderer_host/policy_container_host.cc",
"renderer_host/policy_container_host.h",
- "renderer_host/policy_container_navigation_bundle.cc",
- "renderer_host/policy_container_navigation_bundle.h",
"renderer_host/private_network_access_util.cc",
"renderer_host/private_network_access_util.h",
"renderer_host/recently_destroyed_hosts.cc",
@@ -2928,6 +2928,17 @@ source_set("browser") {
if (is_ohos) {
sources -= [ "media/session/audio_focus_delegate_default.cc" ]
+ sources += [
+ "font_unique_name_lookup/font_unique_name_lookup.cc",
+ "font_unique_name_lookup/font_unique_name_lookup.h",
+ "font_unique_name_lookup/font_unique_name_lookup_service.cc",
+ "font_unique_name_lookup/font_unique_name_lookup_service.h",
+ ]
+
+ deps += [
+ "//build/config/freetype",
+ "//third_party/blink/public/common:font_unique_name_table_proto",
+ ]
}
deps += [
@@ -172,6 +172,10 @@
#include "ui/gl/gl_surface.h"
#endif
+#if BUILDFLAG(IS_OHOS)
+#include "content/browser/font_unique_name_lookup/font_unique_name_lookup.h"
+#endif
+
#if BUILDFLAG(IS_MAC)
#include "base/mac/scoped_nsautorelease_pool.h"
#include "content/browser/renderer_host/browser_compositor_view_mac.h"
@@ -1409,6 +1413,12 @@ void BrowserMainLoop::PostCreateThreadsImpl() {
}
#endif
+#if BUILDFLAG(IS_OHOS)
+ if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) {
+ FontUniqueNameLookup::GetInstance();
+ }
+#endif
+
#if defined(ENABLE_IPC_FUZZER)
SetFileUrlPathAliasForIpcFuzzer();
#endif
@@ -33,7 +33,12 @@ static bool HandleViewSource(GURL* url, BrowserContext* browser_context) {
url::kHttpsScheme,
kChromeUIScheme,
url::kFileScheme,
+ #if BUILDFLAG(IS_OHOS)
+ url::kFileSystemScheme,
+ url::kResourcesScheme
+ #else
url::kFileSystemScheme
+ #endif
};
// Merge all the schemes for which view-source is allowed by default, with
@@ -438,10 +438,16 @@ namespace {
bool IsShellIntegratedExtension(const base::FilePath::StringType& extension) {
base::FilePath::StringType extension_lower = base::ToLowerASCII(extension);
- // .lnk files may be used to execute arbitrary code (see
- // https://nvd.nist.gov/vuln/detail/CVE-2010-2568).
- if (extension_lower == FILE_PATH_LITERAL("lnk"))
+ // .lnk and .scf files may be used to execute arbitrary code (see
+ // https://nvd.nist.gov/vuln/detail/CVE-2010-2568 and
+ // https://crbug.com/1227995, respectively). '.url' files can be used to read
+ // arbitrary files (see https://crbug.com/1307930 and
+ // https://crbug.com/1354518).
+ if (extension_lower == FILE_PATH_LITERAL("lnk") ||
+ extension_lower == FILE_PATH_LITERAL("scf") ||
+ extension_lower == FILE_PATH_LITERAL("url")) {
return true;
+ }
// Setting a file's extension to a CLSID may conceal its actual file type on
// some Windows versions (see https://nvd.nist.gov/vuln/detail/CVE-2004-0420).
@@ -140,6 +140,7 @@ TEST_F(FileSystemAccessDirectoryHandleImplTest, IsSafePathComponent) {
"My Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
"a\\a",
"a.lnk",
+ "a.url",
"a/a",
"C:\\",
"C:/",
@@ -195,8 +196,8 @@ TEST_F(FileSystemAccessDirectoryHandleImplTest, GetEntries) {
constexpr const char* kSafeNames[] = {"a", "a.txt", "My Computer", "lnk.txt",
"a.local"};
constexpr const char* kUnsafeNames[] = {
- "con", "con.zip", "NUL", "a.",
- "a\"a", "a . .", "a.lnk", "My Computer.{a}",
+ "con", "con.zip", "NUL", "a.", "a\"a", "a . .",
+ "a.lnk", "My Computer.{a}", "a.url",
};
for (const char* name : kSafeNames) {
ASSERT_TRUE(base::WriteFile(dir_.GetPath().AppendASCII(name), "data"))
@@ -34,8 +34,14 @@ namespace {
// counting up after the dash "-1", "-2", etc.
const char kFingerprintSuffixForceUpdateCache[] = "-1";
const char kProtobufFilename[] = "font_unique_name_table.pb";
+#if BUILDFLAG(IS_OHOS)
+// This may be add continue.
+static const char* const kOhosFontPaths[] = {
+ "/system/fonts"};
+#else
static const char* const kAndroidFontPaths[] = {
"/system/fonts", "/vendor/fonts", "/product/fonts"};
+#endif
bool IsRelevantNameRecord(const FT_SfntName& sfnt_name) {
if (sfnt_name.name_id != TT_NAME_ID_FULL_NAME &&
@@ -316,18 +322,27 @@ base::FilePath FontUniqueNameLookup::TableCacheFilePath() {
}
std::string FontUniqueNameLookup::GetAndroidBuildFingerprint() const {
+#if BUILDFLAG(IS_OHOS)
+ // Here temporary return kFingerprintSuffixForceUpdateCache.
+ return std::string(kFingerprintSuffixForceUpdateCache);
+#else
return android_build_fingerprint_for_testing_.size()
? android_build_fingerprint_for_testing_
: std::string(base::android::BuildInfo::GetInstance()
->android_build_fp()) +
std::string(kFingerprintSuffixForceUpdateCache);
+#endif
}
std::vector<std::string> FontUniqueNameLookup::GetFontFilePaths() const {
if (font_file_paths_for_testing_.size())
return font_file_paths_for_testing_;
std::vector<std::string> font_files;
+#if BUILDFLAG(IS_OHOS)
+ for (const char* font_dir_path : kOhosFontPaths) {
+#else
for (const char* font_dir_path : kAndroidFontPaths) {
+#endif
base::FileEnumerator files_enumerator(
base::MakeAbsoluteFilePath(base::FilePath(font_dir_path)), true,
base::FileEnumerator::FILES);
@@ -64,6 +64,10 @@
#include "base/win/shortcut.h"
#endif
+#if BUILDFLAG(IS_OHOS)
+#include "ohos_adapter_helper.h"
+#endif
+
namespace content {
namespace {
@@ -773,6 +777,261 @@ class FileURLLoader : public network::mojom::URLLoader {
uint64_t total_bytes_written_ = 0;
};
+#if BUILDFLAG(IS_OHOS)
+class ResourceURLLoader : public network::mojom::URLLoader {
+ public:
+ static void CreateAndStart(
+ const base::FilePath& profile_path,
+ const network::ResourceRequest& request,
+ network::mojom::FetchResponseType response_type,
+ mojo::PendingReceiver<network::mojom::URLLoader> loader,
+ mojo::PendingRemote<network::mojom::URLLoaderClient> client_remote,
+ std::unique_ptr<FileURLLoaderObserver> observer,
+ scoped_refptr<net::HttpResponseHeaders> extra_response_headers) {
+ auto* resource_url_loader = new ResourceURLLoader;
+ resource_url_loader->Start(profile_path, request, response_type,
+ std::move(loader), std::move(client_remote),
+ std::move(observer),
+ std::move(extra_response_headers));
+ }
+
+ ResourceURLLoader(const ResourceURLLoader&) = delete;
+ ResourceURLLoader& operator=(const ResourceURLLoader&) = delete;
+
+ // network::mojom::URLLoader:
+ void FollowRedirect(
+ const std::vector<std::string>& removed_headers,
+ const net::HttpRequestHeaders& modified_headers,
+ const net::HttpRequestHeaders& modified_cors_exempt_headers,
+ const absl::optional<GURL>& new_url) override {}
+ void SetPriority(net::RequestPriority priority,
+ int32_t intra_priority_value) override {}
+ void PauseReadingBodyFromNet() override {}
+ void ResumeReadingBodyFromNet() override {}
+
+ private:
+ ResourceURLLoader() = default;
+ ~ResourceURLLoader() override = default;
+
+ void Start(const base::FilePath& profile_path,
+ const network::ResourceRequest& request,
+ network::mojom::FetchResponseType response_type,
+ mojo::PendingReceiver<network::mojom::URLLoader> loader,
+ mojo::PendingRemote<network::mojom::URLLoaderClient> client_remote,
+ std::unique_ptr<FileURLLoaderObserver> observer,
+ scoped_refptr<net::HttpResponseHeaders> extra_response_headers) {
+ auto head = network::mojom::URLResponseHead::New();
+ head->request_start = base::TimeTicks::Now();
+ head->response_start = base::TimeTicks::Now();
+ head->response_type = response_type;
+ head->headers = extra_response_headers;
+ receiver_.Bind(std::move(loader));
+ receiver_.set_disconnect_handler(base::BindOnce(
+ &ResourceURLLoader::OnMojoDisconnect, base::Unretained(this)));
+ client_.Bind(std::move(client_remote));
+
+ if (!request.url.SchemeIs(url::kResourcesScheme) ||
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kOhosHapPath)) {
+ LOG(ERROR) << "url scheme error or kOhosHapPath not exist";
+ OnClientComplete(net::ERR_FAILED, std::move(observer));
+ return;
+ }
+ std::string hapPath =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kOhosHapPath);
+ std::string resourcesPath = "resources/";
+ resourcesPath = resourcesPath + request.url.host() + request.url.path();
+ LOG(INFO) << "ResourceURLLoader url: " << request.url.spec()
+ << ", path: " << resourcesPath;
+ mojo::ScopedDataPipeProducerHandle producer_handle;
+ mojo::ScopedDataPipeConsumerHandle consumer_handle;
+ if (mojo::CreateDataPipe(kDefaultFileUrlPipeSize, producer_handle,
+ consumer_handle) != MOJO_RESULT_OK) {
+ OnClientComplete(net::ERR_FAILED, std::move(observer));
+ return;
+ }
+ if (observer)
+ observer->OnStart();
+ size_t length = 0;
+ std::unique_ptr<uint8_t[]> data;
+ auto resourceInstance =
+ OHOS::NWeb::OhosAdapterHelper::GetInstance().GetResourceAdapter(
+ hapPath);
+ mojo::DataPipeProducer::DataSource::ReadResult read_result;
+ if (!resourceInstance->GetRawFileData(resourcesPath, length, data, false)) {
+ LOG(ERROR) << "ResourceURLLoader GetRawFileData failed";
+ read_result.result = MOJO_RESULT_NOT_FOUND;
+ if (observer) {
+ observer->OnRead(base::span<char>(), &read_result);
+ observer->OnDone();
+ }
+ client_->OnComplete(network::URLLoaderCompletionStatus(
+ ConvertMojoResultToNetError(read_result.result)));
+ client_.reset();
+ MaybeDeleteSelf();
+ return;
+ }
+ LOG(INFO) << "GetRawFileData length: " << length;
+ read_result.result = MOJO_RESULT_OK;
+ read_result.bytes_read =
+ length > net::kMaxBytesToSniff ? net::kMaxBytesToSniff : length;
+ std::vector<char> initial_read_buffer;
+ char* dataPtr = reinterpret_cast<char*>(data.get());
+ initial_read_buffer.insert(initial_read_buffer.end(), dataPtr,
+ dataPtr + length);
+ if (observer)
+ observer->OnRead(base::span<char>(initial_read_buffer), &read_result);
+
+ uint64_t initial_read_size = read_result.bytes_read;
+ std::string range_header;
+ net::HttpByteRange byte_range;
+ if (request.headers.GetHeader(net::HttpRequestHeaders::kRange,
+ &range_header)) {
+ // Handle a simple Range header for a single range.
+ std::vector<net::HttpByteRange> ranges;
+ bool fail = false;
+ if (net::HttpUtil::ParseRangeHeader(range_header, &ranges) &&
+ ranges.size() == 1) {
+ byte_range = ranges[0];
+ if (!byte_range.ComputeBounds(length)) {
+ fail = true;
+ }
+ } else {
+ fail = true;
+ }
+ if (fail) {
+ OnClientComplete(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE,
+ std::move(observer));
+ return;
+ }
+ }
+ uint64_t first_byte_to_send = 0;
+ uint64_t total_bytes_to_send = length;
+ if (byte_range.IsValid()) {
+ first_byte_to_send = byte_range.first_byte_position();
+ total_bytes_to_send =
+ byte_range.last_byte_position() - first_byte_to_send + 1;
+ }
+ total_bytes_written_ = total_bytes_to_send;
+ head->content_length = base::saturated_cast<int64_t>(total_bytes_to_send);
+
+ if (first_byte_to_send < initial_read_size) {
+ uint32_t write_size = std::min(
+ static_cast<uint32_t>(initial_read_size - first_byte_to_send),
+ static_cast<uint32_t>(total_bytes_to_send));
+ const uint32_t expected_write_size = write_size;
+ MojoResult result =
+ producer_handle->WriteData(&initial_read_buffer[first_byte_to_send],
+ &write_size, MOJO_WRITE_DATA_FLAG_NONE);
+ if (result != MOJO_RESULT_OK || write_size != expected_write_size) {
+ OnFileWritten(std::move(observer), nullptr, result);
+ LOG(ERROR) << "ResourceURLLoader WriteData failed";
+ return;
+ }
+ // Discount the bytes we just sent from the total range.
+ first_byte_to_send = initial_read_size;
+ total_bytes_to_send -= write_size;
+ }
+ const base::FilePath::CharType* resource_file_path =
+ FILE_PATH_LITERAL(resourcesPath.c_str());
+ if (!net::GetMimeTypeFromFile(base::FilePath(resource_file_path),
+ &head->mime_type)) {
+ std::string new_type;
+ net::SniffMimeType(
+ base::StringPiece(initial_read_buffer.data(), read_result.bytes_read),
+ request.url, head->mime_type,
+ GetContentClient()->browser()->ForceSniffingFileUrlsForHtml()
+ ? net::ForceSniffFileUrlsForHtml::kEnabled
+ : net::ForceSniffFileUrlsForHtml::kDisabled,
+ &new_type);
+ head->mime_type.assign(new_type);
+ head->did_mime_sniff = true;
+ }
+ if (!head->headers) {
+ head->headers =
+ base::MakeRefCounted<net::HttpResponseHeaders>("HTTP/1.1 200 OK");
+ }
+ LOG(INFO) << "ResourceURLLoader AddHeader mime_type " << head->mime_type;
+ head->headers->AddHeader(net::HttpRequestHeaders::kContentType,
+ head->mime_type);
+ client_->OnReceiveResponse(std::move(head),
+ mojo::ScopedDataPipeConsumerHandle());
+ client_->OnStartLoadingResponseBody(std::move(consumer_handle));
+ LOG(INFO) << "total_bytes_to_send: " << total_bytes_to_send;
+ if (total_bytes_to_send == 0) {
+ // There's definitely no more data, so we're already done.
+ OnFileWritten(std::move(observer), nullptr, MOJO_RESULT_OK);
+ return;
+ }
+ if (observer)
+ observer->OnSeekComplete(first_byte_to_send);
+ data_producer_ =
+ std::make_unique<mojo::DataPipeProducer>(std::move(producer_handle));
+ base::StringPiece string_piece((char*)data.get() + first_byte_to_send,
+ total_bytes_to_send);
+ data_producer_->Write(
+ std::make_unique<mojo::StringDataSource>(
+ string_piece, mojo::StringDataSource::AsyncWritingMode::
+ STRING_STAYS_VALID_UNTIL_COMPLETION),
+ base::BindOnce(&ResourceURLLoader::OnFileWritten,
+ base::Unretained(this), nullptr, std::move(data)));
+ }
+
+ void OnMojoDisconnect() {
+ data_producer_.reset();
+ receiver_.reset();
+ client_.reset();
+ MaybeDeleteSelf();
+ }
+
+ void OnClientComplete(net::Error net_error,
+ std::unique_ptr<FileURLLoaderObserver> observer) {
+ client_->OnComplete(network::URLLoaderCompletionStatus(net_error));
+ client_.reset();
+ if (observer) {
+ if (net_error != net::OK) {
+ mojo::DataPipeProducer::DataSource::ReadResult result;
+ result.result = ConvertNetErrorToMojoResult(net_error);
+ observer->OnRead(base::span<char>(), &result);
+ }
+ observer->OnDone();
+ }
+ MaybeDeleteSelf();
+ }
+
+ void MaybeDeleteSelf() {
+ if (!receiver_.is_bound() && !client_.is_bound())
+ delete this;
+ }
+
+ void OnFileWritten(std::unique_ptr<FileURLLoaderObserver> observer,
+ std::unique_ptr<uint8_t[]> write_data,
+ MojoResult result) {
+ data_producer_.reset();
+ if (observer)
+ observer->OnDone();
+
+ if (result == MOJO_RESULT_OK) {
+ network::URLLoaderCompletionStatus status(net::OK);
+ status.encoded_data_length = total_bytes_written_;
+ status.encoded_body_length = total_bytes_written_;
+ status.decoded_body_length = total_bytes_written_;
+ client_->OnComplete(status);
+ } else {
+ client_->OnComplete(network::URLLoaderCompletionStatus(net::ERR_FAILED));
+ }
+ client_.reset();
+ MaybeDeleteSelf();
+ }
+
+ std::unique_ptr<mojo::DataPipeProducer> data_producer_;
+ mojo::Receiver<network::mojom::URLLoader> receiver_{this};
+ mojo::Remote<network::mojom::URLLoaderClient> client_;
+
+ uint64_t total_bytes_written_ = 0;
+};
+#endif
} // namespace
FileURLLoaderFactory::FileURLLoaderFactory(
@@ -857,6 +1116,17 @@ void FileURLLoaderFactory::CreateLoaderAndStartInternal(
return;
}
+#if BUILDFLAG(IS_OHOS)
+ if (request.url.SchemeIs(url::kResourcesScheme)) {
+ task_runner_->PostTask(
+ FROM_HERE, base::BindOnce(&ResourceURLLoader::CreateAndStart,
+ profile_path_, request, response_type,
+ std::move(loader), std::move(client),
+ std::unique_ptr<FileURLLoaderObserver>(),
+ nullptr /* extra_response_headers */));
+ return;
+ }
+#endif
// Check file path just after all CORS flag checks are handled.
base::FilePath file_path;
if (!net::FileURLToFilePath(request.url, &file_path)) {
@@ -1350,6 +1350,13 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl(
browser_context_->GetPath(),
browser_context_->GetSharedCorsOriginAccessList(),
file_factory_priority));
+#if BUILDFLAG(IS_OHOS)
+ non_network_url_loader_factories_.emplace(
+ url::kResourcesScheme, FileURLLoaderFactory::Create(
+ browser_context_->GetPath(),
+ browser_context_->GetSharedCorsOriginAccessList(),
+ file_factory_priority));
+#endif
#if BUILDFLAG(IS_ANDROID)
non_network_url_loader_factories_.emplace(url::kContentScheme,
@@ -1550,6 +1557,7 @@ void NavigationURLLoaderImpl::BindNonNetworkURLLoaderFactoryReceiver(
mojo::PendingReceiver<network::mojom::URLLoaderFactory> factory_receiver) {
auto it = non_network_url_loader_factories_.find(url.scheme());
if (it != non_network_url_loader_factories_.end()) {
+ LOG(INFO) << "BindNonNetworkURLLoaderFactoryReceiver scheme: " << url.scheme();
mojo::Remote<network::mojom::URLLoaderFactory> remote(
std::move(it->second));
remote->Clone(std::move(factory_receiver));
@@ -1586,7 +1594,11 @@ void NavigationURLLoaderImpl::
// non-http factory that allows DevTools intereception. For comparison all
// non-WebUI cases in RFHI::CommitNavigation allow DevTools
// interception. Let's try to be more consistent / less ad-hoc.
+#if BUILDFLAG(IS_OHOS)
+ if (url.SchemeIs(url::kFileScheme) || url.SchemeIs(url::kResourcesScheme)) {
+#else
if (url.SchemeIs(url::kFileScheme)) {
+#endif
if (frame_tree_node) { // May be nullptr in some unit tests.
devtools_instrumentation::WillCreateURLLoaderFactory(
frame, /*is_navigation=*/true, /*is_download=*/false,
@@ -35,9 +35,11 @@ void LogConsoleMessage(blink::mojom::ConsoleMessageLevel log_level,
if (!base::FeatureList::IsEnabled(features::kLogJsConsoleMessages))
return;
+#if !BUILDFLAG(IS_OHOS)
logging::LogMessage("CONSOLE", line_number, resolved_level).stream()
<< "\"" << message << "\", source: " << source_id << " (" << line_number
<< ")";
+#endif
}
} // namespace content
@@ -7,6 +7,7 @@
#include "audio_renderer_adapter.h"
#include "audio_system_manager_adapter.h"
#include "content/browser/media/session/media_session_impl.h"
+#include "content/public/common/content_switches.h"
#include "media/base/media_switches.h"
#include "ohos_adapter_helper.h"
@@ -43,6 +44,12 @@ AudioFocusDelegateOHOS::~AudioFocusDelegateOHOS() {}
AudioFocusDelegate::AudioFocusResult AudioFocusDelegateOHOS::RequestAudioFocus(
media_session::mojom::AudioFocusType audio_focus_type) {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ bool hasEnhanceFlag = command_line->HasSwitch(::switches::kOhosHanceSurface);
+ if (hasEnhanceFlag) {
+ LOG(ERROR) << "audio focus is not support in enhance";
+ return AudioFocusDelegate::AudioFocusResult::kSuccess;
+ }
int32_t ret = OhosAdapterHelper::GetInstance()
.GetAudioSystemManager()
.RequestAudioFocus(kAudioInterrupt);
@@ -143,7 +143,12 @@ void InputRouterImpl::SendGestureEvent(
#if BUILDFLAG(IS_OHOS)
if (gesture_event.event.GetType() ==
WebInputEvent::Type::kGestureFlingStart) {
- client_->GetWidgetInputHandler()->StartFling();
+ LOG(INFO) << "InputRouterImpl::SendGestureEvent type=kGestureFlingStart";
+ client_->GetWidgetInputHandler()->TryStartFling();
+ } else if (gesture_event.event.GetType() ==
+ WebInputEvent::Type::kGestureScrollEnd) {
+ LOG(INFO) << "InputRouterImpl::SendGestureEvent type=kGestureScrollEnd";
+ client_->GetWidgetInputHandler()->TryFinishFling();
}
#endif
if (gesture_event_queue_.PassToFlingController(gesture_event)) {
similarity index 69%
rename from src/content/browser/renderer_host/policy_container_navigation_bundle.cc
rename to src/content/browser/renderer_host/navigation_policy_container_builder.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/renderer_host/policy_container_navigation_bundle.h"
+#include "content/browser/renderer_host/navigation_policy_container_builder.h"
#include <utility>
@@ -75,7 +75,7 @@ std::unique_ptr<PolicyContainerPolicies> GetHistoryPolicies(
} // namespace
-PolicyContainerNavigationBundle::PolicyContainerNavigationBundle(
+NavigationPolicyContainerBuilder::NavigationPolicyContainerBuilder(
RenderFrameHostImpl* parent,
const blink::LocalFrameToken* initiator_frame_token,
const FrameNavigationEntry* history_entry)
@@ -84,36 +84,36 @@ PolicyContainerNavigationBundle::PolicyContainerNavigationBundle(
history_policies_(GetHistoryPolicies(history_entry)),
delivered_policies_(std::make_unique<PolicyContainerPolicies>()) {}
-PolicyContainerNavigationBundle::~PolicyContainerNavigationBundle() = default;
+NavigationPolicyContainerBuilder::~NavigationPolicyContainerBuilder() = default;
const PolicyContainerPolicies*
-PolicyContainerNavigationBundle::InitiatorPolicies() const {
+NavigationPolicyContainerBuilder::InitiatorPolicies() const {
return initiator_policies_.get();
}
-const PolicyContainerPolicies* PolicyContainerNavigationBundle::ParentPolicies()
+const PolicyContainerPolicies* NavigationPolicyContainerBuilder::ParentPolicies()
const {
return parent_policies_.get();
}
const PolicyContainerPolicies*
-PolicyContainerNavigationBundle::HistoryPolicies() const {
+NavigationPolicyContainerBuilder::HistoryPolicies() const {
return history_policies_.get();
}
-void PolicyContainerNavigationBundle::SetIPAddressSpace(
+void NavigationPolicyContainerBuilder::SetIPAddressSpace(
network::mojom::IPAddressSpace address_space) {
DCHECK(!HasComputedPolicies());
delivered_policies_->ip_address_space = address_space;
}
-void PolicyContainerNavigationBundle::SetIsOriginPotentiallyTrustworthy(
+void NavigationPolicyContainerBuilder::SetIsOriginPotentiallyTrustworthy(
bool value) {
DCHECK(!HasComputedPolicies());
delivered_policies_->is_web_secure_context = value;
}
-void PolicyContainerNavigationBundle::AddContentSecurityPolicy(
+void NavigationPolicyContainerBuilder::AddContentSecurityPolicy(
network::mojom::ContentSecurityPolicyPtr policy) {
DCHECK(!HasComputedPolicies());
DCHECK(policy);
@@ -121,21 +121,21 @@ void PolicyContainerNavigationBundle::AddContentSecurityPolicy(
delivered_policies_->content_security_policies.push_back(std::move(policy));
}
-void PolicyContainerNavigationBundle::AddContentSecurityPolicies(
+void NavigationPolicyContainerBuilder::AddContentSecurityPolicies(
std::vector<network::mojom::ContentSecurityPolicyPtr> policies) {
DCHECK(!HasComputedPolicies());
delivered_policies_->AddContentSecurityPolicies(std::move(policies));
}
-void PolicyContainerNavigationBundle::SetCrossOriginOpenerPolicy(
+void NavigationPolicyContainerBuilder::SetCrossOriginOpenerPolicy(
network::CrossOriginOpenerPolicy coop) {
DCHECK(!HasComputedPolicies());
delivered_policies_->cross_origin_opener_policy = coop;
}
-void PolicyContainerNavigationBundle::SetCrossOriginEmbedderPolicy(
+void NavigationPolicyContainerBuilder::SetCrossOriginEmbedderPolicy(
network::CrossOriginEmbedderPolicy coep) {
DCHECK(!HasComputedPolicies());
@@ -143,13 +143,13 @@ void PolicyContainerNavigationBundle::SetCrossOriginEmbedderPolicy(
}
const PolicyContainerPolicies&
-PolicyContainerNavigationBundle::DeliveredPoliciesForTesting() const {
+NavigationPolicyContainerBuilder::DeliveredPoliciesForTesting() const {
DCHECK(!HasComputedPolicies());
return *delivered_policies_;
}
-void PolicyContainerNavigationBundle::ComputePoliciesForError() {
+void NavigationPolicyContainerBuilder::ComputePoliciesForError() {
// The decision to commit an error page can happen after receiving the
// response for a regular document. It overrides any previous attempt to
// |ComputePolicies()|.
@@ -172,7 +172,7 @@ void PolicyContainerNavigationBundle::ComputePoliciesForError() {
DCHECK(HasComputedPolicies());
}
-void PolicyContainerNavigationBundle::ComputeIsWebSecureContext() {
+void NavigationPolicyContainerBuilder::ComputeIsWebSecureContext() {
DCHECK(!HasComputedPolicies());
if (!parent_policies_) {
@@ -186,7 +186,7 @@ void PolicyContainerNavigationBundle::ComputeIsWebSecureContext() {
}
std::unique_ptr<PolicyContainerPolicies>
-PolicyContainerNavigationBundle::IncorporateDeliveredPolicies(
+NavigationPolicyContainerBuilder::IncorporateDeliveredPolicies(
const GURL& url,
std::unique_ptr<PolicyContainerPolicies> policies) {
// Delivered content security policies must be appended.
@@ -203,7 +203,7 @@ PolicyContainerNavigationBundle::IncorporateDeliveredPolicies(
}
std::unique_ptr<PolicyContainerPolicies>
-PolicyContainerNavigationBundle::ComputeInheritedPolicies(const GURL& url) {
+NavigationPolicyContainerBuilder::ComputeInheritedPolicies(const GURL& url) {
DCHECK(HasLocalScheme(url)) << "No inheritance allowed for non-local schemes";
if (url.IsAboutSrcdoc()) {
@@ -220,42 +220,59 @@ PolicyContainerNavigationBundle::ComputeInheritedPolicies(const GURL& url) {
}
std::unique_ptr<PolicyContainerPolicies>
-PolicyContainerNavigationBundle::ComputeFinalPolicies(const GURL& url) {
+NavigationPolicyContainerBuilder::ComputeFinalPolicies(const GURL& url) {
+ std::unique_ptr<PolicyContainerPolicies> policies;
// Policies are either inherited from another document for local scheme, or
// directly set from the delivered response.
- if (!HasLocalScheme(url))
- return delivered_policies_->Clone();
-
- // For a local scheme, history policies should not incorporate delivered ones
- // as this may lead to duplication of some policies already stored in history.
- // For example, consider the following HTML:
- // <iframe src="about:blank" csp="something">
- // This will store CSP: something in history. The next time we have a history
- // navigation we will have CSP: something twice.
- if (history_policies_)
- return history_policies_->Clone();
-
- return IncorporateDeliveredPolicies(url, ComputeInheritedPolicies(url));
+ if (!HasLocalScheme(url)) {
+ policies = delivered_policies_->Clone();
+ } else if (history_policies_) {
+ // For a local scheme, history policies should not incorporate delivered
+ // ones as this may lead to duplication of some policies already stored in
+ // history. For example, consider the following HTML:
+ // <iframe src="about:blank" csp="something">
+ // This will store CSP: something in history. The next time we have a
+ // history navigation we will have CSP: something twice.
+ policies = history_policies_->Clone();
+ } else {
+ policies = IncorporateDeliveredPolicies(url, ComputeInheritedPolicies(url));
+ }
+
+ // `can_navigate_top_without_user_gesture` is inherited from the parent.
+ // Later in `NavigationRequest::CommitNavigation()` it will either be made
+ // less strict for same-origin navigations, or stricter for cross-origin
+ // navigations that do not explicitly allow top-level navigation without user
+ // gesture.
+ policies->can_navigate_top_without_user_gesture =
+ parent_policies_ ? parent_policies_->can_navigate_top_without_user_gesture
+ : true;
+
+ return policies;
}
-void PolicyContainerNavigationBundle::ComputePolicies(const GURL& url) {
+void NavigationPolicyContainerBuilder::ComputePolicies(const GURL& url) {
DCHECK(!HasComputedPolicies());
ComputeIsWebSecureContext();
SetFinalPolicies(ComputeFinalPolicies(url));
}
-bool PolicyContainerNavigationBundle::HasComputedPolicies() const {
+bool NavigationPolicyContainerBuilder::HasComputedPolicies() const {
return host_ != nullptr;
}
-void PolicyContainerNavigationBundle::SetFinalPolicies(
+void NavigationPolicyContainerBuilder::SetAllowTopNavigationWithoutUserGesture(
+ bool allow_top) {
+ host_->SetCanNavigateTopWithoutUserGesture(allow_top);
+}
+
+void NavigationPolicyContainerBuilder::SetFinalPolicies(
std::unique_ptr<PolicyContainerPolicies> policies) {
DCHECK(!HasComputedPolicies());
host_ = base::MakeRefCounted<PolicyContainerHost>(std::move(policies));
}
-const PolicyContainerPolicies& PolicyContainerNavigationBundle::FinalPolicies()
+const PolicyContainerPolicies& NavigationPolicyContainerBuilder::FinalPolicies()
const {
DCHECK(HasComputedPolicies());
@@ -263,20 +280,20 @@ const PolicyContainerPolicies& PolicyContainerNavigationBundle::FinalPolicies()
}
blink::mojom::PolicyContainerPtr
-PolicyContainerNavigationBundle::CreatePolicyContainerForBlink() {
+NavigationPolicyContainerBuilder::CreatePolicyContainerForBlink() {
DCHECK(HasComputedPolicies());
return host_->CreatePolicyContainerForBlink();
}
scoped_refptr<PolicyContainerHost>
-PolicyContainerNavigationBundle::TakePolicyContainerHost() && {
+NavigationPolicyContainerBuilder::TakePolicyContainerHost() && {
DCHECK(HasComputedPolicies());
return std::move(host_);
}
-void PolicyContainerNavigationBundle::ResetForCrossDocumentRestart() {
+void NavigationPolicyContainerBuilder::ResetForCrossDocumentRestart() {
host_ = nullptr;
delivered_policies_ = std::make_unique<PolicyContainerPolicies>();
}
similarity index 52%
rename from src/content/browser/renderer_host/policy_container_navigation_bundle.h
rename to src/content/browser/renderer_host/navigation_policy_container_builder.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_RENDERER_HOST_POLICY_CONTAINER_NAVIGATION_BUNDLE_H_
-#define CONTENT_BROWSER_RENDERER_HOST_POLICY_CONTAINER_NAVIGATION_BUNDLE_H_
+#ifndef CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_POLICY_CONTAINER_BUILDER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_POLICY_CONTAINER_BUILDER_H_
#include <memory>
@@ -21,50 +21,51 @@ namespace content {
class FrameNavigationEntry;
class RenderFrameHostImpl;
-// Helper for NavigationRequest. Keeps track of a few important sets of policies
-// (that of the parent document, of the navigation initiator, etc.) and computes
-// the policies of the new document being navigated to.
+// Keeps track of a few important sets of policies during a navigation: those of
+// the parent document, of the navigation initiator, etc. Computes the policies
+// of the new document being navigated to, and creates the new document's
+// `PolicyContainerHost`.
//
-// Instances of this class live in NavigationRequest. They are instantiated when
-// the NavigationRequest is constructed, and destroyed at commit time.
+// Instances of this class live in `NavigationRequest`. They are instantiated
+// when the `NavigationRequest` is constructed and destroyed at commit time.
//
// Setters can be called as the navigation progresses to record interesting
// properties for later.
//
-// When the potential response to commit is known, |ComputePolicies()| can be
+// When the potential response to commit is known, `ComputePolicies()` can be
// called to set the final polices of the new document and create a new policy
// container host.
-// For error documents, |ComputePoliciesForError()| should be used instead. It
-// can also be called after |ComputePolicies()| in some cases when the error is
-// only detected after receiving a response
+// For error documents, `ComputePoliciesForError()` should be used instead. It
+// can also be called after `ComputePolicies()` in some cases when the error is
+// only detected after receiving a response.
//
-// At commit time, |TakePolicyContainerHost()| can be called to transfer
-// ownership of the policy container host to the target RenderFrameHostImpl.
-class CONTENT_EXPORT PolicyContainerNavigationBundle {
+// At commit time, `TakePolicyContainerHost()` can be called to transfer
+// ownership of the policy container host to the target `RenderFrameHostImpl`.
+class CONTENT_EXPORT NavigationPolicyContainerBuilder {
public:
// All arguments may be nullptr and need only outlive this call.
//
- // If |parent| is not nullptr, its policies are copied.
- // If |initiator_frame_token| is not nullptr and maps to a
- // PolicyContainerHost, then its policies are copied.
- // If |history_entry| is not nullptr and contains policies, those are copied.
+ // If `parent` is not nullptr, its policies are copied.
+ // If `initiator_frame_token` is not nullptr and maps to a
+ // `PolicyContainerHost`, then its policies are copied.
+ // If `history_entry` is not nullptr and contains policies, those are copied.
//
// This must only be called on the browser's UI thread.
- PolicyContainerNavigationBundle(
+ NavigationPolicyContainerBuilder(
RenderFrameHostImpl* parent,
const blink::LocalFrameToken* initiator_frame_token,
const FrameNavigationEntry* history_entry);
- ~PolicyContainerNavigationBundle();
+ ~NavigationPolicyContainerBuilder();
// Instances of this class are neither copyable nor movable.
- PolicyContainerNavigationBundle(const PolicyContainerNavigationBundle&) =
+ NavigationPolicyContainerBuilder(const NavigationPolicyContainerBuilder&) =
delete;
- PolicyContainerNavigationBundle& operator=(
- const PolicyContainerNavigationBundle&) = delete;
- PolicyContainerNavigationBundle(PolicyContainerNavigationBundle&&) = delete;
- PolicyContainerNavigationBundle& operator=(
- PolicyContainerNavigationBundle&&) = delete;
+ NavigationPolicyContainerBuilder& operator=(
+ const NavigationPolicyContainerBuilder&) = delete;
+ NavigationPolicyContainerBuilder(NavigationPolicyContainerBuilder&&) = delete;
+ NavigationPolicyContainerBuilder& operator=(
+ NavigationPolicyContainerBuilder&&) = delete;
// Returns a pointer to a snapshot of the parent's policies captured at
// construction time. Returns nullptr if there was no parent.
@@ -81,99 +82,127 @@ class CONTENT_EXPORT PolicyContainerNavigationBundle {
// Sets the cross origin opener policy of the new document.
//
- // This must be called before |ComputePolicies()|.
+ // This must be called before `ComputePolicies()`.
void SetCrossOriginOpenerPolicy(network::CrossOriginOpenerPolicy coop);
// Sets the cross origin embedder policy of the new document.
//
- // This must be called before |ComputePolicies()|.
+ // This must be called before `ComputePolicies()`.
void SetCrossOriginEmbedderPolicy(network::CrossOriginEmbedderPolicy coep);
// Sets the IP address space of the delivered policies of the new document.
//
- // This must be called before |ComputePolicies()|.
+ // This must be called before `ComputePolicies()`.
void SetIPAddressSpace(network::mojom::IPAddressSpace address_space);
// Sets whether the origin of the document being navigated to is
// potentially-trustworthy, as defined in:
// https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy.
//
- // This must be called before |ComputePolicies()|.
+ // This must be called before `ComputePolicies()`.
void SetIsOriginPotentiallyTrustworthy(bool value);
// Records an additional Content Security Policy that will apply to the new
- // document. |policy| must not be null. Policies added this way are ignored
+ // document. `policy` must not be null. Policies added this way are ignored
// for failed navigations and history navigations.
void AddContentSecurityPolicy(
network::mojom::ContentSecurityPolicyPtr policy);
- // Same as `AddContentSecurityPolicy` above, but takes a vector of policies.
+ // Same as calling `AddContentSecurityPolicy()` on each item in `policies`.
void AddContentSecurityPolicies(
std::vector<network::mojom::ContentSecurityPolicyPtr> policies);
// Returns the delivered policies, as set so far by:
//
- // - |SetIPAddressSpace()| for |ip_address_space|
- // - |SetIsOriginPotentiallyTrustworthy()| and |ComputePolicies()| for
- // |is_web_secure_context|
+ // - `SetIPAddressSpace()` for `ip_address_space`
+ // - `SetIsOriginPotentiallyTrustworthy()` and `ComputePolicies()` for
+ // `is_web_secure_context`
const PolicyContainerPolicies& DeliveredPoliciesForTesting() const;
// Sets final policies to defaults suitable for error pages, and builds a
// policy container host.
//
+ // `is_inside_mhtml` specifies whether the navigation loads an MHTML document
+ // or a subframe of an MHTML document. This influences computed sandbox flags.
+ // `frame_sandbox_flags` represents the frame's sandbox flags.
+ //
// This method must only be called once. However it can be called after
- // |ComputePolicies()|.
+ // `ComputePolicies()`.
void ComputePoliciesForError();
// Sets final policies to their correct values and builds a policy container
// host.
//
- // |url| should designate the URL of the document after all redirects have
+ // `url` should designate the URL of the document after all redirects have
// been followed.
+ // `is_inside_mhtml` specifies whether the navigation loads an MHTML document
+ // or a subframe of an MHTML document. This influences computed sandbox flags.
+ // `frame_sandbox_flags` represents the frame's sandbox flags.
//
- // Also sets |DeliveredPolicies().is_web_secure_context| to its final value.
+ // Also sets `DeliveredPoliciesForTesting().is_web_secure_context` to its
+ // final value.
//
- // This method must only be called once. |ComputePoliciesForError()| may be
- // called later and this override the final policies.
+ // This method must only be called once. `ComputePoliciesForError()` may be
+ // called later, in which case it overrides the final policies.
void ComputePolicies(const GURL& url);
// Returns a reference to the policies of the new document, i.e. the policies
// in the policy container host to be committed.
//
- // |ComputePolicies()| or |ComputePoliciesForError()| must have been called
+ // `ComputePolicies()` or `ComputePoliciesForError()` must have been called
// previously.
const PolicyContainerPolicies& FinalPolicies() const;
- // Creates a PolicyContainer connected to this bundle's PolicyContainerHost.
+ // Creates a PolicyContainer linked to this builder's `PolicyContainerHost`.
//
- // Should only be called once. |ComputePolicies()| or
- // |ComputePoliciesForError()| must have been called previously.
+ // Should only be called once. `ComputePolicies()` or
+ // `ComputePoliciesForError()` must have been called previously.
blink::mojom::PolicyContainerPtr CreatePolicyContainerForBlink();
- // Moves the PolicyContainerHost out of this bundle. The returned host
- // contains the same policies as |FinalPolicies()|.
+ // Moves the `PolicyContainerHost` out of this builder. The returned host
+ // contains the same policies as `FinalPolicies()`.
//
- // |ComputePolicies()| or |ComputePoliciesForError()| must have been called
+ // `ComputePolicies()` or `ComputePoliciesForError()` must have been called
// previously.
scoped_refptr<PolicyContainerHost> TakePolicyContainerHost() &&;
+ // Resets this instance to its freshly-constructed state.
+ //
// Called by same-document navigation requests that need to be restarted as
// cross-document navigations. This happens when a same-document commit fails
- // due to another navigation committing in the meantime. This resets the
- // PolicyContainerNavigationBundle to the state when it was first created.
+ // due to another navigation committing in the meantime.
void ResetForCrossDocumentRestart();
+ // Modifies the bit that would allow top-level navigation without sticky
+ // user activation.
+ void SetAllowTopNavigationWithoutUserGesture(bool allow_top);
+
private:
- // Whether either of |ComputePolicies()| or |ComputePoliciesForError()| has
+ // Whether either of `ComputePolicies()` or `ComputePoliciesForError()` has
// been called yet.
bool HasComputedPolicies() const;
- // Sets |delivered_policies_.is_web_secure_context| to its final value.
+ // Sets `delivered_policies_.is_web_secure_context` to its final value.
//
- // Helper for |ComputePolicies()|.
+ // Helper for `ComputePolicies()`.
void ComputeIsWebSecureContext();
- // Sets |host_|.
+ // Sets `policies.sandbox_flags` to its final value. This merges the CSP
+ // sandbox flags with the frame's sandbox flag.
+ //
+ // `is_inside_mhtml` Whether the navigation loads an MHTML document or a
+ // subframe of an MHTML document. When true, this forces all sandbox flags on
+ // the document except popups and popups-to-escape-sandbox.
+ // `frame_sandbox_flags` The frame's sandbox flags.
+ // `policies` The policies computed for the document except for the sandbox
+ // flags.
+ //
+ // Helper for `ComputePolicies()` and `ComputePoliciesForError()`.
+ void ComputeSandboxFlags(bool is_inside_mhtml,
+ network::mojom::WebSandboxFlags frame_sandbox_flags,
+ PolicyContainerPolicies* policies);
+
+ // Sets `host_`.
void SetFinalPolicies(std::unique_ptr<PolicyContainerPolicies> policies);
// Helper for `FinalizePolicies()`. Appends the delivered Content Security
@@ -189,8 +218,7 @@ class CONTENT_EXPORT PolicyContainerNavigationBundle {
// Helper for `FinalizePolicies()`. Returns, depending on `url`, the final
// policies for the document that is going to be committed.
- std::unique_ptr<PolicyContainerPolicies> ComputeFinalPolicies(
- const GURL& url);
+ std::unique_ptr<PolicyContainerPolicies> ComputeFinalPolicies(const GURL& url);
// The policies of the parent document, if any.
const std::unique_ptr<PolicyContainerPolicies> parent_policies_;
@@ -203,15 +231,15 @@ class CONTENT_EXPORT PolicyContainerNavigationBundle {
// The policies extracted from the response as it is loaded.
//
- // See the comment on |SetIsOriginPotentiallyTrustworthy()| regarding this
- // member's |is_web_secure_context| field.
+ // See the comment on `SetIsOriginPotentiallyTrustworthy()` regarding this
+ // member's `is_web_secure_context` field.
std::unique_ptr<PolicyContainerPolicies> delivered_policies_;
- // Nullptr until |ComputePolicies()| or |ComputePoliciesForError()| is
- // called, then moved from by |TakePolicyContainerHost()|.
+ // Nullptr until `ComputePolicies()` or `ComputePoliciesForError()` is
+ // called, then moved from by `TakePolicyContainerHost()`.
scoped_refptr<PolicyContainerHost> host_;
};
} // namespace content
-#endif // CONTENT_BROWSER_RENDERER_HOST_POLICY_CONTAINER_NAVIGATION_BUNDLE_H_
+#endif // CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_POLICY_CONTAINER_BUILDER_H_
similarity index 80%
rename from src/content/browser/renderer_host/policy_container_navigation_bundle_browsertest.cc
rename to src/content/browser/renderer_host/navigation_policy_container_builder_browsertest.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/renderer_host/policy_container_host.h"
-#include "content/browser/renderer_host/policy_container_navigation_bundle.h"
+#include "content/browser/renderer_host/navigation_policy_container_builder.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/navigation_entry_impl.h"
+#include "content/browser/renderer_host/policy_container_host.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/test/back_forward_cache_util.h"
#include "content/public/test/browser_test.h"
@@ -53,12 +53,12 @@ network::mojom::ContentSecurityPolicyPtr MakeTestCSP() {
return csp;
}
-// See also the unit tests for PolicyContainerNavigationBundle, which exercise
+// See also the unit tests for NavigationPolicyContainerBuilder, which exercise
// simpler parts of the API. We use browser tests to exercise behavior in the
// presence of navigation history in particular.
-class PolicyContainerNavigationBundleBrowserTest : public ContentBrowserTest {
+class NavigationPolicyContainerBuilderBrowserTest: public ContentBrowserTest {
protected:
- explicit PolicyContainerNavigationBundleBrowserTest() { StartServer(); }
+ explicit NavigationPolicyContainerBuilderBrowserTest() { StartServer(); }
// Returns a pointer to the current root RenderFrameHostImpl.
RenderFrameHostImpl* root_frame_host() {
@@ -98,15 +98,15 @@ class PolicyContainerNavigationBundleBrowserTest : public ContentBrowserTest {
//
// Even though this could be a unit test, we define this here so as to keep all
// tests of HistoryPolicies() in the same place.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
HistoryPoliciesWithoutEntry) {
- EXPECT_THAT(PolicyContainerNavigationBundle(nullptr, nullptr, nullptr)
+ EXPECT_THAT(NavigationPolicyContainerBuilder(nullptr, nullptr, nullptr)
.HistoryPolicies(),
IsNull());
}
// Verifies that HistoryPolicies() returns non-null during history navigation.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
HistoryPoliciesForNetworkScheme) {
// Navigate to a document with a network scheme. Its history entry should have
// its policies initialized from the network response.
@@ -116,15 +116,15 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
EXPECT_EQ(root_policies.ip_address_space,
network::mojom::IPAddressSpace::kLocal);
- PolicyContainerNavigationBundle bundle(
+ NavigationPolicyContainerBuilder builder(
nullptr, nullptr, GetLastCommittedFrameNavigationEntry());
- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(root_policies))));
+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(root_policies))));
}
// Verifies that SetFrameNavigationEntry() copies the policies during history
// navigation, if any, or resets those policies when given nullptr.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
HistoryPoliciesForBlankUrl) {
RenderFrameHostImpl* root = root_frame_host();
@@ -142,15 +142,15 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
// Now that we have set up a navigation entry with non-default policies, we
// can run the test itself.
- PolicyContainerNavigationBundle bundle(
+ NavigationPolicyContainerBuilder builder(
nullptr, nullptr, GetLastCommittedFrameNavigationEntry());
- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(root_policies))));
+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(root_policies))));
}
// Verifies that HistoryPolicies() returns non-null even when associated with
// a non-current FrameNavigationEntry.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
HistoryPoliciesForNonCurentEntry) {
// Navigate to a document with a network scheme. Its history entry should have
// its policies initialized from the network response.
@@ -161,45 +161,45 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
network::mojom::IPAddressSpace::kLocal);
FrameNavigationEntry* entry = GetLastCommittedFrameNavigationEntry();
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, entry);
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, entry);
// Verify the state is correct before navigating away.
- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(root_policies))));
+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(root_policies))));
EXPECT_TRUE(NavigateToURL(shell()->web_contents(), PublicUrl()));
// Now that the FrameNavigationEntry is non-current, verify that it still has
- // the bundle.
+ // the builder.
EXPECT_NE(entry, GetLastCommittedFrameNavigationEntry());
- PolicyContainerNavigationBundle bundle2(nullptr, nullptr, entry);
- EXPECT_THAT(bundle2.HistoryPolicies(), Pointee(Eq(ByRef(root_policies))));
+ NavigationPolicyContainerBuilder builder2(nullptr, nullptr, entry);
+ EXPECT_THAT(builder2.HistoryPolicies(), Pointee(Eq(ByRef(root_policies))));
}
// Verifies that CreatePolicyContainerForBlink() returns a policy container
-// containing a copy of the bundle's final policies.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+// containing a copy of the builder's final policies.
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
CreatePolicyContainerForBlink) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
- bundle.ComputePolicies(GURL());
+ builder.ComputePolicies(GURL());
// This must be called on a task runner, hence the need for this test to be
// a browser test and not a simple unit test.
blink::mojom::PolicyContainerPtr container =
- bundle.CreatePolicyContainerForBlink();
+ builder.CreatePolicyContainerForBlink();
ASSERT_FALSE(container.is_null());
ASSERT_FALSE(container->policies.is_null());
const blink::mojom::PolicyContainerPolicies& policies = *container->policies;
- EXPECT_EQ(policies.referrer_policy, bundle.FinalPolicies().referrer_policy);
- EXPECT_EQ(policies.ip_address_space, bundle.FinalPolicies().ip_address_space);
+ EXPECT_EQ(policies.referrer_policy, builder.FinalPolicies().referrer_policy);
+ EXPECT_EQ(policies.ip_address_space, builder.FinalPolicies().ip_address_space);
}
// Verifies that when the URL of the document to commit is `about:blank`, and
// when a navigation entry with policies is given, then the navigation
// initiator's policies are ignored in favor of the policies from the entry.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
FinalPoliciesAboutBlankWithInitiatorAndHistory) {
RenderFrameHostImpl* root = root_frame_host();
@@ -219,28 +219,28 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
base::MakeRefCounted<PolicyContainerHost>(std::move(initiator_policies));
initiator_host->AssociateWithFrameToken(token);
- PolicyContainerNavigationBundle bundle(
+ NavigationPolicyContainerBuilder builder(
nullptr, &token, GetLastCommittedFrameNavigationEntry());
- EXPECT_NE(*bundle.HistoryPolicies(), *bundle.InitiatorPolicies());
+ EXPECT_NE(*builder.HistoryPolicies(), *builder.InitiatorPolicies());
std::unique_ptr<PolicyContainerPolicies> history_policies =
- bundle.HistoryPolicies()->Clone();
+ builder.HistoryPolicies()->Clone();
// Deliver a Content Security Policy via `AddContentSecurityPolicy`. This
- // policy should not be incorporated in the final policies, since the bundle
+ // policy should not be incorporated in the final policies, since the builder
// is using the history policies.
- bundle.AddContentSecurityPolicy(MakeTestCSP());
+ builder.AddContentSecurityPolicy(MakeTestCSP());
- bundle.ComputePolicies(AboutBlankUrl());
+ builder.ComputePolicies(AboutBlankUrl());
- EXPECT_EQ(bundle.FinalPolicies(), *history_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *history_policies);
}
// Verifies that when the URL of the document to commit is `about:srcdoc`, and
// when a navigation entry with policies is given, then the parent's policies
// are ignored in favor of the policies from the entry.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
FinalPoliciesAboutSrcDocWithParentAndHistory) {
// First navigate to a local scheme with non-default policies. To do that, we
// first navigate to a document with a public address space, then have that
@@ -263,26 +263,26 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
EXPECT_EQ(true, EvalJs(root, JsReplace(script_template, LocalUrl())));
RenderFrameHostImpl* parent = root->child_at(0)->current_frame_host();
- PolicyContainerNavigationBundle bundle(
+ NavigationPolicyContainerBuilder builder(
parent, nullptr, GetLastCommittedFrameNavigationEntry());
- EXPECT_NE(*bundle.HistoryPolicies(), *bundle.ParentPolicies());
+ EXPECT_NE(*builder.HistoryPolicies(), *builder.ParentPolicies());
std::unique_ptr<PolicyContainerPolicies> history_policies =
- bundle.HistoryPolicies()->Clone();
+ builder.HistoryPolicies()->Clone();
// Deliver a Content Security Policy via `AddContentSecurityPolicy`. This
- // policy should not be incorporated in the final policies, since the bundle
+ // policy should not be incorporated in the final policies, since the builder
// is using the history policies.
- bundle.AddContentSecurityPolicy(MakeTestCSP());
+ builder.AddContentSecurityPolicy(MakeTestCSP());
- bundle.ComputePolicies(AboutSrcdocUrl());
+ builder.ComputePolicies(AboutSrcdocUrl());
- EXPECT_EQ(bundle.FinalPolicies(), *history_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *history_policies);
}
// Verifies that history policies are ignored in the case of error pages.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
FinalPoliciesErrorPageWithHistory) {
// First navigate to a local scheme with non-default policies. To do that, we
// first navigate to a document with a public address space, then have that
@@ -292,18 +292,18 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
EXPECT_TRUE(NavigateToURL(shell()->web_contents(), PublicUrl()));
EXPECT_TRUE(NavigateToURLFromRenderer(root_frame_host(), AboutBlankUrl()));
- PolicyContainerNavigationBundle bundle(
+ NavigationPolicyContainerBuilder builder(
nullptr, nullptr, GetLastCommittedFrameNavigationEntry());
- bundle.ComputePoliciesForError();
+ builder.ComputePoliciesForError();
// Error pages commit with default policies, ignoring the history policies.
- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies());
+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies());
}
// After |ComputePolicies()| or |ComputePoliciesForError()|, the history
// policies are still accessible.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
AccessHistoryAfterComputingPolicies) {
// First navigate to a local scheme with non-default policies. To do that, we
// first navigate to a document with a public address space, then have that
@@ -313,22 +313,22 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
EXPECT_TRUE(NavigateToURL(shell()->web_contents(), PublicUrl()));
EXPECT_TRUE(NavigateToURLFromRenderer(root_frame_host(), AboutBlankUrl()));
- PolicyContainerNavigationBundle bundle(
+ NavigationPolicyContainerBuilder builder(
nullptr, nullptr, GetLastCommittedFrameNavigationEntry());
std::unique_ptr<PolicyContainerPolicies> history_policies =
- bundle.HistoryPolicies()->Clone();
+ builder.HistoryPolicies()->Clone();
- bundle.ComputePolicies(AboutBlankUrl());
- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies))));
+ builder.ComputePolicies(AboutBlankUrl());
+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies))));
- bundle.ComputePoliciesForError();
- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies))));
+ builder.ComputePoliciesForError();
+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies))));
}
// Verifies that history policies from a reused navigation entry aren't used for
// non-local navigations.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
NoHistoryPoliciesInheritedForNonLocalUrlsOnReload) {
// Navigate to some non-local url first.
WebContents* tab = shell()->web_contents();
@@ -353,7 +353,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
// Verifies that history policies from a restored navigation entry are
// overwritten if the policies have changed.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
NoHistoryPoliciesInheritedForNetworkUrlsOnBack) {
DisableBackForwardCacheForTesting(shell()->web_contents(),
BackForwardCache::TEST_REQUIRES_NO_CACHING);
@@ -396,7 +396,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
// Verifies that the history policies are preserved on
// ResetForCrossDocumentRestart.
-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest,
ResetForCrossDocumentRestartHistoryPolicies) {
RenderFrameHostImpl* root = root_frame_host();
@@ -408,22 +408,22 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest,
EXPECT_TRUE(NavigateToURL(shell()->web_contents(), PublicUrl()));
EXPECT_TRUE(NavigateToURLFromRenderer(root, AboutBlankUrl()));
- PolicyContainerNavigationBundle bundle(
+ NavigationPolicyContainerBuilder builder(
nullptr, nullptr, GetLastCommittedFrameNavigationEntry());
std::unique_ptr<PolicyContainerPolicies> history_policies =
- bundle.HistoryPolicies()->Clone();
+ builder.HistoryPolicies()->Clone();
- bundle.ComputePolicies(GURL("http://foo.test"));
+ builder.ComputePolicies(GURL("http://foo.test"));
- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies());
+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies());
- bundle.ResetForCrossDocumentRestart();
- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies))));
+ builder.ResetForCrossDocumentRestart();
+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies))));
- bundle.ComputePolicies(AboutBlankUrl());
+ builder.ComputePolicies(AboutBlankUrl());
- EXPECT_EQ(bundle.FinalPolicies(), *history_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *history_policies);
}
} // namespace
similarity index 57%
rename from src/content/browser/renderer_host/policy_container_navigation_bundle_unittest.cc
rename to src/content/browser/renderer_host/navigation_policy_container_builder_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/renderer_host/policy_container_navigation_bundle.h"
+#include "content/browser/renderer_host/navigation_policy_container_builder.h"
#include <iosfwd>
#include <utility>
@@ -46,7 +46,8 @@ std::unique_ptr<PolicyContainerPolicies> MakeTestPolicies() {
network::mojom::ReferrerPolicy::kAlways,
network::mojom::IPAddressSpace::kPublic,
/*is_web_secure_context=*/true, std::move(csp_list),
- network::CrossOriginOpenerPolicy(), network::CrossOriginEmbedderPolicy());
+ network::CrossOriginOpenerPolicy(), network::CrossOriginEmbedderPolicy(),
+ /*can_navigate_top_without_user_gesture=*/true);
}
// Shorthand.
@@ -70,7 +71,7 @@ GURL AboutSrcdocUrl() {
//
// This test fixture is moderately expensive to set up (~100ms overhead per
// test), but still an order of magnitude faster than browser tests.
-class PolicyContainerNavigationBundleTest
+class NavigationPolicyContainerBuilderTest
: public RenderViewHostImplTestHarness {
protected:
void SetUp() override {
@@ -80,45 +81,46 @@ class PolicyContainerNavigationBundleTest
};
// Verifies that the initial delivered policies are default-constructed.
-TEST_F(PolicyContainerNavigationBundleTest, DefaultDeliveredPolicies) {
- EXPECT_EQ(PolicyContainerNavigationBundle(nullptr, nullptr, nullptr)
+TEST_F(NavigationPolicyContainerBuilderTest, DefaultDeliveredPolicies) {
+ EXPECT_EQ(NavigationPolicyContainerBuilder(nullptr, nullptr, nullptr)
.DeliveredPoliciesForTesting(),
PolicyContainerPolicies());
}
-// Verifies that SetIPAddressSpace sets the address space in the bundle's
+// Verifies that SetIPAddressSpace sets the address space in the builder's
// delivered policies.
-TEST_F(PolicyContainerNavigationBundleTest, SetIPAddressSpace) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
+TEST_F(NavigationPolicyContainerBuilderTest, SetIPAddressSpace) {
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
PolicyContainerPolicies expected_policies;
expected_policies.ip_address_space = network::mojom::IPAddressSpace::kPublic;
- EXPECT_EQ(bundle.DeliveredPoliciesForTesting(), expected_policies);
+ EXPECT_EQ(builder.DeliveredPoliciesForTesting(), expected_policies);
}
// Verifies that SetIsOriginPotentiallyTrustworthy sets the secure context bit
-// in the bundle's delivered policies.
-TEST_F(PolicyContainerNavigationBundleTest, SetIsOriginPotentiallyTrustworthy) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
- bundle.SetIsOriginPotentiallyTrustworthy(true);
+// in the builder's delivered policies.
+TEST_F(NavigationPolicyContainerBuilderTest,
+ SetIsOriginPotentiallyTrustworthy) {
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
+ builder.SetIsOriginPotentiallyTrustworthy(true);
PolicyContainerPolicies expected_policies;
expected_policies.is_web_secure_context = true;
- EXPECT_EQ(bundle.DeliveredPoliciesForTesting(), expected_policies);
+ EXPECT_EQ(builder.DeliveredPoliciesForTesting(), expected_policies);
- bundle.SetIsOriginPotentiallyTrustworthy(false);
+ builder.SetIsOriginPotentiallyTrustworthy(false);
expected_policies.is_web_secure_context = false;
- EXPECT_EQ(bundle.DeliveredPoliciesForTesting(), expected_policies);
+ EXPECT_EQ(builder.DeliveredPoliciesForTesting(), expected_policies);
}
// Verifies that SetCrossOriginOpenerPolicy sets the cross-origin-opener-policy
-// in the bundle's delivered policies.
-TEST_F(PolicyContainerNavigationBundleTest, SetCrossOriginOpenerPolicy) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
+// in the builder's delivered policies.
+TEST_F(NavigationPolicyContainerBuilderTest, SetCrossOriginOpenerPolicy) {
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
network::CrossOriginOpenerPolicy coop;
coop.value = network::mojom::CrossOriginOpenerPolicyValue::kSameOrigin;
@@ -127,140 +129,143 @@ TEST_F(PolicyContainerNavigationBundleTest, SetCrossOriginOpenerPolicy) {
coop.reporting_endpoint = "A";
coop.report_only_reporting_endpoint = "B";
- bundle.SetCrossOriginOpenerPolicy(coop);
+ builder.SetCrossOriginOpenerPolicy(coop);
PolicyContainerPolicies expected_policies;
expected_policies.cross_origin_opener_policy = coop;
- EXPECT_EQ(bundle.DeliveredPoliciesForTesting(), expected_policies);
+ EXPECT_EQ(builder.DeliveredPoliciesForTesting(), expected_policies);
}
-// Verifies that the default final policies of a bundle are default-constructed,
-// and are equal to the policies of the bundle's policy container host.
-TEST_F(PolicyContainerNavigationBundleTest, DefaultFinalPolicies) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
- bundle.ComputePolicies(GURL());
+// Verifies that the default final policies of a builder are
+// default-constructed, and are equal to the policies of the builder's policy
+// container host.
+TEST_F(NavigationPolicyContainerBuilderTest, DefaultFinalPolicies) {
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
+ builder.ComputePolicies(GURL());
PolicyContainerPolicies expected_policies;
- EXPECT_EQ(bundle.FinalPolicies(), expected_policies);
+ EXPECT_EQ(builder.FinalPolicies(), expected_policies);
scoped_refptr<PolicyContainerHost> host =
- std::move(bundle).TakePolicyContainerHost();
+ std::move(builder).TakePolicyContainerHost();
ASSERT_THAT(host, NotNull());
EXPECT_EQ(host->policies(), expected_policies);
}
// Verifies that when the URL of the document to commit does not have a local
// scheme, then the final policies are copied from the delivered policies.
-TEST_F(PolicyContainerNavigationBundleTest, FinalPoliciesNormalUrl) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
+TEST_F(NavigationPolicyContainerBuilderTest, FinalPoliciesNormalUrl) {
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
- bundle.AddContentSecurityPolicy(MakeTestCSP());
+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
+ builder.AddContentSecurityPolicy(MakeTestCSP());
std::unique_ptr<PolicyContainerPolicies> delivered_policies =
- bundle.DeliveredPoliciesForTesting().Clone();
- bundle.ComputePolicies(GURL("https://foo.test"));
+ builder.DeliveredPoliciesForTesting().Clone();
+ builder.ComputePolicies(GURL("https://foo.test"));
- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies);
}
// Verifies the final policies when the URL of the document to commit is
// `about:blank` but there is no initiator.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
FinalPoliciesAboutBlankWithoutInitiator) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
std::unique_ptr<PolicyContainerPolicies> delivered_policies =
- bundle.DeliveredPoliciesForTesting().Clone();
- bundle.ComputePolicies(AboutBlankUrl());
+ builder.DeliveredPoliciesForTesting().Clone();
+ builder.ComputePolicies(AboutBlankUrl());
- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies);
}
// Verifies the final policies when the URL of the document to commit is
// `about:blank` but there is no initiator, and we have some additional CSPs.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
FinalPoliciesAboutBlankWithoutInitiatorAdditionalCSP) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
- bundle.AddContentSecurityPolicy(MakeTestCSP());
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
+ builder.AddContentSecurityPolicy(MakeTestCSP());
std::unique_ptr<PolicyContainerPolicies> delivered_policies =
- bundle.DeliveredPoliciesForTesting().Clone();
- bundle.ComputePolicies(AboutBlankUrl());
+ builder.DeliveredPoliciesForTesting().Clone();
+ builder.ComputePolicies(AboutBlankUrl());
- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies);
}
// This test verifies the default final policies on error pages.
-TEST_F(PolicyContainerNavigationBundleTest, DefaultFinalPoliciesForErrorPage) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
+TEST_F(NavigationPolicyContainerBuilderTest, DefaultFinalPoliciesForErrorPage) {
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
- bundle.ComputePoliciesForError();
+ builder.ComputePoliciesForError();
// Error pages commit with default policies, mostly ignoring the delivered
// policies and the document's URL.
- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies());
+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies());
}
// This test verifies that error pages commit in the same IP address space as
// the underlying page would have, had it not failed to load.
-TEST_F(PolicyContainerNavigationBundleTest, ErrorPageIPAddressSpace) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
+TEST_F(NavigationPolicyContainerBuilderTest, ErrorPageIPAddressSpace) {
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
- bundle.ComputePoliciesForError();
+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic);
+ builder.ComputePoliciesForError();
PolicyContainerPolicies expected_policies;
expected_policies.ip_address_space = network::mojom::IPAddressSpace::kPublic;
- EXPECT_EQ(bundle.FinalPolicies(), expected_policies);
+ EXPECT_EQ(builder.FinalPolicies(), expected_policies);
}
-// Variation of: PolicyContainerNavigationBundleTest.ErrorPageIPAddressSpace
+// Variation of: NavigationPolicyContainerBuilderTest.ErrorPageIPAddressSpace
// The decision to commit an error happens after receiving the response.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
ErrorPageIPAddressSpaceAfterResponse) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPrivate);
+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPrivate);
PolicyContainerPolicies expected_policies;
expected_policies.ip_address_space = network::mojom::IPAddressSpace::kPrivate;
- bundle.ComputePolicies(GURL("https://foo.test"));
- EXPECT_EQ(bundle.FinalPolicies(), expected_policies);
+ builder.ComputePolicies(GURL("https://foo.test"));
+ EXPECT_EQ(builder.FinalPolicies(), expected_policies);
- bundle.ComputePoliciesForError();
- EXPECT_EQ(bundle.FinalPolicies(), expected_policies);
+ builder.ComputePoliciesForError();
+ EXPECT_EQ(builder.FinalPolicies(), expected_policies);
}
// CSP delivered by the HTTP response are ignored for error document.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
DeliveredCSPIgnoredForErrorDocument) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
- bundle.AddContentSecurityPolicy(network::mojom::ContentSecurityPolicy::New());
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
+ builder.AddContentSecurityPolicy(
+ network::mojom::ContentSecurityPolicy::New());
- bundle.ComputePolicies(GURL("https://foo.test"));
- EXPECT_THAT(bundle.FinalPolicies().content_security_policies, SizeIs(1));
+ builder.ComputePolicies(GURL("https://foo.test"));
+ EXPECT_THAT(builder.FinalPolicies().content_security_policies, SizeIs(1));
- bundle.ComputePoliciesForError();
- EXPECT_THAT(bundle.FinalPolicies().content_security_policies, SizeIs(0));
+ builder.ComputePoliciesForError();
+ EXPECT_THAT(builder.FinalPolicies().content_security_policies, SizeIs(0));
}
// Verifies that InitiatorPolicies() returns nullptr in the absence of an
// initiator frame token.
-TEST_F(PolicyContainerNavigationBundleTest, InitiatorPoliciesWithoutInitiator) {
- EXPECT_THAT(PolicyContainerNavigationBundle(nullptr, nullptr, nullptr)
+TEST_F(NavigationPolicyContainerBuilderTest,
+ InitiatorPoliciesWithoutInitiator) {
+ EXPECT_THAT(NavigationPolicyContainerBuilder(nullptr, nullptr, nullptr)
.InitiatorPolicies(),
IsNull());
}
-// It would be nice to verify that when given a wrong token, the bundle just
+// It would be nice to verify that when given a wrong token, the builder just
// ignores it and InitiatorPolicies() returns nullptr. However that path is
// guarded by a DCHECK() so we cannot test it.
// Verifies that SetInitiator() copies the policies of the policy container host
// associated to the given frame token, or resets those policies when given
// nullptr.
-TEST_F(PolicyContainerNavigationBundleTest, InitiatorPoliciesWithInitiator) {
+TEST_F(NavigationPolicyContainerBuilderTest, InitiatorPoliciesWithInitiator) {
std::unique_ptr<PolicyContainerPolicies> initiator_policies =
MakeTestPolicies();
@@ -269,15 +274,15 @@ TEST_F(PolicyContainerNavigationBundleTest, InitiatorPoliciesWithInitiator) {
// Force implicit conversion from LocalFrameToken to UnguessableToken.
const blink::LocalFrameToken& token = initiator->GetFrameToken();
- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr);
+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr);
- EXPECT_THAT(bundle.InitiatorPolicies(),
+ EXPECT_THAT(builder.InitiatorPolicies(),
Pointee(Eq(ByRef(*initiator_policies))));
}
// Verifies that when the URL of the document to commit is `about:blank`, the
-// bundle's final policies are copied from the initiator.
-TEST_F(PolicyContainerNavigationBundleTest,
+// builder's final policies are copied from the initiator.
+TEST_F(NavigationPolicyContainerBuilderTest,
FinalPoliciesAboutBlankWithInitiator) {
std::unique_ptr<PolicyContainerPolicies> initiator_policies =
MakeTestPolicies();
@@ -287,15 +292,15 @@ TEST_F(PolicyContainerNavigationBundleTest,
// Force implicit conversion from LocalFrameToken to UnguessableToken.
const blink::LocalFrameToken& token = initiator->GetFrameToken();
- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr);
- bundle.ComputePolicies(AboutBlankUrl());
+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr);
+ builder.ComputePolicies(AboutBlankUrl());
- EXPECT_EQ(bundle.FinalPolicies(), *initiator_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *initiator_policies);
}
// Verifies that when the URL of the document to commit is `blob:.*`, the
-// bundle's final policies are copied from the initiator.
-TEST_F(PolicyContainerNavigationBundleTest, FinalPoliciesBlobWithInitiator) {
+// builder's final policies are copied from the initiator.
+TEST_F(NavigationPolicyContainerBuilderTest, FinalPoliciesBlobWithInitiator) {
std::unique_ptr<PolicyContainerPolicies> initiator_policies =
MakeTestPolicies();
TestRenderFrameHost* initiator = contents()->GetMainFrame();
@@ -303,18 +308,18 @@ TEST_F(PolicyContainerNavigationBundleTest, FinalPoliciesBlobWithInitiator) {
// Force implicit conversion from LocalFrameToken to UnguessableToken.
const blink::LocalFrameToken& token = initiator->GetFrameToken();
- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr);
+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr);
- bundle.ComputePolicies(
+ builder.ComputePolicies(
GURL("blob:https://example.com/016ece86-b7f9-4b07-88c2-a0e36b7f1dd6"));
- EXPECT_EQ(bundle.FinalPolicies(), *initiator_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *initiator_policies);
}
// Verifies that when the URL of the document to commit is `about:blank`, the
-// bundle's final policies are copied from the initiator, and additional
+// builder's final policies are copied from the initiator, and additional
// delivered policies are merged.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
FinalPoliciesAboutBlankWithInitiatorAndAdditionalCSP) {
std::unique_ptr<PolicyContainerPolicies> initiator_policies =
MakeTestPolicies();
@@ -324,91 +329,91 @@ TEST_F(PolicyContainerNavigationBundleTest,
// Force implicit conversion from LocalFrameToken to UnguessableToken.
const blink::LocalFrameToken& token = initiator->GetFrameToken();
- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr);
+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr);
// Add some CSP.
network::mojom::ContentSecurityPolicyPtr test_csp = MakeTestCSP();
- bundle.AddContentSecurityPolicy(test_csp.Clone());
- bundle.ComputePolicies(AboutBlankUrl());
+ builder.AddContentSecurityPolicy(test_csp.Clone());
+ builder.ComputePolicies(AboutBlankUrl());
// Append the CPS to the `initiator_policies` just for testing equality
// later.
initiator_policies->content_security_policies.push_back(std::move(test_csp));
- EXPECT_EQ(bundle.FinalPolicies(), *initiator_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *initiator_policies);
}
// Verifies that ParentPolicies returns nullptr in the absence of a parent.
-TEST_F(PolicyContainerNavigationBundleTest, ParentPoliciesWithoutParent) {
- EXPECT_THAT(PolicyContainerNavigationBundle(nullptr, nullptr, nullptr)
+TEST_F(NavigationPolicyContainerBuilderTest, ParentPoliciesWithoutParent) {
+ EXPECT_THAT(NavigationPolicyContainerBuilder(nullptr, nullptr, nullptr)
.ParentPolicies(),
IsNull());
}
// Verifies that ParentPolicies returns a pointer to a copy of the parent's
// policies.
-TEST_F(PolicyContainerNavigationBundleTest, ParentPoliciesWithParent) {
+TEST_F(NavigationPolicyContainerBuilderTest, ParentPoliciesWithParent) {
std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies();
TestRenderFrameHost* parent = contents()->GetMainFrame();
parent->SetPolicyContainerHost(NewHost(parent_policies->Clone()));
- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr);
+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr);
- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
}
// Verifies that when the the URL of the document to commit is `about:srcdoc`,
-// the bundle's final policies are copied from the parent.
-TEST_F(PolicyContainerNavigationBundleTest,
+// the builder's final policies are copied from the parent.
+TEST_F(NavigationPolicyContainerBuilderTest,
FinalPoliciesAboutSrcdocWithParent) {
std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies();
TestRenderFrameHost* parent = contents()->GetMainFrame();
parent->SetPolicyContainerHost(NewHost(parent_policies->Clone()));
- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr);
- bundle.ComputePolicies(AboutSrcdocUrl());
+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr);
+ builder.ComputePolicies(AboutSrcdocUrl());
- EXPECT_EQ(bundle.FinalPolicies(), *parent_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *parent_policies);
}
// Verifies that when a document has a potentially-trustworthy origin and no
// parent, then it is a secure context.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
IsWebSecureContextTrustworthyOriginNoParent) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
- bundle.SetIsOriginPotentiallyTrustworthy(true);
+ builder.SetIsOriginPotentiallyTrustworthy(true);
std::unique_ptr<PolicyContainerPolicies> delivered_policies =
- bundle.DeliveredPoliciesForTesting().Clone();
+ builder.DeliveredPoliciesForTesting().Clone();
EXPECT_TRUE(delivered_policies->is_web_secure_context);
- bundle.ComputePolicies(GURL());
+ builder.ComputePolicies(GURL());
- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies);
}
// Verifies that when a document has a non-potentially-trustworthy origin and no
// parent, then it is not a secure context.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
IsWebSecureContextNonTrustworthyOriginNoParent) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
- bundle.SetIsOriginPotentiallyTrustworthy(false);
+ builder.SetIsOriginPotentiallyTrustworthy(false);
std::unique_ptr<PolicyContainerPolicies> delivered_policies =
- bundle.DeliveredPoliciesForTesting().Clone();
+ builder.DeliveredPoliciesForTesting().Clone();
EXPECT_FALSE(delivered_policies->is_web_secure_context);
- bundle.ComputePolicies(GURL());
+ builder.ComputePolicies(GURL());
- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies);
}
// Verifies that when a document has a potentially-trustworthy origin and a
// parent that is not a secure context, then it is not a secure context.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
IsWebSecureContextTrustworthyOriginNonSecureParent) {
std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies();
parent_policies->is_web_secure_context = false;
@@ -416,18 +421,18 @@ TEST_F(PolicyContainerNavigationBundleTest,
TestRenderFrameHost* parent = contents()->GetMainFrame();
parent->SetPolicyContainerHost(NewHost(std::move(parent_policies)));
- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr);
+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr);
- bundle.SetIsOriginPotentiallyTrustworthy(true);
+ builder.SetIsOriginPotentiallyTrustworthy(true);
- bundle.ComputePolicies(GURL("https://foo.test"));
+ builder.ComputePolicies(GURL("https://foo.test"));
- EXPECT_FALSE(bundle.FinalPolicies().is_web_secure_context);
+ EXPECT_FALSE(builder.FinalPolicies().is_web_secure_context);
}
// Verifies that when a document has a non-potentially-trustworthy origin and a
// parent that is a secure context, then it is not a secure context.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
IsWebSecureContextNonTrustworthyOriginSecureParent) {
std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies();
parent_policies->is_web_secure_context = true;
@@ -435,22 +440,22 @@ TEST_F(PolicyContainerNavigationBundleTest,
TestRenderFrameHost* parent = contents()->GetMainFrame();
parent->SetPolicyContainerHost(NewHost(std::move(parent_policies)));
- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr);
+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr);
- bundle.SetIsOriginPotentiallyTrustworthy(false);
+ builder.SetIsOriginPotentiallyTrustworthy(false);
std::unique_ptr<PolicyContainerPolicies> delivered_policies =
- bundle.DeliveredPoliciesForTesting().Clone();
+ builder.DeliveredPoliciesForTesting().Clone();
EXPECT_FALSE(delivered_policies->is_web_secure_context);
- bundle.ComputePolicies(GURL("http://foo.test"));
+ builder.ComputePolicies(GURL("http://foo.test"));
- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies);
}
// Verifies that when a document has a potentially-trustworthy origin and a
// parent that is a secure context, then it is a secure context.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
IsWebSecureContextTrustworthyOriginSecureParent) {
std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies();
parent_policies->is_web_secure_context = true;
@@ -458,61 +463,60 @@ TEST_F(PolicyContainerNavigationBundleTest,
TestRenderFrameHost* parent = contents()->GetMainFrame();
parent->SetPolicyContainerHost(NewHost(std::move(parent_policies)));
- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr);
+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr);
- bundle.SetIsOriginPotentiallyTrustworthy(true);
+ builder.SetIsOriginPotentiallyTrustworthy(true);
std::unique_ptr<PolicyContainerPolicies> delivered_policies =
- bundle.DeliveredPoliciesForTesting().Clone();
+ builder.DeliveredPoliciesForTesting().Clone();
EXPECT_TRUE(delivered_policies->is_web_secure_context);
- bundle.ComputePolicies(GURL("https://foo.test"));
+ builder.ComputePolicies(GURL("https://foo.test"));
- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies);
}
// Verifies that when the the URL of the document to commit is `about:srcdoc`,
-// the bundle's final policies are copied from the parent, and additional
+// the builder's final policies are copied from the parent, and additional
// delivered policies are merged.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
FinalPoliciesAboutSrcdocWithParentAndAdditionalCSP) {
std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies();
TestRenderFrameHost* parent = contents()->GetMainFrame();
parent->SetPolicyContainerHost(NewHost(parent_policies->Clone()));
- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr);
+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr);
// Add some CSP.
network::mojom::ContentSecurityPolicyPtr test_csp = MakeTestCSP();
- bundle.AddContentSecurityPolicy(test_csp.Clone());
- bundle.ComputePolicies(AboutSrcdocUrl());
+ builder.AddContentSecurityPolicy(test_csp.Clone());
+ builder.ComputePolicies(AboutSrcdocUrl());
// Append the CPS to the `parent_policies` just for testing equality
// later.
parent_policies->content_security_policies.push_back(std::move(test_csp));
- EXPECT_EQ(bundle.FinalPolicies(), *parent_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *parent_policies);
}
// Calling ComputePolicies() twice triggers a DCHECK.
-TEST_F(PolicyContainerNavigationBundleTest, ComputePoliciesTwiceDCHECK) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
+TEST_F(NavigationPolicyContainerBuilderTest, ComputePoliciesTwiceDCHECK) {
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
GURL url("https://foo.test");
- bundle.ComputePolicies(url);
- EXPECT_DCHECK_DEATH(bundle.ComputePolicies(url));
+ builder.ComputePolicies(url);
+ EXPECT_DCHECK_DEATH(builder.ComputePolicies(url));
}
-// Calling ComputePolicies() followed by ComputePoliciesForError() is
-// supported.
-TEST_F(PolicyContainerNavigationBundleTest, ComputePoliciesThenError) {
- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr);
- bundle.ComputePolicies(GURL("https://foo.test"));
- bundle.ComputePoliciesForError();
+// Calling ComputePolicies() followed by ComputePoliciesForError() is supported.
+TEST_F(NavigationPolicyContainerBuilderTest, ComputePoliciesThenError) {
+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr);
+ builder.ComputePolicies(GURL("https://foo.test"));
+ builder.ComputePoliciesForError();
}
-// After ComputePolicies() or ComputePoliciesForError(), the initiator
-// policies are still accessible.
-TEST_F(PolicyContainerNavigationBundleTest,
+// After ComputePolicies() or ComputePoliciesForError(), the initiator policies
+// are still accessible.
+TEST_F(NavigationPolicyContainerBuilderTest,
AccessInitiatorAfterComputingPolicies) {
std::unique_ptr<PolicyContainerPolicies> initiator_policies =
MakeTestPolicies();
@@ -520,60 +524,60 @@ TEST_F(PolicyContainerNavigationBundleTest,
initiator->SetPolicyContainerHost(NewHost(initiator_policies->Clone()));
const blink::LocalFrameToken& token = initiator->GetFrameToken();
- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr);
- EXPECT_THAT(bundle.InitiatorPolicies(),
+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr);
+ EXPECT_THAT(builder.InitiatorPolicies(),
Pointee(Eq(ByRef(*initiator_policies))));
- bundle.ComputePolicies(GURL("https://foo.test"));
- EXPECT_THAT(bundle.InitiatorPolicies(),
+ builder.ComputePolicies(GURL("https://foo.test"));
+ EXPECT_THAT(builder.InitiatorPolicies(),
Pointee(Eq(ByRef(*initiator_policies))));
- bundle.ComputePoliciesForError();
- EXPECT_THAT(bundle.InitiatorPolicies(),
+ builder.ComputePoliciesForError();
+ EXPECT_THAT(builder.InitiatorPolicies(),
Pointee(Eq(ByRef(*initiator_policies))));
}
// After ComputePolicies() or ComputePoliciesForError(), the parent
// policies are still accessible.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
AccessParentAfterComputingPolicies) {
std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies();
TestRenderFrameHost* parent = contents()->GetMainFrame();
parent->SetPolicyContainerHost(NewHost(parent_policies->Clone()));
- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr);
- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr);
+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
- bundle.ComputePolicies(GURL("https://foo.test"));
- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
+ builder.ComputePolicies(GURL("https://foo.test"));
+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
- bundle.ComputePoliciesForError();
- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
+ builder.ComputePoliciesForError();
+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
}
// Verifies that the parent policies are preserved on
// ResetForCrossDocumentRestart.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
ResetForCrossDocumentRestartParentPolicies) {
std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies();
TestRenderFrameHost* parent = contents()->GetMainFrame();
parent->SetPolicyContainerHost(NewHost(parent_policies->Clone()));
- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr);
- bundle.ComputePolicies(GURL("https://foo.test"));
- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies());
+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr);
+ builder.ComputePolicies(GURL("https://foo.test"));
+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies());
- bundle.ResetForCrossDocumentRestart();
- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
- bundle.ComputePolicies(AboutSrcdocUrl());
+ builder.ResetForCrossDocumentRestart();
+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies))));
+ builder.ComputePolicies(AboutSrcdocUrl());
- EXPECT_EQ(bundle.FinalPolicies(), *parent_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *parent_policies);
}
// Verifies that the initiator policies are preserved on
// ResetForCrossDocumentRestart.
-TEST_F(PolicyContainerNavigationBundleTest,
+TEST_F(NavigationPolicyContainerBuilderTest,
ResetForCrossDocumentRestartInitiatorPolicies) {
std::unique_ptr<PolicyContainerPolicies> initiator_policies =
MakeTestPolicies();
@@ -583,17 +587,17 @@ TEST_F(PolicyContainerNavigationBundleTest,
// Force implicit conversion from LocalFrameToken to UnguessableToken.
const blink::LocalFrameToken& token = initiator->GetFrameToken();
- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr);
+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr);
- bundle.ComputePolicies(GURL("https://foo.test"));
- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies());
+ builder.ComputePolicies(GURL("https://foo.test"));
+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies());
- bundle.ResetForCrossDocumentRestart();
- EXPECT_THAT(bundle.InitiatorPolicies(),
+ builder.ResetForCrossDocumentRestart();
+ EXPECT_THAT(builder.InitiatorPolicies(),
Pointee(Eq(ByRef(*initiator_policies))));
- bundle.ComputePolicies(AboutBlankUrl());
+ builder.ComputePolicies(AboutBlankUrl());
- EXPECT_EQ(bundle.FinalPolicies(), *initiator_policies);
+ EXPECT_EQ(builder.FinalPolicies(), *initiator_policies);
}
} // namespace
@@ -230,6 +230,9 @@ NavigationURLScheme GetScheme(const GURL& url) {
{url::kFtpScheme, NavigationURLScheme::FTP},
{url::kHttpScheme, NavigationURLScheme::HTTP},
{url::kHttpsScheme, NavigationURLScheme::HTTPS},
+ #if BUILDFLAG(IS_OHOS)
+ {url::kResourcesScheme, NavigationURLScheme::FILE},
+ #endif
});
auto it = kSchemeMap->find(url.scheme());
if (it != kSchemeMap->end())
@@ -1440,7 +1443,7 @@ NavigationRequest::NavigationRequest(
initiator_document_ = initiator_rfh->GetWeakDocumentPtr();
}
- policy_container_navigation_bundle_.emplace(
+ policy_container_builder_.emplace(
GetParentFrame(),
initiator_frame_token_.has_value() ? &*initiator_frame_token_ : nullptr,
frame_entry);
@@ -2066,7 +2069,7 @@ void NavigationRequest::BeginNavigationImpl() {
// MHTML iframe, before selecting the RenderFrameHost.
const url::Origin origin = GetOriginForURLLoaderFactoryUnchecked(this);
coop_status_.EnforceCOOP(
- policy_container_navigation_bundle_->FinalPolicies()
+ policy_container_builder_->FinalPolicies()
.cross_origin_opener_policy,
origin, net::NetworkIsolationKey(origin, origin));
@@ -2309,7 +2312,7 @@ void NavigationRequest::ResetForCrossDocumentRestart() {
// Reset navigation handle timings.
navigation_handle_timing_ = NavigationHandleTiming();
- policy_container_navigation_bundle_->ResetForCrossDocumentRestart();
+ policy_container_builder_->ResetForCrossDocumentRestart();
}
void NavigationRequest::ResetStateForSiteInstanceChange() {
@@ -2380,21 +2383,21 @@ network::mojom::ContentSecurityPolicyPtr NavigationRequest::TakeRequiredCSP() {
const PolicyContainerPolicies*
NavigationRequest::GetInitiatorPolicyContainerPolicies() const {
- return policy_container_navigation_bundle_->InitiatorPolicies();
+ return policy_container_builder_->InitiatorPolicies();
}
const PolicyContainerPolicies& NavigationRequest::GetPolicyContainerPolicies()
const {
DCHECK_GE(state_, READY_TO_COMMIT);
- return policy_container_navigation_bundle_->FinalPolicies();
+ return policy_container_builder_->FinalPolicies();
}
blink::mojom::PolicyContainerPtr
NavigationRequest::CreatePolicyContainerForBlink() {
DCHECK_GE(state_, READY_TO_COMMIT);
- return policy_container_navigation_bundle_->CreatePolicyContainerForBlink();
+ return policy_container_builder_->CreatePolicyContainerForBlink();
}
scoped_refptr<PolicyContainerHost>
@@ -2402,10 +2405,10 @@ NavigationRequest::TakePolicyContainerHost() {
DCHECK_GE(state_, READY_TO_COMMIT);
// Move the host out of the data member, then reset the member. This ensures
- // we do not use the bundle after we moved its contents.
+ // we do not use the helper after we moved its contents.
scoped_refptr<PolicyContainerHost> host =
- std::move(*policy_container_navigation_bundle_).TakePolicyContainerHost();
- policy_container_navigation_bundle_ = absl::nullopt;
+ std::move(*policy_container_builder_).TakePolicyContainerHost();
+ policy_container_builder_ = absl::nullopt;
return host;
}
@@ -2415,7 +2418,7 @@ void NavigationRequest::CreateCoepReporter(
DCHECK(!isolation_info_for_subresources_.IsEmpty());
const PolicyContainerPolicies& policies =
- policy_container_navigation_bundle_->FinalPolicies();
+ policy_container_builder_->FinalPolicies();
coep_reporter_ = std::make_unique<CrossOriginEmbedderPolicyReporter>(
static_cast<StoragePartitionImpl*>(storage_partition)->GetWeakPtr(),
common_params_->url,
@@ -3086,7 +3089,7 @@ void NavigationRequest::OnResponseStarted(
// OnRequestFailedInternal has destroyed the NavigationRequest.
return;
}
- policy_container_navigation_bundle_->SetCrossOriginOpenerPolicy(
+ policy_container_builder_->SetCrossOriginOpenerPolicy(
response_head_->parsed_headers->cross_origin_opener_policy);
}
@@ -3099,7 +3102,7 @@ void NavigationRequest::OnResponseStarted(
GetOriginForURLLoaderFactoryWithoutFinalFrameHost(
sandbox_flags_to_commit_.value());
const PolicyContainerPolicies& policies =
- policy_container_navigation_bundle_->FinalPolicies();
+ policy_container_builder_->FinalPolicies();
coop_status_.EnforceCOOP(policies.cross_origin_opener_policy, origin,
network_isolation_key);
}
@@ -3582,7 +3585,7 @@ void NavigationRequest::OnRequestFailedInternal(
// define our own flags, preferably the strictest ones instead.
ComputePoliciesToCommitForError();
- coop_status_.EnforceCOOP(policy_container_navigation_bundle_->FinalPolicies()
+ coop_status_.EnforceCOOP(policy_container_builder_->FinalPolicies()
.cross_origin_opener_policy,
url::Origin(),
net::NetworkIsolationKey::CreateTransient());
@@ -4471,7 +4474,7 @@ void NavigationRequest::CommitNavigation() {
// about to go.
service_worker_handle_->OnBeginNavigationCommit(
render_frame_host_->GetGlobalId(),
- policy_container_navigation_bundle_->FinalPolicies()
+ policy_container_builder_->FinalPolicies()
.cross_origin_embedder_policy,
std::move(reporter_remote), &service_worker_container_info,
commit_params_->document_ukm_source_id);
@@ -4493,6 +4496,27 @@ void NavigationRequest::CommitNavigation() {
}
}
+ // Determine if top-level navigation is allowed without sticky user
+ // activation. This is used to fix the exploit in https://crbug.com/1251790.
+ // If a child document is cross-origin with its parent, it loses its ability
+ // to navigate top without user gesture. One notable exception is made if its
+ // parent embeds it using sandbox="allow-top-navigation". Please note this is
+ // quite unusual, because it means using sandbox brings new capabilities, as
+ // opposed to new restrictions.
+ using WebSandboxFlags = network::mojom::WebSandboxFlags;
+ const bool embedder_allows_top_navigation_explicitly =
+ ((commit_params_->frame_policy.sandbox_flags != WebSandboxFlags::kNone) &&
+ (commit_params_->frame_policy.sandbox_flags &
+ WebSandboxFlags::kTopNavigation) == WebSandboxFlags::kNone);
+ const bool is_same_origin_to_top =
+ GetOriginToCommit() ==
+ GetRenderFrameHost()->GetMainFrame()->GetLastCommittedOrigin();
+ if (is_same_origin_to_top) {
+ policy_container_builder_->SetAllowTopNavigationWithoutUserGesture(true);
+ } else if (!IsInMainFrame() && !embedder_allows_top_navigation_explicitly) {
+ policy_container_builder_->SetAllowTopNavigationWithoutUserGesture(false);
+ }
+
// If this is a result of an ad auction, need to pass its ad component URLs to
// the renderer.
if (pending_ad_components_map_) {
@@ -4875,7 +4899,7 @@ net::Error NavigationRequest::CheckContentSecurityPolicy(
bool has_followed_redirect,
bool url_upgraded_after_redirect,
bool is_response_check) {
- DCHECK(policy_container_navigation_bundle_.has_value());
+ DCHECK(policy_container_builder_.has_value());
if (common_params_->url.SchemeIs(url::kAboutScheme))
return net::OK;
@@ -4889,7 +4913,7 @@ net::Error NavigationRequest::CheckContentSecurityPolicy(
RenderFrameHostImpl* parent = frame_tree_node()->parent();
const PolicyContainerPolicies* parent_policies =
- policy_container_navigation_bundle_->ParentPolicies();
+ policy_container_builder_->ParentPolicies();
DCHECK(!parent == !parent_policies);
if (!parent && frame_tree_node()->current_frame_host()->InsidePortal() &&
frame_tree_node()->render_manager()->GetOuterDelegateNode()) {
@@ -4900,12 +4924,12 @@ net::Error NavigationRequest::CheckContentSecurityPolicy(
->GetParent();
// TODO(antoniosartori): If we want to keep checking frame-src for portals,
// consider storing a snapshot of the parent policies in the
- // `policy_container_navigation_bundle_` at the beginning of the navigation.
+ // `policy_container_builder_` at the beginning of the navigation.
parent_policies = &parent->policy_container_host()->policies();
}
const PolicyContainerPolicies* initiator_policies =
- policy_container_navigation_bundle_->InitiatorPolicies();
+ policy_container_builder_->InitiatorPolicies();
// CSP checking happens in three phases, per steps 3-5 of
// https://fetch.spec.whatwg.org/#main-fetch:
@@ -5086,7 +5110,7 @@ NavigationRequest::CheckCSPEmbeddedEnforcement() {
GetParentFrame()->GetLastCommittedOrigin(), GetURL(), allow_csp_from,
required_csp_)) {
// Enforce the required CSPs on the frame by passing them down to blink.
- policy_container_navigation_bundle_->AddContentSecurityPolicy(
+ policy_container_builder_->AddContentSecurityPolicy(
required_csp_->Clone());
return CSPEmbeddedEnforcementResult::ALLOW_RESPONSE;
}
@@ -5738,7 +5762,7 @@ void NavigationRequest::UpdatePrivateNetworkRequestPolicy() {
}
const PolicyContainerPolicies& policies =
- policy_container_navigation_bundle_->FinalPolicies();
+ policy_container_builder_->FinalPolicies();
if (!policies.is_web_secure_context &&
base::FeatureList::IsEnabled(
@@ -6748,7 +6772,7 @@ NavigationRequest::ComputeCrossOriginEmbedderPolicy() {
// Return whether the child's |coep| is compatible with its parent's COEP. It
// also sends COEP reports if needed.
bool NavigationRequest::CheckResponseAdherenceToCoep(const GURL& url) {
- const auto& coep = policy_container_navigation_bundle_->FinalPolicies()
+ const auto& coep = policy_container_builder_->FinalPolicies()
.cross_origin_embedder_policy;
// Fenced Frames should respect the outer frame's COEP.
@@ -6824,7 +6848,7 @@ NavigationRequest::EnforceCOEP() {
bool NavigationRequest::CoopCoepSanityCheck() {
const PolicyContainerPolicies& policies =
- policy_container_navigation_bundle_->FinalPolicies();
+ policy_container_builder_->FinalPolicies();
network::mojom::CrossOriginOpenerPolicyValue coop_value =
IsInMainFrame() ? policies.cross_origin_opener_policy.value
: render_frame_host_->GetMainFrame()
@@ -6856,7 +6880,7 @@ NavigationRequest::BuildClientSecurityState() {
auto client_security_state = network::mojom::ClientSecurityState::New();
const PolicyContainerPolicies& policies =
- policy_container_navigation_bundle_->FinalPolicies();
+ policy_container_builder_->FinalPolicies();
client_security_state->is_web_secure_context = policies.is_web_secure_context;
client_security_state->ip_address_space = policies.ip_address_space;
@@ -6927,7 +6951,7 @@ RenderFrameHostImpl* NavigationRequest::GetInitiatorDocumentRenderFrameHost() {
void NavigationRequest::RecordAddressSpaceFeature() {
DCHECK(response_head_);
- DCHECK(policy_container_navigation_bundle_);
+ DCHECK(policy_container_builder_);
RenderFrameHostImpl* initiator_render_frame_host =
GetInitiatorDocumentRenderFrameHost();
@@ -6942,7 +6966,7 @@ void NavigationRequest::RecordAddressSpaceFeature() {
// If there is an initiator document, then `initiator_frame_token_` should
// have a value, and thus there should be initiator policies.
const PolicyContainerPolicies* initiator_policies =
- policy_container_navigation_bundle_->InitiatorPolicies();
+ policy_container_builder_->InitiatorPolicies();
DCHECK(initiator_policies);
if (!initiator_policies) {
base::debug::DumpWithoutCrashing(); // Just in case.
@@ -6982,31 +7006,31 @@ void NavigationRequest::ComputePoliciesToCommit() {
network::mojom::IPAddressSpace response_address_space =
CalculateIPAddressSpace(url, response_head_.get());
- policy_container_navigation_bundle_->SetIPAddressSpace(
+ policy_container_builder_->SetIPAddressSpace(
response_address_space);
if (response_head_ && !devtools_instrumentation::ShouldBypassCSP(*this)) {
- policy_container_navigation_bundle_->AddContentSecurityPolicies(
+ policy_container_builder_->AddContentSecurityPolicies(
mojo::Clone(response_head_->parsed_headers->content_security_policy));
}
// Use the unchecked / non-sandboxed origin to calculate potential
// trustworthiness. Indeed, the potential trustworthiness check should apply
// to the origin of the creation URL, prior to opaquification.
- policy_container_navigation_bundle_->SetIsOriginPotentiallyTrustworthy(
+ policy_container_builder_->SetIsOriginPotentiallyTrustworthy(
network::IsOriginPotentiallyTrustworthy(
GetOriginForURLLoaderFactoryUnchecked(this)));
- policy_container_navigation_bundle_->SetCrossOriginEmbedderPolicy(
+ policy_container_builder_->SetCrossOriginEmbedderPolicy(
ComputeCrossOriginEmbedderPolicy());
- policy_container_navigation_bundle_->ComputePolicies(url);
+ policy_container_builder_->ComputePolicies(url);
ComputeSandboxFlagsToCommit();
}
void NavigationRequest::ComputePoliciesToCommitForError() {
- policy_container_navigation_bundle_->ComputePoliciesForError();
+ policy_container_builder_->ComputePoliciesForError();
ComputeSandboxFlagsToCommit();
}
@@ -7021,7 +7045,7 @@ void NavigationRequest::ComputeSandboxFlagsToCommit() {
// The document can also restrict sandbox further, via its CSP.
const PolicyContainerPolicies& policies_to_commit =
- policy_container_navigation_bundle_->FinalPolicies();
+ policy_container_builder_->FinalPolicies();
for (const auto& csp : policies_to_commit.content_security_policies)
*sandbox_flags_to_commit_ |= csp->sandbox;
@@ -27,9 +27,9 @@
#include "content/browser/renderer_host/cross_origin_opener_policy_status.h"
#include "content/browser/renderer_host/navigation_controller_impl.h"
#include "content/browser/renderer_host/navigation_entry_impl.h"
+#include "content/browser/renderer_host/navigation_policy_container_builder.h"
#include "content/browser/renderer_host/navigation_throttle_runner.h"
#include "content/browser/renderer_host/policy_container_host.h"
-#include "content/browser/renderer_host/policy_container_navigation_bundle.h"
#include "content/browser/renderer_host/render_frame_host_csp_context.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/site_instance_impl.h"
@@ -1851,8 +1851,7 @@ class CONTENT_EXPORT NavigationRequest
const bool anonymous_;
// Non-nullopt from construction until |TakePolicyContainerHost()| is called.
- absl::optional<PolicyContainerNavigationBundle>
- policy_container_navigation_bundle_;
+ absl::optional<NavigationPolicyContainerBuilder> policy_container_builder_;
std::unique_ptr<CrossOriginEmbedderPolicyReporter> coep_reporter_;
@@ -48,7 +48,8 @@ bool operator==(const PolicyContainerPolicies& lhs,
rhs.content_security_policies.begin(),
rhs.content_security_policies.end()) &&
lhs.cross_origin_opener_policy == rhs.cross_origin_opener_policy &&
- lhs.cross_origin_embedder_policy == rhs.cross_origin_embedder_policy;
+ lhs.cross_origin_embedder_policy == rhs.cross_origin_embedder_policy &&
+ lhs.can_navigate_top_without_user_gesture == rhs.can_navigate_top_without_user_gesture;
}
bool operator!=(const PolicyContainerPolicies& lhs,
@@ -99,6 +100,9 @@ std::ostream& operator<<(std::ostream& out,
.value_or("<null>")
<< " }";
+ out << ", can_navigate_top_without_user_gesture: "
+ << policies.can_navigate_top_without_user_gesture;
+
return out << " }";
}
@@ -111,13 +115,16 @@ PolicyContainerPolicies::PolicyContainerPolicies(
std::vector<network::mojom::ContentSecurityPolicyPtr>
content_security_policies,
const network::CrossOriginOpenerPolicy& cross_origin_opener_policy,
- const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy)
+ const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy,
+ bool can_navigate_top_without_user_gesture)
: referrer_policy(referrer_policy),
ip_address_space(ip_address_space),
is_web_secure_context(is_web_secure_context),
content_security_policies(std::move(content_security_policies)),
cross_origin_opener_policy(cross_origin_opener_policy),
- cross_origin_embedder_policy(cross_origin_embedder_policy) {}
+ cross_origin_embedder_policy(cross_origin_embedder_policy),
+ can_navigate_top_without_user_gesture(
+ can_navigate_top_without_user_gesture) {}
PolicyContainerPolicies::~PolicyContainerPolicies() = default;
@@ -126,7 +133,7 @@ std::unique_ptr<PolicyContainerPolicies> PolicyContainerPolicies::Clone()
return std::make_unique<PolicyContainerPolicies>(
referrer_policy, ip_address_space, is_web_secure_context,
mojo::Clone(content_security_policies), cross_origin_opener_policy,
- cross_origin_embedder_policy);
+ cross_origin_embedder_policy, can_navigate_top_without_user_gesture);
}
void PolicyContainerPolicies::AddContentSecurityPolicies(
@@ -206,7 +213,7 @@ PolicyContainerHost::CreatePolicyContainerForBlink() {
return blink::mojom::PolicyContainer::New(
blink::mojom::PolicyContainerPolicies::New(
policies_->referrer_policy, policies_->ip_address_space,
- mojo::Clone(policies_->content_security_policies)),
+ mojo::Clone(policies_->content_security_policies), policies_->can_navigate_top_without_user_gesture),
std::move(remote));
}
@@ -32,7 +32,8 @@ struct CONTENT_EXPORT PolicyContainerPolicies {
std::vector<network::mojom::ContentSecurityPolicyPtr>
content_security_policies,
const network::CrossOriginOpenerPolicy& cross_origin_opener_policy,
- const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy);
+ const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy,
+ bool can_navigate_top_without_user_gesture);
PolicyContainerPolicies(const PolicyContainerPolicies&) = delete;
PolicyContainerPolicies operator=(const PolicyContainerPolicies&) = delete;
~PolicyContainerPolicies();
@@ -80,6 +81,14 @@ struct CONTENT_EXPORT PolicyContainerPolicies {
// See:
// https://html.spec.whatwg.org/multipage/origin.html#coep
network::CrossOriginEmbedderPolicy cross_origin_embedder_policy;
+
+ // Tracks if a document is allowed to navigate the top-level frame without
+ // sticky user activation. A document loses this ability when it is
+ // cross-origin with the top-level frame. An exception is made if the parent
+ // embeds the child with sandbox="allow-top-navigation", as opposed to not
+ // using sandboxing. A document that is same-origin to the top-level frame
+ // will always have this value set to true.
+ bool can_navigate_top_without_user_gesture = true;
};
// PolicyContainerPolicies structs are comparable for equality.
@@ -173,6 +182,10 @@ class CONTENT_EXPORT PolicyContainerHost
policies_->cross_origin_opener_policy = policy;
}
+ void SetCanNavigateTopWithoutUserGesture(bool value) {
+ policies_->can_navigate_top_without_user_gesture = value;
+ }
+
// Return a PolicyContainer containing copies of the policies and a pending
// mojo remote that can be used to update policies in this object. If called a
// second time, it resets the receiver and creates a new PolicyContainer,
@@ -427,10 +427,13 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForMainFrame) {
namespace {
-bool EqualsExceptCOOP(const PolicyContainerPolicies& lhs,
- const PolicyContainerPolicies& rhs) {
+bool EqualsExceptCOOPAndTopNavigation(const PolicyContainerPolicies& lhs,
+ const PolicyContainerPolicies& rhs) {
std::unique_ptr<PolicyContainerPolicies> rhs_modulo_coop = rhs.Clone();
rhs_modulo_coop->cross_origin_opener_policy = lhs.cross_origin_opener_policy;
+ rhs_modulo_coop->can_navigate_top_without_user_gesture =
+ lhs.can_navigate_top_without_user_gesture;
+
return lhs == *rhs_modulo_coop;
}
@@ -494,7 +497,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) {
EXPECT_TRUE(WaitForLoadStop(web_contents()));
// The new document inherits from the navigation initiator, except for COOP.
- EXPECT_TRUE(EqualsExceptCOOP(
+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation(
*main_frame_new_policies,
child->current_frame_host()->policy_container_host()->policies()));
@@ -516,7 +519,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) {
ASSERT_TRUE(WaitForLoadStop(web_contents()));
// The policies have not changed.
- EXPECT_TRUE(EqualsExceptCOOP(
+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation(
*main_frame_new_policies,
child->current_frame_host()->policy_container_host()->policies()));
ASSERT_EQ(2, controller.GetEntryCount());
@@ -542,7 +545,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) {
EXPECT_TRUE(WaitForLoadStop(web_contents()));
// The new document inherits from the navigation initiator.
- EXPECT_TRUE(EqualsExceptCOOP(
+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation(
*policies_a,
child->current_frame_host()->policy_container_host()->policies()));
@@ -585,7 +588,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) {
ASSERT_NE(nullptr, child);
// The correct referrer policy should be restored from history.
- EXPECT_TRUE(EqualsExceptCOOP(
+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation(
*policies_a,
child->current_frame_host()->policy_container_host()->policies()));
@@ -602,7 +605,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) {
EXPECT_TRUE(WaitForLoadStop(web_contents()));
// The correct referrer policy should be restored from history.
- EXPECT_TRUE(EqualsExceptCOOP(
+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation(
*main_frame_new_policies,
child->current_frame_host()->policy_container_host()->policies()));
@@ -616,7 +619,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) {
EXPECT_TRUE(WaitForLoadStop(web_contents()));
// The correct referrer policy should be restored from history.
- EXPECT_TRUE(EqualsExceptCOOP(
+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation(
*main_frame_new_policies,
child->current_frame_host()->policy_container_host()->policies()));
@@ -28,6 +28,7 @@ struct SameSizeAsPolicyContainerPolicies {
content_security_policies;
network::CrossOriginOpenerPolicy cross_origin_opener_policy;
network::CrossOriginEmbedderPolicy cross_origin_embedder_policy;
+ bool can_navigate_top_without_user_gesture;
};
} // namespace
@@ -65,7 +66,8 @@ TEST(PolicyContainerPoliciesTest, CloneIsEqual) {
auto policies = std::make_unique<PolicyContainerPolicies>(
network::mojom::ReferrerPolicy::kAlways,
network::mojom::IPAddressSpace::kUnknown,
- /*is_web_secure_context=*/true, std::move(csps), coop, coep);
+ /*is_web_secure_context=*/true, std::move(csps), coop, coep,
+ /*can_navigate_top_without_user_gesture=*/true);
EXPECT_THAT(policies->Clone(), Pointee(Eq(ByRef(*policies))));
}
@@ -8104,6 +8104,18 @@ void RenderFrameHostImpl::CommitNavigation(
}
#endif
+#if BUILDFLAG(IS_OHOS)
+ if (effective_scheme == url::kResourcesScheme && !navigation_to_web_bundle) {
+ base::TaskPriority file_factory_priority = base::TaskPriority::USER_BLOCKING;
+ non_network_factories.emplace(
+ url::kResourcesScheme,
+ FileURLLoaderFactory::Create(
+ browser_context->GetPath(),
+ browser_context->GetSharedCorsOriginAccessList(),
+ file_factory_priority));
+ }
+#endif
+
auto* partition = GetStoragePartition();
non_network_factories.emplace(
url::kFileSystemScheme,
@@ -105,11 +105,16 @@ void RenderFrameMetadataProviderImpl::OnRenderFrameMetadataChanged(
for (Observer& observer : observers_)
observer.OnRenderFrameMetadataChangedBeforeActivation(metadata);
+// ohos: fix white screen when web instance over 5.
+#if !BUILDFLAG(IS_OHOS)
if (metadata.local_surface_id != last_local_surface_id_) {
+#endif
last_local_surface_id_ = metadata.local_surface_id;
for (Observer& observer : observers_)
observer.OnLocalSurfaceIdChanged(metadata);
+#if !BUILDFLAG(IS_OHOS)
}
+#endif
if (!frame_token)
return;
@@ -206,6 +206,11 @@
#include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h"
#endif
+#if BUILDFLAG(IS_OHOS)
+#include "content/browser/font_unique_name_lookup/font_unique_name_lookup_service.h"
+#include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h"
+#endif
+
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include <sys/resource.h>
@@ -2390,7 +2395,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
base::BindRepeating(&hyphenation::HyphenationImpl::Create),
hyphenation::HyphenationImpl::GetTaskRunner());
#endif
-#if BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_OHOS)
if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) {
registry->AddInterface(
base::BindRepeating(&FontUniqueNameLookupService::Create),
@@ -322,7 +322,11 @@ class UnboundWidgetInputHandler : public blink::mojom::WidgetInputHandler {
DLOG(WARNING) << "Input request on unbound interface";
}
#if BUILDFLAG(IS_OHOS)
- void StartFling() override {
+ void TryStartFling() override {
+ DLOG(WARNING) << "Input request on unbound interface";
+ }
+
+ void TryFinishFling() override {
DLOG(WARNING) << "Input request on unbound interface";
}
#endif
@@ -4,7 +4,10 @@
#include "content/browser/web_contents/file_chooser_impl.h"
+#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
+#include "base/ranges/algorithm.h"
+#include "base/task/thread_pool.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/renderer_host/back_forward_cache_disable.h"
#include "content/browser/renderer_host/render_frame_host_delegate.h"
@@ -17,6 +20,33 @@
namespace content {
+namespace {
+
+// Removes any file that is a symlink or is inside a directory symlink.
+// For |kUploadFolder| mode only. |base_dir| is the folder being uploaded.
+std::vector<blink::mojom::FileChooserFileInfoPtr> RemoveSymlinks(
+ std::vector<blink::mojom::FileChooserFileInfoPtr> files,
+ base::FilePath base_dir) {
+ DCHECK(!base_dir.empty());
+ auto new_end = base::ranges::remove_if(
+ files,
+ [&base_dir](const base::FilePath& file_path) {
+ if (base::IsLink(file_path))
+ return true;
+ for (base::FilePath path = file_path.DirName(); base_dir.IsParent(path);
+ path = path.DirName()) {
+ if (base::IsLink(path))
+ return true;
+ }
+ return false;
+ },
+ [](const auto& file) { return file->get_native_file()->file_path; });
+ files.erase(new_end, files.end());
+ return files;
+}
+
+} // namespace
+
FileChooserImpl::FileSelectListenerImpl::~FileSelectListenerImpl() {
#if DCHECK_IS_ON()
DCHECK(was_file_select_listener_function_called_)
@@ -49,8 +79,20 @@ void FileChooserImpl::FileSelectListenerImpl::FileSelected(
"FileSelectListener::FileSelectionCanceled()";
was_file_select_listener_function_called_ = true;
#endif
- if (owner_)
- owner_->FileSelected(std::move(files), base_dir, mode);
+ if (!owner_)
+ return;
+
+ if (mode != blink::mojom::FileChooserParams::Mode::kUploadFolder) {
+ owner_->FileSelected(base_dir, mode, std::move(files));
+ return;
+ }
+
+ base::ThreadPool::PostTaskAndReplyWithResult(
+ FROM_HERE,
+ {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
+ base::BindOnce(&RemoveSymlinks, std::move(files), base_dir),
+ base::BindOnce(&FileChooserImpl::FileSelected, owner_->GetWeakPtr(),
+ base_dir, mode));
}
void FileChooserImpl::FileSelectListenerImpl::FileSelectionCanceled() {
@@ -160,9 +202,9 @@ void FileChooserImpl::EnumerateChosenDirectory(
}
void FileChooserImpl::FileSelected(
- std::vector<blink::mojom::FileChooserFileInfoPtr> files,
const base::FilePath& base_dir,
- blink::mojom::FileChooserParams::Mode mode) {
+ blink::mojom::FileChooserParams::Mode mode,
+ std::vector<blink::mojom::FileChooserFileInfoPtr> files) {
listener_impl_ = nullptr;
if (!render_frame_host_) {
std::move(callback_).Run(nullptr);
@@ -37,6 +37,8 @@ class CONTENT_EXPORT FileChooserImpl : public blink::mojom::FileChooser,
// FileSelectListener overrides:
+ // TODO(xiaochengh): Move |file| to the end of the argument list to match
+ // the argument ordering of FileChooserImpl::FileSelected().
void FileSelected(std::vector<blink::mojom::FileChooserFileInfoPtr> files,
const base::FilePath& base_dir,
blink::mojom::FileChooserParams::Mode mode) override;
@@ -68,9 +70,9 @@ class CONTENT_EXPORT FileChooserImpl : public blink::mojom::FileChooser,
~FileChooserImpl() override;
- void FileSelected(std::vector<blink::mojom::FileChooserFileInfoPtr> files,
- const base::FilePath& base_dir,
- blink::mojom::FileChooserParams::Mode mode);
+ void FileSelected(const base::FilePath& base_dir,
+ blink::mojom::FileChooserParams::Mode mode,
+ std::vector<blink::mojom::FileChooserFileInfoPtr> files);
void FileSelectionCanceled();
@@ -82,6 +84,10 @@ class CONTENT_EXPORT FileChooserImpl : public blink::mojom::FileChooser,
const base::FilePath& directory_path,
EnumerateChosenDirectoryCallback callback) override;
+ base::WeakPtr<FileChooserImpl> GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+ }
+
private:
explicit FileChooserImpl(RenderFrameHostImpl* render_frame_host);
@@ -95,6 +101,8 @@ class CONTENT_EXPORT FileChooserImpl : public blink::mojom::FileChooser,
raw_ptr<RenderFrameHostImpl> render_frame_host_;
scoped_refptr<FileSelectListenerImpl> listener_impl_;
base::OnceCallback<void(blink::mojom::FileChooserResultPtr)> callback_;
+
+ base::WeakPtrFactory<FileChooserImpl> weak_factory_{this};
};
} // namespace content
@@ -5,14 +5,18 @@
#include "content/browser/web_contents/file_chooser_impl.h"
#include "base/bind.h"
+#include "base/files/file_util.h"
+#include "base/path_service.h"
#include "base/run_loop.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/web_contents_delegate.h"
+#include "content/public/common/content_paths.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
+#include "content/test/content_browser_test_utils_internal.h"
#include "url/gurl.h"
#include "url/url_constants.h"
@@ -143,11 +147,93 @@ IN_PROC_BROWSER_TEST_F(FileChooserImplBrowserTest,
->SetListenerFunctionCalledTrueForTesting();
std::vector<blink::mojom::FileChooserFileInfoPtr> files;
files.emplace_back(blink::mojom::FileChooserFileInfoPtr(nullptr));
- chooser->FileSelected(std::move(files), base::FilePath(),
- blink::mojom::FileChooserParams::Mode::kOpen);
+ chooser->FileSelected(base::FilePath(),
+ blink::mojom::FileChooserParams::Mode::kOpen,
+ std::move(files));
// Test passes if this run_loop.Run() returns instead of timing out.
run_loop.Run();
}
+// https://crbug.com/1345275
+IN_PROC_BROWSER_TEST_F(FileChooserImplBrowserTest, UploadFolderWithSymlink) {
+ EXPECT_TRUE(NavigateToURL(
+ shell(), GetTestUrl(".", "file_input_webkitdirectory.html")));
+
+ // The folder contains a regular file and a symbolic link.
+ // When uploading the folder, the symbolic link should be excluded.
+ base::FilePath dir_test_data;
+ ASSERT_TRUE(base::PathService::Get(DIR_TEST_DATA, &dir_test_data));
+ base::FilePath folder_to_upload =
+ dir_test_data.AppendASCII("file_chooser").AppendASCII("dir_with_symlink");
+
+ base::FilePath text_file = folder_to_upload.AppendASCII("text_file.txt");
+ base::FilePath symlink_file = folder_to_upload.AppendASCII("symlink");
+
+ // Skip the test if symbolic links are not supported.
+ {
+ base::ScopedAllowBlockingForTesting allow_blocking;
+ if (!base::IsLink(symlink_file))
+ return;
+ }
+
+ std::unique_ptr<FileChooserDelegate> delegate(new FileChooserDelegate(
+ {text_file, symlink_file}, folder_to_upload, base::OnceClosure()));
+ shell()->web_contents()->SetDelegate(delegate.get());
+ EXPECT_TRUE(ExecJs(shell(),
+ "(async () => {"
+ " let listener = new Promise("
+ " resolve => fileinput.onchange = resolve);"
+ " fileinput.click();"
+ " await listener;"
+ "})()"));
+
+ EXPECT_EQ(
+ 1, EvalJs(shell(), "document.getElementById('fileinput').files.length;"));
+ EXPECT_EQ(
+ "text_file.txt",
+ EvalJs(shell(), "document.getElementById('fileinput').files[0].name;"));
+}
+
+// https://crbug.com/1378997
+IN_PROC_BROWSER_TEST_F(FileChooserImplBrowserTest, UploadFolderWithDirSymlink) {
+ EXPECT_TRUE(NavigateToURL(
+ shell(), GetTestUrl(".", "file_input_webkitdirectory.html")));
+
+ // The folder contains a regular file and a directory symbolic link.
+ // When uploading the folder, the symbolic link should not be followed.
+ base::FilePath dir_test_data;
+ ASSERT_TRUE(base::PathService::Get(DIR_TEST_DATA, &dir_test_data));
+ base::FilePath folder_to_upload = dir_test_data.AppendASCII("file_chooser")
+ .AppendASCII("dir_with_dir_symlink");
+
+ base::FilePath foo_file = folder_to_upload.AppendASCII("foo.txt");
+ base::FilePath dir_symlink = folder_to_upload.AppendASCII("symlink");
+ base::FilePath bar_file = dir_symlink.AppendASCII("bar.txt");
+
+ // Skip the test if symbolic links are not supported.
+ {
+ base::ScopedAllowBlockingForTesting allow_blocking;
+ if (!base::IsLink(dir_symlink))
+ return;
+ }
+
+ std::unique_ptr<FileChooserDelegate> delegate(new FileChooserDelegate(
+ {foo_file, bar_file}, folder_to_upload, base::OnceClosure()));
+ shell()->web_contents()->SetDelegate(delegate.get());
+ EXPECT_TRUE(ExecJs(shell(),
+ "(async () => {"
+ " let listener = new Promise("
+ " resolve => fileinput.onchange = resolve);"
+ " fileinput.click();"
+ " await listener;"
+ "})()"));
+
+ EXPECT_EQ(
+ 1, EvalJs(shell(), "document.getElementById('fileinput').files.length;"));
+ EXPECT_EQ(
+ "foo.txt",
+ EvalJs(shell(), "document.getElementById('fileinput').files[0].name;"));
+}
+
} // namespace content
@@ -3475,6 +3475,8 @@ void WebContentsImpl::FullscreenStateChanged(
"render_frame_host", rfh, "is_fullscreen",
is_fullscreen);
+ GetView()->FullscreenStateChanged(is_fullscreen);
+
if (is_fullscreen) {
if (options.is_null()) {
ReceivedBadMessage(rfh->GetProcess(),
@@ -6736,6 +6738,7 @@ void WebContentsImpl::ShowContextMenu(
"render_frame_host", render_frame_host);
// If a renderer fires off a second command to show a context menu before the
// first context menu is closed, just ignore it. https://crbug.com/707534
+ touch_insert_handle_menu_show_ = true;
if (showing_context_menu_)
return;
@@ -379,6 +379,12 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void PostWebMessage(std::string& message,
std::vector<blink::WebMessagePort>& ports,
std::string& targetUri) override;
+ void SetTouchInsertHandleMenuShow(bool show) override {
+ touch_insert_handle_menu_show_ = show;
+ }
+ bool GetTouchInsertHandleMenuShow() override {
+ return touch_insert_handle_menu_show_;
+ }
#endif
void UpdateTitleForEntry(NavigationEntry* entry,
const std::u16string& title) override;
@@ -604,6 +610,8 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
mojo::PendingAssociatedRemote<blink::mojom::ContextMenuClient>
context_menu_client,
const ContextMenuParams& params) override;
+#if BUILDFLAG(IS_OHOS)
+#endif
void RunJavaScriptDialog(RenderFrameHostImpl* render_frame_host,
const std::u16string& message,
const std::u16string& default_prompt,
@@ -1900,6 +1908,10 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
std::unique_ptr<WebContentsAndroid> web_contents_android_;
#endif
+#if BUILDFLAG(IS_OHOS)
+ bool touch_insert_handle_menu_show_ = false;
+#endif
+
// Helper classes ------------------------------------------------------------
// Primary FrameTree of this WebContents instance. This WebContents might have
@@ -107,6 +107,8 @@ class CONTENT_EXPORT WebContentsView {
// loop has ended.
virtual bool CloseTabAfterEventTrackingIfNeeded() = 0;
#endif
+
+ virtual void FullscreenStateChanged(bool is_fullscreen) = 0;
};
} // namespace content
@@ -262,6 +262,11 @@ void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) {
void WebContentsViewAndroid::OnCapturerCountChanged() {}
+void WebContentsViewAndroid::FullscreenStateChanged(bool is_fullscreen) {
+ if (select_popup_)
+ select_popup_->HideMenu();
+}
+
void WebContentsViewAndroid::ShowContextMenu(RenderFrameHost& render_frame_host,
const ContextMenuParams& params) {
auto* rwhv = static_cast<RenderWidgetHostViewAndroid*>(
@@ -83,6 +83,7 @@ class WebContentsViewAndroid : public WebContentsView,
RenderViewHost* new_host) override;
void SetOverscrollControllerEnabled(bool enabled) override;
void OnCapturerCountChanged() override;
+ void FullscreenStateChanged(bool is_fullscreen) override;
// Backend implementation of RenderViewHostDelegateView.
void ShowContextMenu(RenderFrameHost& render_frame_host,
@@ -345,15 +345,23 @@ aura::Window* GetHostWindow(aura::Window* window) {
} // namespace
+WebContentsViewAura::DropMetadata::DropMetadata(
+ const ui::DropTargetEvent& event) {
+ localized_location = event.location_f();
+ root_location = event.root_location_f();
+ source_operations = event.source_operations();
+ flags = event.flags();
+}
+
WebContentsViewAura::OnPerformDropContext::OnPerformDropContext(
RenderWidgetHostImpl* target_rwh,
- const ui::DropTargetEvent& event,
+ DropMetadata drop_metadata,
std::unique_ptr<ui::OSExchangeData> data,
base::ScopedClosureRunner end_drag_runner,
absl::optional<gfx::PointF> transformed_pt,
gfx::PointF screen_pt)
: target_rwh(target_rwh->GetWeakPtr()),
- event(event),
+ drop_metadata(drop_metadata),
data(std::move(data)),
end_drag_runner(std::move(end_drag_runner)),
transformed_pt(std::move(transformed_pt)),
@@ -1089,6 +1097,8 @@ void WebContentsViewAura::OnCapturerCountChanged() {
}
}
+void WebContentsViewAura::FullscreenStateChanged(bool is_fullscreen) {}
+
////////////////////////////////////////////////////////////////////////////////
// WebContentsViewAura, RenderViewHostDelegateView implementation:
@@ -1331,7 +1341,7 @@ void WebContentsViewAura::OnMouseEvent(ui::MouseEvent* event) {
// WebContentsViewAura, aura::client::DragDropDelegate implementation:
void WebContentsViewAura::DragEnteredCallback(
- ui::DropTargetEvent event,
+ DropMetadata drop_metadata,
std::unique_ptr<DropData> drop_data,
base::WeakPtr<RenderWidgetHostViewBase> target,
absl::optional<gfx::PointF> transformed_pt) {
@@ -1350,7 +1360,7 @@ void WebContentsViewAura::DragEnteredCallback(
current_rwh_for_drag_->FilterDropData(current_drop_data_.get());
blink::DragOperationsMask op_mask =
- ConvertToDragOperationsMask(event.source_operations());
+ ConvertToDragOperationsMask(drop_metadata.source_operations);
WebContentsDelegate* delegate = web_contents_->GetDelegate();
@@ -1380,7 +1390,8 @@ void WebContentsViewAura::DragEnteredCallback(
gfx::PointF screen_pt(display::Screen::GetScreen()->GetCursorScreenPoint());
current_rwh_for_drag_->DragTargetDragEnter(
*current_drop_data_, transformed_pt.value(), screen_pt, op_mask,
- ui::EventFlagsToWebEventModifiers(event.flags()), base::DoNothing());
+ ui::EventFlagsToWebEventModifiers(drop_metadata.flags),
+ base::DoNothing());
if (drag_dest_delegate_) {
drag_dest_delegate_->OnDragEnter();
@@ -1404,17 +1415,18 @@ void WebContentsViewAura::OnDragEntered(const ui::DropTargetEvent& event) {
drag_dest_delegate_->OnReceiveDragData(event.data());
}
+ DropMetadata drop_metadata(event);
web_contents_->GetInputEventRouter()
->GetRenderWidgetHostAtPointAsynchronously(
web_contents_->GetRenderViewHost()->GetWidget()->GetView(),
event.location_f(),
base::BindOnce(&WebContentsViewAura::DragEnteredCallback,
- weak_ptr_factory_.GetWeakPtr(), event,
+ weak_ptr_factory_.GetWeakPtr(), drop_metadata,
std::move(drop_data)));
}
void WebContentsViewAura::DragUpdatedCallback(
- ui::DropTargetEvent event,
+ DropMetadata drop_metadata,
std::unique_ptr<DropData> drop_data,
base::WeakPtr<RenderWidgetHostViewBase> target,
absl::optional<gfx::PointF> transformed_pt) {
@@ -1435,24 +1447,25 @@ void WebContentsViewAura::DragUpdatedCallback(
aura::Window* root_window = GetNativeView()->GetRootWindow();
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root_window);
- gfx::PointF screen_pt = event.root_location_f();
+ gfx::PointF screen_pt = drop_metadata.root_location;
if (screen_position_client)
screen_position_client->ConvertPointToScreen(root_window, &screen_pt);
if (target_rwh != current_rwh_for_drag_.get()) {
if (current_rwh_for_drag_) {
- gfx::PointF transformed_leave_point = event.location_f();
+ gfx::PointF transformed_leave_point = drop_metadata.localized_location;
static_cast<RenderWidgetHostViewBase*>(
web_contents_->GetRenderWidgetHostView())
->TransformPointToCoordSpaceForView(
- event.location_f(),
+ drop_metadata.localized_location,
static_cast<RenderWidgetHostViewBase*>(
current_rwh_for_drag_->GetView()),
&transformed_leave_point);
current_rwh_for_drag_->DragTargetDragLeave(transformed_leave_point,
screen_pt);
}
- DragEnteredCallback(event, std::move(drop_data), target, transformed_pt);
+ DragEnteredCallback(drop_metadata, std::move(drop_data), target,
+ transformed_pt);
}
if (!current_drop_data_) {
@@ -1461,10 +1474,11 @@ void WebContentsViewAura::DragUpdatedCallback(
DCHECK(transformed_pt.has_value());
blink::DragOperationsMask op_mask =
- ConvertToDragOperationsMask(event.source_operations());
+ ConvertToDragOperationsMask(drop_metadata.source_operations);
target_rwh->DragTargetDragOver(
transformed_pt.value(), screen_pt, op_mask,
- ui::EventFlagsToWebEventModifiers(event.flags()), base::DoNothing());
+ ui::EventFlagsToWebEventModifiers(drop_metadata.flags),
+ base::DoNothing());
if (drag_dest_delegate_)
drag_dest_delegate_->OnDragOver();
@@ -1474,7 +1488,6 @@ aura::client::DragUpdateInfo WebContentsViewAura::OnDragUpdated(
const ui::DropTargetEvent& event) {
if (web_contents_->ShouldIgnoreInputEvents())
return aura::client::DragUpdateInfo();
-
aura::client::DragUpdateInfo drag_info;
auto* focused_frame = web_contents_->GetFocusedFrame();
if (focused_frame && !web_contents_->GetBrowserContext()->IsOffTheRecord()) {
@@ -1485,13 +1498,13 @@ aura::client::DragUpdateInfo WebContentsViewAura::OnDragUpdated(
std::unique_ptr<DropData> drop_data = std::make_unique<DropData>();
// Calling this here as event.data might become invalid inside the callback.
PrepareDropData(drop_data.get(), event.data());
-
+ DropMetadata drop_metadata(event);
web_contents_->GetInputEventRouter()
->GetRenderWidgetHostAtPointAsynchronously(
web_contents_->GetRenderViewHost()->GetWidget()->GetView(),
event.location_f(),
base::BindOnce(&WebContentsViewAura::DragUpdatedCallback,
- weak_ptr_factory_.GetWeakPtr(), event,
+ weak_ptr_factory_.GetWeakPtr(), drop_metadata,
std::move(drop_data)));
drag_info.drag_operation = static_cast<int>(current_drag_op_);
@@ -1526,7 +1539,7 @@ void WebContentsViewAura::CompleteDragExit() {
}
void WebContentsViewAura::PerformDropCallback(
- ui::DropTargetEvent event,
+ DropMetadata drop_metadata,
std::unique_ptr<ui::OSExchangeData> data,
base::WeakPtr<RenderWidgetHostViewBase> target,
absl::optional<gfx::PointF> transformed_pt) {
@@ -1550,13 +1563,14 @@ void WebContentsViewAura::PerformDropCallback(
std::unique_ptr<DropData> drop_data = std::make_unique<DropData>();
PrepareDropData(drop_data.get(), *data.get());
- DragEnteredCallback(event, std::move(drop_data), target, transformed_pt);
+ DragEnteredCallback(drop_metadata, std::move(drop_data), target,
+ transformed_pt);
}
if (!current_drop_data_)
return;
- OnPerformDropContext context(target_rwh, event, std::move(data),
+ OnPerformDropContext context(target_rwh, drop_metadata, std::move(data),
std::move(end_drag_runner), transformed_pt,
screen_pt);
// |delegate_| may be null in unit tests.
@@ -1576,7 +1590,7 @@ void WebContentsViewAura::FinishOnPerformDropCallback(
OnPerformDropContext context,
WebContentsViewDelegate::DropCompletionResult result) {
const int key_modifiers =
- ui::EventFlagsToWebEventModifiers(context.event.flags());
+ ui::EventFlagsToWebEventModifiers(context.drop_metadata.flags);
// This is possibly an async callback. Make sure the RWH is still valid.
if (!context.target_rwh || !IsValidDragTarget(context.target_rwh.get()))
return;
@@ -1637,8 +1651,20 @@ WebContentsViewAura::GetDropCallback(const ui::DropTargetEvent& event) {
return base::DoNothing();
base::ScopedClosureRunner drag_exit(base::BindOnce(
&WebContentsViewAura::CompleteDragExit, weak_ptr_factory_.GetWeakPtr()));
- return base::BindOnce(&WebContentsViewAura::PerformDropOrExitDrag,
- weak_ptr_factory_.GetWeakPtr(), std::move(drag_exit));
+ DropMetadata drop_metadata(event);
+ // TODO(crbug.com/1293449): Remove this when DropTargetEvent is removed from
+ // DropCallback.
+ return base::BindOnce(
+ [](base::WeakPtr<WebContentsViewAura> web_contents,
+ base::ScopedClosureRunner exit_drag, DropMetadata drop_metadata,
+ const ui::DropTargetEvent&, std::unique_ptr<ui::OSExchangeData> data,
+ ui::mojom::DragOperation& output_drag_op) {
+ if (!web_contents)
+ return;
+ web_contents->PerformDropOrExitDrag(std::move(exit_drag), drop_metadata,
+ std::move(data), output_drag_op);
+ },
+ weak_ptr_factory_.GetWeakPtr(), std::move(drag_exit), drop_metadata);
}
void WebContentsViewAura::CompleteDrop(RenderWidgetHostImpl* target_rwh,
@@ -1662,15 +1688,15 @@ void WebContentsViewAura::CompleteDrop(RenderWidgetHostImpl* target_rwh,
void WebContentsViewAura::PerformDropOrExitDrag(
base::ScopedClosureRunner exit_drag,
- const ui::DropTargetEvent& event,
+ DropMetadata drop_metadata,
std::unique_ptr<ui::OSExchangeData> data,
ui::mojom::DragOperation& output_drag_op) {
web_contents_->GetInputEventRouter()
->GetRenderWidgetHostAtPointAsynchronously(
web_contents_->GetRenderViewHost()->GetWidget()->GetView(),
- event.location_f(),
+ drop_metadata.localized_location,
base::BindOnce(&WebContentsViewAura::PerformDropCallback,
- weak_ptr_factory_.GetWeakPtr(), event,
+ weak_ptr_factory_.GetWeakPtr(), drop_metadata,
std::move(data)));
output_drag_op = current_drag_op_;
exit_drag.ReplaceClosure(base::DoNothing());
@@ -75,12 +75,30 @@ class CONTENT_EXPORT WebContentsViewAura
RenderWidgetHostViewCreateFunction create_render_widget_host_view);
private:
+ // Just the metadata from DropTargetEvent that's safe and cheap to copy to
+ // help locate drop events in the callback.
+ struct DropMetadata {
+ explicit DropMetadata(const ui::DropTargetEvent& event);
+
+ // Location local to WebContentsViewAura.
+ gfx::PointF localized_location;
+
+ // Root location of the drop target event.
+ gfx::PointF root_location;
+
+ // The supported DnD operation of the source. A bitmask of
+ // ui::mojom::DragOperations.
+ int source_operations;
+ // Flags from ui::Event. Usually represents modifier keys used at drop time.
+ int flags;
+ };
+
// A structure used to keep drop context for asynchronously finishing a
// drop operation. This is required because some drop event data gets
// cleared out once PerformDropCallback() returns.
struct CONTENT_EXPORT OnPerformDropContext {
OnPerformDropContext(RenderWidgetHostImpl* target_rwh,
- const ui::DropTargetEvent& event,
+ DropMetadata drop_metadata,
std::unique_ptr<ui::OSExchangeData> data,
base::ScopedClosureRunner end_drag_runner,
absl::optional<gfx::PointF> transformed_pt,
@@ -89,7 +107,7 @@ class CONTENT_EXPORT WebContentsViewAura
~OnPerformDropContext();
base::WeakPtr<RenderWidgetHostImpl> target_rwh;
- ui::DropTargetEvent event;
+ DropMetadata drop_metadata;
std::unique_ptr<ui::OSExchangeData> data;
base::ScopedClosureRunner end_drag_runner;
absl::optional<gfx::PointF> transformed_pt;
@@ -180,6 +198,7 @@ class CONTENT_EXPORT WebContentsViewAura
RenderViewHost* new_host) override;
void SetOverscrollControllerEnabled(bool enabled) override;
void OnCapturerCountChanged() override;
+ void FullscreenStateChanged(bool is_fullscreen) override;
// Overridden from RenderViewHostDelegateView:
void ShowContextMenu(RenderFrameHost& render_frame_host,
@@ -245,15 +264,15 @@ class CONTENT_EXPORT WebContentsViewAura
aura::client::DragDropDelegate::DropCallback GetDropCallback(
const ui::DropTargetEvent& event) override;
- void DragEnteredCallback(ui::DropTargetEvent event,
+ void DragEnteredCallback(DropMetadata flags,
std::unique_ptr<DropData> drop_data,
base::WeakPtr<RenderWidgetHostViewBase> target,
absl::optional<gfx::PointF> transformed_pt);
- void DragUpdatedCallback(ui::DropTargetEvent event,
+ void DragUpdatedCallback(DropMetadata drop_metadata,
std::unique_ptr<DropData> drop_data,
base::WeakPtr<RenderWidgetHostViewBase> target,
absl::optional<gfx::PointF> transformed_pt);
- void PerformDropCallback(ui::DropTargetEvent event,
+ void PerformDropCallback(DropMetadata drop_metadata,
std::unique_ptr<ui::OSExchangeData> data,
base::WeakPtr<RenderWidgetHostViewBase> target,
absl::optional<gfx::PointF> transformed_pt);
@@ -277,7 +296,7 @@ class CONTENT_EXPORT WebContentsViewAura
// Performs drop if it's run. Otherwise, it exits the drag. Returned by
// GetDropCallback.
void PerformDropOrExitDrag(base::ScopedClosureRunner exit_drag,
- const ui::DropTargetEvent& event,
+ DropMetadata drop_metadata,
std::unique_ptr<ui::OSExchangeData> data,
ui::mojom::DragOperation& output_drag_op);
@@ -110,6 +110,8 @@ bool WebContentsViewChildFrame::CloseTabAfterEventTrackingIfNeeded() {
void WebContentsViewChildFrame::OnCapturerCountChanged() {}
+void WebContentsViewChildFrame::FullscreenStateChanged(bool is_fullscreen) {}
+
void WebContentsViewChildFrame::RestoreFocus() {
NOTREACHED();
}
@@ -56,6 +56,7 @@ class WebContentsViewChildFrame : public WebContentsView,
bool CloseTabAfterEventTrackingIfNeeded() override;
#endif
void OnCapturerCountChanged() override;
+ void FullscreenStateChanged(bool is_fullscreen) override;
// Backend implementation of RenderViewHostDelegateView.
void ShowContextMenu(RenderFrameHost& render_frame_host,
@@ -88,6 +88,7 @@ class WebContentsViewMac : public WebContentsView,
void SetOverscrollControllerEnabled(bool enabled) override;
bool CloseTabAfterEventTrackingIfNeeded() override;
void OnCapturerCountChanged() override;
+ void FullscreenStateChanged(bool is_fullscreen) override;
// RenderViewHostDelegateView:
void StartDragging(const DropData& drop_data,
@@ -140,6 +140,8 @@ gfx::Rect WebContentsViewMac::GetContainerBounds() const {
void WebContentsViewMac::OnCapturerCountChanged() {}
+void WebContentsViewMac::FullscreenStateChanged(bool is_fullscreen) {}
+
void WebContentsViewMac::StartDragging(
const DropData& drop_data,
DragOperationsMask allowed_operations,
@@ -522,6 +522,16 @@ WorkerScriptFetcher::CreateFactoryBundle(
file_factory_priority));
}
+#if BUILDFLAG(IS_OHOS)
+ base::TaskPriority resources_factory_priority = base::TaskPriority::USER_VISIBLE;
+ non_network_factories.emplace(
+ url::kResourcesScheme, FileURLLoaderFactory::Create(
+ storage_partition->browser_context()->GetPath(),
+ storage_partition->browser_context()
+ ->GetSharedCorsOriginAccessList(),
+ resources_factory_priority));
+#endif
+
switch (loader_type) {
case LoaderType::kMainResource:
GetContentClient()
@@ -29,7 +29,12 @@ const char* const kDefaultSavableSchemes[] = {
url::kFileSystemScheme,
kChromeDevToolsScheme,
kChromeUIScheme,
+#if BUILDFLAG(IS_OHOS)
+ url::kDataScheme,
+ url::kResourcesScheme
+#else
url::kDataScheme
+#endif
};
// These lists are lazily initialized below and are leaked on shutdown to
@@ -595,6 +595,11 @@ class WebContents : public PageNavigator,
std::string& targetUri) = 0;
#endif
+#if BUILDFLAG(IS_OHOS)
+ virtual void SetTouchInsertHandleMenuShow(bool show) = 0;
+ virtual bool GetTouchInsertHandleMenuShow() = 0;
+#endif
+
// Saves the given title to the navigation entry and does associated work. It
// will update history and the view with the new title, and also synthesize
// titles for file URLs that have none. Thus |entry| must have a URL set.
@@ -999,9 +999,11 @@ const char kEnableSpeechDispatcher[] = "enable-speech-dispatcher";
#endif
#if BUILDFLAG(IS_OHOS)
+const char kOhosHapPath[] = "user-hap-path";
const char kEnableMultiRendererProcess[] = "enable-multi-renderer-process";
const char kForBrowser[] = "for-browser";
const char kOhosCustomScheme[] = "ohos-custom-scheme";
+const char kOhosHanceSurface[] = "ohos-enhance-surface";
#endif
#if BUILDFLAG(IS_WIN)
@@ -277,9 +277,11 @@ CONTENT_EXPORT extern const char kEnableSpeechDispatcher[];
#endif
#if BUILDFLAG(IS_OHOS)
+CONTENT_EXPORT extern const char kOhosHapPath[];
CONTENT_EXPORT extern const char kEnableMultiRendererProcess[];
CONTENT_EXPORT extern const char kForBrowser[];
CONTENT_EXPORT extern const char kOhosCustomScheme[];
+CONTENT_EXPORT extern const char kOhosHanceSurface[];
#endif
#if BUILDFLAG(IS_WIN)
@@ -267,6 +267,9 @@ bool ShellContentBrowserClient::IsHandledURL(const GURL& url) {
url::kWssScheme, url::kBlobScheme, url::kFileSystemScheme,
kChromeUIScheme, kChromeUIUntrustedScheme, kChromeDevToolsScheme,
url::kDataScheme, url::kFileScheme,
+ #if BUILDFLAG(IS_OHOS)
+ url::kResourcesScheme,
+ #endif
};
for (const char* supported_protocol : kProtocolList) {
if (url.scheme_piece() == supported_protocol)
@@ -1251,13 +1251,13 @@ test("content_browsertests") {
"../browser/renderer_host/media/video_capture_browsertest.cc",
"../browser/renderer_host/navigation_controller_impl_browsertest.cc",
"../browser/renderer_host/navigation_handle_user_data_browsertest.cc",
+ "../browser/renderer_host/navigation_policy_container_builder_browsertest.cc",
"../browser/renderer_host/navigation_request_browsertest.cc",
"../browser/renderer_host/origin_agent_cluster_browsertest.cc",
"../browser/renderer_host/page_impl_browsertest.cc",
"../browser/renderer_host/page_lifecycle_state_manager_browsertest.cc",
"../browser/renderer_host/panel_rotation_browsertest.cc",
"../browser/renderer_host/policy_container_host_browsertest.cc",
- "../browser/renderer_host/policy_container_navigation_bundle_browsertest.cc",
"../browser/renderer_host/private_network_access_browsertest.cc",
"../browser/renderer_host/render_document_host_browsertest.cc",
"../browser/renderer_host/render_frame_host_impl_browsertest.cc",
@@ -2181,13 +2181,13 @@ test("content_unittests") {
"../browser/renderer_host/mixed_content_navigation_throttle_unittest.cc",
"../browser/renderer_host/navigation_controller_impl_unittest.cc",
"../browser/renderer_host/navigation_entry_impl_unittest.cc",
+ "../browser/renderer_host/navigation_policy_container_builder_unittest.cc",
"../browser/renderer_host/navigation_request_unittest.cc",
"../browser/renderer_host/navigation_throttle_runner_unittest.cc",
"../browser/renderer_host/navigator_unittest.cc",
"../browser/renderer_host/origin_policy_throttle_unittest.cc",
"../browser/renderer_host/overscroll_controller_unittest.cc",
"../browser/renderer_host/policy_container_host_unittest.cc",
- "../browser/renderer_host/policy_container_navigation_bundle_unittest.cc",
"../browser/renderer_host/recently_destroyed_hosts_unittest.cc",
"../browser/renderer_host/render_frame_host_impl_unittest.cc",
"../browser/renderer_host/render_frame_host_manager_unittest.cc",
@@ -447,9 +447,18 @@ Shell* OpenPopup(const ToRenderFrameHost& opener,
return new_shell_observer.GetShell();
}
+FileChooserDelegate::FileChooserDelegate(std::vector<base::FilePath> files,
+ const base::FilePath& base_dir,
+ base::OnceClosure callback)
+ : files_(std::move(files)),
+ base_dir_(base_dir),
+ callback_(std::move(callback)) {}
+
FileChooserDelegate::FileChooserDelegate(const base::FilePath& file,
base::OnceClosure callback)
- : file_(file), callback_(std::move(callback)) {}
+ : FileChooserDelegate(std::vector<base::FilePath>(1, file),
+ base::FilePath(),
+ std::move(callback)) {}
FileChooserDelegate::~FileChooserDelegate() = default;
@@ -457,16 +466,21 @@ void FileChooserDelegate::RunFileChooser(
RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) {
- // Send the selected file to the renderer process.
- auto file_info = blink::mojom::FileChooserFileInfo::NewNativeFile(
- blink::mojom::NativeFileInfo::New(file_, std::u16string()));
+ // |base_dir_| should be set for and only for |kUploadFolder| mode.
+ DCHECK(base_dir_.empty() ==
+ (params.mode != blink::mojom::FileChooserParams::Mode::kUploadFolder));
+ // Send the selected files to the renderer process.
std::vector<blink::mojom::FileChooserFileInfoPtr> files;
- files.push_back(std::move(file_info));
- listener->FileSelected(std::move(files), base::FilePath(),
- blink::mojom::FileChooserParams::Mode::kOpen);
+ for (const auto& file : files_) {
+ auto file_info = blink::mojom::FileChooserFileInfo::NewNativeFile(
+ blink::mojom::NativeFileInfo::New(file, std::u16string()));
+ files.push_back(std::move(file_info));
+ }
+ listener->FileSelected(std::move(files), base_dir_, params.mode);
params_ = params.Clone();
- std::move(callback_).Run();
+ if (callback_)
+ std::move(callback_).Run();
}
FrameTestNavigationManager::FrameTestNavigationManager(
@@ -176,9 +176,14 @@ Shell* OpenPopup(const ToRenderFrameHost& opener,
class FileChooserDelegate : public WebContentsDelegate {
public:
// Constructs a WebContentsDelegate that mocks a file dialog.
- // The mocked file dialog will always reply that the user selected |file|.
- // |callback| is invoked when RunFileChooser() is called.
+ // The mocked file dialog will always reply that the user selected |file| or
+ // |files|. |callback| is invoked when RunFileChooser() is called.
FileChooserDelegate(const base::FilePath& file, base::OnceClosure callback);
+ // |base_dir| must be set to the folder being uploaded in |kUploadFolder|
+ // mode, and must be empty in all other modes.
+ FileChooserDelegate(std::vector<base::FilePath> files,
+ const base::FilePath& base_dir,
+ base::OnceClosure callback);
~FileChooserDelegate() override;
// Implementation of WebContentsDelegate::RunFileChooser.
@@ -190,7 +195,8 @@ class FileChooserDelegate : public WebContentsDelegate {
const blink::mojom::FileChooserParams& params() const { return *params_; }
private:
- base::FilePath file_;
+ std::vector<base::FilePath> files_;
+ const base::FilePath base_dir_;
base::OnceClosure callback_;
blink::mojom::FileChooserParamsPtr params_;
};
new file mode 100644
@@ -0,0 +1 @@
+foo
new file mode 100644
@@ -0,0 +1 @@
+../linked_dir/
\ No newline at end of file
new file mode 120000
@@ -0,0 +1 @@
+../linked_text_file.txt
\ No newline at end of file
new file mode 100644
@@ -0,0 +1 @@
+text
new file mode 100644
@@ -0,0 +1 @@
+bar
new file mode 100644
@@ -0,0 +1 @@
+linked text file
new file mode 100644
@@ -0,0 +1 @@
+<input type="file" id="fileinput" webkitdirectory />
@@ -209,6 +209,18 @@ void MessagingAPIMessageFilter::Shutdown() {
shutdown_notifier_subscription_ = {};
}
+content::RenderProcessHost* MessagingAPIMessageFilter::GetRenderProcessHost() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (!browser_context_)
+ return nullptr;
+
+ // The IPC might race with RenderProcessHost destruction. This may only
+ // happen in scenarios that are already inherently racey, so returning nullptr
+ // (and dropping the IPC) is okay and won't lead to any additional risk of
+ // data loss.
+ return content::RenderProcessHost::FromID(render_process_id_);
+}
+
void MessagingAPIMessageFilter::OverrideThreadForMessage(
const IPC::Message& message,
BrowserThread::ID* thread) {
@@ -299,8 +311,17 @@ void MessagingAPIMessageFilter::OnOpenChannelToTab(
const std::string& channel_name,
const PortId& port_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (!browser_context_)
+ auto* process = GetRenderProcessHost();
+ if (!process)
+ return;
+ TRACE_EVENT("extensions", "MessageFilter::OnOpenChannelToTab",
+ ChromeTrackEvent::kRenderProcessHost, *process);
+
+ if (!CanRendererHostExtensionOrigin(render_process_id_, extension_id)) {
+ bad_message::ReceivedBadMessage(
+ process, bad_message::EMF_INVALID_EXTENSION_ID_FOR_TAB_MSG);
return;
+ }
ChannelEndpoint source_endpoint(browser_context_, render_process_id_,
source_context);
@@ -13,6 +13,7 @@ struct ExtensionMsg_TabTargetConnectionInfo;
namespace content {
class BrowserContext;
+class RenderProcessHost;
}
namespace extensions {
@@ -39,6 +40,11 @@ class MessagingAPIMessageFilter : public content::BrowserMessageFilter {
void Shutdown();
+ // Returns the process that the IPC came from, or `nullptr` if the IPC should
+ // be dropped (in case the IPC arrived racily after the process or its
+ // BrowserContext already got destructed).
+ content::RenderProcessHost* GetRenderProcessHost();
+
// content::BrowserMessageFilter implementation:
void OverrideThreadForMessage(const IPC::Message& message,
content::BrowserThread::ID* thread) override;
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/containers/contains.h"
+#include "base/containers/cxx20_erase.h"
#include "base/lazy_instance.h"
#include "extensions/browser/api/api_resource.h"
#include "net/base/ip_address.h"
@@ -306,9 +307,7 @@ void UDPSocket::OnLeaveGroupCompleted(net::CompletionOnceCallback callback,
const std::string& normalized_address,
int result) {
if (result == net::OK) {
- auto find_result = std::find(multicast_groups_.begin(),
- multicast_groups_.end(), normalized_address);
- multicast_groups_.erase(find_result);
+ base::Erase(multicast_groups_, normalized_address);
}
std::move(callback).Run(result);
@@ -42,6 +42,7 @@ enum BadMessageReason {
EMF_INVALID_EXTENSION_ID_FOR_CONTENT_SCRIPT = 16,
EMF_INVALID_EXTENSION_ID_FOR_WORKER_CONTEXT = 17,
EMF_INVALID_PORT_CONTEXT = 18,
+ EMF_INVALID_EXTENSION_ID_FOR_TAB_MSG = 21,
// Please add new elements here. The naming convention is abbreviated class
// name (e.g. ExtensionHost becomes EH) plus a unique description of the
// reason. After making changes, you MUST update histograms.xml by running:
@@ -47,6 +47,12 @@
#endif
#endif // V8_USE_EXTERNAL_STARTUP_DATA
+#if BUILDFLAG(IS_OHOS)
+#include "base/command_line.h"
+#include "content/public/common/content_switches.h"
+#include "ohos_adapter_helper.h"
+#endif
+
namespace gin {
namespace {
@@ -487,13 +493,43 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
// files in a process.
return;
}
-
+#if BUILDFLAG(IS_OHOS)
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(::switches::kOhosHapPath)) {
+ LoadV8SnapshotFromFileByHap(snapshot_file_type);
+ } else {
+ base::MemoryMappedFile::Region file_region;
+ base::File file =
+ OpenV8File(GetSnapshotFileName(snapshot_file_type), &file_region);
+ LoadV8SnapshotFromFile(std::move(file), &file_region, snapshot_file_type);
+ }
+#else
base::MemoryMappedFile::Region file_region;
base::File file =
OpenV8File(GetSnapshotFileName(snapshot_file_type), &file_region);
LoadV8SnapshotFromFile(std::move(file), &file_region, snapshot_file_type);
+#endif
}
+#if BUILDFLAG(IS_OHOS)
+const char kSnapshotFileNameHap[] = "resources/rawfile/snapshot_blob.bin";
+// static
+int V8Initializer::LoadV8SnapshotFromFileByHap(V8SnapshotFileType snapshot_file_type) {
+ size_t length = 0;
+ std::unique_ptr<uint8_t[]> data;
+ auto resourceInstance = OHOS::NWeb::OhosAdapterHelper::GetInstance().GetResourceAdapter();
+ if (!resourceInstance->GetRawFileData(kSnapshotFileNameHap, length, data, true)) {
+ LOG(FATAL) << "couldn't mmap snapshot_blob data file " << kSnapshotFileNameHap;
+ return 1;
+ }
+ LOG(INFO) << "snapshot_blob data file length: " << length;
+ std::unique_ptr<base::MemoryMappedFile> mmapped_file = std::make_unique<base::MemoryMappedFile>();
+ mmapped_file->SetDataAndLength(data, length);
+ g_mapped_snapshot = mmapped_file.release();
+ g_snapshot_file_type = snapshot_file_type;
+ return 0;
+}
+#endif
+
// static
void V8Initializer::LoadV8SnapshotFromFile(
base::File snapshot_file,
@@ -43,6 +43,10 @@ class GIN_EXPORT V8Initializer {
static void LoadV8Snapshot(
V8SnapshotFileType snapshot_file_type = V8SnapshotFileType::kDefault);
+#if BUILDFLAG(IS_OHOS)
+ static int LoadV8SnapshotFromFileByHap(V8SnapshotFileType snapshot_file_type);
+#endif
+
// Load V8 snapshot from user provided file.
// The region argument, if non-zero, specifies the portions
// of the files to be mapped. Since the VM can boot with or without
@@ -8644,10 +8644,18 @@ void GLES2DecoderImpl::DoFramebufferTexture2DCommon(
service_id = texture_ref->service_id();
}
+ bool valid_target = false;
+ if (texture_ref) {
+ valid_target = texture_manager()->ValidForTextureTarget(
+ texture_ref->texture(), level, 0, 0, 1);
+ } else {
+ valid_target = texture_manager()->ValidForTarget(textarget, level, 0, 0, 1);
+ }
+
if ((level > 0 && !feature_info_->IsWebGL2OrES3Context() &&
!(fbo_render_mipmap_explicitly_enabled_ &&
feature_info_->feature_flags().oes_fbo_render_mipmap)) ||
- !texture_manager()->ValidForTarget(textarget, level, 0, 0, 1)) {
+ !valid_target) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE,
name, "level out of range");
@@ -8719,8 +8727,8 @@ void GLES2DecoderImpl::DoFramebufferTextureLayer(
"texture is neither TEXTURE_3D nor TEXTURE_2D_ARRAY");
return;
}
- if (!texture_manager()->ValidForTarget(texture_target, level,
- 0, 0, layer)) {
+ if (!texture_manager()->ValidForTextureTarget(texture_ref->texture(), level,
+ 0, 0, layer)) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, function_name, "invalid level or layer");
return;
@@ -15101,11 +15109,6 @@ error::Error GLES2DecoderImpl::DoCompressedTexImage(
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "imageSize < 0");
return error::kNoError;
}
- if (!texture_manager()->ValidForTarget(target, level, width, height, depth) ||
- border != 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range");
- return error::kNoError;
- }
TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
&state_, target);
if (!texture_ref) {
@@ -15114,6 +15117,12 @@ error::Error GLES2DecoderImpl::DoCompressedTexImage(
return error::kNoError;
}
Texture* texture = texture_ref->texture();
+ if (!texture_manager()->ValidForTextureTarget(texture, level, width, height,
+ depth) ||
+ border != 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range");
+ return error::kNoError;
+ }
if (texture->IsImmutable()) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, "texture is immutable");
return error::kNoError;
@@ -15483,10 +15492,6 @@ error::Error GLES2DecoderImpl::DoCompressedTexSubImage(
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "imageSize < 0");
return error::kNoError;
}
- if (!texture_manager()->ValidForTarget(target, level, width, height, depth)) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range");
- return error::kNoError;
- }
TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
&state_, target);
if (!texture_ref) {
@@ -15494,7 +15499,14 @@ error::Error GLES2DecoderImpl::DoCompressedTexSubImage(
GL_INVALID_OPERATION, func_name, "no texture bound at target");
return error::kNoError;
}
+
Texture* texture = texture_ref->texture();
+ if (!texture_manager()->ValidForTextureTarget(texture, level, width, height,
+ depth)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range");
+ return error::kNoError;
+ }
+
GLenum type = 0;
GLenum internal_format = 0;
if (!texture->GetLevelType(target, level, &type, &internal_format)) {
@@ -15619,7 +15631,8 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
GL_INVALID_OPERATION, func_name, "texture is immutable");
return;
}
- if (!texture_manager()->ValidForTarget(target, level, width, height, 1) ||
+ if (!texture_manager()->ValidForTextureTarget(texture, level, width, height,
+ 1) ||
border != 0) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, func_name, "dimensions out of range");
@@ -18216,8 +18229,8 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
}
// Check that this type of texture is allowed.
- if (!texture_manager()->ValidForTarget(source_target, source_level,
- source_width, source_height, 1)) {
+ if (!texture_manager()->ValidForTextureTarget(
+ source_texture, source_level, source_width, source_height, 1)) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName, "Bad dimensions");
return;
}
@@ -18384,8 +18397,8 @@ void GLES2DecoderImpl::CopySubTextureHelper(const char* function_name,
}
// Check that this type of texture is allowed.
- if (!texture_manager()->ValidForTarget(source_target, source_level,
- source_width, source_height, 1)) {
+ if (!texture_manager()->ValidForTextureTarget(
+ source_texture, source_level, source_width, source_height, 1)) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name,
"source texture bad dimensions");
return;
@@ -18625,11 +18638,20 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target,
return;
}
}
+ TextureRef* texture_ref =
+ texture_manager()->GetTextureInfoForTarget(&state_, target);
+ if (!texture_ref) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
+ "unknown texture for target");
+ return;
+ }
+ Texture* texture = texture_ref->texture();
// The glTexStorage entry points require width, height, and depth to be
// at least 1, but the other texture entry points (those which use
- // ValidForTarget) do not. So we have to add an extra check here.
+ // ValidForTextureTarget) do not. So we have to add an extra check here.
bool is_invalid_texstorage_size = width < 1 || height < 1 || depth < 1;
- if (!texture_manager()->ValidForTarget(target, 0, width, height, depth) ||
+ if (!texture_manager()->ValidForTextureTarget(texture, 0, width, height,
+ depth) ||
is_invalid_texstorage_size) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, function_name, "dimensions out of range");
@@ -18642,14 +18664,6 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target,
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, "too many levels");
return;
}
- TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
- &state_, target);
- if (!texture_ref) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION, function_name, "unknown texture for target");
- return;
- }
- Texture* texture = texture_ref->texture();
if (texture->IsAttachedToFramebuffer()) {
framebuffer_state_.clear_state_dirty = true;
}
@@ -1642,7 +1642,7 @@ void Texture::Update() {
return;
if (face_infos_.empty() ||
- static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size()) {
+ static_cast<size_t>(base_level_) >= MaxValidMipLevel()) {
texture_complete_ = false;
cube_complete_ = false;
return;
@@ -2029,8 +2029,7 @@ bool Texture::CanRenderTo(const FeatureInfo* feature_info, GLint level) const {
// the time.
if (face_infos_.size() == 6 && !cube_complete())
return false;
- DCHECK(level >= 0 &&
- level < static_cast<GLint>(face_infos_[0].level_infos.size()));
+ DCHECK(level >= 0 && level < static_cast<GLint>(MaxValidMipLevel()));
if (level > base_level_ && !texture_complete()) {
return false;
}
@@ -2065,7 +2064,7 @@ void Texture::SetCompatibilitySwizzle(const CompatibilitySwizzle* swizzle) {
void Texture::ApplyFormatWorkarounds(const FeatureInfo* feature_info) {
if (feature_info->gl_version_info().NeedsLuminanceAlphaEmulation()) {
- if (static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size())
+ if (static_cast<size_t>(base_level_) >= MaxValidMipLevel())
return;
const Texture::LevelInfo& info = face_infos_[0].level_infos[base_level_];
SetCompatibilitySwizzle(GetCompatibilitySwizzleInternal(info.format));
@@ -2299,8 +2298,11 @@ scoped_refptr<TextureRef>
return default_texture;
}
-bool TextureManager::ValidForTarget(
- GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth) {
+bool TextureManager::ValidForTarget(GLenum target,
+ GLint level,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth) {
if (level < 0 || level >= MaxLevelsForTarget(target))
return false;
GLsizei max_size = MaxSizeForTarget(target) >> level;
@@ -2320,6 +2322,18 @@ bool TextureManager::ValidForTarget(
(target != GL_TEXTURE_2D || (depth == 1));
}
+bool TextureManager::ValidForTextureTarget(const Texture* texture,
+ GLint level,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth) {
+ if (texture->target() == 0)
+ return false;
+ if (level < 0 || static_cast<size_t>(level) >= texture->MaxValidMipLevel())
+ return false;
+ return ValidForTarget(texture->target(), level, width, height, depth);
+}
+
void TextureManager::SetTarget(TextureRef* ref, GLenum target) {
DCHECK(ref);
ref->texture()->SetTarget(target, MaxLevelsForTarget(target));
@@ -2803,14 +2817,6 @@ bool TextureManager::ValidateTexImage(ContextState* state,
args.internal_format, args.level)) {
return false;
}
- if (!ValidForTarget(args.target, args.level,
- args.width, args.height, args.depth) ||
- args.border != 0) {
- ERRORSTATE_SET_GL_ERROR(
- error_state, GL_INVALID_VALUE, function_name,
- "dimensions out of range");
- return false;
- }
if ((GLES2Util::GetChannelsForFormat(args.format) &
(GLES2Util::kDepth | GLES2Util::kStencil)) != 0 && args.pixels
&& !feature_info_->IsWebGL2OrES3Context()) {
@@ -2833,7 +2839,13 @@ bool TextureManager::ValidateTexImage(ContextState* state,
"texture is immutable");
return false;
}
-
+ if (!ValidForTextureTarget(local_texture_ref->texture(), args.level,
+ args.width, args.height, args.depth) ||
+ args.border != 0) {
+ ERRORSTATE_SET_GL_ERROR(error_state, GL_INVALID_VALUE, function_name,
+ "dimensions out of range");
+ return false;
+ }
Buffer* buffer = state->bound_pixel_unpack_buffer.get();
if (buffer) {
if (buffer->GetMappedRange()) {
@@ -469,6 +469,11 @@ class GPU_GLES2_EXPORT Texture final : public TextureBase {
sampler_state_.min_filter != GL_LINEAR;
}
+ size_t MaxValidMipLevel() const {
+ DCHECK(!face_infos_.empty());
+ return face_infos_[0].level_infos.size();
+ }
+
private:
friend class MailboxManagerTest;
friend class TextureManager;
@@ -931,6 +936,11 @@ class GPU_GLES2_EXPORT TextureManager
bool ValidForTarget(
GLenum target, GLint level,
GLsizei width, GLsizei height, GLsizei depth);
+ bool ValidForTextureTarget(const Texture* texture,
+ GLint level,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth);
// True if this texture meets all the GLES2 criteria for rendering.
// See section 3.8.2 of the GLES2 spec.
@@ -16,13 +16,15 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/check_op.h"
+#include "base/containers/circular_deque.h"
#include "base/containers/contains.h"
-#include "base/containers/queue.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
+#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/lock.h"
+#include "base/synchronization/waitable_event.h"
#include "base/task/common/task_annotator.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
@@ -48,6 +50,7 @@
#include "mojo/public/cpp/bindings/pipe_control_message_proxy.h"
#include "mojo/public/cpp/bindings/sequence_local_sync_event_watcher.h"
#include "mojo/public/cpp/bindings/tracing_helpers.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
namespace IPC {
@@ -466,6 +469,11 @@ class ChannelAssociatedGroupController
return *this;
}
+ bool HasRequestId(uint64_t request_id) {
+ return !value_.IsNull() && value_.version() >= 1 &&
+ value_.header_v1()->request_id == request_id;
+ }
+
mojo::Message& value() { return value_; }
private:
@@ -557,10 +565,15 @@ class ChannelAssociatedGroupController
sync_watcher_.reset();
}
- uint32_t EnqueueSyncMessage(MessageWrapper message) {
+ absl::optional<uint32_t> EnqueueSyncMessage(MessageWrapper message) {
controller_->lock_.AssertAcquired();
+ if (exclusive_wait_ && exclusive_wait_->TryFulfillingWith(message)) {
+ exclusive_wait_ = nullptr;
+ return absl::nullopt;
+ }
+
uint32_t id = GenerateSyncMessageId();
- sync_messages_.emplace(id, std::move(message));
+ sync_messages_.emplace_back(id, std::move(message));
SignalSyncMessageEvent();
return id;
}
@@ -577,7 +590,7 @@ class ChannelAssociatedGroupController
if (sync_messages_.empty() || sync_messages_.front().first != id)
return MessageWrapper();
MessageWrapper message = std::move(sync_messages_.front().second);
- sync_messages_.pop();
+ sync_messages_.pop_front();
return message;
}
@@ -607,10 +620,38 @@ class ChannelAssociatedGroupController
return sync_watcher_->SyncWatch(&should_stop);
}
+ MessageWrapper WaitForIncomingSyncReply(uint64_t request_id) {
+ absl::optional<ExclusiveSyncWait> wait;
+ {
+ base::AutoLock lock(controller_->lock_);
+ for (auto& [id, message] : sync_messages_) {
+ if (message.HasRequestId(request_id)) {
+ return std::move(message);
+ }
+ }
+
+ DCHECK(!exclusive_wait_);
+ wait.emplace(request_id);
+ exclusive_wait_ = &wait.value();
+ }
+
+ wait->event.Wait();
+ return std::move(wait->message);
+ }
+
bool SyncWatchExclusive(uint64_t request_id) override {
- // We don't support exclusive waits on Channel-associated interfaces.
- NOTREACHED();
- return false;
+ MessageWrapper message = WaitForIncomingSyncReply(request_id);
+ if (message.value().IsNull() || !client_) {
+ return false;
+ }
+
+ if (!client_->HandleIncomingMessage(&message.value())) {
+ base::AutoLock locker(controller_->lock_);
+ controller_->RaiseError();
+ return false;
+ }
+
+ return true;
}
void RegisterExternalSyncWaiter(uint64_t request_id) override {}
@@ -624,20 +665,26 @@ class ChannelAssociatedGroupController
DCHECK(closed_);
DCHECK(peer_closed_);
DCHECK(!sync_watcher_);
+ if (exclusive_wait_) {
+ exclusive_wait_->event.Signal();
+ }
}
void OnSyncMessageEventReady() {
DCHECK(task_runner_->RunsTasksInCurrentSequence());
- scoped_refptr<Endpoint> keepalive(this);
+ // SUBTLE: The order of these scoped_refptrs matters.
+ // `controller_keepalive` MUST outlive `keepalive` because the Endpoint
+ // holds raw pointer to the AssociatedGroupController.
scoped_refptr<AssociatedGroupController> controller_keepalive(
controller_.get());
+ scoped_refptr<Endpoint> keepalive(this);
base::AutoLock locker(controller_->lock_);
bool more_to_process = false;
if (!sync_messages_.empty()) {
MessageWrapper message_wrapper =
std::move(sync_messages_.front().second);
- sync_messages_.pop();
+ sync_messages_.pop_front();
bool dispatch_succeeded;
mojo::InterfaceEndpointClient* client = client_;
@@ -685,6 +732,28 @@ class ChannelAssociatedGroupController
return id;
}
+ // Tracks the state of a pending sync wait which excludes all other incoming
+ // IPC on the waiting thread.
+ struct ExclusiveSyncWait {
+ explicit ExclusiveSyncWait(uint64_t request_id)
+ : request_id(request_id) {}
+ ~ExclusiveSyncWait() = default;
+
+ bool TryFulfillingWith(MessageWrapper& wrapper) {
+ if (!wrapper.HasRequestId(request_id)) {
+ return false;
+ }
+
+ message = std::move(wrapper);
+ event.Signal();
+ return true;
+ }
+
+ uint64_t request_id;
+ base::WaitableEvent event;
+ MessageWrapper message;
+ };
+
const raw_ptr<ChannelAssociatedGroupController> controller_;
const mojo::InterfaceId id_;
@@ -696,7 +765,8 @@ class ChannelAssociatedGroupController
raw_ptr<mojo::InterfaceEndpointClient> client_ = nullptr;
scoped_refptr<base::SequencedTaskRunner> task_runner_;
std::unique_ptr<mojo::SequenceLocalSyncEventWatcher> sync_watcher_;
- base::queue<std::pair<uint32_t, MessageWrapper>> sync_messages_;
+ base::circular_deque<std::pair<uint32_t, MessageWrapper>> sync_messages_;
+ ExclusiveSyncWait* exclusive_wait_ = nullptr;
uint32_t next_sync_message_id_ = 0;
};
@@ -929,12 +999,15 @@ class ChannelAssociatedGroupController
// sync message queue. If the endpoint was blocking, it will dequeue the
// message and dispatch it. Otherwise the posted |AcceptSyncMessage()|
// call will dequeue the message and dispatch it.
- uint32_t message_id =
+ absl::optional<uint32_t> message_id =
endpoint->EnqueueSyncMessage(std::move(message_wrapper));
- task_runner->PostTask(
- FROM_HERE,
- base::BindOnce(&ChannelAssociatedGroupController::AcceptSyncMessage,
- this, id, message_id));
+ if (message_id) {
+ task_runner->PostTask(
+ FROM_HERE,
+ base::BindOnce(
+ &ChannelAssociatedGroupController::AcceptSyncMessage, this,
+ id, *message_id));
+ }
return true;
}
@@ -54,6 +54,10 @@ buildflag_header("media_buildflags") {
"USE_PROPRIETARY_CODECS=$proprietary_codecs",
"ENABLE_PLATFORM_DTS_AUDIO=$enable_platform_dts_audio",
]
+
+ if (is_ohos) {
+ flags += [ "OHOS_ENABLE_MEDIA_ROUTER=$ohos_enable_media_router" ]
+ }
}
if (proprietary_codecs && media_use_ffmpeg) {
@@ -11,15 +11,12 @@
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
+#include "base/command_line.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "media/base/media_export.h"
#include "media/media_buildflags.h"
-namespace base {
-class CommandLine;
-}
-
namespace switches {
MEDIA_EXPORT extern const char kAudioBufferSize[];
@@ -253,7 +253,7 @@ declare_args() {
# This switch defines whether the Media Remoting implementation will be built.
# When enabled, media is allowed to be renderer and played back on remote
# devices when the tab is being casted and other conditions are met.
- enable_media_remoting = !is_chromecast && !is_ios
+ enable_media_remoting = !is_chromecast && !is_ios && !is_ohos
}
declare_args() {
@@ -299,6 +299,10 @@ if (is_fuchsia) {
}
if (is_ohos) {
+ declare_args() {
+ ohos_enable_media_router = false
+ }
+
media_subcomponent_deps += [
"//media/base/ohos",
]
@@ -187,6 +187,7 @@ component("bindings") {
"lib/sync_event_watcher.cc",
"lib/sync_handle_registry.cc",
"lib/sync_handle_watcher.cc",
+ "lib/sync_method_traits.h",
"lib/task_runner_helper.cc",
"lib/task_runner_helper.h",
"lib/thread_safe_forwarder_base.cc",
@@ -5,13 +5,17 @@
#ifndef MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_RECEIVER_H_
#define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_RECEIVER_H_
+#include <stdint.h>
+
#include <memory>
#include <utility>
#include "base/check.h"
+#include "base/containers/span.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/task/sequenced_task_runner.h"
+#include "mojo/public/cpp/bindings/lib/sync_method_traits.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h"
@@ -58,7 +62,7 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) AssociatedReceiverBase {
void BindImpl(ScopedInterfaceEndpointHandle handle,
MessageReceiverWithResponderStatus* receiver,
std::unique_ptr<MessageReceiver> payload_validator,
- bool expect_sync_requests,
+ base::span<const uint32_t> sync_method_ordinals,
scoped_refptr<base::SequencedTaskRunner> runner,
uint32_t interface_version,
const char* interface_name);
@@ -197,8 +201,8 @@ class AssociatedReceiver : public internal::AssociatedReceiverBase {
if (pending_receiver) {
BindImpl(pending_receiver.PassHandle(), &stub_,
base::WrapUnique(new typename Interface::RequestValidator_()),
- Interface::HasSyncMethods_, std::move(task_runner),
- Interface::Version_, Interface::Name_);
+ internal::SyncMethodTraits<Interface>::GetOrdinals(),
+ std::move(task_runner), Interface::Version_, Interface::Name_);
} else {
reset();
}
@@ -15,6 +15,7 @@
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/component_export.h"
+#include "base/containers/span.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
@@ -56,7 +57,7 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) InterfaceEndpointClient
InterfaceEndpointClient(ScopedInterfaceEndpointHandle handle,
MessageReceiverWithResponderStatus* receiver,
std::unique_ptr<MessageReceiver> payload_validator,
- bool expect_sync_requests,
+ base::span<const uint32_t> sync_method_ordinals,
scoped_refptr<base::SequencedTaskRunner> task_runner,
uint32_t interface_version,
const char* interface_name);
@@ -212,6 +213,10 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) InterfaceEndpointClient
// The router lock must be held when calling this.
void ForgetAsyncRequest(uint64_t request_id);
+ base::span<const uint32_t> sync_method_ordinals() const {
+ return sync_method_ordinals_;
+ }
+
private:
struct PendingAsyncResponse {
public:
@@ -273,7 +278,7 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) InterfaceEndpointClient
bool HandleValidatedMessage(Message* message);
- const bool expect_sync_requests_ = false;
+ const base::span<const uint32_t> sync_method_ordinals_;
// The callback to invoke when our peer endpoint sends us NotifyIdle and we
// have no outstanding unacked messages. If null, no callback has been set and
@@ -36,6 +36,10 @@ class InterfaceEndpointController {
// Watches the endpoint for a specific incoming sync reply. This method only
// returns true once the reply is received, or false if the endpoint is
// detached or destroyed beforehand.
+ //
+ // Unlike with SyncWatch(), no other IPCs (not even other sync IPCs) can be
+ // dispatched to the calling thread while SyncWatchExclusive() is waiting on
+ // the reply for `request_id`.
virtual bool SyncWatchExclusive(uint64_t request_id) = 0;
// Notifies the controller that a specific in-flight sync message identified
@@ -4,6 +4,11 @@
#include "mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h"
+#include <stdint.h>
+
+#include <utility>
+
+#include "base/containers/span.h"
#include "mojo/public/cpp/bindings/lib/task_runner_helper.h"
namespace mojo {
@@ -68,7 +73,8 @@ void AssociatedInterfacePtrStateBase::Bind(
// The version is only queried from the client so the value passed here
// will not be used.
endpoint_client_ = std::make_unique<InterfaceEndpointClient>(
- std::move(handle), nullptr, std::move(validator), false,
+ std::move(handle), nullptr, std::move(validator),
+ /*sync_method_ordinals=*/base::span<const uint32_t>(),
GetTaskRunnerToUseFromUserProvidedTaskRunner(std::move(runner)), 0u,
interface_name);
}
@@ -138,6 +138,10 @@ class AssociatedInterfacePtrState : public AssociatedInterfacePtrStateBase {
return info;
}
+ InterfaceEndpointClient* endpoint_client_for_test() {
+ return endpoint_client();
+ }
+
private:
std::unique_ptr<Proxy> proxy_;
};
@@ -62,7 +62,7 @@ void AssociatedReceiverBase::BindImpl(
ScopedInterfaceEndpointHandle handle,
MessageReceiverWithResponderStatus* receiver,
std::unique_ptr<MessageReceiver> payload_validator,
- bool expect_sync_requests,
+ base::span<const uint32_t> sync_method_ordinals,
scoped_refptr<base::SequencedTaskRunner> runner,
uint32_t interface_version,
const char* interface_name) {
@@ -70,7 +70,7 @@ void AssociatedReceiverBase::BindImpl(
endpoint_client_ = std::make_unique<InterfaceEndpointClient>(
std::move(handle), receiver, std::move(payload_validator),
- expect_sync_requests,
+ sync_method_ordinals,
internal::GetTaskRunnerToUseFromUserProvidedTaskRunner(std::move(runner)),
interface_version, interface_name);
}
@@ -107,7 +107,7 @@ void BindingStateBase::BindInternal(
const char* interface_name,
std::unique_ptr<MessageReceiver> request_validator,
bool passes_associated_kinds,
- bool has_sync_methods,
+ base::span<const uint32_t> sync_method_ordinals,
MessageReceiverWithResponderStatus* stub,
uint32_t interface_version) {
DCHECK(!is_bound()) << "Attempting to bind interface that is already bound: "
@@ -119,7 +119,7 @@ void BindingStateBase::BindInternal(
MultiplexRouter::Config config =
passes_associated_kinds
? MultiplexRouter::MULTI_INTERFACE
- : (has_sync_methods
+ : (!sync_method_ordinals.empty()
? MultiplexRouter::SINGLE_INTERFACE_WITH_SYNC_METHODS
: MultiplexRouter::SINGLE_INTERFACE);
router_ = MultiplexRouter::CreateAndStartReceiving(
@@ -129,7 +129,7 @@ void BindingStateBase::BindInternal(
endpoint_client_ = std::make_unique<InterfaceEndpointClient>(
router_->CreateLocalEndpointHandle(kPrimaryInterfaceId), stub,
- std::move(request_validator), has_sync_methods,
+ std::move(request_validator), sync_method_ordinals,
std::move(sequenced_runner), interface_version, interface_name);
endpoint_client_->SetIdleTrackingEnabledCallback(
base::BindOnce(&MultiplexRouter::SetConnectionGroup, router_));
@@ -5,6 +5,8 @@
#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_
#define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_
+#include <stdint.h>
+
#include <memory>
#include <string>
#include <utility>
@@ -13,6 +15,7 @@
#include "base/callback.h"
#include "base/check.h"
#include "base/component_export.h"
+#include "base/containers/span.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/task/sequenced_task_runner.h"
@@ -25,6 +28,7 @@
#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/public/cpp/bindings/lib/multiplex_router.h"
#include "mojo/public/cpp/bindings/lib/pending_receiver_state.h"
+#include "mojo/public/cpp/bindings/lib/sync_method_traits.h"
#include "mojo/public/cpp/bindings/message_header_validator.h"
#include "mojo/public/cpp/bindings/pending_flush.h"
#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
@@ -91,7 +95,7 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) BindingStateBase {
const char* interface_name,
std::unique_ptr<MessageReceiver> request_validator,
bool passes_associated_kinds,
- bool has_sync_methods,
+ base::span<const uint32_t> sync_method_ordinals,
MessageReceiverWithResponderStatus* stub,
uint32_t interface_version);
@@ -120,8 +124,8 @@ class BindingState : public BindingStateBase {
BindingStateBase::BindInternal(
std::move(receiver_state), runner, Interface::Name_,
std::make_unique<typename Interface::RequestValidator_>(),
- Interface::PassesAssociatedKinds_, Interface::HasSyncMethods_, &stub_,
- Interface::Version_);
+ Interface::PassesAssociatedKinds_,
+ SyncMethodTraits<Interface>::GetOrdinals(), &stub_, Interface::Version_);
}
InterfaceRequest<Interface> Unbind() {
@@ -385,7 +385,9 @@ void ThreadSafeInterfaceEndpointClientProxy::SendMessageWithResponder(
}
// If the Remote is bound on another sequence, post the call.
- const bool allow_interrupt = !message.has_flag(Message::kFlagNoInterrupt);
+ const bool allow_interrupt =
+ SyncCallRestrictions::AreSyncCallInterruptsEnabled() &&
+ !message.has_flag(Message::kFlagNoInterrupt);
auto response = base::MakeRefCounted<SyncResponseInfo>();
auto response_signaler = std::make_unique<SyncResponseSignaler>(response);
task_runner_->PostTask(
@@ -435,11 +437,11 @@ InterfaceEndpointClient::InterfaceEndpointClient(
ScopedInterfaceEndpointHandle handle,
MessageReceiverWithResponderStatus* receiver,
std::unique_ptr<MessageReceiver> payload_validator,
- bool expect_sync_requests,
+ base::span<const uint32_t> sync_method_ordinals,
scoped_refptr<base::SequencedTaskRunner> task_runner,
uint32_t interface_version,
const char* interface_name)
- : expect_sync_requests_(expect_sync_requests),
+ : sync_method_ordinals_(sync_method_ordinals),
handle_(std::move(handle)),
incoming_receiver_(receiver),
dispatcher_(&thunk_),
@@ -619,7 +621,9 @@ bool InterfaceEndpointClient::SendMessageWithResponder(
const uint32_t message_name = message->name();
const bool is_sync = message->has_flag(Message::kFlagIsSync);
- const bool exclusive_wait = message->has_flag(Message::kFlagNoInterrupt);
+ const bool exclusive_wait =
+ message->has_flag(Message::kFlagNoInterrupt) ||
+ !SyncCallRestrictions::AreSyncCallInterruptsEnabled();
if (!controller_->SendMessage(message))
return false;
@@ -839,7 +843,8 @@ void InterfaceEndpointClient::InitControllerIfNecessary() {
controller_ = handle_.group_controller()->AttachEndpointClient(handle_, this,
task_runner_);
- if (expect_sync_requests_ && task_runner_->RunsTasksInCurrentSequence())
+ if (!sync_method_ordinals_.empty() &&
+ task_runner_->RunsTasksInCurrentSequence())
controller_->AllowWokenUpBySyncWatchOnSameThread();
}
@@ -4,6 +4,11 @@
#include "mojo/public/cpp/bindings/lib/interface_ptr_state.h"
+#include <stdint.h>
+
+#include <utility>
+
+#include "base/containers/span.h"
#include "mojo/public/cpp/bindings/lib/task_runner_helper.h"
namespace mojo {
@@ -94,7 +99,9 @@ bool InterfacePtrStateBase::InitializeEndpointClient(
interface_name);
endpoint_client_ = std::make_unique<InterfaceEndpointClient>(
router_->CreateLocalEndpointHandle(kPrimaryInterfaceId), nullptr,
- std::move(payload_validator), false, std::move(runner_),
+ std::move(payload_validator),
+ /* sync_method_ordinals= */ base::span<const uint32_t>(),
+ std::move(runner_),
// The version is only queried from the client so the value passed here
// will not be used.
0u, interface_name);
@@ -29,6 +29,7 @@
#include "mojo/public/cpp/bindings/interface_ptr_info.h"
#include "mojo/public/cpp/bindings/lib/multiplex_router.h"
#include "mojo/public/cpp/bindings/lib/pending_remote_state.h"
+#include "mojo/public/cpp/bindings/lib/sync_method_traits.h"
#include "mojo/public/cpp/bindings/message_header_validator.h"
#include "mojo/public/cpp/bindings/pending_flush.h"
#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
@@ -242,6 +243,10 @@ class InterfacePtrState : public InterfacePtrStateBase {
endpoint_client()->RaiseError();
}
+ InterfaceEndpointClient* endpoint_client_for_test() {
+ return endpoint_client();
+ }
+
private:
void ConfigureProxyIfNecessary() {
// The proxy has been configured.
@@ -252,7 +257,8 @@ class InterfacePtrState : public InterfacePtrStateBase {
}
if (InitializeEndpointClient(
- Interface::PassesAssociatedKinds_, Interface::HasSyncMethods_,
+ Interface::PassesAssociatedKinds_,
+ !SyncMethodTraits<Interface>::GetOrdinals().empty(),
Interface::HasUninterruptableMethods_,
std::make_unique<typename Interface::ResponseValidator_>(),
Interface::Name_)) {
@@ -1067,6 +1067,12 @@ bool MultiplexRouter::ProcessIncomingMessage(
bool can_direct_call;
if (message->has_flag(Message::kFlagIsSync)) {
+ if (!message->has_flag(Message::kFlagIsResponse) &&
+ !base::Contains(endpoint->client()->sync_method_ordinals(),
+ message->name())) {
+ RaiseErrorInNonTestingMode();
+ return true;
+ }
can_direct_call = client_call_behavior != NO_DIRECT_CLIENT_CALLS &&
endpoint->task_runner()->RunsTasksInCurrentSequence();
} else {
@@ -4,8 +4,6 @@
#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
-#if ENABLE_SYNC_CALL_RESTRICTIONS
-
#include "base/debug/leak_annotations.h"
#include "base/logging.h"
#include "base/no_destructor.h"
@@ -18,6 +16,11 @@ namespace mojo {
namespace {
+// Sync call interrupts are enabled by default.
+bool g_enable_sync_call_interrupts = true;
+
+#if ENABLE_SYNC_CALL_RESTRICTIONS
+
class GlobalSyncCallSettings {
public:
GlobalSyncCallSettings() = default;
@@ -60,8 +63,12 @@ bool SyncCallRestrictionsEnforceable() {
return base::internal::SequenceLocalStorageMap::IsSetForCurrentThread();
}
+#endif // ENABLE_SYNC_CALL_RESTRICTIONS
+
} // namespace
+#if ENABLE_SYNC_CALL_RESTRICTIONS
+
// static
void SyncCallRestrictions::AssertSyncCallAllowed() {
if (GetGlobalSettings().sync_call_allowed_by_default() ||
@@ -101,6 +108,21 @@ void SyncCallRestrictions::DecreaseScopedAllowCount() {
--GetSequenceLocalScopedAllowCount();
}
-} // namespace mojo
-
#endif // ENABLE_SYNC_CALL_RESTRICTIONS
+
+// static
+void SyncCallRestrictions::DisableSyncCallInterrupts() {
+ g_enable_sync_call_interrupts = false;
+}
+
+// static
+void SyncCallRestrictions::EnableSyncCallInterruptsForTesting() {
+ g_enable_sync_call_interrupts = true;
+}
+
+// static
+bool SyncCallRestrictions::AreSyncCallInterruptsEnabled() {
+ return g_enable_sync_call_interrupts;
+}
+
+} // namespace mojo
new file mode 100644
@@ -0,0 +1,31 @@
+// Copyright 2022 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNC_METHOD_TRAITS_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNC_METHOD_TRAITS_H_
+
+#include <stdint.h>
+
+#include <type_traits>
+
+#include "base/containers/span.h"
+
+namespace mojo::internal {
+
+template <typename Interface, typename SFINAE = void>
+struct SyncMethodTraits {
+ static constexpr base::span<const uint32_t> GetOrdinals() { return {}; }
+};
+
+template <typename Interface>
+struct SyncMethodTraits<Interface,
+ std::void_t<decltype(Interface::kSyncMethodOrdinals)>> {
+ static constexpr base::span<const uint32_t> GetOrdinals() {
+ return Interface::kSyncMethodOrdinals;
+ }
+};
+
+} // namespace mojo::internal
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNC_METHOD_TRAITS_H_
@@ -87,6 +87,20 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions {
static void DisallowSyncCall() {}
#endif
+ // Globally disables sync call interrupts. This means that all sync calls in
+ // the current process will be strictly blocking until a reply is received,
+ // and no incoming sync calls can dispatch on the blocking thread in interim.
+ static void DisableSyncCallInterrupts();
+
+ // Used only in tests to re-enable sync call interrupts after disabling them.
+ static void EnableSyncCallInterruptsForTesting();
+
+ // Indicates whether sync call interrupts are enabled in the calling process.
+ // They're enabled by default, so any sync message that isn't marked [Sync]
+ // may have its blocking call interrupted to dispatch other incoming sync
+ // IPCs which target the blocking thread.
+ static bool AreSyncCallInterruptsEnabled();
+
private:
// DO NOT ADD ANY OTHER FRIEND STATEMENTS, talk to mojo/OWNERS first.
// BEGIN ALLOWED USAGE.
@@ -67,6 +67,7 @@ source_set("tests") {
":mojo_public_bindings_test_utils",
":test_extra_cpp_template_mojom",
":test_mojom",
+ ":test_mojom__generate_message_ids",
"//base/test:test_support",
"//mojo/core/test:test_support",
"//mojo/public/cpp/bindings",
@@ -205,12 +205,10 @@ TEST_F(MojoBindingsPerftest, MultiplexRouterPingPong) {
InterfaceEndpointClient client0(
router0->CreateLocalEndpointHandle(kPrimaryInterfaceId), &paddle0,
- nullptr, false, base::ThreadTaskRunnerHandle::Get(), 0u,
- kTestInterfaceName);
+ nullptr, {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
InterfaceEndpointClient client1(
router1->CreateLocalEndpointHandle(kPrimaryInterfaceId), &paddle1,
- nullptr, false, base::ThreadTaskRunnerHandle::Get(), 0u,
- kTestInterfaceName);
+ nullptr, {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
paddle0.set_sender(&client0);
paddle1.set_sender(&client1);
@@ -257,8 +255,7 @@ TEST_F(MojoBindingsPerftest, MultiplexRouterDispatchCost) {
CounterReceiver receiver;
InterfaceEndpointClient client(
router->CreateLocalEndpointHandle(kPrimaryInterfaceId), &receiver,
- nullptr, false, base::ThreadTaskRunnerHandle::Get(), 0u,
- kTestInterfaceName);
+ nullptr, {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
static const uint32_t kIterations[] = {1000, 3000000};
@@ -66,12 +66,12 @@ class MultiplexRouterTest : public testing::Test {
TEST_F(MultiplexRouterTest, BasicRequestResponse) {
InterfaceEndpointClient client0(
- std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(),
- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
+ std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(), {},
+ base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
ResponseGenerator generator;
InterfaceEndpointClient client1(
std::move(endpoint1_), &generator, std::make_unique<PassThroughFilter>(),
- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
Message request;
AllocRequestMessage(1, "hello", &request);
@@ -113,12 +113,12 @@ TEST_F(MultiplexRouterTest, BasicRequestResponse) {
TEST_F(MultiplexRouterTest, BasicRequestResponse_Synchronous) {
InterfaceEndpointClient client0(
- std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(),
- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
+ std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(), {},
+ base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
ResponseGenerator generator;
InterfaceEndpointClient client1(
std::move(endpoint1_), &generator, std::make_unique<PassThroughFilter>(),
- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
Message request;
AllocRequestMessage(1, "hello", &request);
@@ -161,13 +161,13 @@ TEST_F(MultiplexRouterTest, BasicRequestResponse_Synchronous) {
TEST_F(MultiplexRouterTest, LazyResponses) {
InterfaceEndpointClient client0(
std::move(endpoint0_), nullptr, base::WrapUnique(new PassThroughFilter()),
- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
base::RunLoop run_loop;
LazyResponseGenerator generator(run_loop.QuitClosure());
InterfaceEndpointClient client1(std::move(endpoint1_), &generator,
- base::WrapUnique(new PassThroughFilter()),
- false, base::ThreadTaskRunnerHandle::Get(),
- 0u, kTestInterfaceName);
+ base::WrapUnique(new PassThroughFilter()), {},
+ base::ThreadTaskRunnerHandle::Get(), 0u,
+ kTestInterfaceName);
Message request;
AllocRequestMessage(1, "hello", &request);
@@ -233,7 +233,7 @@ TEST_F(MultiplexRouterTest, MissingResponses) {
base::RunLoop run_loop0, run_loop1;
InterfaceEndpointClient client0(
std::move(endpoint0_), nullptr, base::WrapUnique(new PassThroughFilter()),
- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
bool error_handler_called0 = false;
client0.set_connection_error_handler(base::BindOnce(
&ForwardErrorHandler, &error_handler_called0, run_loop0.QuitClosure()));
@@ -241,9 +241,9 @@ TEST_F(MultiplexRouterTest, MissingResponses) {
base::RunLoop run_loop3;
LazyResponseGenerator generator(run_loop3.QuitClosure());
InterfaceEndpointClient client1(std::move(endpoint1_), &generator,
- base::WrapUnique(new PassThroughFilter()),
- false, base::ThreadTaskRunnerHandle::Get(),
- 0u, kTestInterfaceName);
+ base::WrapUnique(new PassThroughFilter()), {},
+ base::ThreadTaskRunnerHandle::Get(), 0u,
+ kTestInterfaceName);
bool error_handler_called1 = false;
client1.set_connection_error_handler(base::BindOnce(
&ForwardErrorHandler, &error_handler_called1, run_loop1.QuitClosure()));
@@ -290,11 +290,11 @@ TEST_F(MultiplexRouterTest, LateResponse) {
{
InterfaceEndpointClient client0(
std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(),
- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName);
InterfaceEndpointClient client1(std::move(endpoint1_), &generator,
- std::make_unique<PassThroughFilter>(),
- false, base::ThreadTaskRunnerHandle::Get(),
- 0u, kTestInterfaceName);
+ std::make_unique<PassThroughFilter>(), {},
+ base::ThreadTaskRunnerHandle::Get(), 0u,
+ kTestInterfaceName);
Message request;
AllocRequestMessage(1, "hello", &request);
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <tuple>
#include <utility>
#include "base/barrier_closure.h"
@@ -9,16 +10,22 @@
#include "base/check.h"
#include "base/run_loop.h"
#include "base/sequence_token.h"
+#include "base/task/sequenced_task_runner.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/threading/sequence_bound.h"
+#include "base/threading/sequenced_task_runner_handle.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
+#include "mojo/public/cpp/bindings/lib/message_fragment.h"
+#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
+#include "mojo/public/cpp/bindings/lib/serialization_util.h"
+#include "mojo/public/cpp/bindings/message.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h"
@@ -26,11 +33,18 @@
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "mojo/public/cpp/bindings/shared_associated_remote.h"
#include "mojo/public/cpp/bindings/shared_remote.h"
+#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
#include "mojo/public/cpp/bindings/tests/bindings_test_base.h"
+#include "mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom-shared-message-ids.h"
#include "mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom.h"
#include "mojo/public/interfaces/bindings/tests/test_sync_methods.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
+// This needs to be included last, since it forward declares a bunch of classes
+// but depends on those definitions to be included by headers that sort
+// lexicographically after.
+#include "mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom-params-data.h"
+
namespace mojo {
namespace test {
namespace sync_method_unittest {
@@ -1564,7 +1578,375 @@ TEST_P(SyncInterruptTest, SharedAssociatedRemoteNoInterrupt) {
EXPECT_EQ(0, same_pipe_ponger().num_sync_pongs());
}
+class SyncService : public mojom::SyncService {
+ public:
+ explicit SyncService(PendingReceiver<mojom::SyncService> receiver)
+ : receiver_(this, std::move(receiver)) {}
+
+ void SetCallHandler(base::OnceClosure call_handler) {
+ call_handler_ = std::move(call_handler);
+ }
+
+ // mojom::SyncService:
+ void SyncCall(SyncCallCallback callback) override {
+ std::move(callback).Run();
+ if (call_handler_) {
+ std::move(call_handler_).Run();
+ }
+ }
+
+ private:
+ Receiver<mojom::SyncService> receiver_;
+ base::OnceClosure call_handler_;
+};
+
+class DisableSyncInterruptTest : public BindingsTestBase {
+ public:
+ void SetUp() override {
+ mojo::SyncCallRestrictions::DisableSyncCallInterrupts();
+ }
+
+ void TearDown() override {
+ mojo::SyncCallRestrictions::EnableSyncCallInterruptsForTesting();
+ }
+};
+
+TEST_P(DisableSyncInterruptTest, NoInterruptWhenDisabled) {
+ PendingRemote<mojom::SyncService> interrupter;
+ SyncService service(interrupter.InitWithNewPipeAndPassReceiver());
+
+ base::RunLoop wait_for_main_thread_service_call;
+ bool main_thread_service_called = false;
+ service.SetCallHandler(base::BindLambdaForTesting([&] {
+ main_thread_service_called = true;
+ wait_for_main_thread_service_call.Quit();
+ }));
+
+ Remote<mojom::SyncService> caller;
+ base::Thread background_service_thread("SyncService");
+ background_service_thread.Start();
+ base::SequenceBound<SyncService> background_service{
+ background_service_thread.task_runner(),
+ caller.BindNewPipeAndPassReceiver()};
+
+ base::Thread interrupter_thread("Interrupter");
+ interrupter_thread.Start();
+ interrupter_thread.task_runner()->PostTask(
+ FROM_HERE, base::BindLambdaForTesting([&interrupter] {
+ // Issue a sync call to the SyncService on the main thread. This should
+ // never be dispatched until *after* the sync call *from* the main
+ // thread completes below.
+ Remote<mojom::SyncService>(std::move(interrupter))->SyncCall();
+ }));
+
+ // The key test expectation here is that `main_thread_service_called` cannot
+ // be set to true until after SyncCall() returns and we can pump the thread's
+ // message loop. If sync interrupts are not properly disabled, this
+ // expectation can fail flakily (and often.)
+ caller->SyncCall();
+ EXPECT_FALSE(main_thread_service_called);
+
+ // Now the incoming sync call can be dispatched.
+ wait_for_main_thread_service_call.Run();
+ EXPECT_TRUE(main_thread_service_called);
+
+ background_service.SynchronouslyResetForTest();
+ interrupter_thread.Stop();
+ background_service_thread.Stop();
+}
+
+TEST_P(DisableSyncInterruptTest, SharedRemoteNoInterruptWhenDisabled) {
+ PendingRemote<mojom::SyncService> interrupter;
+ SyncService service(interrupter.InitWithNewPipeAndPassReceiver());
+
+ base::RunLoop wait_for_main_thread_service_call;
+ bool main_thread_service_called = false;
+ service.SetCallHandler(base::BindLambdaForTesting([&] {
+ main_thread_service_called = true;
+ wait_for_main_thread_service_call.Quit();
+ }));
+
+ // Bind a SharedRemote to another background thread so that we exercise
+ // SharedRemote's own sync wait codepath when called into from the main
+ // thread.
+ base::Thread background_client_thread("Client");
+ background_client_thread.Start();
+
+ base::Thread background_service_thread("Service");
+ background_service_thread.Start();
+
+ SharedRemote<mojom::SyncService> caller;
+ base::SequenceBound<SyncService> background_service{
+ background_service_thread.task_runner(),
+ caller.BindNewPipeAndPassReceiver(
+ background_client_thread.task_runner())};
+
+ base::Thread interrupter_thread("Interrupter");
+ interrupter_thread.Start();
+ interrupter_thread.task_runner()->PostTask(
+ FROM_HERE, base::BindLambdaForTesting([&interrupter] {
+ // Issue a sync call to the SyncService on the main thread. This should
+ // never be dispatched until *after* the sync call *from* the main
+ // thread completes below.
+ Remote<mojom::SyncService>(std::move(interrupter))->SyncCall();
+ }));
+
+ // The key test expectation here is that `main_thread_service_called` cannot
+ // be set to true until after SyncCall() returns and we can pump the thread's
+ // message loop. If sync interrupts are not properly disabled, this
+ // expectation can fail flakily (and often.)
+ caller->SyncCall();
+ EXPECT_FALSE(main_thread_service_called);
+
+ // Now the incoming sync call can be dispatched.
+ wait_for_main_thread_service_call.Run();
+ EXPECT_TRUE(main_thread_service_called);
+
+ background_service.SynchronouslyResetForTest();
+
+ // We need to reset the SharedRemote before the client thread is stopped, to
+ // ensure the necessary teardown work is executed on that thread. Otherwise
+ // the underlying pipe and related state will leak, and ASan will complain.
+ caller.reset();
+
+ interrupter_thread.Stop();
+ background_service_thread.Stop();
+ background_client_thread.Stop();
+}
+
INSTANTIATE_MOJO_BINDINGS_TEST_SUITE_P(SyncInterruptTest);
+INSTANTIATE_MOJO_BINDINGS_TEST_SUITE_P(DisableSyncInterruptTest);
+
+class OneSyncImpl;
+
+class NoSyncImpl : public mojom::NoSync {
+ public:
+ explicit NoSyncImpl(PendingReceiver<mojom::NoSync> receiver)
+ : receiver_(this, std::move(receiver)) {}
+
+ explicit NoSyncImpl(
+ PendingAssociatedReceiver<mojom::NoSync> associated_receiver)
+ : associated_receiver_(this, std::move(associated_receiver)) {}
+
+ // mojom::NoSync implementation:
+ void Method(MethodCallback callback) override;
+ void BindNoSync(PendingAssociatedReceiver<mojom::NoSync> receiver) override;
+ void BindOneSync(PendingAssociatedReceiver<mojom::OneSync> receiver) override;
+
+ private:
+ Receiver<mojom::NoSync> receiver_{this};
+ AssociatedReceiver<mojom::NoSync> associated_receiver_{this};
+
+ std::unique_ptr<NoSyncImpl> associated_no_sync_;
+ std::unique_ptr<OneSyncImpl> associated_one_sync_;
+};
+
+class OneSyncImpl : public mojom::OneSync {
+ public:
+ explicit OneSyncImpl(PendingReceiver<mojom::OneSync> receiver)
+ : receiver_(this, std::move(receiver)) {}
+
+ explicit OneSyncImpl(
+ PendingAssociatedReceiver<mojom::OneSync> associated_receiver)
+ : associated_receiver_(this, std::move(associated_receiver)) {}
+
+ // mojom::OneSync implementation:
+ void Method(MethodCallback callback) override;
+ void SyncMethod(SyncMethodCallback callback) override;
+ void BindNoSync(PendingAssociatedReceiver<mojom::NoSync> receiver) override;
+ void BindOneSync(PendingAssociatedReceiver<mojom::OneSync> receiver) override;
+
+ private:
+ Receiver<mojom::OneSync> receiver_{this};
+ AssociatedReceiver<mojom::OneSync> associated_receiver_{this};
+
+ std::unique_ptr<NoSyncImpl> associated_no_sync_;
+ std::unique_ptr<OneSyncImpl> associated_one_sync_;
+};
+
+void NoSyncImpl::Method(MethodCallback callback) {
+ EXPECT_TRUE(false);
+ std::move(callback).Run();
+}
+
+void NoSyncImpl::BindNoSync(PendingAssociatedReceiver<mojom::NoSync> receiver) {
+ associated_no_sync_ = std::make_unique<NoSyncImpl>(std::move(receiver));
+}
+
+void NoSyncImpl::BindOneSync(
+ PendingAssociatedReceiver<mojom::OneSync> receiver) {
+ associated_one_sync_ = std::make_unique<OneSyncImpl>(std::move(receiver));
+}
+
+void OneSyncImpl::Method(MethodCallback callback) {
+ EXPECT_TRUE(false);
+ std::move(callback).Run();
+}
+
+void OneSyncImpl::SyncMethod(MethodCallback callback) {
+ std::move(callback).Run();
+}
+
+void OneSyncImpl::BindNoSync(
+ PendingAssociatedReceiver<mojom::NoSync> receiver) {
+ associated_no_sync_ = std::make_unique<NoSyncImpl>(std::move(receiver));
+}
+
+void OneSyncImpl::BindOneSync(
+ PendingAssociatedReceiver<mojom::OneSync> receiver) {
+ associated_one_sync_ = std::make_unique<OneSyncImpl>(std::move(receiver));
+}
+
+class NoResponseExpectedResponder : public MessageReceiver {
+ public:
+ explicit NoResponseExpectedResponder() = default;
+
+ // MessageReceiver implementation:
+ bool Accept(Message* message) override {
+ EXPECT_TRUE(false);
+ return true;
+ }
+};
+
+class SyncFlagValidationTest : public ::testing::TestWithParam<uint32_t> {
+ protected:
+ Message MakeNoSyncMethodMessage() {
+ const uint32_t flags =
+ // Always set the sync flag, as that's the primary point of the test.
+ Message::kFlagIsSync |
+ // InterfaceEndpointClient requires this flag if sending a message with
+ // a responder.
+ Message::kFlagExpectsResponse | GetParam();
+ Message message(mojom::internal::kNoSync_Method_Name, flags, 0, 0, nullptr);
+ ::mojo::internal::MessageFragment<
+ mojom::internal::NoSync_Method_Params_Data>
+ params(message);
+ params.Allocate();
+ return message;
+ }
+
+ Message MakeOneSyncMethodMessage() {
+ const uint32_t flags =
+ // Always set the sync flag, as that's the primary point of the test.
+ Message::kFlagIsSync |
+ // InterfaceEndpointClient requires this flag if sending a message with
+ // a responder.
+ Message::kFlagExpectsResponse | GetParam();
+ Message message(mojom::internal::kOneSync_Method_Name, flags, 0, 0,
+ nullptr);
+ ::mojo::internal::MessageFragment<
+ mojom::internal::NoSync_Method_Params_Data>
+ params(message);
+ params.Allocate();
+ return message;
+ }
+
+ void FlushPostedTasks() {
+ base::RunLoop run_loop;
+ base::SequencedTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ run_loop.QuitClosure());
+ run_loop.Run();
+ }
+
+ private:
+ base::test::SingleThreadTaskEnvironment task_environment;
+};
+
+TEST_P(SyncFlagValidationTest, NonSync) {
+ Remote<mojom::NoSync> remote;
+ NoSyncImpl impl(remote.BindNewPipeAndPassReceiver());
+
+ Message message = MakeNoSyncMethodMessage();
+ auto responder = std::make_unique<NoResponseExpectedResponder>();
+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test());
+ ::mojo::internal::SendMessage(
+ *remote.internal_state()->endpoint_client_for_test(), message,
+ std::move(responder));
+}
+
+TEST_P(SyncFlagValidationTest, OneSync) {
+ Remote<mojom::OneSync> remote;
+ OneSyncImpl impl(remote.BindNewPipeAndPassReceiver());
+
+ Message message = MakeOneSyncMethodMessage();
+ auto responder = std::make_unique<NoResponseExpectedResponder>();
+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test());
+ ::mojo::internal::SendMessage(
+ *remote.internal_state()->endpoint_client_for_test(), message,
+ std::move(responder));
+}
+
+TEST_P(SyncFlagValidationTest, NoSyncAssociatedWithNoSync) {
+ Remote<mojom::NoSync> remote;
+ NoSyncImpl impl(remote.BindNewPipeAndPassReceiver());
+
+ AssociatedRemote<mojom::NoSync> associated_remote;
+ remote->BindNoSync(associated_remote.BindNewEndpointAndPassReceiver());
+
+ FlushPostedTasks();
+
+ Message message = MakeNoSyncMethodMessage();
+ auto responder = std::make_unique<NoResponseExpectedResponder>();
+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test());
+ ::mojo::internal::SendMessage(
+ *associated_remote.internal_state()->endpoint_client_for_test(), message,
+ std::move(responder));
+}
+
+TEST_P(SyncFlagValidationTest, OneSyncAssociatedWithNoSync) {
+ Remote<mojom::NoSync> remote;
+ NoSyncImpl impl(remote.BindNewPipeAndPassReceiver());
+
+ AssociatedRemote<mojom::OneSync> associated_remote;
+ remote->BindOneSync(associated_remote.BindNewEndpointAndPassReceiver());
+
+ FlushPostedTasks();
+
+ Message message = MakeOneSyncMethodMessage();
+ auto responder = std::make_unique<NoResponseExpectedResponder>();
+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test());
+ ::mojo::internal::SendMessage(
+ *associated_remote.internal_state()->endpoint_client_for_test(), message,
+ std::move(responder));
+}
+
+TEST_P(SyncFlagValidationTest, NoSyncAssociatedWithOneSync) {
+ Remote<mojom::OneSync> remote;
+ OneSyncImpl impl(remote.BindNewPipeAndPassReceiver());
+
+ AssociatedRemote<mojom::NoSync> associated_remote;
+ remote->BindNoSync(associated_remote.BindNewEndpointAndPassReceiver());
+
+ FlushPostedTasks();
+
+ Message message = MakeNoSyncMethodMessage();
+ auto responder = std::make_unique<NoResponseExpectedResponder>();
+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test());
+ ::mojo::internal::SendMessage(
+ *associated_remote.internal_state()->endpoint_client_for_test(), message,
+ std::move(responder));
+}
+
+TEST_P(SyncFlagValidationTest, OneSyncAssociatedWithOneSync) {
+ Remote<mojom::OneSync> remote;
+ OneSyncImpl impl(remote.BindNewPipeAndPassReceiver());
+
+ AssociatedRemote<mojom::OneSync> associated_remote;
+ remote->BindOneSync(associated_remote.BindNewEndpointAndPassReceiver());
+
+ FlushPostedTasks();
+
+ Message message = MakeOneSyncMethodMessage();
+ auto responder = std::make_unique<NoResponseExpectedResponder>();
+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test());
+ ::mojo::internal::SendMessage(
+ *associated_remote.internal_state()->endpoint_client_for_test(), message,
+ std::move(responder));
+}
+
+INSTANTIATE_TEST_SUITE_P(,
+ SyncFlagValidationTest,
+ ::testing::Values(0, Message::kFlagIsResponse));
} // namespace
} // namespace sync_method_unittest
@@ -45,3 +45,24 @@ interface Ponger {
[Sync] Pong() => ();
PongAsync();
};
+
+interface SyncService {
+ [Sync] SyncCall() => ();
+};
+
+interface NoSync {
+ Method() => ();
+
+ BindNoSync(pending_associated_receiver<NoSync> no_sync);
+ BindOneSync(pending_associated_receiver<OneSync> one_sync);
+};
+
+interface OneSync {
+ Method() => ();
+
+ [Sync]
+ SyncMethod() => ();
+
+ BindNoSync(pending_associated_receiver<NoSync> no_sync);
+ BindOneSync(pending_associated_receiver<OneSync> one_sync);
+};
@@ -26,7 +26,12 @@ class {{export_attribute}} {{interface.name}}
{%- endif %}
static constexpr uint32_t Version_ = {{interface.version}};
static constexpr bool PassesAssociatedKinds_ = {% if interface|passes_associated_kinds %}true{% else %}false{% endif %};
- static constexpr bool HasSyncMethods_ = {% if interface|has_sync_methods %}true{% else %}false{% endif %};
+ {%- set sync_method_ordinals = interface|get_sync_method_ordinals -%}
+{%- if sync_method_ordinals %}
+ static inline constexpr uint32_t kSyncMethodOrdinals[] = {
+ {{sync_method_ordinals|sort|join(', \n')|indent(4)}}
+ };
+{%- endif %}
static constexpr bool HasUninterruptableMethods_ =
{%- if interface|has_uninterruptable_methods %} true
{%- else %} false{% endif %};
@@ -17,13 +17,15 @@
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
+namespace mojo::internal {
+class ValidationContext;
+}
+
{%- for namespace in namespaces_as_array %}
namespace {{namespace}} {
{%- endfor %}
namespace internal {
-class ValidationContext;
-
{#--- Interface parameter definitions #}
{%- for interface in interfaces %}
{%- for method in interface.methods %}
@@ -403,7 +403,7 @@ class Generator(generator.Generator):
"get_qualified_name_for_kind": self._GetQualifiedNameForKind,
"has_callbacks": mojom.HasCallbacks,
"has_packed_method_ordinals": HasPackedMethodOrdinals,
- "has_sync_methods": mojom.HasSyncMethods,
+ "get_sync_method_ordinals": mojom.GetSyncMethodOrdinals,
"has_uninterruptable_methods": mojom.HasUninterruptableMethods,
"method_supports_lazy_serialization":
self._MethodSupportsLazySerialization,
@@ -1703,11 +1703,8 @@ def MethodPassesInterfaces(method):
return _AnyMethodParameterRecursive(method, IsInterfaceKind)
-def HasSyncMethods(interface):
- for method in interface.methods:
- if method.sync:
- return True
- return False
+def GetSyncMethodOrdinals(interface):
+ return [method.ordinal for method in interface.methods if method.sync]
def HasUninterruptableMethods(interface):
@@ -20,9 +20,9 @@ jboolean JNI_HttpUtil_IsAllowedHeader(
std::string header_name(ConvertJavaStringToUTF8(env, j_header_name));
std::string header_value(ConvertJavaStringToUTF8(env, j_header_value));
- return HttpUtil::IsValidHeaderName(header_name)
- && HttpUtil::IsSafeHeader(header_name)
- && HttpUtil::IsValidHeaderValue(header_value);
+ return HttpUtil::IsValidHeaderName(header_name) &&
+ HttpUtil::IsSafeHeader(header_name, header_value) &&
+ HttpUtil::IsValidHeaderValue(header_value);
}
} // namespace net
@@ -266,5 +266,9 @@ const base::Feature kSwitchWebSocketThroughputWindow{
const base::FeatureParam<int> kRollingAverageWindow{
&kSwitchWebSocketThroughputWindow, "RollingAverageWindow", 100};
+const base::Feature kBlockNewForbiddenHeaders{
+ "BlockNewForbiddenHeaders",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
} // namespace features
} // namespace net
@@ -393,6 +393,9 @@ NET_EXPORT extern const base::FeatureParam<int> kSmallReadBufferSize;
NET_EXPORT extern const base::Feature kSwitchWebSocketThroughputWindow;
NET_EXPORT extern const base::FeatureParam<int> kRollingAverageWindow;
+// Whether to block newly added forbidden headers (https://crbug.com/1362331).
+NET_EXPORT extern const base::Feature kBlockNewForbiddenHeaders;
+
} // namespace features
} // namespace net
@@ -557,6 +557,10 @@ NET_ERROR(CERT_KNOWN_INTERCEPTION_BLOCKED, -217)
// -218 was SSL_OBSOLETE_VERSION which is not longer used. TLS 1.0/1.1 instead
// cause SSL_VERSION_OR_CIPHER_MISMATCH now.
+#if BUILDFLAG(IS_OHOS)
+// The connection uses an obsolete version of SSL/TLS or cipher.
+NET_ERROR(SSL_OBSOLETE_VERSION_OR_CIPHER, -218)
+#endif
// Add new certificate error codes here.
//
// Update the value of CERT_END whenever you add a new certificate error
@@ -50,6 +50,10 @@ CertStatus MapNetErrorToCertStatus(int error) {
return CERT_STATUS_SYMANTEC_LEGACY;
case ERR_CERT_KNOWN_INTERCEPTION_BLOCKED:
return (CERT_STATUS_KNOWN_INTERCEPTION_BLOCKED | CERT_STATUS_REVOKED);
+#if BUILDFLAG(IS_OHOS)
+ case ERR_SSL_OBSOLETE_VERSION_OR_CIPHER:
+ return CERT_STATUS_LEGACY_TLS;
+#endif
default:
return 0;
}
@@ -94,6 +98,10 @@ int MapCertStatusToNetError(CertStatus cert_status) {
return ERR_CERT_UNABLE_TO_CHECK_REVOCATION;
if (cert_status & CERT_STATUS_NO_REVOCATION_MECHANISM)
return ERR_CERT_NO_REVOCATION_MECHANISM;
+#if BUILDFLAG(IS_OHOS)
+ if (cert_status & CERT_STATUS_LEGACY_TLS)
+ return ERR_SSL_OBSOLETE_VERSION_OR_CIPHER;
+#endif
// Unknown status. The assumption is 0 (an OK status) won't be used here.
NOTREACHED();
@@ -15,6 +15,8 @@
// The possible status bits for CertStatus.
// Bits 0 to 15 are for errors.
+#include "build/build_config.h"
+
CERT_STATUS_FLAG(COMMON_NAME_INVALID, 1 << 0)
CERT_STATUS_FLAG(DATE_INVALID, 1 << 1)
CERT_STATUS_FLAG(AUTHORITY_INVALID, 1 << 2)
@@ -46,3 +48,7 @@ CERT_STATUS_FLAG(SYMANTEC_LEGACY, 1 << 25)
CERT_STATUS_FLAG(KNOWN_INTERCEPTION_BLOCKED, 1 << 26)
CERT_STATUS_FLAG(DEPTH_ZERO_SELF_SIGNED_CERT, 1 << 27)
// Bit 27 was CERT_STATUS_LEGACY_TLS.
+#if BUILDFLAG(IS_OHOS)
+//a legacy TLS version is allowed, but needs to be warned
+CERT_STATUS_FLAG(LEGACY_TLS, 1 << 28)
+#endif
\ No newline at end of file
@@ -246,12 +246,9 @@ void X509CertChainVerify(const std::vector<std::string>& cert_chain,
int* status,
bool* is_issued_by_known_root,
std::vector<std::string>* verified_chain) {
- *is_issued_by_known_root = true;
+ *is_issued_by_known_root = false;
*status = CertVerify(cert_chain);
- if (*status == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY) {
- *is_issued_by_known_root = false;
- }
verified_chain->assign(cert_chain.begin(), cert_chain.end());
}
@@ -311,6 +311,23 @@ const char* const kForbiddenHeaderFields[] = {
"via",
};
+// A header string containing any of the following fields with a forbidden
+// method name in the value will cause an error. The list comes from the fetch
+// standard.
+const char* const kForbiddenHeaderFieldsWithForbiddenMethod[] = {
+ "x-http-method",
+ "x-http-method-override",
+ "x-method-override",
+};
+
+// The forbidden method names that is defined in the fetch standard, and used
+// to check the kForbiddenHeaderFileWithForbiddenMethod above.
+const char* const kForbiddenMethods[] = {
+ "connect",
+ "trace",
+ "track",
+};
+
} // namespace
// static
@@ -325,7 +342,7 @@ bool HttpUtil::IsMethodIdempotent(base::StringPiece method) {
}
// static
-bool HttpUtil::IsSafeHeader(base::StringPiece name) {
+bool HttpUtil::IsSafeHeader(base::StringPiece name, base::StringPiece value) {
if (base::StartsWith(name, "proxy-", base::CompareCase::INSENSITIVE_ASCII) ||
base::StartsWith(name, "sec-", base::CompareCase::INSENSITIVE_ASCII))
return false;
@@ -334,6 +351,28 @@ bool HttpUtil::IsSafeHeader(base::StringPiece name) {
if (base::LowerCaseEqualsASCII(name, field))
return false;
}
+
+ if (base::FeatureList::IsEnabled(features::kBlockNewForbiddenHeaders)) {
+ bool is_forbidden_header_fields_with_forbidden_method = false;
+ for (const char* field : kForbiddenHeaderFieldsWithForbiddenMethod) {
+ if (base::EqualsCaseInsensitiveASCII(name, field)) {
+ is_forbidden_header_fields_with_forbidden_method = true;
+ break;
+ }
+ }
+ if (is_forbidden_header_fields_with_forbidden_method) {
+ std::string value_string(value);
+ ValuesIterator method_iterator(value_string.begin(), value_string.end(),
+ ',');
+ while (method_iterator.GetNext()) {
+ base::StringPiece method = method_iterator.value_piece();
+ for (const char* forbidden_method : kForbiddenMethods) {
+ if (base::EqualsCaseInsensitiveASCII(method, forbidden_method))
+ return false;
+ }
+ }
+ }
+ }
return true;
}
@@ -94,11 +94,11 @@ class NET_EXPORT HttpUtil {
// RFC 7231).
static bool IsMethodIdempotent(base::StringPiece method);
- // Returns true if it is safe to allow users and scripts to specify the header
- // named |name|. Returns true for headers not in the list at
- // https://fetch.spec.whatwg.org/#forbidden-header-name. Does not check header
- // validity.
- static bool IsSafeHeader(base::StringPiece name);
+ // Returns true if it is safe to allow users and scripts to specify a header
+ // with a given |name| and |value|.
+ // See https://fetch.spec.whatwg.org/#forbidden-request-header.
+ // Does not check header validity.
+ static bool IsSafeHeader(base::StringPiece name, base::StringPiece value);
// Returns true if |name| is a valid HTTP header name.
static bool IsValidHeaderName(base::StringPiece name);
@@ -45,9 +45,9 @@ TEST(HttpUtilTest, IsSafeHeader) {
"via",
};
for (size_t i = 0; i < base::size(unsafe_headers); ++i) {
- EXPECT_FALSE(HttpUtil::IsSafeHeader(unsafe_headers[i]))
+ EXPECT_FALSE(HttpUtil::IsSafeHeader(unsafe_headers[i], ""))
<< unsafe_headers[i];
- EXPECT_FALSE(HttpUtil::IsSafeHeader(base::ToUpperASCII(unsafe_headers[i])))
+ EXPECT_FALSE(HttpUtil::IsSafeHeader(base::ToUpperASCII(unsafe_headers[i]), ""))
<< unsafe_headers[i];
}
static const char* const safe_headers[] = {
@@ -90,12 +90,45 @@ TEST(HttpUtilTest, IsSafeHeader) {
"user-agenta",
"user_agent",
"viaa",
+ // Following 3 headers are safe if there is no forbidden method in values.
+ "x-http-method",
+ "x-http-method-override",
+ "x-method-override",
};
for (size_t i = 0; i < base::size(safe_headers); ++i) {
- EXPECT_TRUE(HttpUtil::IsSafeHeader(safe_headers[i])) << safe_headers[i];
- EXPECT_TRUE(HttpUtil::IsSafeHeader(base::ToUpperASCII(safe_headers[i])))
+ EXPECT_TRUE(HttpUtil::IsSafeHeader(safe_headers[i], "")) << safe_headers[i];
+ EXPECT_TRUE(HttpUtil::IsSafeHeader(base::ToUpperASCII(safe_headers[i]), ""))
<< safe_headers[i];
}
+
+ static const char* const disallowed_with_forbidden_methods_headers[] = {
+ "x-http-method",
+ "x-http-method-override",
+ "x-method-override",
+ };
+ static const struct {
+ const char* value;
+ bool is_safe;
+ } disallowed_values[] = {{"connect", false},
+ {"trace", false},
+ {"track", false},
+ {"CONNECT", false},
+ {"cOnnEcT", false},
+ {"get", true},
+ {"get,post", true},
+ {"get,connect", false},
+ {"get, connect", false},
+ {"get,connect ", false},
+ {"get,connect ,post", false},
+ {"get,,,,connect", false},
+ {"trace,get,PUT", false}};
+ for (const auto* header : disallowed_with_forbidden_methods_headers) {
+ for (const auto& test_case : disallowed_values) {
+ EXPECT_EQ(test_case.is_safe,
+ HttpUtil::IsSafeHeader(header, test_case.value))
+ << header << ": " << test_case.value;
+ }
+ }
}
TEST(HttpUtilTest, HeadersIterator) {
@@ -84,6 +84,10 @@ const int kCertVerifyPending = 1;
// Default size of the internal BoringSSL buffers.
const int kDefaultOpenSSLBufferSize = 17 * 1024;
+#if BUILDFLAG(IS_OHOS)
+constexpr uint16_t kDefaultSSLVersionMinWarn = SSL_PROTOCOL_VERSION_TLS1_2;
+constexpr uint16_t k3DESCipher = 0x000a;
+#endif
base::Value NetLogPrivateKeyOperationParams(uint16_t algorithm,
SSLPrivateKey* key) {
base::Value value(base::Value::Type::DICTIONARY);
@@ -850,6 +854,32 @@ int SSLClientSocketImpl::Init() {
SSL_set_mode(ssl_.get(), mode.set_mask);
SSL_clear_mode(ssl_.get(), mode.clear_mask);
+#if BUILDFLAG(IS_OHOS)
+ // Use BoringSSL defaults, but disable HMAC-SHA1 ciphers in ECDSA.
+ // These are the remaining CBC-mode ECDSA ciphers.
+ std::string command("ALL:!aPSK:!ECDSA+SHA1");
+
+ if (ssl_config_.require_ecdhe)
+ command.append(":!kRSA");
+
+ if (ssl_config_.disable_legacy_crypto) {
+ command.append(":!3DES");
+ }
+
+ // Remove any disabled ciphers.
+ for (uint16_t id : context_->config().disabled_cipher_suites) {
+ const SSL_CIPHER* cipher = SSL_get_cipher_by_value(id);
+ if (cipher) {
+ command.append(":!");
+ command.append(SSL_CIPHER_get_name(cipher));
+ }
+ }
+
+ if (!SSL_set_strict_cipher_list(ssl_.get(), command.c_str())) {
+ LOG(ERROR) << "SSL_set_cipher_list('" << command << "') failed";
+ return ERR_UNEXPECTED;
+ }
+#else
// Use BoringSSL defaults, but disable 3DES and HMAC-SHA1 ciphers in ECDSA.
// These are the remaining CBC-mode ECDSA ciphers.
std::string command("ALL:!aPSK:!ECDSA+SHA1:!3DES");
@@ -870,6 +900,7 @@ int SSLClientSocketImpl::Init() {
LOG(ERROR) << "SSL_set_cipher_list('" << command << "') failed";
return ERR_UNEXPECTED;
}
+#endif
if (ssl_config_.disable_legacy_crypto) {
static const uint16_t kVerifyPrefs[] = {
@@ -1298,9 +1329,30 @@ ssl_verify_result_t SSLClientSocketImpl::HandleVerifyResult() {
result = ct_result;
}
+#if BUILDFLAG(IS_OHOS)
+ // If no other errors occurred, check whether the connection used a legacy
+ SSLInfo ssl_info;
+ bool has_ssl_info = GetSSLInfo(&ssl_info);
+ DCHECK(has_ssl_info);
+ uint16_t cipher_suite =
+ SSLConnectionStatusToCipherSuite(ssl_info.connection_status);
+ if (result == OK &&
+ (SSL_version(ssl_.get()) < kDefaultSSLVersionMinWarn ||
+ cipher_suite == k3DESCipher)) {
+ server_cert_verify_result_.cert_status |= CERT_STATUS_LEGACY_TLS;
+
+ // Only set the resulting net error if it hasn't been previously bypassed.
+ if (!IsAllowedBadCert(server_cert_.get(), nullptr))
+ result = ERR_SSL_OBSOLETE_VERSION_OR_CIPHER;
+ }
+#endif
+
is_fatal_cert_error_ =
IsCertStatusError(server_cert_verify_result_.cert_status) &&
result != ERR_CERT_KNOWN_INTERCEPTION_BLOCKED &&
+#if BUILDFLAG(IS_OHOS)
+ result != ERR_SSL_OBSOLETE_VERSION_OR_CIPHER &&
+#endif
context_->transport_security_state()->ShouldSSLErrorsBeFatal(
host_and_port_.host());
@@ -3368,7 +3368,11 @@ TEST_F(SSLClientSocketTest, 3DES) {
// 3DES is always disabled.
int rv;
ASSERT_TRUE(CreateAndConnectSSLClientSocket(SSLConfig(), &rv));
- EXPECT_THAT(rv, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH));
+#if BUILDFLAG(IS_OHOS)
+ EXPECT_THAT(rv, IsError(ERR_SSL_OBSOLETE_VERSION_OR_CIPHER));
+#else
+ EXPECT_THAT(rv, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH));
+#endif
}
TEST_F(SSLClientSocketTest, SHA1) {
@@ -5491,7 +5495,16 @@ TEST_P(SSLHandshakeDetailsTest, Metrics) {
base::HistogramTester histograms;
int rv;
ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv));
+#if BUILDFLAG(IS_OHOS)
+ if (version < SSL_CONNECTION_VERSION_TLS1_2) {
+ EXPECT_THAT(rv, IsError(ERR_SSL_OBSOLETE_VERSION_OR_CIPHER));
+ return;
+ } else {
+ EXPECT_THAT(rv, IsOk());
+ }
+#else
EXPECT_THAT(rv, IsOk());
+#endif
// Sanity-check the socket matches the test parameters.
SSLInfo info;
@@ -42,6 +42,9 @@ namespace {
// Timeout for the SSL handshake portion of the connect.
constexpr base::TimeDelta kSSLHandshakeTimeout(base::Seconds(30));
+#if BUILDFLAG(IS_OHOS)
+constexpr uint16_t k3DESCipher = 0x000a;
+#endif
} // namespace
SSLSocketParams::SSLSocketParams(
@@ -469,7 +472,16 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
}
}
}
- if (ssl_info.peer_signature_algorithm == SSL_SIGN_RSA_PKCS1_SHA1) {
+#if BUILDFLAG(IS_OHOS)
+ if (cipher_suite == k3DESCipher /* TLS_RSA_WITH_3DES_EDE_CBC_SHA */) {
+ // TLS_RSA_WITH_3DES_EDE_CBC_SHA does not involve a peer signature.
+ DCHECK_EQ(0, ssl_info.peer_signature_algorithm);
+ fallback = sent_sha1_cert
+ ? SSLLegacyCryptoFallback::kSentSHA1CertAndUsed3DES
+ : SSLLegacyCryptoFallback::kUsed3DES;
+ } else
+#endif
+ if (ssl_info.peer_signature_algorithm == SSL_SIGN_RSA_PKCS1_SHA1) {
fallback = sent_sha1_cert
? SSLLegacyCryptoFallback::kSentSHA1CertAndUsedSHA1
: SSLLegacyCryptoFallback::kUsedSHA1;
@@ -16,6 +16,28 @@ namespace net {
// These values are logged to UMA. Entries should not be renumbered and
// numeric values should never be reused. Please keep in sync with
// "SSLLegacyCryptoFallback" in src/tools/metrics/histograms/enums.xml.
+#if BUILDFLAG(IS_OHOS)
+enum class SSLLegacyCryptoFallback {
+ // The connection did not use the fallback.
+ kNoFallback = 0,
+ // The connection used the fallback and negotiated 3DES.
+ kUsed3DES = 1,
+ // The connection used the fallback and negotiated SHA-1.
+ kUsedSHA1 = 2,
+ // The connection used the fallback and sent a SHA-1 certificate.
+ kSentSHA1Cert = 3,
+ // The connection used the fallback, negotiated 3DES, and sent a SHA-1
+ // certificate.
+ kSentSHA1CertAndUsed3DES = 4,
+ // The connection used the fallback, negotiated SHA-1, and sent a SHA-1
+ // certificate.
+ kSentSHA1CertAndUsedSHA1 = 5,
+ // The connection used the fallback for an unknown reason, likely a
+ // transient network error.
+ kUnknownReason = 6,
+ kMaxValue = kUnknownReason,
+};
+#else
enum class SSLLegacyCryptoFallback {
// The connection did not use the fallback.
kNoFallback = 0,
@@ -35,6 +57,7 @@ enum class SSLLegacyCryptoFallback {
kUnknownReason = 6,
kMaxValue = kUnknownReason,
};
+#endif
} // namespace net
@@ -56,7 +56,6 @@ config("cef_nweb_config") {
if (product_name == "rk3568") {
defines += [
- "DEFAULT_PORTRAIT",
"RK3568",
]
}
@@ -123,6 +122,8 @@ component("cef_nweb") {
"src/cef_delegate/nweb_render_handler.h",
"src/cef_delegate/nweb_resource_handler.cc",
"src/cef_delegate/nweb_resource_handler.h",
+ "src/cef_delegate/nweb_select_popup_menu_callback.cc",
+ "src/cef_delegate/nweb_select_popup_menu_callback.h",
"src/cef_delegate/nweb_touch_handle_state_impl.cc",
"src/cef_delegate/nweb_touch_handle_state_impl.h",
"src/cef_delegate/nweb_web_storage_delegate.cc",
@@ -133,9 +134,7 @@ component("cef_nweb") {
deps = [
"//base:base",
- "//cef:libcef_dll_wrapper",
- "//cef:libweb_engine",
- "//content/public/common:static_switches",
+ "//content/public/common",
"//ui/events/keycodes:x11",
"//url",
]
@@ -227,19 +226,6 @@ component("nweb_sources") {
libs = [ "surface.z" ]
}
-shared_library("libnweb_adapter") {
- configs += [ "//build/config/sanitizers:cfi_config" ]
- deps = [ ":nweb_sources" ]
-
- if (defined(ohos_nweb_ex) && ohos_nweb_ex) {
- deps += [ "//ohos_nweb_ex:nweb_ex" ]
- }
-}
-
-static_library("libohosnweb_static") {
- deps = [ ":nweb_sources" ]
-}
-
#################################################
config("ohosnweb_core_config") {
@@ -27,8 +27,10 @@
#include "nweb_history_list.h"
#include "nweb_javascript_result_callback.h"
#include "nweb_preference.h"
+#include "nweb_release_surface_callback.h"
#include "nweb_value_callback.h"
#include "nweb_hit_testresult.h"
+#include "nweb_web_message.h"
namespace OHOS::NWeb {
class NWebHandler;
@@ -69,6 +71,7 @@ struct OHOS_NWEB_EXPORT NWebInitArgs {
std::list<std::string> web_engine_args_to_add;
std::list<std::string> web_engine_args_to_delete;
bool multi_renderer_process = false;
+ bool is_enhance_surface = false;
};
struct OHOS_NWEB_EXPORT NWebCreateInfo {
@@ -85,6 +88,7 @@ struct OHOS_NWEB_EXPORT NWebCreateInfo {
/* rs producer surface, for acquiring elgsurface from ohos */
void *producer_surface = nullptr;
+ void* enhance_surface_info = nullptr;
};
enum class OHOS_NWEB_EXPORT DragAction {
@@ -103,6 +107,8 @@ struct OHOS_NWEB_EXPORT DragEvent {
DragAction action;
};
+using WebState = std::shared_ptr<std::vector<uint8_t>>;
+
class OHOS_NWEB_EXPORT NWeb : public std::enable_shared_from_this<NWeb> {
public:
NWeb() = default;
@@ -276,8 +282,9 @@ class OHOS_NWEB_EXPORT NWeb : public std::enable_shared_from_this<NWeb> {
*/
virtual void PutDownloadCallback(
std::shared_ptr<NWebDownloadCallback> downloadListener) = 0;
+
/**
- * Sets the NWebHandler that will receive various notifications and
+ * Set the NWebHandler that will receive various notifications and
* requests. This will replace the current handler.
*
* @param client NWebHandler: an implementation of NWebHandler This value
@@ -473,7 +480,7 @@ class OHOS_NWEB_EXPORT NWeb : public std::enable_shared_from_this<NWeb> {
* @param portHandle the port to send message.
* @param data the message to send.
*/
- virtual void PostPortMessage(std::string& portHandle, std::string& data) = 0;
+ virtual void PostPortMessage(std::string& portHandle, std::shared_ptr<NWebMessage> data) = 0;
/**
* set the callback of the message port.
@@ -482,7 +489,7 @@ class OHOS_NWEB_EXPORT NWeb : public std::enable_shared_from_this<NWeb> {
* @param callback to reveive the result when the other port post message.
*/
virtual void SetPortMessageCallback(std::string& portHandle,
- std::shared_ptr<NWebValueCallback<std::string>> callback) = 0;
+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) = 0;
virtual void SendDragEvent(const DragEvent& dragEvent) const = 0;
@@ -558,6 +565,67 @@ class OHOS_NWEB_EXPORT NWeb : public std::enable_shared_from_this<NWeb> {
* @param web has image or not
*/
virtual std::shared_ptr<NWebHistoryList> GetHistoryList() = 0;
+
+ /**
+ * Set the NWebReleaseSurfaceCallback that will receive release surface event.
+ * This will replace the current handler.
+ *
+ * @param releaseSurfaceListener NWebReleaseSurfaceCallback.
+ */
+ virtual void PutReleaseSurfaceCallback(
+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) = 0;
+
+ /**
+ * Get web back forward state.
+ *
+ * @return web back forward state.
+ */
+ virtual WebState SerializeWebState() = 0;
+
+ /**
+ * Restore web back forward state.
+ *
+ * @param web back forward state.
+ */
+ virtual bool RestoreWebState(WebState state) = 0;
+
+ /**
+ * Move page up.
+ *
+ * @param top whether move to the top.
+ */
+ virtual void PageUp(bool top) = 0;
+
+ /**
+ * Move page down.
+ *
+ * @param bottom whether move to the bottom.
+ */
+ virtual void PageDown(bool bottom) = 0;
+
+ /**
+ * Scroll to the position.
+ *
+ * @param x horizontal coordinate.
+ * @param y vertical coordinate.
+ */
+ virtual void ScrollTo(float x, float y) = 0;
+
+ /**
+ * Scroll by the delta distance.
+ *
+ * @param delta_x horizontal offset.
+ * @param delta_y vertical offset.
+ */
+ virtual void ScrollBy(float delta_x, float delta_y) = 0;
+
+ /**
+ * Slide scroll by the speed.
+ *
+ * @param vx horizontal slide speed.
+ * @param vy vertical slide speed.
+ */
+ virtual void SlideScroll(float vx, float vy) = 0;
};
} // namespace OHOS::NWeb
@@ -38,22 +38,29 @@ public:
enum ContextMenuMediaType {
CM_MT_NONE,
CM_MT_IMAGE,
- CM_MT_VIDEO,
- CM_MT_AUDIO,
- CM_MT_FILE,
- CM_MT_PLUGIN,
};
enum ContextMenuEditStateFlags {
CM_ES_NONE = 0,
- CM_ES_CAN_UNDO = 1 << 0,
- CM_ES_CAN_REDO = 1 << 1,
- CM_ES_CAN_CUT = 1 << 2,
- CM_ES_CAN_COPY = 1 << 3,
- CM_ES_CAN_PASTE = 1 << 4,
- CM_ES_CAN_DELETE = 1 << 5,
- CM_ES_CAN_SELECT_ALL = 1 << 6,
- CM_ES_CAN_TRANSLATE = 1 << 7,
+ CM_ES_CAN_CUT = 1 << 0,
+ CM_ES_CAN_COPY = 1 << 1,
+ CM_ES_CAN_PASTE = 1 << 2,
+ CM_ES_CAN_SELECT_ALL = 1 << 3,
+ };
+
+ enum ContextMenuInputFieldType {
+ CM_IT_NONE = 0,
+ CM_IT_PLAINTEXT = 1,
+ CM_IT_PASSWORD = 2,
+ CM_IT_NUMBER = 3,
+ CM_IT_TELEPHONE = 4,
+ CM_IT_OTHER = 5,
+ };
+
+ enum ContextMenuSourceType {
+ CM_ST_NONE = 0,
+ CM_ST_MOUSE = 1,
+ CM_ST_LONG_PRESS = 2,
};
virtual ~NWebContextMenuParams() = default;
@@ -65,9 +72,9 @@ public:
virtual int32_t GetContextMenuTypeFlags() = 0;
virtual std::string GetLinkUrl() = 0;
-
+
virtual std::string GetUnfilteredLinkUrl() = 0;
-
+
virtual std::string GetSourceUrl() = 0;
virtual bool HasImageContents() = 0;
@@ -81,6 +88,12 @@ public:
virtual bool IsEditable() = 0;
virtual int32_t GetEditStateFlags() = 0;
+
+ virtual ContextMenuSourceType GetSourceType() = 0;
+
+ virtual ContextMenuInputFieldType GetInputFieldType() = 0;
+
+ virtual std::string GetSelectionText() = 0;
};
class OHOS_NWEB_EXPORT NWebQuickMenuParams {
@@ -123,6 +136,11 @@ enum MenuEventFlags {
enum MenuCommandId {
CI_IMAGE_COPY = 0,
+ CI_COPY = 1,
+ CI_PASTE = 2,
+ CI_CUT = 3,
+ CI_SELECT_ALL = 4,
+ CI_DELETE = 5,
};
class OHOS_NWEB_EXPORT NWebContextMenuCallback {
@@ -137,9 +155,9 @@ public:
class OHOS_NWEB_EXPORT NWebQuickMenuCallback {
public:
virtual ~NWebQuickMenuCallback() = default;
-
+
virtual void Continue(int32_t commandId, MenuEventFlags flag) = 0;
-
+
virtual void Cancel() = 0;
};
}
@@ -60,10 +60,12 @@ public:
*
* @param host the host to which the credentials apply.
* @param realm the realm to which the credentials apply.
- * @return return an array containing username and password.
+ * @param username the username.
+ * @param password the password.
+ * @param passwordSize the password array size.
*/
- virtual std::vector<std::string> GetHttpAuthCredentials(const std::string& host,
- const std::string& realm) const = 0;
+ virtual void GetHttpAuthCredentials(const std::string& host, const std::string& realm,
+ std::string& username, char* password, uint32_t passwordSize) const = 0;
/**
* @brief gets whether the instance holds the specified permissions for the specified source.
@@ -35,6 +35,7 @@
#include "nweb_js_ssl_error_result.h"
#include "nweb_js_ssl_select_cert_result.h"
#include "nweb_key_event.h"
+#include "nweb_select_popup_menu.h"
#include "nweb_touch_handle_state.h"
#include "nweb_url_resource_error.h"
#include "nweb_url_resource_request.h"
@@ -79,6 +80,71 @@ enum class SslError {
UNTRUSTED,
};
+// Cursor type values.
+enum class CursorType: int32_t {
+ CT_POINTER = 0,
+ CT_CROSS,
+ CT_HAND,
+ CT_IBEAM,
+ CT_WAIT,
+ CT_HELP,
+ CT_EASTRESIZE,
+ CT_NORTHRESIZE,
+ CT_NORTHEASTRESIZE,
+ CT_NORTHWESTRESIZE,
+ CT_SOUTHRESIZE,
+ CT_SOUTHEASTRESIZE,
+ CT_SOUTHWESTRESIZE,
+ CT_WESTRESIZE,
+ CT_NORTHSOUTHRESIZE,
+ CT_EASTWESTRESIZE,
+ CT_NORTHEASTSOUTHWESTRESIZE,
+ CT_NORTHWESTSOUTHEASTRESIZE,
+ CT_COLUMNRESIZE,
+ CT_ROWRESIZE,
+ CT_MIDDLEPANNING,
+ CT_EASTPANNING,
+ CT_NORTHPANNING,
+ CT_NORTHEASTPANNING,
+ CT_NORTHWESTPANNING,
+ CT_SOUTHPANNING,
+ CT_SOUTHEASTPANNING,
+ CT_SOUTHWESTPANNING,
+ CT_WESTPANNING,
+ CT_MOVE,
+ CT_VERTICALTEXT,
+ CT_CELL,
+ CT_CONTEXTMENU,
+ CT_ALIAS,
+ CT_PROGRESS,
+ CT_NODROP,
+ CT_COPY,
+ CT_NONE,
+ CT_NOTALLOWED,
+ CT_ZOOMIN,
+ CT_ZOOMOUT,
+ CT_GRAB,
+ CT_GRABBING,
+ CT_MIDDLE_PANNING_VERTICAL,
+ CT_MIDDLE_PANNING_HORIZONTAL,
+ CT_CUSTOM,
+ CT_DND_NONE,
+ CT_DND_MOVE,
+ CT_DND_COPY,
+ CT_DND_LINK,
+ CT_MAX_VALUE,
+};
+
+struct NWebCursorInfo {
+ int32_t width = 0;
+ int32_t height = 0;
+ int32_t x = 0;
+ int32_t y = 0;
+ float scale = 1.0;
+ // buff will be width*height*4 bytes in size and represents a BGRA image with an upper-left origin.
+ std::unique_ptr<uint8_t[]> buff = nullptr;
+};
+
using FileSelectorCallback = NWebValueCallback<std::vector<std::string>&>;
class OHOS_NWEB_EXPORT NWebHandler {
@@ -465,6 +531,19 @@ public:
virtual bool OnUnProcessedKeyEvent(std::shared_ptr<NWebKeyEvent> event) {
return false;
}
+
+ /**
+ * @brief Called when the browser's cursor has changed.
+ * @param type Cursor type.
+ * @param info If |type| is CT_CUSTOM then |info| will be populated with the custom cursor information.
+ * @return True if the cursor change was handled or false for default handling.
+ */
+ virtual bool OnCursorChange(const CursorType& type, const NWebCursorInfo& info) {
+ return false;
+ }
+
+ virtual void OnSelectPopupMenu(std::shared_ptr<NWebSelectPopupMenuParam> params,
+ std::shared_ptr<NWebSelectPopupMenuCallback> callback) {}
};
} // namespace OHOS::NWeb
@@ -118,11 +118,11 @@ public:
virtual void PutFixedFontFamilyName(std::string font) = 0;
/**
- * Enables or disables the force dark mode for this WebView.
+ * Enables or disables the force dark mode for this NWeb.
*
- * @param forceDark true if set the force dark mode for this WebView.
+ * @param forceDark True if set the force dark mode enabled for this NWeb.
*/
- virtual void PutDarkModeEnabled(int forceDark) = 0;
+ virtual void PutForceDarkModeEnabled(int forceDark) = 0;
/**
* Put whether JavaScript can open windows by JavaScript. This applies to the
@@ -372,11 +372,11 @@ public:
virtual std::string FixedFontFamilyName() = 0;
/**
- * Get if the dark mode for this WebView is supported.
+ * Get whether the force dark mode is enabled for this NWeb.
*
- * @see PutDarkModeEnabled
+ * @see PutForceDarkModeEnabled
*/
- virtual int DarkModeEnabled() = 0;
+ virtual int ForceDarkModeEnabled() = 0;
/**
* Get if JavaScript can open windows.
@@ -516,6 +516,44 @@ public:
* @see PutMultiWindowAccess
*/
virtual bool IsMultiWindowAccess() = 0;
+
+ /**
+ * Enables or disables the dark mode prefer-color-scheme for this NWeb.
+ *
+ * @param darkScheme True if set the dark mode prefer-color-scheme enabled for this NWeb.
+ */
+ virtual void PutDarkSchemeEnabled(int darkScheme) = 0;
+
+ /**
+ * Get whether the dark mode prefer-color-scheme is enabled for this NWeb.
+ *
+ * @see PutDarkSchemeEnabled
+ */
+ virtual int DarkSchemeEnabled() = 0;
+
+ /**
+ * Get whether enable horizontal scroll bar.
+ *
+ * @see PutHorizontalScrollBarAccess
+ */
+ virtual bool IsHorizontalScrollBarAccess() = 0;
+
+ /**
+ * Get whether enable vertical scroll bar.
+ *
+ * @see PutVerticalScrollBarAccess
+ */
+ virtual bool IsVerticalScrollBarAccess() = 0;
+
+ /**
+ * Put whether enable horizontal scroll bar, default value is false.
+ */
+ virtual void PutHorizontalScrollBarAccess(bool flag) = 0;
+
+ /**
+ * Put whether enable vertical scroll bar, default value is false.
+ */
+ virtual void PutVerticalScrollBarAccess(bool flag) = 0;
};
} // namespace OHOS::NWeb
#endif // NWEB_PREFERENCE_H
new file mode 100755
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef NWEB_RELEASE_SURFACE_CALLBACK_H
+#define NWEB_RELEASE_SURFACE_CALLBACK_H
+
+#include <string>
+
+#include "nweb_export.h"
+
+namespace OHOS::NWeb {
+class OHOS_NWEB_EXPORT NWebReleaseSurfaceCallback {
+public:
+ NWebReleaseSurfaceCallback() = default;
+
+ virtual ~NWebReleaseSurfaceCallback() = default;
+
+ virtual void ReleaseSurface() = 0;
+};
+} // namespace OHOS::NWeb
+
+#endif // NWEB_RELEASE_SURFACE_CALLBACK_H
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef NWEB_SELECT_POPUP_MENU_H
+#define NWEB_SELECT_POPUP_MENU_H
+
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace OHOS::NWeb {
+
+struct SelectMenuBound {
+ int x = -1;
+ int y = -1;
+ int width = -1;
+ int height = -1;
+};
+
+enum SelectPopupMenuItemType {
+ SP_OPTION,
+ SP_CHECKABLE_OPTION,
+ SP_GROUP,
+ SP_SEPARATOR,
+ SP_SUBMENU,
+};
+
+enum TextDirection {
+ SP_UNKNOWN,
+ SP_RTL,
+ SP_LTR,
+};
+
+struct SelectPopupMenuItem {
+ std::string label = "";
+ std::string toolTip = "";
+ SelectPopupMenuItemType type = SP_OPTION;
+ uint32_t action = 0;
+ TextDirection textDirection = SP_UNKNOWN;
+ bool enabled = false;
+ bool hasTextDirectionOverride = false;
+ bool checked = false;
+};
+
+struct NWebSelectPopupMenuParam {
+ SelectMenuBound bounds;
+ int itemHeight = -1;
+ double itemFontSize = -1;
+ int selectedItem = -1;
+ std::vector<SelectPopupMenuItem> menuItems;
+ bool rightAligned = false;
+ bool allowMultipleSelection = false;
+};
+
+class NWebSelectPopupMenuCallback {
+public:
+ virtual ~NWebSelectPopupMenuCallback() = default;
+
+ virtual void Continue(const std::vector<int32_t>& indices) = 0;
+
+ virtual void Cancel() = 0;
+};
+}
+#endif
\ No newline at end of file
new file mode 100755
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef NWEB_WEB_MESSAGE_H_
+#define NWEB_WEB_MESSAGE_H_
+
+#include <vector>
+
+#include "nweb_value.h"
+#include "nweb_export.h"
+
+namespace OHOS::NWeb {
+class OHOS_NWEB_EXPORT NWebMessage : public NWebValue {
+public:
+ explicit NWebMessage(NWebValue::Type type) : NWebValue(type){}
+
+ ~NWebMessage() = default;
+
+ void SetBinary(std::vector<uint8_t>& binary_data) {
+ binary_data_.reserve(binary_data.size());
+ binary_data_ = binary_data;
+ }
+
+ std::vector<uint8_t> GetBinary() {
+ return binary_data_;
+ }
+
+private:
+ std::vector<uint8_t> binary_data_;
+};
+}
+
+#endif // NWEB_WEB_MESSAGE_H_
@@ -18,20 +18,16 @@
#include <stddef.h>
-#include "nweb_capi_export.h"
-
-struct NWEB_CAPI_EXPORT NWebReceivedIconInfo {
- const char* image_url;
- size_t width;
- size_t height;
- int color_type{0};
- int alpha_type{0};
-};
-
-struct NWEB_CAPI_EXPORT NWebAppClientExtensionCallback {
- int NWebID{0};
- void (*OnReceivedFaviconUrl)(const NWebReceivedIconInfo&, int);
- void (*OnLoadStarted)(bool toDifferentDocument, int);
+struct NWebAppClientExtensionCallback {
+ size_t struct_size = sizeof(NWebAppClientExtensionCallback);
+ int nweb_id{0};
+ void (*OnReceivedFaviconUrl)(const char* image_url,
+ size_t width,
+ size_t height,
+ int color_type,
+ int alpha_type,
+ int nweb_id);
+ void (*OnLoadStarted)(bool toDifferentDocument, int nweb_id);
};
#endif // OHOS_NWEB_SRC_NWEB_APP_CLIENT_EXTENSION_CALLBACK_H_
@@ -17,8 +17,12 @@
#include <cstdlib>
#include <thread>
-#include "content/public/common/content_switches.h"
+
+#include "cef/include/wrapper/cef_closure_task.h"
#include "cef/include/wrapper/cef_helpers.h"
+#include "content/public/browser/browser_task_traits.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/common/content_switches.h"
#include "nweb_handler_delegate.h"
namespace OHOS::NWeb {
@@ -30,7 +34,7 @@ NWebApplication::NWebApplication(
: preference_delegate_(preference_delegate),
url_(url),
handler_delegate_(handler_delegate),
- window_(window) {}
+ window_(window){}
NWebApplication::~NWebApplication() {}
@@ -95,16 +99,37 @@ void NWebApplication::OnContextInitialized() {
LOG(INFO) << "NWebApplication::OnContextInitialized";
CEF_REQUIRE_UI_THREAD();
CreateBrowser();
+ auto runWebInitedCallback = OhosAdapterHelper::GetInstance().GetInitWebAdapter()->GetRunWebInitedCallback();
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE, base::BindOnce(&NWebApplication::RunWebInitedCallback, this,
+ runWebInitedCallback));
OnContextInitializedInternal();
}
+void NWebApplication::RunWebInitedCallback(WebRunInitedCallback* callback)
+{
+ if (callback != nullptr) {
+ callback->RunInitedCallback();
+ delete callback;
+ callback = nullptr;
+ } else {
+ LOG(ERROR) << "There is no web inited callback to run.";
+ }
+}
+
void NWebApplication::OnBeforeChildProcessLaunch(CefRefPtr<CefCommandLine> command_line)
{
LOG(INFO) << "NWebApplication::OnBeforeChildProcessLaunch";
if (CefCommandLine::GetGlobalCommandLine()->HasSwitch(::switches::kOhosCustomScheme)) {
command_line->AppendSwitchWithValue(::switches::kOhosCustomScheme, CefCommandLine::GetGlobalCommandLine()->GetSwitchValue(::switches::kOhosCustomScheme).ToString());
}
+
+ if (CefCommandLine::GetGlobalCommandLine()->HasSwitch(::switches::kOhosHapPath)) {
+ LOG(INFO) << "hap package is not decompresssed";
+ command_line->AppendSwitchWithValue(::switches::kOhosHapPath,
+ CefCommandLine::GetGlobalCommandLine()->GetSwitchValue(::switches::kOhosHapPath).ToString());
+ }
}
/* CefBrowserProcessHandler methods end */
@@ -20,6 +20,7 @@
#include "cef/include/cef_app.h"
#include "nweb_handler_delegate.h"
#include "nweb_preference_delegate.h"
+#include "ohos_adapter_helper.h"
namespace OHOS::NWeb {
namespace switches {
@@ -64,11 +65,12 @@ class NWebApplication : public CefApp,
void OnContextInitializedInternal();
std::vector<std::string> CustomSchemeCmdLineSplit(std::string str, const char split);
+ void RunWebInitedCallback(WebRunInitedCallback* callback);
+
std::shared_ptr<NWebPreferenceDelegate> preference_delegate_ = nullptr;
std::string url_;
CefRefPtr<NWebHandlerDelegate> handler_delegate_{nullptr};
void* window_ = nullptr;
-
// Include the default reference counting implementation.
IMPLEMENT_REFCOUNTING(NWebApplication);
}; // NWebApplication
@@ -23,7 +23,10 @@ namespace {
using CmTf = NWebContextMenuParams::ContextMenuTypeFlags;
using CmMt = NWebContextMenuParams::ContextMenuMediaType;
using CmEf = NWebContextMenuParams::ContextMenuEditStateFlags;
+using CmIt = NWebContextMenuParams::ContextMenuInputFieldType;
+using CmSt = NWebContextMenuParams::ContextMenuSourceType;
using QmEf = NWebQuickMenuParams::QuickMenuEditStateFlags;
+
const std::unordered_map<int, int> kCmTypeFlagMap = {
{CM_TYPEFLAG_NONE, CmTf::CM_TF_NONE},
{CM_TYPEFLAG_PAGE, CmTf::CM_TF_PAGE},
@@ -37,22 +40,18 @@ const std::unordered_map<int, int> kCmTypeFlagMap = {
const std::unordered_map<int, int> kCmMediaTypeMap = {
{CM_MEDIATYPE_NONE, CmMt::CM_MT_NONE},
{CM_MEDIATYPE_IMAGE, CmMt::CM_MT_IMAGE},
- {CM_MEDIATYPE_VIDEO, CmMt::CM_MT_VIDEO},
- {CM_MEDIATYPE_AUDIO, CmMt::CM_MT_AUDIO},
- {CM_MEDIATYPE_FILE, CmMt::CM_MT_FILE},
- {CM_MEDIATYPE_PLUGIN, CmMt::CM_MT_PLUGIN},
+ {CM_MEDIATYPE_VIDEO, CmMt::CM_MT_NONE},
+ {CM_MEDIATYPE_AUDIO, CmMt::CM_MT_NONE},
+ {CM_MEDIATYPE_FILE, CmMt::CM_MT_NONE},
+ {CM_MEDIATYPE_PLUGIN, CmMt::CM_MT_NONE},
};
const std::unordered_map<int, int> kCmEditStateFlagsMap = {
{CM_EDITFLAG_NONE, CmEf::CM_ES_NONE},
- {CM_EDITFLAG_CAN_UNDO, CmEf::CM_ES_CAN_UNDO},
- {CM_EDITFLAG_CAN_REDO, CmEf::CM_ES_CAN_REDO},
{CM_EDITFLAG_CAN_CUT, CmEf::CM_ES_CAN_CUT},
{CM_EDITFLAG_CAN_COPY, CmEf::CM_ES_CAN_COPY},
{CM_EDITFLAG_CAN_PASTE, CmEf::CM_ES_CAN_PASTE},
- {CM_EDITFLAG_CAN_DELETE, CmEf::CM_ES_CAN_DELETE},
{CM_EDITFLAG_CAN_SELECT_ALL, CmEf::CM_ES_CAN_SELECT_ALL},
- {CM_EDITFLAG_CAN_TRANSLATE, CmEf::CM_ES_CAN_TRANSLATE},
};
const std::unordered_map<int, int> kQmEditStateFlagsMap = {
@@ -77,6 +76,34 @@ const std::unordered_map<int, int> KMenuEventFlagsMap = {
const std::unordered_map<int32_t, cef_menu_id_t> KMenuCommandIdMap = {
{CI_IMAGE_COPY, MENU_ID_IMAGE_COPY},
+ {CI_CUT, MENU_ID_CUT},
+ {CI_COPY, MENU_ID_COPY},
+ {CI_PASTE, MENU_ID_PASTE},
+ {CI_DELETE, MENU_ID_DELETE},
+ {CI_SELECT_ALL, MENU_ID_SELECT_ALL},
+};
+
+const std::unordered_map<int, int> kCmInputFieldTypeMap = {
+ {CM_INPUTFIELDTYPE_NONE, CmIt::CM_IT_NONE},
+ {CM_INPUTFIELDTYPE_PLAINTEXT, CmIt::CM_IT_PLAINTEXT},
+ {CM_INPUTFIELDTYPE_PASSWORD, CmIt::CM_IT_PASSWORD},
+ {CM_INPUTFIELDTYPE_NUMBER, CmIt::CM_IT_NUMBER},
+ {CM_INPUTFIELDTYPE_TELEPHONE, CmIt::CM_IT_TELEPHONE},
+ {CM_INPUTFIELDTYPE_OTHER, CmIt::CM_IT_OTHER},
+};
+
+const std::unordered_map<int, int> kCmSourceTypeMap = {
+ {CM_SOURCETYPE_NONE, CmSt::CM_ST_NONE},
+ {CM_SOURCETYPE_MOUSE, CmSt::CM_ST_MOUSE},
+ {CM_SOURCETYPE_KEYBOARD, CmSt::CM_ST_NONE},
+ {CM_SOURCETYPE_TOUCH, CmSt::CM_ST_NONE},
+ {CM_SOURCETYPE_TOUCH_EDIT_MENU, CmSt::CM_ST_NONE},
+ {CM_SOURCETYPE_LONG_PRESS, CmSt::CM_ST_LONG_PRESS},
+ {CM_SOURCETYPE_LONG_TAP, CmSt::CM_ST_NONE},
+ {CM_SOURCETYPE_TOUCH_HANDLE, CmSt::CM_ST_NONE},
+ {CM_SOURCETYPE_STYLUS, CmSt::CM_ST_NONE},
+ {CM_SOURCETYPE_ADJUST_SELECTION, CmSt::CM_ST_NONE},
+ {CM_SOURCETYPE_SELECTION_RESET, CmSt::CM_ST_NONE},
};
cef_menu_id_t ConvertCommandId(int32_t id) {
@@ -101,29 +128,50 @@ int32_t ConvertMenuFlags(int32_t value,
CmMt ConvertContextMenuMediaType(
CefContextMenuParams::MediaType value) {
- std::unordered_map<int, int>::const_iterator iter =
+ std::unordered_map<int, int>::const_iterator iter =
kCmMediaTypeMap.find(static_cast<int32_t>(value));
if (iter != kCmMediaTypeMap.end()) {
return static_cast<CmMt>(iter->second);
}
return CmMt::CM_MT_NONE;
}
+
+CmIt ConvertContextMenuInputFieldType(CefContextMenuParams::InputFieldType value) {
+ std::unordered_map<int, int>::const_iterator iter =
+ kCmInputFieldTypeMap.find(static_cast<int32_t>(value));
+ if (iter != kCmInputFieldTypeMap.end()) {
+ return static_cast<CmIt>(iter->second);
+ }
+ return CmIt::CM_IT_NONE;
+}
+
+CmSt ConvertContextMenuSourceType(CefContextMenuParams::SourceType value) {
+ std::unordered_map<int, int>::const_iterator iter =
+ kCmSourceTypeMap.find(static_cast<int32_t>(value));
+ if (iter != kCmSourceTypeMap.end()) {
+ return static_cast<CmSt>(iter->second);
+ }
+ return CmSt::CM_ST_NONE;
}
+} // namespace end
namespace OHOS::NWeb {
NWebContextMenuParamsImpl::NWebContextMenuParamsImpl(
- CefRefPtr<CefContextMenuParams> params) : params_(params) {}
+ CefRefPtr<CefContextMenuParams> params,
+ float virutal_device_ratio) :
+ params_(params),
+ virutal_device_ratio_(virutal_device_ratio) {}
int32_t NWebContextMenuParamsImpl::GetXCoord() {
if (params_ != nullptr) {
- return params_->GetXCoord();
+ return params_->GetXCoord() * virutal_device_ratio_;
}
return -1;
}
int32_t NWebContextMenuParamsImpl::GetYCoord() {
if (params_ != nullptr) {
- return params_->GetYCoord();
+ return params_->GetYCoord() * virutal_device_ratio_;;
}
return -1;
}
@@ -141,14 +189,14 @@ std::string NWebContextMenuParamsImpl::GetLinkUrl() {
}
return std::string();
}
-
+
std::string NWebContextMenuParamsImpl::GetUnfilteredLinkUrl() {
if (params_ != nullptr) {
return params_->GetUnfilteredLinkUrl().ToString();
}
return std::string();
}
-
+
std::string NWebContextMenuParamsImpl::GetSourceUrl() {
if (params_ != nullptr) {
return params_->GetSourceUrl().ToString();
@@ -165,14 +213,14 @@ bool NWebContextMenuParamsImpl::HasImageContents() {
std::string NWebContextMenuParamsImpl::GetTitleText() {
if (params_ != nullptr) {
- return params_->GetTitleText();
+ return params_->GetTitleText().ToString();
}
return std::string();
}
std::string NWebContextMenuParamsImpl::GetPageUrl() {
if (params_ != nullptr) {
- return params_->GetPageUrl();
+ return params_->GetPageUrl().ToString();
}
return std::string();
}
@@ -186,9 +234,10 @@ CmMt NWebContextMenuParamsImpl::GetMediaType() {
bool NWebContextMenuParamsImpl::IsEditable() {
if (params_ != nullptr) {
- return params_->HasImageContents();
+ return params_->IsEditable();
}
- return params_->IsEditable();
+
+ return false;
}
int32_t NWebContextMenuParamsImpl::GetEditStateFlags() {
@@ -198,6 +247,27 @@ int32_t NWebContextMenuParamsImpl::GetEditStateFlags() {
return 0;
}
+CmIt NWebContextMenuParamsImpl::GetInputFieldType() {
+ if (params_ != nullptr) {
+ return ConvertContextMenuInputFieldType(params_->GetInputFieldType());
+ }
+ return CmIt::CM_IT_NONE;
+}
+
+CmSt NWebContextMenuParamsImpl::GetSourceType() {
+ if (params_ != nullptr) {
+ return ConvertContextMenuSourceType(params_->GetSourceType());
+ }
+ return CmSt::CM_ST_NONE;
+}
+
+std::string NWebContextMenuParamsImpl::GetSelectionText()
+{
+ if (params_ != nullptr) {
+ return params_->GetSelectionText().ToString();
+ }
+ return std::string();
+}
NWebQuickMenuParamsImpl::NWebQuickMenuParamsImpl(
int32_t x, int32_t y, int32_t width, int32_t height, int32_t flags)
: x_(x), y_(y), width_(width), height_(height),
@@ -262,7 +332,7 @@ NWebContextMenuCallbackImpl::NWebContextMenuCallbackImpl(
void NWebContextMenuCallbackImpl::Continue(
int32_t commandId, MenuEventFlags flag) {
if (callback_ != nullptr) {
- int32_t event_flag =
+ int32_t event_flag =
ConvertMenuFlags(static_cast<int32_t>(flag), KMenuEventFlagsMap);
callback_->Continue(ConvertCommandId(commandId),
static_cast<cef_event_flags_t>(event_flag));
@@ -281,7 +351,7 @@ NWebQuickMenuCallbackImpl::NWebQuickMenuCallbackImpl(
void NWebQuickMenuCallbackImpl::Continue(
int32_t commandId, MenuEventFlags flag) {
if (callback_ != nullptr) {
- int32_t event_flag =
+ int32_t event_flag =
ConvertMenuFlags(static_cast<int32_t>(flag), KMenuEventFlagsMap);
callback_->Continue(commandId,
static_cast<cef_event_flags_t>(event_flag));
@@ -24,7 +24,8 @@ namespace OHOS::NWeb {
class NWebContextMenuParamsImpl : public NWebContextMenuParams {
public:
explicit NWebContextMenuParamsImpl(
- CefRefPtr<CefContextMenuParams> params);
+ CefRefPtr<CefContextMenuParams> params,
+ float virutal_device_ratio);
int32_t GetXCoord() override;
int32_t GetYCoord() override;
int32_t GetContextMenuTypeFlags() override;
@@ -37,9 +38,12 @@ class NWebContextMenuParamsImpl : public NWebContextMenuParams {
ContextMenuMediaType GetMediaType() override;
bool IsEditable() override;
int32_t GetEditStateFlags() override;
-
+ ContextMenuInputFieldType GetInputFieldType() override;
+ ContextMenuSourceType GetSourceType() override;
+ std::string GetSelectionText() override;
private:
CefRefPtr<CefContextMenuParams> params_;
+ float virutal_device_ratio_ = 1.0;
};
class NWebQuickMenuParamsImpl : public NWebQuickMenuParams {
@@ -54,20 +54,16 @@ void NWebDataBaseDelegate::SaveHttpAuthCredentials(const std::string& host,
data_base->SaveHttpAuthCredentials(host, realm,username, password);
}
-std::vector<std::string> NWebDataBaseDelegate::GetHttpAuthCredentials(const std::string& host, const std::string& realm) {
+void NWebDataBaseDelegate::GetHttpAuthCredentials(const std::string& host, const std::string& realm,
+ std::string& username, char* password, uint32_t passwordSize) {
CefRefPtr<CefDataBase> data_base = GetGlobalCefDataBase();
if (data_base == nullptr) {
- return {};
+ return;
}
- std::vector<CefString> method_vector;
- data_base->GetHttpAuthCredentials(host, realm, method_vector);
-
- std::vector<std::string> username_password;
- for (std::string value : method_vector) {
- username_password.push_back(value);
- }
- return username_password;
+ CefString usernameCef;
+ data_base->GetHttpAuthCredentials(host, realm, usernameCef, password, passwordSize);
+ username = usernameCef;
}
bool NWebDataBaseDelegate::ExistPermissionByOrigin(const std::string& origin, int type)
@@ -36,7 +36,8 @@ class NWebDataBaseDelegate {
void SaveHttpAuthCredentials(const std::string& host, const std::string& realm,
const std::string& username, const char* password);
- std::vector<std::string> GetHttpAuthCredentials(const std::string& host, const std::string& realm);
+ void GetHttpAuthCredentials(const std::string& host, const std::string& realm,
+ std::string& username, char* password, uint32_t passwordSize);
bool ExistPermissionByOrigin(const std::string& origin, int type);
@@ -26,10 +26,13 @@
#include "cef/include/cef_app.h"
#include "cef/include/cef_base.h"
#include "cef/include/cef_request_context.h"
+#include "content/public/common/content_switches.h"
#include "nweb_find_delegate.h"
#include "nweb_preference_delegate.h"
#include "url/gurl.h"
+#include "cef/libcef/browser/navigation_state_serializer.h"
+
namespace OHOS::NWeb {
static const float maxZoomFactor = 10.0;
@@ -51,6 +54,38 @@ class JavaScriptResultCallbackImpl : public CefJavaScriptResultCallback {
IMPLEMENT_REFCOUNTING(JavaScriptResultCallbackImpl);
};
+class CefWebMessageReceiverImpl : public CefWebMessageReceiver {
+ public:
+ CefWebMessageReceiverImpl(
+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback)
+ : callback_(callback){};
+ void OnMessage(CefRefPtr<CefValue> message) override {
+ if (callback_ != nullptr) {
+ auto data = std::make_shared<OHOS::NWeb::NWebMessage>(NWebValue::Type::NONE);
+ if (message->GetType() == VTYPE_STRING) {
+ data->SetType(NWebValue::Type::STRING);
+ data->SetString(message->GetString());
+ } else if (message->GetType() == VTYPE_BINARY) {
+ CefRefPtr<CefBinaryValue> binValue = message->GetBinary();
+ size_t len = binValue->GetSize();
+ std::vector<uint8_t> arr(len);
+ binValue->GetData(&arr[0], len, 0);
+ data->SetType(NWebValue::Type::BINARY);
+ data->SetBinary(arr);
+ } else {
+ LOG(ERROR) << "OnMessage not support type";
+ return;
+ }
+ callback_->OnReceiveValue(data);
+ }
+ }
+
+ private:
+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback_;
+
+ IMPLEMENT_REFCOUNTING(CefWebMessageReceiverImpl);
+};
+
class StoreWebArchiveResultCallbackImpl
: public CefStoreWebArchiveResultCallback {
public:
@@ -119,24 +154,23 @@ NWebDelegate::NWebDelegate(int argc, const char* argv[])
: argc_(argc), argv_(argv) {}
NWebDelegate::~NWebDelegate() {
- if (display_listener_ != nullptr &&
- display_manager_adapter_ != nullptr) {
+ if (display_listener_ != nullptr && display_manager_adapter_ != nullptr) {
display_manager_adapter_->UnregisterDisplayListener(display_listener_);
}
}
-bool NWebDelegate::Init(void* window) {
+bool NWebDelegate::Init(bool is_enhance_surface, void* window) {
preference_delegate_ = std::make_shared<NWebPreferenceDelegate>();
find_delegate_ = std::make_shared<NWebFindDelegate>();
-
+ is_enhance_surface_ = is_enhance_surface;
display_manager_adapter_ =
- OhosAdapterHelper::GetInstance().CreateDisplayMgrAdapter();
+ OhosAdapterHelper::GetInstance().CreateDisplayMgrAdapter();
if (display_manager_adapter_ == nullptr) {
return false;
}
display_listener_ =
- std::make_shared<DisplayScreenListener>(shared_from_this());
+ std::make_shared<DisplayScreenListener>(shared_from_this());
if (display_listener_ == nullptr) {
return false;
}
@@ -158,10 +192,10 @@ bool NWebDelegate::Init(void* window) {
}
std::string url_for_init = "";
- InitializeCef(url_for_init, window);
+ InitializeCef(url_for_init, is_enhance_surface_, window);
std::shared_ptr<DisplayAdapter> display =
- display_manager_adapter_->GetDefaultDisplay();
+ display_manager_adapter_->GetDefaultDisplay();
if (display != nullptr) {
NotifyScreenInfoChanged(display->GetRotation(), display->GetOrientation());
SetVirtualPixelRatio(display->GetVirtualPixelRatio());
@@ -171,8 +205,7 @@ bool NWebDelegate::Init(void* window) {
}
void NWebDelegate::OnDestroy(bool is_close_all) {
- if (display_listener_ != nullptr &&
- display_manager_adapter_ != nullptr) {
+ if (display_listener_ != nullptr && display_manager_adapter_ != nullptr) {
display_manager_adapter_->UnregisterDisplayListener(display_listener_);
}
if (handler_delegate_ != nullptr) {
@@ -196,6 +229,15 @@ void NWebDelegate::RegisterDownLoadListener(
handler_delegate_->RegisterDownLoadListener(download_listener);
}
+void NWebDelegate::RegisterReleaseSurfaceListener(
+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) {
+ if (handler_delegate_ == nullptr) {
+ LOG(ERROR) << "fail to register release surface, NWEB handler is nullptr";
+ return;
+ }
+ handler_delegate_->RegisterReleaseSurfaceListener(releaseSurfaceListener);
+}
+
void NWebDelegate::RegisterFindListener(
std::shared_ptr<NWebFindCallback> find_listener) {
if (find_delegate_ == nullptr) {
@@ -243,6 +285,15 @@ void NWebDelegate::RegisterWebAppClientExtensionListener(
web_app_client_extension_listener);
}
+void NWebDelegate::UnRegisterWebAppClientExtensionListener() {
+ if (handler_delegate_ == nullptr) {
+ LOG(ERROR) << "fail to unregister web app client extension listener, nweb "
+ "handler delegate is nullptr";
+ return;
+ }
+ handler_delegate_->UnRegisterWebAppClientExtensionListener();
+}
+
void NWebDelegate::RegisterNWebHandler(std::shared_ptr<NWebHandler> handler) {
if (handler_delegate_ == nullptr) {
LOG(ERROR)
@@ -285,19 +336,22 @@ void NWebDelegate::Resize(uint32_t width, uint32_t height) {
void NWebDelegate::OnTouchPress(int32_t id, double x, double y) {
if (event_handler_ != nullptr) {
- event_handler_->OnTouchPress(id, x, y);
+ event_handler_->OnTouchPress(id, x / default_virtual_pixel_ratio_,
+ y / default_virtual_pixel_ratio_);
}
}
void NWebDelegate::OnTouchRelease(int32_t id, double x, double y) {
if (event_handler_ != nullptr) {
- event_handler_->OnTouchRelease(id, x, y);
+ event_handler_->OnTouchRelease(id, x / default_virtual_pixel_ratio_,
+ y / default_virtual_pixel_ratio_);
}
}
void NWebDelegate::OnTouchMove(int32_t id, double x, double y) {
if (event_handler_ != nullptr) {
- event_handler_->OnTouchMove(id, x, y);
+ event_handler_->OnTouchMove(id, x / default_virtual_pixel_ratio_,
+ y / default_virtual_pixel_ratio_);
}
}
@@ -315,21 +369,32 @@ bool NWebDelegate::SendKeyEvent(int32_t keyCode, int32_t keyAction) {
return retVal;
}
-void NWebDelegate::SendMouseWheelEvent(double x, double y, double deltaX, double deltaY) {
+void NWebDelegate::SendMouseWheelEvent(double x,
+ double y,
+ double deltaX,
+ double deltaY) {
if (event_handler_ != nullptr) {
- event_handler_->SendMouseWheelEvent(x, y, deltaX, deltaY);
+ event_handler_->SendMouseWheelEvent(x / default_virtual_pixel_ratio_,
+ y / default_virtual_pixel_ratio_,
+ deltaX / default_virtual_pixel_ratio_,
+ deltaY / default_virtual_pixel_ratio_);
}
}
-void NWebDelegate::SendMouseEvent(int x, int y, int button, int action, int count) {
+void NWebDelegate::SendMouseEvent(int x,
+ int y,
+ int button,
+ int action,
+ int count) {
if (event_handler_ != nullptr) {
- event_handler_->SendMouseEvent(x, y, button, action, count);
+ event_handler_->SendMouseEvent(x / default_virtual_pixel_ratio_,
+ y / default_virtual_pixel_ratio_, button,
+ action, count);
}
}
-void NWebDelegate::NotifyScreenInfoChanged(
- RotationType rotation,
- OrientationType orientation) {
+void NWebDelegate::NotifyScreenInfoChanged(RotationType rotation,
+ OrientationType orientation) {
if (render_handler_ != nullptr) {
if (display_manager_adapter_ == nullptr) {
LOG(ERROR) << "Get display_manager_adapter_ failed";
@@ -348,8 +413,9 @@ void NWebDelegate::NotifyScreenInfoChanged(
}
int width = display->GetWidth() / display_ratio;
int height = display->GetHeight() / display_ratio;
- render_handler_->SetScreenInfo(rotation, orientation, width, height,
- display_ratio);
+ bool default_portrait = display_manager_adapter_->IsDefaultPortrait();
+ render_handler_->SetScreenInfo({rotation, orientation, width, height,
+ display_ratio, default_portrait});
auto browser = GetBrowser();
if (browser != nullptr && browser->GetHost() != nullptr) {
browser->GetHost()->NotifyScreenInfoChanged();
@@ -585,8 +651,7 @@ int NWebDelegate::ZoomOut() const {
return NWEB_OK;
}
-bool NWebDelegate::SetZoomInFactor(float factor)
-{
+bool NWebDelegate::SetZoomInFactor(float factor) {
LOG(INFO) << "NWebDelegate::SetZoomInFactor";
if (factor <= 0) {
return false;
@@ -595,8 +660,7 @@ bool NWebDelegate::SetZoomInFactor(float factor)
return true;
}
-bool NWebDelegate::SetZoomOutFactor(float factor)
-{
+bool NWebDelegate::SetZoomOutFactor(float factor) {
LOG(INFO) << "NWebDelegate::SetZoomOutFactor";
if (factor >= 0) {
return false;
@@ -641,12 +705,12 @@ void NWebDelegate::PutBackgroundColor(int color) const {
void NWebDelegate::InitialScale(float scale) const {
LOG(INFO) << "NWebDelegate::InitialScale";
- if (scale == intial_scale_) {
+ if (scale == intial_scale_ || !render_handler_) {
return;
}
-
+ float ratio = render_handler_->GetVirtualPixelRatio();
if (GetBrowser().get()) {
- GetBrowser()->GetHost()->SetInitialScale(scale);
+ GetBrowser()->GetHost()->SetInitialScale(scale / ratio);
}
}
@@ -682,9 +746,12 @@ void NWebDelegate::OnContinue() {
GetBrowser()->GetHost()->SetFocus(true);
}
-void NWebDelegate::InitializeCef(std::string url, void* window) {
+void NWebDelegate::InitializeCef(std::string url,
+ bool is_enhance_surface,
+ void* window) {
handler_delegate_ = NWebHandlerDelegate::Create(
- preference_delegate_, render_handler_, event_handler_, find_delegate_, window);
+ preference_delegate_, render_handler_, event_handler_, find_delegate_,
+ is_enhance_surface, window);
nweb_app_ =
new NWebApplication(preference_delegate_, url, handler_delegate_, window);
@@ -711,7 +778,6 @@ void NWebDelegate::InitializeCef(std::string url, void* window) {
if (is_initialized) {
return nweb_app_->CreateBrowser();
}
-
if (!CefInitialize(mainargs, settings, nweb_app_, NULL)) {
LOG(ERROR) << "CefInitialize failed";
} else {
@@ -745,7 +811,9 @@ void NWebDelegate::CreateWebMessagePorts(std::vector<std::string>& ports) {
}
}
-void NWebDelegate::PostWebMessage(std::string& message, std::vector<std::string>& ports, std::string& targetUri) {
+void NWebDelegate::PostWebMessage(std::string& message,
+ std::vector<std::string>& ports,
+ std::string& targetUri) {
if (!GetBrowser().get()) {
LOG(ERROR) << "JSAPI PostWebMessage can not get browser";
return;
@@ -777,26 +845,33 @@ void NWebDelegate::ClosePort(std::string& portHandle) {
GetBrowser()->GetHost()->ClosePort(handleCef);
}
-void NWebDelegate::PostPortMessage(std::string& portHandle, std::string& data) {
+void NWebDelegate::PostPortMessage(std::string& portHandle, std::shared_ptr<NWebMessage> data) {
if (!GetBrowser().get()) {
LOG(ERROR) << "JSAPI PostPortMessage can not get browser";
return;
}
CefString handleCef;
handleCef.FromString(portHandle);
- CefString dataCef;
- dataCef.FromString(data);
- GetBrowser()->GetHost()->PostPortMessage(handleCef, dataCef);
+ CefRefPtr<CefValue> message = CefValue::Create();
+ if (data->GetType() == NWebValue::Type::STRING) {
+ message->SetString(data->GetString());
+ } else if (data->GetType() == NWebValue::Type::BINARY) {
+ std::vector<uint8_t> vecBinary = data->GetBinary();
+ CefRefPtr<CefBinaryValue> value = CefBinaryValue::Create(vecBinary.data(), vecBinary.size());
+ message->SetBinary(value);
+ }
+
+ GetBrowser()->GetHost()->PostPortMessage(handleCef, message);
}
void NWebDelegate::SetPortMessageCallback(std::string& portHandle,
- std::shared_ptr<NWebValueCallback<std::string>> callback) {
+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) {
if (!GetBrowser().get()) {
LOG(ERROR) << "JSAPI SetPortMessageCallback can not get browser";
return;
}
- CefRefPtr<JavaScriptResultCallbackImpl> JsResultCb = new JavaScriptResultCallbackImpl(callback);
+ CefRefPtr<CefWebMessageReceiver> JsResultCb = new CefWebMessageReceiverImpl(callback);
CefString handleCef;
handleCef.FromString(portHandle);
GetBrowser()->GetHost()->SetPortMessageCallback(handleCef, JsResultCb);
@@ -805,7 +880,10 @@ void NWebDelegate::SetPortMessageCallback(std::string& portHandle,
std::string NWebDelegate::GetUrl() const {
LOG(INFO) << "NWebDelegate::get url";
if (GetBrowser().get()) {
- return GetBrowser()->GetMainFrame()->GetURL().ToString();
+ auto entry = GetBrowser()->GetHost()->GetVisibleNavigationEntry();
+ if (entry) {
+ return entry->GetDisplayURL().ToString();
+ }
}
return "";
}
@@ -963,21 +1041,25 @@ void NWebDelegate::RegisterNWebJavaScriptCallBack(
}
void NWebDelegate::OnFocus() const {
- LOG(INFO) << "NWebDelegate::OnFocus";
if (!GetBrowser().get()) {
+ LOG(ERROR) << "NWebDelegate::OnFocus GetBrowser().get() fail";
return;
}
-
- GetBrowser()->GetHost()->SetFocus(true);
+ if (handler_delegate_ && !handler_delegate_->GetFocusState()) {
+ GetBrowser()->GetHost()->SetFocus(true);
+ }
}
void NWebDelegate::OnBlur() const {
- LOG(INFO) << "NWebDelegate::OnBlur";
if (!GetBrowser().get()) {
+ LOG(ERROR) << "NWebDelegate::OnBlur GetBrowser().get() fail";
return;
}
- GetBrowser()->GetHost()->SetFocus(false);
+ if (handler_delegate_ && handler_delegate_->GetFocusState()) {
+ handler_delegate_->SetFocusState(false);
+ GetBrowser()->GetHost()->SetFocus(false);
+ }
}
void NWebDelegate::UpdateLocale(const std::string& language,
@@ -1009,13 +1091,14 @@ void NWebDelegate::SetNWebId(uint32_t nwebId) {
#endif
void NWebDelegate::SendDragEvent(const DelegateDragEvent& dragEvent) const {
- if (!GetBrowser().get()) {
- LOG(ERROR) << "browser is nullptr";
+ if (!GetBrowser().get() || !render_handler_) {
+ LOG(ERROR) << "browser or render_handler is nullptr";
return;
}
CefMouseEvent event;
- event.x = dragEvent.x;
- event.y = dragEvent.y;
+ float ratio = render_handler_->GetVirtualPixelRatio();
+ event.x = dragEvent.x / ratio;
+ event.y = dragEvent.y / ratio;
event.modifiers = EVENTFLAG_LEFT_MOUSE_BUTTON;
switch (dragEvent.action) {
case DelegateDragAction::DRAG_START:
@@ -1023,7 +1106,8 @@ void NWebDelegate::SendDragEvent(const DelegateDragEvent& dragEvent) const {
case DelegateDragAction::DRAG_ENTER:
if (render_handler_) {
LOG(INFO) << "SendDragEvent enter";
- GetBrowser()->GetHost()->DragTargetDragEnter(render_handler_->GetDragData(), event, DRAG_OPERATION_MOVE);
+ GetBrowser()->GetHost()->DragTargetDragEnter(
+ render_handler_->GetDragData(), event, DRAG_OPERATION_MOVE);
}
break;
case DelegateDragAction::DRAG_LEAVE:
@@ -1040,7 +1124,8 @@ void NWebDelegate::SendDragEvent(const DelegateDragEvent& dragEvent) const {
break;
case DelegateDragAction::DRAG_END:
LOG(INFO) << "SendDragEvent end";
- GetBrowser()->GetHost()->DragSourceEndedAt(event.x, event.y, DRAG_OPERATION_MOVE);
+ GetBrowser()->GetHost()->DragSourceEndedAt(event.x, event.y,
+ DRAG_OPERATION_MOVE);
GetBrowser()->GetHost()->DragSourceSystemDragEnded();
break;
case DelegateDragAction::DRAG_CANCEL:
@@ -1084,4 +1169,86 @@ std::shared_ptr<NWebHistoryList> NWebDelegate::GetHistoryList() {
GetBrowser()->GetHost()->GetNavigationEntries(visitor, false);
return visitor->GetHistoryList();
}
+
+void NWebDelegate::PageUp(bool top) {
+ if (!GetBrowser().get() || !render_handler_ || !handler_delegate_) {
+ return;
+ }
+ float ratio = render_handler_->GetVirtualPixelRatio();
+ float scale = handler_delegate_->GetScale() / 100.0;
+ if (ratio <= 0 || scale <= 0) {
+ LOG(ERROR) << "get ratio and scale invalid " << ratio << " " << scale;
+ return;
+ }
+ GetBrowser()->GetHost()->ScrollPageUpDown(true, !top,
+ height_ / ratio / scale);
+}
+
+void NWebDelegate::PageDown(bool bottom) {
+ if (!GetBrowser().get() || !render_handler_ || !handler_delegate_) {
+ return;
+ }
+ float ratio = render_handler_->GetVirtualPixelRatio();
+ float scale = handler_delegate_->GetScale() / 100.0;
+ if (ratio <= 0 || scale <= 0) {
+ LOG(ERROR) << "get ratio and scale invalid " << ratio << " " << scale;
+ return;
+ }
+ GetBrowser()->GetHost()->ScrollPageUpDown(false, !bottom,
+ height_ / ratio / scale);
+}
+
+void NWebDelegate::ScrollTo(float x, float y) {
+ if (!GetBrowser().get()) {
+ LOG(ERROR) << "JSAPI ScrollTo can not get browser";
+ return;
+ }
+
+ GetBrowser()->GetHost()->ScrollTo(x, y);
+}
+
+void NWebDelegate::ScrollBy(float delta_x, float delta_y) {
+ if (!GetBrowser().get()) {
+ LOG(ERROR) << "JSAPI ScrollBy can not get browser";
+ return;
+ }
+
+ GetBrowser()->GetHost()->ScrollBy(delta_x, delta_y);
+}
+
+void NWebDelegate::SlideScroll(float vx, float vy) {
+ if (!GetBrowser().get()) {
+ LOG(ERROR) << "JSAPI SlideScroll can not get browser";
+ return;
+ }
+
+ GetBrowser()->GetHost()->SlideScroll(vx, vy);
+}
+
+WebState NWebDelegate::SerializeWebState() {
+ CefRefPtr<CefBinaryValue> state_value =
+ GetBrowser()->GetHost()->GetWebState();
+ if (!state_value || !GetBrowser().get()) {
+ return nullptr;
+ }
+ size_t state_size = state_value->GetSize();
+ if (state_size == 0) {
+ return nullptr;
+ }
+ WebState state = std::make_shared<std::vector<uint8_t>>(state_size);
+ size_t read_size = state_value->GetData(state->data(), state_size, 0);
+ if (read_size != state_size) {
+ LOG(ERROR) << "SerializeWebState failed";
+ return nullptr;
+ }
+ return state;
+}
+
+bool NWebDelegate::RestoreWebState(WebState state) {
+ if (!GetBrowser().get() || !state || state->size() == 0) {
+ return false;
+ }
+ auto web_state = CefBinaryValue::Create(state->data(), state->size());
+ return GetBrowser()->GetHost()->RestoreWebState(web_state);
+}
} // namespace OHOS::NWeb
@@ -37,7 +37,7 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount {
public:
NWebDelegate(int argc, const char* argv[]);
~NWebDelegate();
- bool Init(void* window);
+ bool Init(bool is_enhance_surface, void* window);
bool IsReady() override;
void OnDestroy(bool is_close_all) override;
@@ -45,8 +45,11 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount {
void RegisterWebAppClientExtensionListener(
std::shared_ptr<NWebAppClientExtensionCallback>
web_app_client_extension_listener) override;
+ void UnRegisterWebAppClientExtensionListener() override;
void RegisterDownLoadListener(
std::shared_ptr<NWebDownloadCallback> downloadListener) override;
+ void RegisterReleaseSurfaceListener(
+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) override;
void RegisterNWebHandler(std::shared_ptr<NWebHandler> handler) override;
void RegisterRenderCb(
std::function<void(const char*)> render_update_cb) override;
@@ -94,9 +97,9 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount {
void CreateWebMessagePorts(std::vector<std::string>& ports) override;
void PostWebMessage(std::string& message, std::vector<std::string>& ports, std::string& targetUri) override;
void ClosePort(std::string& port_handle) override;
- void PostPortMessage(std::string& port_handle, std::string& data) override;
+ void PostPortMessage(std::string& port_handle, std::shared_ptr<NWebMessage> data) override;
void SetPortMessageCallback(std::string& port_handle,
- std::shared_ptr<NWebValueCallback<std::string>> callback) override;
+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) override;
HitTestResult GetHitTestResult() const override;
int PageLoadProgress() override;
float Scale() override;
@@ -158,6 +161,13 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount {
void GetImages(std::shared_ptr<NWebValueCallback<bool>> callback) override;
void RemoveCache(bool include_disk_files) override;
std::shared_ptr<NWebHistoryList> GetHistoryList() override;
+ void PageUp(bool top) override;
+ void PageDown(bool bottom) override;
+ void ScrollTo(float x, float y) override;
+ void ScrollBy(float delta_x, float delta_y) override;
+ void SlideScroll(float vx, float vy) override;
+ WebState SerializeWebState() override;
+ bool RestoreWebState(WebState state) override;
public:
int argc_;
@@ -165,7 +175,7 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount {
private:
void RunMessageLoop();
- void InitializeCef(std::string url, void* window);
+ void InitializeCef(std::string url, bool is_enhance_surface, void* window);
const CefRefPtr<CefBrowser> GetBrowser() const;
void RequestVisitedHistory();
void SetVirtualPixelRatio(float ratio);
@@ -193,6 +203,7 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount {
#if defined(REPORT_SYS_EVENT)
uint32_t nweb_id_;
#endif
+ bool is_enhance_surface_ = false;
};
} // namespace OHOS::NWeb
#endif
@@ -24,6 +24,10 @@
#include "ui/events/keycodes/keysym_to_unicode.h"
namespace OHOS::NWeb {
+
+constexpr double MAX_ZOOM_FACTOR = 10.0;
+constexpr double ZOOM_FACTOR = 2.0;
+
// static
std::shared_ptr<NWebEventHandler> NWebEventHandler::Create() {
auto event_handler = std::make_shared<NWebEventHandler>();
@@ -128,7 +132,18 @@ void NWebEventHandler::SendMouseWheelEvent(double x,
mouseEvent.x = x;
mouseEvent.y = y;
mouseEvent.modifiers = input_delegate_.GetModifiers();
- if (browser_ && browser_->GetHost()) {
+ if (!browser_ || !browser_->GetHost()){
+ return;
+ }
+ if ((mouseEvent.modifiers & EVENTFLAG_CONTROL_DOWN) && (deltaY != 0)) {
+ double curFactor = browser_->GetHost()->GetZoomLevel();
+ double tempZoomFactor = deltaY < 0 ? curFactor + ZOOM_FACTOR : curFactor - ZOOM_FACTOR;
+ if (tempZoomFactor > MAX_ZOOM_FACTOR || tempZoomFactor < 0) {
+ LOG(ERROR) << "The mouse wheel event can no longer be zoomed in or out.";
+ return;
+ }
+ browser_->GetHost()->SetZoomLevel(tempZoomFactor);
+ } else {
browser_->GetHost()->SendMouseWheelEvent(
mouseEvent, deltaX * input_delegate_.GetMouseWheelRatio(),
deltaY * input_delegate_.GetMouseWheelRatio());
@@ -43,6 +43,7 @@
#include "nweb_key_event.h"
#include "nweb_preference_delegate.h"
#include "nweb_resource_handler.h"
+#include "nweb_select_popup_menu_callback.h"
#include "nweb_url_resource_error_impl.h"
#include "nweb_url_resource_request_impl.h"
#include "nweb_url_resource_response.h"
@@ -181,10 +182,6 @@ char* CopyCefStringToChar(const CefString& str) {
return result;
}
-void ReleaseNwebReceivedIconUrlInfo(NWebReceivedIconInfo* iconInfo) {
- if (iconInfo->image_url)
- delete[] iconInfo->image_url;
-}
} // namespace
// static
@@ -193,10 +190,11 @@ CefRefPtr<NWebHandlerDelegate> NWebHandlerDelegate::Create(
CefRefPtr<NWebRenderHandler> render_handler,
std::shared_ptr<NWebEventHandler> event_handler,
std::shared_ptr<NWebFindDelegate> find_delegate,
+ bool is_enhance_surface,
void* window) {
CefRefPtr<NWebHandlerDelegate> handler_delegate =
new NWebHandlerDelegate(preference_delegate, render_handler,
- event_handler, find_delegate, window);
+ event_handler, find_delegate, is_enhance_surface, window);
if (handler_delegate == nullptr) {
LOG(ERROR) << "fail to create NWebHandlerDelegate instance";
return nullptr;
@@ -210,17 +208,21 @@ NWebHandlerDelegate::NWebHandlerDelegate(
CefRefPtr<NWebRenderHandler> render_handler,
std::shared_ptr<NWebEventHandler> event_handler,
std::shared_ptr<NWebFindDelegate> find_delegate,
+ bool is_enhance_surface,
void* window)
: preference_delegate_(preference_delegate),
render_handler_(render_handler),
event_handler_(event_handler),
find_delegate_(find_delegate),
- window_(reinterpret_cast<NativeWindow*>(window)) {
+ is_enhance_surface_(is_enhance_surface){
#if defined(REPORT_SYS_EVENT)
access_sum_count_ = 0;
access_success_count_ = 0;
access_fail_count_ = 0;
#endif
+ if (!is_enhance_surface_) {
+ window_ = reinterpret_cast<NativeWindow*>(window);
+ }
}
void NWebHandlerDelegate::OnDestroy() {
@@ -238,12 +240,21 @@ void NWebHandlerDelegate::RegisterDownLoadListener(
download_listener_ = download_listener;
}
+void NWebHandlerDelegate::RegisterReleaseSurfaceListener(
+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) {
+ releaseSurfaceListener_ = releaseSurfaceListener;
+}
+
void NWebHandlerDelegate::RegisterWebAppClientExtensionListener(
std::shared_ptr<NWebAppClientExtensionCallback>
web_app_client_extension_listener) {
web_app_client_extension_listener_ = web_app_client_extension_listener;
}
+void NWebHandlerDelegate::UnRegisterWebAppClientExtensionListener() {
+ web_app_client_extension_listener_ = nullptr;
+}
+
void NWebHandlerDelegate::RegisterNWebHandler(
std::shared_ptr<NWebHandler> handler) {
LOG(INFO) << "RegisterNWebHandler";
@@ -414,11 +425,18 @@ bool NWebHandlerDelegate::DoClose(CefRefPtr<CefBrowser> browser) {
void NWebHandlerDelegate::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
LOG(INFO) << "NWebHandlerDelegate::OnBeforeClose";
CEF_REQUIRE_UI_THREAD();
-
// Destruct window here to ensure that the GPU thread has stopped
// and will not use window again.
- DestoryNativeWindow(window_);
- window_ = nullptr;
+ if (is_enhance_surface_) {
+ if (releaseSurfaceListener_ != nullptr) {
+ LOG(INFO) << "NWebHandlerDelegate:: ReleaseSurface";
+ releaseSurfaceListener_->ReleaseSurface();
+ }
+ } else {
+ DestoryNativeWindow(window_);
+ window_ = nullptr;
+ }
+
// Remove from the list of existing browsers.
BrowserList::iterator bit = browser_list_.begin();
@@ -443,7 +461,7 @@ bool NWebHandlerDelegate::OnPreBeforePopup(CefRefPtr<CefBrowser> browser,
if (nweb_handler_ == nullptr) {
return true;
}
-
+
switch (target_disposition) {
case WOD_NEW_WINDOW:
case WOD_NEW_POPUP: {
@@ -1040,7 +1058,7 @@ void NWebHandlerDelegate::OnLoadingProgressChange(CefRefPtr<CefBrowser> browser,
on_load_start_notified_ = true;
web_app_client_extension_listener_->OnLoadStarted(
browser != nullptr ? browser->ShouldShowLoadingUI() : false,
- web_app_client_extension_listener_->NWebID);
+ web_app_client_extension_listener_->nweb_id);
}
if (new_progress == MAX_LOADING_PROGRESS) {
on_load_start_notified_ = false;
@@ -1113,13 +1131,15 @@ void NWebHandlerDelegate::OnReceivedIconUrl(const CefString& image_url,
return;
}
- NWebReceivedIconInfo iconInfo{
- CopyCefStringToChar(image_url), width, height,
- TransformColorTypeToInt(TransformColorType(color_type)),
- TransformAlphaTypeToInt(TransformAlphaType(alpha_type))};
+ char* c_image_url = CopyCefStringToChar(image_url);
web_app_client_extension_listener_->OnReceivedFaviconUrl(
- iconInfo, web_app_client_extension_listener_->NWebID);
- ReleaseNwebReceivedIconUrlInfo(&iconInfo);
+ c_image_url, width, height,
+ TransformColorTypeToInt(TransformColorType(color_type)),
+ TransformAlphaTypeToInt(TransformAlphaType(alpha_type)),
+ web_app_client_extension_listener_->nweb_id);
+ if (c_image_url) {
+ delete[] c_image_url;
+ }
}
void NWebHandlerDelegate::OnReceivedTouchIconUrl(CefRefPtr<CefBrowser> browser,
@@ -1149,11 +1169,48 @@ bool NWebHandlerDelegate::OnConsoleMessage(CefRefPtr<CefBrowser> browser,
void NWebHandlerDelegate::OnScaleChanged(CefRefPtr<CefBrowser> browser,
float old_page_scale_factor,
float new_page_scale_factor) {
+ if (!render_handler_) {
+ LOG(ERROR) << "render handler is nullptr";
+ return;
+ }
if (nweb_handler_ != nullptr) {
LOG(INFO) << "OnScaleChanged new scale: " << new_page_scale_factor
<< " old scale: " << old_page_scale_factor;
nweb_handler_->OnScaleChanged(old_page_scale_factor, new_page_scale_factor);
}
+ scale_ = new_page_scale_factor;
+}
+
+bool NWebHandlerDelegate::OnCursorChange(CefRefPtr<CefBrowser> browser,
+ CefCursorHandle cursor,
+ cef_cursor_type_t type,
+ const CefCursorInfo& custom_cursor_info) {
+ LOG(DEBUG) << "OnCursorChange type: " << type;
+ if (nweb_handler_ == nullptr) {
+ LOG(ERROR) << "OnCursorChange nweb handler is nullptr";
+ return false;
+ }
+ if (type < 0 || type >= static_cast<int32_t>(CursorType::CT_MAX_VALUE)) {
+ LOG(ERROR) << "OnCursorChange type exception";
+ return false;
+ }
+ NWebCursorInfo info = {0};
+ if (type == CT_CUSTOM && custom_cursor_info.size.width > 0 && custom_cursor_info.size.height > 0) {
+ info.width = custom_cursor_info.size.width;
+ info.height = custom_cursor_info.size.height;
+ info.x = custom_cursor_info.hotspot.x;
+ info.y = custom_cursor_info.hotspot.y;
+ info.scale = custom_cursor_info.image_scale_factor;
+ uint64_t len = info.width * info.height * 4;
+ info.buff = std::make_unique<uint8_t[]>(len);
+ if (!info.buff) {
+ LOG(ERROR) << "OnCursorChange make_unique failed";
+ return false;
+ }
+ memcpy((char *)info.buff.get(), custom_cursor_info.buffer, len);
+ }
+ CursorType cursorType(static_cast<CursorType>(type));
+ return nweb_handler_->OnCursorChange(cursorType, info);
}
/* CefDisplayHandler method end */
@@ -1161,6 +1218,7 @@ void NWebHandlerDelegate::OnScaleChanged(CefRefPtr<CefBrowser> browser,
bool NWebHandlerDelegate::OnSetFocus(CefRefPtr<CefBrowser> browser,
FocusSource source) {
if (nweb_handler_ != nullptr) {
+ focusState_ = true;
nweb_handler_->OnFocus();
}
return false;
@@ -1295,6 +1353,54 @@ bool NWebHandlerDelegate::OnFileDialog(
std::make_shared<FileSelectorCallbackImpl>(callback);
return nweb_handler_->OnFileSelectorShow(file_path_callback, param);
}
+
+void NWebHandlerDelegate::OnSelectPopupMenu(
+ CefRefPtr<CefBrowser> browser,
+ const CefRect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<CefSelectPopupItem>& menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection,
+ CefRefPtr<CefSelectPopupCallback> callback) {
+ if (!nweb_handler_ || !render_handler_) {
+ return;
+ }
+ float ratio = render_handler_->GetVirtualPixelRatio();
+ std::shared_ptr<NWebSelectPopupMenuParam> param =
+ std::make_shared<NWebSelectPopupMenuParam>();
+ if (!param) {
+ return;
+ }
+ param->bounds = { bounds.x * ratio, bounds.y * ratio, bounds.width * ratio,
+ bounds.height * ratio};
+ param->itemHeight = item_height;
+ param->itemFontSize = item_font_size;
+ param->selectedItem = selected_item;
+ param->rightAligned = right_aligned;
+ param->allowMultipleSelection = allow_multiple_selection;
+ std::vector<SelectPopupMenuItem> menu_list;
+ for (auto& menu_item : menu_items) {
+ std::string label = CefString(&menu_item.label);
+ SelectPopupMenuItem item = {
+ CefString(&menu_item.label).ToString(),
+ CefString(&menu_item.tool_tip).ToString(),
+ static_cast<SelectPopupMenuItemType>(menu_item.type),
+ menu_item.action,
+ static_cast<TextDirection>(menu_item.text_direction),
+ menu_item.enabled,
+ menu_item.has_text_direction_override,
+ menu_item.checked,
+ };
+ menu_list.push_back(std::move(item));
+ }
+ param->menuItems = std::move(menu_list);
+
+ std::shared_ptr<NWebSelectPopupMenuCallback> popup_callback =
+ std::make_shared<NWebSelectPopupMenuCallbackImpl>(callback);
+ nweb_handler_->OnSelectPopupMenu(param, popup_callback);
+}
/* CefDialogHandler method end */
/* CefContextMenuHandler method begin */
@@ -1374,13 +1480,15 @@ bool NWebHandlerDelegate::RunContextMenu(
CefRefPtr<CefContextMenuParams> params,
CefRefPtr<CefMenuModel> model,
CefRefPtr<CefRunContextMenuCallback> callback) {
- if (nweb_handler_ == nullptr) {
+ if (!nweb_handler_ || !render_handler_) {
return false;
}
std::shared_ptr<NWebContextMenuParams> nweb_param =
- std::make_shared<NWebContextMenuParamsImpl>(params);
+ std::make_shared<NWebContextMenuParamsImpl>(params,
+ render_handler_->GetVirtualPixelRatio());
std::shared_ptr<NWebContextMenuCallback> nweb_callback =
std::make_shared<NWebContextMenuCallbackImpl>(callback);
+
image_cache_src_url_ = params->GetSourceUrl();
if (nweb_handler_->RunContextMenu(nweb_param, nweb_callback)) {
return true;
@@ -1638,4 +1746,12 @@ void NWebHandlerDelegate::SetNWebId(uint32_t nwebId) {
nweb_id_ = nwebId;
}
#endif
+
+bool NWebHandlerDelegate::GetFocusState() {
+ return focusState_;
+}
+
+void NWebHandlerDelegate::SetFocusState(bool focusState) {
+ focusState_ = focusState;
+}
} // namespace OHOS::NWeb
@@ -66,6 +66,7 @@ class NWebHandlerDelegate : public CefClient,
CefRefPtr<NWebRenderHandler> render_handler,
std::shared_ptr<NWebEventHandler> event_handler,
std::shared_ptr<NWebFindDelegate> find_delegate,
+ bool is_enhance_surface,
void* window);
NWebHandlerDelegate(
@@ -73,6 +74,7 @@ class NWebHandlerDelegate : public CefClient,
CefRefPtr<NWebRenderHandler> render_handler,
std::shared_ptr<NWebEventHandler> event_handler,
std::shared_ptr<NWebFindDelegate> find_delegate,
+ bool is_enhance_surface,
void* window);
~NWebHandlerDelegate() = default;
@@ -80,10 +82,13 @@ class NWebHandlerDelegate : public CefClient,
void RegisterDownLoadListener(
std::shared_ptr<NWebDownloadCallback> download_listener);
+ void RegisterReleaseSurfaceListener(
+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener);
void RegisterNWebHandler(std::shared_ptr<NWebHandler> handler);
void RegisterWebAppClientExtensionListener(
std::shared_ptr<NWebAppClientExtensionCallback>
web_app_client_extension_listener);
+ void UnRegisterWebAppClientExtensionListener();
void RegisterNWebJavaScriptCallBack(
std::shared_ptr<NWebJavaScriptResultCallBack> callback);
@@ -293,6 +298,10 @@ class NWebHandlerDelegate : public CefClient,
void OnScaleChanged(CefRefPtr<CefBrowser> browser,
float old_page_scale_factor,
float new_page_scale_factor) override;
+ bool OnCursorChange(CefRefPtr<CefBrowser> browser,
+ CefCursorHandle cursor,
+ cef_cursor_type_t type,
+ const CefCursorInfo& custom_cursor_info) override;
/* CefDisplayHandler method end */
/* CefFocusHandler method begin */
@@ -333,6 +342,15 @@ class NWebHandlerDelegate : public CefClient,
int selected_accept_filter,
bool capture,
CefRefPtr<CefFileDialogCallback> callback) override;
+ void OnSelectPopupMenu(CefRefPtr<CefBrowser> browser,
+ const CefRect& bounds,
+ int item_height,
+ double item_font_size,
+ int selected_item,
+ const std::vector<CefSelectPopupItem>& menu_items,
+ bool right_aligned,
+ bool allow_multiple_selection,
+ CefRefPtr<CefSelectPopupCallback> callback) override;
/* CefDialogHandler method end */
/* CefContextMenuHandler method begin */
@@ -400,7 +418,10 @@ class NWebHandlerDelegate : public CefClient,
ImageColorType color_type, ImageAlphaType alpha_type);
bool GetFavicon(const void** data, size_t& width, size_t& height,
ImageColorType& colorType, ImageAlphaType& alphaType);
+ float GetScale() const { return scale_; }
+ bool GetFocusState();
+ void SetFocusState(bool focusState);
private:
void CopyImageToClipboard(CefRefPtr<CefImage> image);
// List of existing browser windows. Only accessed on the CEF UI thread.
@@ -419,6 +440,7 @@ class NWebHandlerDelegate : public CefClient,
IMPLEMENT_REFCOUNTING(NWebHandlerDelegate);
std::shared_ptr<NWebDownloadCallback> download_listener_ = nullptr;
+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener_ = nullptr;
std::shared_ptr<NWebHandler> nweb_handler_ = nullptr;
std::shared_ptr<NWebJavaScriptResultCallBack> nweb_javascript_callback_ =
nullptr;
@@ -428,6 +450,7 @@ class NWebHandlerDelegate : public CefClient,
// lifecycle wrapped by ace WebGeolocationOhos
NWebGeolocationCallback* callback_ = nullptr;
+ bool is_enhance_surface_ = false;
NativeWindow* window_ = nullptr;
CefString image_cache_src_url_;
@@ -453,6 +476,9 @@ class NWebHandlerDelegate : public CefClient,
#if defined(OHOS_NWEB_EX)
bool on_load_start_notified_ = false;
#endif // OHOS_NWEB_EX
+
+ float scale_ = 100.0;
+ bool focusState_ = false;
};
} // namespace OHOS::NWeb
@@ -51,9 +51,12 @@ NWebHistoryItemImpl::NWebHistoryItemImpl(CefRefPtr<CefNavigationEntry> entry)
: entry_(entry) {}
std::string NWebHistoryItemImpl::GetHistoryRawUrl() {
- return (entry_ != nullptr && entry_->IsValid())
- ? entry_->GetOriginalURL().ToString()
- : std::string();
+ if (!entry_ || !entry_->IsValid()) {
+ return std::string();
+ }
+ return entry_->GetOriginalURL().ToString().empty()
+ ? entry_->GetDisplayURL().ToString()
+ : entry_->GetOriginalURL().ToString();
}
std::string NWebHistoryItemImpl::GetHistoryTitle() {
@@ -32,6 +32,10 @@
#include "ohos_nweb/src/cef_delegate/nweb_application.h"
namespace OHOS::NWeb {
+
+constexpr int fontMinSize = 1;
+constexpr int fontMaxSize = 72;
+
int ConvertCacheMode(NWebPreference::CacheModeFlag flag) {
switch (flag) {
case NWebPreference::CacheModeFlag::USE_CACHE_ELSE_NETWORK:
@@ -109,7 +113,7 @@ void NWebPreferenceDelegate::ComputeBrowserSettings(
browser_settings.minimum_font_size = FontSizeLowerLimit();
browser_settings.minimum_logical_font_size = LogicalFontSizeLowerLimit();
browser_settings.initialize_at_minimum_page_scale =
- !IsLoadWithOverviewMode() ? STATE_ENABLED : STATE_DISABLED;
+ IsLoadWithOverviewMode() ? STATE_ENABLED : STATE_DISABLED;
str = CefString(DefaultTextEncodingFormat());
cef_string_set(str.c_str(), str.length(),
@@ -132,7 +136,9 @@ void NWebPreferenceDelegate::ComputeBrowserSettings(
//browser_settings.file_access_from_file_urls =
// EnableRawFileAccessFromFileURLs() ? STATE_ENABLED : STATE_DISABLED;
browser_settings.force_dark_mode_enabled =
- DarkModeEnabled() ? STATE_ENABLED : STATE_DISABLED;
+ ForceDarkModeEnabled() ? STATE_ENABLED : STATE_DISABLED;
+ browser_settings.dark_prefer_color_scheme_enabled =
+ DarkSchemeEnabled() ? STATE_ENABLED : STATE_DISABLED;
browser_settings.javascript_can_open_windows_automatically =
IsCreateWindowsByJavaScriptAllowed();
browser_settings.text_size_percent = ZoomingForTextFactor();
@@ -147,6 +153,10 @@ void NWebPreferenceDelegate::ComputeBrowserSettings(
browser_settings.supports_multi_touch_zoom = ZoomingfunctionEnabled();
browser_settings.user_gesture_required = GetMediaPlayGestureAccess();
browser_settings.pinch_smooth_mode = GetPinchSmoothMode();
+ browser_settings.hide_horizontal_scrollbars =
+ !IsHorizontalScrollBarAccess() ? STATE_ENABLED : STATE_DISABLED;
+ browser_settings.hide_vertical_scrollbars =
+ !IsVerticalScrollBarAccess() ? STATE_ENABLED : STATE_DISABLED;
CefRefPtr<CefCommandLine> command_line =
CefCommandLine::GetGlobalCommandLine();
if (command_line->HasSwitch(::switches::kForBrowser)) {
@@ -169,6 +179,16 @@ void NWebPreferenceDelegate::PutMultiWindowAccess(bool flag) {
multiWindow_access_ = flag;
}
+void NWebPreferenceDelegate::PutHorizontalScrollBarAccess(bool flag) {
+ horizontal_scrollBar_access_ = flag;
+ WebPreferencesChanged();
+}
+
+void NWebPreferenceDelegate::PutVerticalScrollBarAccess(bool flag) {
+ vertical_scrollBar_access_ = flag;
+ WebPreferencesChanged();
+}
+
void NWebPreferenceDelegate::PutEnableContentAccess(bool flag) {
content_access_ = flag;
SetBrowserSettingsToNetHelpers();
@@ -176,7 +196,12 @@ void NWebPreferenceDelegate::PutEnableContentAccess(bool flag) {
void NWebPreferenceDelegate::PutEnableRawFileAccess(bool flag) {
raw_file_access_ = flag;
- SetBrowserSettingsToNetHelpers();
+ if (!browser_.get()) {
+ LOG(ERROR) << "browser is null";
+ return;
+ }
+
+ browser_->GetHost()->SetFileAccess(flag);
}
void NWebPreferenceDelegate::PutEnableRawFileAccessFromFileURLs(bool flag) {
@@ -204,11 +229,11 @@ void NWebPreferenceDelegate::PutDatabaseAllowed(bool flag) {
}
void NWebPreferenceDelegate::PutDefaultFixedFontSize(int size) {
- default_fixed_font_size_ = size;
+ default_fixed_font_size_ = std::clamp(size, fontMinSize, fontMaxSize);
WebPreferencesChanged();
}
void NWebPreferenceDelegate::PutDefaultFontSize(int size) {
- default_font_size_ = size;
+ default_font_size_ = std::clamp(size, fontMinSize, fontMaxSize);
WebPreferencesChanged();
}
@@ -233,8 +258,13 @@ void NWebPreferenceDelegate::PutFixedFontFamilyName(std::string font) {
WebPreferencesChanged();
}
-void NWebPreferenceDelegate::PutDarkModeEnabled(int forceDark) {
- dark_mode_enabled_ = forceDark;
+void NWebPreferenceDelegate::PutForceDarkModeEnabled(int forceDark) {
+ force_dark_mode_enabled_ = forceDark;
+ WebPreferencesChanged();
+}
+
+void NWebPreferenceDelegate::PutDarkSchemeEnabled(int darkScheme) {
+ dark_prefer_color_scheme_enabled_ = darkScheme;
WebPreferencesChanged();
}
@@ -254,12 +284,12 @@ void NWebPreferenceDelegate::PutImageLoadingAllowed(bool flag) {
}
void NWebPreferenceDelegate::PutFontSizeLowerLimit(int size) {
- font_size_lower_limit_ = size;
+ font_size_lower_limit_ = std::clamp(size, fontMinSize, fontMaxSize);
WebPreferencesChanged();
}
void NWebPreferenceDelegate::PutLogicalFontSizeLowerLimit(int size) {
- logical_font_size_lower_limit_ = size;
+ logical_font_size_lower_limit_ = std::clamp(size, fontMinSize, fontMaxSize);
WebPreferencesChanged();
}
@@ -328,12 +358,22 @@ void NWebPreferenceDelegate::PutBlockNetwork(bool flag) {
"INTERNET permission";
}
is_network_blocked_ = flag;
- SetBrowserSettingsToNetHelpers();
+ if (!browser_.get()) {
+ LOG(ERROR) << "browser is null";
+ return;
+ }
+
+ browser_->GetHost()->SetBlockNetwork(flag);
}
void NWebPreferenceDelegate::PutCacheMode(CacheModeFlag flag) {
cache_mode_flag_ = flag;
- SetBrowserSettingsToNetHelpers();
+ if (!browser_.get()) {
+ LOG(ERROR) << "browser is null";
+ return;
+ }
+
+ browser_->GetHost()->SetCacheMode(ConvertCacheMode(flag));
}
void NWebPreferenceDelegate::PutWebDebuggingAccess(bool flag) {
@@ -416,8 +456,12 @@ std::string NWebPreferenceDelegate::FixedFontFamilyName() {
return fixed_font_family_name_;
}
-int NWebPreferenceDelegate::DarkModeEnabled() {
- return dark_mode_enabled_;
+int NWebPreferenceDelegate::ForceDarkModeEnabled() {
+ return force_dark_mode_enabled_;
+}
+
+int NWebPreferenceDelegate::DarkSchemeEnabled() {
+ return dark_prefer_color_scheme_enabled_;
}
bool NWebPreferenceDelegate::IsCreateWindowsByJavaScriptAllowed() {
@@ -530,4 +574,12 @@ bool NWebPreferenceDelegate::GetPinchSmoothMode() {
bool NWebPreferenceDelegate::IsMultiWindowAccess() {
return multiWindow_access_;
}
+
+bool NWebPreferenceDelegate::IsHorizontalScrollBarAccess() {
+ return horizontal_scrollBar_access_;
+}
+
+bool NWebPreferenceDelegate::IsVerticalScrollBarAccess() {
+ return vertical_scrollBar_access_;
+}
} // namespace OHOS::NWeb
@@ -45,7 +45,8 @@ class NWebPreferenceDelegate : public NWebPreference {
void PutDomStorageEnabled(bool flag) override;
void PutFantasyFontFamilyName(std::string font) override;
void PutFixedFontFamilyName(std::string font) override;
- void PutDarkModeEnabled(int forceDark) override;
+ void PutForceDarkModeEnabled(int forceDark) override;
+ void PutDarkSchemeEnabled(int darkScheme) override;
void PutIsCreateWindowsByJavaScriptAllowed(bool flag) override;
void PutJavaScriptEnabled(bool flag) override;
void PutImageLoadingAllowed(bool flag) override;
@@ -66,7 +67,8 @@ class NWebPreferenceDelegate : public NWebPreference {
void PutMediaPlayGestureAccess(bool flag) override;
void PutPinchSmoothMode(bool flag) override;
void PutMultiWindowAccess(bool flag) override;
-
+ void PutHorizontalScrollBarAccess(bool flag) override;
+ void PutVerticalScrollBarAccess(bool flag) override;
/* get methods*/
bool EnableContentAccess() override;
bool EnableRawFileAccess() override;
@@ -82,7 +84,8 @@ class NWebPreferenceDelegate : public NWebPreference {
bool IsDomStorageEnabled() override;
std::string FantasyFontFamilyName() override;
std::string FixedFontFamilyName() override;
- int DarkModeEnabled() override;
+ int ForceDarkModeEnabled() override;
+ int DarkSchemeEnabled() override;
bool IsCreateWindowsByJavaScriptAllowed() override;
bool IsJavaScriptAllowed() override;
bool IsImageLoadingAllowed() override;
@@ -102,6 +105,8 @@ class NWebPreferenceDelegate : public NWebPreference {
bool IsWebDebuggingAccess() override;
bool GetMediaPlayGestureAccess() override;
bool IsMultiWindowAccess() override;
+ bool IsHorizontalScrollBarAccess() override;
+ bool IsVerticalScrollBarAccess() override;
bool RunningInsecureContentAllowed();
bool UseStricMixedContentCheckingAllowed();
@@ -134,10 +139,13 @@ class NWebPreferenceDelegate : public NWebPreference {
bool raw_file_access_{false};
bool universal_access_from_file_urls_{false};
bool raw_file_access_from_file_urls_{false};
- bool dark_mode_enabled_{false};
+ bool force_dark_mode_enabled_{false};
+ bool dark_prefer_color_scheme_enabled_{false};
bool is_need_gesture_access_{true};
bool pinch_smooth_mode_{false};
bool multiWindow_access_{false};
+ bool horizontal_scrollBar_access_{true};
+ bool vertical_scrollBar_access_{true};
/* Web preferences end*/
bool create_windows_by_javascript_allowed_{false};
std::string user_agent_{""};
@@ -26,31 +26,25 @@
namespace {
cef_screen_orientation_type_t ConvertOrientationType(
- OHOS::NWeb::OrientationType type) {
+ OHOS::NWeb::OrientationType type,
+ bool default_portrait) {
switch (type) {
-#if defined(DEFAULT_PORTRAIT)
case OHOS::NWeb::OrientationType::UNSPECIFIED:
- return cef_screen_orientation_type_t::PORTRAIT_PRIMARY;
+ return default_portrait
+ ? cef_screen_orientation_type_t::PORTRAIT_PRIMARY
+ : cef_screen_orientation_type_t::LANDSCAPE_PRIMARY;
case OHOS::NWeb::OrientationType::VERTICAL:
return cef_screen_orientation_type_t::PORTRAIT_PRIMARY;
case OHOS::NWeb::OrientationType::HORIZONTAL:
- return cef_screen_orientation_type_t::LANDSCAPE_SECONDARY;
+ return default_portrait
+ ? cef_screen_orientation_type_t::LANDSCAPE_SECONDARY
+ : cef_screen_orientation_type_t::LANDSCAPE_PRIMARY;
case OHOS::NWeb::OrientationType::REVERSE_VERTICAL:
return cef_screen_orientation_type_t::PORTRAIT_SECONDARY;
case OHOS::NWeb::OrientationType::REVERSE_HORIZONTAL:
- return cef_screen_orientation_type_t::LANDSCAPE_PRIMARY;
-#else
- case OHOS::NWeb::OrientationType::UNSPECIFIED:
- return cef_screen_orientation_type_t::LANDSCAPE_PRIMARY;
- case OHOS::NWeb::OrientationType::VERTICAL:
- return cef_screen_orientation_type_t::PORTRAIT_PRIMARY;
- case OHOS::NWeb::OrientationType::HORIZONTAL:
- return cef_screen_orientation_type_t::LANDSCAPE_PRIMARY;
- case OHOS::NWeb::OrientationType::REVERSE_VERTICAL:
- return cef_screen_orientation_type_t::PORTRAIT_SECONDARY;
- case OHOS::NWeb::OrientationType::REVERSE_HORIZONTAL:
- return cef_screen_orientation_type_t::LANDSCAPE_SECONDARY;
-#endif
+ return default_portrait
+ ? cef_screen_orientation_type_t::LANDSCAPE_PRIMARY
+ : cef_screen_orientation_type_t::LANDSCAPE_SECONDARY;
// Now ohos platform don't hava sensor orientation.
// Will be support later.
case OHOS::NWeb::OrientationType::SENSOR:
@@ -62,33 +56,23 @@ cef_screen_orientation_type_t ConvertOrientationType(
}
}
-uint16_t ConvertRotationAngel(OHOS::NWeb::RotationType type) {
+uint16_t ConvertRotationAngel(OHOS::NWeb::RotationType type,
+ bool default_portrait) {
// Notice: 90 and 270 is reverse.
switch (type) {
-#if defined(DEFAULT_PORTRAIT)
case OHOS::NWeb::RotationType::ROTATION_0:
- return 0;
+ return default_portrait ? 0 : 90;
case OHOS::NWeb::RotationType::ROTATION_90:
- return 270;
+ return default_portrait ? 270 : 0;
case OHOS::NWeb::RotationType::ROTATION_180:
- return 180;
+ return default_portrait ? 180 : 270;
case OHOS::NWeb::RotationType::ROTATION_270:
- return 90;
-#else
- case OHOS::NWeb::RotationType::ROTATION_0:
- return 90;
- case OHOS::NWeb::RotationType::ROTATION_90:
- return 0;
- case OHOS::NWeb::RotationType::ROTATION_180:
- return 270;
- case OHOS::NWeb::RotationType::ROTATION_270:
- return 180;
-#endif
+ return default_portrait ? 90 : 180;
default:
return 0;
}
}
-}
+} // namespace
namespace OHOS::NWeb {
// static
@@ -125,29 +109,41 @@ void NWebRenderHandler::GetViewRect(CefRefPtr<CefBrowser> browser,
CefRect& rect) {
rect.x = 0;
rect.y = 0;
- rect.width = width_;
- rect.height = height_;
- return;
+ if (screen_info_.display_ratio <= 0) {
+ rect.width = width_;
+ rect.height = height_;
+ } else {
+ rect.width = width_ / screen_info_.display_ratio;
+ rect.height = height_ / screen_info_.display_ratio;
+ }
+
+ if (rect.width <= 0) {
+ rect.width = 1;
+ }
+ if (rect.height <= 0) {
+ rect.height = 1;
+ }
}
-void NWebRenderHandler::SetScreenInfo(RotationType rotation,
- OrientationType orientation,
- int width,
- int height,
- double display_ratio) {
- rotation_ = rotation;
- orientation_ = orientation;
- screen_width_ = width;
- screen_height_ = height;
- display_ratio_ = display_ratio;
+void NWebRenderHandler::SetScreenInfo(const NWebScreenInfo& screen_info) {
+ screen_info_ = screen_info;
}
bool NWebRenderHandler::GetScreenInfo(CefRefPtr<CefBrowser> browser,
CefScreenInfo& screen_info) {
- screen_info.orientation = ConvertOrientationType(orientation_);
- screen_info.angle = ConvertRotationAngel(rotation_);
- screen_info.rect.width = screen_width_;
- screen_info.rect.height = screen_height_;
+ screen_info.orientation = ConvertOrientationType(
+ screen_info_.orientation, screen_info_.default_portrait);
+ screen_info.angle = ConvertRotationAngel(screen_info_.rotation,
+ screen_info_.default_portrait);
+ screen_info.rect.width = screen_info_.width;
+ screen_info.rect.height = screen_info_.height;
+ screen_info.device_scale_factor = screen_info_.display_ratio;
+
+ // TODO: currently display dont have interface to get. We use fix value
+ // instead.
+ screen_info.depth = 24;
+ screen_info.depth_per_component = 8;
+
return true;
}
@@ -186,8 +182,8 @@ void NWebRenderHandler::OnRootLayerChanged(CefRefPtr<CefBrowser> browser,
}
void NWebRenderHandler::OnScrollOffsetChanged(CefRefPtr<CefBrowser> browser,
- double x,
- double y) {
+ double x,
+ double y) {
if (auto handler = handler_.lock()) {
handler->OnScroll(x, y);
}
@@ -215,8 +211,10 @@ void NWebRenderHandler::OnTextSelectionChanged(CefRefPtr<CefBrowser> browser,
void NWebRenderHandler::OnVirtualKeyboardRequested(
CefRefPtr<CefBrowser> browser,
- TextInputMode input_mode, bool show_keyboard) {
- LOG(INFO) << "NWebRenderHandler::OnVirtualKeyboardRequested input_mode = " << input_mode << ", show_keyboard = " << show_keyboard;
+ TextInputMode input_mode,
+ bool show_keyboard) {
+ LOG(INFO) << "NWebRenderHandler::OnVirtualKeyboardRequested input_mode = "
+ << input_mode << ", show_keyboard = " << show_keyboard;
if (inputmethod_client_) {
if (input_mode != CEF_TEXT_INPUT_MODE_NONE) {
@@ -232,26 +230,29 @@ void NWebRenderHandler::GetTouchHandleSize(
cef_horizontal_alignment_t orientation,
CefSize& size) {
// TODO: need to refactor in 3.2.8.1 use arkui refactor.
- size.width = 20;
- size.height = 20;
- if (display_ratio_ <= 0.0) {
- LOG(ERROR) << "invalid display_ratio_, display_ratio_ = " << display_ratio_;
+ size.width = 10;
+ size.height = 10;
+ if (screen_info_.display_ratio <= 0.0) {
+ LOG(ERROR) << "invalid display_ratio_, display_ratio_ = "
+ << screen_info_.display_ratio;
return;
}
- if (display_ratio_ <= 1) {
+ if (screen_info_.display_ratio <= 1) {
return;
- } else if (display_ratio_ > 1 && display_ratio_ < 1.7) {
+ } else if (screen_info_.display_ratio > 1 &&
+ screen_info_.display_ratio < 1.7) {
// rk
- size.width = 30;
- size.height = 30;
- } else if (display_ratio_ >= 1.7 && display_ratio_ < 2.5) {
+ size.width = 30 / screen_info_.display_ratio;
+ size.height = 30 / screen_info_.display_ratio;
+ } else if (screen_info_.display_ratio >= 1.7 &&
+ screen_info_.display_ratio < 2.5) {
// wgr
- size.width = 40;
- size.height = 40;
+ size.width = 40 / screen_info_.display_ratio;
+ size.height = 40 / screen_info_.display_ratio;
} else {
- // wgr
- size.width = 60;
- size.height = 60;
+ // phone
+ size.width = 60 / screen_info_.display_ratio;
+ size.height = 60 / screen_info_.display_ratio;
}
LOG(ERROR) << "GetTouchHandleSize " << size.width << " " << size.height;
}
@@ -260,35 +261,53 @@ std::shared_ptr<NWebTouchHandleState> NWebRenderHandler::GetTouchHandleState(
NWebTouchHandleState::TouchHandleType type) {
switch (type) {
case NWebTouchHandleState::TouchHandleType::INSERT_HANDLE:
- return insert_handle_.enabled ?
- std::make_shared<NWebTouchHandleStateImpl>(insert_handle_) : nullptr;
+ return insert_handle_.enabled
+ ? std::make_shared<NWebTouchHandleStateImpl>(insert_handle_)
+ : nullptr;
case NWebTouchHandleState::TouchHandleType::SELECTION_BEGIN_HANDLE:
- return start_selection_handle_.enabled ?
- std::make_shared<NWebTouchHandleStateImpl>(start_selection_handle_) : nullptr;
+ return start_selection_handle_.enabled
+ ? std::make_shared<NWebTouchHandleStateImpl>(
+ start_selection_handle_)
+ : nullptr;
case NWebTouchHandleState::TouchHandleType::SELECTION_END_HANDLE:
- return end_selection_handle_.enabled ?
- std::make_shared<NWebTouchHandleStateImpl>(end_selection_handle_) : nullptr;
+ return end_selection_handle_.enabled
+ ? std::make_shared<NWebTouchHandleStateImpl>(
+ end_selection_handle_)
+ : nullptr;
default:
return nullptr;
}
}
+CefTouchHandleState NWebRenderHandler::ConvertTouchHandleDisplayRatio(
+ const CefTouchHandleState& touch_handle) {
+ CefTouchHandleState result_touch_handle = touch_handle;
+ if (screen_info_.display_ratio <= 0) {
+ LOG(WARNING) << "virtual display ratio is invalid";
+ return result_touch_handle;
+ }
+ result_touch_handle.edge_height *= screen_info_.display_ratio;
+ result_touch_handle.origin.x *= screen_info_.display_ratio;
+ result_touch_handle.origin.y *= screen_info_.display_ratio;
+ return result_touch_handle;
+}
+
void NWebRenderHandler::OnTouchSelectionChanged(
const CefTouchHandleState& insert_handle,
const CefTouchHandleState& start_selection_handle,
const CefTouchHandleState& end_selection_handle,
bool need_report) {
- insert_handle_ = insert_handle;
- start_selection_handle_ = start_selection_handle;
- end_selection_handle_ = end_selection_handle;
+ insert_handle_ = ConvertTouchHandleDisplayRatio(insert_handle);
+ start_selection_handle_ = ConvertTouchHandleDisplayRatio(start_selection_handle);
+ end_selection_handle_ = ConvertTouchHandleDisplayRatio(end_selection_handle);
if (!need_report) {
return;
}
if (auto handler = handler_.lock()) {
handler->OnTouchSelectionChanged(
- std::make_shared<NWebTouchHandleStateImpl>(insert_handle_),
- std::make_shared<NWebTouchHandleStateImpl>(start_selection_handle_),
- std::make_shared<NWebTouchHandleStateImpl>(end_selection_handle_));
+ std::make_shared<NWebTouchHandleStateImpl>(insert_handle_),
+ std::make_shared<NWebTouchHandleStateImpl>(start_selection_handle_),
+ std::make_shared<NWebTouchHandleStateImpl>(end_selection_handle_));
}
}
@@ -297,7 +316,8 @@ bool NWebRenderHandler::StartDragging(CefRefPtr<CefBrowser> browser,
DragOperationsMask allowed_ops,
int x,
int y) {
- LOG(INFO) << "received start dragging callback, operation = " << allowed_ops << ", x = " << x << ", y = " << y;
+ LOG(INFO) << "received start dragging callback, operation = " << allowed_ops
+ << ", x = " << x << ", y = " << y;
if (!drag_data && !drag_data->HasImage()) {
LOG(ERROR) << "drag data invalid";
return false;
@@ -311,7 +331,8 @@ bool NWebRenderHandler::StartDragging(CefRefPtr<CefBrowser> browser,
int width;
int height;
- auto bitmap = image->GetAsBitmap(1, CEF_COLOR_TYPE_BGRA_8888, CEF_ALPHA_TYPE_OPAQUE, width, height);
+ auto bitmap = image->GetAsBitmap(1, CEF_COLOR_TYPE_BGRA_8888,
+ CEF_ALPHA_TYPE_OPAQUE, width, height);
if (!bitmap) {
LOG(ERROR) << "drag data bitmap invalid";
return false;
@@ -330,7 +351,8 @@ bool NWebRenderHandler::StartDragging(CefRefPtr<CefBrowser> browser,
return false;
}
- LOG(INFO) << "drag image width : " << width << ", height : " << height<< ", buffer size : " << read_size;
+ LOG(INFO) << "drag image width : " << width << ", height : " << height
+ << ", buffer size : " << read_size;
auto handler = handler_.lock();
if (handler == nullptr) {
LOG(ERROR) << "can't get strong ptr with handler";
@@ -21,11 +21,20 @@
#include <vector>
#include "cef/include/cef_render_handler.h"
#include "display_manager_adapter.h"
-#include "nweb_inputmethod_client.h"
#include "nweb_handler.h"
+#include "nweb_inputmethod_client.h"
#include "nweb_touch_handle_state_impl.h"
namespace OHOS::NWeb {
+struct NWebScreenInfo {
+ RotationType rotation = RotationType::ROTATION_0;
+ OrientationType orientation = OrientationType::UNSPECIFIED;
+ int width = 0;
+ int height = 0;
+ double display_ratio = -1.0;
+ bool default_portrait = false;
+};
+
class NWebRenderHandler : public CefRenderHandler {
public:
static CefRefPtr<NWebRenderHandler> Create();
@@ -35,8 +44,7 @@ class NWebRenderHandler : public CefRenderHandler {
void RegisterRenderCb(std::function<void(const char*)> render_update_cb);
void RegisterNWebHandler(std::shared_ptr<NWebHandler> handler);
void Resize(uint32_t width, uint32_t height);
- void SetScreenInfo(RotationType rotation, OrientationType orientation,
- int width, int height, double display_ratio);
+ void SetScreenInfo(const NWebScreenInfo& screen_info);
int ContentHeight();
void SetInputMethodClient(CefRefPtr<NWebInputMethodClient> client);
@@ -51,14 +59,14 @@ class NWebRenderHandler : public CefRenderHandler {
const void* buffer,
int width,
int height) override;
-
+
void OnRootLayerChanged(CefRefPtr<CefBrowser> browser,
int height,
int width) override;
void OnScrollOffsetChanged(CefRefPtr<CefBrowser> browser,
- double x,
- double y) override;
+ double x,
+ double y) override;
virtual void OnImeCompositionRangeChanged(
CefRefPtr<CefBrowser> browser,
@@ -70,15 +78,17 @@ class NWebRenderHandler : public CefRenderHandler {
const CefRange& selected_range) override;
virtual void OnVirtualKeyboardRequested(CefRefPtr<CefBrowser> browser,
- TextInputMode input_mode, bool show_keyboard) override;
+ TextInputMode input_mode,
+ bool show_keyboard) override;
void GetTouchHandleSize(CefRefPtr<CefBrowser> browser,
cef_horizontal_alignment_t orientation,
CefSize& size) override;
- void OnTouchSelectionChanged(const CefTouchHandleState& insert_handle,
- const CefTouchHandleState& start_selection_handle,
- const CefTouchHandleState& end_selection_handle,
- bool need_report) override;
+ void OnTouchSelectionChanged(
+ const CefTouchHandleState& insert_handle,
+ const CefTouchHandleState& start_selection_handle,
+ const CefTouchHandleState& end_selection_handle,
+ bool need_report) override;
bool StartDragging(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDragData> drag_data,
@@ -92,21 +102,22 @@ class NWebRenderHandler : public CefRenderHandler {
CefRefPtr<CefDragData> GetDragData();
+ float GetVirtualPixelRatio() const { return screen_info_.display_ratio; }
+
// Include the default reference counting implementation.
IMPLEMENT_REFCOUNTING(NWebRenderHandler);
private:
+ CefTouchHandleState ConvertTouchHandleDisplayRatio(
+ const CefTouchHandleState& touch_handle);
+
std::function<void(const char*)> render_update_cb_ = nullptr;
CefRefPtr<NWebInputMethodClient> inputmethod_client_ = nullptr;
uint32_t width_ = 0;
uint32_t height_ = 0;
- RotationType rotation_ = RotationType::ROTATION_0;
- OrientationType orientation_ = OrientationType::UNSPECIFIED;
int content_height_ = 0;
int content_width_ = 0;
- double display_ratio_ = -1.0;
- uint32_t screen_width_ = 0;
- uint32_t screen_height_ = 0;
+ NWebScreenInfo screen_info_;
std::weak_ptr<NWebHandler> handler_;
CefTouchHandleState insert_handle_;
@@ -114,6 +125,6 @@ class NWebRenderHandler : public CefRenderHandler {
CefTouchHandleState end_selection_handle_;
CefRefPtr<CefDragData> drag_data_ = nullptr;
};
-}
+} // namespace OHOS::NWeb
#endif // NWEB_RENDER_HANDLER_H
new file mode 100644
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "nweb_select_popup_menu_callback.h"
+
+namespace OHOS::NWeb {
+NWebSelectPopupMenuCallbackImpl::NWebSelectPopupMenuCallbackImpl(
+ CefRefPtr<CefSelectPopupCallback> callback)
+ : callback_(callback) {}
+
+void NWebSelectPopupMenuCallbackImpl::Continue(
+ const std::vector<int32_t>& indices) {
+ if (callback_) {
+ callback_->Continue(indices);
+ }
+}
+
+void NWebSelectPopupMenuCallbackImpl::Cancel() {
+ if (callback_) {
+ callback_->Cancel();
+ }
+}
+} // namespace OHOS::NWeb
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef NWEB_SELECT_POPUP_MENU_CALLBACK_H
+#define NWEB_SELECT_POPUP_MENU_CALLBACK_H
+
+#include "cef/include/cef_dialog_handler.h"
+#include "nweb_select_popup_menu.h"
+
+namespace OHOS::NWeb {
+class NWebSelectPopupMenuCallbackImpl : public NWebSelectPopupMenuCallback {
+ public:
+ NWebSelectPopupMenuCallbackImpl() = default;
+ explicit NWebSelectPopupMenuCallbackImpl(
+ CefRefPtr<CefSelectPopupCallback> callback);
+ ~NWebSelectPopupMenuCallbackImpl() = default;
+ void Continue(const std::vector<int32_t>& indices) override;
+ void Cancel() override;
+
+ private:
+ CefRefPtr<CefSelectPopupCallback> callback_ = nullptr;
+};
+} // namespace OHOS::NWeb
+#endif
\ No newline at end of file
@@ -48,16 +48,15 @@ void NWebDataBaseImpl::DeleteHttpAuthCredentials() {
void NWebDataBaseImpl::SaveHttpAuthCredentials(const std::string& host, const std::string& realm,
const std::string& username, const char* password) {
if (delegate_ != nullptr) {
- return delegate_->SaveHttpAuthCredentials(host, realm, username, password);
+ delegate_->SaveHttpAuthCredentials(host, realm, username, password);
}
}
-std::vector<std::string> NWebDataBaseImpl::GetHttpAuthCredentials(const std::string& host,
- const std::string& realm) const {
+void NWebDataBaseImpl::GetHttpAuthCredentials(const std::string& host, const std::string& realm,
+ std::string& username, char* password, uint32_t passwordSize) const {
if (delegate_ != nullptr) {
- return delegate_->GetHttpAuthCredentials(host, realm);
+ delegate_->GetHttpAuthCredentials(host, realm, username, password, passwordSize);
}
- return {};
}
bool NWebDataBaseImpl::ExistPermissionByOrigin(const std::string& origin, int type)
@@ -35,8 +35,8 @@ class NWebDataBaseImpl : public NWebDataBase {
void SaveHttpAuthCredentials(const std::string& host, const std::string& realm,
const std::string& username, const char* password) override;
- std::vector<std::string> GetHttpAuthCredentials(const std::string& host,
- const std::string& realm) const override;
+ void GetHttpAuthCredentials(const std::string& host, const std::string& realm,
+ std::string& username, char* password, uint32_t passwordSize) const override;
bool ExistPermissionByOrigin(const std::string& origin, int type) override;
@@ -25,12 +25,13 @@ namespace OHOS::NWeb {
std::shared_ptr<NWebDelegateInterface> NWebDelegateAdapter::CreateNWebDelegate(
int argc,
const char* argv[],
+ bool is_enhance_surface,
void* window) {
#if defined(USE_CEF)
std::shared_ptr<NWebDelegate> delegate =
std::make_shared<NWebDelegate>(argc, argv);
- if (delegate == nullptr || !delegate->Init(window)) {
+ if (delegate == nullptr || !delegate->Init(is_enhance_surface, window)) {
WVLOG_I("FAIL to create nweb delegate instance");
return nullptr;
}
@@ -26,6 +26,7 @@ class OHOS_NWEB_EXPORT NWebDelegateAdapter {
static std::shared_ptr<NWebDelegateInterface> CreateNWebDelegate(
int argc,
const char* argv[],
+ bool is_enhance_surface,
void* window);
};
}
@@ -26,6 +26,7 @@
#include "nweb_find_callback.h"
#include "nweb_handler.h"
#include "nweb_preference.h"
+#include "nweb_web_message.h"
namespace OHOS::NWeb {
enum class DelegateDragAction {
@@ -44,6 +45,8 @@ struct DelegateDragEvent {
DelegateDragAction action;
};
+using WebState = std::shared_ptr<std::vector<uint8_t>>;
+
class NWebDelegateInterface
: public std::enable_shared_from_this<NWebDelegateInterface>{
public:
@@ -53,12 +56,15 @@ class NWebDelegateInterface
virtual void OnDestroy(bool is_close_all) = 0;
virtual void RegisterDownLoadListener(
std::shared_ptr<NWebDownloadCallback> downloadListener) = 0;
+ virtual void RegisterReleaseSurfaceListener(
+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) = 0;
virtual void RegisterNWebHandler(std::shared_ptr<NWebHandler> handler) = 0;
virtual void RegisterRenderCb(
std::function<void(const char*)> render_update_cb) = 0;
virtual void RegisterWebAppClientExtensionListener(
std::shared_ptr<NWebAppClientExtensionCallback>
web_app_client_extension_listener) = 0;
+ virtual void UnRegisterWebAppClientExtensionListener() = 0;
virtual void SetInputMethodClient(
CefRefPtr<NWebInputMethodClient> client) = 0;
@@ -103,9 +109,9 @@ class NWebDelegateInterface
virtual void CreateWebMessagePorts(std::vector<std::string>& ports) = 0;
virtual void PostWebMessage(std::string& message, std::vector<std::string>& ports, std::string& targetUri) = 0;
virtual void ClosePort(std::string& portHandle) = 0;
- virtual void PostPortMessage(std::string& portHandle, std::string& data) = 0;
+ virtual void PostPortMessage(std::string& portHandle, std::shared_ptr<NWebMessage> data) = 0;
virtual void SetPortMessageCallback(std::string& portHandle,
- std::shared_ptr<NWebValueCallback<std::string>> callback) = 0;
+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) = 0;
virtual HitTestResult GetHitTestResult() const = 0;
virtual int PageLoadProgress() = 0;
virtual float Scale() = 0;
@@ -161,6 +167,13 @@ class NWebDelegateInterface
virtual void GetImages(std::shared_ptr<NWebValueCallback<bool>> callback) = 0;
virtual void RemoveCache(bool include_disk_files) = 0;
virtual std::shared_ptr<NWebHistoryList> GetHistoryList() = 0;
+ virtual WebState SerializeWebState() = 0;
+ virtual bool RestoreWebState(WebState state) = 0;
+ virtual void PageUp(bool top) = 0;
+ virtual void PageDown(bool bottom) = 0;
+ virtual void ScrollTo(float x, float y) = 0;
+ virtual void ScrollBy(float delta_x, float delta_y) = 0;
+ virtual void SlideScroll(float vx, float vy) = 0;
};
} // namespace OHOS::NWeb
@@ -19,11 +19,13 @@
#include <cerrno>
#include <iostream>
#include <map>
+#include <memory>
#include <string>
#include <thread>
#include "base/lazy_instance.h"
#include "base/trace_event/common/trace_event_common.h"
+#include "ohos_adapter_helper.h"
#include "nweb_delegate_adapter.h"
#include "nweb_export.h"
#include "nweb_handler.h"
@@ -47,51 +49,32 @@ bool g_browser_service_api_enabled = false;
#endif
}
-using namespace OHOS::NWeb;
-extern "C" OHOS_NWEB_EXPORT NWeb* CreateNWeb(
- const NWebCreateInfo& create_info) {
- static uint32_t current_nweb_id = 0;
- uint32_t nweb_id = ++current_nweb_id;
- TRACE_EVENT1("NWebImpl", "NWebImpl | CreateNWeb", "nweb_id", nweb_id);
- WVLOG_I("creating nweb %{public}u, size %{public}u*%{public}u", nweb_id,
- create_info.width, create_info.height);
- auto nweb = new NWebImpl(nweb_id);
- if (nweb == nullptr) {
- WVLOG_E("fail to create nweb instance");
- return nullptr;
- }
-
- if (!nweb->Init(create_info)) {
- WVLOG_E("fail to init nweb");
- delete nweb;
- return nullptr;
- }
-
- ++g_nweb_count;
-#if defined(REPORT_SYS_EVENT)
- // Report nweb instance count
- if (g_nweb_count > g_nweb_max_count) {
- g_nweb_max_count = g_nweb_count;
- }
- ReportMultiInstanceStats(nweb_id, g_nweb_count, g_nweb_max_count);
-#endif
- return nweb;
-}
-
namespace OHOS::NWeb {
// For NWebEx
-typedef std::unordered_map<int32_t, NWebImpl*> NWebMap;
+typedef std::unordered_map<int32_t, std::weak_ptr<NWebImpl>> NWebMap;
base::LazyInstance<NWebMap>::DestructorAtExit g_nweb_map =
LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<std::vector<std::string>>::DestructorAtExit g_browser_args =
LAZY_INSTANCE_INITIALIZER;
+void NWebImpl::AddNWebToMap(uint32_t id, std::shared_ptr<NWebImpl>& nweb) {
+ if (nweb) {
+ std::weak_ptr<NWebImpl> nweb_weak(nweb);
+ g_nweb_map.Get().emplace(id, nweb_weak);
+ }
+}
+
NWebImpl* NWebImpl::FromID(int32_t nweb_id) {
NWebMap* map = g_nweb_map.Pointer();
- auto it = map->find(nweb_id);
- return it == map->end() ? nullptr : it->second;
+ if (auto it = map->find(nweb_id); it != map->end()) {
+ auto nweb = it->second.lock();
+ if (nweb) {
+ return nweb.get();
+ }
+ }
+ return nullptr;
}
void NWebImpl::InitBrowserServiceApi(std::vector<std::string>& browser_args) {
@@ -107,9 +90,7 @@ bool NWebImpl::GetBrowserServiceApiEnabled() {
return g_browser_service_api_enabled;
}
-NWebImpl::NWebImpl(uint32_t id) : nweb_id_(id) {
- g_nweb_map.Get().emplace(id, this);
-}
+NWebImpl::NWebImpl(uint32_t id) : nweb_id_(id) {}
NWebImpl::~NWebImpl() {
g_nweb_map.Get().erase(nweb_id_);
@@ -173,11 +154,45 @@ void NWebImpl::ProcessInitArgs(const NWebInitArgs& init_args) {
InitWebEngineArgs(init_args);
}
+bool NWebImpl::SetVirtualDeviceRatio() {
+ if (fabs(device_pixel_ratio_) < 1e-15) {
+ auto display_manager_adapter =
+ OHOS::NWeb::OhosAdapterHelper::GetInstance().CreateDisplayMgrAdapter();
+ if (display_manager_adapter == nullptr) {
+ WVLOG_E("display_manager_adapter is nullptr.");
+ return false;
+ }
+ std::shared_ptr<OHOS::NWeb::DisplayAdapter> display =
+ display_manager_adapter->GetDefaultDisplay();
+ if (display == nullptr) {
+ WVLOG_E("display is nullptr.");
+ return false;
+ }
+ device_pixel_ratio_ = display->GetVirtualPixelRatio();
+ if (device_pixel_ratio_ <= 0) {
+ WVLOG_E("invalid ratio.");
+ return false;
+ }
+ WVLOG_I("GetVirtualPixelRatio ratio: %{public}f", device_pixel_ratio_);
+ }
+ return true;
+}
+
+uint32_t NWebImpl::NormalizeVirtualDeviceRatio(uint32_t length) {
+ float ratio = static_cast<int>(length / device_pixel_ratio_)
+ * device_pixel_ratio_;
+ return std::ceil(ratio);
+}
+
bool NWebImpl::InitWebEngine(const NWebCreateInfo& create_info) {
if (output_handler_ == nullptr) {
WVLOG_E("fail to init web engine, NWeb output handler is not ready");
return false;
}
+ if (!SetVirtualDeviceRatio()) {
+ WVLOG_E("fail to set virtual device ratio");
+ return false;
+ }
if (web_engine_args_.empty()) {
WVLOG_E("fail to init web engine args");
return false;
@@ -189,16 +204,22 @@ bool NWebImpl::InitWebEngine(const NWebCreateInfo& create_info) {
for (auto it = web_engine_args_.begin(); i < argc; ++i, ++it) {
argv[i] = it->c_str();
}
-
- void* window =
+ bool is_enhance_surface = create_info.init_args.is_enhance_surface;
+ void* window = nullptr;
+ if (is_enhance_surface) {
+ window = create_info.enhance_surface_info;
+ } else {
+ window =
reinterpret_cast<void*>(output_handler_->GetNativeWindowFromSurface(
create_info.producer_surface));
+ }
+
if (window == nullptr) {
WVLOG_E("fail to init web engine, get native window from surface failed");
delete[] argv;
return false;
}
- nweb_delegate_ = NWebDelegateAdapter::CreateNWebDelegate(argc, argv, window);
+ nweb_delegate_ = NWebDelegateAdapter::CreateNWebDelegate(argc, argv, is_enhance_surface, window);
if (nweb_delegate_ == nullptr) {
WVLOG_E("fail to create nweb delegate of web engine");
delete[] argv;
@@ -214,6 +235,8 @@ bool NWebImpl::InitWebEngine(const NWebCreateInfo& create_info) {
uint32_t width, height;
output_handler_->GetWindowInfo(width, height);
+ width = NormalizeVirtualDeviceRatio(width);
+ height = NormalizeVirtualDeviceRatio(height);
nweb_delegate_->Resize(width, height);
nweb_delegate_->RegisterRenderCb(render_update_cb);
@@ -231,6 +254,7 @@ bool NWebImpl::InitWebEngine(const NWebCreateInfo& create_info) {
void NWebImpl::InitWebEngineArgs(const NWebInitArgs& init_args) {
web_engine_args_.clear();
+ WVLOG_E("===OH=== InitWebEngineArgs 60fps");
auto args = g_browser_args.Get();
for (const std::string& arg : args) {
web_engine_args_.emplace_back(arg);
@@ -245,7 +269,7 @@ void NWebImpl::InitWebEngineArgs(const NWebInitArgs& init_args) {
#ifdef RK3568
web_engine_args_.emplace_back("--off-screen-frame-rate=70");
#else
- web_engine_args_.emplace_back("--off-screen-frame-rate=65");
+ web_engine_args_.emplace_back("--off-screen-frame-rate=60");
#endif
web_engine_args_.emplace_back("--no-unsandboxed-zygote");
web_engine_args_.emplace_back("--no-zygote");
@@ -260,7 +284,10 @@ void NWebImpl::InitWebEngineArgs(const NWebInitArgs& init_args) {
web_engine_args_.emplace_back("--zygote-cmd-prefix=/system/bin/web_render");
web_engine_args_.emplace_back("--remote-debugging-port=9222");
web_engine_args_.emplace_back("--enable-touch-drag-drop");
-
+ if (init_args.is_enhance_surface) {
+ WVLOG_I("is_enhance_surface is true");
+ web_engine_args_.emplace_back("--ohos-enhance-surface");
+ }
for (auto arg : init_args.web_engine_args_to_delete) {
auto it = std::find(web_engine_args_.begin(), web_engine_args_.end(), arg);
if (it != web_engine_args_.end()) {
@@ -287,6 +314,10 @@ void NWebImpl::PutWebAppClientExtensionCallback(
web_app_client_extension_listener);
}
+void NWebImpl::RemoveWebAppClientExtensionCallback() {
+ nweb_delegate_->UnRegisterWebAppClientExtensionListener();
+}
+
void NWebImpl::SetNWebHandler(std::shared_ptr<NWebHandler> client) {
nweb_handle_ = client;
nweb_delegate_->RegisterNWebHandler(client);
@@ -301,6 +332,8 @@ void NWebImpl::Resize(uint32_t width, uint32_t height) {
if (input_handler_ == nullptr || output_handler_ == nullptr) {
return;
}
+ width = NormalizeVirtualDeviceRatio(width);
+ height = NormalizeVirtualDeviceRatio(height);
if (width > kSurfaceMaxWidth || height > kSurfaceMaxHeight) {
return;
}
@@ -560,7 +593,7 @@ void NWebImpl::ClosePort(std::string& portHandle) {
nweb_delegate_->ClosePort(portHandle);
}
-void NWebImpl::PostPortMessage(std::string& portHandle, std::string& data) {
+void NWebImpl::PostPortMessage(std::string& portHandle, std::shared_ptr<NWebMessage> data) {
if (nweb_delegate_ == nullptr) {
WVLOG_E("JSAPI nweb_delegate_ its null");
return;
@@ -569,7 +602,7 @@ void NWebImpl::PostPortMessage(std::string& portHandle, std::string& data) {
}
void NWebImpl::SetPortMessageCallback(std::string& portHandle,
- std::shared_ptr<NWebValueCallback<std::string>> callback) {
+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) {
if (nweb_delegate_ == nullptr) {
WVLOG_E("JSAPI nweb_delegate_ its null");
return;
@@ -818,9 +851,99 @@ std::shared_ptr<NWebHistoryList> NWebImpl::GetHistoryList() {
return nweb_delegate_->GetHistoryList();
}
+
+WebState NWebImpl::SerializeWebState() {
+ if (nweb_delegate_ == nullptr) {
+ return nullptr;
+ }
+ return nweb_delegate_->SerializeWebState();
+}
+
+bool NWebImpl::RestoreWebState(WebState state) {
+ if (nweb_delegate_ == nullptr) {
+ return false;
+ }
+ return nweb_delegate_->RestoreWebState(state);
+}
+
+void NWebImpl::PutReleaseSurfaceCallback(
+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) {
+ nweb_delegate_->RegisterReleaseSurfaceListener(releaseSurfaceListener);
+}
+
+void NWebImpl::PageUp(bool top) {
+ if (nweb_delegate_ == nullptr) {
+ return;
+ }
+ return nweb_delegate_->PageUp(top);
+}
+
+void NWebImpl::PageDown(bool bottom) {
+ if (nweb_delegate_ == nullptr) {
+ return;
+ }
+ return nweb_delegate_->PageDown(bottom);
+}
+
+void NWebImpl::ScrollTo(float x, float y) {
+ if (nweb_delegate_ == nullptr) {
+ return;
+ }
+ return nweb_delegate_->ScrollTo(x, y);
+}
+
+void NWebImpl::ScrollBy(float delta_x, float delta_y) {
+ if (nweb_delegate_ == nullptr) {
+ return;
+ }
+ return nweb_delegate_->ScrollBy(delta_x, delta_y);
+}
+
+void NWebImpl::SlideScroll(float vx, float vy) {
+ if (nweb_delegate_ == nullptr) {
+ return;
+ }
+ return nweb_delegate_->SlideScroll(vx, vy);
+}
+
} // namespace OHOS::NWeb
-extern "C" OHOS_NWEB_EXPORT NWeb* GetNWeb(int32_t nweb_id) {
+
+using namespace OHOS::NWeb;
+extern "C" OHOS_NWEB_EXPORT void CreateNWeb(const NWebCreateInfo& create_info,
+ std::shared_ptr<NWebImpl>& nweb) {
+ static uint32_t current_nweb_id = 0;
+ uint32_t nweb_id = ++current_nweb_id;
+ TRACE_EVENT1("NWebImpl", "NWebImpl | CreateNWeb", "nweb_id", nweb_id);
+ WVLOG_I("creating nweb %{public}u, size %{public}u*%{public}u", nweb_id,
+ create_info.width, create_info.height);
+ WVLOG_I("creating nweb use enhance surface %{public}d",
+ create_info.init_args.is_enhance_surface);
+ nweb = std::make_shared<NWebImpl>(nweb_id);
+ if (nweb == nullptr) {
+ WVLOG_E("fail to create nweb instance");
+ return;
+ }
+
+ if (!nweb->Init(create_info)) {
+ WVLOG_E("fail to init nweb");
+ return;
+ }
+
+ nweb->AddNWebToMap(nweb_id, nweb);
+ ++g_nweb_count;
+#if defined(REPORT_SYS_EVENT)
+ // Report nweb instance count
+ if (g_nweb_count > g_nweb_max_count) {
+ g_nweb_max_count = g_nweb_count;
+ }
+ ReportMultiInstanceStats(nweb_id, g_nweb_count, g_nweb_max_count);
+#endif
+}
+
+extern "C" OHOS_NWEB_EXPORT void GetNWeb(int32_t nweb_id,
+ std::weak_ptr<NWebImpl>& nweb) {
NWebMap* map = OHOS::NWeb::g_nweb_map.Pointer();
- auto it = map->find(nweb_id);
- return it == map->end() ? nullptr : it->second;
+ if (auto it = map->find(nweb_id); it != map->end()) {
+ nweb = it->second;
+ }
}
@@ -76,15 +76,17 @@ class NWebImpl : public NWeb {
const std::shared_ptr<NWebPreference> GetPreference() const override;
void PutDownloadCallback(
std::shared_ptr<NWebDownloadCallback> downloadListener) override;
+ void PutReleaseSurfaceCallback(
+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) override;
void SetNWebHandler(std::shared_ptr<NWebHandler> handler) override;
const std::shared_ptr<NWebHandler> GetNWebHandler() const override;
std::string Title() override;
void CreateWebMessagePorts(std::vector<std::string>& ports) override;
void PostWebMessage(std::string& message, std::vector<std::string>& ports, std::string& targetUri) override;
void ClosePort(std::string& port_handle) override;
- void PostPortMessage(std::string& port_handle, std::string& data) override;
+ void PostPortMessage(std::string& port_handle, std::shared_ptr<NWebMessage> data) override;
void SetPortMessageCallback(std::string& port_handle,
- std::shared_ptr<NWebValueCallback<std::string>> callback) override;
+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) override;
uint32_t GetWebId() const override;
HitTestResult GetHitTestResult() const override;
int PageLoadProgress() override;
@@ -129,7 +131,13 @@ class NWebImpl : public NWeb {
void HasImages(std::shared_ptr<NWebValueCallback<bool>> callback) override;
void RemoveCache(bool include_disk_files) override;
std::shared_ptr<NWebHistoryList> GetHistoryList() override;
-
+ WebState SerializeWebState() override;
+ bool RestoreWebState(WebState state) override;
+ void PageUp(bool top) override;
+ void PageDown(bool bottom) override;
+ void ScrollTo(float x, float y) override;
+ void ScrollBy(float delta_x, float delta_y) override;
+ void SlideScroll(float vx, float vy) override;
// For NWebEx
static NWebImpl* FromID(int32_t nweb_id);
@@ -141,14 +149,18 @@ class NWebImpl : public NWeb {
void PutWebAppClientExtensionCallback(
std::shared_ptr<NWebAppClientExtensionCallback>
web_app_client_extension_listener);
+ void RemoveWebAppClientExtensionCallback();
CefRefPtr<CefClient> GetCefClient() const {
return nweb_delegate_->GetCefClient();
}
+ void AddNWebToMap(uint32_t id, std::shared_ptr<NWebImpl>& nweb);
private:
void ProcessInitArgs(const NWebInitArgs& init_args);
void InitWebEngineArgs(const NWebInitArgs& init_args);
bool InitWebEngine(const NWebCreateInfo& create_info);
+ bool SetVirtualDeviceRatio();
+ uint32_t NormalizeVirtualDeviceRatio(uint32_t length);
private:
uint32_t nweb_id_ = 0;
@@ -159,6 +171,7 @@ class NWebImpl : public NWeb {
std::shared_ptr<NWebDelegateInterface> nweb_delegate_ = nullptr;
std::list<std::string> web_engine_args_;
+ float device_pixel_ratio_ = 0.f;
};
} // namespace OHOS::NWeb
@@ -79,6 +79,10 @@ class OnTextChangedListenerImpl : public OnTextChangedListener {
handler_->MoveCursor(direction);
}
+ void HandleSetSelection(int32_t start, int32_t end) override {};
+ void HandleExtendAction(int32_t action) override {};
+ void HandleSelect(int32_t keyCode, int32_t cursorMoveSkip) override {};
+
private:
NWebInputMethodHandler* handler_;
};
@@ -113,8 +117,14 @@ void NWebInputMethodHandler::Attach(CefRefPtr<CefBrowser> browser,
if (inputmethod_listener_ == nullptr) {
inputmethod_listener_ = new OnTextChangedListenerImpl(this);
}
- InputMethodController::GetInstance()->Attach(inputmethod_listener_,
- show_keyboard);
+
+ if (show_keyboard && isAttached_) {
+ LOG(INFO) << "Attach ShowCurrentInput" ;
+ InputMethodController::GetInstance()->ShowCurrentInput();
+ } else {
+ InputMethodController::GetInstance()->Attach(inputmethod_listener_, show_keyboard);
+ isAttached_ = true;
+ }
}
void NWebInputMethodHandler::ShowTextInput() {
@@ -122,9 +132,13 @@ void NWebInputMethodHandler::ShowTextInput() {
}
void NWebInputMethodHandler::HideTextInput() {
- LOG(INFO) << "NWebInputMethodHandler::HideTextInput " << ime_shown_;
+ if (!isAttached_) {
+ LOG(INFO) << "keyboard is not attach";
+ return;
+ }
InputMethodController::GetInstance()->HideTextInput();
InputMethodController::GetInstance()->Close();
+ isAttached_ = false;
}
void NWebInputMethodHandler::OnTextSelectionChanged(
@@ -141,10 +155,6 @@ void NWebInputMethodHandler::OnTextSelectionChanged(
selected_to_ = selected_range.to;
ime_text_composing_ = false;
composing_text_.clear();
-
- std::lock_guard<std::mutex> lock(textSelectMutex_);
- isTextSelectReady_ = true;
- textSelectCv_.notify_all();
}
void NWebInputMethodHandler::SetIMEStatus(bool status) {
@@ -162,14 +172,6 @@ void NWebInputMethodHandler::InsertText(const std::u16string& text) {
}
if (browser_ != nullptr && browser_->GetHost() != nullptr) {
- std::unique_lock<std::mutex> lock(textSelectMutex_);
- bool isNormal = textSelectCv_.wait_for(
- lock, std::chrono::seconds(1), [this] { return isTextSelectReady_; });
- if (!isNormal) {
- LOG(ERROR) << "InsertText wait_for timeout";
- }
- isTextSelectReady_ = false;
-
CefRefPtr<CefTask> insert_task = new InputMethodTask(base::BindOnce(
&NWebInputMethodHandler::InsertTextHandlerOnUI, this, std::move(text)));
browser_->GetHost()->PostTaskToUIThread(insert_task);
@@ -186,16 +188,6 @@ void NWebInputMethodHandler::DeleteBackward(int32_t length) {
void NWebInputMethodHandler::DeleteForward(int32_t length) {
if (browser_ != nullptr && browser_->GetHost() != nullptr) {
- if (selected_to_ != 0) {
- std::unique_lock<std::mutex> lock(textSelectMutex_);
- bool isNormal = textSelectCv_.wait_for(
- lock, std::chrono::seconds(1), [this] { return isTextSelectReady_; });
- if (!isNormal) {
- LOG(ERROR) << "DeleteForward wait_for timeout";
- }
- isTextSelectReady_ = false;
- }
-
CefRefPtr<CefTask> delete_task = new InputMethodTask(base::BindOnce(
&NWebInputMethodHandler::DeleteForwardHandlerOnUI, this, length));
browser_->GetHost()->PostTaskToUIThread(delete_task);
@@ -217,26 +209,29 @@ void NWebInputMethodHandler::InsertTextHandlerOnUI(const std::u16string& text) {
return;
}
+ CefKeyEvent keyEvent;
+ keyEvent.windows_key_code = ui::VKEY_PROCESSKEY;
+ keyEvent.modifiers = 0;
+ keyEvent.is_system_key = false;
+ keyEvent.type = KEYEVENT_RAWKEYDOWN;
+ browser_->GetHost()->SendKeyEvent(keyEvent);
+
if (!ime_text_composing_) {
ime_text_composing_ = true;
composing_text_.clear();
}
composing_text_.append(text);
+ browser_->GetHost()->ImeCommitText(composing_text_,
+ CefRange(UINT32_MAX, UINT32_MAX), 0);
- std::vector<CefCompositionUnderline> underlines;
- CefRange new_range(0, static_cast<int>(composing_text_.length()));
- cef_composition_underline_t line = {new_range, 0xFF000000, 0, false};
- underlines.push_back(line);
- CefRange replacement_range(selected_from_, selected_to_);
- CefRange selection_range(0, static_cast<int>(composing_text_.length()));
- browser_->GetHost()->ImeSetComposition(CefString(composing_text_), underlines,
- replacement_range, selection_range);
// no selection
- browser_->GetHost()->ImeFinishComposingText(false);
ime_text_composing_ = false;
selected_from_ += static_cast<int>(composing_text_.length());
selected_to_ += static_cast<int>(composing_text_.length());
composing_text_.clear();
+
+ keyEvent.type = KEYEVENT_KEYUP;
+ browser_->GetHost()->SendKeyEvent(keyEvent);
}
void NWebInputMethodHandler::DeleteBackwardHandlerOnUI(int32_t length) {
@@ -58,10 +58,7 @@ class NWebInputMethodHandler : public NWebInputMethodClient {
int selected_to_;
OHOS::sptr<OHOS::MiscServices::OnTextChangedListener> inputmethod_listener_ =
nullptr;
-
- bool isTextSelectReady_ = true;
- std::mutex textSelectMutex_;
- std::condition_variable textSelectCv_;
+ bool isAttached_ = false;
IMPLEMENT_REFCOUNTING(NWebInputMethodHandler);
};
@@ -21,5 +21,6 @@ declare_args() {
# currently depends on PPAPI. It does not make sense to port PPAPI, which is
# being deprecated, to Fuchsia. Once the PDF Viewer no longer uses PPAPI, the
# PDF Viewer should be enabled on Fuchsia, like on other desktop platforms.
- enable_pdf = !is_android && !is_ios && !is_chromecast && !is_fuchsia
+ enable_pdf =
+ !is_android && !is_ios && !is_chromecast && !is_fuchsia && !is_ohos
}
@@ -17,6 +17,10 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/geometry/size.h"
+#if BUILDFLAG(IS_OHOS)
+#include "ppapi/buildflags/buildflags.h"
+#endif
+
using printing::kMicronsPerInch;
using printing::kPointsPerInch;
@@ -24,6 +28,7 @@ namespace chrome_pdf {
namespace {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
// Scales `length_points` to be in inches instead of points.
constexpr float ConvertPointsToInches(int length_points) {
constexpr float kInchesPerPoint = 1.0f / kPointsPerInch;
@@ -72,10 +77,12 @@ bool ShowInches() {
// On error, assume the units are SI.
return U_SUCCESS(error_code) && system == UMS_US;
}
+#endif
} // namespace
std::u16string FormatPageSize(const absl::optional<gfx::Size>& size_points) {
+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS)
if (!size_points.has_value())
return l10n_util::GetStringUTF16(IDS_PDF_PROPERTIES_PAGE_SIZE_VARIABLE);
@@ -93,6 +100,9 @@ std::u16string FormatPageSize(const absl::optional<gfx::Size>& size_points) {
FormatLengthInMillimeters(size_points.value().width()),
FormatLengthInMillimeters(size_points.value().height()),
GetOrientation(size_points.value()));
+#else
+ return u"";
+#endif
}
std::string FormatPdfVersion(PdfVersion version) {
@@ -7,5 +7,6 @@ import("//build/config/chromecast_build.gni")
import("//build/config/features.gni")
declare_args() {
- enable_plugins = !is_android && !is_ios && !is_chromecast && !is_fuchsia
+ enable_plugins =
+ !is_android && !is_ios && !is_chromecast && !is_fuchsia && !is_ohos
}
@@ -15,7 +15,7 @@ declare_args() {
declare_args() {
# Enable printing with print preview.
- enable_print_preview = enable_basic_printing && !is_android
+ enable_print_preview = enable_basic_printing && !is_android && !is_ohos
if (use_fuzzing_engine && (is_linux || is_chromeos)) {
# For fuzzing, just restrict to chromeos and linux.
@@ -29,7 +29,7 @@ declare_args() {
# `enable_print_preview`, do not base this definition upon that. This
# feature could still be appropriate for some build configurations which
# explicitly disable print preview.
- enable_oop_printing = enable_basic_printing && !is_android
+ enable_oop_printing = enable_basic_printing && !is_android && !is_ohos
}
declare_args() {
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/memory/raw_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "base/unguessable_token.h"
#include "media/mojo/mojom/audio_stream_factory.mojom.h"
@@ -44,6 +45,8 @@ class LocalMuter final : public media::mojom::LocalMuter,
void OnMemberJoinedGroup(LoopbackGroupMember* member) final;
void OnMemberLeftGroup(LoopbackGroupMember* member) final;
+ base::WeakPtr<LocalMuter> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
+
private:
// Runs the |all_bindings_lost_callback_| when |bindings_| becomes empty.
void OnBindingLost();
@@ -55,6 +58,8 @@ class LocalMuter final : public media::mojom::LocalMuter,
base::OnceClosure all_bindings_lost_callback_;
SEQUENCE_CHECKER(sequence_checker_);
+
+ base::WeakPtrFactory<LocalMuter> weak_factory_{this};
};
} // namespace audio
@@ -174,8 +174,9 @@ void StreamFactory::BindMuter(
if (it == muters_.end()) {
auto muter_ptr = std::make_unique<LocalMuter>(&coordinator_, group_id);
muter = muter_ptr.get();
- muter->SetAllBindingsLostCallback(base::BindOnce(
- &StreamFactory::DestroyMuter, base::Unretained(this), muter));
+ muter->SetAllBindingsLostCallback(
+ base::BindRepeating(&StreamFactory::DestroyMuter,
+ base::Unretained(this), muter_ptr->GetWeakPtr()));
muters_.emplace_back(std::move(muter_ptr));
} else {
muter = it->get();
@@ -247,9 +248,10 @@ void StreamFactory::DestroyOutputStream(OutputStream* stream) {
DCHECK_EQ(1u, erased);
}
-void StreamFactory::DestroyMuter(LocalMuter* muter) {
+void StreamFactory::DestroyMuter(base::WeakPtr<LocalMuter> muter) {
DCHECK_CALLED_ON_VALID_SEQUENCE(owning_sequence_);
- DCHECK(muter);
+ if (!muter)
+ return;
// Output streams have a task posting before destruction (see the OnError
// function in output_stream.cc). To ensure that stream destruction and
@@ -258,13 +260,10 @@ void StreamFactory::DestroyMuter(LocalMuter* muter) {
// Otherwise, a "destroy all streams, then destroy the muter" sequence may
// result in a brief blip of audio.
auto do_destroy = [](base::WeakPtr<StreamFactory> weak_this,
- LocalMuter* muter) {
- if (weak_this) {
-
- const auto it =
- std::find_if(weak_this->muters_.begin(), weak_this->muters_.end(),
- base::MatchesUniquePtr(muter));
- DCHECK(it != weak_this->muters_.end());
+ base::WeakPtr<LocalMuter> muter) {
+ if (weak_this && muter) {
+ const auto it = base::ranges::find_if(
+ weak_this->muters_, base::MatchesUniquePtr(muter.get()));
weak_this->muters_.erase(it);
}
};
@@ -104,7 +104,7 @@ class StreamFactory final : public media::mojom::AudioStreamFactory {
void DestroyInputStream(InputStream* stream);
void DestroyOutputStream(OutputStream* stream);
- void DestroyMuter(LocalMuter* muter);
+ void DestroyMuter(base::WeakPtr<LocalMuter> muter);
void DestroyLoopbackStream(LoopbackStream* stream);
SEQUENCE_CHECKER(owning_sequence_);
@@ -161,8 +161,7 @@ LocationArbitrator::NewNetworkLocationProvider(
std::unique_ptr<LocationProvider>
LocationArbitrator::NewSystemLocationProvider() {
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || \
- BUILDFLAG(IS_OHOS)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
return nullptr;
#else
return device::NewSystemLocationProvider(main_task_runner_,
@@ -14,7 +14,7 @@
#include "base/memory/singleton.h"
namespace device {
-
+class GeolocationManager;
// LocationProviderOhos
LocationProviderOhos::LocationProviderOhos() {
locator_callback_ = new LocationProviderCallback();
@@ -102,10 +102,15 @@ void LocationProviderOhos::RequestLocationUpdate(bool high_accuracy) {
return;
}
- locator_->EnableAbility(true);
std::unique_ptr<OHOS::Location::RequestConfig> requestConfig =
std::make_unique<OHOS::Location::RequestConfig>();
SetRequestConfig(requestConfig, high_accuracy);
+ if (locator_->GetSwitchState() != 1) {
+ LOG(ERROR) << "geolocation setting is not turned on";
+ locator_callback_->OnErrorReport(
+ LocationProviderCallback::LOCATION_GET_FAILED);
+ return;
+ }
OHOS::sptr<OHOS::Location::ILocatorCallback> locator_call_back =
locator_callback_;
int ret = locator_->StartLocating(requestConfig, locator_call_back, "location.ILocator",
@@ -190,7 +195,9 @@ void LocationProviderCallback::OnErrorReport(const int errorCode) {
}
// static
-std::unique_ptr<LocationProvider> NewSystemLocationProvider() {
+std::unique_ptr<LocationProvider> NewSystemLocationProvider(
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
+ GeolocationManager* geolocation_manager) {
return base::WrapUnique(new LocationProviderOhos);
}
@@ -21,7 +21,7 @@ std::vector<std::string> CorsUnsafeNotForbiddenRequestHeaderNames(
size_t safe_list_value_size = 0;
for (const auto& header : headers) {
- if (!net::HttpUtil::IsSafeHeader(header.key))
+ if (!net::HttpUtil::IsSafeHeader(header.key, header.value))
continue;
const std::string name = base::ToLowerASCII(header.key);
@@ -526,11 +526,11 @@ struct NetworkConditions {
// response received.
mojo_base.mojom.TimeDelta latency;
- // Maximal aggregated download throughput (bytes/sec). 0 disables download
+ // Maximal aggregated download throughput (bytes/sec). <=0 disables download
// throttling.
double download_throughput;
- // Maximal aggregated upload throughput (bytes/sec). 0 disables upload
+ // Maximal aggregated upload throughput (bytes/sec). <=0 disables upload
// throttling.
double upload_throughput;
};
@@ -4,6 +4,8 @@
#include "services/network/throttling/network_conditions.h"
+#include <algorithm>
+
namespace network {
NetworkConditions::NetworkConditions() : NetworkConditions(false) {}
@@ -16,9 +18,9 @@ NetworkConditions::NetworkConditions(bool offline,
double download_throughput,
double upload_throughput)
: offline_(offline),
- latency_(latency),
- download_throughput_(download_throughput),
- upload_throughput_(upload_throughput) {}
+ latency_(std::max(latency, 0.0)),
+ download_throughput_(std::max(download_throughput, 0.0)),
+ upload_throughput_(std::max(upload_throughput, 0.0)) {}
NetworkConditions::~NetworkConditions() {}
@@ -28,6 +28,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkConditions {
bool IsThrottling() const;
bool offline() const { return offline_; }
+
+ // These are 0 if the corresponding throttle is disabled, >0 otherwise.
double latency() const { return latency_; }
double download_throughput() const { return download_throughput_; }
double upload_throughput() const { return upload_throughput_; }
@@ -298,7 +298,7 @@ TEST(ThrottlingControllerTest, DownloadOnly) {
ThrottlingControllerTestHelper helper;
TestCallback* callback = helper.callback();
- helper.SetNetworkState(false, 10000000, 0);
+ helper.SetNetworkState(false, 10000000, -1);
int rv = helper.Start(false);
EXPECT_EQ(rv, net::ERR_IO_PENDING);
helper.FastForwardUntilNoTasksRemain();
@@ -317,7 +317,7 @@ TEST(ThrottlingControllerTest, UploadOnly) {
ThrottlingControllerTestHelper helper;
TestCallback* callback = helper.callback();
- helper.SetNetworkState(false, 0, 1000000);
+ helper.SetNetworkState(false, -2, 1000000);
int rv = helper.Start(true);
EXPECT_EQ(rv, net::OK);
helper.FastForwardUntilNoTasksRemain();
@@ -625,7 +625,7 @@ void WebSocket::AddChannel(
for (const auto& header : additional_headers) {
if (net::HttpUtil::IsValidHeaderName(header->name) &&
net::HttpUtil::IsValidHeaderValue(header->value) &&
- (net::HttpUtil::IsSafeHeader(header->name) ||
+ (net::HttpUtil::IsSafeHeader(header->name, header->value) ||
base::EqualsCaseInsensitiveASCII(
header->name, net::HttpRequestHeaders::kUserAgent) ||
base::EqualsCaseInsensitiveASCII(header->name,
@@ -64,10 +64,9 @@ const base::FilePath::CharType kTemporaryDirectoryPattern[] =
FILE_PATH_LITERAL("DeleteMe*");
#if BUILDFLAG(IS_OHOS)
-const std::u16string baseDatabaseDir =
+static const std::u16string kBaseDatabaseDir =
base::UTF8ToUTF16("/data/storage/el2/base/");
-const std::u16string divisionStr = base::UTF8ToUTF16("/");
-const std::u16string suffixStr = base::UTF8ToUTF16(".db");
+static const std::u16string kSuffixStr = base::UTF8ToUTF16(".db");
#endif
OriginInfo::OriginInfo() : total_size_(0) {}
@@ -340,20 +339,35 @@ base::FilePath DatabaseTracker::GetOriginDirectory(
incognito_origin_directories_[origin_identifier] = origin_directory;
}
}
-
+#if BUILDFLAG(IS_OHOS)
+ return base::FilePath::FromUTF16Unsafe(kBaseDatabaseDir + origin_directory);
+#else
return db_dir_.Append(base::FilePath::FromUTF16Unsafe(origin_directory));
+#endif
}
+#if BUILDFLAG(IS_OHOS)
base::FilePath DatabaseTracker::GetFullDBFilePath(
const std::string& origin_identifier,
- const std::u16string& database_name) {
-#if BUILDFLAG(IS_OHOS)
+ const std::u16string& database_name,
+ bool suffix) {
+ DCHECK(task_runner_->RunsTasksInCurrentSequence());
DCHECK(!origin_identifier.empty());
- std::u16string origin_directory = base::UTF8ToUTF16(origin_identifier);
- std::u16string filename = baseDatabaseDir + origin_directory + divisionStr +
- database_name + suffixStr;
- return base::FilePath::FromUTF16Unsafe(filename);
+ if (!LazyInit())
+ return base::FilePath();
+
+ int64_t id =
+ databases_table_->GetDatabaseID(origin_identifier, database_name);
+ if (id < 0)
+ return base::FilePath();
+
+ return GetOriginDirectory(origin_identifier)
+ .AppendASCII((suffix? base::UTF16ToASCII(database_name + kSuffixStr): base::UTF16ToASCII(database_name)));
+}
#else
+base::FilePath DatabaseTracker::GetFullDBFilePath(
+ const std::string& origin_identifier,
+ const std::u16string& database_name) {
DCHECK(task_runner_->RunsTasksInCurrentSequence());
DCHECK(!origin_identifier.empty());
if (!LazyInit())
@@ -366,8 +380,8 @@ base::FilePath DatabaseTracker::GetFullDBFilePath(
return GetOriginDirectory(origin_identifier)
.AppendASCII(base::NumberToString(id));
-#endif
}
+#endif
bool DatabaseTracker::GetOriginInfo(const std::string& origin_identifier,
OriginInfo* info) {
@@ -655,7 +669,11 @@ DatabaseTracker::CachedOriginInfo* DatabaseTracker::MaybeGetCachedOriginInfo(
origin_info.SetDatabaseSize(db.database_name, db_file_size);
base::FilePath path =
+ #if BUILDFLAG(IS_OHOS)
+ GetFullDBFilePath(origin_identifier, db.database_name, true);
+ #else
GetFullDBFilePath(origin_identifier, db.database_name);
+ #endif
base::File::Info file_info;
// TODO(jsbell): Avoid duplicate base::GetFileInfo calls between this and
// the GetDBFileSize() call above.
@@ -672,7 +690,11 @@ int64_t DatabaseTracker::GetDBFileSize(const std::string& origin_identifier,
const std::u16string& database_name) {
DCHECK(task_runner_->RunsTasksInCurrentSequence());
base::FilePath db_file_name =
+ #if BUILDFLAG(IS_OHOS)
+ GetFullDBFilePath(origin_identifier, database_name, true);
+ #else
GetFullDBFilePath(origin_identifier, database_name);
+ #endif
int64_t db_file_size = 0;
if (!base::GetFileSize(db_file_name, &db_file_size))
db_file_size = 0;
@@ -797,7 +819,11 @@ void DatabaseTracker::DeleteDataModifiedSince(
rv = net::ERR_FAILED;
}
for (const DatabaseDetails& db : details) {
+ #if BUILDFLAG(IS_OHOS)
+ base::FilePath db_file = GetFullDBFilePath(origin, db.database_name, true);
+ #else
base::FilePath db_file = GetFullDBFilePath(origin, db.database_name);
+ #endif
base::File::Info file_info;
base::GetFileInfo(db_file, &file_info);
if (file_info.last_modified < cutoff)
@@ -138,9 +138,14 @@ class COMPONENT_EXPORT(STORAGE_BROWSER) DatabaseTracker
// Thread-safe getter.
const base::FilePath& database_directory() const { return db_dir_; }
-
+#if BUILDFLAG(IS_OHOS)
+ base::FilePath GetFullDBFilePath(const std::string& origin_identifier,
+ const std::u16string& database_name,
+ bool suffix = false);
+#else
base::FilePath GetFullDBFilePath(const std::string& origin_identifier,
const std::u16string& database_name);
+#endif
// virtual for unit-testing only
virtual bool GetOriginInfo(const std::string& origin_id, OriginInfo* info);
@@ -39,6 +39,41 @@ bool DatabaseUtil::CrackVfsFileName(const std::u16string& vfs_file_name,
// 'vfs_file_name' is of the form <origin_identifier>/<db_name>#<suffix>.
// <suffix> is optional.
DCHECK(!vfs_file_name.empty());
+#if BUILDFLAG(IS_OHOS)
+ size_t first_slash_index = vfs_file_name.rfind('/');
+ if (first_slash_index == std::u16string::npos) {
+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName not find /";
+ return false;
+ }
+ std::u16string dbnameAndSuffix = vfs_file_name.substr(
+ first_slash_index + 1, vfs_file_name.length() - first_slash_index - 1);
+ size_t last_pound_index = dbnameAndSuffix.rfind('.');
+ if (last_pound_index == std::u16string::npos) {
+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName not find .";
+ return false;
+ }
+ std::u16string suffix = dbnameAndSuffix.substr(last_pound_index, dbnameAndSuffix.length() - last_pound_index);
+ if (!IsSafeSuffix(suffix)) {
+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName IsSafeSuffix failed";
+ return false;
+ }
+ std::u16string path = vfs_file_name.substr(0, first_slash_index);
+ first_slash_index = path.rfind('/');
+ if (first_slash_index == std::u16string::npos) {
+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName not find /";
+ return false;
+ }
+ std::u16string name = dbnameAndSuffix.substr(0, last_pound_index);
+ std::string origin_id = base::UTF16ToASCII(path.substr(first_slash_index + 1, path.length() - first_slash_index - 1));
+ if (!IsValidOriginIdentifier(origin_id)) {
+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName IsValidOriginIdentifier failed";
+ return false;
+ }
+ if (sqlite_suffix) *sqlite_suffix = suffix;
+ if (database_name) *database_name = name;
+ if (origin_identifier) *origin_identifier = origin_id;
+ return true;
+#else
size_t first_slash_index = vfs_file_name.find('/');
size_t last_pound_index = vfs_file_name.rfind('#');
// '/' and '#' must be present in the string. Also, the string cannot start
@@ -71,6 +106,7 @@ bool DatabaseUtil::CrackVfsFileName(const std::u16string& vfs_file_name,
*sqlite_suffix = suffix;
return true;
+#endif
}
base::FilePath DatabaseUtil::GetFullFilePathForVfsFile(
@@ -1295,7 +1295,6 @@ void QuotaManagerImpl::GetStorageKeysForType(blink::mojom::StorageType type,
GetStorageKeysCallback callback) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
EnsureDatabaseOpened();
-
if (db_disabled_) {
std::move(callback).Run(std::set<StorageKey>());
return;
@@ -262,7 +262,7 @@ source_set("common") {
deps += [ "//media" ]
}
- if (is_android || is_win) {
+ if (is_android || is_win || is_ohos) {
sources += [
"font_unique_name_lookup/font_table_matcher.cc",
"font_unique_name_lookup/font_table_persistence.cc",
@@ -64,6 +64,16 @@ UntrustworthyContextMenuParams ContextMenuParamsBuilder::Build(
params.suggested_filename = base::UTF8ToUTF16(data.suggested_filename);
params.input_field_type = data.input_field_type;
params.opened_from_highlight = data.opened_from_highlight;
+#if BUILDFLAG(IS_OHOS)
+ params.source_type = static_cast<ui::MenuSourceType>(data.source_type);
+
+ LOG(DEBUG) << "ContextMenuParamsBuilder::Build [params] "
+ << "is_editable = " << params.is_editable
+ << ", edit_flags = " << params.edit_flags
+ << ", input_field_type = " << params.input_field_type
+ << ", source_type = " << params.source_type
+ << ", media_type = " << params.media_type;
+#endif
for (const auto& suggestion : data.dictionary_suggestions)
params.dictionary_suggestions.push_back(suggestion);
@@ -242,6 +242,11 @@ bool IsFencedFramesMPArchBased() {
blink::features::FencedFramesImplementationType::kMPArch;
}
+bool IsFencedFramesShadowDOMBased() {
+ return blink::features::kFencedFramesImplementationTypeParam.Get() ==
+ blink::features::FencedFramesImplementationType::kShadowDOM;
+}
+
const base::Feature kInitialNavigationEntry{"InitialNavigationEntry",
base::FEATURE_DISABLED_BY_DEFAULT};
@@ -460,7 +465,13 @@ const base::Feature kWebFontsCacheAwareTimeoutAdaption {
// Enabled to block programmatic focus in subframes when not triggered by user
// activation (see htpps://crbug.com/954349).
const base::Feature kBlockingFocusWithoutUserActivation{
- "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT};
+ "BlockingFocusWithoutUserActivation",
+#if defined(OS_OHOS)
+ base::FEATURE_ENABLED_BY_DEFAULT
+#else
+ base::FEATURE_DISABLED_BY_DEFAULT
+#endif
+};
// A server-side switch for the REALTIME_AUDIO thread priority of
// RealtimeAudioWorkletThread object. This can be controlled by a field trial,
@@ -8,17 +8,34 @@
#include "base/containers/buffer_iterator.h"
#include "base/logging.h"
+#if BUILDFLAG(IS_OHOS)
+#include "base/notreached.h"
+#include "mojo/public/cpp/base/big_buffer.h"
+#include "third_party/blink/public/mojom/array_buffer/array_buffer_contents.mojom.h"
+#endif
namespace blink {
namespace {
+// Template helpers for visiting std::variant.
+template <class... Ts>
+struct overloaded : Ts... {
+ using Ts::operator()...;
+};
+template <class... Ts>
+overloaded(Ts...) -> overloaded<Ts...>;
+
const uint32_t kVarIntShift = 7;
const uint32_t kVarIntMask = (1 << kVarIntShift) - 1;
const uint8_t kVersionTag = 0xFF;
const uint8_t kPaddingTag = '\0';
+
+// serialization_tag, see v8/src/objects/value-serializer.cc
const uint8_t kOneByteStringTag = '"';
const uint8_t kTwoByteStringTag = 'c';
+const uint8_t kArrayBuffer = 'B';
+const uint8_t kArrayBufferTransferTag = 't';
const uint32_t kVersion = 10;
@@ -144,5 +161,129 @@ bool DecodeStringMessage(base::span<const uint8_t> encoded_data,
DLOG(WARNING) << "Unexpected tag: " << tag;
return false;
}
+TransferableMessage EncodeWebMessagePayload(const WebMessagePayload& payload) {
+ TransferableMessage message;
+ std::vector<uint8_t> buffer;
+ WriteUint8(kVersionTag, &buffer);
+ WriteUint32(kVersion, &buffer);
+
+ absl::visit(
+ overloaded{
+ [&](const std::u16string& str) {
+ if (ContainsOnlyLatin1(str)) {
+ std::string data_latin1(str.cbegin(), str.cend());
+ WriteUint8(kOneByteStringTag, &buffer);
+ WriteUint32(data_latin1.size(), &buffer);
+ WriteBytes(data_latin1.c_str(), data_latin1.size(), &buffer);
+ } else {
+ size_t num_bytes = str.size() * sizeof(char16_t);
+ if ((buffer.size() + 1 + BytesNeededForUint32(num_bytes)) & 1)
+ WriteUint8(kPaddingTag, &buffer);
+ WriteUint8(kTwoByteStringTag, &buffer);
+ WriteUint32(num_bytes, &buffer);
+ WriteBytes(reinterpret_cast<const char*>(str.data()), num_bytes,
+ &buffer);
+ }
+ },
+ [&](const std::vector<uint8_t>& array_buffer) {
+ WriteUint8(kArrayBufferTransferTag, &buffer);
+ // Write at the first slot.
+ WriteUint32(0, &buffer);
+
+ mojo_base::BigBuffer big_buffer(array_buffer);
+ message.array_buffer_contents_array.push_back(
+ mojom::SerializedArrayBufferContents::New(
+ std::move(big_buffer)));
+ }},
+ payload);
+
+ message.owned_encoded_message = std::move(buffer);
+ message.encoded_message = message.owned_encoded_message;
+
+ return message;
+}
+
+absl::optional<WebMessagePayload> DecodeToWebMessagePayload(
+ const TransferableMessage& message) {
+ base::BufferIterator<const uint8_t> iter(message.encoded_message);
+ uint8_t tag = 0;
+
+ // Discard the outer envelope, including trailer info if applicable.
+ if (!ReadUint8(iter, &tag))
+ return absl::nullopt;
+ if (tag == kVersionTag) {
+ uint32_t version = 0;
+ if (!ReadUint32(iter, &version))
+ return absl::nullopt;
+ static constexpr uint32_t kMinWireFormatVersionWithTrailer = 21;
+ if (version >= kMinWireFormatVersionWithTrailer) {
+ // In these versions, we expect kTrailerOffsetTag (0xFE) followed by an
+ // offset and size.
+ // See details in v8/serialization/serialization_tag.h
+ auto span = iter.Span<uint8_t>(1 + sizeof(uint64_t) + sizeof(uint32_t));
+ if (span.empty() || span[0] != 0xFE) {
+ LOG(ERROR) << "Span is empty or span[0] not correct";
+ return absl::nullopt;
+ }
+ }
+ if (!ReadUint8(iter, &tag)) {
+ return absl::nullopt;
+ }
+ }
+
+ // Discard any leading version and padding tags.
+ while (tag == kVersionTag || tag == kPaddingTag) {
+ uint32_t version;
+ if (tag == kVersionTag && !ReadUint32(iter, &version)) {
+ LOG(ERROR) << "Read tag or version failed, tag:" << (int)tag;
+ return absl::nullopt;
+ }
+ if (!ReadUint8(iter, &tag)) {
+ LOG(ERROR) << "ReadUint8 failed";
+ return absl::nullopt;
+ }
+ }
+ switch (tag) {
+ case kOneByteStringTag: {
+ // Use of unsigned char rather than char here matters, so that Latin-1
+ // characters are zero-extended rather than sign-extended
+ uint32_t num_bytes;
+ if (!ReadUint32(iter, &num_bytes)) {
+ LOG(ERROR) << "ReadUint32 failed";
+ return absl::nullopt;
+ }
+ auto span = iter.Span<unsigned char>(num_bytes / sizeof(unsigned char));
+ std::u16string str(span.begin(), span.end());
+ return span.size_bytes() == num_bytes
+ ? absl::make_optional(WebMessagePayload(std::move(str)))
+ : absl::nullopt;
+ }
+ case kTwoByteStringTag: {
+ uint32_t num_bytes;
+ if (!ReadUint32(iter, &num_bytes)) {
+ LOG(ERROR) << "ReadUint32 failed";
+ return absl::nullopt;
+ }
+ auto span = iter.Span<char16_t>(num_bytes / sizeof(char16_t));
+ std::u16string str(span.begin(), span.end());
+ return span.size_bytes() == num_bytes
+ ? absl::make_optional(WebMessagePayload(std::move(str)))
+ : absl::nullopt;
+ }
+ case kArrayBuffer: {
+ uint32_t num_bytes;
+ if (!ReadUint32(iter, &num_bytes))
+ return absl::nullopt;
+ auto span = iter.Span<uint8_t>(num_bytes);
+ std::vector<uint8_t> array_buf(span.begin(), span.end());
+ return span.size_bytes() == num_bytes
+ ? absl::make_optional(
+ WebMessagePayload(std::move(array_buf)))
+ : absl::nullopt;
+ }
+ }
+ LOG(ERROR) << "Unexpected tag:"<< tag;
+ return absl::nullopt;
+}
} // namespace blink
@@ -4,6 +4,7 @@
#include "third_party/blink/public/common/messaging/web_message_port.h"
+#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "third_party/blink/public/common/messaging/message_port_channel.h"
#include "third_party/blink/public/common/messaging/string_message_codec.h"
@@ -22,6 +23,11 @@ WebMessagePort::Message::~Message() = default;
WebMessagePort::Message::Message(const std::u16string& data) : data(data) {}
+#if BUILDFLAG(IS_OHOS)
+WebMessagePort::Message::Message(std::vector<uint8_t> array_buffer)
+ : array_buffer(std::move(array_buffer)) {}
+#endif
+
WebMessagePort::Message::Message(std::vector<WebMessagePort> ports)
: ports(std::move(ports)) {}
@@ -152,11 +158,12 @@ bool WebMessagePort::PostMessage(Message&& message) {
// Build the message.
// TODO(chrisha): Finally kill off MessagePortChannel, once
// MessagePortDescriptor more thoroughly plays that role.
- blink::TransferableMessage transferable_message;
- transferable_message.owned_encoded_message =
- blink::EncodeStringMessage(message.data);
- transferable_message.encoded_message =
- transferable_message.owned_encoded_message;
+ blink::TransferableMessage transferable_message =
+ blink::EncodeWebMessagePayload(
+ message.array_buffer.size() != 0 ?
+ WebMessagePayload(std::move(message.array_buffer)) :
+ WebMessagePayload(std::move(message.data)));
+
transferable_message.ports =
blink::MessagePortChannel::CreateFromHandles(std::move(ports));
@@ -228,9 +235,20 @@ bool WebMessagePort::Accept(mojo::Message* mojo_message) {
// Decode the string portion of the message.
Message message;
- if (!blink::DecodeStringMessage(transferable_message.encoded_message,
- &message.data)) {
- return false;
+ absl::optional<WebMessagePayload> optional_payload =
+ blink::DecodeToWebMessagePayload(transferable_message);
+ if (!optional_payload) {
+ LOG(ERROR) << "WebMessagePort::Accept DecodeToWebMessagePayload failed";
+ return true;
+ }
+ auto& payload = optional_payload.value();
+ if (auto* str = absl::get_if<std::u16string>(&payload)) {
+ message.data = std::move(*str);
+ } else if (auto* array_buffer = absl::get_if<std::vector<uint8_t>>(&payload)) {
+ message.array_buffer = std::move(*array_buffer);
+ } else {
+ LOG(INFO) << "WebMessagePort::Accept Get string or arraybuffer failed";
+ return true;
}
// Convert raw handles to MessagePorts.
@@ -80,6 +80,10 @@ WebPreferences::WebPreferences()
privileged_webgl_extensions_enabled(false),
webgl_errors_to_console_enabled(true),
hide_scrollbars(false),
+#if BUILDFLAG(IS_OHOS)
+ hide_vertical_scrollbars(false),
+ hide_horizontal_scrollbars(false),
+#endif
accelerated_2d_canvas_enabled(false),
new_canvas_2d_api_enabled(false),
antialiased_2d_canvas_disabled(false),
@@ -127,7 +131,11 @@ WebPreferences::WebPreferences()
#if defined(OS_ANDROID) || BUILDFLAG(IS_OHOS)
viewport_meta_enabled(true),
shrinks_viewport_contents_to_fit(true),
+#if BUILDFLAG(IS_OHOS)
+ viewport_style(mojom::ViewportStyle::kDefault),
+#else
viewport_style(mojom::ViewportStyle::kMobile),
+#endif
always_show_context_menu_on_touch(false),
smooth_scroll_for_find_enabled(true),
main_frame_resizes_are_orientation_changes(true),
@@ -198,8 +206,8 @@ WebPreferences::WebPreferences()
default_minimum_page_scale_factor(1.f),
default_maximum_page_scale_factor(3.f),
#elif BUILDFLAG(IS_OHOS)
- default_minimum_page_scale_factor(2.f),
- default_maximum_page_scale_factor(4.f),
+ default_minimum_page_scale_factor(0.25f),
+ default_maximum_page_scale_factor(2.f),
#else
default_minimum_page_scale_factor(1.f),
default_maximum_page_scale_factor(4.f),
@@ -225,28 +233,6 @@ WebPreferences::WebPreferences()
sans_serif_font_family_map[web_pref::kCommonScript] = u"Arial";
cursive_font_family_map[web_pref::kCommonScript] = u"Script";
fantasy_font_family_map[web_pref::kCommonScript] = u"Impact";
-
-#if BUILDFLAG(IS_OHOS)
- std::unique_ptr<OHOS::NWeb::DisplayManagerAdapter> display_manager_adapter =
- OHOS::NWeb::OhosAdapterHelper::GetInstance().CreateDisplayMgrAdapter();
- if (display_manager_adapter == nullptr) {
- LOG(ERROR) << "display_manager_adapter is nullptr.";
- return;
- }
- std::shared_ptr<OHOS::NWeb::DisplayAdapter> display =
- display_manager_adapter->GetDefaultDisplay();
- if (display == nullptr) {
- LOG(ERROR) << "display is nullptr.";
- return;
- }
- float ratio = display->GetVirtualPixelRatio();
- if (ratio <= 0.0f) {
- LOG(ERROR) << "get virtual pixel ratio error.";
- return;
- }
- default_minimum_page_scale_factor = ratio;
- default_maximum_page_scale_factor = ratio * 2;
-#endif
}
WebPreferences::WebPreferences(const WebPreferences& other) = default;
@@ -94,6 +94,10 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
data.privileged_webgl_extensions_enabled();
out->webgl_errors_to_console_enabled = data.webgl_errors_to_console_enabled();
out->hide_scrollbars = data.hide_scrollbars();
+#if BUILDFLAG(IS_OHOS)
+ out->hide_vertical_scrollbars = data.hide_vertical_scrollbars();
+ out->hide_horizontal_scrollbars = data.hide_horizontal_scrollbars();
+#endif
out->accelerated_2d_canvas_enabled = data.accelerated_2d_canvas_enabled();
out->new_canvas_2d_api_enabled = data.new_canvas_2d_api_enabled();
out->canvas_2d_layers_enabled = data.canvas_2d_layers_enabled();
@@ -300,7 +300,7 @@ source_set("headers") {
public_deps += [ "//media/mojo/mojom" ]
}
- if (is_android || is_win) {
+ if (is_android || is_win || is_ohos) {
sources += [
"font_unique_name_lookup/font_table_matcher.h",
"font_unique_name_lookup/font_table_persistence.h",
@@ -318,7 +318,7 @@ source_set("headers") {
}
}
-if (is_android || is_win) {
+if (is_android || is_win || is_ohos) {
proto_library("font_unique_name_table_proto") {
sources = [ "font_unique_name_lookup/font_unique_name_table.proto" ]
}
@@ -92,6 +92,7 @@ BLINK_COMMON_EXPORT bool IsPrerender2Enabled();
// Fenced Frames:
BLINK_COMMON_EXPORT bool IsFencedFramesEnabled();
BLINK_COMMON_EXPORT bool IsFencedFramesMPArchBased();
+BLINK_COMMON_EXPORT bool IsFencedFramesShadowDOMBased();
// Whether we will create initial NavigationEntry or not on FrameTree creation,
// which also impacts the session history replacement decisions made in the
@@ -8,7 +8,14 @@
#include <string>
#include <vector>
#include "base/containers/span.h"
+#if BUILDFLAG(IS_OHOS)
+#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "third_party/abseil-cpp/absl/types/variant.h"
+#endif
#include "third_party/blink/public/common/common_export.h"
+#if BUILDFLAG(IS_OHOS)
+#include "third_party/blink/public/common/messaging/transferable_message.h"
+#endif
namespace blink {
@@ -29,6 +36,15 @@ BLINK_COMMON_EXPORT bool DecodeStringMessage(
base::span<const uint8_t> encoded_data,
std::u16string* result);
+#if BUILDFLAG(IS_OHOS)
+using WebMessagePayload = absl::variant<std::u16string, std::vector<uint8_t>>;
+BLINK_COMMON_EXPORT TransferableMessage
+EncodeWebMessagePayload(const WebMessagePayload& payload);
+
+BLINK_COMMON_EXPORT absl::optional<WebMessagePayload> DecodeToWebMessagePayload(
+ const TransferableMessage& message);
+#endif
+
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_MESSAGING_STRING_MESSAGE_CODEC_H_
@@ -192,6 +192,11 @@ struct BLINK_COMMON_EXPORT WebMessagePort::Message {
// Creates a message with the given |data|.
explicit Message(const std::u16string& data);
+ #if BUILDFLAG(IS_OHOS)
+ // Creates a message with the given |array_buffer|.
+ explicit Message(std::vector<uint8_t> array_buffer);
+ #endif
+
// Creates a message with the given collection of |ports| to be transferred.
explicit Message(std::vector<WebMessagePort> ports);
@@ -208,6 +213,11 @@ struct BLINK_COMMON_EXPORT WebMessagePort::Message {
// A UTF-16 message.
std::u16string data;
+ #if BUILDFLAG(IS_OHOS)
+ // std::vector<uint8_t>: the ArrayBuffer.
+ std::vector<uint8_t> array_buffer;
+ #endif
+
// Other message ports that are to be transmitted as part of this message.
std::vector<WebMessagePort> ports;
};
@@ -94,6 +94,10 @@ struct BLINK_COMMON_EXPORT WebPreferences {
bool privileged_webgl_extensions_enabled;
bool webgl_errors_to_console_enabled;
bool hide_scrollbars;
+#if BUILDFLAG(IS_OHOS)
+ bool hide_vertical_scrollbars;
+ bool hide_horizontal_scrollbars;
+#endif
bool accelerated_2d_canvas_enabled;
bool canvas_2d_layers_enabled = false;
bool canvas_context_lost_in_background_enabled = false;
@@ -771,6 +771,16 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
return r.pinch_smooth_mode;
}
+#if BUILDFLAG(IS_OHOS)
+ static bool hide_vertical_scrollbars(const blink::web_pref::WebPreferences& r) {
+ return r.hide_vertical_scrollbars;
+ }
+
+ static bool hide_horizontal_scrollbars(const blink::web_pref::WebPreferences& r) {
+ return r.hide_horizontal_scrollbars;
+ }
+#endif
+
static bool Read(blink::mojom::WebPreferencesDataView r,
blink::web_pref::WebPreferences* out);
};
@@ -12,6 +12,7 @@ struct PolicyContainerPolicies {
network.mojom.ReferrerPolicy referrer_policy = network.mojom.ReferrerPolicy.kDefault;
network.mojom.IPAddressSpace ip_address_space = network.mojom.IPAddressSpace.kUnknown;
array<network.mojom.ContentSecurityPolicy> content_security_policies;
+ bool can_navigate_top_without_user_gesture = true;
};
// This interface is implemented in the browser process. It defines methods to
@@ -5,8 +5,10 @@
module blink.mojom;
enum FocusType {
- // Element::focus(), etc.
+ // Catch-all focus type. Includes accessibility-based focusing.
kNone = 0,
+ // element.focus()/element.blur() in JavaScript
+ kScript,
// Sequential navigation with TAB, or Shift + TAB.
kForward,
kBackward,
@@ -425,7 +425,10 @@ interface WidgetInputHandler {
TouchActionOptional? touch_action);
[EnableIf=is_ohos]
- StartFling();
+ TryStartFling();
+
+ [EnableIf=is_ohos]
+ TryFinishFling();
// Sends a non-blocking input event to the render widget. The behaviour
// of this API is the same as DispatchEvent just that there is no callback
@@ -150,6 +150,8 @@ struct WebPreferences {
bool privileged_webgl_extensions_enabled;
bool webgl_errors_to_console_enabled;
bool hide_scrollbars;
+ bool hide_vertical_scrollbars;
+ bool hide_horizontal_scrollbars;
bool accelerated_2d_canvas_enabled;
bool canvas_context_lost_in_background_enabled;
bool new_canvas_2d_api_enabled;
@@ -20,6 +20,7 @@ struct WebPolicyContainerPolicies {
network::mojom::ReferrerPolicy referrer_policy;
network::mojom::IPAddressSpace ip_address_space;
WebVector<WebContentSecurityPolicy> content_security_policies;
+ bool can_navigate_top_without_user_gesture = true;
};
// TODO(antoniosartori): Remove this when CommitNavigation IPC will be handled
@@ -171,6 +171,10 @@ class WebSettings {
virtual void SetMinimumFontSize(int) = 0;
virtual void SetMinimumLogicalFontSize(int) = 0;
virtual void SetHideScrollbars(bool) = 0;
+#if BUILDFLAG(IS_OHOS)
+ virtual void SetVerticalHideScrollbars(bool) = 0;
+ virtual void SetHorizontalHideScrollbars(bool) = 0;
+#endif
virtual void SetPasswordEchoDurationInSeconds(double) = 0;
virtual void SetPasswordEchoEnabled(bool) = 0;
virtual void SetPluginsEnabled(bool) = 0;
@@ -470,6 +470,12 @@ class WebView {
// Returns whether this WebView represents a fenced frame root or not.
virtual bool IsFencedFrameRoot() const = 0;
+#if BUILDFLAG(IS_OHOS)
+ virtual gfx::PointF GetScrollOffset() = 0;
+ virtual float GetScrollBottom() = 0;
+ virtual void SetScrollOffset(const gfx::PointF point) = 0;
+#endif
+
// Misc -------------------------------------------------------------
// Returns the number of live WebView instances in this process.
@@ -2435,6 +2435,7 @@ void StyleEngine::RecalcStyle(StyleRecalcChange change,
const StyleRecalcContext& style_recalc_context) {
DCHECK(GetDocument().documentElement());
HasMatchedCacheScope has_matched_cache_scope(&GetDocument());
+ SkipStyleRecalcScope skip_scope(*this);
Element& root_element = style_recalc_root_.RootElement();
Element* parent = FlatTreeTraversal::ParentElement(root_element);
@@ -2997,4 +2998,17 @@ void StyleEngine::MarkForLayoutTreeChangesAfterDetach() {
parent_for_detached_subtree_ = nullptr;
}
+bool StyleEngine::AllowSkipStyleRecalcForScope() const {
+ if (InContainerQueryStyleRecalc())
+ return true;
+ if (LocalFrameView* view = GetDocument().View()) {
+ // Existing layout roots before starting style recalc may end up being
+ // inside skipped subtrees if we allowed skipping. If we start out with an
+ // empty list, any added ones will be a result of an element style recalc,
+ // which means the will not be inside a skipped subtree.
+ return !view->IsSubtreeLayout();
+ }
+ return true;
+}
+
} // namespace blink
@@ -163,6 +163,20 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>,
base::AutoReset<bool> allow_marking_;
};
+ // Set up the condition for allowing to skip style recalc before starting
+ // RecalcStyle().
+ class SkipStyleRecalcScope {
+ STACK_ALLOCATED();
+
+ public:
+ explicit SkipStyleRecalcScope(StyleEngine& engine)
+ : allow_skip_(&engine.allow_skip_style_recalc_,
+ engine.AllowSkipStyleRecalcForScope()) {}
+
+ private:
+ base::AutoReset<bool> allow_skip_;
+ };
+
explicit StyleEngine(Document&);
~StyleEngine() override;
@@ -323,6 +337,10 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>,
void UpdateStyleRecalcRoot(ContainerNode* ancestor, Node* dirty_node);
void UpdateLayoutTreeRebuildRoot(ContainerNode* ancestor, Node* dirty_node);
+ // Returns true if we can skip style recalc for a size container subtree and
+ // resume it during layout.
+ bool SkipStyleRecalcAllowed() const { return allow_skip_style_recalc_; }
+
CSSFontSelector* GetFontSelector() { return font_selector_; }
void RemoveFontFaceRules(const HeapVector<Member<const StyleRuleFontFace>>&);
@@ -673,6 +691,9 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>,
// container.
void RebuildFieldSetContainer(HTMLFieldSetElement& fieldset);
+ // Initialization value for SkipStyleRecalcScope.
+ bool AllowSkipStyleRecalcForScope() const;
+
Member<Document> document_;
// Tracks the number of currently loading top-level stylesheets. Sheets loaded
@@ -746,6 +767,9 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>,
// AllowMarkStyleDirtyFromRecalcScope.
bool allow_mark_for_reattach_from_rebuild_layout_tree_{false};
+ // Set to true if we are allowed to skip recalc for a size container subtree.
+ bool allow_skip_style_recalc_{false};
+
VisionDeficiency vision_deficiency_{VisionDeficiency::kNoVisionDeficiency};
Member<ReferenceFilterOperation> vision_deficiency_filter_;
@@ -4788,8 +4788,10 @@ bool Document::SetFocusedElement(Element* new_focused_element,
focused_element_ = new_focused_element;
SetSequentialFocusNavigationStartingPoint(focused_element_.Get());
- // Keep track of last focus from user interaction, ignoring focus from code.
- if (params.type != mojom::blink::FocusType::kNone)
+ // Keep track of last focus from user interaction, ignoring focus from code
+ // and other non-user internal interventions.
+ if (params.type != mojom::blink::FocusType::kNone &&
+ params.type != mojom::blink::FocusType::kScript)
last_focus_type_ = params.type;
focused_element_->SetFocused(true, params.type);
@@ -2904,6 +2904,10 @@ bool Element::SkipStyleRecalcForContainer(
const ComputedStyle& style,
const StyleRecalcChange& child_change) {
DCHECK(RuntimeEnabledFeatures::CSSContainerSkipStyleRecalcEnabled());
+
+ if (!GetDocument().GetStyleEngine().SkipStyleRecalcAllowed())
+ return false;
+
if (!child_change.TraversePseudoElements(*this)) {
// If none of the children or pseudo elements need to be traversed for style
// recalc, there is no point in marking the subtree as skipped.
@@ -4391,13 +4395,21 @@ Element* Element::GetFocusableArea() const {
return FocusController::FindFocusableElementInShadowHost(*this);
}
+void Element::focusForBindings(const FocusOptions* options) {
+ focus(FocusParams(SelectionBehaviorOnFocus::kRestore,
+ mojom::blink::FocusType::kScript,
+ /*capabilities=*/nullptr, options,
+ /*gate_on_user_activation=*/true));
+}
+
void Element::focus() {
focus(FocusParams());
}
void Element::focus(const FocusOptions* options) {
focus(FocusParams(SelectionBehaviorOnFocus::kRestore,
- mojom::blink::FocusType::kNone, nullptr, options));
+ mojom::blink::FocusType::kNone, /*capabilities=*/nullptr,
+ options));
}
void Element::focus(const FocusParams& params) {
@@ -4418,6 +4430,37 @@ void Element::focus(const FocusParams& params) {
frame_owner_element->contentDocument()->UnloadStarted())
return;
+ FocusOptions* focus_options = nullptr;
+ if (params.gate_on_user_activation) {
+ LocalFrame& frame = *GetDocument().GetFrame();
+ if (!frame.AllowFocusWithoutUserActivation() &&
+ !LocalFrame::HasTransientUserActivation(&frame)) {
+ return;
+ }
+
+ // Fenced frame focusing should not auto-scroll, since that behavior can
+ // be observed by an embedder.
+ if (frame.IsInFencedFrameTree()) {
+ focus_options = FocusOptions::Create();
+ focus_options->setPreventScroll(true);
+ }
+
+ // Fenced frames should consume user activation when attempting to pull
+ // focus across a fenced boundary into itself.
+ // TODO(crbug.com/848778) Right now the browser can't verify that the
+ // renderer properly consumed user activation. When user activation code is
+ // migrated to the browser, move this logic to the browser as well.
+ if (!frame.AllowFocusWithoutUserActivation() &&
+ frame.IsInFencedFrameTree()) {
+ LocalFrame::ConsumeTransientUserActivation(&frame);
+ }
+ }
+
+ FocusParams params_to_use = FocusParams(
+ params.selection_behavior, params.type, params.source_capabilities,
+ focus_options ? focus_options : params.options,
+ params.gate_on_user_activation);
+
// Ensure we have clean style (including forced display locks).
GetDocument().UpdateStyleAndLayoutTreeForNode(this);
@@ -4428,23 +4471,24 @@ void Element::focus(const FocusParams& params) {
if (Element* new_focus_target = GetFocusableArea()) {
// Unlike the specification, we re-run focus() for new_focus_target
// because we can't change |this| in a member function.
- new_focus_target->focus(FocusParams(SelectionBehaviorOnFocus::kReset,
- mojom::blink::FocusType::kForward,
- nullptr, params.options));
+ new_focus_target->focus(FocusParams(
+ SelectionBehaviorOnFocus::kReset, mojom::blink::FocusType::kForward,
+ /*capabilities=*/nullptr, params_to_use.options));
}
// 2. If new focus target is null, then:
// 2.1. If no fallback target was specified, then return.
return;
}
- // If script called focus(), then the type would be none. This means we are
- // activating because of a script action (kScriptFocus). Otherwise, this is a
- // user activation (kUserFocus).
- ActivateDisplayLockIfNeeded(params.type == mojom::blink::FocusType::kNone
+ // If a script called focus(), then the type would be kScript. This means
+ // we are activating because of a script action (kScriptFocus). Otherwise,
+ // this is a user activation (kUserFocus).
+ ActivateDisplayLockIfNeeded(params_to_use.type ==
+ mojom::blink::FocusType::kScript
? DisplayLockActivationReason::kScriptFocus
: DisplayLockActivationReason::kUserFocus);
if (!GetDocument().GetPage()->GetFocusController().SetFocusedElement(
- this, GetDocument().GetFrame(), params))
+ this, GetDocument().GetFrame(), params_to_use))
return;
if (GetDocument().FocusedElement() == this) {
@@ -4465,15 +4509,16 @@ void Element::focus(const FocusParams& params) {
// Trigger a tooltip to show for the newly focused element only when the
// focus was set resulting from a keyboard action.
//
- // TODO(bebeaudr): To also trigger a tooltip when the |params.type| is
- // kSpatialNavigation, we'll first have to ensure that the fake mouse move
- // event fired by `SpatialNavigationController::DispatchMouseMoveEvent` does
- // not lead to a cursor triggered tooltip update. The only tooltip update
- // that there should be in that case is the one triggered from the spatial
- // navigation keypress. This issue is tracked in https://crbug.com/1206446.
+ // TODO(bebeaudr): To also trigger a tooltip when the |params_to_use.type|
+ // is kSpatialNavigation, we'll first have to ensure that the fake mouse
+ // move event fired by `SpatialNavigationController::DispatchMouseMoveEvent`
+ // does not lead to a cursor triggered tooltip update. The only tooltip
+ // update that there should be in that case is the one triggered from the
+ // spatial navigation keypress. This issue is tracked in
+ // https://crbug.com/1206446.
bool is_focused_from_keypress = false;
- switch (params.type) {
- case mojom::blink::FocusType::kNone:
+ switch (params_to_use.type) {
+ case mojom::blink::FocusType::kScript:
if (GetDocument()
.GetFrame()
->LocalFrameRoot()
@@ -690,6 +690,11 @@ class CORE_EXPORT Element : public ContainerNode, public Animatable {
// delegatesFocus flag.
bool DelegatesFocus() const;
Element* GetFocusableArea() const;
+ // Element focus function called through IDL (i.e. element.focus() in JS)
+ // Delegates to Focus() with focus type set to kScript
+ void focusForBindings(const FocusOptions*);
+ // Element focus function called from outside IDL (user focus,
+ // accessibility, etc...)
virtual void focus(const FocusParams&);
void focus();
void focus(const FocusOptions*);
@@ -359,8 +359,13 @@ inline void EventDispatcher::DispatchEventPostProcess(
// Call default event handlers. While the DOM does have a concept of
// preventing default handling, the detail of which handlers are called is an
// internal implementation detail and not part of the DOM.
+#if BUILDFLAG(IS_OHOS)
+ if ((event_->type() == event_type_names::kClick || !event_->defaultPrevented())
+ && !event_->DefaultHandled() && is_trusted_or_click) {
+#elif
if (!event_->defaultPrevented() && !event_->DefaultHandled() &&
is_trusted_or_click) {
+#endif
// Non-bubbling events call only one default event handler, the one for the
// target.
node_->DefaultEventHandler(*event_);
@@ -17,14 +17,19 @@ struct FocusParams {
public:
FocusParams() : options(FocusOptions::Create()) {}
+ explicit FocusParams(bool gate_on_user_activation)
+ : options(FocusOptions::Create()),
+ gate_on_user_activation(gate_on_user_activation) {}
FocusParams(SelectionBehaviorOnFocus selection,
mojom::blink::FocusType focus_type,
InputDeviceCapabilities* capabilities,
- const FocusOptions* focus_options = FocusOptions::Create())
+ const FocusOptions* focus_options = FocusOptions::Create(),
+ bool gate_on_user_activation = false)
: selection_behavior(selection),
type(focus_type),
source_capabilities(capabilities),
- options(focus_options) {}
+ options(focus_options),
+ gate_on_user_activation(gate_on_user_activation) {}
SelectionBehaviorOnFocus selection_behavior =
SelectionBehaviorOnFocus::kRestore;
@@ -32,6 +37,7 @@ struct FocusParams {
InputDeviceCapabilities* source_capabilities = nullptr;
const FocusOptions* options = nullptr;
bool omit_blur_events = false;
+ bool gate_on_user_activation = false;
};
} // namespace blink
@@ -463,6 +463,16 @@ void WebSettingsImpl::SetHideScrollbars(bool enabled) {
dev_tools_emulator_->SetHideScrollbars(enabled);
}
+#if BUILDFLAG(IS_OHOS)
+void WebSettingsImpl::SetVerticalHideScrollbars(bool enabled) {
+ settings_->SetVerticalHideScrollbars(enabled);
+}
+
+void WebSettingsImpl::SetHorizontalHideScrollbars(bool enabled) {
+ settings_->SetHorizontalHideScrollbars(enabled);
+}
+#endif
+
void WebSettingsImpl::SetMockGestureTapHighlightsEnabled(bool enabled) {
settings_->SetMockGestureTapHighlightsEnabled(enabled);
}
@@ -122,6 +122,10 @@ class CORE_EXPORT WebSettingsImpl final : public WebSettings {
void SetMinimumFontSize(int) override;
void SetMinimumLogicalFontSize(int) override;
void SetHideScrollbars(bool) override;
+#if BUILDFLAG(IS_OHOS)
+ void SetVerticalHideScrollbars(bool) override;
+ void SetHorizontalHideScrollbars(bool) override;
+#endif
void SetPasswordEchoDurationInSeconds(double) override;
void SetPasswordEchoEnabled(bool) override;
void SetPluginsEnabled(bool) override;
@@ -629,7 +629,6 @@ bool WebViewImpl::StartPageScaleAnimation(const gfx::Point& target_position,
// compositing.
DCHECK(MainFrameImpl());
DCHECK(does_composite_);
-
VisualViewport& visual_viewport = GetPage()->GetVisualViewport();
gfx::Point clamped_point = target_position;
if (!use_anchor) {
@@ -1483,6 +1482,11 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
settings->SetHideScrollbars(prefs.hide_scrollbars);
+#if BUILDFLAG(IS_OHOS)
+ settings->SetVerticalHideScrollbars(prefs.hide_vertical_scrollbars);
+ settings->SetHorizontalHideScrollbars(prefs.hide_horizontal_scrollbars);
+#endif
+
// Enable gpu-accelerated 2d canvas if requested on the command line.
RuntimeEnabledFeatures::SetAccelerated2dCanvasEnabled(
prefs.accelerated_2d_canvas_enabled);
@@ -2076,6 +2080,34 @@ void WebViewImpl::SmoothScroll(int target_x,
StartPageScaleAnimation(target_position, false, PageScaleFactor(), duration);
}
+#if BUILDFLAG(IS_OHOS)
+gfx::PointF WebViewImpl::GetScrollOffset() {
+ DCHECK(MainFrameImpl());
+ DCHECK(MainFrameImpl()->GetFrameView());
+ LocalFrameView* view = MainFrameImpl()->GetFrameView();
+ DCHECK(view->GetScrollableArea());
+ ScrollOffset offset = view->GetScrollableArea()->GetScrollOffset();
+ return view->GetScrollableArea()->ScrollOffsetToPosition(offset);
+}
+
+float WebViewImpl::GetScrollBottom() {
+ ScrollableArea* root_viewport =
+ MainFrameImpl()->GetFrame()->View()->GetScrollableArea();
+ if (!root_viewport) {
+ return -1.0;
+ }
+ return root_viewport->MaximumScrollOffset().y();
+}
+
+void WebViewImpl::SetScrollOffset(const gfx::PointF point) {
+ DCHECK(MainFrameImpl());
+ DCHECK(MainFrameImpl()->GetFrameView());
+ LocalFrameView* view = MainFrameImpl()->GetFrameView();
+ DCHECK(view->GetScrollableArea());
+ view->GetScrollableArea()->SetScrollOffset(gfx::Vector2dF(point.OffsetFromOrigin()), mojom::blink::ScrollType::kProgrammatic);
+}
+#endif
+
void WebViewImpl::ComputeScaleAndScrollForEditableElementRects(
const gfx::Rect& element_bounds_in_document,
const gfx::Rect& caret_bounds_in_document,
@@ -591,6 +591,12 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// words, after the frame has painted something.
void DidFirstVisuallyNonEmptyPaint();
+#if BUILDFLAG(IS_OHOS)
+ gfx::PointF GetScrollOffset() override;
+ float GetScrollBottom() override;
+ void SetScrollOffset(const gfx::PointF point) override;
+#endif
+
private:
FRIEND_TEST_ALL_PREFIXES(WebFrameTest, DivScrollIntoEditableTest);
FRIEND_TEST_ALL_PREFIXES(WebFrameTest,
@@ -96,7 +96,7 @@ void Headers::append(const String& name,
}
// "4. Otherwise, if guard is |request| and |name| is a forbidden header
// name, return."
- if (guard_ == kRequestGuard && cors::IsForbiddenHeaderName(name))
+ if (guard_ == kRequestGuard && cors::IsForbiddenRequestHeader(name, value))
return;
// 5. Otherwise, if guard is |request-no-cors|:
if (guard_ == kRequestNoCorsGuard) {
@@ -145,9 +145,9 @@ void Headers::remove(const String& name, ExceptionState& exception_state) {
exception_state.ThrowTypeError("Headers are immutable");
return;
}
- // "3. Otherwise, if guard is |request| and |name| is a forbidden header
- // name, return."
- if (guard_ == kRequestGuard && cors::IsForbiddenHeaderName(name))
+ // "3. Otherwise, if guard is |request| and (|name|, '') is a forbidden
+ // request header, return."
+ if (guard_ == kRequestGuard && cors::IsForbiddenRequestHeader(name, ""))
return;
// "4. Otherwise, if the context object’s guard is |request-no-cors|, |name|
// is not a no-CORS-safelisted request-header name, and |name| is not a
@@ -222,9 +222,9 @@ void Headers::set(const String& name,
exception_state.ThrowTypeError("Headers are immutable");
return;
}
- // "4. Otherwise, if guard is |request| and |name| is a forbidden header
- // name, return."
- if (guard_ == kRequestGuard && cors::IsForbiddenHeaderName(name))
+ // "4. Otherwise, if guard is |request| and (|name|, |value|) is a forbidden
+ // request header, return."
+ if (guard_ == kRequestGuard && cors::IsForbiddenRequestHeader(name, value))
return;
// "5. Otherwise, if guard is |request-no-CORS| and |name|/|value| is not a
// no-CORS-safelisted header, return."
@@ -439,6 +439,18 @@ void DOMWindow::focus(v8::Isolate* isolate) {
if (!page)
return;
+ if (!frame->AllowFocusWithoutUserActivation()) {
+ // Disallow script focus that crosses a fenced frame boundary on a
+ // frame that doesn't have transient user activation. Note: all calls to
+ // DOMWindow::focus come from JavaScript calls in the web platform
+ if (!frame->HasTransientUserActivation())
+ return;
+ // Fenced frames should consume user activation when attempting to pull
+ // focus across a fenced boundary into itself.
+ if (frame->IsInFencedFrameTree())
+ LocalFrame::ConsumeTransientUserActivation(DynamicTo<LocalFrame>(frame));
+ }
+
RecordWindowProxyAccessMetrics(
WebFeature::kWindowProxyCrossOriginAccessFocus,
WebFeature::kWindowProxyCrossOriginAccessFromOtherPageFocus);
@@ -334,10 +334,12 @@ void Frame::RenderFallbackContentWithResourceTiming(
}
bool Frame::IsInFencedFrameTree() const {
- if (!blink::features::IsFencedFramesEnabled())
+ DCHECK(!IsDetached());
+ const auto& ff_impl = GetPage()->FencedFramesImplementationType();
+ if (!ff_impl)
return false;
- switch (blink::features::kFencedFramesImplementationTypeParam.Get()) {
+ switch (ff_impl.value()) {
case blink::features::FencedFramesImplementationType::kMPArch:
return GetPage()->IsMainFrameFencedFrameRoot();
case blink::features::FencedFramesImplementationType::kShadowDOM:
@@ -582,6 +584,38 @@ Frame* Frame::FirstChild(FrameTreeBoundary frame_tree_boundary) const {
return first_child_;
}
+bool Frame::FocusCrossesFencedBoundary() {
+ DCHECK(blink::features::IsFencedFramesShadowDOMBased());
+
+ if (Frame* focused_frame = GetPage()->GetFocusController().FocusedFrame()) {
+ if (!focused_frame->IsInFencedFrameTree() && !IsInFencedFrameTree())
+ return false;
+
+ return Tree().Top(FrameTreeBoundary::kFenced) !=
+ focused_frame->Tree().Top(FrameTreeBoundary::kFenced);
+ }
+
+ return false;
+}
+
+bool Frame::AllowFocusWithoutUserActivation() {
+ const auto& ff_impl = GetPage()->FencedFramesImplementationType();
+ if (!ff_impl)
+ return true;
+
+ switch (ff_impl.value()) {
+ case blink::features::FencedFramesImplementationType::kMPArch:
+ // For a newly-loaded page, no page will have focus. We allow a non-fenced
+ // frame to get the first focus before enforcing if a page already has
+ // focus.
+ return (!GetPage()->GetFocusController().IsActive() &&
+ !IsInFencedFrameTree()) ||
+ GetPage()->GetFocusController().IsFocused();
+ case blink::features::FencedFramesImplementationType::kShadowDOM:
+ return !FocusCrossesFencedBoundary();
+ }
+}
+
bool Frame::Swap(WebFrame* new_web_frame) {
DCHECK(IsAttached());
@@ -192,6 +192,14 @@ class CORE_EXPORT Frame : public GarbageCollected<Frame> {
void SetIsLoading(bool is_loading) { is_loading_ = is_loading; }
bool IsLoading() const { return is_loading_; }
+ // Determines if the frame should be allowed to pull focus without receiving
+ // user activation. A frame cannot pull focus without user activation if
+ // doing so would cross a fenced frame boundary.
+ // Note: the only time focus can be pulled across a fence without the target
+ // frame having user activation is in the case of tab-focusing. In that case,
+ // this function is not called and focus is blanket allowed.
+ bool AllowFocusWithoutUserActivation();
+
// Tells the frame to check whether its load has completed, based on the state
// of its subframes, etc.
virtual void CheckCompleted() = 0;
@@ -456,6 +464,12 @@ class CORE_EXPORT Frame : public GarbageCollected<Frame> {
// null. The child frame's parent must be set in the constructor.
void InsertAfter(Frame* new_child, Frame* previous_sibling);
+ // Returns true if this frame pulling focus will cause focus to traverse
+ // across a fenced frame boundary. This handles checking for focus entering
+ // a fenced frame, as well as focus leaving a fenced frames.
+ // Note: This is only called if fenced frames are enabled with ShadowDOM
+ bool FocusCrossesFencedBoundary();
+
Member<FrameClient> client_;
const Member<WindowProxyManager> window_proxy_manager_;
FrameLifecycle lifecycle_;
@@ -143,9 +143,6 @@
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "ui/display/screen_info.h"
#include "v8/include/v8.h"
-#if BUILDFLAG(IS_OHOS)
-#include "ohos_adapter_helper.h"
-#endif
namespace blink {
namespace {
@@ -1599,35 +1596,10 @@ ScriptPromise LocalDOMWindow::getComputedAccessibleNode(
}
double LocalDOMWindow::devicePixelRatio() const {
-#if BUILDFLAG(IS_OHOS)
- static double ratio = 0;
- if (!ratio) {
- auto display_manager_adapter =
- OHOS::NWeb::OhosAdapterHelper::GetInstance().CreateDisplayMgrAdapter();
- if (display_manager_adapter == nullptr) {
- LOG(ERROR) << "display_manager_adapter is nullptr.";
- return 0.0;
- }
- auto display = display_manager_adapter->GetDefaultDisplay();
- if (display == nullptr) {
- LOG(ERROR) << "display is nullptr.";
- return 0.0;
- }
- ratio = display->GetVirtualPixelRatio();
- if (ratio <= 0) {
- LOG(ERROR) << "invalid ratio, ratio = " << ratio;
- ratio = 0;
- return 0.0;
- }
- }
-
- return ratio;
-#else
if (!GetFrame())
return 0.0;
return GetFrame()->DevicePixelRatio();
-#endif
}
void LocalDOMWindow::scrollBy(double x, double y) const {
@@ -1570,60 +1570,40 @@ static bool CanAccessAncestor(const SecurityOrigin& active_security_origin,
return false;
}
-// `initiating_frame` - The frame that CanNavigate was initially requested for.
-// `source_frame` - The frame that is currently being tested to see if it can
-// navigate `target_frame`.
-// `target_frame` - The frame to be navigated.
-// `destination_url` - The URL to navigate to on `target_frame`.
-static bool CanNavigateHelper(LocalFrame& initiating_frame,
- const Frame& source_frame,
- const Frame& target_frame,
- const KURL& destination_url) {
- // The only time the helper is called with a different `initiating_frame` from
- // its `source_frame` is to recursively check if ancestors can navigate the
- // top frame.
- DCHECK(&initiating_frame == &source_frame ||
- target_frame == initiating_frame.Tree().Top());
-
- // Only report navigation blocking on the initial call to CanNavigateHelper,
- // not the recursive calls.
- bool should_report = &initiating_frame == &source_frame;
-
- if (&target_frame == &source_frame)
+bool LocalFrame::CanNavigate(const Frame& target_frame,
+ const KURL& destination_url) {
+ // https://html.spec.whatwg.org/multipage/browsers.html#allowed-to-navigate
+ // If source is target, then return true.
+ if (&target_frame == this)
return true;
// Navigating window.opener cross origin, without user activation. See
// https://crbug.com/813643.
- if (should_report && source_frame.Opener() == target_frame &&
- !source_frame.HasTransientUserActivation() &&
+ if (Opener() == target_frame && !HasTransientUserActivation(this) &&
!target_frame.GetSecurityContext()->GetSecurityOrigin()->CanAccess(
SecurityOrigin::Create(destination_url).get())) {
- UseCounter::Count(initiating_frame.GetDocument(),
+ UseCounter::Count(GetDocument(),
WebFeature::kOpenerNavigationWithoutGesture);
}
if (destination_url.ProtocolIsJavaScript() &&
- !source_frame.GetSecurityContext()->GetSecurityOrigin()->CanAccess(
+ !GetSecurityContext()->GetSecurityOrigin()->CanAccess(
target_frame.GetSecurityContext()->GetSecurityOrigin())) {
- if (should_report) {
- initiating_frame.PrintNavigationErrorMessage(
- target_frame,
- "The frame attempting navigation must be same-origin with the target "
- "if navigating to a javascript: url");
- }
+ PrintNavigationErrorMessage(
+ target_frame,
+ "The frame attempting navigation must be same-origin with the target "
+ "if navigating to a javascript: url");
return false;
}
- if (source_frame.GetSecurityContext()->IsSandboxed(
+ if (GetSecurityContext()->IsSandboxed(
network::mojom::blink::WebSandboxFlags::kNavigation)) {
- if (!target_frame.Tree().IsDescendantOf(&source_frame) &&
+ if (!target_frame.Tree().IsDescendantOf(this) &&
!target_frame.IsMainFrame()) {
- if (should_report) {
- initiating_frame.PrintNavigationErrorMessage(
- target_frame,
- "The frame attempting navigation is sandboxed, and is therefore "
- "disallowed from navigating its ancestors.");
- }
+ PrintNavigationErrorMessage(
+ target_frame,
+ "The frame attempting navigation is sandboxed, and is therefore "
+ "disallowed from navigating its ancestors.");
return false;
}
@@ -1631,91 +1611,80 @@ static bool CanNavigateHelper(LocalFrame& initiating_frame,
// 'allow-sandbox-escape-via-popup' flag is specified, or if
// 'allow-popups' flag is specified, or if the
if (target_frame.IsMainFrame() &&
- target_frame != source_frame.Tree().Top() &&
- source_frame.GetSecurityContext()->IsSandboxed(
+ target_frame != Tree().Top() &&
+ GetSecurityContext()->IsSandboxed(
network::mojom::blink::WebSandboxFlags::
kPropagatesToAuxiliaryBrowsingContexts) &&
- (source_frame.GetSecurityContext()->IsSandboxed(
+ (GetSecurityContext()->IsSandboxed(
network::mojom::blink::WebSandboxFlags::kPopups) ||
- target_frame.Opener() != &source_frame)) {
- if (should_report) {
- initiating_frame.PrintNavigationErrorMessage(
- target_frame,
- "The frame attempting navigation is sandboxed and is trying "
- "to navigate a popup, but is not the popup's opener and is not "
- "set to propagate sandboxing to popups.");
- }
+ target_frame.Opener() != this)) {
+ PrintNavigationErrorMessage(
+ target_frame,
+ "The frame attempting navigation is sandboxed and is trying "
+ "to navigate a popup, but is not the popup's opener and is not "
+ "set to propagate sandboxing to popups.");
return false;
}
// Top navigation is forbidden in sandboxed frames unless opted-in, and only
// then if the ancestor chain allowed to navigate the top frame.
- if (target_frame == source_frame.Tree().Top()) {
- if (source_frame.GetSecurityContext()->IsSandboxed(
+ if (target_frame == Tree().Top()) {
+ if (GetSecurityContext()->IsSandboxed(
network::mojom::blink::WebSandboxFlags::kTopNavigation) &&
- source_frame.GetSecurityContext()->IsSandboxed(
+ GetSecurityContext()->IsSandboxed(
network::mojom::blink::WebSandboxFlags::
kTopNavigationByUserActivation)) {
- if (should_report) {
- initiating_frame.PrintNavigationErrorMessage(
- target_frame,
- "The frame attempting navigation of the top-level window is "
- "sandboxed, but the flag of 'allow-top-navigation' or "
- "'allow-top-navigation-by-user-activation' is not set.");
- }
+ PrintNavigationErrorMessage(
+ target_frame,
+ "The frame attempting navigation of the top-level window is "
+ "sandboxed, but the flag of 'allow-top-navigation' or "
+ "'allow-top-navigation-by-user-activation' is not set.");
return false;
}
- if (source_frame.GetSecurityContext()->IsSandboxed(
+ if (GetSecurityContext()->IsSandboxed(
network::mojom::blink::WebSandboxFlags::kTopNavigation) &&
- !source_frame.GetSecurityContext()->IsSandboxed(
+ !GetSecurityContext()->IsSandboxed(
network::mojom::blink::WebSandboxFlags::
kTopNavigationByUserActivation) &&
- !source_frame.HasTransientUserActivation()) {
- if (should_report) {
- // With only 'allow-top-navigation-by-user-activation' (but not
- // 'allow-top-navigation'), top navigation requires a user gesture.
- initiating_frame.GetLocalFrameHostRemote().DidBlockNavigation(
- destination_url, initiating_frame.GetDocument()->Url(),
+ !HasTransientUserActivation(this)) {
+ GetLocalFrameHostRemote().DidBlockNavigation(
+ destination_url, GetDocument()->Url(),
mojom::NavigationBlockedReason::
kRedirectWithNoUserGestureSandbox);
- initiating_frame.PrintNavigationErrorMessage(
+ PrintNavigationErrorMessage(
target_frame,
"The frame attempting navigation of the top-level window is "
"sandboxed with the 'allow-top-navigation-by-user-activation' "
"flag, but has no user activation (aka gesture). See "
"https://www.chromestatus.com/feature/5629582019395584.");
- }
return false;
}
- // If the nearest non-sandboxed ancestor frame is not allowed to navigate,
- // then this sandboxed frame can't either. This prevents a cross-origin
- // frame from embedding a sandboxed iframe with kTopNavigate from
- // navigating the top frame. See (crbug.com/1145553)
- if (Frame* parent_frame = source_frame.Tree().Parent()) {
- bool parent_can_navigate = CanNavigateHelper(
- initiating_frame, *parent_frame, target_frame, destination_url);
- if (!parent_can_navigate) {
- if (should_report) {
- String message =
- "The frame attempting navigation of the top-level window is "
- "sandboxed and is not allowed to navigate since its ancestor "
- "frame " +
- FrameDescription(*parent_frame) +
- " is unable to navigate the top frame.\n";
- initiating_frame.PrintNavigationErrorMessage(target_frame, message);
- }
- return false;
- }
+ // This is a "last line of defense" to prevent a cross-origin document
+ // from escalating its own top-navigation privileges. See
+ // `PolicyContainerPolicies::can_navigate_top_without_user_gesture`
+ // for the cases where this would be allowed or disallowed.
+ // See (crbug.com/1145553) and (crbug.com/1251790).
+ if (!DomWindow()
+ ->GetExecutionContext()
+ ->GetPolicyContainer()
+ ->GetPolicies()
+ .can_navigate_top_without_user_gesture &&
+ !HasStickyUserActivation()) {
+ String message =
+ "The frame attempting to navigate the top-level window is "
+ "cross-origin and either it or one of its ancestors is not "
+ "allowed to navigate the top frame.\n";
+ PrintNavigationErrorMessage(target_frame, message);
+ return false;
}
return true;
}
}
- DCHECK(source_frame.GetSecurityContext()->GetSecurityOrigin());
- const SecurityOrigin& origin =
- *source_frame.GetSecurityContext()->GetSecurityOrigin();
+ DCHECK(GetSecurityContext()->GetSecurityOrigin());
+ const SecurityOrigin& origin = *GetSecurityContext()->GetSecurityOrigin();
// This is the normal case. A document can navigate its decendant frames,
// or, more generally, a document can navigate a frame if the document is
@@ -1739,17 +1708,17 @@ static bool CanNavigateHelper(LocalFrame& initiating_frame,
// and/or "parent" relation). Requiring some sort of relation prevents a
// document from navigating arbitrary, unrelated top-level frames.
if (!target_frame.Tree().Parent()) {
- if (target_frame == source_frame.Opener())
+ if (target_frame == Opener())
return true;
if (CanAccessAncestor(origin, target_frame.Opener()))
return true;
}
- if (target_frame == source_frame.Tree().Top()) {
+ if (target_frame == Tree().Top()) {
// A frame navigating its top may blocked if the document initiating
// the navigation has never received a user gesture and the navigation
// isn't same-origin with the target.
- if (source_frame.HasStickyUserActivation() ||
+ if (HasStickyUserActivation() ||
target_frame.GetSecurityContext()->GetSecurityOrigin()->CanAccess(
SecurityOrigin::Create(destination_url).get())) {
return true;
@@ -1769,44 +1738,29 @@ static bool CanNavigateHelper(LocalFrame& initiating_frame,
return true;
}
- // We skip this check for recursive calls on remote frames, in which case
- // we're less permissive.
- if (const LocalFrame* local_frame = DynamicTo<LocalFrame>(&source_frame)) {
- if (auto* settings_client =
- local_frame->Client()->GetContentSettingsClient()) {
- if (settings_client->AllowPopupsAndRedirects(false /* default_value*/))
- return true;
- }
- }
-
- if (should_report) {
- initiating_frame.PrintNavigationErrorMessage(
- target_frame,
- "The frame attempting navigation is targeting its top-level window, "
- "but is neither same-origin with its target nor has it received a "
- "user gesture. See "
- "https://www.chromestatus.com/feature/5851021045661696.");
- initiating_frame.GetLocalFrameHostRemote().DidBlockNavigation(
- destination_url, initiating_frame.GetDocument()->Url(),
- mojom::NavigationBlockedReason::kRedirectWithNoUserGesture);
+ if (auto* settings_client = Client()->GetContentSettingsClient()) {
+ if (settings_client->AllowPopupsAndRedirects(false /* default_value*/))
+ return true;
}
+ PrintNavigationErrorMessage(
+ target_frame,
+ "The frame attempting navigation is targeting its top-level window, "
+ "but is neither same-origin with its target nor has it received a "
+ "user gesture. See "
+ "https://www.chromestatus.com/feature/5851021045661696.");
+ GetLocalFrameHostRemote().DidBlockNavigation(
+ destination_url, GetDocument()->Url(),
+ mojom::blink::NavigationBlockedReason::kRedirectWithNoUserGesture);
} else {
- if (should_report) {
- initiating_frame.PrintNavigationErrorMessage(
- target_frame,
- "The frame attempting navigation is neither same-origin with the "
- "target, nor is it the target's parent or opener.");
- }
+ PrintNavigationErrorMessage(
+ target_frame,
+ "The frame attempting navigation is neither same-origin with the "
+ "target, nor is it the target's parent or opener.");
}
return false;
}
-bool LocalFrame::CanNavigate(const Frame& target_frame,
- const KURL& destination_url) {
- return CanNavigateHelper(*this, *this, target_frame, destination_url);
-}
-
ContentCaptureManager* LocalFrame::GetContentCaptureManager() {
DCHECK(Client());
if (!IsLocalRoot())
@@ -230,47 +230,13 @@ constexpr int kCommitDelayDefaultInMs = 500; // 30 frames @ 60hz
// returning.
static const unsigned kMaxUpdatePluginsIterations = 2;
-#if BUILDFLAG(IS_OHOS)
-void LocalFrameView::SetInitalLayoutRatio() {
- static double ratio = 0;
- if (!ratio) {
- display_manager_adapter_ =
- OHOS::NWeb::OhosAdapterHelper::GetInstance().CreateDisplayMgrAdapter();
- if (display_manager_adapter_ == nullptr) {
- LOG(ERROR) << "display_manager_adapter is nullptr.";
- return;
- }
- std::shared_ptr<OHOS::NWeb::DisplayAdapter> display =
- display_manager_adapter_->GetDefaultDisplay();
- if (display == nullptr) {
- LOG(ERROR) << "display is nullptr.";
- return;
- }
- ratio = display->GetVirtualPixelRatio();
- if (ratio <= 0) {
- LOG(ERROR) << "invalid ratio.";
- ratio = 0;
- return;
- }
- LOG(INFO) << "SetInitalLayoutRatio ratio = " << ratio;
- }
- initial_layout_size_ratio_ = ratio;
-}
-#endif
-
LocalFrameView::LocalFrameView(LocalFrame& frame)
: LocalFrameView(frame, gfx::Rect()) {
-#if BUILDFLAG(IS_OHOS)
- SetInitalLayoutRatio();
-#endif
Show();
}
LocalFrameView::LocalFrameView(LocalFrame& frame, const gfx::Size& initial_size)
: LocalFrameView(frame, gfx::Rect(gfx::Point(), initial_size)) {
-#if BUILDFLAG(IS_OHOS)
- SetInitalLayoutRatio();
-#endif
SetLayoutSizeInternal(initial_size);
Show();
}
@@ -331,9 +297,6 @@ LocalFrameView::LocalFrameView(LocalFrame& frame, gfx::Rect frame_rect)
is_updating_layout_(false)
#endif
{
-#if BUILDFLAG(IS_OHOS)
- SetInitalLayoutRatio();
-#endif
// Propagate the marginwidth/height and scrolling modes to the view.
if (frame_->Owner() && frame_->Owner()->ScrollbarMode() ==
mojom::blink::ScrollbarMode::kAlwaysOff)
@@ -1411,12 +1374,7 @@ void LocalFrameView::SetLayoutSize(const gfx::Size& size) {
frame_->GetDocument()->Lifecycle().LifecyclePostponed())
return;
-#if BUILDFLAG(IS_OHOS)
- SetLayoutSizeInternal(gfx::Size(size.width() / initial_layout_size_ratio_,
- size.height() / initial_layout_size_ratio_));
-#else
SetLayoutSizeInternal(size);
-#endif
}
void LocalFrameView::SetLayoutSizeFixedToFrameSize(bool is_fixed) {
@@ -37,7 +37,8 @@ std::unique_ptr<PolicyContainer> PolicyContainer::CreateFromWebPolicyContainer(
container->policies.referrer_policy,
container->policies.ip_address_space,
ConvertToMojoBlink(
- std::move(container->policies.content_security_policies)));
+ std::move(container->policies.content_security_policies)),
+ container->policies.can_navigate_top_without_user_gesture);
return std::make_unique<PolicyContainer>(std::move(container->remote),
std::move(policies));
}
@@ -16,7 +16,8 @@ TEST(PolicyContainerTest, MembersAreSetDuringConstruction) {
auto policies = mojom::blink::PolicyContainerPolicies::New(
network::mojom::blink::ReferrerPolicy::kNever,
network::mojom::blink::IPAddressSpace::kPrivate,
- Vector<network::mojom::blink::ContentSecurityPolicyPtr>());
+ Vector<network::mojom::blink::ContentSecurityPolicyPtr>(),
+ /*can_navigate_top_without_user_gesture=*/true);
PolicyContainer policy_container(host.BindNewEndpointAndPassDedicatedRemote(),
std::move(policies));
@@ -31,7 +32,8 @@ TEST(PolicyContainerTest, UpdateReferrerPolicyIsPropagated) {
auto policies = mojom::blink::PolicyContainerPolicies::New(
network::mojom::blink::ReferrerPolicy::kAlways,
network::mojom::blink::IPAddressSpace::kPublic,
- Vector<network::mojom::blink::ContentSecurityPolicyPtr>());
+ Vector<network::mojom::blink::ContentSecurityPolicyPtr>(),
+ /*can_navigate_top_without_user_gesture=*/true);
PolicyContainer policy_container(host.BindNewEndpointAndPassDedicatedRemote(),
std::move(policies));
@@ -67,6 +67,21 @@ class CORE_EXPORT Settings {
SETTINGS_GETTERS_AND_SETTERS
+#if BUILDFLAG(IS_OHOS)
+ void SetVerticalHideScrollbars(bool hide_vertical_scrollbars) {
+ hide_vertical_scrollbars_ = hide_vertical_scrollbars;
+ }
+ void SetHorizontalHideScrollbars(bool hide_horizontal_scrollbars) {
+ hide_horizontal_scrollbars_ = hide_horizontal_scrollbars;
+ }
+ bool GetVerticalHideScrollbars() {
+ return hide_vertical_scrollbars_;
+ }
+ bool GetHorizontalHideScrollbars() {
+ return hide_horizontal_scrollbars_;
+ }
+#endif
+
void SetDelegate(SettingsDelegate*);
private:
@@ -77,6 +92,11 @@ class CORE_EXPORT Settings {
GenericFontFamilySettings generic_font_family_settings_;
SETTINGS_MEMBER_VARIABLES
+
+#if BUILDFLAG(IS_OHOS)
+ bool hide_vertical_scrollbars_ = true;
+ bool hide_horizontal_scrollbars_ = true;
+#endif
};
} // namespace blink
@@ -644,11 +644,23 @@ void VisualViewport::InitializeScrollbars() {
scrollbar_layer_horizontal_ = nullptr;
scrollbar_layer_vertical_ = nullptr;
+#if BUILDFLAG(IS_OHOS)
+ if (VisualViewportSuppliesScrollbars() &&
+ !GetPage().GetSettings().GetHideScrollbars()) {
+ if (!GetPage().GetSettings().GetVerticalHideScrollbars()) {
+ UpdateScrollbarLayer(kVerticalScrollbar);
+ }
+ if (!GetPage().GetSettings().GetHorizontalHideScrollbars()) {
+ UpdateScrollbarLayer(kHorizontalScrollbar);
+ }
+ }
+#else
if (VisualViewportSuppliesScrollbars() &&
!GetPage().GetSettings().GetHideScrollbars()) {
UpdateScrollbarLayer(kHorizontalScrollbar);
UpdateScrollbarLayer(kVerticalScrollbar);
}
+#endif
// Ensure existing LocalFrameView scrollbars are removed if the visual
// viewport scrollbars are now supplied, or created if the visual viewport no
@@ -1134,7 +1146,32 @@ void VisualViewport::Paint(GraphicsContext& context) const {
DisplayItem::kForeignLayerViewportScroll, scroll_layer_,
gfx::Point(), &state);
}
+#if BUILDFLAG(IS_OHOS)
+ if (scrollbar_layer_horizontal_ && !GetPage().GetSettings().GetHorizontalHideScrollbars()) {
+ auto state = parent_property_tree_state_;
+ state.SetEffect(*horizontal_scrollbar_effect_node_);
+ DEFINE_STATIC_LOCAL(Persistent<LiteralDebugNameClient>, debug_name_client,
+ (MakeGarbageCollected<LiteralDebugNameClient>(
+ "Inner Viewport Horizontal Scrollbar")));
+ RecordForeignLayer(context, *debug_name_client,
+ DisplayItem::kForeignLayerViewportScrollbar,
+ scrollbar_layer_horizontal_,
+ gfx::Point(0, size_.height() - ScrollbarThickness()),
+ &state);
+ }
+ if (scrollbar_layer_vertical_ && !GetPage().GetSettings().GetVerticalHideScrollbars()) {
+ auto state = parent_property_tree_state_;
+ state.SetEffect(*vertical_scrollbar_effect_node_);
+ DEFINE_STATIC_LOCAL(Persistent<LiteralDebugNameClient>, debug_name_client,
+ (MakeGarbageCollected<LiteralDebugNameClient>(
+ "Inner Viewport Vertical Scrollbar")));
+ RecordForeignLayer(
+ context, *debug_name_client,
+ DisplayItem::kForeignLayerViewportScrollbar, scrollbar_layer_vertical_,
+ gfx::Point(size_.width() - ScrollbarThickness(), 0), &state);
+ }
+#else
if (scrollbar_layer_horizontal_) {
auto state = parent_property_tree_state_;
state.SetEffect(*horizontal_scrollbar_effect_node_);
@@ -1159,6 +1196,7 @@ void VisualViewport::Paint(GraphicsContext& context) const {
DisplayItem::kForeignLayerViewportScrollbar, scrollbar_layer_vertical_,
gfx::Point(size_.width() - ScrollbarThickness(), 0), &state);
}
+#endif
}
} // namespace blink
@@ -448,13 +448,10 @@ void MultipleFieldsTemporalInputTypeView::HandleFocusInEvent(
if (GetElement().GetDocument().GetPage())
GetElement().GetDocument().GetPage()->GetFocusController().AdvanceFocus(
type);
- } else if (type == mojom::blink::FocusType::kNone ||
- type == mojom::blink::FocusType::kMouse ||
- type == mojom::blink::FocusType::kPage ||
- type == mojom::blink::FocusType::kAccessKey) {
- edit->FocusByOwner(old_focused_element);
- } else {
+ } else if (type == mojom::blink::FocusType::kForward) {
edit->FocusByOwner();
+ } else {
+ edit->FocusByOwner(old_focused_element);
}
}
@@ -11,6 +11,6 @@ interface mixin HTMLOrForeignElement {
[CEReactions, Reflect] attribute boolean autofocus;
[CEReactions] attribute long tabIndex;
- void focus(optional FocusOptions options = {});
+ [ImplementedAs=focusForBindings] void focus(optional FocusOptions options = {});
void blur();
};
@@ -109,9 +109,13 @@ void MediaInspectorContextImpl::TrimPlayer(const WebString& playerId) {
void MediaInspectorContextImpl::CullPlayers(const WebString& prefer_keep) {
// Erase all the dead players, but only erase the required number of others.
- for (const auto& playerId : dead_players_)
+ while (!dead_players_.IsEmpty()) {
+ auto playerId = dead_players_.back();
+ // remove it first, since |RemovePlayer| can cause a GC event which can
+ // potentially caues more players to get added to |dead_players_|.
+ dead_players_.pop_back();
RemovePlayer(playerId);
- dead_players_.clear();
+ }
while (!expendable_players_.IsEmpty()) {
if (total_event_count_ <= kMaxCachedPlayerEvents)
@@ -147,7 +147,8 @@ TEST_F(FrameLoaderTest, PolicyContainerIsStoredOnCommitNavigation) {
EXPECT_EQ(*mojom::blink::PolicyContainerPolicies::New(
network::mojom::ReferrerPolicy::kAlways,
network::mojom::IPAddressSpace::kPublic,
- Vector<network::mojom::blink::ContentSecurityPolicyPtr>()),
+ Vector<network::mojom::blink::ContentSecurityPolicyPtr>(),
+ /*can_navigate_top_without_user_gesture=*/true),
local_frame->DomWindow()->GetPolicyContainer()->GetPolicies());
}
@@ -88,7 +88,7 @@ class HTTPRequestHeaderValidator : public WebHTTPHeaderVisitor {
void HTTPRequestHeaderValidator::VisitHeader(const WebString& name,
const WebString& value) {
is_safe_ = is_safe_ && IsValidHTTPToken(name) &&
- !cors::IsForbiddenHeaderName(name) &&
+ !cors::IsForbiddenRequestHeader(name, value) &&
IsValidHTTPHeaderValue(value);
}
@@ -377,7 +377,7 @@ void WebAssociatedURLLoaderImpl::LoadAsynchronously(
// consult it separately, if set.
if (request.ReferrerString() !=
blink::WebString(Referrer::ClientReferrerString())) {
- DCHECK(cors::IsForbiddenHeaderName("Referer"));
+ DCHECK(cors::IsForbiddenRequestHeader("Referer", ""));
// `Referer` is a forbidden header name, so we must disallow this to
// load.
allow_load = false;
@@ -1305,6 +1305,7 @@ bool FocusController::SetFocusedElement(Element* element,
SetFocusedFrame(nullptr);
return false;
}
+
SetFocusedFrame(new_focused_frame);
if (new_document) {
@@ -104,6 +104,7 @@ const int kMaxNumberOfFrames = 1000;
const int kTenFrames = 10;
bool g_limit_max_frames_to_ten_for_testing = false;
+
} // namespace
// Function defined in third_party/blink/public/web/blink.h.
@@ -189,6 +190,11 @@ Page::Page(base::PassKey<Page>,
bool is_ordinary)
: SettingsDelegate(std::make_unique<Settings>()),
main_frame_(nullptr),
+ fenced_frames_impl_(
+ features::IsFencedFramesEnabled()
+ ? absl::optional<features::FencedFramesImplementationType>(
+ features::kFencedFramesImplementationTypeParam.Get())
+ : absl::nullopt),
agent_group_scheduler_(agent_group_scheduler),
animator_(MakeGarbageCollected<PageAnimator>(*this)),
autoscroll_controller_(MakeGarbageCollected<AutoscrollController>(*this)),
@@ -628,10 +634,10 @@ void CheckFrameCountConsistency(int expected_frame_count, Frame* frame) {
// a fenced frame and creates a new ``DocumentFencedFrames`` object).
if (features::IsFencedFramesMPArchBased()) {
if (auto* local_frame = DynamicTo<LocalFrame>(frame)) {
- actual_frame_count += static_cast<int>(
- DocumentFencedFrames::From(*local_frame->GetDocument())
- .GetFencedFrames()
- .size());
+ actual_frame_count += static_cast<int>(
+ DocumentFencedFrames::From(*local_frame->GetDocument())
+ .GetFencedFrames()
+ .size());
}
}
}
@@ -27,6 +27,8 @@
#include "base/dcheck_is_on.h"
#include "base/types/pass_key.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/devtools/inspector_issue.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/frame/text_autosizer_page_info.mojom-blink.h"
#include "third_party/blink/public/mojom/page/page.mojom-blink.h"
@@ -208,6 +210,11 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>,
return window_features_;
}
+ const absl::optional<features::FencedFramesImplementationType>&
+ FencedFramesImplementationType() const {
+ return fenced_frames_impl_;
+ }
+
PageScaleConstraintsSet& GetPageScaleConstraintsSet();
const PageScaleConstraintsSet& GetPageScaleConstraintsSet() const;
@@ -418,6 +425,9 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>,
// longer needed.
Member<Frame> main_frame_;
+ // The type of fenced frames being used.
+ absl::optional<features::FencedFramesImplementationType> fenced_frames_impl_;
+
scheduler::WebAgentGroupScheduler& agent_group_scheduler_;
Member<PageAnimator> animator_;
const Member<AutoscrollController> autoscroll_controller_;
@@ -9,6 +9,7 @@
#include "third_party/blink/renderer/core/display_lock/display_lock_context.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
+#include "third_party/blink/renderer/core/dom/focus_params.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
@@ -199,7 +200,7 @@ void ElementFragmentAnchor::ApplyFocusIfNeeded() {
// clear focus, which matches the behavior of other browsers.
auto* element = DynamicTo<Element>(anchor_node_.Get());
if (element && element->IsFocusable()) {
- element->focus();
+ element->focus(FocusParams(/*gate_on_user_activation=*/true));
} else {
frame_->GetDocument()->SetSequentialFocusNavigationStartingPoint(
anchor_node_);
@@ -84,6 +84,8 @@ ValidationMessageOverlayDelegate::~ValidationMessageOverlayDelegate() {
EventDispatchForbiddenScope::AllowUserAgentEvents allow_events;
page_->WillBeDestroyed();
}
+ if (destroyed_ptr_)
+ *destroyed_ptr_ = true;
}
LocalFrameView& ValidationMessageOverlayDelegate::FrameView() const {
@@ -164,7 +166,18 @@ void ValidationMessageOverlayDelegate::CreatePage(const FrameOverlay& overlay) {
// Propagate deprecated DSF for platforms without use-zoom-for-dsf.
page_->SetDeviceScaleFactorDeprecated(
main_page_->DeviceScaleFactorDeprecated());
+
+ // ForceSynchronousDocumentInstall can cause another call to
+ // ValidationMessageClientImpl::ShowValidationMessage, which will hide this
+ // validation message and may even delete this. In order to avoid continuing
+ // when this is destroyed, |destroyed| will be set to true in the destructor.
+ bool destroyed = false;
+ DCHECK(!destroyed_ptr_);
+ destroyed_ptr_ = &destroyed;
frame->ForceSynchronousDocumentInstall("text/html", data);
+ if (destroyed)
+ return;
+ destroyed_ptr_ = nullptr;
Element& main_message = GetElementById("main-message");
main_message.setTextContent(message_);
@@ -71,6 +71,10 @@ class CORE_EXPORT ValidationMessageOverlayDelegate
String sub_message_;
TextDirection message_dir_;
TextDirection sub_message_dir_;
+
+ // Used by CreatePage() to determine if this has been deleted in the middle of
+ // the function.
+ bool* destroyed_ptr_ = nullptr;
};
} // namespace blink
@@ -1484,6 +1484,7 @@ bool PaintLayerScrollableArea::NeedsScrollbarReconstruction() const {
return false;
}
+#if BUILDFLAG(IS_OHOS)
void PaintLayerScrollableArea::ComputeScrollbarExistence(
bool& needs_horizontal_scrollbar,
bool& needs_vertical_scrollbar,
@@ -1499,7 +1500,108 @@ void PaintLayerScrollableArea::ComputeScrollbarExistence(
needs_vertical_scrollbar = false;
return;
}
+ mojom::blink::ScrollbarMode h_mode = mojom::blink::ScrollbarMode::kAuto;
+ mojom::blink::ScrollbarMode v_mode = mojom::blink::ScrollbarMode::kAuto;
+ bool is_vertical_scrollbars_hide = GetLayoutBox()->GetFrame()->GetSettings()->GetVerticalHideScrollbars();
+ bool is_horizontal_scrollbars_hide = GetLayoutBox()->GetFrame()->GetSettings()->GetHorizontalHideScrollbars();
+
+ // First, determine what behavior the scrollbars say they should have.
+ {
+ if (auto* layout_view = DynamicTo<LayoutView>(GetLayoutBox())) {
+ // LayoutView is special as there's various quirks and settings that
+ // style doesn't account for.
+ layout_view->CalculateScrollbarModes(h_mode, v_mode);
+ h_mode = is_vertical_scrollbars_hide ? mojom::blink::ScrollbarMode::kAlwaysOff : h_mode;
+ v_mode = is_horizontal_scrollbars_hide ? mojom::blink::ScrollbarMode::kAlwaysOff : v_mode;
+ } else {
+ auto overflow_x = GetLayoutBox()->StyleRef().OverflowX();
+ if (overflow_x == EOverflow::kScroll) {
+ h_mode = is_horizontal_scrollbars_hide ? mojom::blink::ScrollbarMode::kAlwaysOff : mojom::blink::ScrollbarMode::kAlwaysOn;
+ } else if (overflow_x == EOverflow::kHidden ||
+ overflow_x == EOverflow::kVisible) {
+ h_mode = mojom::blink::ScrollbarMode::kAlwaysOff;
+ }
+
+ auto overflow_y = GetLayoutBox()->StyleRef().OverflowY();
+ if (overflow_y == EOverflow::kScroll) {
+ v_mode = is_vertical_scrollbars_hide ? mojom::blink::ScrollbarMode::kAlwaysOff : mojom::blink::ScrollbarMode::kAlwaysOn;
+ } else if (overflow_y == EOverflow::kHidden ||
+ overflow_y == EOverflow::kVisible) {
+ v_mode = mojom::blink::ScrollbarMode::kAlwaysOff;
+ }
+ }
+ // Since overlay scrollbars (the fade-in/out kind, not overflow: overlay)
+ // only appear when scrolling, we don't create them if there isn't overflow
+ // to scroll. Thus, overlay scrollbars can't be "always on". i.e.
+ // |overlay:scroll| behaves like |overlay:auto|.
+ bool has_custom_scrollbar_style = ScrollbarStyleSource(*GetLayoutBox())
+ .StyleRef()
+ .HasCustomScrollbarStyle();
+ bool will_be_overlay = GetPageScrollbarTheme().UsesOverlayScrollbars() &&
+ !has_custom_scrollbar_style;
+ if (will_be_overlay) {
+ if (!is_horizontal_scrollbars_hide && h_mode == mojom::blink::ScrollbarMode::kAlwaysOn)
+ h_mode = mojom::blink::ScrollbarMode::kAuto;
+ if (!is_vertical_scrollbars_hide && v_mode == mojom::blink::ScrollbarMode::kAlwaysOn)
+ v_mode = mojom::blink::ScrollbarMode::kAuto;
+ }
+ }
+
+ // By default, don't make any changes.
+ needs_horizontal_scrollbar = is_horizontal_scrollbars_hide ? false : HasHorizontalScrollbar();
+ needs_vertical_scrollbar = is_vertical_scrollbars_hide ? false : HasVerticalScrollbar();
+ // If the behavior doesn't depend on overflow or any other information, we
+ // can set it now.
+ {
+ if (h_mode == mojom::blink::ScrollbarMode::kAlwaysOn)
+ needs_horizontal_scrollbar = true;
+ else if (h_mode == mojom::blink::ScrollbarMode::kAlwaysOff)
+ needs_horizontal_scrollbar = false;
+
+ if (v_mode == mojom::blink::ScrollbarMode::kAlwaysOn)
+ needs_vertical_scrollbar = true;
+ else if (v_mode == mojom::blink::ScrollbarMode::kAlwaysOff)
+ needs_vertical_scrollbar = false;
+ }
+
+ // If this is being performed before layout, we want to only update scrollbar
+ // existence if its based on purely style based reasons.
+ if (option == kOverflowIndependent)
+ return;
+
+ // If we have clean layout, we can make a decision on any scrollbars that
+ // depend on overflow.
+ {
+ if (!is_horizontal_scrollbars_hide && h_mode == mojom::blink::ScrollbarMode::kAuto) {
+ // Don't add auto scrollbars if the box contents aren't visible.
+ needs_horizontal_scrollbar =
+ GetLayoutBox()->IsRooted() && HasHorizontalOverflow() &&
+ VisibleContentRect(kIncludeScrollbars).height();
+ }
+ if (!is_vertical_scrollbars_hide && v_mode == mojom::blink::ScrollbarMode::kAuto) {
+ needs_vertical_scrollbar = GetLayoutBox()->IsRooted() &&
+ HasVerticalOverflow() &&
+ VisibleContentRect(kIncludeScrollbars).width();
+ }
+ }
+}
+#else
+void PaintLayerScrollableArea::ComputeScrollbarExistence(
+ bool& needs_horizontal_scrollbar,
+ bool& needs_vertical_scrollbar,
+ ComputeScrollbarExistenceOption option) const {
+ // Scrollbars may be hidden or provided by visual viewport or frame instead.
+ DCHECK(GetLayoutBox()->GetFrame()->GetSettings());
+ if (VisualViewportSuppliesScrollbars() ||
+ !CanHaveOverflowScrollbars(*GetLayoutBox()) ||
+ GetLayoutBox()->GetFrame()->GetSettings()->GetHideScrollbars() ||
+ GetLayoutBox()->IsLayoutNGFieldset() ||
+ GetLayoutBox()->StyleRef().ScrollbarWidth() == EScrollbarWidth::kNone) {
+ needs_horizontal_scrollbar = false;
+ needs_vertical_scrollbar = false;
+ return;
+ }
mojom::blink::ScrollbarMode h_mode = mojom::blink::ScrollbarMode::kAuto;
mojom::blink::ScrollbarMode v_mode = mojom::blink::ScrollbarMode::kAuto;
@@ -1583,7 +1685,7 @@ void PaintLayerScrollableArea::ComputeScrollbarExistence(
}
}
}
-
+#endif
bool PaintLayerScrollableArea::TryRemovingAutoScrollbars(
const bool& needs_horizontal_scrollbar,
const bool& needs_vertical_scrollbar) {
@@ -234,6 +234,7 @@ class ThreadedWorkletMessagingProxyForTest
private:
friend class ThreadedWorkletTest;
+ FRIEND_TEST_ALL_PREFIXES(ThreadedWorkletTest, NestedRunLoopTermination);
std::unique_ptr<WorkerThread> CreateWorkerThread() final {
return std::make_unique<ThreadedWorkletThreadForTest>(WorkletObjectProxy());
@@ -280,6 +281,16 @@ class ThreadedWorkletTest : public testing::Test {
}
Document& GetDocument() { return page_->GetDocument(); }
+ void WaitForReady(WorkerThread* worker_thread) {
+ base::WaitableEvent child_waitable;
+ PostCrossThreadTask(
+ *worker_thread->GetTaskRunner(TaskType::kInternalTest), FROM_HERE,
+ CrossThreadBindOnce(&base::WaitableEvent::Signal,
+ CrossThreadUnretained(&child_waitable)));
+
+ child_waitable.Wait();
+ }
+
private:
std::unique_ptr<DummyPageHolder> page_;
Persistent<ThreadedWorkletMessagingProxyForTest> messaging_proxy_;
@@ -403,4 +414,40 @@ TEST_F(ThreadedWorkletTest, TaskRunner) {
test::EnterRunLoop();
}
+TEST_F(ThreadedWorkletTest, NestedRunLoopTermination) {
+ MessagingProxy()->Start();
+
+ ThreadedWorkletMessagingProxyForTest* second_messaging_proxy =
+ MakeGarbageCollected<ThreadedWorkletMessagingProxyForTest>(
+ GetExecutionContext());
+
+ // Get a nested event loop where the first one is on the stack
+ // and the second is still alive.
+ second_messaging_proxy->Start();
+
+ // Wait until the workers are setup and ready to accept work before we
+ // pause them.
+ WaitForReady(GetWorkerThread());
+ WaitForReady(second_messaging_proxy->GetWorkerThread());
+
+ // Pause the second worker, then the first.
+ second_messaging_proxy->GetWorkerThread()->Pause();
+ GetWorkerThread()->Pause();
+
+ // Resume then terminate the second worker.
+ second_messaging_proxy->GetWorkerThread()->Resume();
+ second_messaging_proxy->GetWorkerThread()->Terminate();
+ second_messaging_proxy = nullptr;
+
+ // Now resume the first worker.
+ GetWorkerThread()->Resume();
+
+ // Make sure execution still works without crashing.
+ PostCrossThreadTask(
+ *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE,
+ CrossThreadBindOnce(&ThreadedWorkletThreadForTest::TestTaskRunner,
+ CrossThreadUnretained(GetWorkerThread())));
+ test::EnterRunLoop();
+}
+
} // namespace blink
@@ -589,6 +589,7 @@ void WorkerThread::InitializeOnWorkerThread(
const absl::optional<WorkerBackingThreadStartupData>& thread_startup_data,
std::unique_ptr<WorkerDevToolsParams> devtools_params) {
DCHECK(IsCurrentThread());
+ backing_thread_weak_factory_.emplace(this);
worker_reporting_proxy_.WillInitializeWorkerContext();
{
TRACE_EVENT0("blink.worker", "WorkerThread::InitializeWorkerContext");
@@ -724,11 +725,13 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
SetThreadState(ThreadState::kReadyToShutdown);
}
+ backing_thread_weak_factory_ = absl::nullopt;
if (pause_or_freeze_count_ > 0) {
DCHECK(nested_runner_);
pause_or_freeze_count_ = 0;
nested_runner_->QuitNow();
}
+ pause_handle_.reset();
if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::From(GetIsolate()))
debugger->WorkerThreadDestroyed(this);
@@ -873,8 +876,7 @@ void WorkerThread::PauseOrFreezeOnWorkerThread(
if (pause_or_freeze_count_ > 1)
return;
- std::unique_ptr<scheduler::WorkerScheduler::PauseHandle> pause_handle =
- GetScheduler()->Pause();
+ pause_handle_ = GetScheduler()->Pause();
{
// Since the nested message loop runner needs to be created and destroyed on
// the same thread we allocate and destroy a new message loop runner each
@@ -882,13 +884,20 @@ void WorkerThread::PauseOrFreezeOnWorkerThread(
// the worker thread such that the resume/terminate can quit this runner.
std::unique_ptr<Platform::NestedMessageLoopRunner> nested_runner =
Platform::Current()->CreateNestedMessageLoopRunner();
- base::AutoReset<Platform::NestedMessageLoopRunner*> nested_runner_autoreset(
- &nested_runner_, nested_runner.get());
+ auto weak_this = backing_thread_weak_factory_->GetWeakPtr();
+ nested_runner_ = nested_runner.get();
nested_runner->Run();
+
+ // Careful `this` may be destroyed.
+ if (!weak_this) {
+ return;
+ }
+ nested_runner_ = nullptr;
}
GlobalScope()->SetDefersLoadingForResourceFetchers(LoaderFreezeMode::kNone);
GlobalScope()->SetIsInBackForwardCache(false);
GlobalScope()->SetLifecycleState(mojom::blink::FrameLifecycleState::kRunning);
+ pause_handle_.reset();
}
void WorkerThread::ResumeOnWorkerThread() {
@@ -31,6 +31,7 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_refptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/single_thread_task_runner.h"
#include "base/thread_annotations.h"
@@ -77,7 +78,7 @@ struct WorkerMainScriptLoadParameters;
// abstract class. Multiple WorkerThreads may share one WorkerBackingThread for
// worklets.
//
-// WorkerThread start and termination must be initiated on the main thread and
+// WorkerThread start and termination must be initiated on the parent thread and
// an actual task is executed on the worker thread.
//
// When termination starts, (debugger) tasks on WorkerThread are handled as
@@ -100,7 +101,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
~WorkerThread() override;
// Starts the underlying thread and creates the global scope. Called on the
- // main thread.
+ // parent thread.
// Startup data for WorkerBackingThread is absl::nullopt if |this| doesn't own
// the underlying WorkerBackingThread.
// TODO(nhiroki): We could separate WorkerBackingThread initialization from
@@ -112,14 +113,14 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
std::unique_ptr<WorkerDevToolsParams>);
// Posts a task to evaluate a top-level classic script on the worker thread.
- // Called on the main thread after Start().
+ // Called on the parent thread after Start().
void EvaluateClassicScript(const KURL& script_url,
const String& source_code,
std::unique_ptr<Vector<uint8_t>> cached_meta_data,
const v8_inspector::V8StackTraceId& stack_id);
// Posts a task to fetch and run a top-level classic script on the worker
- // thread. Called on the main thread after Start().
+ // thread. Called on the parent thread after Start().
void FetchAndRunClassicScript(
const KURL& script_url,
std::unique_ptr<WorkerMainScriptLoadParameters>
@@ -130,7 +131,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
const v8_inspector::V8StackTraceId& stack_id);
// Posts a task to fetch and run a top-level module script on the worker
- // thread. Called on the main thread after Start().
+ // thread. Called on the parent thread after Start().
void FetchAndRunModuleScript(
const KURL& script_url,
std::unique_ptr<WorkerMainScriptLoadParameters>
@@ -151,7 +152,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
// Terminates the worker thread. Subclasses of WorkerThread can override this
// to do cleanup. The default behavior is to call Terminate() and
// synchronously call EnsureScriptExecutionTerminates() to ensure the thread
- // is quickly terminated. Called on the main thread.
+ // is quickly terminated. Called on the parent thread.
virtual void TerminateForTesting();
// Thread::TaskObserver.
@@ -178,7 +179,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
void DebuggerTaskStarted();
void DebuggerTaskFinished();
- // Callable on both the main thread and the worker thread.
+ // Callable on both the parent thread and the worker thread.
const base::UnguessableToken& GetDevToolsWorkerToken() const {
return devtools_worker_token_;
}
@@ -322,7 +323,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
// already shutting down. Does not terminate if a debugger task is running,
// because the debugger task is guaranteed to finish and it heavily uses V8
// API calls which would crash after forcible script termination. Called on
- // the main thread.
+ // the parent thread.
void EnsureScriptExecutionTerminates(ExitCode) LOCKS_EXCLUDED(mutex_);
// These are called in this order during worker thread startup.
@@ -407,7 +408,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
// A unique identifier among all WorkerThreads.
const int worker_thread_id_;
- // Set on the main thread.
+ // Set on the parent thread.
bool requested_to_terminate_ GUARDED_BY(mutex_) = false;
ThreadState thread_state_ GUARDED_BY(mutex_) = ThreadState::kNotStarted;
@@ -441,7 +442,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
TaskTypeTraits>;
TaskRunnerHashMap worker_task_runners_;
- // This lock protects shared states between the main thread and the worker
+ // This lock protects shared states between the parent thread and the worker
// thread. See thread-safety annotations (e.g., GUARDED_BY) in this header
// file.
Mutex mutex_;
@@ -450,6 +451,10 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
// only on the worker thread.
int pause_or_freeze_count_ = 0;
+ // The `PauseHandle` needs to be destroyed before the scheduler is destroyed
+ // otherwise we will hit a DCHECK.
+ std::unique_ptr<scheduler::WorkerScheduler::PauseHandle> pause_handle_;
+
// A nested message loop for handling pausing. Pointer is not owned. Used only
// on the worker thread.
Platform::NestedMessageLoopRunner* nested_runner_ = nullptr;
@@ -476,6 +481,12 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver {
HashSet<std::unique_ptr<InterruptData>> pending_interrupts_
GUARDED_BY(mutex_);
+ // Since the WorkerThread is allocated and deallocated on the parent thread,
+ // we need a WeakPtrFactory that is allocated and cleared on the backing
+ // thread.
+ absl::optional<base::WeakPtrFactory<WorkerThread>>
+ backing_thread_weak_factory_;
+
THREAD_CHECKER(parent_thread_checker_);
};
@@ -1394,9 +1394,10 @@ void XMLHttpRequest::setRequestHeader(const AtomicString& name,
return;
}
- // "5. Terminate these steps if |name| is a forbidden header name."
+ // "5. Terminate these steps if (|name|, |value|) is a forbidden request
+ // header."
// No script (privileged or not) can set unsafe headers.
- if (cors::IsForbiddenHeaderName(name)) {
+ if (cors::IsForbiddenRequestHeader(name, value)) {
LogConsoleError(GetExecutionContext(),
"Refused to set unsafe header \"" + name + "\"");
return;
@@ -97,16 +97,6 @@ namespace {
constexpr const char kCategory[] = "media";
constexpr int kMaxActiveEncodes = 5;
-// Use this function in cases when we can't immediately delete |ptr| because
-// there might be its methods on the call stack.
-template <typename T>
-void DeleteLater(ScriptState* state, std::unique_ptr<T> ptr) {
- DCHECK(state->ContextIsValid());
- auto* context = ExecutionContext::From(state);
- auto runner = context->GetTaskRunner(TaskType::kInternalDefault);
- runner->DeleteSoon(FROM_HERE, std::move(ptr));
-}
-
bool IsAcceleratedConfigurationSupported(
media::VideoCodecProfile profile,
const media::VideoEncoder::Options& options,
@@ -985,6 +975,7 @@ void VideoEncoder::ResetInternal() {
}
static void isConfigSupportedWithSoftwareOnly(
+ ScriptState* script_state,
ScriptPromiseResolver* resolver,
VideoEncoderSupport* support,
VideoEncoderTraits::ParsedConfig* config) {
@@ -1009,22 +1000,25 @@ static void isConfigSupportedWithSoftwareOnly(
return;
}
- auto done_callback = [](std::unique_ptr<media::VideoEncoder> sw_encoder,
+ auto done_callback = [](std::unique_ptr<media::VideoEncoder> encoder,
ScriptPromiseResolver* resolver,
+ scoped_refptr<base::SingleThreadTaskRunner> runner,
VideoEncoderSupport* support,
media::EncoderStatus status) {
support->setSupported(status.is_ok());
resolver->Resolve(support);
- DeleteLater(resolver->GetScriptState(), std::move(sw_encoder));
+ runner->DeleteSoon(FROM_HERE, std::move(encoder));
};
+ auto* context = ExecutionContext::From(script_state);
+ auto runner = context->GetTaskRunner(TaskType::kInternalDefault);
auto* software_encoder_raw = software_encoder.get();
software_encoder_raw->Initialize(
config->profile, config->options, base::DoNothing(),
- ConvertToBaseOnceCallback(
- CrossThreadBindOnce(done_callback, std::move(software_encoder),
- WrapCrossThreadPersistent(resolver),
- WrapCrossThreadPersistent(support))));
+ ConvertToBaseOnceCallback(CrossThreadBindOnce(
+ done_callback, std::move(software_encoder),
+ WrapCrossThreadPersistent(resolver), std::move(runner),
+ WrapCrossThreadPersistent(support))));
}
static void isConfigSupportedWithHardwareOnly(
@@ -1111,7 +1105,8 @@ ScriptPromise VideoEncoder::isConfigSupported(ScriptState* script_state,
promises.push_back(resolver->Promise());
auto* support = VideoEncoderSupport::Create();
support->setConfig(config_copy);
- isConfigSupportedWithSoftwareOnly(resolver, support, parsed_config);
+ isConfigSupportedWithSoftwareOnly(script_state, resolver, support,
+ parsed_config);
}
// Wait for all |promises| to resolve and check if any of them have
@@ -46,14 +46,10 @@ std::tuple<int, sqlite3*> OpenDatabase(const String& filename) {
/*make_default=*/false);
sqlite3* connection;
-#if BUILDFLAG(IS_OHOS)
- int status = sqlite3_open(filename.Utf8().c_str(), &connection);
-#else
constexpr int open_flags =
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_PRIVATECACHE;
int status = sqlite3_open_v2(filename.Utf8().c_str(), &connection, open_flags,
kSqliteVfsName);
-#endif
if (status != SQLITE_OK) {
// SQLite creates a connection handle in most cases where open fails.
if (connection) {
@@ -1752,7 +1752,11 @@ component("platform") {
}
if (is_ohos) {
- sources += [ "fonts/android/font_cache_android.cc" ]
+ sources += [
+ "fonts/android/font_cache_android.cc",
+ "fonts/ohos/font_unique_name_lookup_ohos.cc",
+ "fonts/ohos/font_unique_name_lookup_ohos.h",
+ ]
}
if (is_android) {
@@ -11,6 +11,8 @@
#include "third_party/blink/renderer/platform/fonts/linux/font_unique_name_lookup_linux.h"
#elif defined(OS_WIN)
#include "third_party/blink/renderer/platform/fonts/win/font_unique_name_lookup_win.h"
+#elif BUILDFLAG(IS_OHOS)
+#include "third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.h"
#endif
namespace blink {
@@ -26,6 +28,8 @@ FontUniqueNameLookup::GetPlatformUniqueNameLookup() {
return std::make_unique<FontUniqueNameLookupLinux>();
#elif defined(OS_WIN)
return std::make_unique<FontUniqueNameLookupWin>();
+#elif BUILDFLAG(IS_OHOS)
+ return std::make_unique<FontUniqueNameLookupOhos>();
#else
return nullptr;
#endif
@@ -12,7 +12,7 @@
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkTypeface.h"
-#if defined(OS_ANDROID) || defined(OS_WIN)
+#if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_OHOS)
#include "third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h"
#endif
@@ -65,7 +65,7 @@ class FontUniqueNameLookup {
// Windows and Android share the concept of connecting to a Mojo service for
// retrieving a ReadOnlySharedMemoryRegion with the lookup table in it.
-#if defined(OS_WIN) || defined(OS_ANDROID)
+#if defined(OS_WIN) || defined(OS_ANDROID) || BUILDFLAG(IS_OHOS)
std::unique_ptr<FontTableMatcher> font_table_matcher_;
#endif
};
new file mode 100755
@@ -0,0 +1,104 @@
+// Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.h"
+
+#include "base/files/file.h"
+#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
+#include "base/timer/elapsed_timer.h"
+#include "third_party/blink/public/common/features.h"
+#include "third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h"
+#include "third_party/blink/public/common/thread_safe_browser_interface_broker_proxy.h"
+#include "third_party/blink/public/platform/platform.h"
+#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+#include "third_party/skia/include/core/SkData.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
+#include "third_party/skia/include/core/SkTypeface.h"
+
+#include "base/logging.h"
+
+namespace blink {
+
+FontUniqueNameLookupOhos::~FontUniqueNameLookupOhos() = default;
+
+sk_sp<SkTypeface> FontUniqueNameLookupOhos::MatchUniqueName(
+ const String& font_unique_name) {
+ if (!IsFontUniqueNameLookupReadyForSyncLookup())
+ return nullptr;
+ absl::optional<FontTableMatcher::MatchResult> match_result =
+ font_table_matcher_->MatchName(font_unique_name.Utf8().c_str());
+ if (!match_result)
+ return nullptr;
+ return SkTypeface::MakeFromFile(match_result->font_path.c_str(),
+ match_result->ttc_index);
+}
+
+void FontUniqueNameLookupOhos::Init() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ EnsureServiceConnected();
+}
+
+bool FontUniqueNameLookupOhos::IsFontUniqueNameLookupReadyForSyncLookup() {
+ if (!RuntimeEnabledFeatures::FontSrcLocalMatchingEnabled())
+ return true;
+
+ EnsureServiceConnected();
+
+ if (font_table_matcher_.get())
+ return true;
+
+ if (sync_available_.has_value())
+ return sync_available_.value();
+
+ bool sync_available_from_mojo = false;
+ base::ReadOnlySharedMemoryRegion shared_memory_region;
+ ohos_font_lookup_service_->GetUniqueNameLookupTableIfAvailable(
+ &sync_available_from_mojo, &shared_memory_region);
+ sync_available_ = sync_available_from_mojo;
+
+ if (*sync_available_) {
+ DCHECK_EQ(pending_callbacks_.size(), 0u);
+ ReceiveReadOnlySharedMemoryRegion(std::move(shared_memory_region));
+ }
+
+ return *sync_available_;
+}
+
+void FontUniqueNameLookupOhos::PrepareFontUniqueNameLookup(
+ NotifyFontUniqueNameLookupReady callback) {
+ DCHECK(!font_table_matcher_.get());
+ DCHECK(RuntimeEnabledFeatures::FontSrcLocalMatchingEnabled());
+
+ pending_callbacks_.push_back(std::move(callback));
+
+ if (pending_callbacks_.size() > 1)
+ return;
+
+ EnsureServiceConnected();
+
+ ohos_font_lookup_service_->GetUniqueNameLookupTable(base::BindOnce(
+ &FontUniqueNameLookupOhos::ReceiveReadOnlySharedMemoryRegion,
+ base::Unretained(this)));
+}
+
+void FontUniqueNameLookupOhos::EnsureServiceConnected() {
+ if (!ohos_font_lookup_service_) {
+ Platform::Current()->GetBrowserInterfaceBroker()->GetInterface(
+ ohos_font_lookup_service_.BindNewPipeAndPassReceiver());
+ }
+}
+
+void FontUniqueNameLookupOhos::ReceiveReadOnlySharedMemoryRegion(
+ base::ReadOnlySharedMemoryRegion shared_memory_region) {
+ font_table_matcher_ =
+ std::make_unique<FontTableMatcher>(shared_memory_region.Map());
+ while (!pending_callbacks_.IsEmpty()) {
+ NotifyFontUniqueNameLookupReady callback = pending_callbacks_.TakeFirst();
+ std::move(callback).Run();
+ }
+}
+
+} // namespace blink
new file mode 100755
@@ -0,0 +1,49 @@
+// Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_LINUX_FONT_UNIQUE_NAME_LOOKUP_OHOS_H_
+#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_LINUX_FONT_UNIQUE_NAME_LOOKUP_OHOS_H_
+
+#include "base/sequence_checker.h"
+#include "mojo/public/cpp/bindings/remote.h"
+#include "third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h"
+#include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom-blink.h"
+#include "third_party/blink/public/mojom/font_unique_name_lookup/font_unique_name_lookup.mojom-blink.h"
+#include "third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h"
+#include "third_party/blink/renderer/platform/wtf/deque.h"
+
+namespace blink {
+
+class FontUniqueNameLookupOhos : public FontUniqueNameLookup {
+ public:
+ FontUniqueNameLookupOhos() = default;
+ FontUniqueNameLookupOhos(const FontUniqueNameLookupOhos&) = delete;
+ FontUniqueNameLookupOhos& operator=(const FontUniqueNameLookupOhos&) = delete;
+ ~FontUniqueNameLookupOhos() override;
+
+ bool IsFontUniqueNameLookupReadyForSyncLookup() override;
+
+ void PrepareFontUniqueNameLookup(
+ NotifyFontUniqueNameLookupReady callback) override;
+
+ sk_sp<SkTypeface> MatchUniqueName(const String& font_unique_name) override;
+
+ void Init() override;
+
+ private:
+ void EnsureServiceConnected();
+
+ void ReceiveReadOnlySharedMemoryRegion(
+ base::ReadOnlySharedMemoryRegion shared_memory_region);
+
+ mojo::Remote<mojom::blink::FontUniqueNameLookup> ohos_font_lookup_service_;
+ WTF::Deque<NotifyFontUniqueNameLookupReady> pending_callbacks_;
+ absl::optional<bool> sync_available_;
+
+ SEQUENCE_CHECKER(sequence_checker_);
+};
+
+} // namespace blink
+
+#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_LINUX_FONT_UNIQUE_NAME_LOOKUP_OHOS_H_
@@ -200,7 +200,6 @@ sk_sp<SkTypeface> FontCache::CreateTypeface(
std::string& name) {
#if !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
// TODO(fuchsia): Revisit this and other font code for Fuchsia.
-
if (creation_params.CreationType() == kCreateFontByFciIdAndTtcIndex) {
if (Platform::Current()->GetSandboxSupport()) {
return SkTypeface_Factory::FromFontConfigInterfaceIdAndTtcIndex(
@@ -242,6 +241,7 @@ sk_sp<SkTypeface> FontCache::CreateTypeface(
// the embedder provided font Manager rather than calling
// SkTypeface::CreateFromName which may redirect the call to the default font
// Manager. On Windows the font manager is always present.
+
if (font_manager_) {
auto tf = sk_sp<SkTypeface>(font_manager_->matchFamilyStyle(
name.c_str(), font_description.SkiaFontStyle()));
@@ -264,7 +264,7 @@ std::unique_ptr<FontPlatformData> FontCache::CreateFontPlatformData(
std::string name;
sk_sp<SkTypeface> typeface;
-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_OHOS)
bool noto_color_emoji_from_gmscore = false;
#if defined(OS_ANDROID)
// Use the unique local matching pathway for fetching Noto Color Emoji Compat
@@ -136,8 +136,8 @@ PLATFORM_EXPORT Vector<String> PrivilegedNoCorsHeaderNames() {
return header_names;
}
-bool IsForbiddenHeaderName(const String& name) {
- return !net::HttpUtil::IsSafeHeader(name.Latin1());
+bool IsForbiddenRequestHeader(const String& name, const String& value) {
+ return !net::HttpUtil::IsSafeHeader(name.Latin1(), value.Latin1());
}
bool ContainsOnlyCorsSafelistedHeaders(const HTTPHeaderMap& header_map) {
@@ -39,7 +39,8 @@ PLATFORM_EXPORT bool IsNoCorsSafelistedHeader(const String& name,
PLATFORM_EXPORT bool IsPrivilegedNoCorsHeaderName(const String& name);
PLATFORM_EXPORT bool IsNoCorsSafelistedHeaderName(const String& name);
PLATFORM_EXPORT Vector<String> PrivilegedNoCorsHeaderNames();
-PLATFORM_EXPORT bool IsForbiddenHeaderName(const String& name);
+PLATFORM_EXPORT bool IsForbiddenRequestHeader(const String& name,
+ const String& value);
PLATFORM_EXPORT bool ContainsOnlyCorsSafelistedHeaders(const HTTPHeaderMap&);
PLATFORM_EXPORT bool IsOkStatus(int status);
@@ -1599,7 +1599,8 @@
},
{
name: "OrientationEvent",
- status: {"Android": "stable"},
+ // BUILDFLAG(IS_OHOS)
+ status: "stable",
},
{
name: "OriginIsolationHeader",
@@ -151,8 +151,12 @@ void WidgetInputHandlerImpl::DispatchEvent(
}
#if BUILDFLAG(IS_OHOS)
-void WidgetInputHandlerImpl::StartFling() {
- soc_perf::SocPerUtil::ApplySocConfig();
+void WidgetInputHandlerImpl::TryStartFling() {
+ soc_perf::SocPerUtil::EnableFlingBoost();
+}
+
+void WidgetInputHandlerImpl::TryFinishFling() {
+ soc_perf::SocPerUtil::DisableFlingBoost();
}
#endif
@@ -62,7 +62,8 @@ class WidgetInputHandlerImpl : public mojom::blink::WidgetInputHandler {
void DispatchEvent(std::unique_ptr<WebCoalescedInputEvent>,
DispatchEventCallback callback) override;
#if BUILDFLAG(IS_OHOS)
- void StartFling() override;
+ void TryStartFling() override;
+ void TryFinishFling() override;
#endif
void DispatchNonBlockingEvent(
std::unique_ptr<WebCoalescedInputEvent>) override;
@@ -819,8 +819,14 @@ void WidgetBase::BeginMainFrame(base::TimeTicks frame_time) {
if (ShouldRecordBeginMainFrameMetrics()) {
raf_aligned_input_start_time = base::TimeTicks::Now();
}
+
+ auto weak_this = weak_ptr_factory_.GetWeakPtr();
widget_input_handler_manager_->input_event_queue()->DispatchRafAlignedInput(
frame_time);
+ // DispatchRafAlignedInput could have detached the frame.
+ if (!weak_this)
+ return;
+
if (ShouldRecordBeginMainFrameMetrics()) {
client_->RecordDispatchRafAlignedInputTime(raf_aligned_input_start_time);
}
@@ -7609,3 +7609,6 @@ crbug.com/1282347 [ Mac ] virtual/clipboard-custom-formats/clipboard/async-clipb
# Sheriff 2022-01-25
crbug.com/1289992 virtual/document-transition/document-transition/paint-order.html [ Skip ]
+
+crbug.com/1295980 [ Mac ] virtual/fenced-frame-mparch/wpt_internal/fenced_frame/script-focus.https.html [ Pass Timeout ]
+crbug.com/1295980 [ Mac ] virtual/fenced-frame-shadow-dom/wpt_internal/fenced_frame/script-focus.https.html [ Pass Timeout ]
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,17 @@
+<!doctype html>
+<html class="reftest-wait">
+<link rel="help" href="https://crbug.com/1371820">
+<style>
+ body, div, img { container-type: size; }
+</style>
+<p>Pass if no crash.</p>
+<div id="div"><img id="img" alt="a"></div>
+<script>
+ requestAnimationFrame(() => requestAnimationFrame(() => {
+ // Adds a layout root inside the div size container.
+ img.alt = img.src = "b";
+ // Marks div size container for layout which skips style recalc for the sub-tree.
+ div.style.width = "500px";
+ document.documentElement.classList.remove("reftest-wait");
+ }));
+</script>
new file mode 100644
@@ -0,0 +1,78 @@
+// To use this file, use the following imports:
+// // META: script=/common/dispatcher/dispatcher.js
+// // META: script=/common/get-host-info.sub.js
+// // META: script=/common/utils.js
+// // META: script=/resources/testdriver.js
+// // META: script=/resources/testdriver-vendor.js
+// // META: script=/resources/testharness.js
+// // META: script=/resources/testharnessreport.js
+// // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
+// // META: script=./resources/sandbox-top-navigation-helper.js
+
+// Helper file that provides various functions to test top-level navigation
+// with various frame and sandbox flag configurations.
+
+async function createNestedIframe(parent, origin, frame_sandbox, header_sandbox)
+{
+ let headers = [];
+ if (header_sandbox) {
+ headers.push([
+ "Content-Security-Policy",
+ "sandbox allow-scripts " + header_sandbox
+ ]);
+ }
+ let iframe_attributes = {};
+ if (frame_sandbox) {
+ iframe_attributes.sandbox = "allow-scripts " + frame_sandbox;
+ }
+ return parent.addIframe({
+ origin: origin,
+ scripts: [
+ '/resources/testdriver.js',
+ '/resources/testdriver-driver.js',
+ '/resources/testdriver-vendor.js'
+ ],
+ headers: headers,
+ }, iframe_attributes);
+}
+
+async function attemptTopNavigation(iframe, should_succeed) {
+ let did_succeed;
+ try {
+ await iframe.executeScript(() => {
+ window.top.location.href = "https://google.com";
+ });
+ did_succeed = true;
+ } catch (e) {
+ did_succeed = false;
+ }
+
+ assert_equals(did_succeed, should_succeed,
+ should_succeed ?
+ "The navigation should succeed." :
+ "The navigation should fail.");
+}
+
+async function setupTest() {
+ const rcHelper = new RemoteContextHelper();
+ return rcHelper.addWindow(/*config=*/ null, /*options=*/ {});
+}
+
+async function activate(iframe) {
+ return iframe.executeScript(async () => {
+ let b = document.createElement("button");
+ document.body.appendChild(b);
+
+ // Since test_driver.bless() does not play nicely with the remote context
+ // helper, this is a workaround to trigger user activation in the iframe.
+ // This adds a button to the iframe and then simulates hitting the 'tab' key
+ // twice. Once to focus on the button, and once to trigger user activation
+ // in the iframe (user activation is given to the frame that has focus when
+ // the tab key is pressed, not the frame that ends up getting focus). Note
+ // that this will result in both the parent and this frame getting user
+ // activation. Note that this currently only works for iframes nested 1
+ // level deep.
+ test_driver.set_test_context(window.top);
+ return test_driver.send_keys(document.body, "\uE004\uE004");
+ });
+}
new file mode 100644
@@ -0,0 +1,49 @@
+// META: title=Top-level navigation tests with cross origin & user activated child frames
+// META: script=/common/dispatcher/dispatcher.js
+// META: script=/common/get-host-info.sub.js
+// META: script=/common/utils.js
+// META: script=/resources/testdriver.js
+// META: script=/resources/testdriver-vendor.js
+// META: script=/resources/testharness.js
+// META: script=/resources/testharnessreport.js
+// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
+// META: script=./resources/sandbox-top-navigation-helper.js
+
+'use strict';
+
+/* ------------------------- USER ACTIVATION TESTS ------------------------- */
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "allow-top-navigation-by-user-activation", "");
+ await activate(iframe_1);
+
+ await attemptTopNavigation(iframe_1, true);
+}, "Allow top with user activation + user activation");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "allow-top-navigation-by-user-activation", "");
+
+ await attemptTopNavigation(iframe_1, false);
+}, "allow-top-navigation-by-user-activation set but no sticky activation");
+
+/* ---------------------- CROSS ORIGIN (A -> B) TESTS ---------------------- */
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_REMOTE_ORIGIN", "allow-top-navigation", "");
+
+ await attemptTopNavigation(iframe_1, true);
+}, "A cross-origin frame with frame sandbox flags can navigate top");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_REMOTE_ORIGIN", "", "allow-top-navigation");
+
+ await attemptTopNavigation(iframe_1, false);
+}, "A cross-origin frame with delivered sandbox flags can not navigate top");
new file mode 100644
@@ -0,0 +1,58 @@
+// META: title=Top-level navigation tests with child frames
+// META: script=/common/dispatcher/dispatcher.js
+// META: script=/common/get-host-info.sub.js
+// META: script=/common/utils.js
+// META: script=/resources/testdriver.js
+// META: script=/resources/testdriver-vendor.js
+// META: script=/resources/testharness.js
+// META: script=/resources/testharnessreport.js
+// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
+// META: script=./resources/sandbox-top-navigation-helper.js
+
+'use strict';
+
+/* ----------------------- SAME ORIGIN (A -> A) TESTS ----------------------- */
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "", "allow-top-navigation allow-same-origin");
+
+ await attemptTopNavigation(iframe_1, true);
+}, "A same-origin frame with delivered sandbox flags can navigate top");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "allow-top-navigation allow-same-origin", "");
+
+ await attemptTopNavigation(iframe_1, true);
+}, "A same-origin frame with frame sandbox flags can navigate top");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "", "");
+
+ await attemptTopNavigation(iframe_1, true);
+}, "A same-origin unsandboxed frame can navigate top");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "",
+ "allow-top-navigation allow-top-navigation-by-user-activation allow-same-origin");
+
+ await attemptTopNavigation(iframe_1, true);
+}, "A frame with both top navigation delivered sandbox flags uses the less \
+ restrictive one");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN",
+ "allow-top-navigation allow-top-navigation-by-user-activation", "");
+
+ await attemptTopNavigation(iframe_1, true);
+}, "A frame with both top navigation frame sandbox flags uses the less \
+ restrictive one");
new file mode 100644
@@ -0,0 +1,65 @@
+// META: title=Top-level navigation tests with frames that try to give themselves top-nav permission
+// META: script=/common/dispatcher/dispatcher.js
+// META: script=/common/get-host-info.sub.js
+// META: script=/common/utils.js
+// META: script=/resources/testdriver.js
+// META: script=/resources/testdriver-vendor.js
+// META: script=/resources/testharness.js
+// META: script=/resources/testharnessreport.js
+// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
+// META: script=./resources/sandbox-top-navigation-helper.js
+
+'use strict';
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_REMOTE_ORIGIN", "", "");
+ const iframe_2 = await createNestedIframe(iframe_1,
+ "HTTP_REMOTE_ORIGIN", "allow-top-navigation", "");
+
+ await attemptTopNavigation(iframe_2, false);
+}, "A cross origin unsandboxed frame can't escalate privileges in a child \
+ frame");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_REMOTE_ORIGIN", "allow-top-navigation", "");
+ const iframe_2 = await createNestedIframe(iframe_1,
+ "OTHER_ORIGIN", "", "");
+
+ await attemptTopNavigation(iframe_2, true);
+}, "An unsandboxed grandchild inherits its parents ability to navigate top.");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "", "");
+ const iframe_2 = await createNestedIframe(iframe_1,
+ "HTTP_ORIGIN", "allow-top-navigation", "");
+
+ await attemptTopNavigation(iframe_2, true);
+}, "A same-origin grandchild with frame allow-top can navigate top");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "", "");
+ const iframe_2 = await createNestedIframe(iframe_1,
+ "HTTP_ORIGIN", "", "allow-top-navigation");
+
+ await attemptTopNavigation(iframe_2, false);
+}, "A sandboxed same-origin grandchild without allow-same-origin can't \
+ escalate its own top-nav privileges");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "", "");
+ const iframe_2 = await createNestedIframe(iframe_1,
+ "HTTP_ORIGIN", "", "allow-same-origin allow-top-navigation");
+
+ await attemptTopNavigation(iframe_2, true);
+}, "A sandboxed same-origin grandchild with allow-same-origin can \
+ give itself top-nav privileges");
new file mode 100644
@@ -0,0 +1,52 @@
+// META: title=Top-level navigation tests with grandchild frames
+// META: script=/common/dispatcher/dispatcher.js
+// META: script=/common/get-host-info.sub.js
+// META: script=/common/utils.js
+// META: script=/resources/testdriver.js
+// META: script=/resources/testdriver-vendor.js
+// META: script=/resources/testharness.js
+// META: script=/resources/testharnessreport.js
+// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
+// META: script=./resources/sandbox-top-navigation-helper.js
+
+'use strict';
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "", "");
+ const iframe_2 = await createNestedIframe(iframe_1,
+ "HTTP_ORIGIN", "allow-scripts", "");
+
+ await attemptTopNavigation(iframe_2, false);
+}, "A fully sandboxed same-origin grandchild can't navigate top");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_ORIGIN", "", "");
+ const iframe_2 = await createNestedIframe(iframe_1,
+ "HTTP_ORIGIN", "", "");
+
+ await attemptTopNavigation(iframe_2, true);
+}, "An unsandboxed same-origin grandchild can navigate top");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_REMOTE_ORIGIN", "", "");
+ const iframe_2 = await createNestedIframe(iframe_1,
+ "HTTP_ORIGIN", "", "");
+
+ await attemptTopNavigation(iframe_2, true);
+}, "A same-origin grandchild in a cross-origin parent can navigate top");
+
+promise_test(async t => {
+ const main = await setupTest();
+ const iframe_1 = await createNestedIframe(main,
+ "HTTP_REMOTE_ORIGIN", "", "");
+ const iframe_2 = await createNestedIframe(iframe_1,
+ "HTTP_ORIGIN", "allow-top-navigation allow-same-origin", "");
+
+ await attemptTopNavigation(iframe_2, true);
+}, "A same-origin sandboxed grandchild in a cross-origin parent can navigate top");
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+<script>
+Object.prototype.__defineGetter__('then', prom);
+var prom_count = 0;
+function prom() {
+prom_count++;
+if (prom_count > 2) return;
+var v14 = x37.animate({},100);
+v14.reverse();
+v14.ready;
+v14.currentTime = 0;
+x57.reportValidity();
+}
+function f0() {
+var v38 = x37.animate({},300);
+v38.ready;
+x57.prepend(x78);
+}
+function f1() {
+var x57 = document.getElementById("x57");
+x57.disabled = false;
+}
+</script>
+</head>
+
+<body>
+<fieldset id="x37">
+<canvas onfocusin="f0()" >
+<input id="x78" autofocus="" onfocusout="f1()" >
+</canvas>
+<select id="x57" disabled="" required=""></select>
+</body>
+
+</html>
deleted file mode 100644
@@ -1,6 +0,0 @@
-CONSOLE ERROR: Unsafe attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation.html' from frame with URL 'https://localhost:8443/security/frameNavigation/resources/failed-top-navigation.html'. The frame attempting navigation of the top-level window is sandboxed and is not allowed to navigate since its ancestor frame with URL 'http://localhost:8080/security/frameNavigation/resources/cross-iframe-that-performs-top-navigation-in-sandboxed-frame.html' is unable to navigate the top frame.
-
-
-This tests that an iframe in sandbox with 'allow-top-navigation' can't navigate the top level page if its ancestor can't.
-
-DOMAIN
deleted file mode 100644
@@ -1,6 +0,0 @@
-CONSOLE ERROR: Unsafe attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox.html' from frame with URL 'https://localhost:8443/security/frameNavigation/resources/failed-top-navigation.html'. The frame attempting navigation of the top-level window is sandboxed and is not allowed to navigate since its ancestor frame with URL 'http://localhost:8080/security/frameNavigation/resources/cross-iframe-that-performs-top-navigation-in-sandboxed-frame.html' is unable to navigate the top frame.
-
-
-This tests that an iframe in a nested sandbox with 'allow-top-navigation' can't navigate the top level page if its ancestor can't.
-
-DOMAIN
deleted file mode 100644
@@ -1,10 +0,0 @@
-<html>
-
-<body>
- This should create a sandboxed iframe.
-
- <iframe sandbox="allow-scripts allow-top-navigation" src="cross-iframe-that-performs-top-navigation-in-sandboxed-frame.html"></iframe>
- The navigation should fail. This text should be visible.
-</body>
-
-</html>
deleted file mode 100644
@@ -1,3 +0,0 @@
-localhost
-
-PASSED: Navigation succeeded.
deleted file mode 100644
@@ -1,28 +0,0 @@
-<html>
-<head>
- <style>
- iframe { width: 400px; height: 200px;}
- </style>
- <script>
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
-
- function loaded()
- {
- document.getElementsByTagName('h4')[0].innerHTML = document.domain;
- var iframe = document.getElementById("i");
- // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates.
- // Because the iframe is cross-origin, it can't get the offsets itself, so leak them.
- frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*");
- }
- </script>
-</head>
-<body onload="loaded();">
- <p>This tests that an iframe in sandbox with both 'allow-top-navigation' and 'allow-top-navigation-by-user-activation'
- can navigate the top level page with a user gesture: Basically the later flag is ignored.</p>
- <h4>DOMAIN</h4>
- <iframe id="i" sandbox="allow-scripts allow-top-navigation allow-top-navigation-by-user-activation" src="resources/iframe-that-performs-parent-navigation.html"></iframe>
-</body>
-</html>
deleted file mode 100644
@@ -1,3 +0,0 @@
-localhost
-
-PASSED: Navigation succeeded.
deleted file mode 100644
@@ -1,28 +0,0 @@
-<html>
-<head>
- <style>
- iframe { width: 400px; height: 200px;}
- </style>
- <script>
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
-
- function loaded()
- {
- document.getElementsByTagName('h4')[0].innerHTML = document.domain;
- var iframe = document.getElementById("i");
- // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates.
- // Because the iframe is cross-origin, it can't get the offsets itself, so leak them.
- frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*");
- }
- </script>
-</head>
-<body onload="loaded();">
- <p>This tests that an iframe in sandbox with 'allow-top-navigation-by-user-activation'
- can navigate the top level page, if it is trigged by a user gesture.</p>
- <h4>DOMAIN</h4>
- <iframe id="i" sandbox="allow-scripts allow-top-navigation-by-user-activation" src="resources/iframe-that-performs-parent-navigation.html"></iframe>
-</body>
-</html>
deleted file mode 100644
@@ -1,6 +0,0 @@
-CONSOLE ERROR: Unsafe attempt to initiate navigation for frame with origin 'http://127.0.0.1:8000' from frame with URL 'https://localhost:8443/security/frameNavigation/resources/failed-top-navigation.html'. The frame attempting navigation of the top-level window is sandboxed and is not allowed to navigate since its ancestor frame with origin 'http://localhost:8080' is unable to navigate the top frame.
-
-
-This tests that an iframe in sandbox with 'allow-top-navigation' can't navigate the top level page if its ancestor can't.
-
-DOMAIN
deleted file mode 100644
@@ -1,6 +0,0 @@
-CONSOLE ERROR: Unsafe attempt to initiate navigation for frame with origin 'http://127.0.0.1:8000' from frame with URL 'https://localhost:8443/security/frameNavigation/resources/failed-top-navigation.html'. The frame attempting navigation of the top-level window is sandboxed and is not allowed to navigate since its ancestor frame with origin 'null' is unable to navigate the top frame.
-
-
-This tests that an iframe in a nested sandbox with 'allow-top-navigation' can't navigate the top level page if its ancestor can't.
-
-DOMAIN
deleted file mode 100644
@@ -1,32 +0,0 @@
-<html>
-
-<head>
- <style>
- iframe {
- width: 400px;
- height: 200px;
- }
- </style>
- <script>
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
- window.addEventListener("message", e => {
- if (e.data == "PASS")
- testRunner.notifyDone();
- else
- testRunner.testFailed("'top.location' didn't throw.");
- });
- </script>
-</head>
-
-<body>
- <p>This tests that an iframe in a nested sandbox with 'allow-top-navigation'
- can't navigate the top level page if its ancestor can't.</p>
- <h4>DOMAIN</h4>
- <iframe
- src="http://localhost:8080/security/frameNavigation/resources/cross-iframe-that-performs-top-navigation-in-nested-sandboxed-frame.html"></iframe>
-</body>
-
-</html>
deleted file mode 100644
@@ -1,32 +0,0 @@
-<html>
-
-<head>
- <style>
- iframe {
- width: 400px;
- height: 200px;
- }
- </style>
- <script>
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
- window.addEventListener("message", e => {
- if (e.data == "PASS")
- testRunner.notifyDone();
- else
- testRunner.testFailed("'top.location' didn't throw.");
- });
- </script>
-</head>
-
-<body>
- <p>This tests that an iframe in sandbox with 'allow-top-navigation'
- can't navigate the top level page if its ancestor can't.</p>
- <h4>DOMAIN</h4>
- <iframe
- src="http://localhost:8080/security/frameNavigation/resources/cross-iframe-that-performs-top-navigation-in-sandboxed-frame.html"></iframe>
-</body>
-
-</html>
new file mode 100644
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Anchor based focusing across a fenced frame boundary</title>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-actions.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<script src="/common/dispatcher/dispatcher.js"></script>
+<script src="resources/utils.js"></script>
+
+<body>
+<script>
+function attemptAutofocus(frame) {
+ return frame.execute(async () => {
+ let autofocusInput = document.createElement('input');
+ autofocusInput.id = "myinput";
+ document.body.appendChild(autofocusInput);
+ document.location.href = document.location.href + "#myinput";
+ await new Promise(resolve => requestAnimationFrame(resolve));
+ return document.activeElement == autofocusInput;
+ });
+}
+
+promise_test(async () => {
+ const frame = attachFencedFrameContext();
+ let autofocusIsFocused = await attemptAutofocus(frame);
+ assert_false(autofocusIsFocused,
+ "element should not get focus through anchor focusing");
+}, "Anchor focusing is blocked on an element in a fenced frame " +
+ "without user activation.");
+
+promise_test(async () => {
+ const frame = attachFencedFrameContext();
+ const actions = new test_driver.Actions();
+ await actions.pointerMove(0, 0, {origin: frame.element})
+ .pointerDown()
+ .pointerUp()
+ .send();
+ let autofocusIsFocused = await attemptAutofocus(frame);
+ assert_true(autofocusIsFocused,
+ "element should get focus through anchor focusing");
+}, "Anchor focusing is allowed on an element in a fenced frame " +
+ "with user activation.");
+</script>
+</body>
+</html>
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,205 @@
+<!DOCTYPE html>
+<title>Test Script-Based Focus for Fenced Frames</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-actions.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script src="/common/utils.js"></script>
+<script src="resources/utils.js"></script>
+<script src="/common/dispatcher/dispatcher.js"></script>
+
+<script src="/common/get-host-info.sub.js"></script>
+
+<body>
+<script>
+async function AttemptButtonFocus(frame, expecting_focus) {
+ await frame.execute(async (expecting_focus) => {
+ const button = document.createElement("button");
+ document.body.append(button);
+ button.focus();
+ assert_equals(document.activeElement == button, expecting_focus,
+ "Button's focus should match expected focus");
+ }, [expecting_focus]);
+}
+
+async function ClickOn(element, actions) {
+ // Wait until the window size is initialized.
+ while (window.innerWidth == 0) {
+ await new Promise(resolve => requestAnimationFrame(resolve));
+ }
+ await actions.pointerMove(0, 0, {origin: element})
+ .pointerDown()
+ .pointerUp()
+ .send();
+}
+
+async function SetupTest(click=true) {
+ // Clean up any leftover frames from prior tests.
+ document.querySelectorAll("fencedframe").forEach(e => {
+ e.remove();
+ })
+
+ const actions = new test_driver.Actions();
+
+ const frame = attachFencedFrameContext();
+ const fencedframe_element = frame.element;
+
+ if (click)
+ await ClickOn(document.body, actions);
+
+ return [actions, frame, fencedframe_element];
+}
+
+promise_test(async () => {
+ const [actions, ff1, ff1_element] = await SetupTest(false);
+
+ await ClickOn(ff1_element, actions);
+ await AttemptButtonFocus(ff1, true);
+
+ const button = document.createElement("button");
+ document.body.append(button);
+ button.focus();
+ assert_false(document.activeElement == button,
+ "The button should not have focus");
+ assert_false(navigator.userActivation.isActive,
+ "Window should not have user activation");
+}, "An embedder cannot pull focus out of a fenced frame");
+
+promise_test(async () => {
+ const [actions, frame, fencedframe_element] = await SetupTest();
+
+ await AttemptButtonFocus(frame, false);
+ await ClickOn(fencedframe_element, actions);
+ await AttemptButtonFocus(frame, true);
+}, "Fenced frames can't pull script focus until getting user activation");
+
+promise_test(async () => {
+ const [actions, frame, fencedframe_element] = await SetupTest();
+
+ await ClickOn(fencedframe_element, actions);
+ await ClickOn(document.body, actions);
+
+ await AttemptButtonFocus(frame, true);
+
+ // Give the browser time to receive the focus event before attempting
+ // another focus.
+ await setTimeout(async () => {await AttemptButtonFocus(frame, true);}, 20);
+}, "Focused fenced frames can move programmatic focus within frame");
+
+promise_test(async () => {
+ const [actions, frame, fencedframe_element] = await SetupTest();
+
+ await ClickOn(fencedframe_element, actions);
+ await ClickOn(document.body, actions);
+
+ // This will pull focus across a frame boundary and consume user activation.
+ await AttemptButtonFocus(frame, true);
+
+ await ClickOn(document.body, actions);
+ await AttemptButtonFocus(frame, false);
+}, "Script focus into a fenced frame consumes user activation");
+
+promise_test(async () => {
+ const [actions, ff1, ff1_element] = await SetupTest();
+
+ const ff2 = attachFencedFrameContext();
+ const ff2_element = ff2.element;
+
+ await ClickOn(ff1_element, actions);
+
+ await AttemptButtonFocus(ff1, true);
+ await AttemptButtonFocus(ff2, false);
+}, "Another fenced frame cannot pull focus out of a focused fenced frame");
+
+promise_test(async () => {
+ const [actions, ff1, ff1_element] = await SetupTest();
+
+ await ClickOn(ff1_element, actions);
+ await AttemptButtonFocus(ff1, true);
+
+ await ff1.execute(async () => {
+ const ff2 = attachFencedFrameContext();
+
+ await ff2.execute(async () => {
+ const button = document.createElement("button");
+ document.body.append(button);
+ button.focus();
+ assert_false(document.activeElement == button,
+ "The button should not have focus");
+ assert_false(navigator.userActivation.isActive,
+ "The fenced frame should not have user activation");
+ });
+ });
+}, "A fenced frame nested in another fenced frame cannot pull focus");
+
+promise_test(async () => {
+ const [actions, ff1, ff1_element] = await SetupTest();
+
+ await ClickOn(document.body, actions);
+
+ const button = document.createElement("button");
+ document.body.append(button);
+ button.focus();
+ assert_equals(document.activeElement, button,
+ "The button in the main page should have focus.");
+
+ await ff1.execute(async () => {
+ assert_false(navigator.userActivation.isActive,
+ "The fenced frame should not have user activation.");
+ window.focus();
+ });
+
+ assert_equals(document.activeElement, button,
+ "The button in the main page should still have focus.");
+}, "A fenced frame cannot pull window.focus() without user activation");
+
+promise_test(async () => {
+ const [actions, ff1, ff1_element] = await SetupTest();
+
+ await ClickOn(ff1_element, actions);
+ await ClickOn(document.body, actions);
+
+ const button = document.createElement("button");
+ document.body.append(button);
+ button.focus();
+ assert_equals(document.activeElement, button,
+ "The button should have focus.");
+
+ await ff1.execute(async () => {
+ assert_true(navigator.userActivation.isActive,
+ "The fenced frame should have user activation.");
+ window.focus();
+ assert_false(navigator.userActivation.isActive,
+ "The fenced frame's user activation should be consumed by the focus");
+ });
+
+ assert_equals(document.activeElement, document.body,
+ "The main page's focus should be pulled away from the button.");
+}, "A fenced frame can pull window.focus() after user activation");
+
+promise_test(async () => {
+ var actions = new test_driver.Actions();
+
+ const frame = attachIFrameContext(
+ {origin: get_host_info().HTTPS_REMOTE_ORIGIN});
+ const iframe_element =
+ document.body.getElementsByTagName('iframe')[0];
+
+ await frame.execute(async () => {
+ const button = document.createElement("button");
+ document.body.append(button);
+ button.focus();
+ assert_equals(document.activeElement, button,
+ "The button in the iframe should have focus.");
+ }, [true]);
+
+ const button = document.createElement("button");
+ document.body.append(button);
+ button.focus();
+ assert_equals(document.activeElement, button,
+ "The button in the main page should have focus.");
+}, "An cross-origin iframe can pull focus back and forth without activation");
+
+</script>
+</body>
\ No newline at end of file
@@ -331,6 +331,11 @@ ssize_t PtraceClient::ReadUpTo(VMAddress address, size_t size, void* buffer) {
return total_read;
}
+ if (static_cast<size_t>(bytes_read) > size) {
+ LOG(ERROR) << "invalid size " << bytes_read;
+ return -1;
+ }
+
if (!LoggingReadFileExactly(sock_, buffer_c, bytes_read)) {
return -1;
}
@@ -105,9 +105,10 @@ export let load = function(
arg0: boolean, arg1: {
[x: string]: string,
},
- arg2: string, arg3: LoadErrorDescription) => void): void {
+ arg2: string, arg3: LoadErrorDescription) => void,
+ allowRemoteFilePaths: boolean): void {
const stream = new Common.StringOutputStream.StringOutputStream();
- loadAsStream(url, headers, stream, mycallback);
+ loadAsStream(url, headers, stream, mycallback, allowRemoteFilePaths);
function mycallback(
success: boolean, headers: {
@@ -233,6 +234,15 @@ const loadXHR = (url: string): Promise<string> => {
});
};
+function canBeRemoteFilePath(url: string): boolean {
+ try {
+ const urlObject = new URL(url);
+ return urlObject.protocol === 'file:' && urlObject.host !== '';
+ } catch (exception) {
+ return false;
+ }
+}
+
export const loadAsStream = function(
url: string, headers: {
[x: string]: string,
@@ -242,7 +252,8 @@ export const loadAsStream = function(
((arg0: boolean, arg1: {
[x: string]: string,
},
- arg2: LoadErrorDescription) => void)): void {
+ arg2: LoadErrorDescription) => void),
+ allowRemoteFilePaths?: boolean): void {
const streamId = _bindOutputStream(stream);
const parsedURL = new Common.ParsedURL.ParsedURL(url);
if (parsedURL.isDataURL()) {
@@ -250,6 +261,19 @@ export const loadAsStream = function(
return;
}
+ if (!allowRemoteFilePaths && canBeRemoteFilePath(url)) {
+ // Remote file paths can cause security problems, see crbug.com/1342722.
+ if (callback) {
+ callback(/* success */ false, /* headers */ {}, {
+ statusCode: 400, // BAD_REQUEST
+ netError: -20, // BLOCKED_BY_CLIENT
+ netErrorName: 'net::BLOCKED_BY_CLIENT',
+ message: 'Loading from a remote file path is prohibited for security reasons.',
+ });
+ }
+ return;
+ }
+
const rawHeaders = [];
if (headers) {
for (const key in headers) {
@@ -55,6 +55,10 @@ export class DevToolsLocale {
return devToolsLocaleInstance as DevToolsLocale;
}
+ static removeInstance(): void {
+ devToolsLocaleInstance = null;
+ }
+
forceFallbackLocale(): void {
// Locale is 'readonly', this is the only case where we want to forceably
// overwrite the locale.
@@ -692,6 +692,9 @@
"core/sdk/sdk-meta.ts | enableNetworkRequestBlocking": {
"message": "Enable network request blocking"
},
+ "core/sdk/sdk-meta.ts | enableRemoteFileLoading": {
+ "message": "Allow DevTools to load resources, such as source maps, from remote file paths. Disabled by default for security reasons."
+ },
"core/sdk/sdk-meta.ts | enableWebpFormat": {
"message": "Enable WebP format"
},
@@ -692,6 +692,9 @@
"core/sdk/sdk-meta.ts | enableNetworkRequestBlocking": {
"message": "Êńâb́l̂é n̂ét̂ẃôŕk̂ ŕêq́ûéŝt́ b̂ĺôćk̂ín̂ǵ"
},
+ "core/sdk/sdk-meta.ts | enableRemoteFileLoading": {
+ "message": "Âĺl̂óŵ DevTools t́ô ĺôád̂ ŕêśôúr̂ćêś, ŝúĉh́ âś ŝóûŕĉé m̂áp̂ś, f̂ŕôḿ r̂ém̂ót̂é f̂íl̂é p̂át̂h́ŝ. D́îśâb́l̂éd̂ b́ŷ d́êf́âúl̂t́ f̂ór̂ śêćûŕît́ŷ ŕêáŝón̂ś."
+ },
"core/sdk/sdk-meta.ts | enableWebpFormat": {
"message": "Êńâb́l̂é WebP f̂ór̂ḿât́"
},
@@ -1442,10 +1442,13 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
headers['Cache-Control'] = 'no-cache';
}
+ const allowRemoteFilePaths =
+ Common.Settings.Settings.instance().moduleSetting('network.enable-remote-file-loading').get();
+
return new Promise(
resolve => Host.ResourceLoader.load(url, headers, (success, _responseHeaders, content, errorDescription) => {
resolve({success, content, errorDescription});
- }));
+ }, allowRemoteFilePaths));
}
}
@@ -314,6 +314,11 @@ const UIStrings = {
* emulates that the webpage is in auto dark mode.
*/
emulateAutoDarkMode: 'Emulate auto dark mode',
+ /**
+ * @description Label of a checkbox in the DevTools settings UI.
+ */
+ enableRemoteFileLoading:
+ 'Allow `DevTools` to load resources, such as source maps, from remote file paths. Disabled by default for security reasons.',
};
const str_ = i18n.i18n.registerUIStrings('core/sdk/sdk-meta.ts', UIStrings);
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
@@ -1033,3 +1038,12 @@ Common.Settings.registerSettingExtension({
storageType: Common.Settings.SettingStorageType.Session,
defaultValue: false,
});
+
+Common.Settings.registerSettingExtension({
+ category: Common.Settings.SettingCategory.SOURCES,
+ storageType: Common.Settings.SettingStorageType.Synced,
+ title: i18nLazyString(UIStrings.enableRemoteFileLoading),
+ settingName: 'network.enable-remote-file-loading',
+ settingType: Common.Settings.SettingType.BOOLEAN,
+ defaultValue: false,
+});
@@ -79,17 +79,8 @@ export class TimelineLoader implements Common.StringOutputStream.OutputStream {
static loadFromEvents(events: SDK.TracingManager.EventPayload[], client: Client): TimelineLoader {
const loader = new TimelineLoader(client);
-
window.setTimeout(async () => {
- const eventsPerChunk = 5000;
- client.loadingStarted();
- for (let i = 0; i < events.length; i += eventsPerChunk) {
- const chunk = events.slice(i, i + eventsPerChunk);
- (loader.tracingModel as SDK.TracingModel.TracingModel).addEvents(chunk);
- client.loadingProgress((i + chunk.length) / events.length);
- await new Promise(r => window.setTimeout(r)); // Yield event loop to paint.
- }
- void loader.close();
+ void loader.addEvents(events);
});
return loader;
@@ -97,10 +88,39 @@ export class TimelineLoader implements Common.StringOutputStream.OutputStream {
static loadFromURL(url: string, client: Client): TimelineLoader {
const loader = new TimelineLoader(client);
- Host.ResourceLoader.loadAsStream(url, null, loader);
+ const stream = new Common.StringOutputStream.StringOutputStream();
+ client.loadingStarted();
+
+ const allowRemoteFilePaths =
+ Common.Settings.Settings.instance().moduleSetting('network.enable-remote-file-loading').get();
+ Host.ResourceLoader.loadAsStream(url, null, stream, finishedCallback, allowRemoteFilePaths);
+
+ function finishedCallback(
+ success: boolean, _headers: {[x: string]: string},
+ errorDescription: Host.ResourceLoader.LoadErrorDescription): void {
+ if (!success) {
+ return loader.reportErrorAndCancelLoading(errorDescription.message);
+ }
+ const txt = stream.data();
+ const events = JSON.parse(txt);
+ void loader.addEvents(events);
+ }
+
return loader;
}
+ async addEvents(events: SDK.TracingManager.EventPayload[]): Promise<void> {
+ this.client?.loadingStarted();
+ const eventsPerChunk = 5000;
+ for (let i = 0; i < events.length; i += eventsPerChunk) {
+ const chunk = events.slice(i, i + eventsPerChunk);
+ (this.tracingModel as SDK.TracingModel.TracingModel).addEvents(chunk);
+ this.client?.loadingProgress((i + chunk.length) / events.length);
+ await new Promise(r => window.setTimeout(r)); // Yield event loop to paint.
+ }
+ void this.close();
+ }
+
cancel(): void {
this.tracingModel = null;
this.backingStorage.reset();
@@ -4,9 +4,12 @@
const {assert} = chai;
-import type * as Host from '../../../../../front_end/core/host/host.js';
+import * as Common from '../../../../../front_end/core/common/common.js';
+import * as Host from '../../../../../front_end/core/host/host.js';
import * as SDK from '../../../../../front_end/core/sdk/sdk.js';
+import * as Platform from '../../../../../front_end/core/platform/platform.js';
import type * as Protocol from '../../../../../front_end/generated/protocol.js';
+import {describeWithEnvironment, describeWithLocale} from '../../helpers/EnvironmentHelpers.js';
interface LoadResult {
success: boolean;
@@ -14,7 +17,13 @@ interface LoadResult {
errorDescription: Host.ResourceLoader.LoadErrorDescription;
}
-describe('PageResourceLoader', () => {
+const initiator = {
+ target: null,
+ frameId: '123' as Protocol.Page.FrameId,
+ initiatorUrl: ''
+};
+
+describeWithLocale('PageResourceLoader', () => {
const loads: Array<{url: string}> = [];
const load = (url: string): Promise<LoadResult> => {
loads.push({url});
@@ -26,8 +35,6 @@ describe('PageResourceLoader', () => {
});
};
- const initiator = {target: null, frameId: '123' as Protocol.Page.FrameId, initiatorUrl: ''};
-
beforeEach(() => {
loads.length = 0;
});
@@ -120,3 +127,85 @@ describe('PageResourceLoader', () => {
assert.isTrue(resources.every(x => x.success));
});
});
+
+// Loading via host bindings requires the settings infra to be booted.
+describeWithEnvironment('PageResourceLoader', () => {
+ it('blocks UNC file paths with the default setting', async () => {
+ if (!Host.Platform.isWin()) {
+ return;
+ }
+
+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance(
+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000});
+
+ const message =
+ await loader
+ .loadResource('file:////127.0.0.1/share/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator)
+ .catch(e => e.message);
+
+ assert.include(message, 'remote file');
+ });
+
+ it('blocks remote file paths with the default setting', async () => {
+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance(
+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000});
+
+ const message =
+ await loader.loadResource('file://host/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator)
+ .catch(e => e.message);
+
+ assert.include(message, 'remote file');
+ });
+
+ it('blocks UNC file paths with a backslash on Windows with the default setting', async () => {
+ if (!Host.Platform.isWin()) {
+ return;
+ }
+
+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance(
+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000});
+
+ const message =
+ await loader
+ .loadResource('file:///\\127.0.0.1/share/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator)
+ .catch(e => e.message);
+
+ assert.include(message, 'remote file');
+ });
+
+ it('allows remote file paths with the setting enabled', async () => {
+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance(
+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000});
+ sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'loadNetworkResource')
+ .callsFake((_url, _headers, streamId, callback) => {
+ Host.ResourceLoader.streamWrite(streamId, 'content of the source map');
+ callback({statusCode: 200});
+ });
+
+ Common.Settings.Settings.instance().moduleSetting('network.enable-remote-file-loading').set(true);
+ const response =
+ await loader.loadResource('file://host/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator);
+
+ assert.strictEqual(response.content, 'content of the source map');
+ });
+
+ it('allows UNC paths on Windows with the setting enabled', async () => {
+ if (!Host.Platform.isWin()) {
+ return;
+ }
+
+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance(
+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000});
+ sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'loadNetworkResource')
+ .callsFake((_url, _headers, streamId, callback) => {
+ Host.ResourceLoader.streamWrite(streamId, 'content of the source map');
+ callback({statusCode: 200});
+ });
+
+ Common.Settings.Settings.instance().moduleSetting('network.enable-remote-file-loading').set(true);
+ const response = await loader.loadResource(
+ 'file:////127.0.0.1/share/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator);
+
+ assert.strictEqual(response.content, 'content of the source map');
+ });
+});
@@ -5,6 +5,7 @@
const {assert} = chai;
import * as SDK from '../../../../../front_end/core/sdk/sdk.js';
+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js';
describe('ServerTiming', () => {
it('can be instantiated correctly', () => {
@@ -15,7 +16,7 @@ describe('ServerTiming', () => {
});
});
-describe('SDK.ServerTiming.ServerTiming.createFromHeaderValue', () => {
+describeWithLocale('SDK.ServerTiming.ServerTiming.createFromHeaderValue', () => {
it('parses headers correctly', () => {
// A real-world-like example with some edge cases.
const actual = SDK.ServerTiming.ServerTiming.createFromHeaderValue(
@@ -48,25 +48,7 @@ const REGISTERED_EXPERIMENTS = [
];
export async function initializeGlobalVars({reset = true} = {}) {
- // Expose the locale.
- i18n.DevToolsLocale.DevToolsLocale.instance({
- create: true,
- data: {
- navigatorLanguage: 'en-US',
- settingLanguage: 'en-US',
- lookupClosestDevToolsLocale: () => 'en-US',
- },
- });
-
- // Load the strings from the resource file.
- const locale = i18n.DevToolsLocale.DevToolsLocale.instance().locale;
- // proxied call.
- try {
- await i18n.i18n.fetchAndRegisterLocaleData(locale);
- } catch (error) {
- // eslint-disable-next-line no-console
- console.warn('EnvironmentHelper: Loading en-US locale failed', error.message);
- }
+ await initializeGlobalLocaleVars();
// Create the appropriate settings needed to boot.
const settings = [
@@ -150,6 +132,9 @@ export async function initializeGlobalVars({reset = true} = {}) {
Common.Settings.SettingCategory.APPEARANCE, 'uiTheme', 'systemPreferred', Common.Settings.SettingType.ENUM),
createSettingValue(
Common.Settings.SettingCategory.APPEARANCE, 'language', 'en-US', Common.Settings.SettingType.ENUM),
+ createSettingValue(
+ Common.Settings.SettingCategory.SOURCES, 'network.enable-remote-file-loading', false,
+ Common.Settings.SettingType.BOOLEAN),
];
Common.Settings.registerSettingsForTest(settings, reset);
@@ -185,6 +170,7 @@ export async function deinitializeGlobalVars() {
Root.Runtime.experiments.clearForTest();
// Remove instances.
+ await deinitializeGlobalLocaleVars();
SDK.TargetManager.TargetManager.removeInstance();
Root.Runtime.Runtime.removeInstance();
Common.Settings.Settings.removeInstance();
@@ -210,6 +196,40 @@ export function describeWithEnvironment(title: string, fn: (this: Mocha.Suite) =
});
}
+export async function initializeGlobalLocaleVars() {
+ // Expose the locale.
+ i18n.DevToolsLocale.DevToolsLocale.instance({
+ create: true,
+ data: {
+ navigatorLanguage: 'en-US',
+ settingLanguage: 'en-US',
+ lookupClosestDevToolsLocale: () => 'en-US',
+ },
+ });
+
+ // Load the strings from the resource file.
+ const locale = i18n.DevToolsLocale.DevToolsLocale.instance().locale;
+ // proxied call.
+ try {
+ await i18n.i18n.fetchAndRegisterLocaleData(locale);
+ } catch (error) {
+ // eslint-disable-next-line no-console
+ console.warn('EnvironmentHelper: Loading en-US locale failed', error.message);
+ }
+}
+
+export function deinitializeGlobalLocaleVars() {
+ i18n.DevToolsLocale.DevToolsLocale.removeInstance();
+}
+
+export function describeWithLocale(title: string, fn: (this: Mocha.Suite) => void) {
+ return describe(`locale-${title}`, () => {
+ before(async () => await initializeGlobalLocaleVars());
+ after(deinitializeGlobalLocaleVars);
+ describe(title, fn);
+ });
+}
+
export function createFakeSetting<T>(name: string, defaultValue: T): Common.Settings.Setting<T> {
const storage = new Common.Settings.SettingsStorage({}, Common.Settings.NOOP_STORAGE, 'test');
return new Common.Settings.Setting(name, defaultValue, new Common.ObjectWrapper.ObjectWrapper(), storage);
@@ -9,6 +9,7 @@ import * as SDK from '../../../../../front_end/core/sdk/sdk.js';
import * as UI from '../../../../../front_end/ui/legacy/legacy.js';
import * as HAR from '../../../../../front_end/models/har/har.js';
import type * as Protocol from '../../../../../front_end/generated/protocol.js';
+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js';
const simulateRequestWithStartTime = (startTime: number): SDK.NetworkRequest.NetworkRequest => {
const requestId = 'r0' as Protocol.Network.RequestId;
@@ -18,7 +19,7 @@ const simulateRequestWithStartTime = (startTime: number): SDK.NetworkRequest.Net
return request;
};
-describe('HARWriter', () => {
+describeWithLocale('HARWriter', () => {
it('can correctly sort exported requests logs', async () => {
const req1Time = new Date(2020, 0, 3);
const req2Time = new Date(2020, 1, 3);
@@ -7,10 +7,11 @@ const {assert} = chai;
import type * as SDKModule from '../../../../../front_end/core/sdk/sdk.js';
import * as Resources from '../../../../../front_end/panels/application/application.js';
import * as Protocol from '../../../../../front_end/generated/protocol.js';
+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js';
import View = Resources.ServiceWorkerUpdateCycleView;
-describe('ServiceWorkerUpdateCycleView', () => {
+describeWithLocale('ServiceWorkerUpdateCycleView', () => {
let versionId = 0;
let SDK: typeof SDKModule;
before(async () => {
@@ -6,6 +6,7 @@ import * as ApplicationComponents from '../../../../../../front_end/panels/appli
import * as DataGrid from '../../../../../../front_end/ui/components/data_grid/data_grid.js';
import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js';
import {assertShadowRoot, getElementWithinComponent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
import {getHeaderCells, getValuesOfAllBodyRows} from '../../../ui/components/DataGridHelpers.js';
const {assert} = chai;
@@ -38,7 +39,7 @@ const getHeaderText = (cell: HTMLTableCellElement): string|null => {
cell.querySelector('devtools-resources-endpoints-grid-status-header')?.shadowRoot?.textContent?.trim() || null;
};
-describe('EndpointsGrid', async () => {
+describeWithLocale('EndpointsGrid', async () => {
it('displays placeholder text if no data', async () => {
const component = new ApplicationComponents.EndpointsGrid.EndpointsGrid();
renderElementIntoDOM(component);
@@ -7,6 +7,7 @@ import * as ApplicationComponents from '../../../../../../front_end/panels/appli
import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js';
import * as TreeOutline from '../../../../../../front_end/ui/components/tree_outline/tree_outline.js';
import {assertElement, assertShadowRoot, getElementWithinComponent, renderElementIntoDOM, stripLitHtmlCommentNodes} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
@@ -204,7 +205,7 @@ async function waitForRenderedTreeNodeCount(shadowRoot: ShadowRoot, expectedNode
});
}
-describe('OriginTrialTreeView', () => {
+describeWithLocale('OriginTrialTreeView', () => {
it('renders trial names as root tree nodes', async () => {
const {shadowRoot} = await renderOriginTrialTreeViewTreeOutline({
trials: [
@@ -8,6 +8,7 @@ import * as ExpandableList from '../../../../../../front_end/ui/components/expan
import * as Components from '../../../../../../front_end/ui/legacy/components/utils/utils.js';
import type * as Protocol from '../../../../../../front_end/generated/protocol.js';
import {assertElement, assertShadowRoot, dispatchClickEvent, getCleanTextContentFromElements, getElementWithinComponent, getElementsWithinComponent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
@@ -40,7 +41,7 @@ function mockBuildStackTraceRows(
const fakeScriptId = '1' as Protocol.Runtime.ScriptId;
-describe('StackTrace', () => {
+describeWithLocale('StackTrace', () => {
it('does not generate rows when there is no data', () => {
const component = new ApplicationComponents.StackTrace.StackTrace();
const rows = component.createRowTemplates();
@@ -8,6 +8,7 @@ import * as Coordinator from '../../../../../../front_end/ui/components/render_c
import type * as Protocol from '../../../../../../front_end/generated/protocol.js';
import {assertElement, assertShadowRoot, dispatchClickEvent, getElementWithinComponent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
import {getCellByIndexes, getValuesOfAllBodyRows} from '../../../ui/components/DataGridHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
@@ -35,7 +36,7 @@ function getInternalDataGridShadowRoot(component: ApplicationComponents.TrustTok
return dataGrid.shadowRoot;
}
-describe('TrustTokensView', () => {
+describeWithLocale('TrustTokensView', () => {
it('renders trust token data', async () => {
const component = await renderTrustTokensView([
{issuerOrigin: 'foo.com', count: 42},
@@ -5,10 +5,11 @@
import * as ElementsComponents from '../../../../../../front_end/panels/elements/components/components.js';
import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js';
import {assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
-describe('AccessibilityTreeNode', () => {
+describeWithLocale('AccessibilityTreeNode', () => {
it('renders role and name correctly for unignored nodes', async () => {
const component = new ElementsComponents.AccessibilityTreeNode.AccessibilityTreeNode();
renderElementIntoDOM(component);
@@ -5,10 +5,11 @@
import * as Common from '../../../../../../front_end/core/common/common.js';
import * as ElementsComponents from '../../../../../../front_end/panels/elements/components/components.js';
import {assertElement, assertShadowRoot, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
-describe('LayoutPane', async () => {
+describeWithLocale('LayoutPane', async () => {
function queryLabels(component: HTMLElement, selector: string) {
assertShadowRoot(component.shadowRoot);
return Array.from(component.shadowRoot.querySelectorAll(selector)).map(label => {
@@ -4,10 +4,11 @@
import * as ElementsComponents from '../../../../../../front_end/panels/elements/components/components.js';
import {assertElement, assertShadowRoot, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
-describe('StylePropertyEditor', async () => {
+describeWithLocale('StylePropertyEditor', async () => {
function assertValues(component: HTMLElement, values: string[]) {
assertShadowRoot(component.shadowRoot);
const propertyElements = component.shadowRoot.querySelectorAll('.property');
@@ -8,8 +8,9 @@ import * as IssuesManager from '../../../../../front_end/models/issues_manager/i
import type * as SDK from '../../../../../front_end/core/sdk/sdk.js';
import {MockIssuesModel} from '../../models/issues_manager/MockIssuesModel.js';
import * as Protocol from '../../../../../front_end/generated/protocol.js';
+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js';
-describe('GenericIssue', async () => {
+describeWithLocale('GenericIssue', async () => {
const mockModel = new MockIssuesModel([]) as unknown as SDK.IssuesModel.IssuesModel;
function createProtocolIssueWithoutDetails(): Protocol.Audits.InspectorIssue {
@@ -6,10 +6,11 @@ import {assertNotNullOrUndefined} from '../../../../../../front_end/core/platfor
import * as Protocol from '../../../../../../front_end/generated/protocol.js';
import * as NetworkComponents from '../../../../../../front_end/panels/network/components/components.js';
import {getElementsWithinComponent, getElementWithinComponent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
-describe('RequestTrustTokensView', () => {
+describeWithLocale('RequestTrustTokensView', () => {
const mockId = 'mockId' as Protocol.Network.RequestId;
const renderRequestTrustTokensView = () => {
@@ -4,10 +4,11 @@
import * as EmulationComponents from '../../../../../../../front_end/panels/settings/emulation/components/components.js';
import * as Buttons from '../../../../../../../front_end/ui/components/buttons/buttons.js';
import {getElementsWithinComponent, getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
-describe('UserAgentClientHintsForm', () => {
+describeWithLocale('UserAgentClientHintsForm', () => {
const testMetaData = {
brands: [
{
@@ -3,10 +3,11 @@
// found in the LICENSE file.
import * as TimelineComponents from '../../../../../../front_end/panels/timeline/components/components.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
-describe('WebVitalsTimeline', () => {
+describeWithLocale('WebVitalsTimeline', () => {
it('should instantiate without problems', () => {
const node = new TimelineComponents.WebVitalsTimeline.WebVitalsTimeline();
assert.instanceOf(node, TimelineComponents.WebVitalsTimeline.WebVitalsTimeline);
@@ -5,8 +5,9 @@
const {assert} = chai;
import * as UI from '../../../../front_end/ui/legacy/legacy.js';
+import {describeWithLocale} from '../helpers/EnvironmentHelpers.js';
-describe('ListWidget', () => {
+describeWithLocale('ListWidget', () => {
it('Cancel button triggers on mouse click event', () => {
const editor = new UI.ListWidget.Editor<string>();
document.body.appendChild(editor.element);
@@ -4,13 +4,14 @@
import * as Linkifier from '../../../../../front_end/ui/components/linkifier/linkifier.js';
import * as Coordinator from '../../../../../front_end/ui/components/render_coordinator/render_coordinator.js';
+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js';
const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
import {assertElement, assertShadowRoot, dispatchClickEvent, getEventPromise, renderElementIntoDOM} from '../../helpers/DOMHelpers.js';
const {assert} = chai;
-describe('Linkifier', () => {
+describeWithLocale('Linkifier', () => {
it('renders a link when given a URL', async () => {
const component = new Linkifier.Linkifier.Linkifier();
component.data = {
@@ -8,6 +8,7 @@ import * as SurveyLink from '../../../../../front_end/ui/components/survey_link/
import * as Common from '../../../../../front_end/core/common/common.js';
import {assertNotNullOrUndefined} from '../../../../../front_end/core/platform/platform.js';
import {assertShadowRoot, renderElementIntoDOM} from '../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js';
function canShowSuccessfulCallback(trigger: string, callback: SurveyLink.SurveyLink.CanShowSurveyCallback) {
callback({canShowSurvey: true});
@@ -24,7 +25,7 @@ function showFailureCallback(trigger: string, callback: SurveyLink.SurveyLink.Sh
const empty = Common.UIString.LocalizedEmptyString;
-describe('SurveyLink', async () => {
+describeWithLocale('SurveyLink', async () => {
it('shows no link when canShowSurvey is still pending', () => {
const link = new SurveyLink.SurveyLink.SurveyLink();
link.data = {trigger: 'test trigger', promptText: empty, canShowSurvey: () => {}, showSurvey: () => {}};
@@ -11,5 +11,6 @@ ts_library("diff_view") {
deps = [
"../../../../../../front_end/third_party/diff:bundle",
"../../../../../../front_end/ui/components/diff_view:bundle",
+ "../../../helpers",
]
}
@@ -6,6 +6,7 @@ const {assert} = chai;
import * as DiffView from '../../../../../../front_end/ui/components/diff_view/diff_view.js';
import * as Diff from '../../../../../../front_end/third_party/diff/diff.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
function buildDiff(original: string, updated: string): Promise<DocumentFragment> {
const diff = Diff.Diff.DiffWrapper.lineDiff(original.split('\n'), updated.split('\n'));
@@ -35,7 +36,7 @@ function text(elt: Node): string {
return '';
}
-describe('DiffView', () => {
+describeWithLocale('DiffView', () => {
it('renders the proper content', async () => {
const output = await simpleDiff();
const lines = Array.from(output.querySelectorAll('.diff-line-content'));
@@ -7,6 +7,7 @@ import * as IssuesManager from '../../../../../../front_end/models/issues_manage
import * as IconButton from '../../../../../../front_end/ui/components/icon_button/icon_button.js';
import * as IssueCounter from '../../../../../../front_end/ui/components/issue_counter/issue_counter.js';
import {assertElement, assertElements, assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
import {MockIssuesManager} from '../../../models/issues_manager/MockIssuesManager.js';
const {assert} = chai;
@@ -50,7 +51,7 @@ export const extractButton = (shadowRoot: ShadowRoot): HTMLButtonElement => {
return button;
};
-describe('IssueCounter', () => {
+describeWithLocale('IssueCounter', () => {
describe('with omitting zero-count issue kinds', () => {
it('renders correctly', () => {
const issuesManager = new MockIssuesManager([]);
@@ -216,7 +217,7 @@ describe('IssueCounter', () => {
});
});
-describe('getIssueCountsEnumeration', () => {
+describeWithLocale('getIssueCountsEnumeration', () => {
it('formats issue counts correctly', () => {
const issuesManager = new MockIssuesManager([]);
const string = IssueCounter.IssueCounter.getIssueCountsEnumeration(
@@ -8,6 +8,7 @@ import * as IconButton from '../../../../../../front_end/ui/components/icon_butt
import * as IssueCounter from '../../../../../../front_end/ui/components/issue_counter/issue_counter.js';
import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js';
import {assertElement, assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
import type * as Protocol from '../../../../../../front_end/generated/protocol.js';
import * as IssuesManager from '../../../../../../front_end/models/issues_manager/issues_manager.js';
@@ -92,7 +93,7 @@ class MockIssueResolver {
}
}
-describe('IssueLinkIcon', () => {
+describeWithLocale('IssueLinkIcon', () => {
const issueId = 'issue1' as Protocol.Audits.IssueId;
const defaultIcon = {iconName: 'issue-questionmark-icon', color: 'var(--color-text-secondary)'};
const breakingChangeIcon =
@@ -4,6 +4,7 @@
import * as LinearMemoryInspectorModule from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js';
import {dispatchClickEvent, getElementsWithinComponent, getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
import {NAVIGATOR_ADDRESS_SELECTOR, NAVIGATOR_HISTORY_BUTTON_SELECTOR, NAVIGATOR_PAGE_BUTTON_SELECTOR} from './LinearMemoryNavigator_test.js';
import {ENDIANNESS_SELECTOR} from './LinearMemoryValueInterpreter_test.js';
@@ -16,7 +17,7 @@ const NAVIGATOR_SELECTOR = 'devtools-linear-memory-inspector-navigator';
const VIEWER_SELECTOR = 'devtools-linear-memory-inspector-viewer';
const INTERPRETER_SELECTOR = 'devtools-linear-memory-inspector-interpreter';
-describe('LinearMemoryInspector', () => {
+describeWithLocale('LinearMemoryInspector', () => {
function getViewer(component: LinearMemoryInspectorModule.LinearMemoryInspector.LinearMemoryInspector) {
return getElementWithinComponent(
component, VIEWER_SELECTOR, LinearMemoryInspectorModule.LinearMemoryViewer.LinearMemoryViewer);
@@ -4,6 +4,7 @@
import * as LinearMemoryInspector from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js';
import {assertElement, assertElements, assertShadowRoot, getElementsWithinComponent, getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
@@ -12,7 +13,7 @@ export const NAVIGATOR_PAGE_BUTTON_SELECTOR = '[data-button=pagenavigation]';
export const NAVIGATOR_HISTORY_BUTTON_SELECTOR = '[data-button=historynavigation]';
export const NAVIGATOR_REFRESH_BUTTON_SELECTOR = '[data-button=refreshrequested]';
-describe('LinearMemoryNavigator', () => {
+describeWithLocale('LinearMemoryNavigator', () => {
let component: LinearMemoryInspector.LinearMemoryNavigator.LinearMemoryNavigator;
beforeEach(renderNavigator);
@@ -4,6 +4,7 @@
import * as LinearMemoryInspector from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js';
import {getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
@@ -30,7 +31,7 @@ function clickSettingsButton(
settingsButton.click();
}
-describe('LinearMemoryValueInterpreter', () => {
+describeWithLocale('LinearMemoryValueInterpreter', () => {
function setUpComponent() {
const buffer = new Uint8Array([34, 234, 12, 3]).buffer;
const component = new LinearMemoryInspector.LinearMemoryValueInterpreter.LinearMemoryValueInterpreter();
@@ -4,12 +4,13 @@
import * as LinearMemoryInspector from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js';
import {dispatchClickEvent, getElementsWithinComponent, getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
export const DISPLAY_JUMP_TO_POINTER_BUTTON_SELECTOR = '[data-jump]';
const {assert} = chai;
-describe('ValueInterpreterDisplay', () => {
+describeWithLocale('ValueInterpreterDisplay', () => {
const combinationsForNumbers = [
{endianness: LinearMemoryInspector.ValueInterpreterDisplayUtils.Endianness.Little, signed: true},
{endianness: LinearMemoryInspector.ValueInterpreterDisplayUtils.Endianness.Little, signed: false},
@@ -4,6 +4,7 @@
import * as LinearMemoryInspector from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js';
import {assertElement, getElementsWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
@@ -11,7 +12,7 @@ const SETTINGS_INPUT_SELECTOR = '[data-input]';
const SETTINGS_TITLE_SELECTOR = '[data-title]';
const SETTINGS_LABEL_SELECTOR = '.type-label';
-describe('ValueInterpreterSettings', () => {
+describeWithLocale('ValueInterpreterSettings', () => {
function setUpComponent() {
const component = new LinearMemoryInspector.ValueInterpreterSettings.ValueInterpreterSettings();
const data = {
@@ -6,10 +6,11 @@ import * as Host from '../../../../../../front_end/core/host/host.js';
import * as PanelFeedback from '../../../../../../front_end/ui/components/panel_feedback/panel_feedback.js';
import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js';
import {assertElement, assertShadowRoot, dispatchClickEvent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
-describe('Feedback button', () => {
+describeWithLocale('Feedback button', () => {
it('calls out to the Host API to open the link in a new tab', async () => {
const openInNewTabStub = sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'openInNewTab');
const component = new PanelFeedback.FeedbackButton.FeedbackButton();
@@ -5,10 +5,11 @@
import * as PanelFeedback from '../../../../../../front_end/ui/components/panel_feedback/panel_feedback.js';
import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js';
import {assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
-describe('Panel Feedback', () => {
+describeWithLocale('Panel Feedback', () => {
async function renderFeedbackComponent(): Promise<PanelFeedback.PanelFeedback.PanelFeedback> {
const component = new PanelFeedback.PanelFeedback.PanelFeedback();
component.data = {
@@ -6,10 +6,11 @@ import * as Root from '../../../../../../front_end/core/root/root.js';
import * as PanelFeedback from '../../../../../../front_end/ui/components/panel_feedback/panel_feedback.js';
import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js';
import {assertElement, assertShadowRoot, dispatchClickEvent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
-describe('Preview toggle', () => {
+describeWithLocale('Preview toggle', () => {
it('calls out correctly to enable experiment', async () => {
const isEnabledStub = sinon.stub(Root.Runtime.experiments, 'isEnabled');
isEnabledStub.callsFake(() => false);
@@ -11,6 +11,7 @@ import * as IconButton from '../../../../../../front_end/ui/components/icon_butt
import {assertElement, assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js';
import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js';
import type * as Protocol from '../../../../../../front_end/generated/protocol.js';
+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
@@ -104,7 +105,7 @@ class MockRequestResolver {
}
}
-describe('RequestLinkIcon', () => {
+describeWithLocale('RequestLinkIcon', () => {
const requestId1 = 'r1' as Protocol.Network.RequestId;
const requestId2 = 'r2' as Protocol.Network.RequestId;
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import * as UI from '../../../../../front_end/ui/legacy/legacy.js';
+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
@@ -34,7 +35,7 @@ class MockSuggestBoxDelegate implements UI.SuggestBox.SuggestBoxDelegate {
const createKeyEvent = (key: string) => new KeyboardEvent('keydown', {bubbles: true, cancelable: true, key});
-describe('SuggestBox', () => {
+describeWithLocale('SuggestBox', () => {
let delegate: MockSuggestBoxDelegate;
let div: HTMLElement;
let suggestBox: UI.SuggestBox.SuggestBox;
@@ -5,6 +5,7 @@
import {assertNotNullOrUndefined} from '../../../../../../../front_end/core/platform/platform.js';
import * as InlineEditor from '../../../../../../../front_end/ui/legacy/components/inline_editor/inline_editor.js';
import {assertShadowRoot, renderElementIntoDOM} from '../../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
@@ -31,7 +32,7 @@ function assertSwatch(swatch: InlineEditor.CSSVarSwatch.CSSVarSwatch, expected:
assert.strictEqual(link.textContent, expected.varText, 'The link has the right text content');
}
-describe('CSSVarSwatch', () => {
+describeWithLocale('CSSVarSwatch', () => {
it('can be instantiated successfully', () => {
const component = new InlineEditor.CSSVarSwatch.CSSVarSwatch();
renderElementIntoDOM(component);
@@ -6,6 +6,7 @@ import * as Common from '../../../../../../../front_end/core/common/common.js';
import {assertNotNullOrUndefined} from '../../../../../../../front_end/core/platform/platform.js';
import * as InlineEditor from '../../../../../../../front_end/ui/legacy/components/inline_editor/inline_editor.js';
import {assertElement, assertShadowRoot, dispatchClickEvent, renderElementIntoDOM} from '../../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
@@ -45,7 +46,7 @@ function getClickTarget(swatch: InlineEditor.ColorSwatch.ColorSwatch) {
return swatch.shadowRoot.querySelector('.color-swatch-inner') as HTMLElement;
}
-describe('ColorSwatch', () => {
+describeWithLocale('ColorSwatch', () => {
it('accepts colors as text', () => {
const swatch = createSwatch('red');
@@ -5,6 +5,7 @@
import {assertNotNullOrUndefined} from '../../../../../../../front_end/core/platform/platform.js';
import * as PerfUI from '../../../../../../../front_end/ui/legacy/components/perf_ui/perf_ui.js';
import {assertShadowRoot, renderElementIntoDOM} from '../../../../helpers/DOMHelpers.js';
+import {describeWithLocale} from '../../../../helpers/EnvironmentHelpers.js';
const {assert} = chai;
@@ -26,7 +27,7 @@ const testChartNoLegendData = {
slices: [{value: 75, color: 'crimson', title: 'Filling'}, {value: 25, color: 'burlywood', title: 'Crust'}],
};
-describe('PieChart', () => {
+describeWithLocale('PieChart', () => {
describe('with legend', () => {
it('is labelled by the chart name', () => {
const chart = new PerfUI.PieChart.PieChart();
@@ -364,7 +364,7 @@ if (is_android && enable_java_templates) {
}
}
-if (is_android) {
+if (is_android || is_ohos) {
# Use android_small for now to keep the size till we decide to switch to the new one.
data_dir = "android_small"
} else if (is_ios) {
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
import("//third_party/protobuf/proto_library.gni")
@@ -116,3 +117,16 @@ test("libphonenumber_unittests") {
"//third_party/icu",
]
}
+
+fuzzer_test("libphonenumber_fuzzer") {
+ sources = [ "libphonenumber_fuzzer.cc" ]
+ deps = [
+ ":libphonenumber",
+ "//third_party/abseil-cpp:absl",
+ ]
+}
+
+fuzzer_test("charntorune_fuzzer") {
+ sources = [ "charntorune_fuzzer.cc" ]
+ deps = [ ":libphonenumber" ]
+}
@@ -19,6 +19,8 @@ Additional files, not in the original library:
BUILD.gn
README.chromium
LICENSE # Taken from https://github.com/googlei18n/libphonenumber/
+ charntorune_fuzzer.cc
+ libphonenumber_fuzzer.cc
phonenumber_api.h
The library is mapped through the DEPS file into the Chromium sources root
new file mode 100644
@@ -0,0 +1,15 @@
+// Copyright 2022 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string>
+
+#include <fuzzer/FuzzedDataProvider.h>
+
+#include "third_party/libphonenumber/dist/cpp/src/phonenumbers/utf/utf.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ Rune rune;
+ charntorune(&rune, reinterpret_cast<const char*>(data), size);
+ return 0;
+}
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,22 @@
+// Copyright 2022 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string>
+
+#include <fuzzer/FuzzedDataProvider.h>
+
+#include "third_party/libphonenumber/phonenumber_api.h"
+
+using ::i18n::phonenumbers::PhoneNumber;
+using ::i18n::phonenumbers::PhoneNumberUtil;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ std::string input(reinterpret_cast<const char*>(data), size);
+
+ PhoneNumber parsed_number;
+ PhoneNumberUtil* phone_number_util = PhoneNumberUtil::GetInstance();
+ phone_number_util->Parse(input, "US", &parsed_number);
+
+ return 0;
+}
\ No newline at end of file
@@ -35,6 +35,7 @@ is a no-op in chromium builds and upsets clang.
only available on POSIX systems.
11) Run clang-format.
12) Remove an unneeded static initializer.
+13) Remove whitespace tokenizer since it uses the unsafe function `chartorune`.
Update Process:
1) Clone the tflite-support github repo at the desired commit into src/
new file mode 100644
@@ -0,0 +1,776 @@
+From 3e2574d49dd6a93efef8de6c5256a428c9d9c784 Mon Sep 17 00:00:00 2001
+From: Robert Ogden <robertogden@chromium.org>
+Date: Mon, 17 Oct 2022 13:09:01 -0700
+Subject: [PATCH] remove whitespace tokenizer
+
+---
+ .../custom_ops/kernel/whitespace_tokenizer.cc | 227 ------------------
+ .../custom_ops/kernel/whitespace_tokenizer.h | 31 ---
+ .../whitespace_tokenizer_op_resolver.cc | 32 ---
+ .../kernel/whitespace_tokenizer_op_resolver.h | 34 ---
+ ...hitespace_tokenizer_op_resolver_wrapper.cc | 29 ---
+ .../kernel/whitespace_tokenizer_test.cc | 189 ---------------
+ .../kernel/whitespace_tokenizer_test.py | 167 -------------
+ 7 files changed, 709 deletions(-)
+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.cc
+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h
+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.cc
+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h
+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver_wrapper.cc
+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.cc
+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.py
+
+diff --git a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.cc b/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.cc
+deleted file mode 100644
+index 8096a5008bd12..0000000000000
+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.cc
+@@ -1,227 +0,0 @@
+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
+-
+-Licensed under the Apache License, Version 2.0 (the "License");
+-you may not use this file except in compliance with the License.
+-You may obtain a copy of the License at
+-
+- http://www.apache.org/licenses/LICENSE-2.0
+-
+-Unless required by applicable law or agreed to in writing, software
+-distributed under the License is distributed on an "AS IS" BASIS,
+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-See the License for the specific language governing permissions and
+-limitations under the License.
+-==============================================================================*/
+-
+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h"
+-
+-#include <algorithm>
+-#include <utility>
+-#include <vector>
+-
+-#include "libutf/utf.h"
+-#include "tensorflow/lite/context.h"
+-#include "tensorflow/lite/kernels/kernel_util.h"
+-#include "tensorflow/lite/string_util.h"
+-
+-constexpr int kInput = 0;
+-constexpr int kOutputValues = 0;
+-constexpr int kOutputRowSplitsStart = 1;
+-
+-namespace tflite {
+-namespace ops {
+-namespace custom {
+-namespace whitespace_tokenizer {
+-
+-// This TFLite op implements a whitespace tokenizer, and can output the
+-// tokens as either a padded tensor or a ragged tensor.
+-//
+-// If we're outputting a padded tensor, our outputs are:
+-// * A string tensor
+-//
+-// If we're outputting a ragged tensor, our outputs are:
+-// * A string tensor (the innermost values of the ragged tensor)
+-// * N int64 tensors (the row_splits of the ragged tensor, where N is the
+-// rank of the input tensor)
+-
+-inline bool OutputIsPaddedTensor(TfLiteNode* node) {
+- return NumOutputs(node) == 1;
+-}
+-
+-inline int charntorune(Rune* r, const char* s, int n) {
+- const int bytes_read = chartorune(r, const_cast<char*>(s));
+- if (bytes_read > n) {
+- *r = Runeerror;
+- return 0;
+- }
+- return bytes_read;
+-}
+-
+-std::vector<std::pair<const char*, int>> Tokenize(StringRef str) {
+- const char* p = str.str;
+- int n = str.len;
+-
+- std::vector<std::pair<const char*, int>> tokens;
+- const char* start = nullptr;
+- while (n > 0) {
+- Rune r;
+- int c = charntorune(&r, p, n);
+- if (r == Runeerror)
+- break;
+-
+- if (isspacerune(r)) {
+- if (start != nullptr) {
+- tokens.push_back({start, p - start});
+- }
+- start = nullptr;
+- } else {
+- if (start == nullptr) {
+- start = p;
+- }
+- }
+-
+- p += c;
+- n -= c;
+- }
+- if (start != nullptr) {
+- tokens.push_back({start, p - start});
+- }
+-
+- return tokens;
+-}
+-
+-TfLiteStatus WritePaddedOutput(
+- const std::vector<std::vector<std::pair<const char*, int>>>& list_of_tokens,
+- const TfLiteTensor* input,
+- TfLiteTensor* output_values) {
+- TfLiteIntArray* output_shape = TfLiteIntArrayCreate(NumDimensions(input) + 1);
+- for (int i = 0; i < NumDimensions(input); ++i) {
+- output_shape->data[i] = SizeOfDimension(input, i);
+- }
+-
+- size_t max_tokens = 0;
+- for (const auto& tokens : list_of_tokens) {
+- max_tokens = std::max(max_tokens, tokens.size());
+- }
+-
+- output_shape->data[NumDimensions(input)] = max_tokens;
+- DynamicBuffer buffer;
+- for (const auto& tokens : list_of_tokens) {
+- for (const auto& token : tokens) {
+- buffer.AddString(token.first, token.second);
+- }
+- for (int i = tokens.size(); i < max_tokens; ++i) {
+- buffer.AddString(nullptr, 0);
+- }
+- }
+- buffer.WriteToTensor(output_values, output_shape);
+- return kTfLiteOk;
+-}
+-
+-TfLiteStatus WriteRaggedOutput(
+- const std::vector<std::vector<std::pair<const char*, int>>>& list_of_tokens,
+- const TfLiteTensor* input,
+- TfLiteTensor* output_values,
+- std::vector<TfLiteTensor*> nested_row_splits) {
+- // The outer dimensions of the ragged tensor are all non-ragged.
+- for (int i = 0; i < nested_row_splits.size() - 1; ++i) {
+- int row_splits_step = SizeOfDimension(input, i + 1);
+- TfLiteTensor* row_splits = nested_row_splits[i];
+- for (int j = 0; j < SizeOfDimension(row_splits, 0); ++j) {
+- row_splits->data.i64[j] = j * row_splits_step;
+- }
+- }
+-
+- // Generate the innermost row_splits and values tensors.
+- TfLiteTensor* row_splits = nested_row_splits.back();
+- TfLiteIntArray* output_shape = TfLiteIntArrayCreate(1);
+- DynamicBuffer buffer;
+- int token_index = 0;
+- int row_splits_index = 0;
+- for (const auto& tokens : list_of_tokens) {
+- row_splits->data.i64[row_splits_index] = token_index;
+- for (const auto& token : tokens) {
+- buffer.AddString(token.first, token.second);
+- ++token_index;
+- }
+- ++row_splits_index;
+- }
+- row_splits->data.i64[row_splits_index] = token_index;
+- output_shape->data[0] = token_index;
+- buffer.WriteToTensor(output_values, output_shape);
+- return kTfLiteOk;
+-}
+-
+-TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
+- TfLiteTensor* output_values = GetOutput(context, node, kOutputValues);
+- SetTensorToDynamic(output_values);
+-
+- if (OutputIsPaddedTensor(node)) {
+- return kTfLiteOk;
+- }
+-
+- const TfLiteTensor* input = GetInput(context, node, kInput);
+- TF_LITE_ENSURE(context, NumDimensions(input) ==
+- (NumOutputs(node) - kOutputRowSplitsStart));
+-
+- // Resize the row_splits tensors. We're just adding a ragged inner
+- // dimension to the shape of the input tensor, so the size of the
+- // row_splits tensors can be calculated using the input tensor's shape.
+- int input_size = 1;
+- for (int i = 0; i < NumDimensions(input); ++i) {
+- input_size *= SizeOfDimension(input, i);
+-
+- TfLiteIntArray* row_splits_shape = TfLiteIntArrayCreate(1);
+- row_splits_shape->data[0] = input_size + 1;
+- TfLiteTensor* row_splits =
+- GetOutput(context, node, kOutputRowSplitsStart + i);
+- TF_LITE_ENSURE_STATUS(
+- context->ResizeTensor(context, row_splits, row_splits_shape));
+- }
+-
+- return kTfLiteOk;
+-}
+-
+-TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
+- const TfLiteTensor* input = GetInput(context, node, kInput);
+- int input_size = 1;
+- for (int i = 0; i < NumDimensions(input); ++i) {
+- input_size *= SizeOfDimension(input, i);
+- }
+-
+- std::vector<std::vector<std::pair<const char*, int>>> list_of_tokens;
+- list_of_tokens.reserve(input_size);
+- for (int i = 0; i < input_size; ++i) {
+- list_of_tokens.emplace_back(Tokenize(GetString(input, i)));
+- }
+-
+- TfLiteTensor* output_values = GetOutput(context, node, kOutputValues);
+- TF_LITE_ENSURE(context, IsDynamicTensor(output_values));
+-
+- if (OutputIsPaddedTensor(node)) {
+- return WritePaddedOutput(list_of_tokens, input, output_values);
+- }
+-
+- std::vector<TfLiteTensor*> nested_row_splits;
+- nested_row_splits.reserve(NumDimensions(input));
+- for (int i = 0; i < NumDimensions(input); ++i) {
+- TfLiteTensor* output_row_splits =
+- GetOutput(context, node, kOutputRowSplitsStart + i);
+- nested_row_splits.push_back(output_row_splits);
+- }
+- return WriteRaggedOutput(list_of_tokens, input, output_values,
+- nested_row_splits);
+-}
+-
+-} // namespace whitespace_tokenizer
+-
+-TfLiteRegistration* Register_tftext_WhitespaceTokenizer() {
+- static TfLiteRegistration r = {nullptr, nullptr,
+- whitespace_tokenizer::Prepare,
+- whitespace_tokenizer::Eval};
+- return &r;
+-}
+-
+-} // namespace custom
+-} // namespace ops
+-} // namespace tflite
+diff --git a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h b/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h
+deleted file mode 100644
+index b190248087d20..0000000000000
+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h
+@@ -1,31 +0,0 @@
+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
+-
+-Licensed under the Apache License, Version 2.0 (the "License");
+-you may not use this file except in compliance with the License.
+-You may obtain a copy of the License at
+-
+- http://www.apache.org/licenses/LICENSE-2.0
+-
+-Unless required by applicable law or agreed to in writing, software
+-distributed under the License is distributed on an "AS IS" BASIS,
+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-See the License for the specific language governing permissions and
+-limitations under the License.
+-==============================================================================*/
+-
+-#ifndef TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_
+-#define TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_
+-
+-#include "tensorflow/lite/context.h"
+-
+-namespace tflite {
+-namespace ops {
+-namespace custom {
+-
+-TfLiteRegistration* Register_tftext_WhitespaceTokenizer();
+-
+-} // namespace custom
+-} // namespace ops
+-} // namespace tflite
+-
+-#endif // TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_
+diff --git a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.cc b/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.cc
+deleted file mode 100644
+index 6166bc149bc00..0000000000000
+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.cc
+@@ -1,32 +0,0 @@
+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
+-
+-Licensed under the Apache License, Version 2.0 (the "License");
+-you may not use this file except in compliance with the License.
+-You may obtain a copy of the License at
+-
+- http://www.apache.org/licenses/LICENSE-2.0
+-
+-Unless required by applicable law or agreed to in writing, software
+-distributed under the License is distributed on an "AS IS" BASIS,
+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-See the License for the specific language governing permissions and
+-limitations under the License.
+-==============================================================================*/
+-
+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h"
+-
+-#include "tensorflow/lite/mutable_op_resolver.h"
+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h"
+-
+-namespace tflite {
+-namespace ops {
+-namespace custom {
+-
+-void AddWhitespaceTokenizerCustomOp(MutableOpResolver* resolver) {
+- resolver->AddCustom("tftext:WhitespaceTokenizer",
+- Register_tftext_WhitespaceTokenizer());
+-}
+-
+-} // namespace custom
+-} // namespace ops
+-} // namespace tflite
+diff --git a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h b/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h
+deleted file mode 100644
+index 4f57d8d8010cb..0000000000000
+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h
+@@ -1,34 +0,0 @@
+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
+-
+-Licensed under the Apache License, Version 2.0 (the "License");
+-you may not use this file except in compliance with the License.
+-You may obtain a copy of the License at
+-
+- http://www.apache.org/licenses/LICENSE-2.0
+-
+-Unless required by applicable law or agreed to in writing, software
+-distributed under the License is distributed on an "AS IS" BASIS,
+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-See the License for the specific language governing permissions and
+-limitations under the License.
+-==============================================================================*/
+-
+-#ifndef TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_
+-#define TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_
+-
+-#include "tensorflow/lite/mutable_op_resolver.h"
+-
+-namespace tflite {
+-namespace ops {
+-namespace custom {
+-
+-// Adds the WhitespaceTokenizer custom op to an op resolver.
+-// This function can be loaded using dlopen. Since C++ function names get
+-// mangled, declare this function as extern C, so its name is unchanged.
+-extern "C" void AddWhitespaceTokenizerCustomOp(MutableOpResolver* resolver);
+-
+-} // namespace custom
+-} // namespace ops
+-} // namespace tflite
+-
+-#endif // LETENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_
+diff --git a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver_wrapper.cc b/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver_wrapper.cc
+deleted file mode 100644
+index 03d3ba899395a..0000000000000
+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver_wrapper.cc
+@@ -1,29 +0,0 @@
+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
+-
+-Licensed under the Apache License, Version 2.0 (the "License");
+-you may not use this file except in compliance with the License.
+-You may obtain a copy of the License at
+-
+- http://www.apache.org/licenses/LICENSE-2.0
+-
+-Unless required by applicable law or agreed to in writing, software
+-distributed under the License is distributed on an "AS IS" BASIS,
+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-See the License for the specific language governing permissions and
+-limitations under the License.
+-==============================================================================*/
+-
+-#include "pybind11/pybind11.h"
+-#include "tensorflow/lite/mutable_op_resolver.h"
+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h"
+-
+-PYBIND11_MODULE(_pywrap_whitespace_tokenizer_op_resolver, m) {
+- m.doc() = "_pywrap_whitespace_tokenizer_op_resolver";
+- m.def(
+- "AddWhitespaceTokenizerCustomOp",
+- [](uintptr_t resolver) {
+- tflite::ops::custom::AddWhitespaceTokenizerCustomOp(
+- reinterpret_cast<tflite::MutableOpResolver*>(resolver));
+- },
+- "Op registerer function for the tftext:WhitespaceTokenizer custom op.");
+-}
+diff --git a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.cc b/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.cc
+deleted file mode 100644
+index 4654e46c4a270..0000000000000
+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.cc
+@@ -1,189 +0,0 @@
+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
+-
+-Licensed under the Apache License, Version 2.0 (the "License");
+-you may not use this file except in compliance with the License.
+-You may obtain a copy of the License at
+-
+- http://www.apache.org/licenses/LICENSE-2.0
+-
+-Unless required by applicable law or agreed to in writing, software
+-distributed under the License is distributed on an "AS IS" BASIS,
+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-See the License for the specific language governing permissions and
+-limitations under the License.
+-==============================================================================*/
+-
+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h"
+-
+-#include <string>
+-#include <vector>
+-
+-#include <gmock/gmock.h>
+-#include <gtest/gtest.h>
+-#include "tensorflow/lite/kernels/test_util.h"
+-#include "tensorflow/lite/schema/schema_generated.h"
+-#include "tensorflow/lite/string_util.h"
+-
+-namespace tflite {
+-namespace ops {
+-namespace custom {
+-namespace whitespace_tokenizer {
+-namespace test {
+-namespace {
+-
+-using ::testing::ElementsAre;
+-using ::testing::ElementsAreArray;
+-
+-} // namespace
+-
+-enum OutputType { PADDED, RAGGED };
+-
+-class WhitespaceTokenizerModel : public SingleOpModel {
+- public:
+- WhitespaceTokenizerModel(OutputType output_type,
+- const std::vector<std::string>& input_values,
+- const std::vector<int>& input_shape)
+- : input_shape_(input_shape) {
+- input_ = AddInput(TensorType_STRING);
+- output_values_ = AddOutput(TensorType_STRING);
+- if (output_type == RAGGED) {
+- for (int i = 0; i < input_shape_.size(); ++i) {
+- output_row_splits_.push_back(AddOutput(TensorType_INT64));
+- }
+- }
+- SetCustomOp("WhitespaceTokenizer", {}, Register_tftext_WhitespaceTokenizer);
+-
+- BuildInterpreter({input_shape});
+- PopulateStringTensor(input_, input_values);
+- Invoke();
+- }
+-
+- std::vector<int> GetValuesTensorShape() {
+- return GetTensorShape(output_values_);
+- }
+-
+- std::vector<std::string> ExtractValuesTensorVector() {
+- std::vector<std::string> r;
+- TfLiteTensor* tensor = interpreter_->tensor(output_values_);
+- int n = GetStringCount(tensor);
+- for (int i = 0; i < n; ++i) {
+- StringRef ref = GetString(tensor, i);
+- r.emplace_back(ref.str, ref.len);
+- }
+- return r;
+- }
+-
+- void CheckRowSplits(const std::vector<int>& token_counts) {
+- int size = 1;
+- for (int i = 0; i < input_shape_.size(); ++i) {
+- size *= input_shape_[i];
+- EXPECT_THAT(GetTensorShape(output_row_splits_[i]), ElementsAre(size + 1))
+- << "row_splits " << i << " has the wrong shape";
+-
+- std::vector<int64_t> expected_values(size + 1);
+- if (i == input_shape_.size() - 1) {
+- ASSERT_EQ(token_counts.size(), size);
+-
+- int index = 0;
+- expected_values[0] = index;
+- for (int j = 0; j < size; ++j) {
+- index += token_counts[j];
+- expected_values[j + 1] = index;
+- }
+- } else {
+- for (int j = 0; j <= size; ++j) {
+- expected_values[j] = j * input_shape_[i + 1];
+- }
+- }
+- EXPECT_THAT(ExtractVector<int64_t>(output_row_splits_[i]),
+- ElementsAreArray(expected_values))
+- << "row_splits " << i << " has an incorrect value/index";
+- }
+- }
+-
+- private:
+- int input_;
+- std::vector<int> input_shape_;
+- int output_values_;
+- std::vector<int> output_row_splits_;
+-}; // namespace test
+-
+-TEST(WhitespaceTokenizerTest, SingleStringPaddedOutput) {
+- WhitespaceTokenizerModel m(PADDED, {"this is a test"}, {1});
+- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(1, 4));
+- EXPECT_THAT(m.ExtractValuesTensorVector(),
+- ElementsAre("this", "is", "a", "test"));
+-}
+-
+-TEST(WhitespaceTokenizerTest, SingleStringRaggedOutput) {
+- WhitespaceTokenizerModel m(RAGGED, {"this is a test"}, {1});
+- m.CheckRowSplits({4});
+- EXPECT_THAT(m.ExtractValuesTensorVector(),
+- ElementsAre("this", "is", "a", "test"));
+-}
+-
+-TEST(WhitespaceTokenizerTest, VectorPaddedOutput) {
+- WhitespaceTokenizerModel m(PADDED,
+- {"this is a test", //
+- "three token sentence", //
+- "many more tokens than that sentence"},
+- {3});
+- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(3, 6));
+- EXPECT_THAT(
+- m.ExtractValuesTensorVector(),
+- ElementsAre("this", "is", "a", "test", "", "", //
+- "three", "token", "sentence", "", "", "", //
+- "many", "more", "tokens", "than", "that", "sentence"));
+-}
+-
+-TEST(WhitespaceTokenizerTest, VectorRaggedOutput) {
+- WhitespaceTokenizerModel m(RAGGED,
+- {"this is a test", //
+- "three token sentence", //
+- "many more tokens than that sentence"},
+- {3});
+- m.CheckRowSplits({4, 3, 6});
+- EXPECT_THAT(
+- m.ExtractValuesTensorVector(),
+- ElementsAre("this", "is", "a", "test", //
+- "three", "token", "sentence", //
+- "many", "more", "tokens", "than", "that", "sentence"));
+-}
+-
+-TEST(WhitespaceTokenizerTest, MatrixPaddedOutput) {
+- WhitespaceTokenizerModel m(PADDED,
+- {"a b c", "d e f", //
+- "g h", "i j k l", //
+- "m", "n o p q r"},
+- {3, 2});
+- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(3, 2, 5));
+- EXPECT_THAT(m.ExtractValuesTensorVector(),
+- ElementsAre("a", "b", "c", "", "", //
+- "d", "e", "f", "", "", //
+- "g", "h", "", "", "", //
+- "i", "j", "k", "l", "", //
+- "m", "", "", "", "", //
+- "n", "o", "p", "q", "r"));
+-}
+-
+-TEST(WhitespaceTokenizerTest, MatrixRAGGEDOutput) {
+- WhitespaceTokenizerModel m(RAGGED,
+- {"a b c", "d e f", //
+- "g h", "i j k l", //
+- "m", "n o p q r"},
+- {3, 2});
+- m.CheckRowSplits({3, 3, 2, 4, 1, 5});
+- EXPECT_THAT(m.ExtractValuesTensorVector(),
+- ElementsAre("a", "b", "c", //
+- "d", "e", "f", //
+- "g", "h", //
+- "i", "j", "k", "l", //
+- "m", //
+- "n", "o", "p", "q", "r"));
+-}
+-
+-} // namespace test
+-} // namespace whitespace_tokenizer
+-} // namespace custom
+-} // namespace ops
+-} // namespace tflite
+diff --git a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.py b/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.py
+deleted file mode 100644
+index 70de237a22dad..0000000000000
+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.py
+@@ -1,167 +0,0 @@
+-# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
+-#
+-# Licensed under the Apache License, Version 2.0 (the "License");
+-# you may not use this file except in compliance with the License.
+-# You may obtain a copy of the License at
+-#
+-# http://www.apache.org/licenses/LICENSE-2.0
+-#
+-# Unless required by applicable law or agreed to in writing, software
+-# distributed under the License is distributed on an "AS IS" BASIS,
+-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-# See the License for the specific language governing permissions and
+-# limitations under the License.
+-# ==============================================================================
+-"""Tests for tensorflow_lite_support.custom_ops.kernel.whitespace_tokenizer."""
+-
+-import os
+-import sys
+-import timeit
+-
+-from absl import logging
+-from absl.testing import parameterized
+-import numpy as np
+-import tensorflow as tf
+-import tensorflow_text as tf_text
+-# pylint: disable=g-direct-tensorflow-import
+-from tensorflow.lite.python import interpreter as interpreter_wrapper
+-from tensorflow.python.platform import resource_loader
+-
+-# Force loaded shared object symbols to be globally visible. This is needed so
+-# that the interpreter_wrapper, in one .so file, can see the op resolver
+-# in a different .so file. Note that this may already be set by default.
+-# pylint: disable=g-import-not-at-top,g-bad-import-order,unused-import
+-if hasattr(sys, 'setdlopenflags') and hasattr(sys, 'getdlopenflags'):
+- sys.setdlopenflags(sys.getdlopenflags() | os.RTLD_GLOBAL)
+-from tensorflow_lite_support.custom_ops.kernel import _pywrap_whitespace_tokenizer_op_resolver
+-
+-TEST_CASES = [
+- ['this is a test'],
+- ['extra spaces in here'],
+- ['a four token sentence', 'a five token sentence thing.'],
+- [['a multi dimensional test case', 'a b c d', 'e f g'],
+- ['h i j', 'k l m 2 3', 'n o p'], ['q r s 0 1', 't u v', 'w x y z']],
+-]
+-
+-INVOKES_FOR_SINGLE_OP_BENCHMARK = 1000
+-INVOKES_FOR_FLEX_DELEGATE_BENCHMARK = 10
+-
+-
+-@tf.function
+-def _call_whitespace_tokenizer_to_tensor(test_case):
+- tokenizer = tf_text.WhitespaceTokenizer()
+- return tokenizer.tokenize(test_case).to_tensor()
+-
+-
+-@tf.function
+-def _call_whitespace_tokenizer_to_ragged(test_case):
+- tokenizer = tf_text.WhitespaceTokenizer()
+- return tokenizer.tokenize(test_case)
+-
+-
+-class WhitespaceTokenizerTest(parameterized.TestCase):
+-
+- @parameterized.parameters([t] for t in TEST_CASES)
+- def testToTensorEquivalence(self, test_case):
+- tf_output = _call_whitespace_tokenizer_to_tensor(test_case)
+-
+- model_filename = resource_loader.get_path_to_datafile(
+- 'testdata/whitespace_tokenizer_to_tensor.tflite')
+- with open(model_filename, 'rb') as file:
+- model = file.read()
+- interpreter = interpreter_wrapper.InterpreterWithCustomOps(
+- model_content=model,
+- custom_op_registerers=['AddWhitespaceTokenizerCustomOp'])
+-
+- np_test_case = np.array(test_case, dtype=np.str)
+- interpreter.resize_tensor_input(0, np_test_case.shape)
+- interpreter.allocate_tensors()
+- interpreter.set_tensor(interpreter.get_input_details()[0]['index'],
+- np_test_case)
+- interpreter.invoke()
+- tflite_output = interpreter.get_tensor(
+- interpreter.get_output_details()[0]['index'])
+-
+- self.assertEqual(tf_output.numpy().tolist(), tflite_output.tolist())
+-
+- @parameterized.parameters([t] for t in TEST_CASES)
+- def testToRaggedEquivalence(self, test_case):
+- tf_output = _call_whitespace_tokenizer_to_ragged(test_case)
+-
+- np_test_case = np.array(test_case, dtype=np.str)
+- rank = len(np_test_case.shape)
+-
+- model_filename = resource_loader.get_path_to_datafile(
+- 'testdata/whitespace_tokenizer_to_ragged_{}d_input.tflite'.format(rank))
+- with open(model_filename, 'rb') as file:
+- model = file.read()
+- interpreter = interpreter_wrapper.InterpreterWithCustomOps(
+- model_content=model,
+- custom_op_registerers=['AddWhitespaceTokenizerCustomOp'])
+- interpreter.resize_tensor_input(0, np_test_case.shape)
+- interpreter.allocate_tensors()
+- interpreter.set_tensor(interpreter.get_input_details()[0]['index'],
+- np_test_case)
+- interpreter.invoke()
+-
+- # Traverse the nested row_splits/values of the ragged tensor.
+- for i in range(rank):
+- tflite_output_cur_row_splits = interpreter.get_tensor(
+- interpreter.get_output_details()[1 + i]['index'])
+- self.assertEqual(tf_output.row_splits.numpy().tolist(),
+- tflite_output_cur_row_splits.tolist())
+- tf_output = tf_output.values
+-
+- tflite_output_values = interpreter.get_tensor(
+- interpreter.get_output_details()[0]['index'])
+- self.assertEqual(tf_output.numpy().tolist(), tflite_output_values.tolist())
+-
+- def testSingleOpLatency(self):
+- model_filename = resource_loader.get_path_to_datafile(
+- 'testdata/whitespace_tokenizer_to_tensor.tflite')
+- with open(model_filename, 'rb') as file:
+- model = file.read()
+- interpreter = interpreter_wrapper.InterpreterWithCustomOps(
+- model_content=model,
+- custom_op_registerers=['AddWhitespaceTokenizerCustomOp'])
+-
+- latency = 0.0
+- for test_case in TEST_CASES:
+- np_test_case = np.array(test_case, dtype=np.str)
+- interpreter.resize_tensor_input(0, np_test_case.shape)
+- interpreter.allocate_tensors()
+- interpreter.set_tensor(interpreter.get_input_details()[0]['index'],
+- np_test_case)
+- start_time = timeit.default_timer()
+- for _ in range(INVOKES_FOR_SINGLE_OP_BENCHMARK):
+- interpreter.invoke()
+- latency = latency + timeit.default_timer() - start_time
+-
+- latency = latency / (INVOKES_FOR_SINGLE_OP_BENCHMARK * len(TEST_CASES))
+- logging.info('Latency: %fms', latency * 1000.0)
+-
+- def testFlexDelegateLatency(self):
+- model_filename = resource_loader.get_path_to_datafile(
+- 'testdata/whitespace_tokenizer_flex_delegate.tflite')
+- with open(model_filename, 'rb') as file:
+- model = file.read()
+- interpreter = interpreter_wrapper.Interpreter(model_content=model)
+-
+- latency = 0.0
+- for test_case in TEST_CASES:
+- np_test_case = np.array(test_case, dtype=np.str)
+- interpreter.resize_tensor_input(0, np_test_case.shape)
+- interpreter.allocate_tensors()
+- interpreter.set_tensor(interpreter.get_input_details()[0]['index'],
+- np_test_case)
+- start_time = timeit.default_timer()
+- for _ in range(INVOKES_FOR_FLEX_DELEGATE_BENCHMARK):
+- interpreter.invoke()
+- latency = latency + timeit.default_timer() - start_time
+-
+- latency = latency / (INVOKES_FOR_FLEX_DELEGATE_BENCHMARK * len(TEST_CASES))
+- logging.info('Latency: %fms', latency * 1000.0)
+-
+-
+-if __name__ == '__main__':
+- tf.test.main()
+--
+2.38.0.413.g74048e4d9e-goog
+
deleted file mode 100644
@@ -1,227 +0,0 @@
-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-==============================================================================*/
-
-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h"
-
-#include <algorithm>
-#include <utility>
-#include <vector>
-
-#include "libutf/utf.h"
-#include "tensorflow/lite/context.h"
-#include "tensorflow/lite/kernels/kernel_util.h"
-#include "tensorflow/lite/string_util.h"
-
-constexpr int kInput = 0;
-constexpr int kOutputValues = 0;
-constexpr int kOutputRowSplitsStart = 1;
-
-namespace tflite {
-namespace ops {
-namespace custom {
-namespace whitespace_tokenizer {
-
-// This TFLite op implements a whitespace tokenizer, and can output the
-// tokens as either a padded tensor or a ragged tensor.
-//
-// If we're outputting a padded tensor, our outputs are:
-// * A string tensor
-//
-// If we're outputting a ragged tensor, our outputs are:
-// * A string tensor (the innermost values of the ragged tensor)
-// * N int64 tensors (the row_splits of the ragged tensor, where N is the
-// rank of the input tensor)
-
-inline bool OutputIsPaddedTensor(TfLiteNode* node) {
- return NumOutputs(node) == 1;
-}
-
-inline int charntorune(Rune* r, const char* s, int n) {
- const int bytes_read = chartorune(r, const_cast<char*>(s));
- if (bytes_read > n) {
- *r = Runeerror;
- return 0;
- }
- return bytes_read;
-}
-
-std::vector<std::pair<const char*, int>> Tokenize(StringRef str) {
- const char* p = str.str;
- int n = str.len;
-
- std::vector<std::pair<const char*, int>> tokens;
- const char* start = nullptr;
- while (n > 0) {
- Rune r;
- int c = charntorune(&r, p, n);
- if (r == Runeerror)
- break;
-
- if (isspacerune(r)) {
- if (start != nullptr) {
- tokens.push_back({start, p - start});
- }
- start = nullptr;
- } else {
- if (start == nullptr) {
- start = p;
- }
- }
-
- p += c;
- n -= c;
- }
- if (start != nullptr) {
- tokens.push_back({start, p - start});
- }
-
- return tokens;
-}
-
-TfLiteStatus WritePaddedOutput(
- const std::vector<std::vector<std::pair<const char*, int>>>& list_of_tokens,
- const TfLiteTensor* input,
- TfLiteTensor* output_values) {
- TfLiteIntArray* output_shape = TfLiteIntArrayCreate(NumDimensions(input) + 1);
- for (int i = 0; i < NumDimensions(input); ++i) {
- output_shape->data[i] = SizeOfDimension(input, i);
- }
-
- size_t max_tokens = 0;
- for (const auto& tokens : list_of_tokens) {
- max_tokens = std::max(max_tokens, tokens.size());
- }
-
- output_shape->data[NumDimensions(input)] = max_tokens;
- DynamicBuffer buffer;
- for (const auto& tokens : list_of_tokens) {
- for (const auto& token : tokens) {
- buffer.AddString(token.first, token.second);
- }
- for (int i = tokens.size(); i < max_tokens; ++i) {
- buffer.AddString(nullptr, 0);
- }
- }
- buffer.WriteToTensor(output_values, output_shape);
- return kTfLiteOk;
-}
-
-TfLiteStatus WriteRaggedOutput(
- const std::vector<std::vector<std::pair<const char*, int>>>& list_of_tokens,
- const TfLiteTensor* input,
- TfLiteTensor* output_values,
- std::vector<TfLiteTensor*> nested_row_splits) {
- // The outer dimensions of the ragged tensor are all non-ragged.
- for (int i = 0; i < nested_row_splits.size() - 1; ++i) {
- int row_splits_step = SizeOfDimension(input, i + 1);
- TfLiteTensor* row_splits = nested_row_splits[i];
- for (int j = 0; j < SizeOfDimension(row_splits, 0); ++j) {
- row_splits->data.i64[j] = j * row_splits_step;
- }
- }
-
- // Generate the innermost row_splits and values tensors.
- TfLiteTensor* row_splits = nested_row_splits.back();
- TfLiteIntArray* output_shape = TfLiteIntArrayCreate(1);
- DynamicBuffer buffer;
- int token_index = 0;
- int row_splits_index = 0;
- for (const auto& tokens : list_of_tokens) {
- row_splits->data.i64[row_splits_index] = token_index;
- for (const auto& token : tokens) {
- buffer.AddString(token.first, token.second);
- ++token_index;
- }
- ++row_splits_index;
- }
- row_splits->data.i64[row_splits_index] = token_index;
- output_shape->data[0] = token_index;
- buffer.WriteToTensor(output_values, output_shape);
- return kTfLiteOk;
-}
-
-TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
- TfLiteTensor* output_values = GetOutput(context, node, kOutputValues);
- SetTensorToDynamic(output_values);
-
- if (OutputIsPaddedTensor(node)) {
- return kTfLiteOk;
- }
-
- const TfLiteTensor* input = GetInput(context, node, kInput);
- TF_LITE_ENSURE(context, NumDimensions(input) ==
- (NumOutputs(node) - kOutputRowSplitsStart));
-
- // Resize the row_splits tensors. We're just adding a ragged inner
- // dimension to the shape of the input tensor, so the size of the
- // row_splits tensors can be calculated using the input tensor's shape.
- int input_size = 1;
- for (int i = 0; i < NumDimensions(input); ++i) {
- input_size *= SizeOfDimension(input, i);
-
- TfLiteIntArray* row_splits_shape = TfLiteIntArrayCreate(1);
- row_splits_shape->data[0] = input_size + 1;
- TfLiteTensor* row_splits =
- GetOutput(context, node, kOutputRowSplitsStart + i);
- TF_LITE_ENSURE_STATUS(
- context->ResizeTensor(context, row_splits, row_splits_shape));
- }
-
- return kTfLiteOk;
-}
-
-TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
- const TfLiteTensor* input = GetInput(context, node, kInput);
- int input_size = 1;
- for (int i = 0; i < NumDimensions(input); ++i) {
- input_size *= SizeOfDimension(input, i);
- }
-
- std::vector<std::vector<std::pair<const char*, int>>> list_of_tokens;
- list_of_tokens.reserve(input_size);
- for (int i = 0; i < input_size; ++i) {
- list_of_tokens.emplace_back(Tokenize(GetString(input, i)));
- }
-
- TfLiteTensor* output_values = GetOutput(context, node, kOutputValues);
- TF_LITE_ENSURE(context, IsDynamicTensor(output_values));
-
- if (OutputIsPaddedTensor(node)) {
- return WritePaddedOutput(list_of_tokens, input, output_values);
- }
-
- std::vector<TfLiteTensor*> nested_row_splits;
- nested_row_splits.reserve(NumDimensions(input));
- for (int i = 0; i < NumDimensions(input); ++i) {
- TfLiteTensor* output_row_splits =
- GetOutput(context, node, kOutputRowSplitsStart + i);
- nested_row_splits.push_back(output_row_splits);
- }
- return WriteRaggedOutput(list_of_tokens, input, output_values,
- nested_row_splits);
-}
-
-} // namespace whitespace_tokenizer
-
-TfLiteRegistration* Register_tftext_WhitespaceTokenizer() {
- static TfLiteRegistration r = {nullptr, nullptr,
- whitespace_tokenizer::Prepare,
- whitespace_tokenizer::Eval};
- return &r;
-}
-
-} // namespace custom
-} // namespace ops
-} // namespace tflite
deleted file mode 100644
@@ -1,31 +0,0 @@
-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-==============================================================================*/
-
-#ifndef TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_
-#define TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_
-
-#include "tensorflow/lite/context.h"
-
-namespace tflite {
-namespace ops {
-namespace custom {
-
-TfLiteRegistration* Register_tftext_WhitespaceTokenizer();
-
-} // namespace custom
-} // namespace ops
-} // namespace tflite
-
-#endif // TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_
deleted file mode 100644
@@ -1,32 +0,0 @@
-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-==============================================================================*/
-
-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h"
-
-#include "tensorflow/lite/mutable_op_resolver.h"
-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h"
-
-namespace tflite {
-namespace ops {
-namespace custom {
-
-void AddWhitespaceTokenizerCustomOp(MutableOpResolver* resolver) {
- resolver->AddCustom("tftext:WhitespaceTokenizer",
- Register_tftext_WhitespaceTokenizer());
-}
-
-} // namespace custom
-} // namespace ops
-} // namespace tflite
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-==============================================================================*/
-
-#ifndef TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_
-#define TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_
-
-#include "tensorflow/lite/mutable_op_resolver.h"
-
-namespace tflite {
-namespace ops {
-namespace custom {
-
-// Adds the WhitespaceTokenizer custom op to an op resolver.
-// This function can be loaded using dlopen. Since C++ function names get
-// mangled, declare this function as extern C, so its name is unchanged.
-extern "C" void AddWhitespaceTokenizerCustomOp(MutableOpResolver* resolver);
-
-} // namespace custom
-} // namespace ops
-} // namespace tflite
-
-#endif // LETENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_
deleted file mode 100644
@@ -1,29 +0,0 @@
-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-==============================================================================*/
-
-#include "pybind11/pybind11.h"
-#include "tensorflow/lite/mutable_op_resolver.h"
-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h"
-
-PYBIND11_MODULE(_pywrap_whitespace_tokenizer_op_resolver, m) {
- m.doc() = "_pywrap_whitespace_tokenizer_op_resolver";
- m.def(
- "AddWhitespaceTokenizerCustomOp",
- [](uintptr_t resolver) {
- tflite::ops::custom::AddWhitespaceTokenizerCustomOp(
- reinterpret_cast<tflite::MutableOpResolver*>(resolver));
- },
- "Op registerer function for the tftext:WhitespaceTokenizer custom op.");
-}
deleted file mode 100644
@@ -1,189 +0,0 @@
-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-==============================================================================*/
-
-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h"
-
-#include <string>
-#include <vector>
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include "tensorflow/lite/kernels/test_util.h"
-#include "tensorflow/lite/schema/schema_generated.h"
-#include "tensorflow/lite/string_util.h"
-
-namespace tflite {
-namespace ops {
-namespace custom {
-namespace whitespace_tokenizer {
-namespace test {
-namespace {
-
-using ::testing::ElementsAre;
-using ::testing::ElementsAreArray;
-
-} // namespace
-
-enum OutputType { PADDED, RAGGED };
-
-class WhitespaceTokenizerModel : public SingleOpModel {
- public:
- WhitespaceTokenizerModel(OutputType output_type,
- const std::vector<std::string>& input_values,
- const std::vector<int>& input_shape)
- : input_shape_(input_shape) {
- input_ = AddInput(TensorType_STRING);
- output_values_ = AddOutput(TensorType_STRING);
- if (output_type == RAGGED) {
- for (int i = 0; i < input_shape_.size(); ++i) {
- output_row_splits_.push_back(AddOutput(TensorType_INT64));
- }
- }
- SetCustomOp("WhitespaceTokenizer", {}, Register_tftext_WhitespaceTokenizer);
-
- BuildInterpreter({input_shape});
- PopulateStringTensor(input_, input_values);
- Invoke();
- }
-
- std::vector<int> GetValuesTensorShape() {
- return GetTensorShape(output_values_);
- }
-
- std::vector<std::string> ExtractValuesTensorVector() {
- std::vector<std::string> r;
- TfLiteTensor* tensor = interpreter_->tensor(output_values_);
- int n = GetStringCount(tensor);
- for (int i = 0; i < n; ++i) {
- StringRef ref = GetString(tensor, i);
- r.emplace_back(ref.str, ref.len);
- }
- return r;
- }
-
- void CheckRowSplits(const std::vector<int>& token_counts) {
- int size = 1;
- for (int i = 0; i < input_shape_.size(); ++i) {
- size *= input_shape_[i];
- EXPECT_THAT(GetTensorShape(output_row_splits_[i]), ElementsAre(size + 1))
- << "row_splits " << i << " has the wrong shape";
-
- std::vector<int64_t> expected_values(size + 1);
- if (i == input_shape_.size() - 1) {
- ASSERT_EQ(token_counts.size(), size);
-
- int index = 0;
- expected_values[0] = index;
- for (int j = 0; j < size; ++j) {
- index += token_counts[j];
- expected_values[j + 1] = index;
- }
- } else {
- for (int j = 0; j <= size; ++j) {
- expected_values[j] = j * input_shape_[i + 1];
- }
- }
- EXPECT_THAT(ExtractVector<int64_t>(output_row_splits_[i]),
- ElementsAreArray(expected_values))
- << "row_splits " << i << " has an incorrect value/index";
- }
- }
-
- private:
- int input_;
- std::vector<int> input_shape_;
- int output_values_;
- std::vector<int> output_row_splits_;
-}; // namespace test
-
-TEST(WhitespaceTokenizerTest, SingleStringPaddedOutput) {
- WhitespaceTokenizerModel m(PADDED, {"this is a test"}, {1});
- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(1, 4));
- EXPECT_THAT(m.ExtractValuesTensorVector(),
- ElementsAre("this", "is", "a", "test"));
-}
-
-TEST(WhitespaceTokenizerTest, SingleStringRaggedOutput) {
- WhitespaceTokenizerModel m(RAGGED, {"this is a test"}, {1});
- m.CheckRowSplits({4});
- EXPECT_THAT(m.ExtractValuesTensorVector(),
- ElementsAre("this", "is", "a", "test"));
-}
-
-TEST(WhitespaceTokenizerTest, VectorPaddedOutput) {
- WhitespaceTokenizerModel m(PADDED,
- {"this is a test", //
- "three token sentence", //
- "many more tokens than that sentence"},
- {3});
- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(3, 6));
- EXPECT_THAT(
- m.ExtractValuesTensorVector(),
- ElementsAre("this", "is", "a", "test", "", "", //
- "three", "token", "sentence", "", "", "", //
- "many", "more", "tokens", "than", "that", "sentence"));
-}
-
-TEST(WhitespaceTokenizerTest, VectorRaggedOutput) {
- WhitespaceTokenizerModel m(RAGGED,
- {"this is a test", //
- "three token sentence", //
- "many more tokens than that sentence"},
- {3});
- m.CheckRowSplits({4, 3, 6});
- EXPECT_THAT(
- m.ExtractValuesTensorVector(),
- ElementsAre("this", "is", "a", "test", //
- "three", "token", "sentence", //
- "many", "more", "tokens", "than", "that", "sentence"));
-}
-
-TEST(WhitespaceTokenizerTest, MatrixPaddedOutput) {
- WhitespaceTokenizerModel m(PADDED,
- {"a b c", "d e f", //
- "g h", "i j k l", //
- "m", "n o p q r"},
- {3, 2});
- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(3, 2, 5));
- EXPECT_THAT(m.ExtractValuesTensorVector(),
- ElementsAre("a", "b", "c", "", "", //
- "d", "e", "f", "", "", //
- "g", "h", "", "", "", //
- "i", "j", "k", "l", "", //
- "m", "", "", "", "", //
- "n", "o", "p", "q", "r"));
-}
-
-TEST(WhitespaceTokenizerTest, MatrixRAGGEDOutput) {
- WhitespaceTokenizerModel m(RAGGED,
- {"a b c", "d e f", //
- "g h", "i j k l", //
- "m", "n o p q r"},
- {3, 2});
- m.CheckRowSplits({3, 3, 2, 4, 1, 5});
- EXPECT_THAT(m.ExtractValuesTensorVector(),
- ElementsAre("a", "b", "c", //
- "d", "e", "f", //
- "g", "h", //
- "i", "j", "k", "l", //
- "m", //
- "n", "o", "p", "q", "r"));
-}
-
-} // namespace test
-} // namespace whitespace_tokenizer
-} // namespace custom
-} // namespace ops
-} // namespace tflite
deleted file mode 100644
@@ -1,168 +0,0 @@
-# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ==============================================================================
-# Lint as: python3
-"""Tests for tensorflow_lite_support.custom_ops.kernel.whitespace_tokenizer."""
-
-import os
-import sys
-import timeit
-
-from absl import logging
-from absl.testing import parameterized
-import numpy as np
-import tensorflow as tf
-import tensorflow_text as tf_text
-# pylint: disable=g-direct-tensorflow-import
-from tensorflow.lite.python import interpreter as interpreter_wrapper
-from tensorflow.python.platform import resource_loader
-
-# Force loaded shared object symbols to be globally visible. This is needed so
-# that the interpreter_wrapper, in one .so file, can see the op resolver
-# in a different .so file. Note that this may already be set by default.
-# pylint: disable=g-import-not-at-top,g-bad-import-order,unused-import
-if hasattr(sys, 'setdlopenflags') and hasattr(sys, 'getdlopenflags'):
- sys.setdlopenflags(sys.getdlopenflags() | os.RTLD_GLOBAL)
-from tensorflow_lite_support.custom_ops.kernel import _pywrap_whitespace_tokenizer_op_resolver
-
-TEST_CASES = [
- ['this is a test'],
- ['extra spaces in here'],
- ['a four token sentence', 'a five token sentence thing.'],
- [['a multi dimensional test case', 'a b c d', 'e f g'],
- ['h i j', 'k l m 2 3', 'n o p'], ['q r s 0 1', 't u v', 'w x y z']],
-]
-
-INVOKES_FOR_SINGLE_OP_BENCHMARK = 1000
-INVOKES_FOR_FLEX_DELEGATE_BENCHMARK = 10
-
-
-@tf.function
-def _call_whitespace_tokenizer_to_tensor(test_case):
- tokenizer = tf_text.WhitespaceTokenizer()
- return tokenizer.tokenize(test_case).to_tensor()
-
-
-@tf.function
-def _call_whitespace_tokenizer_to_ragged(test_case):
- tokenizer = tf_text.WhitespaceTokenizer()
- return tokenizer.tokenize(test_case)
-
-
-class WhitespaceTokenizerTest(parameterized.TestCase):
-
- @parameterized.parameters([t] for t in TEST_CASES)
- def testToTensorEquivalence(self, test_case):
- tf_output = _call_whitespace_tokenizer_to_tensor(test_case)
-
- model_filename = resource_loader.get_path_to_datafile(
- 'testdata/whitespace_tokenizer_to_tensor.tflite')
- with open(model_filename, 'rb') as file:
- model = file.read()
- interpreter = interpreter_wrapper.InterpreterWithCustomOps(
- model_content=model,
- custom_op_registerers=['AddWhitespaceTokenizerCustomOp'])
-
- np_test_case = np.array(test_case, dtype=np.str)
- interpreter.resize_tensor_input(0, np_test_case.shape)
- interpreter.allocate_tensors()
- interpreter.set_tensor(interpreter.get_input_details()[0]['index'],
- np_test_case)
- interpreter.invoke()
- tflite_output = interpreter.get_tensor(
- interpreter.get_output_details()[0]['index'])
-
- self.assertEqual(tf_output.numpy().tolist(), tflite_output.tolist())
-
- @parameterized.parameters([t] for t in TEST_CASES)
- def testToRaggedEquivalence(self, test_case):
- tf_output = _call_whitespace_tokenizer_to_ragged(test_case)
-
- np_test_case = np.array(test_case, dtype=np.str)
- rank = len(np_test_case.shape)
-
- model_filename = resource_loader.get_path_to_datafile(
- 'testdata/whitespace_tokenizer_to_ragged_{}d_input.tflite'.format(rank))
- with open(model_filename, 'rb') as file:
- model = file.read()
- interpreter = interpreter_wrapper.InterpreterWithCustomOps(
- model_content=model,
- custom_op_registerers=['AddWhitespaceTokenizerCustomOp'])
- interpreter.resize_tensor_input(0, np_test_case.shape)
- interpreter.allocate_tensors()
- interpreter.set_tensor(interpreter.get_input_details()[0]['index'],
- np_test_case)
- interpreter.invoke()
-
- # Traverse the nested row_splits/values of the ragged tensor.
- for i in range(rank):
- tflite_output_cur_row_splits = interpreter.get_tensor(
- interpreter.get_output_details()[1 + i]['index'])
- self.assertEqual(tf_output.row_splits.numpy().tolist(),
- tflite_output_cur_row_splits.tolist())
- tf_output = tf_output.values
-
- tflite_output_values = interpreter.get_tensor(
- interpreter.get_output_details()[0]['index'])
- self.assertEqual(tf_output.numpy().tolist(), tflite_output_values.tolist())
-
- def testSingleOpLatency(self):
- model_filename = resource_loader.get_path_to_datafile(
- 'testdata/whitespace_tokenizer_to_tensor.tflite')
- with open(model_filename, 'rb') as file:
- model = file.read()
- interpreter = interpreter_wrapper.InterpreterWithCustomOps(
- model_content=model,
- custom_op_registerers=['AddWhitespaceTokenizerCustomOp'])
-
- latency = 0.0
- for test_case in TEST_CASES:
- np_test_case = np.array(test_case, dtype=np.str)
- interpreter.resize_tensor_input(0, np_test_case.shape)
- interpreter.allocate_tensors()
- interpreter.set_tensor(interpreter.get_input_details()[0]['index'],
- np_test_case)
- start_time = timeit.default_timer()
- for _ in range(INVOKES_FOR_SINGLE_OP_BENCHMARK):
- interpreter.invoke()
- latency = latency + timeit.default_timer() - start_time
-
- latency = latency / (INVOKES_FOR_SINGLE_OP_BENCHMARK * len(TEST_CASES))
- logging.info('Latency: %fms', latency * 1000.0)
-
- def testFlexDelegateLatency(self):
- model_filename = resource_loader.get_path_to_datafile(
- 'testdata/whitespace_tokenizer_flex_delegate.tflite')
- with open(model_filename, 'rb') as file:
- model = file.read()
- interpreter = interpreter_wrapper.Interpreter(model_content=model)
-
- latency = 0.0
- for test_case in TEST_CASES:
- np_test_case = np.array(test_case, dtype=np.str)
- interpreter.resize_tensor_input(0, np_test_case.shape)
- interpreter.allocate_tensors()
- interpreter.set_tensor(interpreter.get_input_details()[0]['index'],
- np_test_case)
- start_time = timeit.default_timer()
- for _ in range(INVOKES_FOR_FLEX_DELEGATE_BENCHMARK):
- interpreter.invoke()
- latency = latency + timeit.default_timer() - start_time
-
- latency = latency / (INVOKES_FOR_FLEX_DELEGATE_BENCHMARK * len(TEST_CASES))
- logging.info('Latency: %fms', latency * 1000.0)
-
-
-if __name__ == '__main__':
- tf.test.main()
@@ -8455,6 +8455,7 @@ Called by update_bad_message_reasons.py.-->
<int value="16" label="EMF_INVALID_EXTENSION_ID_FOR_CONTENT_SCRIPT"/>
<int value="17" label="EMF_INVALID_EXTENSION_ID_FOR_WORKER_CONTEXT"/>
<int value="18" label="EMF_INVALID_PORT_CONTEXT"/>
+ <int value="21" label="EMF_INVALID_EXTENSION_ID_FOR_TAB_MSG"/>
</enum>
<enum name="BadMessageReasonGuestView">
@@ -6,6 +6,7 @@
#include "ui/base/clipboard/ohos/clipboard_ohos_read_data.h"
#include "base/check_op.h"
+#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/files/file_util.h"
@@ -16,6 +17,7 @@
#include "base/synchronization/lock.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/common/content_switches.h"
#include "skia/ext/skia_utils_base.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/clipboard_constants.h"
@@ -29,6 +31,7 @@
#include "base/logging.h"
#include "ohos_adapter_helper.h"
+#include "ohos_resource_adapter.h"
#include <securec.h>
#include <map>
@@ -45,6 +48,10 @@ namespace {
const std::string kImgTagPattern = "<img.*?data-ohos=.*?>";
const std::string kImgTagSrcPattern = "src=*\"([^\"]+)";
const std::string kImgTagSrcHead = "src=\"";
+const std::string kResourcePathPrefix = "resources/";
+const std::string kResourceResavePathPrefix =
+ "/data/storage/el2/base/cache/resource_resave/";
+
using InstanceRegistry = std::set<const ClipboardOHOS*, std::less<>>;
InstanceRegistry* GetInstanceRegistry() {
static base::NoDestructor<InstanceRegistry> registry;
@@ -71,6 +78,14 @@ bool IsRegisteredInstance(const Clipboard* clipboard) {
return base::Contains(*GetInstanceRegistry(), clipboard);
}
+std::string RemoveFileSchemePerfix(const std::string img_src) {
+ GURL img_url(img_src);
+ if (img_url.SchemeIsFile()) {
+ return img_url.path();
+ }
+ return img_src;
+}
+
std::string GetImgLocalPath(const char* img_src) {
if (!img_src) {
return "";
@@ -80,9 +95,12 @@ std::string GetImgLocalPath(const char* img_src) {
img_url.SchemeIsBlob()) {
return "";
}
+ if (img_url.SchemeIsOhosResource()) {
+ return std::string(img_src);
+ }
if (img_url.SchemeIsFile() &&
base::PathExists(base::FilePath(img_url.path()))) {
- return img_url.path();
+ return std::string(img_src);
}
if (base::PathExists(base::FilePath(img_src))) {
return std::string(img_src);
@@ -126,6 +144,12 @@ class ClipboardOHOSInternal {
.GetPasteBoard()
.AddPasteboardChangedObserver(observer_);
observer_->SetClipboardInternal(this);
+ std::string hapPath =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kOhosHapPath);
+ resource_adapter_ =
+ OHOS::NWeb::OhosAdapterHelper::GetInstance().GetResourceAdapter(
+ hapPath);
}
~ClipboardOHOSInternal() {
@@ -320,7 +344,6 @@ class ClipboardOHOSInternal {
std::make_shared<std::string>(currentData->markup_data());
if (record->SetHtmlText(html)) {
LOG(INFO) << "set html to record success";
-
} else {
LOG(ERROR) << "set html to record failed";
}
@@ -348,8 +371,13 @@ class ClipboardOHOSInternal {
std::vector<uint8_t> offset_list(
offset_data, offset_data + it->second.size() * sizeof(int));
custom_data.insert(std::make_pair(it->first, offset_list));
- if (uri_record->SetUri(it->first) &&
+ std::string resave_path = it->first;
+ if (!ResaveResourceImg(it->first, resave_path)) {
+ continue;
+ }
+ if (uri_record->SetUri(RemoveFileSchemePerfix(resave_path)) &&
uri_record->SetCustomData(custom_data)) {
+ LOG(ERROR) << it->first;
result_list.push_back(uri_record);
} else {
LOG(ERROR) << "WriteHTML extra record failed";
@@ -405,6 +433,43 @@ class ClipboardOHOSInternal {
return allFormat & static_cast<int>(format);
}
+ bool ResaveResourceImg(const std::string& img_src, std::string& resave_path) {
+ GURL resource_img_src(img_src);
+ if (!resource_img_src.SchemeIsOhosResource()) {
+ LOG(INFO) << "no need to resave";
+ return true;
+ }
+
+ std::string img_path =
+ kResourcePathPrefix + resource_img_src.host() + resource_img_src.path();
+ if (!resource_adapter_ || !resource_adapter_->IsRawFileExist(img_path)) {
+ LOG(ERROR) << "resource_adapter is nullptr or " << img_path
+ << " is not exists";
+ return false;
+ }
+ std::unique_ptr<uint8_t[]> data;
+ size_t length = 0;
+ if (!resource_adapter_->GetRawFileData(img_path, length, data, false)) {
+ LOG(ERROR) << "read " << img_path << " failed";
+ return false;
+ }
+ LOG(INFO) << img_path << " length:" << length;
+ base::FilePath resave_root_path(kResourceResavePathPrefix);
+ resave_root_path = resave_root_path.Append(base::FilePath(img_path));
+ LOG(ERROR) << "resave_root_path dir:" << resave_root_path.DirName();
+ if (!base::DirectoryExists(resave_root_path.DirName()) &&
+ !base::CreateDirectory(resave_root_path.DirName())) {
+ return false;
+ }
+ resave_path = resave_root_path.AsUTF8Unsafe();
+ if (base::WriteFile(resave_root_path, reinterpret_cast<char*>(data.get()),
+ length) != length) {
+ LOG(ERROR) << "resave img resource failed";
+ return false;
+ }
+ return true;
+ }
+
// Current ClipboardData.
std::unique_ptr<ClipboardData> data_;
@@ -413,6 +478,7 @@ class ClipboardOHOSInternal {
std::shared_ptr<PasteboardObserverOhos> observer_;
ClipboardState state_ = ClipboardState::kOutOfDate;
std::shared_ptr<ClipboardOhosReadData> read_data_ = nullptr;
+ std::unique_ptr<OHOS::NWeb::OhosResourceAdapter> resource_adapter_ = nullptr;
};
class ClipboardDataBuilder {
@@ -533,7 +599,6 @@ class ClipboardDataBuilder {
std::map<std::string, std::vector<int>>& img_src_set,
int offset) {
std::string img_path = GetImgLocalPath(img_src);
- // LOG(ERROR) << "AddImgUrlToSet:" << img_path;
if (!img_path.empty()) {
std::map<std::string, std::vector<int>>::iterator iter =
img_src_set.find(img_path);
@@ -10,12 +10,21 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "third_party/icu/source/i18n/unicode/regex.h"
+#include "url/gurl.h"
using namespace OHOS::NWeb;
namespace ui {
const std::string kImgPasteboardDir = "/data/storage/el2/base/cache/pasteboard";
+std::string RemoveFileSchemePerfix(const std::string& img_src) {
+ GURL img_url(img_src);
+ if (img_url.SchemeIsFile()) {
+ return img_url.path();
+ }
+ return img_src;
+}
+
ClipboardOhosReadData::ClipboardOhosReadData(PasteRecordList& record_list)
: record_list_(record_list) {
is_in_app_ = OhosAdapterHelper::GetInstance().GetPasteBoard().IsLocalPaste();
@@ -28,6 +37,7 @@ ClipboardOhosReadData::ClipboardOhosReadData(PasteRecordList& record_list)
if (!new_uri) {
continue;
}
+ LOG(INFO) << "new_uri:" << *new_uri;
int fd = OhosAdapterHelper::GetInstance().GetPasteBoard().OpenRemoteUri(
*new_uri);
if (fd > 0) {
@@ -41,11 +51,12 @@ void ClipboardOhosReadData::SaveImgFile(const std::string& old_uri,
std::string& new_uri,
uint32_t token_id) {
base::FilePath pasteboard_root_path(kImgPasteboardDir);
+ std::string old_uri_without_prefix = RemoveFileSchemePerfix(old_uri);
base::FilePath dest_file_dir_path(
pasteboard_root_path.Append(std::to_string(token_id))
- .Append(base::FilePath(old_uri).DirName()));
- base::FilePath new_file_path(
- dest_file_dir_path.Append(base::FilePath(old_uri).BaseName()));
+ .Append(base::FilePath(old_uri_without_prefix).DirName()));
+ base::FilePath new_file_path(dest_file_dir_path.Append(
+ base::FilePath(old_uri_without_prefix).BaseName()));
if (!base::DirectoryExists(dest_file_dir_path) &&
!base::CreateDirectory(dest_file_dir_path)) {
return;
@@ -60,7 +71,7 @@ void ClipboardOhosReadData::SaveImgFile(const std::string& old_uri,
base::File::Flags::FLAG_WRITE);
if (old_file.IsValid() && new_file.IsValid()) {
if (base::CopyFileContents(old_file, new_file)) {
- new_uri = new_file_path.AsUTF8Unsafe();
+ new_uri = "file://" + new_file_path.AsUTF8Unsafe();
} else {
LOG(ERROR) << "SaveImgFile copy file failed";
}
@@ -25,6 +25,13 @@
#include "net/filter/gzip_header.h"
#include "third_party/zlib/google/compression_utils.h"
+#if BUILDFLAG(IS_OHOS)
+#include <unordered_map>
+#include "base/command_line.h"
+#include "content/public/common/content_switches.h"
+#include "ohos_adapter_helper.h"
+#endif
+
// For details of the file layout, see
// http://dev.chromium.org/developers/design-documents/linuxresourcesandlocalizedstrings
@@ -173,6 +180,38 @@ bool MmapHasGzipHeader(const base::MemoryMappedFile* mmap) {
return header_status == net::GZipHeader::COMPLETE_HEADER;
}
+#if BUILDFLAG(IS_OHOS)
+std::unordered_map<ui::ResourceScaleFactor, std::string> kPakFileNameHapMap = {
+ {ui::ResourceScaleFactor::kScaleFactorNone,
+ "resources/rawfile/resources.pak"},
+ {ui::ResourceScaleFactor::k100Percent,
+ "resources/rawfile/chrome_100_percent.pak"},
+ {ui::ResourceScaleFactor::k200Percent,
+ "resources/rawfile/chrome_200_percent.pak"}};
+
+bool IsPathFromHap(ui::ResourceScaleFactor factor,
+ const base::FilePath& path,
+ std::string& pathHap) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kOhosHapPath)) {
+ LOG(INFO) << "not has switch kOhosHapPath, hap is decompress";
+ return false;
+ }
+ auto iter = kPakFileNameHapMap.find(factor);
+ if (iter == kPakFileNameHapMap.end()) {
+ LOG(ERROR) << "kPakFileNameHapMap not find path: " << path;
+ return false;
+ }
+ std::string pathStr = path.MaybeAsASCII();
+ if (pathStr.find("zh-CN.pak") != std::string::npos) {
+ pathHap = "resources/rawfile/locales/zh-CN.pak";
+ } else if (pathStr.find("en-US.pak") != std::string::npos) {
+ pathHap = "resources/rawfile/locales/en-US.pak";
+ } else {
+ pathHap = iter->second;
+ }
+ return true;
+}
+#endif
} // namespace
namespace ui {
@@ -278,10 +317,46 @@ DataPack::DataPack(ResourceScaleFactor resource_scale_factor)
static_assert(sizeof(Alias) == 4, "size of Alias must be 4");
}
-DataPack::~DataPack() {
-}
+DataPack::~DataPack() {}
bool DataPack::LoadFromPath(const base::FilePath& path) {
+#if BUILDFLAG(IS_OHOS)
+ std::string pathHap;
+ if (IsPathFromHap(resource_scale_factor_, path, pathHap)) {
+ size_t length = 0;
+ std::unique_ptr<uint8_t[]> data;
+ auto resourceInstance =
+ OHOS::NWeb::OhosAdapterHelper::GetInstance().GetResourceAdapter();
+ if (!resourceInstance->GetRawFileData(pathHap, length, data, true)) {
+ LOG(ERROR) << "DataPack::LoadFromPath couldn't data file: "
+ << pathHap.c_str();
+ return false;
+ }
+
+ LOG(INFO) << "DataPack::LoadFromPath " << pathHap.c_str()
+ << ", data file length: " << length;
+ std::unique_ptr<base::MemoryMappedFile> mmap =
+ std::make_unique<base::MemoryMappedFile>();
+ mmap->SetDataAndLength(data, length);
+ if (MmapHasGzipHeader(mmap.get())) {
+ base::StringPiece compressed(reinterpret_cast<char*>(mmap->data()),
+ mmap->length());
+ std::string data;
+ if (!compression::GzipUncompress(compressed, &data)) {
+ LOG(ERROR) << "Failed to unzip compressed datapack: "
+ << pathHap.c_str();
+ LogDataPackError(UNZIP_FAILED);
+ return false;
+ }
+ return LoadImpl(std::make_unique<StringDataSource>(std::move(data)));
+ }
+ return LoadImpl(std::make_unique<MemoryMappedDataSource>(std::move(mmap)));
+ }
+ if (!base::PathExists(path)) {
+ LOG(ERROR) << "LoadFromPath file not exist";
+ return false;
+ }
+#endif
std::unique_ptr<base::MemoryMappedFile> mmap =
std::make_unique<base::MemoryMappedFile>();
// Open the file for reading; allowing other consumers to also open it for
@@ -502,9 +577,9 @@ void DataPack::CheckForDuplicateResources(
if (GetScaleForResourceScaleFactor(handle->GetResourceScaleFactor()) !=
resource_scale)
continue;
- DCHECK(!handle->HasResource(resource_id)) << "Duplicate resource "
- << resource_id << " with scale "
- << resource_scale;
+ DCHECK(!handle->HasResource(resource_id))
+ << "Duplicate resource " << resource_id << " with scale "
+ << resource_scale;
}
}
}
@@ -68,6 +68,12 @@
#undef LoadBitmap
#endif
+#if BUILDFLAG(IS_OHOS)
+#include "base/command_line.h"
+#include "content/public/common/content_switches.h"
+#include "ohos_adapter_helper.h"
+#endif
+
namespace ui {
namespace {
@@ -366,6 +372,14 @@ void ResourceBundle::LoadSecondaryLocaleDataWithPakFileRegion(
#if !BUILDFLAG(IS_ANDROID)
// static
bool ResourceBundle::LocaleDataPakExists(const std::string& locale) {
+#if BUILDFLAG(IS_OHOS)
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kOhosHapPath)) {
+ if (locale == "zh-CN" || locale == "en-US" || locale == "resources" ||
+ locale == "chrome_100_percent" || locale == "chrome_200_percent") {
+ return true;
+ }
+ }
+#endif
const auto path = GetLocaleFilePath(locale);
return !path.empty() && base::PathExists(path);
}
@@ -32,4 +32,4 @@ declare_args() {
has_platform_accessibility_support =
has_native_accessibility || is_android || is_fuchsia
-enable_hidpi = !is_android
+enable_hidpi = !is_android && !is_ohos
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "ui/gl/gl_surface_egl_ohos.h"
+#include "content/public/common/content_switches.h"
#include <surface.h>
#include <sys/time.h>
@@ -25,11 +26,29 @@ namespace gl {
scoped_refptr<gl::NativeViewGLSurfaceEGLOhos>
NativeViewGLSurfaceEGLOhos::CreateNativeViewGLSurfaceEGLOhos(
gfx::AcceleratedWidget widget) {
- NativeWindow* window =
- (NativeWindow*)NWebNativeWindowTracker::Instance().GetNativeWindow(
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(::switches::kOhosHanceSurface)) {
+ LOG(INFO) << "CreateNativeViewGLSurfaceEGLOhos:: enhance surface";
+ WindowsSurfaceInfo* surfaceInfo =
+ (WindowsSurfaceInfo*)NWebNativeWindowTracker::Instance().GetNativeWindow(
widget);
- return scoped_refptr<NativeViewGLSurfaceEGLOhos>(
- new NativeViewGLSurfaceEGLOhos(EGLNativeWindowType(window)));
+ if (surfaceInfo != nullptr) {
+ LOG(INFO) << "clear surface from NWEB";
+ eglDestroySurface(surfaceInfo->display, surfaceInfo->surface);
+ eglDestroyContext(surfaceInfo->display, surfaceInfo->context);
+
+ return scoped_refptr<NativeViewGLSurfaceEGLOhos>(
+ new NativeViewGLSurfaceEGLOhos(EGLNativeWindowType(surfaceInfo->window)));
+ }
+ } else {
+ LOG(INFO) << "CreateNativeViewGLSurfaceEGLOhos:: normal surface";
+ NativeWindow* window =
+ (NativeWindow*)NWebNativeWindowTracker::Instance().GetNativeWindow(
+ widget);
+ return scoped_refptr<NativeViewGLSurfaceEGLOhos>(
+ new NativeViewGLSurfaceEGLOhos(EGLNativeWindowType(window)));
+ }
+ return nullptr;
}
NativeViewGLSurfaceEGLOhos::NativeViewGLSurfaceEGLOhos(
@@ -54,9 +73,8 @@ gfx::SwapResult NativeViewGLSurfaceEGLOhos::SwapBuffers(
void NativeViewGLSurfaceEGLOhos::FrameCounter::Start() {
std::weak_ptr<FrameCounter> frame_counter_weak(shared_from_this());
std::thread frame_stat_thread([frame_counter_weak]() {
- while (!frame_counter_weak.expired()) {
+ while (auto frame_counter = frame_counter_weak.lock()) {
{
- auto frame_counter = frame_counter_weak.lock();
std::unique_lock<std::mutex> lk(frame_counter->frame_stat_mtx_);
int64_t curr_time = GetNowTime();
if (frame_counter->last_time_ == 0) {
@@ -10,8 +10,15 @@
#include <mutex>
#include "ui/gl/gl_export.h"
#include "ui/gl/gl_surface_egl.h"
+#include "ui/gl/gl_bindings.h"
namespace gl {
+typedef struct WindowsSurfaceInfoTag {
+ void* window;
+ EGLDisplay display;
+ EGLContext context;
+ EGLSurface surface;
+} WindowsSurfaceInfo;
class GL_EXPORT NativeViewGLSurfaceEGLOhos : public NativeViewGLSurfaceEGL {
public:
@@ -96,7 +96,11 @@ bool GLSurfacePresentationHelper::GetFrameTimestampInfoIfAvailable(
int64_t start = 0;
int64_t end = 0;
frame.timer->GetStartEndTimestamps(&start, &end);
+#if BUILDFLAG(IS_OHOS)
+ *timestamp = base::TimeTicks::Now();
+#else
*timestamp = base::TimeTicks() + base::Microseconds(start);
+#endif
} else {
if (!frame.fence->HasCompleted())
return false;
@@ -15,7 +15,13 @@ import("//ui/views/features.gni")
assert(toolkit_views || is_ohos)
config("flags") {
- defines = [ "TOOLKIT_VIEWS=1" ]
+ if (is_ohos) {
+ if (toolkit_views) {
+ defines = [ "TOOLKIT_VIEWS=1" ]
+ }
+ } else {
+ defines = [ "TOOLKIT_VIEWS=1" ]
+ }
}
aggregate_vector_icons("views_vector_icons") {
@@ -74,6 +74,11 @@ AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(View* view) {
// Avoid problems with transient focus events. https://crbug.com/729449
if (!view->GetWidget())
return nullptr;
+
+ DCHECK(view_to_id_map_.find(view) != view_to_id_map_.end() ||
+ // This is either a new view or we're erroneously here during ~View.
+ view->life_cycle_state() == View::LifeCycleState::kAlive);
+
return CreateInternal<AXViewObjWrapper>(view, &view_to_id_map_);
}
@@ -88,9 +88,6 @@ class VIEWS_EXPORT AXAuraObjCache : public aura::client::FocusChangeObserver {
// Get the object that has focus.
AXAuraObjWrapper* GetFocus();
- // Send a notification that the focused view may have changed.
- void OnFocusedViewChanged();
-
// Tell our delegate to fire an event on a given object.
void FireEvent(AXAuraObjWrapper* aura_obj, ax::mojom::Event event_type);
@@ -122,6 +119,9 @@ class VIEWS_EXPORT AXAuraObjCache : public aura::client::FocusChangeObserver {
View* GetFocusedView();
+ // Send a notification that the focused view may have changed.
+ void OnFocusedViewChanged();
+
// aura::client::FocusChangeObserver override.
void OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) override;
@@ -106,15 +106,12 @@ class ViewBlurObserver : public ViewObserver {
observation_.Observe(view);
}
- // This is fired while the view is being destroyed, after the cache entry is
- // removed by the AXWidgetObjWrapper. Re-create the cache entry so we can
- // test that it will also be removed.
void OnViewBlurred(View* view) override {
ASSERT_FALSE(was_called());
observation_.Reset();
- ASSERT_EQ(cache_->GetID(view), 0);
- cache_->GetOrCreate(view);
+ // The cache entry gets deleted in
+ // AXViewObjWrapper::OnViewIsDeleting which occurs later in ~View.
}
bool was_called() { return !observation_.IsObserving(); }
@@ -20,7 +20,6 @@ AXWidgetObjWrapper::AXWidgetObjWrapper(AXAuraObjCache* aura_obj_cache,
: AXAuraObjWrapper(aura_obj_cache), widget_(widget) {
DCHECK(widget->GetNativeView());
widget_observation_.Observe(widget);
- widget_removals_observation_.Observe(widget);
}
AXWidgetObjWrapper::~AXWidgetObjWrapper() = default;
@@ -78,14 +77,4 @@ void AXWidgetObjWrapper::OnWidgetClosing(Widget* widget) {
aura_obj_cache_->Remove(widget);
}
-void AXWidgetObjWrapper::OnWidgetVisibilityChanged(Widget*, bool) {
- // If a widget changes visibility it may affect what's focused, in particular
- // when a widget that contains the focused view gets hidden.
- aura_obj_cache_->OnFocusedViewChanged();
-}
-
-void AXWidgetObjWrapper::OnWillRemoveView(Widget* widget, View* view) {
- aura_obj_cache_->RemoveViewSubtree(view);
-}
-
} // namespace views
@@ -16,15 +16,12 @@
#include "ui/views/accessibility/ax_aura_obj_wrapper.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
-#include "ui/views/widget/widget_removals_observer.h"
namespace views {
class AXAuraObjCache;
// Describes a |Widget| for use with other AX classes.
-class AXWidgetObjWrapper : public AXAuraObjWrapper,
- public WidgetObserver,
- public WidgetRemovalsObserver {
+class AXWidgetObjWrapper : public AXAuraObjWrapper, public WidgetObserver {
public:
// |aura_obj_cache| must outlive this object.
AXWidgetObjWrapper(AXAuraObjCache* aura_obj_cache, Widget* widget);
@@ -43,10 +40,6 @@ class AXWidgetObjWrapper : public AXAuraObjWrapper,
void OnWidgetDestroying(Widget* widget) override;
void OnWidgetDestroyed(Widget* widget) override;
void OnWidgetClosing(Widget* widget) override;
- void OnWidgetVisibilityChanged(Widget*, bool) override;
-
- // WidgetRemovalsObserver overrides.
- void OnWillRemoveView(Widget* widget, View* view) override;
private:
raw_ptr<Widget> widget_;
@@ -54,11 +47,6 @@ class AXWidgetObjWrapper : public AXAuraObjWrapper,
const ui::AXUniqueId unique_id_;
base::ScopedObservation<Widget, WidgetObserver> widget_observation_{this};
- base::ScopedObservation<Widget,
- WidgetRemovalsObserver,
- &Widget::AddRemovalsObserver,
- &Widget::RemoveRemovalsObserver>
- widget_removals_observation_{this};
};
} // namespace views
@@ -281,19 +281,15 @@ void AXWindowObjWrapper::OnCaretBoundsChanged(
}
void AXWindowObjWrapper::OnWindowDestroyed(aura::Window* window) {
+ if (is_root_window_)
+ aura_obj_cache_->OnRootWindowObjDestroyed(window_);
+
aura_obj_cache_->Remove(window, nullptr);
}
void AXWindowObjWrapper::OnWindowDestroying(aura::Window* window) {
- if (window == window_)
- window_destroying_ = true;
-
- Widget* widget = GetWidgetForWindow(window);
- if (widget)
- aura_obj_cache_->Remove(widget);
-
- if (is_root_window_)
- aura_obj_cache_->OnRootWindowObjDestroyed(window_);
+ DCHECK_EQ(window, window_);
+ window_destroying_ = true;
}
void AXWindowObjWrapper::OnWindowHierarchyChanged(
@@ -35,6 +35,7 @@
#include "ui/views/view_class_properties.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
+#include "ui/views/window/dialog_client_view.h"
#if BUILDFLAG(IS_WIN)
#include "ui/base/win/shell.h"
@@ -709,6 +710,16 @@ void BubbleDialogDelegate::OnAnchorBoundsChanged() {
// TODO(pbos): Reconsider whether to update the anchor when the view isn't
// drawn.
SizeToContents();
+
+ // We will not accept input event a short time after anchored view changed.
+ UpdateInputProtectorsTimeStamp();
+}
+
+void BubbleDialogDelegate::UpdateInputProtectorsTimeStamp() {
+ if (auto* dialog = GetDialogClientView())
+ dialog->UpdateInputProtectorTimeStamp();
+
+ GetBubbleFrameView()->UpdateInputProtectorTimeStamp();
}
gfx::Rect BubbleDialogDelegate::GetBubbleBounds() {
@@ -140,6 +140,10 @@ class VIEWS_EXPORT BubbleDialogDelegate : public DialogDelegate {
// normally, do not call this.
void OnAnchorBoundsChanged();
+ // Call this method to update view shown time stamp of underneath input
+ // protectors.
+ void UpdateInputProtectorsTimeStamp();
+
//////////////////////////////////////////////////////////////////////////////
// Miscellaneous bubble behaviors:
//
@@ -692,6 +692,10 @@ gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(
return bubble_border_->GetBounds(anchor_rect, size);
}
+void BubbleFrameView::UpdateInputProtectorTimeStamp() {
+ input_protector_.UpdateViewShownTimeStamp();
+}
+
void BubbleFrameView::ResetViewShownTimeStampForTesting() {
input_protector_.ResetForTesting();
}
@@ -166,6 +166,10 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView {
View* GetHeaderViewForTesting() const { return header_view_; }
+ // Update the |view_shown_time_stamp_| of input protector. A short time
+ // from this point onward, input event will be ignored.
+ void UpdateInputProtectorTimeStamp();
+
// Resets the time when view has been shown. Tests may need to call this
// method if they use events that could be otherwise treated as unintended.
// See IsPossiblyUnintendedInteraction().
@@ -202,6 +206,8 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView {
IgnorePossiblyUnintendedClicksClose);
FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest,
IgnorePossiblyUnintendedClicksMinimize);
+ FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest,
+ IgnorePossiblyUnintendedClicksAnchorBoundsChanged);
FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CloseReasons);
FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewTest, CloseMethods);
FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewTest, CreateDelegate);
@@ -30,11 +30,10 @@
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
+#include "ui/views/window/dialog_client_view.h"
namespace views {
-using BubbleFrameViewTest = ViewsTestBase;
-
namespace {
constexpr BubbleBorder::Arrow kArrow = BubbleBorder::TOP_LEFT;
@@ -147,6 +146,18 @@ class TestBubbleFrameView : public BubbleFrameView {
} // namespace
+class BubbleFrameViewTest : public ViewsTestBase {
+ public:
+ BubbleFrameViewTest()
+ : views::ViewsTestBase(
+ base::test::TaskEnvironment::TimeSource::MOCK_TIME) {}
+
+ BubbleFrameViewTest(const BubbleFrameViewTest&) = delete;
+ BubbleFrameViewTest& operator=(const BubbleFrameViewTest&) = delete;
+
+ ~BubbleFrameViewTest() override = default;
+};
+
TEST_F(BubbleFrameViewTest, GetBoundsForClientView) {
TestBubbleFrameView frame(this);
EXPECT_EQ(kArrow, frame.GetBorderArrow());
@@ -1303,6 +1314,46 @@ TEST_F(BubbleFrameViewTest, IgnorePossiblyUnintendedClicksMinimize) {
EXPECT_TRUE(bubble->IsMinimized());
}
+// Ensures that clicks are ignored for short time after anchor view bounds
+// changed.
+TEST_F(BubbleFrameViewTest, IgnorePossiblyUnintendedClicksAnchorBoundsChanged) {
+ auto delegate_unique = std::make_unique<TestBubbleDialogDelegateView>();
+ TestBubbleDialogDelegateView* const delegate = delegate_unique.get();
+ TestAnchor anchor(CreateParams(Widget::InitParams::TYPE_WINDOW));
+ delegate->SetAnchorView(anchor.widget().GetContentsView());
+ delegate->SetCanMinimize(true);
+ Widget* bubble =
+ BubbleDialogDelegateView::CreateBubble(std::move(delegate_unique));
+ bubble->Show();
+ ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
+ BubbleFrameView* frame = delegate->GetBubbleFrameView();
+ test::ButtonTestApi(frame->minimize_).NotifyClick(mouse_event);
+ auto* widget = delegate->GetWidget();
+ auto* dialog = delegate->GetDialogClientView();
+ auto* ok_button = dialog->ok_button();
+ test::ButtonTestApi(ok_button).NotifyClick(mouse_event);
+ EXPECT_FALSE(bubble->IsMinimized());
+ EXPECT_FALSE(widget->IsClosed());
+
+ task_environment()->FastForwardBy(
+ base::Milliseconds(GetDoubleClickInterval()));
+ anchor.widget().SetBounds(gfx::Rect(10, 10, 100, 100));
+
+ ui::MouseEvent mouse_event_1(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
+ test::ButtonTestApi(ok_button).NotifyClick(mouse_event_1);
+ test::ButtonTestApi(frame->minimize_).NotifyClick(mouse_event_1);
+ EXPECT_FALSE(widget->IsClosed());
+ EXPECT_FALSE(bubble->IsMinimized());
+
+ test::ButtonTestApi(ok_button).NotifyClick(ui::MouseEvent(
+ ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
+ ui::EventTimeForNow() + base::Milliseconds(GetDoubleClickInterval()),
+ ui::EF_NONE, ui::EF_NONE));
+ EXPECT_TRUE(widget->IsClosed());
+}
+
// Ensures that layout is correct when the progress indicator is visible.
TEST_F(BubbleFrameViewTest, LayoutWithProgressIndicator) {
auto delegate_unique = std::make_unique<TestBubbleDialogDelegateView>();
@@ -14,6 +14,14 @@ void InputEventActivationProtector::VisibilityChanged(bool is_visible) {
view_shown_time_stamp_ = base::TimeTicks::Now();
}
+void InputEventActivationProtector::UpdateViewShownTimeStamp() {
+ // The UI was never shown, ignore.
+ if (view_shown_time_stamp_ == base::TimeTicks())
+ return;
+
+ view_shown_time_stamp_ = base::TimeTicks::Now();
+}
+
bool InputEventActivationProtector::IsPossiblyUnintendedInteraction(
const ui::Event& event) {
if (view_shown_time_stamp_ == base::TimeTicks()) {
@@ -30,6 +30,11 @@ class VIEWS_EXPORT InputEventActivationProtector {
// method must be called when the visibility of the view is changed.
void VisibilityChanged(bool is_visible);
+ // Updates the |view_shown_time_stamp_| if needed. This function will be
+ // called when we want to reset back the input protector to "initial shown"
+ // state, basically under some certain view's proprieties changed events.
+ void UpdateViewShownTimeStamp();
+
// Returns true if the event is a mouse, touch, or pointer event that took
// place within the double-click time interval after |view_shown_time_stamp_|.
bool IsPossiblyUnintendedInteraction(const ui::Event& event);
@@ -224,6 +224,8 @@ View::View() {
}
View::~View() {
+ life_cycle_state_ = LifeCycleState::kDestroying;
+
if (parent_)
parent_->RemoveChildView(this);
@@ -1415,6 +1415,16 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
void RemoveObserver(ViewObserver* observer);
bool HasObserver(const ViewObserver* observer) const;
+ // http://crbug.com/1162949 : Instrumentation that indicates if this is alive.
+ // Callers should not depend on this as it is meant to be temporary.
+ enum class LifeCycleState : uint32_t {
+ kAlive = 0x600D600D,
+ kDestroying = 0x90141013,
+ kDestroyed = 0xBAADBAAD,
+ };
+
+ LifeCycleState life_cycle_state() const { return life_cycle_state_; }
+
protected:
// Used to track a drag. RootView passes this into
// ProcessMousePressed/Dragged.
@@ -1666,12 +1676,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
FRIEND_TEST_ALL_PREFIXES(ViewTest, PaintWithMovedViewUsesCacheInRTL);
FRIEND_TEST_ALL_PREFIXES(ViewTest, PaintWithUnknownInvalidation);
- // http://crbug.com/1162949 : Instrumentation that indicates if this is alive.
- enum class LifeCycleState : uint32_t {
- kAlive = 0x600D600D,
- kDestroyed = 0xBAADBAAD,
- };
-
// This is the default view layout. It is a very simple version of FillLayout,
// which merely sets the bounds of the children to the content bounds. The
// actual FillLayout isn't used here because it supports a couple of features
@@ -225,6 +225,10 @@ void DialogClientView::OnThemeChanged() {
}
}
+void DialogClientView::UpdateInputProtectorTimeStamp() {
+ input_protector_.UpdateViewShownTimeStamp();
+}
+
void DialogClientView::ResetViewShownTimeStampForTesting() {
input_protector_.ResetForTesting();
}
@@ -63,6 +63,10 @@ class VIEWS_EXPORT DialogClientView : public ClientView, public DialogObserver {
const ViewHierarchyChangedDetails& details) override;
void OnThemeChanged() override;
+ // Update the |view_shown_time_stamp_| of input protector. A short time
+ // from this point onward, input event will be ignored.
+ void UpdateInputProtectorTimeStamp();
+
void set_minimum_size(const gfx::Size& size) { minimum_size_ = size; }
// Resets the time when view has been shown. Tests may need to call this
@@ -275,12 +275,8 @@ const DialogClientView* DialogDelegate::GetDialogClientView() const {
}
DialogClientView* DialogDelegate::GetDialogClientView() {
- if (!GetWidget())
- return nullptr;
- views::View* client_view = GetWidget()->client_view();
- return client_view->GetClassName() == DialogClientView::kViewClassName
- ? static_cast<DialogClientView*>(client_view)
- : nullptr;
+ return const_cast<DialogClientView*>(
+ const_cast<const DialogDelegate*>(this)->GetDialogClientView());
}
BubbleFrameView* DialogDelegate::GetBubbleFrameView() const {
@@ -172,6 +172,13 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
// will only be created when use_custom_frame() is true.
BubbleFrameView* GetBubbleFrameView() const;
+ // A helper for accessing the DialogClientView object contained by this
+ // delegate's Window. This function can return nullptr if the |client_view| is
+ // a DialogClientView subclass which also has metadata or overrides
+ // GetClassName().
+ const DialogClientView* GetDialogClientView() const;
+ DialogClientView* GetDialogClientView();
+
// Helpers for accessing parts of the DialogClientView without needing to know
// about DialogClientView. Do not call these before OnWidgetInitialized().
views::LabelButton* GetOkButton() const;
@@ -310,11 +317,6 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
std::unique_ptr<View> DisownFootnoteView();
private:
- // A helper for accessing the DialogClientView object contained by this
- // delegate's Window.
- const DialogClientView* GetDialogClientView() const;
- DialogClientView* GetDialogClientView();
-
// Runs a close callback, ensuring that at most one close callback is ever
// run.
void RunCloseCallback(base::OnceClosure callback);
@@ -248,6 +248,13 @@ class COMPONENT_EXPORT(URL) GURL {
return SchemeIs(url::kFileSystemScheme);
}
+#if BUILDFLAG(IS_OHOS)
+ // Resource URLs for ohos system
+ bool SchemeIsOhosResource() const {
+ return SchemeIs(url::kResourcesScheme);
+ }
+#endif
+
// Returns true if the scheme indicates a network connection that uses TLS or
// some other cryptographic protocol (e.g. QUIC) for security.
//
@@ -55,6 +55,9 @@ const char16_t kWsScheme16[] = u"ws";
const char kWssScheme[] = "wss";
const char16_t kWssScheme16[] = u"wss";
+const char kResourcesScheme[] = "resource";
+const char16_t kResourcesScheme16[] = u"resource";
+
const char kStandardSchemeSeparator[] = "://";
const char16_t kStandardSchemeSeparator16[] = u"://";
@@ -59,6 +59,9 @@ COMPONENT_EXPORT(URL) extern const char16_t kWsScheme16[];
COMPONENT_EXPORT(URL) extern const char kWssScheme[];
COMPONENT_EXPORT(URL) extern const char16_t kWssScheme16[];
+COMPONENT_EXPORT(URL) extern const char kResourcesScheme[];
+COMPONENT_EXPORT(URL) extern const char16_t kResourcesScheme16[];
+
// Used to separate a standard scheme and the hostname: "://".
COMPONENT_EXPORT(URL) extern const char kStandardSchemeSeparator[];
COMPONENT_EXPORT(URL) extern const char16_t kStandardSchemeSeparator16[];
@@ -47,6 +47,7 @@ struct SchemeRegistry {
{kWsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, // WebSocket.
{kFileSystemScheme, SCHEME_WITHOUT_AUTHORITY},
{kQuicTransportScheme, SCHEME_WITH_HOST_AND_PORT},
+ {kResourcesScheme, SCHEME_WITH_HOST},
};
// Schemes that are allowed for referrers.
@@ -69,7 +70,7 @@ struct SchemeRegistry {
// Schemes that normal pages cannot link to or access (i.e., with the same
// security rules as those applied to "file" URLs).
std::vector<std::string> local_schemes = {
- kFileScheme,
+ kFileScheme, kResourcesScheme,
};
// Schemes that cause pages loaded with them to not have access to pages
@@ -89,7 +90,7 @@ struct SchemeRegistry {
// Schemes that can be used by web to store data (local storage, etc).
std::vector<std::string> web_storage_schemes = {
- kHttpsScheme, kHttpScheme, kFileScheme, kFtpScheme, kWssScheme, kWsScheme,
+ kHttpsScheme, kHttpScheme, kFileScheme, kFtpScheme, kWssScheme, kWsScheme, kResourcesScheme
};
// Schemes that can bypass the Content-Security-Policy (CSP) checks.
@@ -87,7 +87,7 @@ declare_args() {
# Enable advanced BigInt algorithms, costing about 10-30 KB binary size
# depending on platform. Disabled on Android to save binary size.
- v8_advanced_bigint_algorithms = !is_android
+ v8_advanced_bigint_algorithms = !is_android && !is_ohos
}
if (v8_use_external_startup_data == "") {
@@ -139,7 +139,8 @@ if (is_debug && !v8_optimized_debug) {
# TODO(crbug.com/621335) Rework this so that we don't have the confusion
# between "optimize_speed" and "optimize_max".
- if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) {
+ if (((is_posix && !is_android && !is_ohos) || is_fuchsia) &&
+ !using_sanitizer) {
v8_add_configs += [ "//build/config/compiler:optimize_speed" ]
} else {
v8_add_configs += [ "//build/config/compiler:optimize_max" ]
@@ -840,9 +840,8 @@ void DeclarationScope::AddLocal(Variable* var) {
}
void Scope::Snapshot::Reparent(DeclarationScope* new_parent) {
- DCHECK(!IsCleared());
- DCHECK_EQ(new_parent, outer_scope_and_calls_eval_.GetPointer()->inner_scope_);
- DCHECK_EQ(new_parent->outer_scope_, outer_scope_and_calls_eval_.GetPointer());
+ DCHECK_EQ(new_parent, outer_scope_->inner_scope_);
+ DCHECK_EQ(new_parent->outer_scope_, outer_scope_);
DCHECK_EQ(new_parent, new_parent->GetClosureScope());
DCHECK_NULL(new_parent->inner_scope_);
DCHECK(new_parent->unresolved_list_.is_empty());
@@ -867,12 +866,11 @@ void Scope::Snapshot::Reparent(DeclarationScope* new_parent) {
new_parent->sibling_ = top_inner_scope_;
}
- Scope* outer_scope = outer_scope_and_calls_eval_.GetPointer();
- new_parent->unresolved_list_.MoveTail(&outer_scope->unresolved_list_,
+ new_parent->unresolved_list_.MoveTail(&outer_scope_->unresolved_list_,
top_unresolved_);
// Move temporaries allocated for complex parameter initializers.
- DeclarationScope* outer_closure = outer_scope->GetClosureScope();
+ DeclarationScope* outer_closure = outer_scope_->GetClosureScope();
for (auto it = top_local_; it != outer_closure->locals()->end(); ++it) {
Variable* local = *it;
DCHECK_EQ(VariableMode::kTemporary, local->mode());
@@ -884,16 +882,10 @@ void Scope::Snapshot::Reparent(DeclarationScope* new_parent) {
outer_closure->locals_.Rewind(top_local_);
// Move eval calls since Snapshot's creation into new_parent.
- if (outer_scope_and_calls_eval_->calls_eval_) {
- new_parent->RecordDeclarationScopeEvalCall();
- new_parent->inner_scope_calls_eval_ = true;
+ if (outer_scope_->calls_eval_) {
+ new_parent->RecordEvalCall();
+ declaration_scope_->sloppy_eval_can_extend_vars_ = false;
}
-
- // We are in the arrow function case. The calls eval we may have recorded
- // is intended for the inner scope and we should simply restore the
- // original "calls eval" flag of the outer scope.
- RestoreEvalFlag();
- Clear();
}
void Scope::ReplaceOuterScope(Scope* outer) {
@@ -2510,6 +2502,9 @@ void Scope::AllocateVariablesRecursively() {
this->ForEach([](Scope* scope) -> Iteration {
DCHECK(!scope->already_resolved_);
if (WasLazilyParsed(scope)) return Iteration::kContinue;
+ if (scope->sloppy_eval_can_extend_vars_) {
+ scope->num_heap_slots_ = Context::MIN_CONTEXT_EXTENDED_SLOTS;
+ }
DCHECK_EQ(scope->ContextHeaderLength(), scope->num_heap_slots_);
// Allocate variables for this scope.
@@ -107,12 +107,6 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
class Snapshot final {
public:
- Snapshot()
- : outer_scope_and_calls_eval_(nullptr, false),
- top_unresolved_(),
- top_local_() {
- DCHECK(IsCleared());
- }
inline explicit Snapshot(Scope* scope);
// Disallow copy and move.
@@ -120,45 +114,31 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
Snapshot(Snapshot&&) = delete;
~Snapshot() {
- // If we're still active, there was no arrow function. In that case outer
- // calls eval if it already called eval before this snapshot started, or
- // if the code during the snapshot called eval.
- if (!IsCleared() && outer_scope_and_calls_eval_.GetPayload()) {
- RestoreEvalFlag();
+ // Restore eval flags from before the scope was active.
+ if (sloppy_eval_can_extend_vars_) {
+ declaration_scope_->sloppy_eval_can_extend_vars_ = true;
}
- }
-
- void RestoreEvalFlag() {
- if (outer_scope_and_calls_eval_.GetPayload()) {
- // This recreates both calls_eval and sloppy_eval_can_extend_vars.
- outer_scope_and_calls_eval_.GetPointer()->RecordEvalCall();
+ if (calls_eval_) {
+ outer_scope_->calls_eval_ = true;
}
}
void Reparent(DeclarationScope* new_parent);
- bool IsCleared() const {
- return outer_scope_and_calls_eval_.GetPointer() == nullptr;
- }
-
- void Clear() {
- outer_scope_and_calls_eval_.SetPointer(nullptr);
-#ifdef DEBUG
- outer_scope_and_calls_eval_.SetPayload(false);
- top_inner_scope_ = nullptr;
- top_local_ = base::ThreadedList<Variable>::Iterator();
- top_unresolved_ = UnresolvedList::Iterator();
-#endif
- }
private:
- // During tracking calls_eval caches whether the outer scope called eval.
- // Upon move assignment we store whether the new inner scope calls eval into
- // the move target calls_eval bit, and restore calls eval on the outer
- // scope.
- PointerWithPayload<Scope, bool, 1> outer_scope_and_calls_eval_;
+ Scope* outer_scope_;
+ Scope* declaration_scope_;
Scope* top_inner_scope_;
UnresolvedList::Iterator top_unresolved_;
base::ThreadedList<Variable>::Iterator top_local_;
+ // While the scope is active, the scope caches the flag values for
+ // outer_scope_ / declaration_scope_ they can be used to know what happened
+ // while parsing the arrow head. If this turns out to be an arrow head, new
+ // values on the respective scopes will be cleared and moved to the inner
+ // scope. Otherwise the cached flags will be merged with the flags from the
+ // arrow head.
+ bool calls_eval_;
+ bool sloppy_eval_can_extend_vars_;
};
enum class DeserializationMode { kIncludingVariables, kScopesOnly };
@@ -884,8 +864,8 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
void RecordDeclarationScopeEvalCall() {
calls_eval_ = true;
- // If this isn't a sloppy eval, we don't care about it.
- if (language_mode() != LanguageMode::kSloppy) return;
+ // The caller already checked whether we're in sloppy mode.
+ CHECK(is_sloppy(language_mode()));
// Sloppy eval in script scopes can only introduce global variables anyway,
// so we don't care that it calls sloppy eval.
@@ -919,7 +899,6 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
}
sloppy_eval_can_extend_vars_ = true;
- num_heap_slots_ = Context::MIN_CONTEXT_EXTENDED_SLOTS;
}
bool sloppy_eval_can_extend_vars() const {
@@ -1337,7 +1316,9 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
void Scope::RecordEvalCall() {
calls_eval_ = true;
- GetDeclarationScope()->RecordDeclarationScopeEvalCall();
+ if (is_sloppy(language_mode())) {
+ GetDeclarationScope()->RecordDeclarationScopeEvalCall();
+ }
RecordInnerScopeEvalCall();
// The eval contents might access "super" (if it's inside a function that
// binds super).
@@ -1350,14 +1331,18 @@ void Scope::RecordEvalCall() {
}
Scope::Snapshot::Snapshot(Scope* scope)
- : outer_scope_and_calls_eval_(scope, scope->calls_eval_),
+ : outer_scope_(scope),
+ declaration_scope_(scope->GetDeclarationScope()),
top_inner_scope_(scope->inner_scope_),
top_unresolved_(scope->unresolved_list_.end()),
- top_local_(scope->GetClosureScope()->locals_.end()) {
- // Reset in order to record eval calls during this Snapshot's lifetime.
- outer_scope_and_calls_eval_.GetPointer()->calls_eval_ = false;
- outer_scope_and_calls_eval_.GetPointer()->sloppy_eval_can_extend_vars_ =
- false;
+ top_local_(scope->GetClosureScope()->locals_.end()),
+ calls_eval_(outer_scope_->calls_eval_),
+ sloppy_eval_can_extend_vars_(
+ declaration_scope_->sloppy_eval_can_extend_vars_) {
+ // Reset in order to record (sloppy) eval calls during this Snapshot's
+ // lifetime.
+ outer_scope_->calls_eval_ = false;
+ declaration_scope_->sloppy_eval_can_extend_vars_ = false;
}
class ModuleScope final : public DeclarationScope {
@@ -477,9 +477,15 @@ PropertyAccessInfo AccessInfoFactory::ComputeDataFieldAccessInfo(
map, descriptor, details_representation));
} else if (details_representation.IsHeapObject()) {
if (descriptors_field_type->IsNone()) {
- // Store is not safe if the field type was cleared.
- if (access_mode == AccessMode::kStore) {
- return Invalid();
+ switch (access_mode) {
+ case AccessMode::kStore:
+ case AccessMode::kStoreInLiteral:
+ case AccessMode::kDefine:
+ // Store is not safe if the field type was cleared.
+ return Invalid();
+ case AccessMode::kLoad:
+ case AccessMode::kHas:
+ break;
}
// The field type was cleared by the GC, so we don't know anything
@@ -35,7 +35,8 @@ namespace compiler {
V(Protector) \
V(PrototypeProperty) \
V(StableMap) \
- V(Transition)
+ V(Transition) \
+ V(ObjectSlotValue)
CompilationDependencies::CompilationDependencies(JSHeapBroker* broker,
Zone* zone)
@@ -863,6 +864,42 @@ class ProtectorDependency final : public CompilationDependency {
const PropertyCellRef cell_;
};
+// Check that an object slot will not change during compilation.
+class ObjectSlotValueDependency final : public CompilationDependency {
+ public:
+ explicit ObjectSlotValueDependency(const HeapObjectRef& object, int offset,
+ const ObjectRef& value)
+ : CompilationDependency(kObjectSlotValue),
+ object_(object.object()),
+ offset_(offset),
+ value_(value.object()) {}
+
+ bool IsValid() const override {
+ PtrComprCageBase cage_base = GetPtrComprCageBase(*object_);
+ Object current_value =
+ offset_ == HeapObject::kMapOffset
+ ? object_->map()
+ : TaggedField<Object>::Relaxed_Load(cage_base, *object_, offset_);
+ return *value_ == current_value;
+ }
+ void Install(PendingDependencies* deps) const override {}
+
+ private:
+ size_t Hash() const override {
+ return base::hash_combine(object_.address(), offset_, value_.address());
+ }
+
+ bool Equals(const CompilationDependency* that) const override {
+ const ObjectSlotValueDependency* const zat = that->AsObjectSlotValue();
+ return object_->address() == zat->object_->address() &&
+ offset_ == zat->offset_ && value_.address() == zat->value_.address();
+ }
+
+ Handle<HeapObject> object_;
+ int offset_;
+ Handle<Object> value_;
+};
+
class ElementsKindDependency final : public CompilationDependency {
public:
ElementsKindDependency(const AllocationSiteRef& site, ElementsKind kind)
@@ -1110,6 +1147,12 @@ void CompilationDependencies::DependOnElementsKind(
}
}
+void CompilationDependencies::DependOnObjectSlotValue(
+ const HeapObjectRef& object, int offset, const ObjectRef& value) {
+ RecordDependency(
+ zone_->New<ObjectSlotValueDependency>(object, offset, value));
+}
+
void CompilationDependencies::DependOnOwnConstantElement(
const JSObjectRef& holder, uint32_t index, const ObjectRef& element) {
RecordDependency(
@@ -93,6 +93,10 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject {
// Record the assumption that {site}'s {ElementsKind} doesn't change.
void DependOnElementsKind(const AllocationSiteRef& site);
+ // Check that an object slot will not change during compilation.
+ void DependOnObjectSlotValue(const HeapObjectRef& object, int offset,
+ const ObjectRef& value);
+
void DependOnOwnConstantElement(const JSObjectRef& holder, uint32_t index,
const ObjectRef& element);
@@ -5527,6 +5527,8 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) {
auto if_double = __ MakeDeferredLabel();
auto done = __ MakeLabel(MachineRepresentation::kTagged);
+ auto loaded_field = __ MakeLabel(MachineRepresentation::kTagged);
+ auto done_double = __ MakeLabel(MachineRepresentation::kFloat64);
// Check if field is a mutable double field.
__ GotoIfNot(__ IntPtrEqual(__ WordAnd(index, one), zero), &if_double);
@@ -5543,8 +5545,8 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) {
Node* offset =
__ IntAdd(__ WordShl(index, __ IntPtrConstant(kTaggedSizeLog2 - 1)),
__ IntPtrConstant(JSObject::kHeaderSize - kHeapObjectTag));
- Node* result = __ Load(MachineType::AnyTagged(), object, offset);
- __ Goto(&done, result);
+ Node* field = __ Load(MachineType::AnyTagged(), object, offset);
+ __ Goto(&loaded_field, field);
}
// The field is located in the properties backing store of {object}.
@@ -5558,8 +5560,8 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) {
__ IntPtrConstant(kTaggedSizeLog2 - 1)),
__ IntPtrConstant((FixedArray::kHeaderSize - kTaggedSize) -
kHeapObjectTag));
- Node* result = __ Load(MachineType::AnyTagged(), properties, offset);
- __ Goto(&done, result);
+ Node* field = __ Load(MachineType::AnyTagged(), properties, offset);
+ __ Goto(&loaded_field, field);
}
}
@@ -5567,9 +5569,6 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) {
// architectures, or a mutable HeapNumber.
__ Bind(&if_double);
{
- auto loaded_field = __ MakeLabel(MachineRepresentation::kTagged);
- auto done_double = __ MakeLabel(MachineRepresentation::kFloat64);
-
index = __ WordSar(index, one);
// Check if field is in-object or out-of-object.
@@ -5597,27 +5596,27 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) {
Node* field = __ Load(MachineType::AnyTagged(), properties, offset);
__ Goto(&loaded_field, field);
}
+ }
- __ Bind(&loaded_field);
- {
- Node* field = loaded_field.PhiAt(0);
- // We may have transitioned in-place away from double, so check that
- // this is a HeapNumber -- otherwise the load is fine and we don't need
- // to copy anything anyway.
- __ GotoIf(ObjectIsSmi(field), &done, field);
- Node* field_map = __ LoadField(AccessBuilder::ForMap(), field);
- __ GotoIfNot(__ TaggedEqual(field_map, __ HeapNumberMapConstant()), &done,
- field);
-
- Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), field);
- __ Goto(&done_double, value);
- }
+ __ Bind(&loaded_field);
+ {
+ Node* field = loaded_field.PhiAt(0);
+ // We may have transitioned in-place away from double, so check that
+ // this is a HeapNumber -- otherwise the load is fine and we don't need
+ // to copy anything anyway.
+ __ GotoIf(ObjectIsSmi(field), &done, field);
+ Node* field_map = __ LoadField(AccessBuilder::ForMap(), field);
+ __ GotoIfNot(__ TaggedEqual(field_map, __ HeapNumberMapConstant()), &done,
+ field);
- __ Bind(&done_double);
- {
- Node* result = AllocateHeapNumberWithValue(done_double.PhiAt(0));
- __ Goto(&done, result);
- }
+ Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), field);
+ __ Goto(&done_double, value);
+ }
+
+ __ Bind(&done_double);
+ {
+ Node* result = AllocateHeapNumberWithValue(done_double.PhiAt(0));
+ __ Goto(&done, result);
}
__ Bind(&done);
@@ -1677,6 +1677,10 @@ base::Optional<Node*> JSCreateLowering::TryAllocateFastLiteral(
// Now that we hold the migration lock, get the current map.
MapRef boilerplate_map = boilerplate.map();
+ // Protect against concurrent changes to the boilerplate object by checking
+ // for an identical value at the end of the compilation.
+ dependencies()->DependOnObjectSlotValue(boilerplate, HeapObject::kMapOffset,
+ boilerplate_map);
{
base::Optional<MapRef> current_boilerplate_map =
boilerplate.map_direct_read();
@@ -1841,10 +1845,18 @@ base::Optional<Node*> JSCreateLowering::TryAllocateFastLiteralElements(
boilerplate.elements(kRelaxedLoad);
if (!maybe_boilerplate_elements.has_value()) return {};
FixedArrayBaseRef boilerplate_elements = maybe_boilerplate_elements.value();
+ // Protect against concurrent changes to the boilerplate object by checking
+ // for an identical value at the end of the compilation.
+ dependencies()->DependOnObjectSlotValue(
+ boilerplate, JSObject::kElementsOffset, boilerplate_elements);
// Empty or copy-on-write elements just store a constant.
int const elements_length = boilerplate_elements.length();
MapRef elements_map = boilerplate_elements.map();
+ // Protect against concurrent changes to the boilerplate object by checking
+ // for an identical value at the end of the compilation.
+ dependencies()->DependOnObjectSlotValue(boilerplate_elements,
+ HeapObject::kMapOffset, elements_map);
if (boilerplate_elements.length() == 0 || elements_map.IsFixedCowArrayMap()) {
if (allocation == AllocationType::kOld &&
!boilerplate.IsElementsTenured(boilerplate_elements)) {
@@ -87,6 +87,7 @@ class WasmGraphBuildingInterface {
struct TryInfo : public ZoneObject {
SsaEnv* catch_env;
TFNode* exception = nullptr;
+ bool first_catch = true;
bool might_throw() const { return exception != nullptr; }
@@ -865,6 +866,10 @@ class WasmGraphBuildingInterface {
TFNode* exception = block->try_info->exception;
SetEnv(block->try_info->catch_env);
+ if (block->try_info->first_catch) {
+ LoadContextIntoSsa(ssa_env_);
+ block->try_info->first_catch = false;
+ }
TFNode* if_catch = nullptr;
TFNode* if_no_catch = nullptr;
@@ -942,6 +947,9 @@ class WasmGraphBuildingInterface {
}
SetEnv(block->try_info->catch_env);
+ if (block->try_info->first_catch) {
+ LoadContextIntoSsa(ssa_env_);
+ }
}
void AtomicOp(FullDecoder* decoder, WasmOpcode opcode,