1diff --git a/src/BUILD.gn b/src/BUILD.gn 2index 2c35c744f576c..42c59a4c5f587 3--- a/src/BUILD.gn 4+++ b/src/BUILD.gn 5@@ -104,13 +104,12 @@ group("gn_all") { 6 "//url:url_unittests", 7 ] 8 9- deps += [ "//ohos_nweb:libnweb_adapter" ] 10- 11 #ifdef OHOS_NWEB_EX 12 if (defined(ohos_nweb_ex) && ohos_nweb_ex) { 13 deps += [ 14 "//ohos_browser_shell", 15 "//ohos_nweb_ex/browser_service", 16+ "//ohos_nweb_ex/test:ohos_nweb_ex_unittests", 17 "//ohos_nweb_hap", 18 ] 19 } # endif // OHOS_NWEB_EX 20diff --git a/src/DEPS b/src/DEPS 21index 6fe0d455815f5..649352fdf33db 22--- a/src/DEPS 23+++ b/src/DEPS 24@@ -1592,7 +1592,7 @@ deps = { 25 Var('chromium_git') + '/external/github.com/google/snappy.git' + '@' + '65dc7b383985eb4f63cd3e752136db8d9b4be8c0', 26 27 'src/third_party/sqlite/src': 28- Var('chromium_git') + '/chromium/deps/sqlite.git' + '@' + 'e6b63421941617bf5ccac6b4a62d7a7b4a2c3fef', 29+ Var('chromium_git') + '/chromium/deps/sqlite.git' + '@' + 'b48b7b78fcdf0227c59a1fde8bc7e19362239e97', 30 31 'src/third_party/sqlite4java': { 32 'packages': [ 33diff --git a/src/PRESUBMIT.py b/src/PRESUBMIT.py 34index 9e494489f8072..8b6873613163e 35--- a/src/PRESUBMIT.py 36+++ b/src/PRESUBMIT.py 37@@ -985,6 +985,19 @@ _BANNED_CPP_FUNCTIONS = ( 38 r'^base[\\/]win[\\/]scoped_winrt_initializer\.cc$' 39 ), 40 ), 41+ ( 42+ r'\bchartorune\b', 43+ ( 44+ 'chartorune is not memory-safe, unless you can guarantee the input ', 45+ 'string is always null-terminated. Otherwise, please use charntorune ', 46+ 'from libphonenumber instead.' 47+ ), 48+ True, 49+ [ 50+ _THIRD_PARTY_EXCEPT_BLINK, 51+ # Exceptions to this rule should have a fuzzer. 52+ ], 53+ ), 54 ) 55 56 # Format: Sequence of tuples containing: 57diff --git a/src/base/files/file_util_posix.cc b/src/base/files/file_util_posix.cc 58index 7e4b3cd4796f2..584d51b168eda 59--- a/src/base/files/file_util_posix.cc 60+++ b/src/base/files/file_util_posix.cc 61@@ -570,12 +570,6 @@ bool ExecutableExistsInPath(Environment* env, 62 #if !BUILDFLAG(IS_APPLE) 63 // This is implemented in file_util_mac.mm for Mac. 64 bool GetTempDir(FilePath* path) { 65- const char* tmp = getenv("TMPDIR"); 66- if (tmp) { 67- *path = FilePath(tmp); 68- return true; 69- } 70- 71 #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_OHOS) 72 return PathService::Get(DIR_CACHE, path); 73 #else 74diff --git a/src/base/files/scoped_file.cc b/src/base/files/scoped_file.cc 75index d4b955caadc1b..a673e98b52cc2 76--- a/src/base/files/scoped_file.cc 77+++ b/src/base/files/scoped_file.cc 78@@ -5,6 +5,7 @@ 79 #include "base/files/scoped_file.h" 80 81 #include "base/check.h" 82+#include "base/logging.h" 83 #include "build/build_config.h" 84 85 #if BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) 86@@ -31,16 +32,20 @@ void ScopedFDCloseTraits::Free(int fd) { 87 int ret = IGNORE_EINTR(close(fd)); 88 89 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_APPLE) || \ 90- BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID) 91+ BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_OHOS) 92 // NB: Some file descriptors can return errors from close() e.g. network 93 // filesystems such as NFS and Linux input devices. On Linux, macOS, and 94 // Fuchsia's POSIX layer, errors from close other than EBADF do not indicate 95 // failure to actually close the fd. 96- if (ret != 0 && errno != EBADF) 97+ if (ret != 0 && errno != EBADF) { 98+ LOG(ERROR) << "ScopedFDCloseTraits::Free fd:" << fd << ", errorno:" << errno; 99 ret = 0; 100+ } 101 #endif 102 103+#if !BUILDFLAG(IS_OHOS) 104 PCHECK(0 == ret); 105+#endif 106 } 107 108 #endif // BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) 109diff --git a/src/base/logging.cc b/src/base/logging.cc 110index 0de6357094283..6f930c3dbc87d 111--- a/src/base/logging.cc 112+++ b/src/base/logging.cc 113@@ -146,7 +146,7 @@ namespace { 114 VlogInfo* g_vlog_info = nullptr; 115 VlogInfo* g_vlog_info_prev = nullptr; 116 117-const char* const log_severity_names[] = {"INFO", "WARNING", "ERROR", "FATAL"}; 118+const char* const log_severity_names[] = {"INFO", "WARNING", "ERROR", "FATAL", "DEBUG"}; 119 static_assert(LOGGING_NUM_SEVERITIES == base::size(log_severity_names), 120 "Incorrect number of log_severity_names"); 121 122@@ -850,6 +850,8 @@ LogMessage::~LogMessage() { 123 case LOGGING_FATAL: 124 priority = LogLevel::LOG_FATAL; 125 break; 126+ case LOGGING_DEBUG: 127+ priority = LogLevel::LOG_DEBUG; 128 } 129 const char kOHOSLogTag[] = "chromium"; 130 HiLogPrintOHOS(LOG_CORE, priority, 0xD004500, kOHOSLogTag, str_newline.c_str()); 131diff --git a/src/base/logging.h b/src/base/logging.h 132index a3ff92f0fd7df..83a8dc3517608 133--- a/src/base/logging.h 134+++ b/src/base/logging.h 135@@ -359,7 +359,8 @@ constexpr LogSeverity LOGGING_INFO = 0; 136 constexpr LogSeverity LOGGING_WARNING = 1; 137 constexpr LogSeverity LOGGING_ERROR = 2; 138 constexpr LogSeverity LOGGING_FATAL = 3; 139-constexpr LogSeverity LOGGING_NUM_SEVERITIES = 4; 140+constexpr LogSeverity LOGGING_DEBUG = 4; 141+constexpr LogSeverity LOGGING_NUM_SEVERITIES = 5; 142 143 // LOGGING_DFATAL is LOGGING_FATAL in DCHECK-enabled builds, ERROR in normal 144 // mode. 145@@ -373,6 +374,7 @@ constexpr LogSeverity LOGGING_DFATAL = LOGGING_ERROR; 146 // from LOG_FOO to LOGGING_FOO. 147 // TODO(thestig): Convert existing users to LOGGING_FOO and remove this block. 148 constexpr LogSeverity LOG_VERBOSE = LOGGING_VERBOSE; 149+constexpr LogSeverity LOG_DEBUG = LOGGING_DEBUG; 150 constexpr LogSeverity LOG_INFO = LOGGING_INFO; 151 constexpr LogSeverity LOG_WARNING = LOGGING_WARNING; 152 constexpr LogSeverity LOG_ERROR = LOGGING_ERROR; 153@@ -382,6 +384,9 @@ constexpr LogSeverity LOG_DFATAL = LOGGING_DFATAL; 154 // A few definitions of macros that don't generate much code. These are used 155 // by LOG() and LOG_IF, etc. Since these are used all over our code, it's 156 // better to have compact code for these operations. 157+#define COMPACT_GOOGLE_LOG_EX_DEBUG(ClassName, ...) \ 158+ ::logging::ClassName(__FILE__, __LINE__, ::logging::LOGGING_DEBUG, \ 159+ ##__VA_ARGS__) 160 #define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \ 161 ::logging::ClassName(__FILE__, __LINE__, ::logging::LOGGING_INFO, \ 162 ##__VA_ARGS__) 163@@ -401,6 +406,7 @@ constexpr LogSeverity LOG_DFATAL = LOGGING_DFATAL; 164 ::logging::ClassName(__FILE__, __LINE__, ::logging::LOGGING_DCHECK, \ 165 ##__VA_ARGS__) 166 167+#define COMPACT_GOOGLE_LOG_DEBUG COMPACT_GOOGLE_LOG_EX_DEBUG(LogMessage) 168 #define COMPACT_GOOGLE_LOG_INFO COMPACT_GOOGLE_LOG_EX_INFO(LogMessage) 169 #define COMPACT_GOOGLE_LOG_WARNING COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage) 170 #define COMPACT_GOOGLE_LOG_ERROR COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage) 171diff --git a/src/base/rand_util_posix.cc b/src/base/rand_util_posix.cc 172index f624d48d31fc5..77bb848408cbf 173--- a/src/base/rand_util_posix.cc 174+++ b/src/base/rand_util_posix.cc 175@@ -17,7 +17,7 @@ 176 #include "base/posix/eintr_wrapper.h" 177 #include "build/build_config.h" 178 179-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) 180+#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_OHOS) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) 181 #include "third_party/lss/linux_syscall_support.h" 182 #elif BUILDFLAG(IS_MAC) 183 // TODO(crbug.com/995996): Waiting for this header to appear in the iOS SDK. 184@@ -62,7 +62,7 @@ namespace base { 185 // (https://chromium-review.googlesource.com/c/chromium/src/+/1545096) and land 186 // it or some form of it. 187 void RandBytes(void* output, size_t output_length) { 188-#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) 189+#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_OHOS) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) 190 // We have to call `getrandom` via Linux Syscall Support, rather than through 191 // the libc wrapper, because we might not have an up-to-date libc (e.g. on 192 // some bots). 193diff --git a/src/build/config/compiler/BUILD.gn b/src/build/config/compiler/BUILD.gn 194index da2e9864f99e3..28ee784acd77d 195--- a/src/build/config/compiler/BUILD.gn 196+++ b/src/build/config/compiler/BUILD.gn 197@@ -238,7 +238,7 @@ config("default_include_dirs") { 198 # the executable they are loaded into, so they are unresolved at link-time. 199 config("no_unresolved_symbols") { 200 if (!using_sanitizer && 201- (is_linux || is_chromeos || is_android || is_fuchsia)) { 202+ (is_linux || is_chromeos || is_android || is_fuchsia || is_ohos)) { 203 ldflags = [ 204 "-Wl,-z,defs", 205 "-Wl,--as-needed", 206@@ -692,6 +692,10 @@ config("compiler") { 207 # TODO(thakis): Check if '=0' (that is, number of cores, instead 208 # of "all" which means number of hardware threads) is faster. 209 ldflags += [ "-Wl,--thinlto-jobs=all" ] 210+ if (is_ohos && !use_musl) { 211+ ldflags -= [ "-Wl,--thinlto-jobs=all" ] 212+ ldflags += [ "-Wl,--thinlto-jobs=8" ] 213+ } 214 if (is_mac) { 215 ldflags += 216 [ "-Wl,-cache_path_lto," + 217@@ -720,7 +724,7 @@ config("compiler") { 218 } 219 220 # TODO(https://crbug.com/1211155): investigate why this isn't effective on arm32. 221- if ((!is_android && !is_ohos) || current_cpu == "arm64") { 222+ if (!is_android || current_cpu == "arm64") { 223 cflags += [ "-fwhole-program-vtables" ] 224 if (!is_win) { 225 ldflags += [ "-fwhole-program-vtables" ] 226diff --git a/src/build/config/compiler/compiler.gni b/src/build/config/compiler/compiler.gni 227index 05a30aa62deb8..15fa15254b93c 228--- a/src/build/config/compiler/compiler.gni 229+++ b/src/build/config/compiler/compiler.gni 230@@ -74,7 +74,7 @@ declare_args() { 231 use_thin_lto = 232 is_cfi || 233 (is_clang && is_official_build && chrome_pgo_phase != 1 && 234- (is_linux || is_win || is_mac || 235+ (is_linux || is_win || is_mac || is_ohos || 236 (is_android && target_os != "chromeos") || 237 ((is_chromeos_ash || is_chromeos_lacros) && is_chromeos_device))) 238 239diff --git a/src/build/config/ohos/BUILD.gn b/src/build/config/ohos/BUILD.gn 240index 267a37869f9e7..875bf5ea66216 241--- a/src/build/config/ohos/BUILD.gn 242+++ b/src/build/config/ohos/BUILD.gn 243@@ -31,6 +31,9 @@ config("compiler") { 244 "_LIBCPP_HAS_MUSL_LIBC", 245 "__BUILD_LINUX_WITH_CLANG", 246 ] 247+ if (current_cpu == "x64") { 248+ defines += [ "PTRACE_GET_THREAD_AREA=25" ] 249+ } 250 } else { 251 defines += [ "__BUILD_LINUX_WITH_CLANG" ] 252 } 253@@ -80,8 +83,7 @@ config("compiler") { 254 compile_api_level = arm64_ndk_api_level 255 } 256 } else if (current_cpu == "x64") { 257- abi_target = "" 258- compile_api_level = "" 259+ abi_target = "x86_64-linux-ohos" 260 } else { 261 assert(false, "Architecture not supported") 262 } 263@@ -89,6 +91,11 @@ config("compiler") { 264 if (use_musl) { 265 cflags += [ "--target=$abi_target" ] 266 include_dirs = [ "$ohos_toolchain_root/include/libcxx-ohos/include/c++/v1" ] 267+ if (current_cpu == "x64") { 268+ include_dirs += [ 269+ "$ohos_sysroot/usr/include/x86_64-linux-ohos/asm-x86", 270+ ] 271+ } 272 ldflags += [ "--target=$abi_target" ] 273 } else { 274 cflags += [ 275@@ -156,6 +163,22 @@ config("runtime_library") { 276 libclang_rt_file = "$ohos_toolchain_root/lib/clang/current/lib/aarch64-linux-ohos/libclang_rt.builtins.a" 277 } 278 279+ if (current_cpu == "x64") { 280+ ldflags += [ "-Wl,-z,max-page-size=4096" ] 281+ ldflags += [ "-Wl,--hash-style=gnu" ] 282+ ldflags += 283+ [ "-L" + rebase_path("$ohos_sysroot/usr/lib/x86_64-linux-ohos", 284+ root_build_dir) ] 285+ ldflags += [ "-L" + rebase_path( 286+ "$ohos_toolchain_root/lib/x86_64-linux-ohos/c++", 287+ root_build_dir) ] 288+ ldflags += 289+ [ "-L" + rebase_path( 290+ "$ohos_toolchain_root/lib/clang/current/lib/x86_64-linux-ohos", 291+ root_build_dir) ] 292+ libclang_rt_file = "$ohos_toolchain_root/lib/clang/current/lib/x86_64-linux-ohos/libclang_rt.builtins.a" 293+ } 294+ 295 libs += [ 296 rebase_path(libclang_rt_file), 297 "c", 298@@ -259,7 +282,11 @@ config("runtime_library") { 299 } 300 301 config("lld_pack_relocations") { 302- ldflags = [ "-Wl,--pack-dyn-relocs=android" ] 303+ if (use_musl) { 304+ ldflags = [ "-Wl,--pack-dyn-relocs=relr" ] 305+ } else { 306+ ldflags = [ "-Wl,--pack-dyn-relocs=android" ] 307+ } 308 } 309 310 # Used for instrumented build to generate the orderfile. 311diff --git a/src/build/config/ohos/config.gni b/src/build/config/ohos/config.gni 312index e8573467f88e3..1f210c389deec 313--- a/src/build/config/ohos/config.gni 314+++ b/src/build/config/ohos/config.gni 315@@ -15,6 +15,9 @@ if (is_ohos) { 316 317 # Enable ohos_nweb_hap build target. 318 enable_ohos_nweb_hap = false 319+ 320+ # To disable PNA mode. 321+ build_with_disable_pna_mode = false 322 } 323 324 declare_args() { 325@@ -54,7 +57,11 @@ if (is_ohos) { 326 ohos_build_root = "//../../.." 327 if (use_musl) { 328 ohos_toolchain_root = "$ohos_ndk_root/clang/ohos/linux-x86_64/llvm" 329- ohos_sysroot = "$ohos_build_root/out/rk3568/obj/third_party/musl" 330+ if (current_cpu == "x64") { 331+ ohos_sysroot = "$ohos_build_root/out/arm64/obj/third_party/musl" 332+ } else { 333+ ohos_sysroot = "$ohos_build_root/out/rk3568/obj/third_party/musl" 334+ } 335 } else { 336 ohos_toolchain_root = "$ohos_ndk_root/clang/host/linux-x86/clang-r353983c" 337 if (current_cpu == "arm") { 338@@ -138,8 +145,13 @@ if (is_ohos) { 339 ] 340 } else { 341 if (use_musl) { 342- ohos_build_root = "//ohos_ndk" 343- ohos_ndk_root = "//ohos_ndk" 344+ if (current_cpu == "x64") { 345+ ohos_build_root = "//ohos_ndk_x86" 346+ ohos_ndk_root = "//ohos_ndk_x86" 347+ } else { 348+ ohos_build_root = "//ohos_ndk" 349+ ohos_ndk_root = "//ohos_ndk" 350+ } 351 ohos_toolchain_root = "$ohos_ndk_root/toolchains/llvm" 352 ohos_sysroot = "$ohos_ndk_root/sysroot" 353 } else { 354@@ -198,6 +210,8 @@ if (is_ohos) { 355 ohos_libs_dir = [ "$ohos_build_root/libs" ] 356 } else if (current_cpu == "arm64") { 357 ohos_libs_dir = [ "$ohos_build_root/libs64" ] 358+ } else if (current_cpu == "x64") { 359+ ohos_libs_dir = [ "$ohos_build_root/libs64" ] 360 } 361 } 362 } 363diff --git a/src/build/toolchain/ohos/BUILD.gn b/src/build/toolchain/ohos/BUILD.gn 364index 2046bc1321ac8..b5572e699ae2c 365--- a/src/build/toolchain/ohos/BUILD.gn 366+++ b/src/build/toolchain/ohos/BUILD.gn 367@@ -61,3 +61,9 @@ ohos_clang_toolchain("ohos_clang_arm64") { 368 current_cpu = "arm64" 369 } 370 } 371+ 372+ohos_clang_toolchain("ohos_clang_x64") { 373+ toolchain_args = { 374+ current_cpu = "x64" 375+ } 376+} 377diff --git a/src/cc/layers/scrollbar_layer_impl_base.cc b/src/cc/layers/scrollbar_layer_impl_base.cc 378index 8afe837d5255f..130f0682779f7 379--- a/src/cc/layers/scrollbar_layer_impl_base.cc 380+++ b/src/cc/layers/scrollbar_layer_impl_base.cc 381@@ -7,6 +7,7 @@ 382 #include <algorithm> 383 384 #include "base/cxx17_backports.h" 385+#include "base/logging.h" 386 #include "cc/trees/effect_node.h" 387 #include "cc/trees/layer_tree_impl.h" 388 #include "cc/trees/scroll_node.h" 389@@ -28,12 +29,44 @@ ScrollbarLayerImplBase::ScrollbarLayerImplBase( 390 scroll_layer_length_(0.f), 391 orientation_(orientation), 392 is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar), 393- vertical_adjust_(0.f) {} 394+ vertical_adjust_(0.f) { 395+ #if BUILDFLAG(IS_OHOS) 396+ SetInitalLayoutRatio(); 397+ #endif 398+} 399 400 ScrollbarLayerImplBase::~ScrollbarLayerImplBase() { 401 layer_tree_impl()->UnregisterScrollbar(this); 402 } 403 404+#if BUILDFLAG(IS_OHOS) 405+void ScrollbarLayerImplBase::SetInitalLayoutRatio() { 406+ static double ratio = 0; 407+ if (fabs(ratio) < 1e-15) { 408+ display_manager_adapter_ = 409+ OHOS::NWeb::OhosAdapterHelper::GetInstance().CreateDisplayMgrAdapter(); 410+ if (display_manager_adapter_ == nullptr) { 411+ LOG(ERROR) << "display_manager_adapter is nullptr."; 412+ return; 413+ } 414+ std::shared_ptr<OHOS::NWeb::DisplayAdapter> display = 415+ display_manager_adapter_->GetDefaultDisplay(); 416+ if (display == nullptr) { 417+ LOG(ERROR) << "display is nullptr."; 418+ return; 419+ } 420+ ratio = display->GetVirtualPixelRatio(); 421+ if (ratio <= 0) { 422+ LOG(ERROR) << "invalid ratio."; 423+ return; 424+ } 425+ LOG(INFO) << "GetVirtualPixelRatio ratio:" << ratio; 426+ } 427+ initial_layout_size_ratio_ = ratio; 428+ LOG(INFO) << "Use ratio to set initial_layout_size_ratio_:" << initial_layout_size_ratio_; 429+} 430+#endif 431+ 432 void ScrollbarLayerImplBase::PushPropertiesTo(LayerImpl* layer) { 433 LayerImpl::PushPropertiesTo(layer); 434 DCHECK(layer->IsScrollbarLayer()); 435@@ -213,6 +246,11 @@ gfx::Rect ScrollbarLayerImplBase::ComputeThumbQuadRectWithThumbThicknessScale( 436 int thumb_thickness = ThumbThickness(); 437 // TODO(crbug.com/1239770): This is a speculative fix. 438 float maximum = std::max(scroll_layer_length() - clip_layer_length(), 0.0f); 439+ #if BUILDFLAG(IS_OHOS) 440+ if (orientation_ == ScrollbarOrientation::VERTICAL) { 441+ maximum = std::max(scroll_layer_length() - clip_layer_length() * initial_layout_size_ratio_, 0.0f); 442+ } 443+ #endif 444 // TODO(crbug.com/1239510): Re-enable the following DCHECK once the 445 // underlying issue is resolved. 446 // DCHECK(scroll_layer_length() >= clip_layer_length()); 447diff --git a/src/cc/layers/scrollbar_layer_impl_base.h b/src/cc/layers/scrollbar_layer_impl_base.h 448index b0a5eb3dd8e69..a456eedd6182f 449--- a/src/cc/layers/scrollbar_layer_impl_base.h 450+++ b/src/cc/layers/scrollbar_layer_impl_base.h 451@@ -12,6 +12,10 @@ 452 #include "cc/layers/layer.h" 453 #include "cc/layers/layer_impl.h" 454 #include "cc/trees/layer_tree_settings.h" 455+#if BUILDFLAG(IS_OHOS) 456+#include "display_manager_adapter.h" 457+#include "ohos_adapter_helper.h" 458+#endif 459 460 namespace cc { 461 462@@ -115,6 +119,13 @@ class CC_EXPORT ScrollbarLayerImplBase : public LayerImpl { 463 ScrollbarOrientation orientation_; 464 bool is_left_side_vertical_scrollbar_; 465 466+#if BUILDFLAG(IS_OHOS) 467+ std::unique_ptr<OHOS::NWeb::DisplayManagerAdapter> display_manager_adapter_ = 468+ nullptr; 469+ float initial_layout_size_ratio_ = 2.0f; 470+ void SetInitalLayoutRatio(); 471+#endif 472+ 473 // Difference between the clip layer's height and the visible viewport 474 // height (which may differ in the presence of top-controls hiding). 475 float vertical_adjust_; 476diff --git a/src/cef/BUILD.gn b/src/cef/BUILD.gn 477index 34b45df974a8a..4af75193cdca7 478--- a/src/cef/BUILD.gn 479+++ b/src/cef/BUILD.gn 480@@ -249,7 +249,7 @@ if (is_linux) { 481 482 # Set ENABLE_PRINTING=1 ENABLE_BASIC_PRINTING=1. 483 assert(enable_basic_printing) 484-assert(enable_print_preview) 485+assert(enable_print_preview || is_ohos) 486 487 # Enable support for Widevine CDM. 488 assert(enable_widevine || is_ohos) 489@@ -259,6 +259,13 @@ if (is_clang) { 490 assert(!clang_use_chrome_plugins) 491 } 492 493+if (is_ohos) { 494+ import("//pdf/features.gni") 495+ declare_args() { 496+ ohos_enable_cef_chrome_runtime = false 497+ } 498+} 499+ 500 # 501 # Local variables. 502 # 503@@ -449,6 +456,8 @@ static_library("libcef_static") { 504 "libcef/browser/browser_platform_delegate_create.cc", 505 "libcef/browser/browser_util.cc", 506 "libcef/browser/browser_util.h", 507+ "libcef/browser/navigation_state_serializer.cc", 508+ "libcef/browser/navigation_state_serializer.h", 509 "libcef/browser/chrome/browser_delegate.h", 510 "libcef/browser/chrome/browser_platform_delegate_chrome.cc", 511 "libcef/browser/chrome/browser_platform_delegate_chrome.h", 512@@ -863,6 +872,75 @@ static_library("libcef_static") { 513 "//third_party/crashpad/crashpad", 514 ] 515 516+ if (defined(ohos_enable_cef_chrome_runtime) && 517+ !ohos_enable_cef_chrome_runtime) { 518+ sources -= [ 519+ "//chrome/app/chrome_main_delegate.cc", 520+ "//chrome/app/chrome_main_delegate.h", 521+ "libcef/browser/chrome/browser_delegate.h", 522+ "libcef/browser/chrome/browser_platform_delegate_chrome.cc", 523+ "libcef/browser/chrome/browser_platform_delegate_chrome.h", 524+ "libcef/browser/chrome/chrome_browser_context.cc", 525+ "libcef/browser/chrome/chrome_browser_context.h", 526+ "libcef/browser/chrome/chrome_browser_delegate.cc", 527+ "libcef/browser/chrome/chrome_browser_delegate.h", 528+ "libcef/browser/chrome/chrome_browser_host_impl.cc", 529+ "libcef/browser/chrome/chrome_browser_host_impl.h", 530+ "libcef/browser/chrome/chrome_browser_main_extra_parts_cef.cc", 531+ "libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h", 532+ "libcef/browser/chrome/chrome_content_browser_client_cef.cc", 533+ "libcef/browser/chrome/chrome_content_browser_client_cef.h", 534+ "libcef/browser/chrome/chrome_context_menu_handler.cc", 535+ "libcef/browser/chrome/chrome_context_menu_handler.h", 536+ "libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.cc", 537+ "libcef/browser/chrome/extensions/chrome_mime_handler_view_guest_delegate_cef.h", 538+ "libcef/browser/chrome_crash_reporter_client_stub.cc", 539+ "libcef/browser/net/chrome_scheme_handler.cc", 540+ "libcef/browser/net/chrome_scheme_handler.h", 541+ "libcef/common/chrome/chrome_content_client_cef.cc", 542+ "libcef/common/chrome/chrome_content_client_cef.h", 543+ "libcef/common/chrome/chrome_main_delegate_cef.cc", 544+ "libcef/common/chrome/chrome_main_delegate_cef.h", 545+ "libcef/common/chrome/chrome_main_runner_delegate.cc", 546+ "libcef/common/chrome/chrome_main_runner_delegate.h", 547+ "libcef/renderer/chrome/chrome_content_renderer_client_cef.cc", 548+ "libcef/renderer/chrome/chrome_content_renderer_client_cef.h", 549+ ] 550+ } 551+ 552+ if (is_ohos && !enable_print_preview) { 553+ sources -= [ 554+ "libcef/browser/printing/constrained_window_views_client.cc", 555+ "libcef/browser/printing/constrained_window_views_client.h", 556+ "libcef/browser/printing/print_view_manager.cc", 557+ "libcef/browser/printing/print_view_manager.h", 558+ "libcef/renderer/extensions/print_render_frame_helper_delegate.cc", 559+ "libcef/renderer/extensions/print_render_frame_helper_delegate.h", 560+ ] 561+ } 562+ 563+ if (is_ohos && !enable_plugins) { 564+ sources -= [ 565+ "libcef/browser/web_plugin_impl.cc", 566+ "libcef/browser/web_plugin_impl.h", 567+ ] 568+ } 569+ 570+ if (is_ohos && !ohos_enable_media_router) { 571+ sources -= [ 572+ "libcef/browser/media_router/media_route_impl.cc", 573+ "libcef/browser/media_router/media_route_impl.h", 574+ "libcef/browser/media_router/media_router_impl.cc", 575+ "libcef/browser/media_router/media_router_impl.h", 576+ "libcef/browser/media_router/media_router_manager.cc", 577+ "libcef/browser/media_router/media_router_manager.h", 578+ "libcef/browser/media_router/media_sink_impl.cc", 579+ "libcef/browser/media_router/media_sink_impl.h", 580+ "libcef/browser/media_router/media_source_impl.cc", 581+ "libcef/browser/media_router/media_source_impl.h", 582+ ] 583+ } 584+ 585 public_deps = [ 586 # Bring in feature flag defines. 587 "//cef/libcef/features", 588@@ -974,6 +1052,42 @@ static_library("libcef_static") { 589 "//v8", 590 ] 591 592+ if (defined(ohos_enable_cef_chrome_runtime) && 593+ !ohos_enable_cef_chrome_runtime) { 594+ deps -= [ 595+ "//chrome:packed_resources", 596+ "//chrome:resources", 597+ "//chrome:strings", 598+ "//chrome/services/printing:lib", 599+ ] 600+ } 601+ 602+ if (is_ohos && !enable_print_preview) { 603+ deps -= [ 604+ "//components/printing/browser", 605+ "//components/printing/common", 606+ "//components/printing/renderer", 607+ "//components/services/print_compositor/public/cpp", 608+ "//components/services/print_compositor/public/mojom", 609+ ] 610+ } 611+ 612+ if (is_ohos && !enable_plugins) { 613+ deps -= [ "//components/plugins/renderer" ] 614+ } 615+ 616+ if (is_ohos && !enable_pdf) { 617+ deps -= [ 618+ "//components/pdf/browser", 619+ "//components/pdf/renderer", 620+ "//pdf", 621+ ] 622+ } 623+ 624+ if (is_ohos && !ohos_enable_media_router) { 625+ deps -= [ "//components/media_router/common/mojom:media_router" ] 626+ } 627+ 628 if (defined(ohos_nweb_ex) && ohos_nweb_ex) { 629 deps += [ "//ohos_nweb_ex/overrides/cef" ] 630 } 631@@ -1113,7 +1227,7 @@ static_library("libcef_static") { 632 deps += [ "//tools/v8_context_snapshot" ] 633 } 634 635- if (toolkit_views || is_ohos) { 636+ if (toolkit_views) { 637 sources += [ 638 "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc", 639 "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h", 640@@ -1330,6 +1444,58 @@ static_library("libcef_static") { 641 "libcef_dll/views_stub.cc", 642 ] 643 } 644+ 645+ if (is_ohos) { 646+ sources += [ 647+ "libcef/browser/chrome/views/chrome_views_util.cc", 648+ "libcef/browser/chrome/views/chrome_views_util.h", 649+ "libcef/browser/views/view_util.cc", 650+ "libcef/browser/views/view_util.h", 651+ ] 652+ 653+ if (use_aura) { 654+ sources += [ 655+ "libcef/browser/native/browser_platform_delegate_native_aura.cc", 656+ "libcef/browser/native/browser_platform_delegate_native_aura.h", 657+ "libcef/browser/views/view_util_aura.cc", 658+ 659+ # Part of //ui/views:test_support which is testingonly. 660+ "//ui/views/test/desktop_test_views_delegate_aura.cc", 661+ "//ui/views/test/test_views_delegate_aura.cc", 662+ 663+ # Support for UI input events. 664+ # Part of //ui/base:test_support which is testingonly. 665+ "//ui/aura/test/ui_controls_factory_aura.h", 666+ "//ui/base/test/ui_controls_aura.cc", 667+ ] 668+ 669+ deps += [ 670+ "//ui/aura", 671+ "//ui/wm", 672+ "//ui/wm/public", 673+ ] 674+ 675+ if (is_ohos) { 676+ sources += [ 677+ # Support for UI input events. 678+ # Part of //ui/aura:test_support which is testingonly. 679+ "//ui/aura/test/aura_test_utils.cc", 680+ "//ui/aura/test/aura_test_utils.h", 681+ 682+ # Part of //ui/events:test_support which is testingonly. 683+ # "//ui/events/test/x11_event_waiter.cc", 684+ # "//ui/events/test/x11_event_waiter.h", 685+ ] 686+ 687+ deps += [ 688+ "//ui/events", 689+ "//ui/strings", 690+ "//ui/views", 691+ "//ui/views/controls/webview", 692+ ] 693+ } 694+ } 695+ } 696 } 697 698 # 699@@ -1519,7 +1685,27 @@ make_pack_header("resources") { 700 "//ui/resources:webui_resources_grd", 701 ] 702 703- if (toolkit_views || is_ohos) { 704+ if (defined(ohos_enable_cef_chrome_runtime) && 705+ !ohos_enable_cef_chrome_runtime) { 706+ inputs -= [ 707+ "$root_gen_dir/chrome/grit/browser_resources.h", 708+ "$root_gen_dir/chrome/grit/common_resources.h", 709+ "$root_gen_dir/chrome/grit/component_extension_resources.h", 710+ "$root_gen_dir/chrome/grit/dev_ui_browser_resources.h", 711+ "$root_gen_dir/chrome/grit/pdf_resources.h", 712+ "$root_gen_dir/chrome/grit/renderer_resources.h", 713+ ] 714+ deps -= [ 715+ "//chrome/browser:dev_ui_browser_resources", 716+ "//chrome/browser:resources", 717+ "//chrome/browser/resources:component_extension_resources", 718+ "//chrome/browser/resources/pdf:resources", 719+ "//chrome/common:resources", 720+ "//chrome/renderer:resources", 721+ ] 722+ } 723+ 724+ if (toolkit_views) { 725 inputs += [ "$root_gen_dir/ui/views/resources/grit/views_resources.h" ] 726 deps += [ "//ui/views/resources:resources_grd" ] 727 } 728@@ -1561,6 +1747,22 @@ make_pack_header("strings") { 729 "//ui/strings:app_locale_settings", 730 "//ui/strings:ui_strings", 731 ] 732+ 733+ if (defined(ohos_enable_cef_chrome_runtime) && 734+ !ohos_enable_cef_chrome_runtime) { 735+ inputs -= [ 736+ "$root_gen_dir/chrome/grit/chromium_strings.h", 737+ "$root_gen_dir/chrome/grit/generated_resources.h", 738+ "$root_gen_dir/chrome/grit/locale_settings.h", 739+ "$root_gen_dir/chrome/grit/platform_locale_settings.h", 740+ ] 741+ deps -= [ 742+ "//chrome/app:chromium_strings", 743+ "//chrome/app:generated_resources", 744+ "//chrome/app/resources:locale_settings", 745+ "//chrome/app/resources:platform_locale_settings", 746+ ] 747+ } 748 } 749 750 # Generate cef_api_hash.h. 751@@ -1753,6 +1955,18 @@ if (is_mac) { 752 ldflags = [ "-Wl,--version-script=" + 753 rebase_path("//cef/libcef_dll/libcef.lst") ] 754 } 755+ 756+ if (is_ohos) { 757+ deps += [ "//ohos_nweb:nweb_sources" ] 758+ if (defined(ohos_nweb_ex) && ohos_nweb_ex) { 759+ deps += [ "//ohos_nweb_ex:nweb_ex" ] 760+ } 761+ configs += [ "//build/config/ohos:lld_pack_relocations" ] 762+ if (!(defined(testonly) && testonly)) { 763+ configs -= [ "//build/config/compiler:thinlto_optimize_default" ] 764+ configs += [ "//build/config/compiler:thinlto_optimize_max" ] 765+ } 766+ } 767 } 768 } 769 770diff --git a/src/cef/cef_paths.gypi b/src/cef/cef_paths.gypi 771index 93564229abd37..b82cb6579f4e1 772--- a/src/cef/cef_paths.gypi 773+++ b/src/cef/cef_paths.gypi 774@@ -1,4 +1,4 @@ 775-# Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 776+# Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 777 # reserved. Use of this source code is governed by a BSD-style license that 778 # can be found in the LICENSE file. 779 # 780@@ -8,7 +8,7 @@ 781 # by hand. See the translator.README.txt file in the tools directory for 782 # more information. 783 # 784-# $hash=e1b5f3e91a0370d71e09c07e9baedea6f42d3276$ 785+# $hash=c0184bbfa08d5b1a2168f3886235203d2fa5b758$ 786 # 787 788 { 789@@ -48,7 +48,6 @@ 790 'include/cef_keyboard_handler.h', 791 'include/cef_life_span_handler.h', 792 'include/cef_load_handler.h', 793- 'include/cef_media_router.h', 794 'include/cef_menu_model.h', 795 'include/cef_menu_model_delegate.h', 796 'include/cef_navigation_entry.h', 797@@ -86,7 +85,6 @@ 798 'include/cef_v8.h', 799 'include/cef_values.h', 800 'include/cef_waitable_event.h', 801- 'include/cef_web_plugin.h', 802 'include/cef_web_storage.h', 803 'include/cef_x509_certificate.h', 804 'include/cef_xml_reader.h', 805@@ -150,7 +148,6 @@ 806 'include/capi/cef_keyboard_handler_capi.h', 807 'include/capi/cef_life_span_handler_capi.h', 808 'include/capi/cef_load_handler_capi.h', 809- 'include/capi/cef_media_router_capi.h', 810 'include/capi/cef_menu_model_capi.h', 811 'include/capi/cef_menu_model_delegate_capi.h', 812 'include/capi/cef_navigation_entry_capi.h', 813@@ -188,7 +185,6 @@ 814 'include/capi/cef_v8_capi.h', 815 'include/capi/cef_values_capi.h', 816 'include/capi/cef_waitable_event_capi.h', 817- 'include/capi/cef_web_plugin_capi.h', 818 'include/capi/cef_web_storage_capi.h', 819 'include/capi/cef_x509_certificate_capi.h', 820 'include/capi/cef_xml_reader_capi.h', 821@@ -322,6 +318,8 @@ 822 'libcef_dll/cpptoc/geolocation_acess_cpptoc.h', 823 'libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.cc', 824 'libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h', 825+ 'libcef_dll/ctocpp/get_images_callback_ctocpp.cc', 826+ 'libcef_dll/ctocpp/get_images_callback_ctocpp.h', 827 'libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.cc', 828 'libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.h', 829 'libcef_dll/ctocpp/get_origins_callback_ctocpp.cc', 830@@ -346,20 +344,6 @@ 831 'libcef_dll/cpptoc/list_value_cpptoc.h', 832 'libcef_dll/ctocpp/load_handler_ctocpp.cc', 833 'libcef_dll/ctocpp/load_handler_ctocpp.h', 834- 'libcef_dll/ctocpp/media_observer_ctocpp.cc', 835- 'libcef_dll/ctocpp/media_observer_ctocpp.h', 836- 'libcef_dll/cpptoc/media_route_cpptoc.cc', 837- 'libcef_dll/cpptoc/media_route_cpptoc.h', 838- 'libcef_dll/ctocpp/media_route_create_callback_ctocpp.cc', 839- 'libcef_dll/ctocpp/media_route_create_callback_ctocpp.h', 840- 'libcef_dll/cpptoc/media_router_cpptoc.cc', 841- 'libcef_dll/cpptoc/media_router_cpptoc.h', 842- 'libcef_dll/cpptoc/media_sink_cpptoc.cc', 843- 'libcef_dll/cpptoc/media_sink_cpptoc.h', 844- 'libcef_dll/ctocpp/media_sink_device_info_callback_ctocpp.cc', 845- 'libcef_dll/ctocpp/media_sink_device_info_callback_ctocpp.h', 846- 'libcef_dll/cpptoc/media_source_cpptoc.cc', 847- 'libcef_dll/cpptoc/media_source_cpptoc.h', 848 'libcef_dll/cpptoc/views/menu_button_cpptoc.cc', 849 'libcef_dll/cpptoc/views/menu_button_cpptoc.h', 850 'libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc', 851@@ -450,6 +434,8 @@ 852 'libcef_dll/cpptoc/views/scroll_view_cpptoc.h', 853 'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc', 854 'libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h', 855+ 'libcef_dll/cpptoc/select_popup_callback_cpptoc.cc', 856+ 'libcef_dll/cpptoc/select_popup_callback_cpptoc.h', 857 'libcef_dll/cpptoc/server_cpptoc.cc', 858 'libcef_dll/cpptoc/server_cpptoc.h', 859 'libcef_dll/ctocpp/server_handler_ctocpp.cc', 860@@ -526,12 +512,8 @@ 861 'libcef_dll/ctocpp/views/view_delegate_ctocpp.h', 862 'libcef_dll/cpptoc/waitable_event_cpptoc.cc', 863 'libcef_dll/cpptoc/waitable_event_cpptoc.h', 864- 'libcef_dll/cpptoc/web_plugin_info_cpptoc.cc', 865- 'libcef_dll/cpptoc/web_plugin_info_cpptoc.h', 866- 'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc', 867- 'libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h', 868- 'libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc', 869- 'libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h', 870+ 'libcef_dll/ctocpp/web_message_receiver_ctocpp.cc', 871+ 'libcef_dll/ctocpp/web_message_receiver_ctocpp.h', 872 'libcef_dll/cpptoc/web_storage_cpptoc.cc', 873 'libcef_dll/cpptoc/web_storage_cpptoc.h', 874 'libcef_dll/cpptoc/views/window_cpptoc.cc', 875@@ -654,6 +636,8 @@ 876 'libcef_dll/ctocpp/geolocation_acess_ctocpp.h', 877 'libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.cc', 878 'libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h', 879+ 'libcef_dll/cpptoc/get_images_callback_cpptoc.cc', 880+ 'libcef_dll/cpptoc/get_images_callback_cpptoc.h', 881 'libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.cc', 882 'libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.h', 883 'libcef_dll/cpptoc/get_origins_callback_cpptoc.cc', 884@@ -678,20 +662,6 @@ 885 'libcef_dll/ctocpp/list_value_ctocpp.h', 886 'libcef_dll/cpptoc/load_handler_cpptoc.cc', 887 'libcef_dll/cpptoc/load_handler_cpptoc.h', 888- 'libcef_dll/cpptoc/media_observer_cpptoc.cc', 889- 'libcef_dll/cpptoc/media_observer_cpptoc.h', 890- 'libcef_dll/ctocpp/media_route_ctocpp.cc', 891- 'libcef_dll/ctocpp/media_route_ctocpp.h', 892- 'libcef_dll/cpptoc/media_route_create_callback_cpptoc.cc', 893- 'libcef_dll/cpptoc/media_route_create_callback_cpptoc.h', 894- 'libcef_dll/ctocpp/media_router_ctocpp.cc', 895- 'libcef_dll/ctocpp/media_router_ctocpp.h', 896- 'libcef_dll/ctocpp/media_sink_ctocpp.cc', 897- 'libcef_dll/ctocpp/media_sink_ctocpp.h', 898- 'libcef_dll/cpptoc/media_sink_device_info_callback_cpptoc.cc', 899- 'libcef_dll/cpptoc/media_sink_device_info_callback_cpptoc.h', 900- 'libcef_dll/ctocpp/media_source_ctocpp.cc', 901- 'libcef_dll/ctocpp/media_source_ctocpp.h', 902 'libcef_dll/ctocpp/views/menu_button_ctocpp.cc', 903 'libcef_dll/ctocpp/views/menu_button_ctocpp.h', 904 'libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc', 905@@ -782,6 +752,8 @@ 906 'libcef_dll/ctocpp/views/scroll_view_ctocpp.h', 907 'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc', 908 'libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h', 909+ 'libcef_dll/ctocpp/select_popup_callback_ctocpp.cc', 910+ 'libcef_dll/ctocpp/select_popup_callback_ctocpp.h', 911 'libcef_dll/ctocpp/server_ctocpp.cc', 912 'libcef_dll/ctocpp/server_ctocpp.h', 913 'libcef_dll/cpptoc/server_handler_cpptoc.cc', 914@@ -858,12 +830,8 @@ 915 'libcef_dll/cpptoc/views/view_delegate_cpptoc.h', 916 'libcef_dll/ctocpp/waitable_event_ctocpp.cc', 917 'libcef_dll/ctocpp/waitable_event_ctocpp.h', 918- 'libcef_dll/ctocpp/web_plugin_info_ctocpp.cc', 919- 'libcef_dll/ctocpp/web_plugin_info_ctocpp.h', 920- 'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc', 921- 'libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h', 922- 'libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc', 923- 'libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h', 924+ 'libcef_dll/cpptoc/web_message_receiver_cpptoc.cc', 925+ 'libcef_dll/cpptoc/web_message_receiver_cpptoc.h', 926 'libcef_dll/ctocpp/web_storage_ctocpp.cc', 927 'libcef_dll/ctocpp/web_storage_ctocpp.h', 928 'libcef_dll/ctocpp/views/window_ctocpp.cc', 929diff --git a/src/cef/include/capi/cef_accessibility_handler_capi.h b/src/cef/include/capi/cef_accessibility_handler_capi.h 930index cafa9a27d3c12..40b5a26b2c9cf 931--- a/src/cef/include/capi/cef_accessibility_handler_capi.h 932+++ b/src/cef/include/capi/cef_accessibility_handler_capi.h 933@@ -1,4 +1,4 @@ 934-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 935+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 936 // 937 // Redistribution and use in source and binary forms, with or without 938 // modification, are permitted provided that the following conditions are 939@@ -33,7 +33,7 @@ 940 // by hand. See the translator.README.txt file in the tools directory for 941 // more information. 942 // 943-// $hash=306e44d49ab6198a0fa1bcea50e8a25ee18672be$ 944+// $hash=5dc54f9c45e2a1df857f114a11c97509da95db34$ 945 // 946 947 #ifndef CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_ 948diff --git a/src/cef/include/capi/cef_app_capi.h b/src/cef/include/capi/cef_app_capi.h 949index 4554a25dc0104..f5418cdfd9752 950--- a/src/cef/include/capi/cef_app_capi.h 951+++ b/src/cef/include/capi/cef_app_capi.h 952@@ -1,4 +1,4 @@ 953-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 954+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 955 // 956 // Redistribution and use in source and binary forms, with or without 957 // modification, are permitted provided that the following conditions are 958@@ -33,7 +33,7 @@ 959 // by hand. See the translator.README.txt file in the tools directory for 960 // more information. 961 // 962-// $hash=adfba3dd6479b96a95639c13ee1e07bed7b335d0$ 963+// $hash=7713ef16c0c137b67ad926fafe2dfae35d187b48$ 964 // 965 966 #ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ 967diff --git a/src/cef/include/capi/cef_audio_handler_capi.h b/src/cef/include/capi/cef_audio_handler_capi.h 968index ffb9ff0b18de4..11d69d36c5bd1 969--- a/src/cef/include/capi/cef_audio_handler_capi.h 970+++ b/src/cef/include/capi/cef_audio_handler_capi.h 971@@ -1,4 +1,4 @@ 972-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 973+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 974 // 975 // Redistribution and use in source and binary forms, with or without 976 // modification, are permitted provided that the following conditions are 977@@ -33,7 +33,7 @@ 978 // by hand. See the translator.README.txt file in the tools directory for 979 // more information. 980 // 981-// $hash=fd8d34089842ee8f8490ef1828c3091d12052e28$ 982+// $hash=dca41618f6b4b8c5623912b0637918ab10c61846$ 983 // 984 985 #ifndef CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_ 986diff --git a/src/cef/include/capi/cef_auth_callback_capi.h b/src/cef/include/capi/cef_auth_callback_capi.h 987index fd06fe2312988..97ed88afd31da 988--- a/src/cef/include/capi/cef_auth_callback_capi.h 989+++ b/src/cef/include/capi/cef_auth_callback_capi.h 990@@ -1,4 +1,4 @@ 991-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 992+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 993 // 994 // Redistribution and use in source and binary forms, with or without 995 // modification, are permitted provided that the following conditions are 996@@ -33,7 +33,7 @@ 997 // by hand. See the translator.README.txt file in the tools directory for 998 // more information. 999 // 1000-// $hash=0938c1802b077b2b17708c6a8ee305984e079d64$ 1001+// $hash=5b63adedf123da2990eef1445830f221e557ce95$ 1002 // 1003 1004 #ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ 1005diff --git a/src/cef/include/capi/cef_browser_capi.h b/src/cef/include/capi/cef_browser_capi.h 1006index bbed76ff16ba2..d0d087ab0df9b 1007--- a/src/cef/include/capi/cef_browser_capi.h 1008+++ b/src/cef/include/capi/cef_browser_capi.h 1009@@ -1,4 +1,4 @@ 1010-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1011+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1012 // 1013 // Redistribution and use in source and binary forms, with or without 1014 // modification, are permitted provided that the following conditions are 1015@@ -33,7 +33,7 @@ 1016 // by hand. See the translator.README.txt file in the tools directory for 1017 // more information. 1018 // 1019-// $hash=c797c6e02b956ccd39ab4463f412cff4e45deeda$ 1020+// $hash=097fc69d7b712dde294d45394bc0eff518a34689$ 1021 // 1022 1023 #ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ 1024@@ -59,6 +59,7 @@ struct _cef_browser_host_t; 1025 struct _cef_client_t; 1026 struct _cef_java_script_result_callback_t; 1027 struct _cef_store_web_archive_result_callback_t; 1028+struct _cef_web_message_receiver_t; 1029 1030 /// 1031 // Structure used to represent a browser. When used in the browser process the 1032@@ -864,7 +865,7 @@ typedef struct _cef_browser_host_t { 1033 /// 1034 void(CEF_CALLBACK* post_port_message)(struct _cef_browser_host_t* self, 1035 cef_string_t* port_handle, 1036- cef_string_t* data); 1037+ struct _cef_value_t* message); 1038 1039 /// 1040 // Set the callback of the port. 1041@@ -872,7 +873,7 @@ typedef struct _cef_browser_host_t { 1042 void(CEF_CALLBACK* set_port_message_callback)( 1043 struct _cef_browser_host_t* self, 1044 cef_string_t* port_handle, 1045- struct _cef_java_script_result_callback_t* callback); 1046+ struct _cef_web_message_receiver_t* callback); 1047 1048 /// 1049 // Gets the latest hitdata 1050@@ -1176,6 +1177,84 @@ typedef struct _cef_browser_host_t { 1051 /// 1052 void(CEF_CALLBACK* update_locale)(struct _cef_browser_host_t* self, 1053 const cef_string_t* locale); 1054+ 1055+ /// 1056+ // Returns the original url of the request. 1057+ /// 1058+ // The resulting string must be freed by calling cef_string_userfree_free(). 1059+ cef_string_userfree_t(CEF_CALLBACK* get_original_url)( 1060+ struct _cef_browser_host_t* self); 1061+ 1062+ /// 1063+ // Set network status 1064+ /// 1065+ void(CEF_CALLBACK* put_network_available)(struct _cef_browser_host_t* self, 1066+ int available); 1067+ 1068+ /// 1069+ // Remove web cache 1070+ /// 1071+ void(CEF_CALLBACK* remove_cache)(struct _cef_browser_host_t* self, 1072+ int include_disk_files); 1073+ 1074+ /// 1075+ // Scroll page up or down 1076+ /// 1077+ void(CEF_CALLBACK* scroll_page_up_down)(struct _cef_browser_host_t* self, 1078+ int is_up, 1079+ int is_half, 1080+ float view_height); 1081+ 1082+ /// 1083+ // Get web history state 1084+ /// 1085+ struct _cef_binary_value_t*(CEF_CALLBACK* get_web_state)( 1086+ struct _cef_browser_host_t* self); 1087+ 1088+ /// 1089+ // Restore web history state 1090+ /// 1091+ int(CEF_CALLBACK* restore_web_state)(struct _cef_browser_host_t* self, 1092+ struct _cef_binary_value_t* state); 1093+ 1094+ /// 1095+ // Scroll to the position. 1096+ /// 1097+ void(CEF_CALLBACK* scroll_to)(struct _cef_browser_host_t* self, 1098+ float x, 1099+ float y); 1100+ 1101+ /// 1102+ // Scroll by the delta distance. 1103+ /// 1104+ void(CEF_CALLBACK* scroll_by)(struct _cef_browser_host_t* self, 1105+ float delta_x, 1106+ float delta_y); 1107+ 1108+ /// 1109+ // Slide Scroll by the speed. 1110+ /// 1111+ void(CEF_CALLBACK* slide_scroll)(struct _cef_browser_host_t* self, 1112+ float vx, 1113+ float vy); 1114+ 1115+ /// 1116+ // Set whether webview can access files 1117+ /// 1118+ void(CEF_CALLBACK* set_file_access)(struct _cef_browser_host_t* self, 1119+ int falg); 1120+ 1121+ /// 1122+ // Set whether webview can access network 1123+ /// 1124+ void(CEF_CALLBACK* set_block_network)(struct _cef_browser_host_t* self, 1125+ int falg); 1126+ 1127+ /// 1128+ // Set the cache mode of webview 1129+ /// 1130+ void(CEF_CALLBACK* set_cache_mode)(struct _cef_browser_host_t* self, 1131+ int falg); 1132 } cef_browser_host_t; 1133 1134 /// 1135@@ -1250,6 +1329,23 @@ typedef struct _cef_store_web_archive_result_callback_t { 1136 const cef_string_t* result); 1137 } cef_store_web_archive_result_callback_t; 1138 1139+/// 1140+// Structure to implement to be notified of asynchronous web message channel. 1141+/// 1142+typedef struct _cef_web_message_receiver_t { 1143+ /// 1144+ // Base structure. 1145+ /// 1146+ cef_base_ref_counted_t base; 1147+ 1148+ /// 1149+ // Method that will be called upon |PostPortMessage|. |message| will be sent 1150+ // to another end of web message channel. 1151+ /// 1152+ void(CEF_CALLBACK* on_message)(struct _cef_web_message_receiver_t* self, 1153+ struct _cef_value_t* message); 1154+} cef_web_message_receiver_t; 1155+ 1156 #ifdef __cplusplus 1157 } 1158 #endif 1159diff --git a/src/cef/include/capi/cef_browser_process_handler_capi.h b/src/cef/include/capi/cef_browser_process_handler_capi.h 1160index 2a3dc178e7353..a53e677b9be24 1161--- a/src/cef/include/capi/cef_browser_process_handler_capi.h 1162+++ b/src/cef/include/capi/cef_browser_process_handler_capi.h 1163@@ -1,4 +1,4 @@ 1164-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1165+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1166 // 1167 // Redistribution and use in source and binary forms, with or without 1168 // modification, are permitted provided that the following conditions are 1169@@ -33,7 +33,7 @@ 1170 // by hand. See the translator.README.txt file in the tools directory for 1171 // more information. 1172 // 1173-// $hash=8c97f9b58c642c144cc37824ad820192640307cb$ 1174+// $hash=e56e9d7bc7bd7d42f768a845cb3dc8ead6475fcd$ 1175 // 1176 1177 #ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ 1178diff --git a/src/cef/include/capi/cef_callback_capi.h b/src/cef/include/capi/cef_callback_capi.h 1179index 481e45266351a..05353af3423ee 1180--- a/src/cef/include/capi/cef_callback_capi.h 1181+++ b/src/cef/include/capi/cef_callback_capi.h 1182@@ -1,4 +1,4 @@ 1183-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1184+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1185 // 1186 // Redistribution and use in source and binary forms, with or without 1187 // modification, are permitted provided that the following conditions are 1188@@ -33,7 +33,7 @@ 1189 // by hand. See the translator.README.txt file in the tools directory for 1190 // more information. 1191 // 1192-// $hash=6dabadb8090f82aa929beda6f4724bac4cd17020$ 1193+// $hash=a48ae6711d03e12ddfe94aa3b54a46fbd41bd179$ 1194 // 1195 1196 #ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ 1197diff --git a/src/cef/include/capi/cef_client_capi.h b/src/cef/include/capi/cef_client_capi.h 1198index ce800661252b7..606e22de72f37 1199--- a/src/cef/include/capi/cef_client_capi.h 1200+++ b/src/cef/include/capi/cef_client_capi.h 1201@@ -1,4 +1,4 @@ 1202-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1203+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1204 // 1205 // Redistribution and use in source and binary forms, with or without 1206 // modification, are permitted provided that the following conditions are 1207@@ -33,7 +33,7 @@ 1208 // by hand. See the translator.README.txt file in the tools directory for 1209 // more information. 1210 // 1211-// $hash=d69368574610ae29c8b17bf71174c237fb01ca28$ 1212+// $hash=100836d9c768fb63da4c355cb0571e34d0c6a8dd$ 1213 // 1214 1215 #ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ 1216@@ -76,133 +76,137 @@ typedef struct _cef_client_t { 1217 /// 1218 // Return the handler for audio rendering events. 1219 /// 1220- struct _cef_audio_handler_t *(CEF_CALLBACK *get_audio_handler)( 1221- struct _cef_client_t *self); 1222+ struct _cef_audio_handler_t*(CEF_CALLBACK* get_audio_handler)( 1223+ struct _cef_client_t* self); 1224 1225 /// 1226 // Return the handler for context menus. If no handler is provided the default 1227 // implementation will be used. 1228 /// 1229- struct _cef_context_menu_handler_t *(CEF_CALLBACK *get_context_menu_handler)( 1230- struct _cef_client_t *self); 1231+ struct _cef_context_menu_handler_t*(CEF_CALLBACK* get_context_menu_handler)( 1232+ struct _cef_client_t* self); 1233 1234 /// 1235 // Return the handler for dialogs. If no handler is provided the default 1236 // implementation will be used. 1237 /// 1238- struct _cef_dialog_handler_t *(CEF_CALLBACK *get_dialog_handler)( 1239- struct _cef_client_t *self); 1240+ struct _cef_dialog_handler_t*(CEF_CALLBACK* get_dialog_handler)( 1241+ struct _cef_client_t* self); 1242 1243 /// 1244 // Return the handler for browser display state events. 1245 /// 1246- struct _cef_display_handler_t *(CEF_CALLBACK *get_display_handler)( 1247- struct _cef_client_t *self); 1248+ struct _cef_display_handler_t*(CEF_CALLBACK* get_display_handler)( 1249+ struct _cef_client_t* self); 1250 1251 /// 1252 // Return the handler for download events. If no handler is returned downloads 1253 // will not be allowed. 1254 /// 1255- struct _cef_download_handler_t *(CEF_CALLBACK *get_download_handler)( 1256- struct _cef_client_t *self); 1257+ struct _cef_download_handler_t*(CEF_CALLBACK* get_download_handler)( 1258+ struct _cef_client_t* self); 1259 1260 /// 1261 // Return the handler for drag events. 1262 /// 1263- struct _cef_drag_handler_t *(CEF_CALLBACK *get_drag_handler)( 1264- struct _cef_client_t *self); 1265+ struct _cef_drag_handler_t*(CEF_CALLBACK* get_drag_handler)( 1266+ struct _cef_client_t* self); 1267 1268 /// 1269 // Return the handler for find result events. 1270 /// 1271- struct _cef_find_handler_t *(CEF_CALLBACK *get_find_handler)( 1272- struct _cef_client_t *self); 1273+ struct _cef_find_handler_t*(CEF_CALLBACK* get_find_handler)( 1274+ struct _cef_client_t* self); 1275 1276 /// 1277 // Return the handler for focus events. 1278 /// 1279- struct _cef_focus_handler_t *(CEF_CALLBACK *get_focus_handler)( 1280- struct _cef_client_t *self); 1281+ struct _cef_focus_handler_t*(CEF_CALLBACK* get_focus_handler)( 1282+ struct _cef_client_t* self); 1283 1284 /// 1285 // Return the handler for events related to cef_frame_t lifespan. This 1286 // function will be called once during cef_browser_t creation and the result 1287 // will be cached for performance reasons. 1288 /// 1289- struct _cef_frame_handler_t *(CEF_CALLBACK *get_frame_handler)( 1290- struct _cef_client_t *self); 1291+ struct _cef_frame_handler_t*(CEF_CALLBACK* get_frame_handler)( 1292+ struct _cef_client_t* self); 1293 1294 /// 1295 // Return the handler for JavaScript dialogs. If no handler is provided the 1296 // default implementation will be used. 1297 /// 1298- struct _cef_jsdialog_handler_t *(CEF_CALLBACK *get_jsdialog_handler)( 1299- struct _cef_client_t *self); 1300+ struct _cef_jsdialog_handler_t*(CEF_CALLBACK* get_jsdialog_handler)( 1301+ struct _cef_client_t* self); 1302 1303 /// 1304 // Return the handler for keyboard events. 1305 /// 1306- struct _cef_keyboard_handler_t *(CEF_CALLBACK *get_keyboard_handler)( 1307- struct _cef_client_t *self); 1308+ struct _cef_keyboard_handler_t*(CEF_CALLBACK* get_keyboard_handler)( 1309+ struct _cef_client_t* self); 1310 1311 /// 1312 // Return the handler for browser life span events. 1313 /// 1314- struct _cef_life_span_handler_t *(CEF_CALLBACK *get_life_span_handler)( 1315- struct _cef_client_t *self); 1316+ struct _cef_life_span_handler_t*(CEF_CALLBACK* get_life_span_handler)( 1317+ struct _cef_client_t* self); 1318 1319 /// 1320 // Return the handler for browser load status events. 1321 /// 1322- struct _cef_load_handler_t *(CEF_CALLBACK *get_load_handler)( 1323- struct _cef_client_t *self); 1324+ struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)( 1325+ struct _cef_client_t* self); 1326 1327 /// 1328 // Return the handler for printing on Linux. If a print handler is not 1329 // provided then printing will not be supported on the Linux platform. 1330 /// 1331- struct _cef_print_handler_t *(CEF_CALLBACK *get_print_handler)( 1332- struct _cef_client_t *self); 1333+ struct _cef_print_handler_t*(CEF_CALLBACK* get_print_handler)( 1334+ struct _cef_client_t* self); 1335 1336 /// 1337 // Return the handler for off-screen rendering events. 1338 /// 1339- struct _cef_render_handler_t *(CEF_CALLBACK *get_render_handler)( 1340- struct _cef_client_t *self); 1341+ struct _cef_render_handler_t*(CEF_CALLBACK* get_render_handler)( 1342+ struct _cef_client_t* self); 1343 1344 /// 1345 // Return the handler for browser request events. 1346 /// 1347- struct _cef_request_handler_t *(CEF_CALLBACK *get_request_handler)( 1348- struct _cef_client_t *self); 1349+ struct _cef_request_handler_t*(CEF_CALLBACK* get_request_handler)( 1350+ struct _cef_client_t* self); 1351 1352 /// 1353 // Return the handler for browser geolocation permission request events. 1354 /// 1355- struct _cef_permission_request_t *(CEF_CALLBACK *get_permission_request)( 1356- struct _cef_client_t *self); 1357+ struct _cef_permission_request_t*(CEF_CALLBACK* get_permission_request)( 1358+ struct _cef_client_t* self); 1359 1360 /// 1361 // Called when a new message is received from a different process. Return true 1362 // (1) if the message was handled or false (0) otherwise. It is safe to keep 1363 // a reference to |message| outside of this callback. 1364 /// 1365- int(CEF_CALLBACK *on_process_message_received)( 1366- struct _cef_client_t *self, struct _cef_browser_t *browser, 1367- struct _cef_frame_t *frame, cef_process_id_t source_process, 1368- struct _cef_process_message_t *message); 1369+ int(CEF_CALLBACK* on_process_message_received)( 1370+ struct _cef_client_t* self, 1371+ struct _cef_browser_t* browser, 1372+ struct _cef_frame_t* frame, 1373+ cef_process_id_t source_process, 1374+ struct _cef_process_message_t* message); 1375 1376 /// 1377 // Returns the list of arguments NotifyJavaScriptResult. 1378 /// 1379- int(CEF_CALLBACK *notify_java_script_result)( 1380- struct _cef_client_t *self, struct _cef_list_value_t *args, 1381- const cef_string_t *method, const cef_string_t *object_name, 1382- struct _cef_list_value_t *result); 1383+ int(CEF_CALLBACK* notify_java_script_result)( 1384+ struct _cef_client_t* self, 1385+ struct _cef_list_value_t* args, 1386+ const cef_string_t* method, 1387+ const cef_string_t* object_name, 1388+ struct _cef_list_value_t* result); 1389 } cef_client_t; 1390 1391 #ifdef __cplusplus 1392 } 1393 #endif 1394 1395-#endif // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ 1396+#endif // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ 1397diff --git a/src/cef/include/capi/cef_command_line_capi.h b/src/cef/include/capi/cef_command_line_capi.h 1398index 7f69a1d34da58..f1088f0143950 1399--- a/src/cef/include/capi/cef_command_line_capi.h 1400+++ b/src/cef/include/capi/cef_command_line_capi.h 1401@@ -1,4 +1,4 @@ 1402-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1403+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1404 // 1405 // Redistribution and use in source and binary forms, with or without 1406 // modification, are permitted provided that the following conditions are 1407@@ -33,7 +33,7 @@ 1408 // by hand. See the translator.README.txt file in the tools directory for 1409 // more information. 1410 // 1411-// $hash=93f3d769c0d48ed6e1d91ad8a8e2f95d4ee54287$ 1412+// $hash=deb97d81f206e08a6f78510e7f8f1985aef98ff0$ 1413 // 1414 1415 #ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ 1416diff --git a/src/cef/include/capi/cef_context_menu_handler_capi.h b/src/cef/include/capi/cef_context_menu_handler_capi.h 1417index 04dbeaf8390ec..d292f78cec42f 1418--- a/src/cef/include/capi/cef_context_menu_handler_capi.h 1419+++ b/src/cef/include/capi/cef_context_menu_handler_capi.h 1420@@ -1,4 +1,4 @@ 1421-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1422+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1423 // 1424 // Redistribution and use in source and binary forms, with or without 1425 // modification, are permitted provided that the following conditions are 1426@@ -33,7 +33,7 @@ 1427 // by hand. See the translator.README.txt file in the tools directory for 1428 // more information. 1429 // 1430-// $hash=07baaa2ecbddce012a9ef020766e4cb40ff8b9b0$ 1431+// $hash=351828c559518eeefb3b74bb24558ae51a49f2a5$ 1432 // 1433 1434 #ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ 1435@@ -373,6 +373,20 @@ typedef struct _cef_context_menu_params_t { 1436 // items). 1437 /// 1438 int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self); 1439+ 1440+ /// 1441+ // Returns the input field type of context node that the context menu was 1442+ // invoked on. 1443+ /// 1444+ cef_context_menu_input_field_type_t(CEF_CALLBACK* get_input_field_type)( 1445+ struct _cef_context_menu_params_t* self); 1446+ 1447+ /// 1448+ // Returns the source type of context node that the context menu was invoked 1449+ // on. 1450+ /// 1451+ cef_context_menu_source_type_t(CEF_CALLBACK* get_source_type)( 1452+ struct _cef_context_menu_params_t* self); 1453 } cef_context_menu_params_t; 1454 1455 #ifdef __cplusplus 1456diff --git a/src/cef/include/capi/cef_cookie_capi.h b/src/cef/include/capi/cef_cookie_capi.h 1457index fe865a0831b00..d81c9e8f46251 1458--- a/src/cef/include/capi/cef_cookie_capi.h 1459+++ b/src/cef/include/capi/cef_cookie_capi.h 1460@@ -1,4 +1,4 @@ 1461-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1462+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1463 // 1464 // Redistribution and use in source and binary forms, with or without 1465 // modification, are permitted provided that the following conditions are 1466@@ -33,7 +33,7 @@ 1467 // by hand. See the translator.README.txt file in the tools directory for 1468 // more information. 1469 // 1470-// $hash=76bce0d14b3cfcc4afb47d59936e4f2e0932566b$ 1471+// $hash=fcda5b9ec03f8bae722fa681f0cde144caf6c929$ 1472 // 1473 1474 #ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ 1475diff --git a/src/cef/include/capi/cef_crash_util_capi.h b/src/cef/include/capi/cef_crash_util_capi.h 1476index 2a569bdb807d9..4ebf112d358d1 1477--- a/src/cef/include/capi/cef_crash_util_capi.h 1478+++ b/src/cef/include/capi/cef_crash_util_capi.h 1479@@ -1,4 +1,4 @@ 1480-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1481+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1482 // 1483 // Redistribution and use in source and binary forms, with or without 1484 // modification, are permitted provided that the following conditions are 1485@@ -33,7 +33,7 @@ 1486 // by hand. See the translator.README.txt file in the tools directory for 1487 // more information. 1488 // 1489-// $hash=0460e68eb7d1b1188706c42d14beafbf9a6f7126$ 1490+// $hash=dd437f3b8022c0c92074a0d1d9aa5b2cef40e109$ 1491 // 1492 1493 #ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_ 1494diff --git a/src/cef/include/capi/cef_data_base_capi.h b/src/cef/include/capi/cef_data_base_capi.h 1495index a0e1d91eaa644..12b11dd1e81cb 1496--- a/src/cef/include/capi/cef_data_base_capi.h 1497+++ b/src/cef/include/capi/cef_data_base_capi.h 1498@@ -1,4 +1,4 @@ 1499-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1500+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1501 // 1502 // Redistribution and use in source and binary forms, with or without 1503 // modification, are permitted provided that the following conditions are 1504@@ -33,7 +33,7 @@ 1505 // by hand. See the translator.README.txt file in the tools directory for 1506 // more information. 1507 // 1508-// $hash=d2a63576b59c75e748b5a725af9a4337414c82b9$ 1509+// $hash=99bb61cf23fa49b4a7ce08c77d0c98980bc07a1f$ 1510 // 1511 1512 #ifndef CEF_INCLUDE_CAPI_CEF_DATA_BASE_CAPI_H_ 1513@@ -78,11 +78,12 @@ typedef struct _cef_data_base_t { 1514 /// 1515 // get http auth data by host and realm. 1516 /// 1517- void(CEF_CALLBACK* get_http_auth_credentials)( 1518- struct _cef_data_base_t* self, 1519- const cef_string_t* host, 1520- const cef_string_t* realm, 1521- cef_string_list_t username_password); 1522+ void(CEF_CALLBACK* get_http_auth_credentials)(struct _cef_data_base_t* self, 1523+ const cef_string_t* host, 1524+ const cef_string_t* realm, 1525+ cef_string_t* username, 1526+ char* password, 1527+ uint32_t passwordSize); 1528 1529 /// 1530 // gets whether the instance holds the specified permissions for the specified 1531diff --git a/src/cef/include/capi/cef_devtools_message_observer_capi.h b/src/cef/include/capi/cef_devtools_message_observer_capi.h 1532index 137f82136d035..b9e7662ff2908 1533--- a/src/cef/include/capi/cef_devtools_message_observer_capi.h 1534+++ b/src/cef/include/capi/cef_devtools_message_observer_capi.h 1535@@ -1,4 +1,4 @@ 1536-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1537+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1538 // 1539 // Redistribution and use in source and binary forms, with or without 1540 // modification, are permitted provided that the following conditions are 1541@@ -33,7 +33,7 @@ 1542 // by hand. See the translator.README.txt file in the tools directory for 1543 // more information. 1544 // 1545-// $hash=ec62239c2b24ff512b64ca758be825ff57fb3b6b$ 1546+// $hash=bd660c767a942fc27ea2ede0343e029ac8b7c603$ 1547 // 1548 1549 #ifndef CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_ 1550diff --git a/src/cef/include/capi/cef_dialog_handler_capi.h b/src/cef/include/capi/cef_dialog_handler_capi.h 1551index 0071832626b2d..2d5c1438f0756 1552--- a/src/cef/include/capi/cef_dialog_handler_capi.h 1553+++ b/src/cef/include/capi/cef_dialog_handler_capi.h 1554@@ -1,4 +1,4 @@ 1555-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1556+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1557 // 1558 // Redistribution and use in source and binary forms, with or without 1559 // modification, are permitted provided that the following conditions are 1560@@ -33,7 +33,7 @@ 1561 // by hand. See the translator.README.txt file in the tools directory for 1562 // more information. 1563 // 1564-// $hash=abdbb4a150fc310df31ec08d1618e1e557dfe3e2$ 1565+// $hash=999efab317d9de20cf31c967a7facaed253ced56$ 1566 // 1567 1568 #ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ 1569@@ -73,6 +73,30 @@ typedef struct _cef_file_dialog_callback_t { 1570 void(CEF_CALLBACK* cancel)(struct _cef_file_dialog_callback_t* self); 1571 } cef_file_dialog_callback_t; 1572 1573+/// 1574+// Callback structure for asynchronous continuation of <select> selection. 1575+/// 1576+typedef struct _cef_select_popup_callback_t { 1577+ /// 1578+ // Base structure. 1579+ /// 1580+ cef_base_ref_counted_t base; 1581+ 1582+ /// 1583+ // Continue the <select> selection. |indices| should be the 0-based array 1584+ // index of the value selected from the <select> array passed to 1585+ // cef_dialog_handler_t::ShowSelectPopup. 1586+ /// 1587+ void(CEF_CALLBACK* cont)(struct _cef_select_popup_callback_t* self, 1588+ size_t indicesCount, 1589+ int const* indices); 1590+ 1591+ /// 1592+ // Cancel <select> selection. 1593+ /// 1594+ void(CEF_CALLBACK* cancel)(struct _cef_select_popup_callback_t* self); 1595+} cef_select_popup_callback_t; 1596+ 1597 /// 1598 // Implement this structure to handle dialog events. The functions of this 1599 // structure will be called on the browser process UI thread. 1600@@ -108,6 +132,22 @@ typedef struct _cef_dialog_handler_t { 1601 int selected_accept_filter, 1602 int capture, 1603 struct _cef_file_dialog_callback_t* callback); 1604+ 1605+ /// 1606+ // Show <select> popup menu. 1607+ /// 1608+ void(CEF_CALLBACK* on_select_popup_menu)( 1609+ struct _cef_dialog_handler_t* self, 1610+ struct _cef_browser_t* browser, 1611+ const cef_rect_t* bounds, 1612+ int item_height, 1613+ double item_font_size, 1614+ int selected_item, 1615+ size_t menu_itemsCount, 1616+ cef_select_popup_item_t const* menu_items, 1617+ int right_aligned, 1618+ int allow_multiple_selection, 1619+ struct _cef_select_popup_callback_t* callback); 1620 } cef_dialog_handler_t; 1621 1622 #ifdef __cplusplus 1623diff --git a/src/cef/include/capi/cef_display_handler_capi.h b/src/cef/include/capi/cef_display_handler_capi.h 1624index c59849b24eebd..ed9cc06c26811 1625--- a/src/cef/include/capi/cef_display_handler_capi.h 1626+++ b/src/cef/include/capi/cef_display_handler_capi.h 1627@@ -1,4 +1,4 @@ 1628-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1629+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1630 // 1631 // Redistribution and use in source and binary forms, with or without 1632 // modification, are permitted provided that the following conditions are 1633@@ -33,7 +33,7 @@ 1634 // by hand. See the translator.README.txt file in the tools directory for 1635 // more information. 1636 // 1637-// $hash=98444bfe2f513889b45f8a8c7d047cb21b110243$ 1638+// $hash=a7d326ca19b9ac03c15ed63eed59e0a7f763456b$ 1639 // 1640 1641 #ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ 1642diff --git a/src/cef/include/capi/cef_dom_capi.h b/src/cef/include/capi/cef_dom_capi.h 1643index 97300ec387f46..eab26e375d8fc 1644--- a/src/cef/include/capi/cef_dom_capi.h 1645+++ b/src/cef/include/capi/cef_dom_capi.h 1646@@ -1,4 +1,4 @@ 1647-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1648+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1649 // 1650 // Redistribution and use in source and binary forms, with or without 1651 // modification, are permitted provided that the following conditions are 1652@@ -33,7 +33,7 @@ 1653 // by hand. See the translator.README.txt file in the tools directory for 1654 // more information. 1655 // 1656-// $hash=c6de3fb4d64a2b2ad06a4b9c5e9d7625d40b5bb6$ 1657+// $hash=b01f97e4395b8da428df01f58d8301b3b8c41cc0$ 1658 // 1659 1660 #ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ 1661diff --git a/src/cef/include/capi/cef_download_handler_capi.h b/src/cef/include/capi/cef_download_handler_capi.h 1662index 29b05871030e6..3d3e57314dd05 1663--- a/src/cef/include/capi/cef_download_handler_capi.h 1664+++ b/src/cef/include/capi/cef_download_handler_capi.h 1665@@ -1,4 +1,4 @@ 1666-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1667+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1668 // 1669 // Redistribution and use in source and binary forms, with or without 1670 // modification, are permitted provided that the following conditions are 1671@@ -33,7 +33,7 @@ 1672 // by hand. See the translator.README.txt file in the tools directory for 1673 // more information. 1674 // 1675-// $hash=ec13ec3e2819e4ac49792c3a1c57bc60b45fb95b$ 1676+// $hash=8c9afdb42e9045fad9c6c3a901552f67a69e3f34$ 1677 // 1678 1679 #ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ 1680diff --git a/src/cef/include/capi/cef_download_item_capi.h b/src/cef/include/capi/cef_download_item_capi.h 1681index 2d52f11b42381..b211640529979 1682--- a/src/cef/include/capi/cef_download_item_capi.h 1683+++ b/src/cef/include/capi/cef_download_item_capi.h 1684@@ -1,4 +1,4 @@ 1685-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1686+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1687 // 1688 // Redistribution and use in source and binary forms, with or without 1689 // modification, are permitted provided that the following conditions are 1690@@ -33,7 +33,7 @@ 1691 // by hand. See the translator.README.txt file in the tools directory for 1692 // more information. 1693 // 1694-// $hash=b9f0d91dd2fdb3625365ff8b332b08e1f0ea1187$ 1695+// $hash=91273857318c2755502ed75f36dd9cca4cf3beb1$ 1696 // 1697 1698 #ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ 1699diff --git a/src/cef/include/capi/cef_drag_data_capi.h b/src/cef/include/capi/cef_drag_data_capi.h 1700index 7e133155d6633..927234788fc4d 1701--- a/src/cef/include/capi/cef_drag_data_capi.h 1702+++ b/src/cef/include/capi/cef_drag_data_capi.h 1703@@ -1,4 +1,4 @@ 1704-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1705+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1706 // 1707 // Redistribution and use in source and binary forms, with or without 1708 // modification, are permitted provided that the following conditions are 1709@@ -33,7 +33,7 @@ 1710 // by hand. See the translator.README.txt file in the tools directory for 1711 // more information. 1712 // 1713-// $hash=b6e3236a062cd25ec26c3daeb1940d1e1bf0d96a$ 1714+// $hash=319451cc942ceffde5c1b4f5e19972e5132ee71e$ 1715 // 1716 1717 #ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ 1718diff --git a/src/cef/include/capi/cef_drag_handler_capi.h b/src/cef/include/capi/cef_drag_handler_capi.h 1719index 68b26d7165a35..97c56380eada1 1720--- a/src/cef/include/capi/cef_drag_handler_capi.h 1721+++ b/src/cef/include/capi/cef_drag_handler_capi.h 1722@@ -1,4 +1,4 @@ 1723-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1724+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1725 // 1726 // Redistribution and use in source and binary forms, with or without 1727 // modification, are permitted provided that the following conditions are 1728@@ -33,7 +33,7 @@ 1729 // by hand. See the translator.README.txt file in the tools directory for 1730 // more information. 1731 // 1732-// $hash=5b2051c42c1d4c41b85ca823d34b26bfa5de6777$ 1733+// $hash=3c99a3db33be866a89d9600248b9b6ebcc48fbcb$ 1734 // 1735 1736 #ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ 1737diff --git a/src/cef/include/capi/cef_extension_capi.h b/src/cef/include/capi/cef_extension_capi.h 1738index 24ba87d64125c..466af7a7207ed 1739--- a/src/cef/include/capi/cef_extension_capi.h 1740+++ b/src/cef/include/capi/cef_extension_capi.h 1741@@ -1,4 +1,4 @@ 1742-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1743+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1744 // 1745 // Redistribution and use in source and binary forms, with or without 1746 // modification, are permitted provided that the following conditions are 1747@@ -33,7 +33,7 @@ 1748 // by hand. See the translator.README.txt file in the tools directory for 1749 // more information. 1750 // 1751-// $hash=fcfe34c1517ebdb3f00c1f737b91361e771b820d$ 1752+// $hash=75dd531ede2169c637c969db447761ca7e59aac9$ 1753 // 1754 1755 #ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_ 1756diff --git a/src/cef/include/capi/cef_extension_handler_capi.h b/src/cef/include/capi/cef_extension_handler_capi.h 1757index 73c4f3bca1b99..04325f3a21976 1758--- a/src/cef/include/capi/cef_extension_handler_capi.h 1759+++ b/src/cef/include/capi/cef_extension_handler_capi.h 1760@@ -1,4 +1,4 @@ 1761-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1762+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1763 // 1764 // Redistribution and use in source and binary forms, with or without 1765 // modification, are permitted provided that the following conditions are 1766@@ -33,7 +33,7 @@ 1767 // by hand. See the translator.README.txt file in the tools directory for 1768 // more information. 1769 // 1770-// $hash=768e2436e54cceb2675ddd03ebdc61b5c0785bdc$ 1771+// $hash=90bd893bc1fdd605330bcfabcab9faeab419c42a$ 1772 // 1773 1774 #ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_ 1775diff --git a/src/cef/include/capi/cef_file_util_capi.h b/src/cef/include/capi/cef_file_util_capi.h 1776index 234f4240f8a76..942ec7d69e15c 1777--- a/src/cef/include/capi/cef_file_util_capi.h 1778+++ b/src/cef/include/capi/cef_file_util_capi.h 1779@@ -1,4 +1,4 @@ 1780-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1781+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1782 // 1783 // Redistribution and use in source and binary forms, with or without 1784 // modification, are permitted provided that the following conditions are 1785@@ -33,7 +33,7 @@ 1786 // by hand. See the translator.README.txt file in the tools directory for 1787 // more information. 1788 // 1789-// $hash=e76fa23e9682bf0865319d93e4009752ac8f854f$ 1790+// $hash=42b3783846c1c99e91e4f69e8d8df2be2c823251$ 1791 // 1792 1793 #ifndef CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_ 1794diff --git a/src/cef/include/capi/cef_find_handler_capi.h b/src/cef/include/capi/cef_find_handler_capi.h 1795index fd8a317f67416..10a9c854e67f5 1796--- a/src/cef/include/capi/cef_find_handler_capi.h 1797+++ b/src/cef/include/capi/cef_find_handler_capi.h 1798@@ -1,4 +1,4 @@ 1799-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1800+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1801 // 1802 // Redistribution and use in source and binary forms, with or without 1803 // modification, are permitted provided that the following conditions are 1804@@ -33,7 +33,7 @@ 1805 // by hand. See the translator.README.txt file in the tools directory for 1806 // more information. 1807 // 1808-// $hash=f2e80b8637b07f19adea666e554269de4627e399$ 1809+// $hash=25230ddd8f70b87fd98ba72581e99c3428344f89$ 1810 // 1811 1812 #ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ 1813diff --git a/src/cef/include/capi/cef_focus_handler_capi.h b/src/cef/include/capi/cef_focus_handler_capi.h 1814index 16159861500c2..bfb7fbf286e74 1815--- a/src/cef/include/capi/cef_focus_handler_capi.h 1816+++ b/src/cef/include/capi/cef_focus_handler_capi.h 1817@@ -1,4 +1,4 @@ 1818-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1819+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1820 // 1821 // Redistribution and use in source and binary forms, with or without 1822 // modification, are permitted provided that the following conditions are 1823@@ -33,7 +33,7 @@ 1824 // by hand. See the translator.README.txt file in the tools directory for 1825 // more information. 1826 // 1827-// $hash=a136a2679c8af339b21a89e8ae3090a9dbb8daa7$ 1828+// $hash=dd317f470d2f7096459be0c0fc2cadfd483633b0$ 1829 // 1830 1831 #ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ 1832diff --git a/src/cef/include/capi/cef_frame_capi.h b/src/cef/include/capi/cef_frame_capi.h 1833index 87910b5455b8b..b89a458a1b735 1834--- a/src/cef/include/capi/cef_frame_capi.h 1835+++ b/src/cef/include/capi/cef_frame_capi.h 1836@@ -1,4 +1,4 @@ 1837-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1838+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1839 // 1840 // Redistribution and use in source and binary forms, with or without 1841 // modification, are permitted provided that the following conditions are 1842@@ -33,7 +33,7 @@ 1843 // by hand. See the translator.README.txt file in the tools directory for 1844 // more information. 1845 // 1846-// $hash=96a0878ed40f8901085fa666e46ce49a7ab8eaa9$ 1847+// $hash=1f592012807b171ad5177d991d53c972559ea56a$ 1848 // 1849 1850 #ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ 1851@@ -52,6 +52,7 @@ extern "C" { 1852 #endif 1853 1854 struct _cef_browser_t; 1855+struct _cef_get_images_callback_t; 1856 struct _cef_urlrequest_client_t; 1857 struct _cef_urlrequest_t; 1858 struct _cef_v8context_t; 1859@@ -265,8 +266,32 @@ typedef struct _cef_frame_t { 1860 struct _cef_frame_t* self, 1861 cef_process_id_t target_process, 1862 struct _cef_process_message_t* message); 1863+ 1864+ /// 1865+ // web has image or not 1866+ /// 1867+ void(CEF_CALLBACK* get_images)(struct _cef_frame_t* self, 1868+ struct _cef_get_images_callback_t* callback); 1869 } cef_frame_t; 1870 1871+/// 1872+// Structure to implement to be notified of asynchronous completion via 1873+// cef_frame_tHostImpl::GetImages. 1874+/// 1875+typedef struct _cef_get_images_callback_t { 1876+ /// 1877+ // Base structure. 1878+ /// 1879+ cef_base_ref_counted_t base; 1880+ 1881+ /// 1882+ // Method that will be called upon completion. |num_deleted| will be the 1883+ // number of cookies that were deleted. 1884+ /// 1885+ void(CEF_CALLBACK* get_images)(struct _cef_get_images_callback_t* self, 1886+ int response); 1887+} cef_get_images_callback_t; 1888+ 1889 #ifdef __cplusplus 1890 } 1891 #endif 1892diff --git a/src/cef/include/capi/cef_frame_handler_capi.h b/src/cef/include/capi/cef_frame_handler_capi.h 1893index 1352ee28f56a6..8b69fd73e6d5c 1894--- a/src/cef/include/capi/cef_frame_handler_capi.h 1895+++ b/src/cef/include/capi/cef_frame_handler_capi.h 1896@@ -1,4 +1,4 @@ 1897-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1898+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1899 // 1900 // Redistribution and use in source and binary forms, with or without 1901 // modification, are permitted provided that the following conditions are 1902@@ -33,7 +33,7 @@ 1903 // by hand. See the translator.README.txt file in the tools directory for 1904 // more information. 1905 // 1906-// $hash=8f791b2d1d5bea27f9e6ca5e0db731a0a76d181c$ 1907+// $hash=3d27496e328f3e76fb05bde7b0da65563604c073$ 1908 // 1909 1910 #ifndef CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_ 1911diff --git a/src/cef/include/capi/cef_i18n_util_capi.h b/src/cef/include/capi/cef_i18n_util_capi.h 1912index 7a642b28a77a3..c6ceba4b8b419 1913--- a/src/cef/include/capi/cef_i18n_util_capi.h 1914+++ b/src/cef/include/capi/cef_i18n_util_capi.h 1915@@ -1,4 +1,4 @@ 1916-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1917+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1918 // 1919 // Redistribution and use in source and binary forms, with or without 1920 // modification, are permitted provided that the following conditions are 1921@@ -33,7 +33,7 @@ 1922 // by hand. See the translator.README.txt file in the tools directory for 1923 // more information. 1924 // 1925-// $hash=b6168013910802cf6d7603892741385958026dcd$ 1926+// $hash=4fa59a60e9138f66bf3f290a499f7fc5a69041ae$ 1927 // 1928 1929 #ifndef CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_ 1930diff --git a/src/cef/include/capi/cef_image_capi.h b/src/cef/include/capi/cef_image_capi.h 1931index 99af056297923..56cdb4c4fc8e8 1932--- a/src/cef/include/capi/cef_image_capi.h 1933+++ b/src/cef/include/capi/cef_image_capi.h 1934@@ -1,4 +1,4 @@ 1935-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1936+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1937 // 1938 // Redistribution and use in source and binary forms, with or without 1939 // modification, are permitted provided that the following conditions are 1940@@ -33,7 +33,7 @@ 1941 // by hand. See the translator.README.txt file in the tools directory for 1942 // more information. 1943 // 1944-// $hash=b5a36ef39ff250c9d3cb1e9a8c7ee38d7e0f8b3f$ 1945+// $hash=51ec70e713506e02d7157fc9d8268d02e91d80a3$ 1946 // 1947 1948 #ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_ 1949diff --git a/src/cef/include/capi/cef_jsdialog_handler_capi.h b/src/cef/include/capi/cef_jsdialog_handler_capi.h 1950index c0ab4497edc9e..15d43781582a9 1951--- a/src/cef/include/capi/cef_jsdialog_handler_capi.h 1952+++ b/src/cef/include/capi/cef_jsdialog_handler_capi.h 1953@@ -1,4 +1,4 @@ 1954-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1955+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1956 // 1957 // Redistribution and use in source and binary forms, with or without 1958 // modification, are permitted provided that the following conditions are 1959@@ -33,7 +33,7 @@ 1960 // by hand. See the translator.README.txt file in the tools directory for 1961 // more information. 1962 // 1963-// $hash=c68332a779bab425aa2e6a858d20a43448631890$ 1964+// $hash=f8dc9d32c3f345e1c3b7d02a098bebaafad7e81f$ 1965 // 1966 1967 #ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ 1968diff --git a/src/cef/include/capi/cef_keyboard_handler_capi.h b/src/cef/include/capi/cef_keyboard_handler_capi.h 1969index 3d6c50fc38e3e..cf3746dcc8b52 1970--- a/src/cef/include/capi/cef_keyboard_handler_capi.h 1971+++ b/src/cef/include/capi/cef_keyboard_handler_capi.h 1972@@ -1,4 +1,4 @@ 1973-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1974+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1975 // 1976 // Redistribution and use in source and binary forms, with or without 1977 // modification, are permitted provided that the following conditions are 1978@@ -33,7 +33,7 @@ 1979 // by hand. See the translator.README.txt file in the tools directory for 1980 // more information. 1981 // 1982-// $hash=140d3a3ce78f5e8ab50a24a2fd6377e7a8ea3256$ 1983+// $hash=4ef92123de5221aa1ad5959d004e293d6a966fbd$ 1984 // 1985 1986 #ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ 1987diff --git a/src/cef/include/capi/cef_life_span_handler_capi.h b/src/cef/include/capi/cef_life_span_handler_capi.h 1988index c5e09131cbad3..e1db2aa4605e3 1989--- a/src/cef/include/capi/cef_life_span_handler_capi.h 1990+++ b/src/cef/include/capi/cef_life_span_handler_capi.h 1991@@ -1,4 +1,4 @@ 1992-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1993+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 1994 // 1995 // Redistribution and use in source and binary forms, with or without 1996 // modification, are permitted provided that the following conditions are 1997@@ -33,7 +33,7 @@ 1998 // by hand. See the translator.README.txt file in the tools directory for 1999 // more information. 2000 // 2001-// $hash=205d56bf87a049ce7ac21b111d42a99659ad7c76$ 2002+// $hash=f9ae882bb6092d1f94b7c78dc6b45369c8b0ec2e$ 2003 // 2004 2005 #ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ 2006diff --git a/src/cef/include/capi/cef_load_handler_capi.h b/src/cef/include/capi/cef_load_handler_capi.h 2007index 317444b6f19f7..e8f8e10193d2f 2008--- a/src/cef/include/capi/cef_load_handler_capi.h 2009+++ b/src/cef/include/capi/cef_load_handler_capi.h 2010@@ -1,4 +1,4 @@ 2011-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2012+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2013 // 2014 // Redistribution and use in source and binary forms, with or without 2015 // modification, are permitted provided that the following conditions are 2016@@ -33,7 +33,7 @@ 2017 // by hand. See the translator.README.txt file in the tools directory for 2018 // more information. 2019 // 2020-// $hash=812538f84d327ea24469bcfc50957df699dc6edd$ 2021+// $hash=bf5522dc1385a750cad8b9197a588045beaaba58$ 2022 // 2023 2024 #ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ 2025diff --git a/src/cef/include/capi/cef_menu_model_capi.h b/src/cef/include/capi/cef_menu_model_capi.h 2026index a1f7920ce974e..6b260824da7c7 2027--- a/src/cef/include/capi/cef_menu_model_capi.h 2028+++ b/src/cef/include/capi/cef_menu_model_capi.h 2029@@ -1,4 +1,4 @@ 2030-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2031+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2032 // 2033 // Redistribution and use in source and binary forms, with or without 2034 // modification, are permitted provided that the following conditions are 2035@@ -33,7 +33,7 @@ 2036 // by hand. See the translator.README.txt file in the tools directory for 2037 // more information. 2038 // 2039-// $hash=9f30f2caa9eedc0d4fe963dbf0127602ffcbec61$ 2040+// $hash=a64d72dbd200dfb6a03a2a370b756e559422e97f$ 2041 // 2042 2043 #ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ 2044diff --git a/src/cef/include/capi/cef_menu_model_delegate_capi.h b/src/cef/include/capi/cef_menu_model_delegate_capi.h 2045index bd4628568f266..a0b114e251387 2046--- a/src/cef/include/capi/cef_menu_model_delegate_capi.h 2047+++ b/src/cef/include/capi/cef_menu_model_delegate_capi.h 2048@@ -1,4 +1,4 @@ 2049-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2050+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2051 // 2052 // Redistribution and use in source and binary forms, with or without 2053 // modification, are permitted provided that the following conditions are 2054@@ -33,7 +33,7 @@ 2055 // by hand. See the translator.README.txt file in the tools directory for 2056 // more information. 2057 // 2058-// $hash=bdb670bcaa9eb9f5748900ad25bcc061155d6076$ 2059+// $hash=5525030c1b87ab3430a11e7e12db71505531f548$ 2060 // 2061 2062 #ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_ 2063diff --git a/src/cef/include/capi/cef_navigation_entry_capi.h b/src/cef/include/capi/cef_navigation_entry_capi.h 2064index 4d4e07f10dd81..e1202c0483f95 2065--- a/src/cef/include/capi/cef_navigation_entry_capi.h 2066+++ b/src/cef/include/capi/cef_navigation_entry_capi.h 2067@@ -1,4 +1,4 @@ 2068-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2069+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2070 // 2071 // Redistribution and use in source and binary forms, with or without 2072 // modification, are permitted provided that the following conditions are 2073@@ -33,7 +33,7 @@ 2074 // by hand. See the translator.README.txt file in the tools directory for 2075 // more information. 2076 // 2077-// $hash=3a7dd4a6a1b5e0d9191be6c4dd2f0135f43de643$ 2078+// $hash=0e0d367fabdb12792de5ba8c588fe4bbc035b7a9$ 2079 // 2080 2081 #ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ 2082@@ -123,6 +123,16 @@ typedef struct _cef_navigation_entry_t { 2083 /// 2084 struct _cef_sslstatus_t*(CEF_CALLBACK* get_sslstatus)( 2085 struct _cef_navigation_entry_t* self); 2086+ 2087+ /// 2088+ // Return favicon for this navigation entry. 2089+ /// 2090+ int(CEF_CALLBACK* get_favicon)(struct _cef_navigation_entry_t* self, 2091+ void** pixel_data, 2092+ int* color_type, 2093+ int* alpha_type, 2094+ int* pixel_width, 2095+ int* pixel_height); 2096 } cef_navigation_entry_t; 2097 2098 #ifdef __cplusplus 2099diff --git a/src/cef/include/capi/cef_origin_whitelist_capi.h b/src/cef/include/capi/cef_origin_whitelist_capi.h 2100index 563bbdd2cd239..ca47638d2f2e1 2101--- a/src/cef/include/capi/cef_origin_whitelist_capi.h 2102+++ b/src/cef/include/capi/cef_origin_whitelist_capi.h 2103@@ -1,4 +1,4 @@ 2104-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2105+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2106 // 2107 // Redistribution and use in source and binary forms, with or without 2108 // modification, are permitted provided that the following conditions are 2109@@ -33,7 +33,7 @@ 2110 // by hand. See the translator.README.txt file in the tools directory for 2111 // more information. 2112 // 2113-// $hash=0939a44345bea8df7ca5f1dbd6afbe41972121f2$ 2114+// $hash=41e29ffa7778537b0bfec9d7094babf6b3f6db69$ 2115 // 2116 2117 #ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ 2118diff --git a/src/cef/include/capi/cef_parser_capi.h b/src/cef/include/capi/cef_parser_capi.h 2119index d3ec0ee5d4eb5..37d43cf8f12ac 2120--- a/src/cef/include/capi/cef_parser_capi.h 2121+++ b/src/cef/include/capi/cef_parser_capi.h 2122@@ -1,4 +1,4 @@ 2123-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2124+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2125 // 2126 // Redistribution and use in source and binary forms, with or without 2127 // modification, are permitted provided that the following conditions are 2128@@ -33,7 +33,7 @@ 2129 // by hand. See the translator.README.txt file in the tools directory for 2130 // more information. 2131 // 2132-// $hash=f5e1c0fc43c6e85dbafa66975d9dc5e2bc7be69f$ 2133+// $hash=de8e3f97b060588604ec89b3cb5e2ddcd9e11499$ 2134 // 2135 2136 #ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_ 2137diff --git a/src/cef/include/capi/cef_path_util_capi.h b/src/cef/include/capi/cef_path_util_capi.h 2138index 3cbb3ba4b01d0..c49b5a0bc3be1 2139--- a/src/cef/include/capi/cef_path_util_capi.h 2140+++ b/src/cef/include/capi/cef_path_util_capi.h 2141@@ -1,4 +1,4 @@ 2142-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2143+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2144 // 2145 // Redistribution and use in source and binary forms, with or without 2146 // modification, are permitted provided that the following conditions are 2147@@ -33,7 +33,7 @@ 2148 // by hand. See the translator.README.txt file in the tools directory for 2149 // more information. 2150 // 2151-// $hash=41ddd04d4efb147b05eb93816af1591ec3b61b76$ 2152+// $hash=9955c85f6282d1ee103791206079c1d2100ab7be$ 2153 // 2154 2155 #ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ 2156diff --git a/src/cef/include/capi/cef_permission_request_capi.h b/src/cef/include/capi/cef_permission_request_capi.h 2157index 33c483a4c2b1e..f056f4d95be1d 2158--- a/src/cef/include/capi/cef_permission_request_capi.h 2159+++ b/src/cef/include/capi/cef_permission_request_capi.h 2160@@ -1,4 +1,4 @@ 2161-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2162+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2163 // 2164 // Redistribution and use in source and binary forms, with or without 2165 // modification, are permitted provided that the following conditions are 2166@@ -33,7 +33,7 @@ 2167 // by hand. See the translator.README.txt file in the tools directory for 2168 // more information. 2169 // 2170-// $hash=e930f6445aaeb80ff2f6b1a3077d7d0d4bbd7109$ 2171+// $hash=51af1ce96096db7ed212692b5915a74a18e0222d$ 2172 // 2173 2174 #ifndef CEF_INCLUDE_CAPI_CEF_PERMISSION_REQUEST_CAPI_H_ 2175@@ -60,18 +60,18 @@ typedef struct _cef_access_request_t { 2176 // Get the origin that is trying to acess the resource. 2177 /// 2178 // The resulting string must be freed by calling cef_string_userfree_free(). 2179- cef_string_userfree_t(CEF_CALLBACK *origin)( 2180- struct _cef_access_request_t *self); 2181+ cef_string_userfree_t(CEF_CALLBACK* origin)( 2182+ struct _cef_access_request_t* self); 2183 2184 /// 2185 // Get the resource that the origin is trying to acess. 2186 /// 2187- int(CEF_CALLBACK *resource_acess_id)(struct _cef_access_request_t *self); 2188+ int(CEF_CALLBACK* resource_acess_id)(struct _cef_access_request_t* self); 2189 2190 /// 2191 // Report whether the origin is allowed to acess the resource. 2192 /// 2193- void(CEF_CALLBACK *report_request_result)(struct _cef_access_request_t *self, 2194+ void(CEF_CALLBACK* report_request_result)(struct _cef_access_request_t* self, 2195 int allowed); 2196 } cef_access_request_t; 2197 2198@@ -90,14 +90,15 @@ typedef struct _cef_permission_request_t { 2199 // set for that origin. The host application should invoke the specified 2200 // callback with the desired permission state. 2201 /// 2202- void(CEF_CALLBACK *on_geolocation_show)( 2203- struct _cef_permission_request_t *self, const cef_string_t *origin); 2204+ void(CEF_CALLBACK* on_geolocation_show)( 2205+ struct _cef_permission_request_t* self, 2206+ const cef_string_t* origin); 2207 2208 /// 2209 // Revert the operation in the OnGeolocationShow. 2210 /// 2211- void(CEF_CALLBACK *on_geolocation_hide)( 2212- struct _cef_permission_request_t *self); 2213+ void(CEF_CALLBACK* on_geolocation_hide)( 2214+ struct _cef_permission_request_t* self); 2215 2216 /// 2217 // Notify the host application that web content from the specified origin is 2218@@ -105,16 +106,16 @@ typedef struct _cef_permission_request_t { 2219 // set for that origin. The host application should invoke the specified 2220 // callback with the desired permission state. 2221 /// 2222- void(CEF_CALLBACK *on_permission_request)( 2223- struct _cef_permission_request_t *self, 2224- struct _cef_access_request_t *request); 2225+ void(CEF_CALLBACK* on_permission_request)( 2226+ struct _cef_permission_request_t* self, 2227+ struct _cef_access_request_t* request); 2228 2229 /// 2230 // Revert the operation in the OnPermissionRequest. 2231 /// 2232- void(CEF_CALLBACK *on_permission_request_canceled)( 2233- struct _cef_permission_request_t *self, 2234- struct _cef_access_request_t *request); 2235+ void(CEF_CALLBACK* on_permission_request_canceled)( 2236+ struct _cef_permission_request_t* self, 2237+ struct _cef_access_request_t* request); 2238 } cef_permission_request_t; 2239 2240 /// 2241@@ -129,51 +130,55 @@ typedef struct _cef_browser_permission_request_delegate_t { 2242 /// 2243 // Handle the Geolocation permission requests. 2244 /// 2245- void(CEF_CALLBACK *ask_geolocation_permission)( 2246- struct _cef_browser_permission_request_delegate_t *self, 2247- const cef_string_t *origin, cef_permission_callback_t callback); 2248+ void(CEF_CALLBACK* ask_geolocation_permission)( 2249+ struct _cef_browser_permission_request_delegate_t* self, 2250+ const cef_string_t* origin, 2251+ cef_permission_callback_t callback); 2252 2253 /// 2254 // Cancel the Geolocation permission requests. 2255 /// 2256- void(CEF_CALLBACK *abort_ask_geolocation_permission)( 2257- struct _cef_browser_permission_request_delegate_t *self, 2258- const cef_string_t *origin); 2259+ void(CEF_CALLBACK* abort_ask_geolocation_permission)( 2260+ struct _cef_browser_permission_request_delegate_t* self, 2261+ const cef_string_t* origin); 2262 2263 /// 2264 // Handle the Protected Media Identifier permission requests. 2265 /// 2266- void(CEF_CALLBACK *ask_protected_media_identifier_permission)( 2267- struct _cef_browser_permission_request_delegate_t *self, 2268- const cef_string_t *origin, cef_permission_callback_t callback); 2269+ void(CEF_CALLBACK* ask_protected_media_identifier_permission)( 2270+ struct _cef_browser_permission_request_delegate_t* self, 2271+ const cef_string_t* origin, 2272+ cef_permission_callback_t callback); 2273 2274 /// 2275 // Cancel the Protected Media Identifier permission requests. 2276 /// 2277- void(CEF_CALLBACK *abort_ask_protected_media_identifier_permission)( 2278- struct _cef_browser_permission_request_delegate_t *self, 2279- const cef_string_t *origin); 2280+ void(CEF_CALLBACK* abort_ask_protected_media_identifier_permission)( 2281+ struct _cef_browser_permission_request_delegate_t* self, 2282+ const cef_string_t* origin); 2283 2284 /// 2285 // Handle the MIDI Sysex permission requests. 2286 /// 2287- void(CEF_CALLBACK *ask_midisysex_permission)( 2288- struct _cef_browser_permission_request_delegate_t *self, 2289- const cef_string_t *origin, cef_permission_callback_t callback); 2290+ void(CEF_CALLBACK* ask_midisysex_permission)( 2291+ struct _cef_browser_permission_request_delegate_t* self, 2292+ const cef_string_t* origin, 2293+ cef_permission_callback_t callback); 2294 2295 /// 2296 // Cancel the MIDI Sysex permission requests. 2297 /// 2298- void(CEF_CALLBACK *abort_ask_midisysex_permission)( 2299- struct _cef_browser_permission_request_delegate_t *self, 2300- const cef_string_t *origin); 2301+ void(CEF_CALLBACK* abort_ask_midisysex_permission)( 2302+ struct _cef_browser_permission_request_delegate_t* self, 2303+ const cef_string_t* origin); 2304 2305 /// 2306 // The callback for the Geolocation permission requests. 2307 /// 2308- void(CEF_CALLBACK *notify_geolocation_permission)( 2309- struct _cef_browser_permission_request_delegate_t *self, int value, 2310- const cef_string_t *origin); 2311+ void(CEF_CALLBACK* notify_geolocation_permission)( 2312+ struct _cef_browser_permission_request_delegate_t* self, 2313+ int value, 2314+ const cef_string_t* origin); 2315 } cef_browser_permission_request_delegate_t; 2316 2317 /// 2318@@ -190,32 +195,33 @@ typedef struct _cef_geolocation_acess_t { 2319 // Return true (1) if the geolocation permission state is set for the 2320 // specified origin. 2321 /// 2322- int(CEF_CALLBACK *contain_origin)(struct _cef_geolocation_acess_t *self, 2323- const cef_string_t *origin); 2324+ int(CEF_CALLBACK* contain_origin)(struct _cef_geolocation_acess_t* self, 2325+ const cef_string_t* origin); 2326 2327 /// 2328 // Return true (1) if the geolocation permission state set for the specified 2329 // origin is true (1). 2330 /// 2331- int(CEF_CALLBACK *is_origin_access_enabled)( 2332- struct _cef_geolocation_acess_t *self, const cef_string_t *origin); 2333+ int(CEF_CALLBACK* is_origin_access_enabled)( 2334+ struct _cef_geolocation_acess_t* self, 2335+ const cef_string_t* origin); 2336 2337 /// 2338 // Set the geolocation permission state to true (1) for the specified origin. 2339 /// 2340- void(CEF_CALLBACK *enabled)(struct _cef_geolocation_acess_t *self, 2341- const cef_string_t *origin); 2342+ void(CEF_CALLBACK* enabled)(struct _cef_geolocation_acess_t* self, 2343+ const cef_string_t* origin); 2344 2345 /// 2346 // Set the geolocation permission state to false (0) for the specified 2347 // origin. 2348 /// 2349- void(CEF_CALLBACK *disabled)(struct _cef_geolocation_acess_t *self, 2350- const cef_string_t *origin); 2351+ void(CEF_CALLBACK* disabled)(struct _cef_geolocation_acess_t* self, 2352+ const cef_string_t* origin); 2353 } cef_geolocation_acess_t; 2354 2355 #ifdef __cplusplus 2356 } 2357 #endif 2358 2359-#endif // CEF_INCLUDE_CAPI_CEF_PERMISSION_REQUEST_CAPI_H_ 2360+#endif // CEF_INCLUDE_CAPI_CEF_PERMISSION_REQUEST_CAPI_H_ 2361diff --git a/src/cef/include/capi/cef_print_handler_capi.h b/src/cef/include/capi/cef_print_handler_capi.h 2362index df321dea177b1..0563268bfb5e9 2363--- a/src/cef/include/capi/cef_print_handler_capi.h 2364+++ b/src/cef/include/capi/cef_print_handler_capi.h 2365@@ -1,4 +1,4 @@ 2366-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2367+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2368 // 2369 // Redistribution and use in source and binary forms, with or without 2370 // modification, are permitted provided that the following conditions are 2371@@ -33,7 +33,7 @@ 2372 // by hand. See the translator.README.txt file in the tools directory for 2373 // more information. 2374 // 2375-// $hash=e26be3efc18d8c79d019c02b1d73a7ec2866b142$ 2376+// $hash=3a9d7294c9a4c3aeafe1231c7a3ba5afd7fad0b5$ 2377 // 2378 2379 #ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ 2380diff --git a/src/cef/include/capi/cef_print_settings_capi.h b/src/cef/include/capi/cef_print_settings_capi.h 2381index e611abfd47243..2b776c142d53a 2382--- a/src/cef/include/capi/cef_print_settings_capi.h 2383+++ b/src/cef/include/capi/cef_print_settings_capi.h 2384@@ -1,4 +1,4 @@ 2385-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2386+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2387 // 2388 // Redistribution and use in source and binary forms, with or without 2389 // modification, are permitted provided that the following conditions are 2390@@ -33,7 +33,7 @@ 2391 // by hand. See the translator.README.txt file in the tools directory for 2392 // more information. 2393 // 2394-// $hash=fdbd26f9dd20dbd7813fc17a8c34650b2da19581$ 2395+// $hash=eef0d62c1e839660037f32600f5a396d3dce3019$ 2396 // 2397 2398 #ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ 2399diff --git a/src/cef/include/capi/cef_process_message_capi.h b/src/cef/include/capi/cef_process_message_capi.h 2400index b87770ba48738..206ea501212be 2401--- a/src/cef/include/capi/cef_process_message_capi.h 2402+++ b/src/cef/include/capi/cef_process_message_capi.h 2403@@ -1,4 +1,4 @@ 2404-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2405+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2406 // 2407 // Redistribution and use in source and binary forms, with or without 2408 // modification, are permitted provided that the following conditions are 2409@@ -33,7 +33,7 @@ 2410 // by hand. See the translator.README.txt file in the tools directory for 2411 // more information. 2412 // 2413-// $hash=2549ea10cd3a41bc04ab81bad24eb12787de68b9$ 2414+// $hash=12e4604521c186e03d984931e66613d33fc32ffd$ 2415 // 2416 2417 #ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ 2418diff --git a/src/cef/include/capi/cef_process_util_capi.h b/src/cef/include/capi/cef_process_util_capi.h 2419index f22dd7e8ab6e4..3f609f440eb2f 2420--- a/src/cef/include/capi/cef_process_util_capi.h 2421+++ b/src/cef/include/capi/cef_process_util_capi.h 2422@@ -1,4 +1,4 @@ 2423-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2424+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2425 // 2426 // Redistribution and use in source and binary forms, with or without 2427 // modification, are permitted provided that the following conditions are 2428@@ -33,7 +33,7 @@ 2429 // by hand. See the translator.README.txt file in the tools directory for 2430 // more information. 2431 // 2432-// $hash=1f2b752c4e314b240ce95cb3b87863c2f99534a8$ 2433+// $hash=230303a48ff28b79f289c199b06a4d3540cb36af$ 2434 // 2435 2436 #ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ 2437diff --git a/src/cef/include/capi/cef_registration_capi.h b/src/cef/include/capi/cef_registration_capi.h 2438index 3285569eb8f08..2bdb0e51830a9 2439--- a/src/cef/include/capi/cef_registration_capi.h 2440+++ b/src/cef/include/capi/cef_registration_capi.h 2441@@ -1,4 +1,4 @@ 2442-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2443+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2444 // 2445 // Redistribution and use in source and binary forms, with or without 2446 // modification, are permitted provided that the following conditions are 2447@@ -33,7 +33,7 @@ 2448 // by hand. See the translator.README.txt file in the tools directory for 2449 // more information. 2450 // 2451-// $hash=d5efa37953d0f0097fef20bc18f4938621c6b168$ 2452+// $hash=9dbe775fa78723fa6695c778fbe8cdbd36b0a888$ 2453 // 2454 2455 #ifndef CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_ 2456diff --git a/src/cef/include/capi/cef_render_handler_capi.h b/src/cef/include/capi/cef_render_handler_capi.h 2457index 605ec1c02ceb2..16c82b8fa0c46 2458--- a/src/cef/include/capi/cef_render_handler_capi.h 2459+++ b/src/cef/include/capi/cef_render_handler_capi.h 2460@@ -1,4 +1,4 @@ 2461-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2462+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2463 // 2464 // Redistribution and use in source and binary forms, with or without 2465 // modification, are permitted provided that the following conditions are 2466@@ -33,7 +33,7 @@ 2467 // by hand. See the translator.README.txt file in the tools directory for 2468 // more information. 2469 // 2470-// $hash=50df1cb9393d36c975aecddb2775ada0d8b9eeec$ 2471+// $hash=3a236866417ec98ad3fb5f325b07250a31c0183c$ 2472 // 2473 2474 #ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ 2475diff --git a/src/cef/include/capi/cef_render_process_handler_capi.h b/src/cef/include/capi/cef_render_process_handler_capi.h 2476index 2fea446ebe519..1ab59d126d5b1 2477--- a/src/cef/include/capi/cef_render_process_handler_capi.h 2478+++ b/src/cef/include/capi/cef_render_process_handler_capi.h 2479@@ -1,4 +1,4 @@ 2480-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2481+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2482 // 2483 // Redistribution and use in source and binary forms, with or without 2484 // modification, are permitted provided that the following conditions are 2485@@ -33,7 +33,7 @@ 2486 // by hand. See the translator.README.txt file in the tools directory for 2487 // more information. 2488 // 2489-// $hash=0b8abb0e55cb56fcb778ced72a61a108c2b28011$ 2490+// $hash=5827d7a0ee7343daab5fc2a36bdbfabb9d85bb37$ 2491 // 2492 2493 #ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ 2494diff --git a/src/cef/include/capi/cef_request_capi.h b/src/cef/include/capi/cef_request_capi.h 2495index 3ddd18fef51ce..66d1721d93be6 2496--- a/src/cef/include/capi/cef_request_capi.h 2497+++ b/src/cef/include/capi/cef_request_capi.h 2498@@ -1,4 +1,4 @@ 2499-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2500+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2501 // 2502 // Redistribution and use in source and binary forms, with or without 2503 // modification, are permitted provided that the following conditions are 2504@@ -33,7 +33,7 @@ 2505 // by hand. See the translator.README.txt file in the tools directory for 2506 // more information. 2507 // 2508-// $hash=47b361878452f2a94e559782913d80beb0dba25a$ 2509+// $hash=77ebea253e3607ed44c60791bb461a202d95c222$ 2510 // 2511 2512 #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ 2513diff --git a/src/cef/include/capi/cef_request_context_capi.h b/src/cef/include/capi/cef_request_context_capi.h 2514index 857f918122f6e..28508ef72433d 2515--- a/src/cef/include/capi/cef_request_context_capi.h 2516+++ b/src/cef/include/capi/cef_request_context_capi.h 2517@@ -1,4 +1,4 @@ 2518-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2519+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2520 // 2521 // Redistribution and use in source and binary forms, with or without 2522 // modification, are permitted provided that the following conditions are 2523@@ -33,7 +33,7 @@ 2524 // by hand. See the translator.README.txt file in the tools directory for 2525 // more information. 2526 // 2527-// $hash=d2ccf65028b87821b92eda7e8d715ec98f8e1623$ 2528+// $hash=c6c04067690990978ca3bbbbc6ddd6f5a0186f91$ 2529 // 2530 2531 #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ 2532@@ -45,7 +45,6 @@ 2533 #include "include/capi/cef_data_base_capi.h" 2534 #include "include/capi/cef_extension_capi.h" 2535 #include "include/capi/cef_extension_handler_capi.h" 2536-#include "include/capi/cef_media_router_capi.h" 2537 #include "include/capi/cef_values_capi.h" 2538 #include "include/capi/cef_web_storage_capi.h" 2539 2540@@ -370,15 +369,6 @@ typedef struct _cef_request_context_t { 2541 struct _cef_extension_t*(CEF_CALLBACK* get_extension)( 2542 struct _cef_request_context_t* self, 2543 const cef_string_t* extension_id); 2544- 2545- /// 2546- // Returns the MediaRouter object associated with this context. If |callback| 2547- // is non-NULL it will be executed asnychronously on the UI thread after the 2548- // manager's context has been initialized. 2549- /// 2550- struct _cef_media_router_t*(CEF_CALLBACK* get_media_router)( 2551- struct _cef_request_context_t* self, 2552- struct _cef_completion_callback_t* callback); 2553 } cef_request_context_t; 2554 2555 /// 2556diff --git a/src/cef/include/capi/cef_request_context_handler_capi.h b/src/cef/include/capi/cef_request_context_handler_capi.h 2557index eb1e08b0c8a5b..1a2bb1d2d2e99 2558--- a/src/cef/include/capi/cef_request_context_handler_capi.h 2559+++ b/src/cef/include/capi/cef_request_context_handler_capi.h 2560@@ -1,4 +1,4 @@ 2561-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2562+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2563 // 2564 // Redistribution and use in source and binary forms, with or without 2565 // modification, are permitted provided that the following conditions are 2566@@ -33,7 +33,7 @@ 2567 // by hand. See the translator.README.txt file in the tools directory for 2568 // more information. 2569 // 2570-// $hash=b44d320d5cceb5022543e8154170b8d276628c76$ 2571+// $hash=f517370ae17962732a0894555330fd002860b83a$ 2572 // 2573 2574 #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ 2575@@ -45,12 +45,13 @@ 2576 #include "include/capi/cef_frame_capi.h" 2577 #include "include/capi/cef_request_capi.h" 2578 #include "include/capi/cef_resource_request_handler_capi.h" 2579-#include "include/capi/cef_web_plugin_capi.h" 2580 2581 #ifdef __cplusplus 2582 extern "C" { 2583 #endif 2584 2585+// #include "include/cef_web_plugin.h" // !enable_plugins 2586+ 2587 /// 2588 // Implement this structure to provide handler implementations. The handler 2589 // instance will not be released until all objects related to the context have 2590diff --git a/src/cef/include/capi/cef_request_handler_capi.h b/src/cef/include/capi/cef_request_handler_capi.h 2591index a5daa4db861ba..d55682ebb3f26 2592--- a/src/cef/include/capi/cef_request_handler_capi.h 2593+++ b/src/cef/include/capi/cef_request_handler_capi.h 2594@@ -1,4 +1,4 @@ 2595-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2596+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2597 // 2598 // Redistribution and use in source and binary forms, with or without 2599 // modification, are permitted provided that the following conditions are 2600@@ -33,7 +33,7 @@ 2601 // by hand. See the translator.README.txt file in the tools directory for 2602 // more information. 2603 // 2604-// $hash=0a47add5335ff2d73e08d1e491f2561356f63fcd$ 2605+// $hash=76ffdecdfc2fb8b6956b936d0a5762e4f7b122a1$ 2606 // 2607 2608 #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ 2609diff --git a/src/cef/include/capi/cef_resource_bundle_capi.h b/src/cef/include/capi/cef_resource_bundle_capi.h 2610index 9e83df4059bfb..e10a539cdc16b 2611--- a/src/cef/include/capi/cef_resource_bundle_capi.h 2612+++ b/src/cef/include/capi/cef_resource_bundle_capi.h 2613@@ -1,4 +1,4 @@ 2614-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2615+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2616 // 2617 // Redistribution and use in source and binary forms, with or without 2618 // modification, are permitted provided that the following conditions are 2619@@ -33,7 +33,7 @@ 2620 // by hand. See the translator.README.txt file in the tools directory for 2621 // more information. 2622 // 2623-// $hash=a9e35ca17785f77666db7650208cacfd9a85c3e0$ 2624+// $hash=d45529ccb797163f6ff0b790d4959e7644355a8b$ 2625 // 2626 2627 #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_ 2628diff --git a/src/cef/include/capi/cef_resource_bundle_handler_capi.h b/src/cef/include/capi/cef_resource_bundle_handler_capi.h 2629index a72d6dffd3f87..c025ec51f7998 2630--- a/src/cef/include/capi/cef_resource_bundle_handler_capi.h 2631+++ b/src/cef/include/capi/cef_resource_bundle_handler_capi.h 2632@@ -1,4 +1,4 @@ 2633-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2634+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2635 // 2636 // Redistribution and use in source and binary forms, with or without 2637 // modification, are permitted provided that the following conditions are 2638@@ -33,7 +33,7 @@ 2639 // by hand. See the translator.README.txt file in the tools directory for 2640 // more information. 2641 // 2642-// $hash=3d7b3d4702c8d35dc8780f9e87eb7560d6ce1dee$ 2643+// $hash=0436aa15546615fe9252d46ea89887ec59c0e85d$ 2644 // 2645 2646 #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ 2647diff --git a/src/cef/include/capi/cef_resource_handler_capi.h b/src/cef/include/capi/cef_resource_handler_capi.h 2648index 4c581cb71fb09..e73f1484e1fec 2649--- a/src/cef/include/capi/cef_resource_handler_capi.h 2650+++ b/src/cef/include/capi/cef_resource_handler_capi.h 2651@@ -1,4 +1,4 @@ 2652-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2653+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2654 // 2655 // Redistribution and use in source and binary forms, with or without 2656 // modification, are permitted provided that the following conditions are 2657@@ -33,7 +33,7 @@ 2658 // by hand. See the translator.README.txt file in the tools directory for 2659 // more information. 2660 // 2661-// $hash=67df3d56f0cc0f58d2b0a2fe884bbb2c1c39813f$ 2662+// $hash=443ce8d80b80b55337069a9a118fb0eb645faba3$ 2663 // 2664 2665 #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ 2666diff --git a/src/cef/include/capi/cef_resource_request_handler_capi.h b/src/cef/include/capi/cef_resource_request_handler_capi.h 2667index 1773465c3aa3e..0f06b2f65f44c 2668--- a/src/cef/include/capi/cef_resource_request_handler_capi.h 2669+++ b/src/cef/include/capi/cef_resource_request_handler_capi.h 2670@@ -1,4 +1,4 @@ 2671-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2672+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2673 // 2674 // Redistribution and use in source and binary forms, with or without 2675 // modification, are permitted provided that the following conditions are 2676@@ -33,7 +33,7 @@ 2677 // by hand. See the translator.README.txt file in the tools directory for 2678 // more information. 2679 // 2680-// $hash=3d5c3c54c9f7eedc5cd1dd61c0f69edcd6a1143a$ 2681+// $hash=d95bcd8d70029011eb9e0f2c64febb627939d121$ 2682 // 2683 2684 #ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_ 2685diff --git a/src/cef/include/capi/cef_response_capi.h b/src/cef/include/capi/cef_response_capi.h 2686index d4973e6cdaf75..7e03febd1c38f 2687--- a/src/cef/include/capi/cef_response_capi.h 2688+++ b/src/cef/include/capi/cef_response_capi.h 2689@@ -1,4 +1,4 @@ 2690-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2691+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2692 // 2693 // Redistribution and use in source and binary forms, with or without 2694 // modification, are permitted provided that the following conditions are 2695@@ -33,7 +33,7 @@ 2696 // by hand. See the translator.README.txt file in the tools directory for 2697 // more information. 2698 // 2699-// $hash=6ebf7adcdaee57772810c1528b27140ae95966d0$ 2700+// $hash=0b0b89911503aeb4fc52afa8d0d0f4e103181b6c$ 2701 // 2702 2703 #ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ 2704diff --git a/src/cef/include/capi/cef_response_filter_capi.h b/src/cef/include/capi/cef_response_filter_capi.h 2705index 2267054ca8133..66708ecccb2bc 2706--- a/src/cef/include/capi/cef_response_filter_capi.h 2707+++ b/src/cef/include/capi/cef_response_filter_capi.h 2708@@ -1,4 +1,4 @@ 2709-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2710+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2711 // 2712 // Redistribution and use in source and binary forms, with or without 2713 // modification, are permitted provided that the following conditions are 2714@@ -33,7 +33,7 @@ 2715 // by hand. See the translator.README.txt file in the tools directory for 2716 // more information. 2717 // 2718-// $hash=fb06b9630b95fedb5d202aab7814d914ab7c943b$ 2719+// $hash=557c259e90896df250dafa16c1205a817204dc22$ 2720 // 2721 2722 #ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_ 2723diff --git a/src/cef/include/capi/cef_scheme_capi.h b/src/cef/include/capi/cef_scheme_capi.h 2724index 444506c93f356..fa07fd7691c7a 2725--- a/src/cef/include/capi/cef_scheme_capi.h 2726+++ b/src/cef/include/capi/cef_scheme_capi.h 2727@@ -1,4 +1,4 @@ 2728-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2729+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2730 // 2731 // Redistribution and use in source and binary forms, with or without 2732 // modification, are permitted provided that the following conditions are 2733@@ -33,7 +33,7 @@ 2734 // by hand. See the translator.README.txt file in the tools directory for 2735 // more information. 2736 // 2737-// $hash=df8c46dd19ef6a3964c49d79e770de6e4245e208$ 2738+// $hash=2dd528ca9ff88be60782b87036f464a6bd6e69a5$ 2739 // 2740 2741 #ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ 2742diff --git a/src/cef/include/capi/cef_server_capi.h b/src/cef/include/capi/cef_server_capi.h 2743index a3aa6a64d9ad1..f23b3545406dd 2744--- a/src/cef/include/capi/cef_server_capi.h 2745+++ b/src/cef/include/capi/cef_server_capi.h 2746@@ -1,4 +1,4 @@ 2747-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2748+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2749 // 2750 // Redistribution and use in source and binary forms, with or without 2751 // modification, are permitted provided that the following conditions are 2752@@ -33,7 +33,7 @@ 2753 // by hand. See the translator.README.txt file in the tools directory for 2754 // more information. 2755 // 2756-// $hash=72c2b4f976016cea50e54a386c09a786973c01a3$ 2757+// $hash=58c1f77a5342d836003a2246fcbe501a6f05086b$ 2758 // 2759 2760 #ifndef CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_ 2761diff --git a/src/cef/include/capi/cef_ssl_info_capi.h b/src/cef/include/capi/cef_ssl_info_capi.h 2762index b122a75862ceb..2a76452b3b9fe 2763--- a/src/cef/include/capi/cef_ssl_info_capi.h 2764+++ b/src/cef/include/capi/cef_ssl_info_capi.h 2765@@ -1,4 +1,4 @@ 2766-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2767+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2768 // 2769 // Redistribution and use in source and binary forms, with or without 2770 // modification, are permitted provided that the following conditions are 2771@@ -33,7 +33,7 @@ 2772 // by hand. See the translator.README.txt file in the tools directory for 2773 // more information. 2774 // 2775-// $hash=d72f3b34b4150f29f1491b2c729f4a8afc4a33f4$ 2776+// $hash=9a4618d543430a0818201958879d89a6b082019b$ 2777 // 2778 2779 #ifndef CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_ 2780diff --git a/src/cef/include/capi/cef_ssl_status_capi.h b/src/cef/include/capi/cef_ssl_status_capi.h 2781index 49268b3f2413e..f9467c7c8accf 2782--- a/src/cef/include/capi/cef_ssl_status_capi.h 2783+++ b/src/cef/include/capi/cef_ssl_status_capi.h 2784@@ -1,4 +1,4 @@ 2785-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2786+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2787 // 2788 // Redistribution and use in source and binary forms, with or without 2789 // modification, are permitted provided that the following conditions are 2790@@ -33,7 +33,7 @@ 2791 // by hand. See the translator.README.txt file in the tools directory for 2792 // more information. 2793 // 2794-// $hash=1bc8a73a196fbbb6cec3dd1738b817575b17706d$ 2795+// $hash=60394d189c5dfa8625f7e5fdab03eeda1fce7c5a$ 2796 // 2797 2798 #ifndef CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_ 2799diff --git a/src/cef/include/capi/cef_stream_capi.h b/src/cef/include/capi/cef_stream_capi.h 2800index 3197a5b1f5ddf..357af53881211 2801--- a/src/cef/include/capi/cef_stream_capi.h 2802+++ b/src/cef/include/capi/cef_stream_capi.h 2803@@ -1,4 +1,4 @@ 2804-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2805+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2806 // 2807 // Redistribution and use in source and binary forms, with or without 2808 // modification, are permitted provided that the following conditions are 2809@@ -33,7 +33,7 @@ 2810 // by hand. See the translator.README.txt file in the tools directory for 2811 // more information. 2812 // 2813-// $hash=87f6cad177614ece33d9574f0f2964e5bb97d613$ 2814+// $hash=3c7df6e11c46a966f2bb7d2e751927779ddf4dd2$ 2815 // 2816 2817 #ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ 2818diff --git a/src/cef/include/capi/cef_string_visitor_capi.h b/src/cef/include/capi/cef_string_visitor_capi.h 2819index 4acd1b472ab4e..89499c9ff2e9b 2820--- a/src/cef/include/capi/cef_string_visitor_capi.h 2821+++ b/src/cef/include/capi/cef_string_visitor_capi.h 2822@@ -1,4 +1,4 @@ 2823-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2824+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2825 // 2826 // Redistribution and use in source and binary forms, with or without 2827 // modification, are permitted provided that the following conditions are 2828@@ -33,7 +33,7 @@ 2829 // by hand. See the translator.README.txt file in the tools directory for 2830 // more information. 2831 // 2832-// $hash=398537ec88bfe902c49908db4a549da297594b70$ 2833+// $hash=215af99d25f001165995c9fa88c59d6e8a05f28f$ 2834 // 2835 2836 #ifndef CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ 2837diff --git a/src/cef/include/capi/cef_task_capi.h b/src/cef/include/capi/cef_task_capi.h 2838index 5f6281e1b943b..b9d721b00f254 2839--- a/src/cef/include/capi/cef_task_capi.h 2840+++ b/src/cef/include/capi/cef_task_capi.h 2841@@ -1,4 +1,4 @@ 2842-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2843+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2844 // 2845 // Redistribution and use in source and binary forms, with or without 2846 // modification, are permitted provided that the following conditions are 2847@@ -33,7 +33,7 @@ 2848 // by hand. See the translator.README.txt file in the tools directory for 2849 // more information. 2850 // 2851-// $hash=e943dd2af818e5a5f19f6cbd1648896684c666c6$ 2852+// $hash=be97992f2fd5e08cf5483c55a1db72a74a1fa5c6$ 2853 // 2854 2855 #ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ 2856diff --git a/src/cef/include/capi/cef_thread_capi.h b/src/cef/include/capi/cef_thread_capi.h 2857index 4b99983d5b3ba..5f496f2368f92 2858--- a/src/cef/include/capi/cef_thread_capi.h 2859+++ b/src/cef/include/capi/cef_thread_capi.h 2860@@ -1,4 +1,4 @@ 2861-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2862+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2863 // 2864 // Redistribution and use in source and binary forms, with or without 2865 // modification, are permitted provided that the following conditions are 2866@@ -33,7 +33,7 @@ 2867 // by hand. See the translator.README.txt file in the tools directory for 2868 // more information. 2869 // 2870-// $hash=d99ffc2270c1cf8b0f06dd08c1b6e9b27cee4bc8$ 2871+// $hash=6ef25dfdc109d397dd9ac685605c143ed453843d$ 2872 // 2873 2874 #ifndef CEF_INCLUDE_CAPI_CEF_THREAD_CAPI_H_ 2875diff --git a/src/cef/include/capi/cef_trace_capi.h b/src/cef/include/capi/cef_trace_capi.h 2876index df39462f05228..19792c5ed1145 2877--- a/src/cef/include/capi/cef_trace_capi.h 2878+++ b/src/cef/include/capi/cef_trace_capi.h 2879@@ -1,4 +1,4 @@ 2880-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2881+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2882 // 2883 // Redistribution and use in source and binary forms, with or without 2884 // modification, are permitted provided that the following conditions are 2885@@ -33,7 +33,7 @@ 2886 // by hand. See the translator.README.txt file in the tools directory for 2887 // more information. 2888 // 2889-// $hash=a7b4410e0a35eb0aba747014665419fb6b6fcb67$ 2890+// $hash=95fee99cebd49941b0016a94fe1377a273df875f$ 2891 // 2892 2893 #ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ 2894diff --git a/src/cef/include/capi/cef_urlrequest_capi.h b/src/cef/include/capi/cef_urlrequest_capi.h 2895index 75a834c811c31..50ba3da3394b0 2896--- a/src/cef/include/capi/cef_urlrequest_capi.h 2897+++ b/src/cef/include/capi/cef_urlrequest_capi.h 2898@@ -1,4 +1,4 @@ 2899-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2900+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2901 // 2902 // Redistribution and use in source and binary forms, with or without 2903 // modification, are permitted provided that the following conditions are 2904@@ -33,7 +33,7 @@ 2905 // by hand. See the translator.README.txt file in the tools directory for 2906 // more information. 2907 // 2908-// $hash=a14d77cd7756797afb4db3d28a2359da53011bfa$ 2909+// $hash=1a7f7266ca653ae00fda873d7b1161fda5be5655$ 2910 // 2911 2912 #ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ 2913diff --git a/src/cef/include/capi/cef_v8_capi.h b/src/cef/include/capi/cef_v8_capi.h 2914index 824c3dbb48e2f..21a1134c93647 2915--- a/src/cef/include/capi/cef_v8_capi.h 2916+++ b/src/cef/include/capi/cef_v8_capi.h 2917@@ -1,4 +1,4 @@ 2918-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2919+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2920 // 2921 // Redistribution and use in source and binary forms, with or without 2922 // modification, are permitted provided that the following conditions are 2923@@ -33,7 +33,7 @@ 2924 // by hand. See the translator.README.txt file in the tools directory for 2925 // more information. 2926 // 2927-// $hash=2bdcad7f8e3c03285a5e5ddb9a02a5a2182f254c$ 2928+// $hash=515a6f62bb5217ba8ec2f7d39ab80c8309969a36$ 2929 // 2930 2931 #ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ 2932diff --git a/src/cef/include/capi/cef_values_capi.h b/src/cef/include/capi/cef_values_capi.h 2933index 90df63d6cedeb..dc4674a91eb70 2934--- a/src/cef/include/capi/cef_values_capi.h 2935+++ b/src/cef/include/capi/cef_values_capi.h 2936@@ -1,4 +1,4 @@ 2937-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2938+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2939 // 2940 // Redistribution and use in source and binary forms, with or without 2941 // modification, are permitted provided that the following conditions are 2942@@ -33,7 +33,7 @@ 2943 // by hand. See the translator.README.txt file in the tools directory for 2944 // more information. 2945 // 2946-// $hash=c557496bdc1403b25b22ca9354a942478131c7ce$ 2947+// $hash=ddc15ea7b9330cf163a23d502e104084469fceee$ 2948 // 2949 2950 #ifndef CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ 2951diff --git a/src/cef/include/capi/cef_waitable_event_capi.h b/src/cef/include/capi/cef_waitable_event_capi.h 2952index aa507e1083f85..ba326fa23f21e 2953--- a/src/cef/include/capi/cef_waitable_event_capi.h 2954+++ b/src/cef/include/capi/cef_waitable_event_capi.h 2955@@ -1,4 +1,4 @@ 2956-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2957+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2958 // 2959 // Redistribution and use in source and binary forms, with or without 2960 // modification, are permitted provided that the following conditions are 2961@@ -33,7 +33,7 @@ 2962 // by hand. See the translator.README.txt file in the tools directory for 2963 // more information. 2964 // 2965-// $hash=aff380a4fa3f1a26063170381d47c67971511f1d$ 2966+// $hash=5f8073d54b2908fb4257e39f9a7ec377c904607d$ 2967 // 2968 2969 #ifndef CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_ 2970diff --git a/src/cef/include/capi/cef_web_storage_capi.h b/src/cef/include/capi/cef_web_storage_capi.h 2971index b013bf001c667..97bf6d8a52884 2972--- a/src/cef/include/capi/cef_web_storage_capi.h 2973+++ b/src/cef/include/capi/cef_web_storage_capi.h 2974@@ -1,4 +1,4 @@ 2975-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2976+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2977 // 2978 // Redistribution and use in source and binary forms, with or without 2979 // modification, are permitted provided that the following conditions are 2980@@ -33,7 +33,7 @@ 2981 // by hand. See the translator.README.txt file in the tools directory for 2982 // more information. 2983 // 2984-// $hash=4f98d594eaa1a0b41b534f51da2639bfc9a12778$ 2985+// $hash=94416352092795abfea395fe1b6853fea26edf5e$ 2986 // 2987 2988 #ifndef CEF_INCLUDE_CAPI_CEF_WEB_STORAGE_CAPI_H_ 2989diff --git a/src/cef/include/capi/cef_x509_certificate_capi.h b/src/cef/include/capi/cef_x509_certificate_capi.h 2990index 8650b4055db2a..7c663501075c7 2991--- a/src/cef/include/capi/cef_x509_certificate_capi.h 2992+++ b/src/cef/include/capi/cef_x509_certificate_capi.h 2993@@ -1,4 +1,4 @@ 2994-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2995+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 2996 // 2997 // Redistribution and use in source and binary forms, with or without 2998 // modification, are permitted provided that the following conditions are 2999@@ -33,7 +33,7 @@ 3000 // by hand. See the translator.README.txt file in the tools directory for 3001 // more information. 3002 // 3003-// $hash=32b942f6b50b842ddec08addc2b5794f2a272dbe$ 3004+// $hash=50344d992070d4f7c39071988e3df72aa1eab9df$ 3005 // 3006 3007 #ifndef CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_ 3008diff --git a/src/cef/include/capi/cef_xml_reader_capi.h b/src/cef/include/capi/cef_xml_reader_capi.h 3009index 75f32a4d1d897..0245d236da957 3010--- a/src/cef/include/capi/cef_xml_reader_capi.h 3011+++ b/src/cef/include/capi/cef_xml_reader_capi.h 3012@@ -1,4 +1,4 @@ 3013-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3014+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3015 // 3016 // Redistribution and use in source and binary forms, with or without 3017 // modification, are permitted provided that the following conditions are 3018@@ -33,7 +33,7 @@ 3019 // by hand. See the translator.README.txt file in the tools directory for 3020 // more information. 3021 // 3022-// $hash=c3bdf957dfd307568842b95599e3259d4c8d8f44$ 3023+// $hash=48faeb26812f4fa6d8965c47acc96e635c45d27a$ 3024 // 3025 3026 #ifndef CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ 3027diff --git a/src/cef/include/capi/cef_zip_reader_capi.h b/src/cef/include/capi/cef_zip_reader_capi.h 3028index 5d899353362ca..27c81799e25bd 3029--- a/src/cef/include/capi/cef_zip_reader_capi.h 3030+++ b/src/cef/include/capi/cef_zip_reader_capi.h 3031@@ -1,4 +1,4 @@ 3032-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3033+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3034 // 3035 // Redistribution and use in source and binary forms, with or without 3036 // modification, are permitted provided that the following conditions are 3037@@ -33,7 +33,7 @@ 3038 // by hand. See the translator.README.txt file in the tools directory for 3039 // more information. 3040 // 3041-// $hash=ac91bcd40e1439ee1e742cc47989530b112c99bd$ 3042+// $hash=28f7ff6c3af903a645adc15ad4b696939e79df19$ 3043 // 3044 3045 #ifndef CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ 3046diff --git a/src/cef/include/capi/test/cef_test_helpers_capi.h b/src/cef/include/capi/test/cef_test_helpers_capi.h 3047index 128ab4c64925e..092ebf4d02b81 3048--- a/src/cef/include/capi/test/cef_test_helpers_capi.h 3049+++ b/src/cef/include/capi/test/cef_test_helpers_capi.h 3050@@ -1,4 +1,4 @@ 3051-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3052+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3053 // 3054 // Redistribution and use in source and binary forms, with or without 3055 // modification, are permitted provided that the following conditions are 3056@@ -33,7 +33,7 @@ 3057 // by hand. See the translator.README.txt file in the tools directory for 3058 // more information. 3059 // 3060-// $hash=584acfdb7be699b0192c46ac9fa88084f141e845$ 3061+// $hash=cd0ff16b2ea4d2d973ca9b7c7f503e7c1df0ad26$ 3062 // 3063 3064 #ifndef CEF_INCLUDE_CAPI_TEST_CEF_TEST_HELPERS_CAPI_H_ 3065diff --git a/src/cef/include/capi/test/cef_translator_test_capi.h b/src/cef/include/capi/test/cef_translator_test_capi.h 3066index 48811c5e883d6..601c8637e94ac 3067--- a/src/cef/include/capi/test/cef_translator_test_capi.h 3068+++ b/src/cef/include/capi/test/cef_translator_test_capi.h 3069@@ -1,4 +1,4 @@ 3070-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3071+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3072 // 3073 // Redistribution and use in source and binary forms, with or without 3074 // modification, are permitted provided that the following conditions are 3075@@ -33,7 +33,7 @@ 3076 // by hand. See the translator.README.txt file in the tools directory for 3077 // more information. 3078 // 3079-// $hash=d70d5b74890e3ca91f01333ebdb4f3298caeb619$ 3080+// $hash=1f8029c1907d5e1097d7347f03618bec25388f9b$ 3081 // 3082 3083 #ifndef CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_ 3084diff --git a/src/cef/include/capi/views/cef_box_layout_capi.h b/src/cef/include/capi/views/cef_box_layout_capi.h 3085index 6499ec22fd540..687aa2a3c57a4 3086--- a/src/cef/include/capi/views/cef_box_layout_capi.h 3087+++ b/src/cef/include/capi/views/cef_box_layout_capi.h 3088@@ -1,4 +1,4 @@ 3089-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3090+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3091 // 3092 // Redistribution and use in source and binary forms, with or without 3093 // modification, are permitted provided that the following conditions are 3094@@ -33,7 +33,7 @@ 3095 // by hand. See the translator.README.txt file in the tools directory for 3096 // more information. 3097 // 3098-// $hash=bf1d1dc95fa2053645a348d6f554688b9d06c83a$ 3099+// $hash=5e9d3854f9d31ac72038fb24aa9ef5944691a4ca$ 3100 // 3101 3102 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BOX_LAYOUT_CAPI_H_ 3103diff --git a/src/cef/include/capi/views/cef_browser_view_capi.h b/src/cef/include/capi/views/cef_browser_view_capi.h 3104index ab629c8a61cbb..3c2942a89061d 3105--- a/src/cef/include/capi/views/cef_browser_view_capi.h 3106+++ b/src/cef/include/capi/views/cef_browser_view_capi.h 3107@@ -1,4 +1,4 @@ 3108-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3109+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3110 // 3111 // Redistribution and use in source and binary forms, with or without 3112 // modification, are permitted provided that the following conditions are 3113@@ -33,7 +33,7 @@ 3114 // by hand. See the translator.README.txt file in the tools directory for 3115 // more information. 3116 // 3117-// $hash=9ae10b92eed7495112c94825521ac46fb9327ef7$ 3118+// $hash=90e42cb56ab7b8b752ddaf9526cb3b6e5af0d0fb$ 3119 // 3120 3121 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_ 3122diff --git a/src/cef/include/capi/views/cef_browser_view_delegate_capi.h b/src/cef/include/capi/views/cef_browser_view_delegate_capi.h 3123index 27ae4c1c4ee72..0a828fd052d26 3124--- a/src/cef/include/capi/views/cef_browser_view_delegate_capi.h 3125+++ b/src/cef/include/capi/views/cef_browser_view_delegate_capi.h 3126@@ -1,4 +1,4 @@ 3127-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3128+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3129 // 3130 // Redistribution and use in source and binary forms, with or without 3131 // modification, are permitted provided that the following conditions are 3132@@ -33,7 +33,7 @@ 3133 // by hand. See the translator.README.txt file in the tools directory for 3134 // more information. 3135 // 3136-// $hash=520df1f3e00efbffc9d499149f2f797bf0f85c99$ 3137+// $hash=ec5c49d383e69a87b525c6e1ec3e2c779db6ab78$ 3138 // 3139 3140 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_ 3141diff --git a/src/cef/include/capi/views/cef_button_capi.h b/src/cef/include/capi/views/cef_button_capi.h 3142index 40e71ec963aee..59699f8ae27b2 3143--- a/src/cef/include/capi/views/cef_button_capi.h 3144+++ b/src/cef/include/capi/views/cef_button_capi.h 3145@@ -1,4 +1,4 @@ 3146-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3147+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3148 // 3149 // Redistribution and use in source and binary forms, with or without 3150 // modification, are permitted provided that the following conditions are 3151@@ -33,7 +33,7 @@ 3152 // by hand. See the translator.README.txt file in the tools directory for 3153 // more information. 3154 // 3155-// $hash=5ebbf84a506d3d4d0bfb3d8db48f060a682f1ac9$ 3156+// $hash=ce7101147c7a834842e1b4006f3d830aa58cfc91$ 3157 // 3158 3159 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_CAPI_H_ 3160diff --git a/src/cef/include/capi/views/cef_button_delegate_capi.h b/src/cef/include/capi/views/cef_button_delegate_capi.h 3161index d853dbf97ed59..c9180f5c96122 3162--- a/src/cef/include/capi/views/cef_button_delegate_capi.h 3163+++ b/src/cef/include/capi/views/cef_button_delegate_capi.h 3164@@ -1,4 +1,4 @@ 3165-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3166+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3167 // 3168 // Redistribution and use in source and binary forms, with or without 3169 // modification, are permitted provided that the following conditions are 3170@@ -33,7 +33,7 @@ 3171 // by hand. See the translator.README.txt file in the tools directory for 3172 // more information. 3173 // 3174-// $hash=9f1752ee949e98662a718de764e83f26ce06ec26$ 3175+// $hash=cd06431dcfeb4f0907a478695ff1690da701fa8c$ 3176 // 3177 3178 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_DELEGATE_CAPI_H_ 3179diff --git a/src/cef/include/capi/views/cef_display_capi.h b/src/cef/include/capi/views/cef_display_capi.h 3180index 40c304b44f512..85e2ce6599231 3181--- a/src/cef/include/capi/views/cef_display_capi.h 3182+++ b/src/cef/include/capi/views/cef_display_capi.h 3183@@ -1,4 +1,4 @@ 3184-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3185+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3186 // 3187 // Redistribution and use in source and binary forms, with or without 3188 // modification, are permitted provided that the following conditions are 3189@@ -33,7 +33,7 @@ 3190 // by hand. See the translator.README.txt file in the tools directory for 3191 // more information. 3192 // 3193-// $hash=2fd0db428ce5902d59a7802c901e1c13b2367b5a$ 3194+// $hash=6cc3e2f52a4e8eab9690225cc085f726032c7bb1$ 3195 // 3196 3197 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_ 3198diff --git a/src/cef/include/capi/views/cef_fill_layout_capi.h b/src/cef/include/capi/views/cef_fill_layout_capi.h 3199index a8778a96d6898..23f4aa770bb7d 3200--- a/src/cef/include/capi/views/cef_fill_layout_capi.h 3201+++ b/src/cef/include/capi/views/cef_fill_layout_capi.h 3202@@ -1,4 +1,4 @@ 3203-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3204+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3205 // 3206 // Redistribution and use in source and binary forms, with or without 3207 // modification, are permitted provided that the following conditions are 3208@@ -33,7 +33,7 @@ 3209 // by hand. See the translator.README.txt file in the tools directory for 3210 // more information. 3211 // 3212-// $hash=13972453cdca328c6ee81249aeb202d80da6d290$ 3213+// $hash=477dc88c896170d4b617be9f7ce0bc21ebbbccbe$ 3214 // 3215 3216 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_FILL_LAYOUT_CAPI_H_ 3217diff --git a/src/cef/include/capi/views/cef_label_button_capi.h b/src/cef/include/capi/views/cef_label_button_capi.h 3218index 47ff1de60f6ca..ab9757079cd9c 3219--- a/src/cef/include/capi/views/cef_label_button_capi.h 3220+++ b/src/cef/include/capi/views/cef_label_button_capi.h 3221@@ -1,4 +1,4 @@ 3222-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3223+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3224 // 3225 // Redistribution and use in source and binary forms, with or without 3226 // modification, are permitted provided that the following conditions are 3227@@ -33,7 +33,7 @@ 3228 // by hand. See the translator.README.txt file in the tools directory for 3229 // more information. 3230 // 3231-// $hash=de3e738efca85a84422c92fa8504b24ed4efab8a$ 3232+// $hash=e638b5ad0528625d06234d8a35b44eb11a79fc3c$ 3233 // 3234 3235 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LABEL_BUTTON_CAPI_H_ 3236diff --git a/src/cef/include/capi/views/cef_layout_capi.h b/src/cef/include/capi/views/cef_layout_capi.h 3237index 8047df752aa6a..1408aa90ca55f 3238--- a/src/cef/include/capi/views/cef_layout_capi.h 3239+++ b/src/cef/include/capi/views/cef_layout_capi.h 3240@@ -1,4 +1,4 @@ 3241-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3242+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3243 // 3244 // Redistribution and use in source and binary forms, with or without 3245 // modification, are permitted provided that the following conditions are 3246@@ -33,7 +33,7 @@ 3247 // by hand. See the translator.README.txt file in the tools directory for 3248 // more information. 3249 // 3250-// $hash=6ef0d3d4390654fc1460a2ff586f2bbfd62e96b8$ 3251+// $hash=8c78341b1803cdcba66c5e95d0eab1ce2dea4e02$ 3252 // 3253 3254 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LAYOUT_CAPI_H_ 3255diff --git a/src/cef/include/capi/views/cef_menu_button_capi.h b/src/cef/include/capi/views/cef_menu_button_capi.h 3256index 50aaca9d60ecd..7fbf905e48f80 3257--- a/src/cef/include/capi/views/cef_menu_button_capi.h 3258+++ b/src/cef/include/capi/views/cef_menu_button_capi.h 3259@@ -1,4 +1,4 @@ 3260-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3261+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3262 // 3263 // Redistribution and use in source and binary forms, with or without 3264 // modification, are permitted provided that the following conditions are 3265@@ -33,7 +33,7 @@ 3266 // by hand. See the translator.README.txt file in the tools directory for 3267 // more information. 3268 // 3269-// $hash=925b09f77cd71327a447bf5c9601cc21a7eb7c3a$ 3270+// $hash=6c4206291d525099e382ce8b39b5bc82655455fc$ 3271 // 3272 3273 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_CAPI_H_ 3274diff --git a/src/cef/include/capi/views/cef_menu_button_delegate_capi.h b/src/cef/include/capi/views/cef_menu_button_delegate_capi.h 3275index c5f22aabac2a7..e0d2ec5279fcd 3276--- a/src/cef/include/capi/views/cef_menu_button_delegate_capi.h 3277+++ b/src/cef/include/capi/views/cef_menu_button_delegate_capi.h 3278@@ -1,4 +1,4 @@ 3279-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3280+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3281 // 3282 // Redistribution and use in source and binary forms, with or without 3283 // modification, are permitted provided that the following conditions are 3284@@ -33,7 +33,7 @@ 3285 // by hand. See the translator.README.txt file in the tools directory for 3286 // more information. 3287 // 3288-// $hash=ca7948602a0d20a5bd0271065d79e8679898eff6$ 3289+// $hash=357d6e0ba5823c66b72eae87696a33c0855134ee$ 3290 // 3291 3292 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_DELEGATE_CAPI_H_ 3293diff --git a/src/cef/include/capi/views/cef_overlay_controller_capi.h b/src/cef/include/capi/views/cef_overlay_controller_capi.h 3294index a0d6ac3a7d142..0226cd9c6f340 3295--- a/src/cef/include/capi/views/cef_overlay_controller_capi.h 3296+++ b/src/cef/include/capi/views/cef_overlay_controller_capi.h 3297@@ -1,4 +1,4 @@ 3298-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3299+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3300 // 3301 // Redistribution and use in source and binary forms, with or without 3302 // modification, are permitted provided that the following conditions are 3303@@ -33,7 +33,7 @@ 3304 // by hand. See the translator.README.txt file in the tools directory for 3305 // more information. 3306 // 3307-// $hash=14eaca76dba704ee64f454aaca821a6818012fc6$ 3308+// $hash=55371efcc9d09b9205ce160174a85d1b345d56ea$ 3309 // 3310 3311 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_OVERLAY_CONTROLLER_CAPI_H_ 3312diff --git a/src/cef/include/capi/views/cef_panel_capi.h b/src/cef/include/capi/views/cef_panel_capi.h 3313index 276c6206d488b..7ee9d9faf56ab 3314--- a/src/cef/include/capi/views/cef_panel_capi.h 3315+++ b/src/cef/include/capi/views/cef_panel_capi.h 3316@@ -1,4 +1,4 @@ 3317-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3318+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3319 // 3320 // Redistribution and use in source and binary forms, with or without 3321 // modification, are permitted provided that the following conditions are 3322@@ -33,7 +33,7 @@ 3323 // by hand. See the translator.README.txt file in the tools directory for 3324 // more information. 3325 // 3326-// $hash=d5311ffa72e57d240f6963b1f45a278041bd33f4$ 3327+// $hash=1aee6ef8b8b0c8d6a820f99a17a0d13b417cbe86$ 3328 // 3329 3330 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_CAPI_H_ 3331diff --git a/src/cef/include/capi/views/cef_panel_delegate_capi.h b/src/cef/include/capi/views/cef_panel_delegate_capi.h 3332index bef0a26510f8d..76bd0ef5201ff 3333--- a/src/cef/include/capi/views/cef_panel_delegate_capi.h 3334+++ b/src/cef/include/capi/views/cef_panel_delegate_capi.h 3335@@ -1,4 +1,4 @@ 3336-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3337+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3338 // 3339 // Redistribution and use in source and binary forms, with or without 3340 // modification, are permitted provided that the following conditions are 3341@@ -33,7 +33,7 @@ 3342 // by hand. See the translator.README.txt file in the tools directory for 3343 // more information. 3344 // 3345-// $hash=3b6b3ef725189debb1dd43db395a111f50dee60c$ 3346+// $hash=0b27daf9b7ff1378a7404b913d6e7bf778ec4c46$ 3347 // 3348 3349 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_DELEGATE_CAPI_H_ 3350diff --git a/src/cef/include/capi/views/cef_scroll_view_capi.h b/src/cef/include/capi/views/cef_scroll_view_capi.h 3351index 2c93f45c3a00a..2c8f180a45adc 3352--- a/src/cef/include/capi/views/cef_scroll_view_capi.h 3353+++ b/src/cef/include/capi/views/cef_scroll_view_capi.h 3354@@ -1,4 +1,4 @@ 3355-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3356+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3357 // 3358 // Redistribution and use in source and binary forms, with or without 3359 // modification, are permitted provided that the following conditions are 3360@@ -33,7 +33,7 @@ 3361 // by hand. See the translator.README.txt file in the tools directory for 3362 // more information. 3363 // 3364-// $hash=374b16fddbbb8bedc2dbb2e03dcfaa8cddba6aeb$ 3365+// $hash=bf4d81ab1ea8b9920e890161f32f805c5fcd0622$ 3366 // 3367 3368 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_SCROLL_VIEW_CAPI_H_ 3369diff --git a/src/cef/include/capi/views/cef_textfield_capi.h b/src/cef/include/capi/views/cef_textfield_capi.h 3370index fbb97eea9334b..8e56b964be535 3371--- a/src/cef/include/capi/views/cef_textfield_capi.h 3372+++ b/src/cef/include/capi/views/cef_textfield_capi.h 3373@@ -1,4 +1,4 @@ 3374-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3375+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3376 // 3377 // Redistribution and use in source and binary forms, with or without 3378 // modification, are permitted provided that the following conditions are 3379@@ -33,7 +33,7 @@ 3380 // by hand. See the translator.README.txt file in the tools directory for 3381 // more information. 3382 // 3383-// $hash=798f84672412f544765b800d03cf284b066f818c$ 3384+// $hash=3faf27fd1377ad64fe06aa30e69934b78102456e$ 3385 // 3386 3387 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_CAPI_H_ 3388diff --git a/src/cef/include/capi/views/cef_textfield_delegate_capi.h b/src/cef/include/capi/views/cef_textfield_delegate_capi.h 3389index 167249eef60cc..92a115c24c01d 3390--- a/src/cef/include/capi/views/cef_textfield_delegate_capi.h 3391+++ b/src/cef/include/capi/views/cef_textfield_delegate_capi.h 3392@@ -1,4 +1,4 @@ 3393-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3394+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3395 // 3396 // Redistribution and use in source and binary forms, with or without 3397 // modification, are permitted provided that the following conditions are 3398@@ -33,7 +33,7 @@ 3399 // by hand. See the translator.README.txt file in the tools directory for 3400 // more information. 3401 // 3402-// $hash=44337fe515a5acf51829e1dd00a54f2c1230aba5$ 3403+// $hash=c81f3ad4200af508ec18645f9a1c47ca137b2422$ 3404 // 3405 3406 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_DELEGATE_CAPI_H_ 3407diff --git a/src/cef/include/capi/views/cef_view_capi.h b/src/cef/include/capi/views/cef_view_capi.h 3408index 9907ccc53797b..5fbac19fa73a4 3409--- a/src/cef/include/capi/views/cef_view_capi.h 3410+++ b/src/cef/include/capi/views/cef_view_capi.h 3411@@ -1,4 +1,4 @@ 3412-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3413+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3414 // 3415 // Redistribution and use in source and binary forms, with or without 3416 // modification, are permitted provided that the following conditions are 3417@@ -33,7 +33,7 @@ 3418 // by hand. See the translator.README.txt file in the tools directory for 3419 // more information. 3420 // 3421-// $hash=d2aadfa4159846c2719387e2814d5e108def4b81$ 3422+// $hash=86f76917de91f297c2165a7e2311b8e1220a24ac$ 3423 // 3424 3425 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_CAPI_H_ 3426diff --git a/src/cef/include/capi/views/cef_view_delegate_capi.h b/src/cef/include/capi/views/cef_view_delegate_capi.h 3427index 09971e2a201dd..663a9a4bee755 3428--- a/src/cef/include/capi/views/cef_view_delegate_capi.h 3429+++ b/src/cef/include/capi/views/cef_view_delegate_capi.h 3430@@ -1,4 +1,4 @@ 3431-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3432+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3433 // 3434 // Redistribution and use in source and binary forms, with or without 3435 // modification, are permitted provided that the following conditions are 3436@@ -33,7 +33,7 @@ 3437 // by hand. See the translator.README.txt file in the tools directory for 3438 // more information. 3439 // 3440-// $hash=6a8166eca76513b59a4f6355f4f765dc1d77e4ee$ 3441+// $hash=aae94169e63ebfb9223ef32a28eeeb03d5cc710f$ 3442 // 3443 3444 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_DELEGATE_CAPI_H_ 3445diff --git a/src/cef/include/capi/views/cef_window_capi.h b/src/cef/include/capi/views/cef_window_capi.h 3446index 8e493af11e137..52546b074656b 3447--- a/src/cef/include/capi/views/cef_window_capi.h 3448+++ b/src/cef/include/capi/views/cef_window_capi.h 3449@@ -1,4 +1,4 @@ 3450-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3451+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3452 // 3453 // Redistribution and use in source and binary forms, with or without 3454 // modification, are permitted provided that the following conditions are 3455@@ -33,7 +33,7 @@ 3456 // by hand. See the translator.README.txt file in the tools directory for 3457 // more information. 3458 // 3459-// $hash=1785245d89e84d5a27ce062208bc19a4031ce97f$ 3460+// $hash=3ea36e131dbb52dbe2c80567e38835b6aab1613b$ 3461 // 3462 3463 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_ 3464diff --git a/src/cef/include/capi/views/cef_window_delegate_capi.h b/src/cef/include/capi/views/cef_window_delegate_capi.h 3465index 3bcffb3e2ef42..4fa5096b31dd0 3466--- a/src/cef/include/capi/views/cef_window_delegate_capi.h 3467+++ b/src/cef/include/capi/views/cef_window_delegate_capi.h 3468@@ -1,4 +1,4 @@ 3469-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3470+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3471 // 3472 // Redistribution and use in source and binary forms, with or without 3473 // modification, are permitted provided that the following conditions are 3474@@ -33,7 +33,7 @@ 3475 // by hand. See the translator.README.txt file in the tools directory for 3476 // more information. 3477 // 3478-// $hash=cd5d7c4e83237ceb39c5639489ca6004d2d69f0c$ 3479+// $hash=e8f5a22c50d02ae662383e056d4bf64de235d68d$ 3480 // 3481 3482 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_ 3483diff --git a/src/cef/include/cef_api_hash.h b/src/cef/include/cef_api_hash.h 3484index 177a21cdb0a30..058fd83436f8c 3485--- a/src/cef/include/cef_api_hash.h 3486+++ b/src/cef/include/cef_api_hash.h 3487@@ -1,4 +1,4 @@ 3488-// Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 3489+// Copyright (c) 2023 Marshall A. Greenblatt. All rights reserved. 3490 // 3491 // Redistribution and use in source and binary forms, with or without 3492 // modification, are permitted provided that the following conditions are 3493@@ -42,15 +42,15 @@ 3494 // way that may cause binary incompatibility with other builds. The universal 3495 // hash value will change if any platform is affected whereas the platform hash 3496 // values will change only if that particular platform is affected. 3497-#define CEF_API_HASH_UNIVERSAL "6960173003d330fe8b8fd0b99dc8b8fd5db47654" 3498+#define CEF_API_HASH_UNIVERSAL "fa7171a110d7f5a06e06c770c9224972d99054ec" 3499 #if defined(OS_WIN) 3500-#define CEF_API_HASH_PLATFORM "8dfc9e8c07e88d79bf8eb4dadf432451eb518186" 3501+#define CEF_API_HASH_PLATFORM "56a3fec8d1782d7f1bf12d13c6f61b5707282879" 3502 #elif defined(OS_MAC) 3503-#define CEF_API_HASH_PLATFORM "b76cd249ab87b40ba21b1502b9bfe9747cb8846b" 3504+#define CEF_API_HASH_PLATFORM "c01d748bab5bbdd4b4ed03a6b91fddf28c5ce635" 3505 #elif defined(OS_LINUX) 3506-#define CEF_API_HASH_PLATFORM "89b35957b8b3e9ed71fbac46aa3947d64d3c4506" 3507+#define CEF_API_HASH_PLATFORM "61c970f2c3d3c064401adeb42d16a19566d577c2" 3508 #elif defined(OS_OHOS) 3509-#define CEF_API_HASH_PLATFORM "89b35957b8b3e9ed71fbac46aa3947d64d3c4506" 3510+#define CEF_API_HASH_PLATFORM "61c970f2c3d3c064401adeb42d16a19566d577c2" 3511 #endif 3512 3513 #ifdef __cplusplus 3514diff --git a/src/cef/include/cef_browser.h b/src/cef/include/cef_browser.h 3515index be45cdcf0ceb2..33090400deb67 3516--- a/src/cef/include/cef_browser.h 3517+++ b/src/cef/include/cef_browser.h 3518@@ -53,6 +53,7 @@ 3519 class CefBrowserHost; 3520 class CefClient; 3521 class CefJavaScriptResultCallback; 3522+class CefWebMessageReceiver; 3523 class CefStoreWebArchiveResultCallback; 3524 3525 /// 3526@@ -237,7 +238,8 @@ class CefBrowser : public virtual CefBaseRefCounted { 3527 // Returns the Permission Request Delegate object. 3528 /// 3529 /*--cef()--*/ 3530- virtual CefRefPtr<CefBrowserPermissionRequestDelegate> GetPermissionRequestDelegate() = 0; 3531+ virtual CefRefPtr<CefBrowserPermissionRequestDelegate> 3532+ GetPermissionRequestDelegate() = 0; 3533 3534 /// 3535 // Returns the Geolocation Permission handler object. 3536@@ -899,7 +901,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { 3537 // Post a message to the port. 3538 /// 3539 /*--cef()--*/ 3540- virtual void PostPortMessage(CefString& port_handle, CefString& data) = 0; 3541+ virtual void PostPortMessage(CefString& port_handle, CefRefPtr<CefValue> message) = 0; 3542 3543 /// 3544 // Set the callback of the port. 3545@@ -907,7 +909,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted { 3546 /*--cef()--*/ 3547 virtual void SetPortMessageCallback( 3548 CefString& port_handle, 3549- CefRefPtr<CefJavaScriptResultCallback> callback) = 0; 3550+ CefRefPtr<CefWebMessageReceiver> callback) = 0; 3551 3552 /// 3553 // Gets the latest hitdata 3554@@ -953,7 +955,8 @@ class CefBrowserHost : public virtual CefBaseRefCounted { 3555 // Loads the given data into this WebView 3556 // optional_param=data, optional_param=mimeType, optional_param=encoding, 3557 /// 3558- /*--cef(optional_param=data, optional_param=mimeType, optional_param=encoding,)--*/ 3559+ /*--cef(optional_param=data, optional_param=mimeType, 3560+ optional_param=encoding,)--*/ 3561 virtual void LoadWithData(const CefString& data, 3562 const CefString& mimeType, 3563 const CefString& encoding) = 0; 3564@@ -1217,6 +1220,80 @@ class CefBrowserHost : public virtual CefBaseRefCounted { 3565 /// 3566 /*--cef()--*/ 3567 virtual void UpdateLocale(const CefString& locale) = 0; 3568+ 3569+ /// 3570+ // Returns the original url of the request. 3571+ /// 3572+ /*--cef()--*/ 3573+ virtual CefString GetOriginalUrl() = 0; 3574+ 3575+ /// 3576+ // Set network status 3577+ /// 3578+ /*--cef()--*/ 3579+ virtual void PutNetworkAvailable(bool available) = 0; 3580+ 3581+ /// 3582+ // Remove web cache 3583+ /// 3584+ /*--cef()--*/ 3585+ virtual void RemoveCache(bool include_disk_files) = 0; 3586+ 3587+ /// 3588+ // Scroll page up or down 3589+ /// 3590+ /*--cef()--*/ 3591+ virtual void ScrollPageUpDown(bool is_up, 3592+ bool is_half, 3593+ float view_height) = 0; 3594+ 3595+ /// 3596+ // Get web history state 3597+ /// 3598+ /*--cef()--*/ 3599+ virtual CefRefPtr<CefBinaryValue> GetWebState() = 0; 3600+ 3601+ /// 3602+ // Restore web history state 3603+ /// 3604+ /*--cef()--*/ 3605+ virtual bool RestoreWebState(const CefRefPtr<CefBinaryValue> state) = 0; 3606+ 3607+ /// 3608+ // Scroll to the position. 3609+ /// 3610+ /*--cef()--*/ 3611+ virtual void ScrollTo(float x, float y) = 0; 3612+ 3613+ /// 3614+ // Scroll by the delta distance. 3615+ /// 3616+ /*--cef()--*/ 3617+ virtual void ScrollBy(float delta_x, float delta_y) = 0; 3618+ 3619+ /// 3620+ // Slide Scroll by the speed. 3621+ /// 3622+ /*--cef()--*/ 3623+ virtual void SlideScroll(float vx, float vy) = 0; 3624+ 3625+ /// 3626+ // Set whether webview can access files 3627+ /// 3628+ /*--cef()--*/ 3629+ virtual void SetFileAccess(bool falg) = 0; 3630+ 3631+ /// 3632+ // Set whether webview can access network 3633+ /// 3634+ /*--cef()--*/ 3635+ virtual void SetBlockNetwork(bool falg) = 0; 3636+ 3637+ /// 3638+ // Set the cache mode of webview 3639+ /// 3640+ /*--cef()--*/ 3641+ virtual void SetCacheMode(int falg) = 0; 3642 }; 3643 3644 /// 3645@@ -1250,6 +1327,20 @@ class CefStoreWebArchiveResultCallback : public virtual CefBaseRefCounted { 3646 /*--cef(optional_param=result)--*/ 3647 virtual void OnStoreWebArchiveDone(const CefString& result) = 0; 3648 }; 3649+ 3650+/// 3651+// Interface to implement to be notified of asynchronous web message channel. 3652+/// 3653+/*--cef(source=client)--*/ 3654+class CefWebMessageReceiver : public virtual CefBaseRefCounted { 3655+ public: 3656+ /// 3657+ // Method that will be called upon |PostPortMessage|. |message| will be sent 3658+ // to another end of web message channel. 3659+ /// 3660+ /*--cef()--*/ 3661+ virtual void OnMessage(CefRefPtr<CefValue> message) = 0; 3662+}; 3663 /* ---------- ohos webview add end --------- */ 3664 3665 #endif // CEF_INCLUDE_CEF_BROWSER_H_ 3666diff --git a/src/cef/include/cef_context_menu_handler.h b/src/cef/include/cef_context_menu_handler.h 3667index 6df23c193cef5..c9864ccd93baf 3668--- a/src/cef/include/cef_context_menu_handler.h 3669+++ b/src/cef/include/cef_context_menu_handler.h 3670@@ -219,6 +219,8 @@ class CefContextMenuParams : public virtual CefBaseRefCounted { 3671 typedef cef_context_menu_media_type_t MediaType; 3672 typedef cef_context_menu_media_state_flags_t MediaStateFlags; 3673 typedef cef_context_menu_edit_state_flags_t EditStateFlags; 3674+ typedef cef_context_menu_input_field_type_t InputFieldType; 3675+ typedef cef_context_menu_source_type_t SourceType; 3676 3677 /// 3678 // Returns the X coordinate of the mouse where the context menu was invoked. 3679@@ -356,6 +358,18 @@ class CefContextMenuParams : public virtual CefBaseRefCounted { 3680 /// 3681 /*--cef()--*/ 3682 virtual bool IsCustomMenu() = 0; 3683+ 3684+ /// 3685+ // Returns the input field type of context node that the context menu was invoked on. 3686+ /// 3687+ /*--cef(default_retval=CM_INPUTFIELDTYPE_NONE)--*/ 3688+ virtual InputFieldType GetInputFieldType() = 0; 3689+ 3690+ /// 3691+ // Returns the source type of context node that the context menu was invoked on. 3692+ /// 3693+ /*--cef(default_retval=CM_SOURCETYPE_NONE)--*/ 3694+ virtual SourceType GetSourceType() = 0; 3695 }; 3696 3697 #endif // CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_ 3698diff --git a/src/cef/include/cef_data_base.h b/src/cef/include/cef_data_base.h 3699index 31aa67d68425c..a6a937ede1691 3700--- a/src/cef/include/cef_data_base.h 3701+++ b/src/cef/include/cef_data_base.h 3702@@ -81,7 +81,9 @@ class CefDataBase : public virtual CefBaseRefCounted { 3703 virtual void GetHttpAuthCredentials( 3704 const CefString& host, 3705 const CefString& realm, 3706- std::vector<CefString>& username_password) = 0; 3707+ CefString& username, 3708+ char* password, 3709+ uint32_t passwordSize) = 0; 3710 3711 /// 3712 // gets whether the instance holds the specified permissions for the specified 3713diff --git a/src/cef/include/cef_dialog_handler.h b/src/cef/include/cef_dialog_handler.h 3714index 5b77305af987d..88209153d9c72 3715--- a/src/cef/include/cef_dialog_handler.h 3716+++ b/src/cef/include/cef_dialog_handler.h 3717@@ -66,6 +66,27 @@ class CefFileDialogCallback : public virtual CefBaseRefCounted { 3718 virtual void Cancel() = 0; 3719 }; 3720 3721+/// 3722+// Callback interface for asynchronous continuation of <select> selection. 3723+/// 3724+/*--cef(source=library)--*/ 3725+class CefSelectPopupCallback : public virtual CefBaseRefCounted { 3726+ public: 3727+ /// 3728+ // Continue the <select> selection. |indices| should be the 0-based array 3729+ // index of the value selected from the <select> array passed to 3730+ // CefDialogHandler::ShowSelectPopup. 3731+ /// 3732+ /*--cef(capi_name=cont)--*/ 3733+ virtual void Continue(const std::vector<int>& indices) = 0; 3734+ 3735+ /// 3736+ // Cancel <select> selection. 3737+ /// 3738+ /*--cef()--*/ 3739+ virtual void Cancel() = 0; 3740+}; 3741+ 3742 /// 3743 // Implement this interface to handle dialog events. The methods of this class 3744 // will be called on the browser process UI thread. 3745@@ -102,6 +123,20 @@ class CefDialogHandler : public virtual CefBaseRefCounted { 3746 CefRefPtr<CefFileDialogCallback> callback) { 3747 return false; 3748 } 3749+ 3750+ /// 3751+ // Show <select> popup menu. 3752+ /// 3753+ /*--cef()--*/ 3754+ virtual void OnSelectPopupMenu(CefRefPtr<CefBrowser> browser, 3755+ const CefRect& bounds, 3756+ int item_height, 3757+ double item_font_size, 3758+ int selected_item, 3759+ const std::vector<CefSelectPopupItem>& menu_items, 3760+ bool right_aligned, 3761+ bool allow_multiple_selection, 3762+ CefRefPtr<CefSelectPopupCallback> callback) {} 3763 }; 3764 3765 #endif // CEF_INCLUDE_CEF_DIALOG_HANDLER_H_ 3766diff --git a/src/cef/include/cef_frame.h b/src/cef/include/cef_frame.h 3767index d27330e1dbfc9..472f477c67d5e 3768--- a/src/cef/include/cef_frame.h 3769+++ b/src/cef/include/cef_frame.h 3770@@ -49,6 +49,7 @@ class CefBrowser; 3771 class CefURLRequest; 3772 class CefURLRequestClient; 3773 class CefV8Context; 3774+class CefGetImagesCallback; 3775 3776 /// 3777 // Class used to represent a frame in the browser window. When used in the 3778@@ -267,6 +268,27 @@ class CefFrame : public virtual CefBaseRefCounted { 3779 /*--cef()--*/ 3780 virtual void SendProcessMessage(CefProcessId target_process, 3781 CefRefPtr<CefProcessMessage> message) = 0; 3782+ 3783+ /// 3784+ // web has image or not 3785+ /// 3786+ /*--cef()--*/ 3787+ virtual void GetImages(CefRefPtr<CefGetImagesCallback> callback) = 0; 3788+}; 3789+ 3790+/// 3791+// Interface to implement to be notified of asynchronous completion via 3792+// CefFrameHostImpl::GetImages. 3793+/// 3794+/*--cef(source=client)--*/ 3795+class CefGetImagesCallback : public virtual CefBaseRefCounted { 3796+ public: 3797+ /// 3798+ // Method that will be called upon completion. |num_deleted| will be the 3799+ // number of cookies that were deleted. 3800+ /// 3801+ /*--cef()--*/ 3802+ virtual void GetImages(bool response) = 0; 3803 }; 3804 3805 #endif // CEF_INCLUDE_CEF_FRAME_H_ 3806diff --git a/src/cef/include/cef_media_router.h b/src/cef/include/cef_media_router.h 3807deleted file mode 100644 3808index 378c3fc51530e..0000000000000 3809--- a/src/cef/include/cef_media_router.h 3810+++ /dev/null 3811@@ -1,323 +0,0 @@ 3812-// Copyright (c) 2020 Marshall A. Greenblatt. All rights reserved. 3813-// 3814-// Redistribution and use in source and binary forms, with or without 3815-// modification, are permitted provided that the following conditions are 3816-// met: 3817-// 3818-// * Redistributions of source code must retain the above copyright 3819-// notice, this list of conditions and the following disclaimer. 3820-// * Redistributions in binary form must reproduce the above 3821-// copyright notice, this list of conditions and the following disclaimer 3822-// in the documentation and/or other materials provided with the 3823-// distribution. 3824-// * Neither the name of Google Inc. nor the name Chromium Embedded 3825-// Framework nor the names of its contributors may be used to endorse 3826-// or promote products derived from this software without specific prior 3827-// written permission. 3828-// 3829-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 3830-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3831-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 3832-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3833-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3834-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3835-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3836-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3837-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3838-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3839-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3840-// 3841-// --------------------------------------------------------------------------- 3842-// 3843-// The contents of this file must follow a specific format in order to 3844-// support the CEF translator tool. See the translator.README.txt file in the 3845-// tools directory for more information. 3846-// 3847- 3848-#ifndef CEF_INCLUDE_CEF_MEDIA_ROUTER_H_ 3849-#define CEF_INCLUDE_CEF_MEDIA_ROUTER_H_ 3850-#pragma once 3851- 3852-#include <vector> 3853-#include "include/cef_base.h" 3854-#include "include/cef_callback.h" 3855-#include "include/cef_registration.h" 3856- 3857-class CefMediaObserver; 3858-class CefMediaRoute; 3859-class CefMediaRouteCreateCallback; 3860-class CefMediaSink; 3861-class CefMediaSinkDeviceInfoCallback; 3862-class CefMediaSource; 3863- 3864-/// 3865-// Supports discovery of and communication with media devices on the local 3866-// network via the Cast and DIAL protocols. The methods of this class may be 3867-// called on any browser process thread unless otherwise indicated. 3868-/// 3869-/*--cef(source=library)--*/ 3870-class CefMediaRouter : public virtual CefBaseRefCounted { 3871- public: 3872- /// 3873- // Returns the MediaRouter object associated with the global request context. 3874- // If |callback| is non-NULL it will be executed asnychronously on the UI 3875- // thread after the manager's storage has been initialized. Equivalent to 3876- // calling CefRequestContext::GetGlobalContext()->GetMediaRouter(). 3877- /// 3878- /*--cef(optional_param=callback)--*/ 3879- static CefRefPtr<CefMediaRouter> GetGlobalMediaRouter( 3880- CefRefPtr<CefCompletionCallback> callback); 3881- 3882- /// 3883- // Add an observer for MediaRouter events. The observer will remain registered 3884- // until the returned Registration object is destroyed. 3885- /// 3886- /*--cef()--*/ 3887- virtual CefRefPtr<CefRegistration> AddObserver( 3888- CefRefPtr<CefMediaObserver> observer) = 0; 3889- 3890- /// 3891- // Returns a MediaSource object for the specified media source URN. Supported 3892- // URN schemes include "cast:" and "dial:", and will be already known by the 3893- // client application (e.g. "cast:<appId>?clientId=<clientId>"). 3894- /// 3895- /*--cef()--*/ 3896- virtual CefRefPtr<CefMediaSource> GetSource(const CefString& urn) = 0; 3897- 3898- /// 3899- // Trigger an asynchronous call to CefMediaObserver::OnSinks on all 3900- // registered observers. 3901- /// 3902- /*--cef()--*/ 3903- virtual void NotifyCurrentSinks() = 0; 3904- 3905- /// 3906- // Create a new route between |source| and |sink|. Source and sink must be 3907- // valid, compatible (as reported by CefMediaSink::IsCompatibleWith), and a 3908- // route between them must not already exist. |callback| will be executed 3909- // on success or failure. If route creation succeeds it will also trigger an 3910- // asynchronous call to CefMediaObserver::OnRoutes on all registered 3911- // observers. 3912- /// 3913- /*--cef()--*/ 3914- virtual void CreateRoute(CefRefPtr<CefMediaSource> source, 3915- CefRefPtr<CefMediaSink> sink, 3916- CefRefPtr<CefMediaRouteCreateCallback> callback) = 0; 3917- 3918- /// 3919- // Trigger an asynchronous call to CefMediaObserver::OnRoutes on all 3920- // registered observers. 3921- /// 3922- /*--cef()--*/ 3923- virtual void NotifyCurrentRoutes() = 0; 3924-}; 3925- 3926-/// 3927-// Implemented by the client to observe MediaRouter events and registered via 3928-// CefMediaRouter::AddObserver. The methods of this class will be called on the 3929-// browser process UI thread. 3930-/// 3931-/*--cef(source=client)--*/ 3932-class CefMediaObserver : public virtual CefBaseRefCounted { 3933- public: 3934- typedef cef_media_route_connection_state_t ConnectionState; 3935- 3936- /// 3937- // The list of available media sinks has changed or 3938- // CefMediaRouter::NotifyCurrentSinks was called. 3939- /// 3940- /*--cef()--*/ 3941- virtual void OnSinks(const std::vector<CefRefPtr<CefMediaSink>>& sinks) = 0; 3942- 3943- /// 3944- // The list of available media routes has changed or 3945- // CefMediaRouter::NotifyCurrentRoutes was called. 3946- /// 3947- /*--cef()--*/ 3948- virtual void OnRoutes( 3949- const std::vector<CefRefPtr<CefMediaRoute>>& routes) = 0; 3950- 3951- /// 3952- // The connection state of |route| has changed. 3953- /// 3954- /*--cef()--*/ 3955- virtual void OnRouteStateChanged(CefRefPtr<CefMediaRoute> route, 3956- ConnectionState state) = 0; 3957- 3958- /// 3959- // A message was recieved over |route|. |message| is only valid for 3960- // the scope of this callback and should be copied if necessary. 3961- /// 3962- /*--cef()--*/ 3963- virtual void OnRouteMessageReceived(CefRefPtr<CefMediaRoute> route, 3964- const void* message, 3965- size_t message_size) = 0; 3966-}; 3967- 3968-/// 3969-// Represents the route between a media source and sink. Instances of this 3970-// object are created via CefMediaRouter::CreateRoute and retrieved via 3971-// CefMediaObserver::OnRoutes. Contains the status and metadata of a 3972-// routing operation. The methods of this class may be called on any browser 3973-// process thread unless otherwise indicated. 3974-/// 3975-/*--cef(source=library)--*/ 3976-class CefMediaRoute : public virtual CefBaseRefCounted { 3977- public: 3978- /// 3979- // Returns the ID for this route. 3980- /// 3981- /*--cef()--*/ 3982- virtual CefString GetId() = 0; 3983- 3984- /// 3985- // Returns the source associated with this route. 3986- /// 3987- /*--cef()--*/ 3988- virtual CefRefPtr<CefMediaSource> GetSource() = 0; 3989- 3990- /// 3991- // Returns the sink associated with this route. 3992- /// 3993- /*--cef()--*/ 3994- virtual CefRefPtr<CefMediaSink> GetSink() = 0; 3995- 3996- /// 3997- // Send a message over this route. |message| will be copied if necessary. 3998- /// 3999- /*--cef()--*/ 4000- virtual void SendRouteMessage(const void* message, size_t message_size) = 0; 4001- 4002- /// 4003- // Terminate this route. Will result in an asynchronous call to 4004- // CefMediaObserver::OnRoutes on all registered observers. 4005- /// 4006- /*--cef()--*/ 4007- virtual void Terminate() = 0; 4008-}; 4009- 4010-/// 4011-// Callback interface for CefMediaRouter::CreateRoute. The methods of this 4012-// class will be called on the browser process UI thread. 4013-/// 4014-/*--cef(source=client)--*/ 4015-class CefMediaRouteCreateCallback : public virtual CefBaseRefCounted { 4016- public: 4017- typedef cef_media_route_create_result_t RouteCreateResult; 4018- 4019- /// 4020- // Method that will be executed when the route creation has finished. |result| 4021- // will be CEF_MRCR_OK if the route creation succeeded. |error| will be a 4022- // description of the error if the route creation failed. |route| is the 4023- // resulting route, or empty if the route creation failed. 4024- /// 4025- /*--cef(optional_param=error,optional_param=route)--*/ 4026- virtual void OnMediaRouteCreateFinished(RouteCreateResult result, 4027- const CefString& error, 4028- CefRefPtr<CefMediaRoute> route) = 0; 4029-}; 4030- 4031-/// 4032-// Represents a sink to which media can be routed. Instances of this object are 4033-// retrieved via CefMediaObserver::OnSinks. The methods of this class may 4034-// be called on any browser process thread unless otherwise indicated. 4035-/// 4036-/*--cef(source=library)--*/ 4037-class CefMediaSink : public virtual CefBaseRefCounted { 4038- public: 4039- typedef cef_media_sink_icon_type_t IconType; 4040- 4041- /// 4042- // Returns the ID for this sink. 4043- /// 4044- /*--cef()--*/ 4045- virtual CefString GetId() = 0; 4046- 4047- /// 4048- // Returns the name of this sink. 4049- /// 4050- /*--cef()--*/ 4051- virtual CefString GetName() = 0; 4052- 4053- /// 4054- // Returns the description of this sink. 4055- /// 4056- /*--cef()--*/ 4057- virtual CefString GetDescription() = 0; 4058- 4059- /// 4060- // Returns the icon type for this sink. 4061- /// 4062- /*--cef(default_retval=CEF_MSIT_GENERIC)--*/ 4063- virtual IconType GetIconType() = 0; 4064- 4065- /// 4066- // Asynchronously retrieves device info. 4067- /// 4068- /*--cef()--*/ 4069- virtual void GetDeviceInfo( 4070- CefRefPtr<CefMediaSinkDeviceInfoCallback> callback) = 0; 4071- 4072- /// 4073- // Returns true if this sink accepts content via Cast. 4074- /// 4075- /*--cef()--*/ 4076- virtual bool IsCastSink() = 0; 4077- 4078- /// 4079- // Returns true if this sink accepts content via DIAL. 4080- /// 4081- /*--cef()--*/ 4082- virtual bool IsDialSink() = 0; 4083- 4084- /// 4085- // Returns true if this sink is compatible with |source|. 4086- /// 4087- /*--cef()--*/ 4088- virtual bool IsCompatibleWith(CefRefPtr<CefMediaSource> source) = 0; 4089-}; 4090- 4091-/// 4092-// Callback interface for CefMediaSink::GetDeviceInfo. The methods of this 4093-// class will be called on the browser process UI thread. 4094-/// 4095-/*--cef(source=client)--*/ 4096-class CefMediaSinkDeviceInfoCallback : public virtual CefBaseRefCounted { 4097- public: 4098- /// 4099- // Method that will be executed asyncronously once device information has been 4100- // retrieved. 4101- /// 4102- /*--cef()--*/ 4103- virtual void OnMediaSinkDeviceInfo( 4104- const CefMediaSinkDeviceInfo& device_info) = 0; 4105-}; 4106- 4107-/// 4108-// Represents a source from which media can be routed. Instances of this object 4109-// are retrieved via CefMediaRouter::GetSource. The methods of this class may be 4110-// called on any browser process thread unless otherwise indicated. 4111-/// 4112-/*--cef(source=library)--*/ 4113-class CefMediaSource : public virtual CefBaseRefCounted { 4114- public: 4115- /// 4116- // Returns the ID (media source URN or URL) for this source. 4117- /// 4118- /*--cef()--*/ 4119- virtual CefString GetId() = 0; 4120- 4121- /// 4122- // Returns true if this source outputs its content via Cast. 4123- /// 4124- /*--cef()--*/ 4125- virtual bool IsCastSource() = 0; 4126- 4127- /// 4128- // Returns true if this source outputs its content via DIAL. 4129- /// 4130- /*--cef()--*/ 4131- virtual bool IsDialSource() = 0; 4132-}; 4133- 4134-#endif // CEF_INCLUDE_CEF_MEDIA_ROUTER_H_ 4135diff --git a/src/cef/include/cef_navigation_entry.h b/src/cef/include/cef_navigation_entry.h 4136index 292f5b6c38de4..1d1892be07a67 4137--- a/src/cef/include/cef_navigation_entry.h 4138+++ b/src/cef/include/cef_navigation_entry.h 4139@@ -115,6 +115,16 @@ class CefNavigationEntry : public virtual CefBaseRefCounted { 4140 /// 4141 /*--cef()--*/ 4142 virtual CefRefPtr<CefSSLStatus> GetSSLStatus() = 0; 4143+ 4144+ /// 4145+ // Return favicon for this navigation entry. 4146+ /// 4147+ /*--cef()--*/ 4148+ virtual bool GetFavicon(void** pixel_data, 4149+ int& color_type, 4150+ int& alpha_type, 4151+ int& pixel_width, 4152+ int& pixel_height) = 0; 4153 }; 4154 4155 #endif // CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_ 4156diff --git a/src/cef/include/cef_request_context.h b/src/cef/include/cef_request_context.h 4157index 016362f4a3572..e95de9a65bc3f 4158--- a/src/cef/include/cef_request_context.h 4159+++ b/src/cef/include/cef_request_context.h 4160@@ -45,7 +45,6 @@ 4161 #include "include/cef_data_base.h" 4162 #include "include/cef_extension.h" 4163 #include "include/cef_extension_handler.h" 4164-#include "include/cef_media_router.h" 4165 #include "include/cef_values.h" 4166 #include "include/cef_web_storage.h" 4167 4168@@ -380,15 +379,6 @@ class CefRequestContext : public virtual CefBaseRefCounted { 4169 /*--cef()--*/ 4170 virtual CefRefPtr<CefExtension> GetExtension( 4171 const CefString& extension_id) = 0; 4172- 4173- /// 4174- // Returns the MediaRouter object associated with this context. If |callback| 4175- // is non-NULL it will be executed asnychronously on the UI thread after the 4176- // manager's context has been initialized. 4177- /// 4178- /*--cef(optional_param=callback)--*/ 4179- virtual CefRefPtr<CefMediaRouter> GetMediaRouter( 4180- CefRefPtr<CefCompletionCallback> callback) = 0; 4181 }; 4182 4183 #endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_ 4184diff --git a/src/cef/include/cef_request_context_handler.h b/src/cef/include/cef_request_context_handler.h 4185index 3bf495dda0f6c..162fd229fc87d 4186--- a/src/cef/include/cef_request_context_handler.h 4187+++ b/src/cef/include/cef_request_context_handler.h 4188@@ -43,7 +43,7 @@ 4189 #include "include/cef_frame.h" 4190 #include "include/cef_request.h" 4191 #include "include/cef_resource_request_handler.h" 4192-#include "include/cef_web_plugin.h" 4193+//#include "include/cef_web_plugin.h" // !enable_plugins 4194 4195 /// 4196 // Implement this interface to provide handler implementations. The handler 4197diff --git a/src/cef/include/cef_web_plugin.h b/src/cef/include/cef_web_plugin.h 4198deleted file mode 100644 4199index 2ffd572a506d2..0000000000000 4200--- a/src/cef/include/cef_web_plugin.h 4201+++ /dev/null 4202@@ -1,148 +0,0 @@ 4203-// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. 4204-// 4205-// Redistribution and use in source and binary forms, with or without 4206-// modification, are permitted provided that the following conditions are 4207-// met: 4208-// 4209-// * Redistributions of source code must retain the above copyright 4210-// notice, this list of conditions and the following disclaimer. 4211-// * Redistributions in binary form must reproduce the above 4212-// copyright notice, this list of conditions and the following disclaimer 4213-// in the documentation and/or other materials provided with the 4214-// distribution. 4215-// * Neither the name of Google Inc. nor the name Chromium Embedded 4216-// Framework nor the names of its contributors may be used to endorse 4217-// or promote products derived from this software without specific prior 4218-// written permission. 4219-// 4220-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 4221-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 4222-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 4223-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 4224-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 4225-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 4226-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 4227-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 4228-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 4229-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 4230-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 4231-// 4232-// --------------------------------------------------------------------------- 4233-// 4234-// The contents of this file must follow a specific format in order to 4235-// support the CEF translator tool. See the translator.README.txt file in the 4236-// tools directory for more information. 4237-// 4238- 4239-#ifndef CEF_INCLUDE_CEF_WEB_PLUGIN_H_ 4240-#define CEF_INCLUDE_CEF_WEB_PLUGIN_H_ 4241- 4242-#include "include/cef_base.h" 4243- 4244-class CefBrowser; 4245- 4246-/// 4247-// Information about a specific web plugin. 4248-/// 4249-/*--cef(source=library)--*/ 4250-class CefWebPluginInfo : public virtual CefBaseRefCounted { 4251- public: 4252- /// 4253- // Returns the plugin name. 4254- /// 4255- /*--cef()--*/ 4256- virtual CefString GetName() = 0; 4257- 4258- /// 4259- // Returns the plugin file path (DLL/bundle/library). 4260- /// 4261- /*--cef()--*/ 4262- virtual CefString GetPath() = 0; 4263- 4264- /// 4265- // Returns the version of the plugin (may be OS-specific). 4266- /// 4267- /*--cef()--*/ 4268- virtual CefString GetVersion() = 0; 4269- 4270- /// 4271- // Returns a description of the plugin from the version information. 4272- /// 4273- /*--cef()--*/ 4274- virtual CefString GetDescription() = 0; 4275-}; 4276- 4277-/// 4278-// Interface to implement for visiting web plugin information. The methods of 4279-// this class will be called on the browser process UI thread. 4280-/// 4281-/*--cef(source=client)--*/ 4282-class CefWebPluginInfoVisitor : public virtual CefBaseRefCounted { 4283- public: 4284- /// 4285- // Method that will be called once for each plugin. |count| is the 0-based 4286- // index for the current plugin. |total| is the total number of plugins. 4287- // Return false to stop visiting plugins. This method may never be called if 4288- // no plugins are found. 4289- /// 4290- /*--cef()--*/ 4291- virtual bool Visit(CefRefPtr<CefWebPluginInfo> info, 4292- int count, 4293- int total) = 0; 4294-}; 4295- 4296-/// 4297-// Visit web plugin information. Can be called on any thread in the browser 4298-// process. 4299-/// 4300-/*--cef()--*/ 4301-void CefVisitWebPluginInfo(CefRefPtr<CefWebPluginInfoVisitor> visitor); 4302- 4303-/// 4304-// Cause the plugin list to refresh the next time it is accessed regardless 4305-// of whether it has already been loaded. Can be called on any thread in the 4306-// browser process. 4307-/// 4308-/*--cef()--*/ 4309-void CefRefreshWebPlugins(); 4310- 4311-/// 4312-// Unregister an internal plugin. This may be undone the next time 4313-// CefRefreshWebPlugins() is called. Can be called on any thread in the browser 4314-// process. 4315-/// 4316-/*--cef()--*/ 4317-void CefUnregisterInternalWebPlugin(const CefString& path); 4318- 4319-/// 4320-// Register a plugin crash. Can be called on any thread in the browser process 4321-// but will be executed on the IO thread. 4322-/// 4323-/*--cef()--*/ 4324-void CefRegisterWebPluginCrash(const CefString& path); 4325- 4326-/// 4327-// Interface to implement for receiving unstable plugin information. The methods 4328-// of this class will be called on the browser process IO thread. 4329-/// 4330-/*--cef(source=client)--*/ 4331-class CefWebPluginUnstableCallback : public virtual CefBaseRefCounted { 4332- public: 4333- /// 4334- // Method that will be called for the requested plugin. |unstable| will be 4335- // true if the plugin has reached the crash count threshold of 3 times in 120 4336- // seconds. 4337- /// 4338- /*--cef()--*/ 4339- virtual void IsUnstable(const CefString& path, bool unstable) = 0; 4340-}; 4341- 4342-/// 4343-// Query if a plugin is unstable. Can be called on any thread in the browser 4344-// process. 4345-/// 4346-/*--cef()--*/ 4347-void CefIsWebPluginUnstable(const CefString& path, 4348- CefRefPtr<CefWebPluginUnstableCallback> callback); 4349- 4350-#endif // CEF_INCLUDE_CEF_WEB_PLUGIN_H_ 4351diff --git a/src/cef/include/internal/cef_string_wrappers.h b/src/cef/include/internal/cef_string_wrappers.h 4352index c53f5627e99ae..0909f90669e6c 4353--- a/src/cef/include/internal/cef_string_wrappers.h 4354+++ b/src/cef/include/internal/cef_string_wrappers.h 4355@@ -531,6 +531,16 @@ class CefStringBase { 4356 owner_ = false; 4357 } 4358 4359+ /// 4360+ // Memset the data to zero. 4361+ /// 4362+ void MemsetToZero() { 4363+ if (!string_) 4364+ return; 4365+ if (string_->str != NULL) 4366+ memset(string_->str, 0, string_->length); 4367+ } 4368+ 4369 /// 4370 // Attach to the specified string structure. If |owner| is true this class 4371 // will take ownership of the structure. 4372diff --git a/src/cef/include/internal/cef_types.h b/src/cef/include/internal/cef_types.h 4373index e24b376d19871..6ec7dd2e48e2c 4374--- a/src/cef/include/internal/cef_types.h 4375+++ b/src/cef/include/internal/cef_types.h 4376@@ -664,6 +664,7 @@ typedef struct _cef_browser_settings_t { 4377 // Force the background color to be dark 4378 /// 4379 cef_state_t force_dark_mode_enabled; 4380+ cef_state_t dark_prefer_color_scheme_enabled; 4381 cef_state_t loads_images_automatically; 4382 bool javascript_can_open_windows_automatically; 4383 int text_size_percent; 4384@@ -677,6 +678,10 @@ typedef struct _cef_browser_settings_t { 4385 bool viewport_meta_enabled; 4386 bool user_gesture_required; 4387 bool pinch_smooth_mode; 4388+#if BUILDFLAG(IS_OHOS) 4389+ cef_state_t hide_vertical_scrollbars; 4390+ cef_state_t hide_horizontal_scrollbars; 4391+#endif 4392 /* ohos webview end */ 4393 } cef_browser_settings_t; 4394 4395@@ -3308,6 +3313,197 @@ typedef struct _cef_touch_handle_state_t { 4396 float edge_height; 4397 } cef_touch_handle_state_t; 4398 4399+/// 4400+// Supported context menu input field types. These constants match their equivalents 4401+// in Chromium's ContextMenuDataInputFieldType and should not be renumbered. 4402+/// 4403+typedef enum { 4404+ /// 4405+ // Not an input field. 4406+ /// 4407+ CM_INPUTFIELDTYPE_NONE, 4408+ 4409+ /// 4410+ // type = text, search, email, url 4411+ /// 4412+ CM_INPUTFIELDTYPE_PLAINTEXT, 4413+ 4414+ /// 4415+ // type = password 4416+ /// 4417+ CM_INPUTFIELDTYPE_PASSWORD, 4418+ 4419+ /// 4420+ // type = number 4421+ /// 4422+ CM_INPUTFIELDTYPE_NUMBER, 4423+ 4424+ /// 4425+ // type = tel 4426+ /// 4427+ CM_INPUTFIELDTYPE_TELEPHONE, 4428+ 4429+ /// 4430+ // type = <etc.> 4431+ /// 4432+ CM_INPUTFIELDTYPE_OTHER, 4433+} cef_context_menu_input_field_type_t; 4434+ 4435+/// 4436+// Supported context menu source types. These constants match their equivalents 4437+// in Chromium's ui::MenuSourceType and should not be renumbered. 4438+/// 4439+typedef enum { 4440+ /// 4441+ // type = none 4442+ /// 4443+ CM_SOURCETYPE_NONE, 4444+ 4445+ /// 4446+ // type = mouse 4447+ /// 4448+ CM_SOURCETYPE_MOUSE, 4449+ 4450+ /// 4451+ // type = keyboard 4452+ /// 4453+ CM_SOURCETYPE_KEYBOARD, 4454+ 4455+ /// 4456+ // type = touch 4457+ /// 4458+ CM_SOURCETYPE_TOUCH, 4459+ 4460+ /// 4461+ // type = touch edit menu 4462+ /// 4463+ CM_SOURCETYPE_TOUCH_EDIT_MENU, 4464+ 4465+ /// 4466+ // type = long press 4467+ /// 4468+ CM_SOURCETYPE_LONG_PRESS, 4469+ 4470+ /// 4471+ // type = long tap 4472+ /// 4473+ CM_SOURCETYPE_LONG_TAP, 4474+ 4475+ /// 4476+ // type = number 4477+ /// 4478+ CM_SOURCETYPE_TOUCH_HANDLE, 4479+ 4480+ /// 4481+ // type = stylus 4482+ /// 4483+ CM_SOURCETYPE_STYLUS, 4484+ 4485+ /// 4486+ // type = adjust selection 4487+ /// 4488+ CM_SOURCETYPE_ADJUST_SELECTION, 4489+ 4490+ /// 4491+ // type = selection reset 4492+ /// 4493+ CM_SOURCETYPE_SELECTION_RESET, 4494+} cef_context_menu_source_type_t; 4495+ 4496+/// 4497+// Supported text direction. See text_direction.mojom. 4498+/// 4499+typedef enum { 4500+ /// 4501+ // type = unknown direction 4502+ /// 4503+ UNKNOWN, 4504+ 4505+ /// 4506+ // type = right to left 4507+ /// 4508+ RTL, 4509+ 4510+ /// 4511+ // type = left to right 4512+ /// 4513+ LTR, 4514+} cef_text_direction_t; 4515+ 4516+/// 4517+// Supported <select> item type. See popup_menu.mojom. 4518+/// 4519+typedef enum { 4520+ /// 4521+ // type = kOption 4522+ /// 4523+ OPTION, 4524+ 4525+ /// 4526+ // type = kCheckableOption 4527+ /// 4528+ CHECKABLE_OPTION, 4529+ 4530+ /// 4531+ // type = kGruop 4532+ /// 4533+ GROUP, 4534+ 4535+ /// 4536+ // type = kSeparator 4537+ /// 4538+ SEPARATOR, 4539+ 4540+ /// 4541+ // type = kSubMenu 4542+ /// 4543+ SubMenu, 4544+} cef_select_popup_item_type_t; 4545+ 4546+/// 4547+// Supported <select> item. 4548+/// 4549+typedef struct _cef_select_popup_item_t { 4550+ /// 4551+ // label name of item. 4552+ /// 4553+ cef_string_t label; 4554+ 4555+ /// 4556+ // tool tip of item. 4557+ /// 4558+ cef_string_t tool_tip; 4559+ 4560+ /// 4561+ // type of item. 4562+ /// 4563+ cef_select_popup_item_type_t type; 4564+ 4565+ /// 4566+ // action of item. 4567+ /// 4568+ uint32_t action; 4569+ 4570+ /// 4571+ // text direction of item. 4572+ /// 4573+ cef_text_direction_t text_direction; 4574+ 4575+ /// 4576+ // whether item is enabled. 4577+ /// 4578+ bool enabled; 4579+ 4580+ /// 4581+ // whether item has text direction overridel 4582+ /// 4583+ bool has_text_direction_override; 4584+ 4585+ /// 4586+ // whether item is checked. 4587+ /// 4588+ bool checked; 4589+} cef_select_popup_item_t; 4590 #ifdef __cplusplus 4591 } 4592 #endif 4593diff --git a/src/cef/include/internal/cef_types_wrappers.h b/src/cef/include/internal/cef_types_wrappers.h 4594index 9bfde0a89e3f9..d69abfcbf52b3 4595--- a/src/cef/include/internal/cef_types_wrappers.h 4596+++ b/src/cef/include/internal/cef_types_wrappers.h 4597@@ -730,6 +730,7 @@ struct CefBrowserSettingsTraits { 4598 4599 /* ohos webview begin */ 4600 target->force_dark_mode_enabled = src->force_dark_mode_enabled; 4601+ target->dark_prefer_color_scheme_enabled = src->dark_prefer_color_scheme_enabled; 4602 target->javascript_can_open_windows_automatically = 4603 src->javascript_can_open_windows_automatically; 4604 target->loads_images_automatically = src->loads_images_automatically; 4605@@ -746,6 +747,10 @@ struct CefBrowserSettingsTraits { 4606 target->viewport_meta_enabled = src->viewport_meta_enabled; 4607 target->user_gesture_required = src->user_gesture_required; 4608 target->pinch_smooth_mode = src->pinch_smooth_mode; 4609+#if BUILDFLAG(IS_OHOS) 4610+ target->hide_vertical_scrollbars = src->hide_vertical_scrollbars; 4611+ target->hide_horizontal_scrollbars = src->hide_horizontal_scrollbars; 4612+#endif 4613 /* ohos webview end */ 4614 } 4615 }; 4616@@ -1050,4 +1055,23 @@ struct CefMediaSinkDeviceInfoTraits { 4617 /// 4618 typedef CefStructBase<CefMediaSinkDeviceInfoTraits> CefMediaSinkDeviceInfo; 4619 4620+struct CefSelectPopupItemTraits { 4621+ typedef cef_select_popup_item_t struct_type; 4622+ 4623+ static inline void init(struct_type* s) {} 4624+ 4625+ static inline void clear(struct_type* s) {} 4626+ 4627+ static inline void set(const struct_type* src, 4628+ struct_type* target, 4629+ bool copy) { 4630+ *target = *src; 4631+ } 4632+}; 4633+ 4634+/// 4635+// Class representing select popup item. 4636+/// 4637+typedef CefStructBase<CefSelectPopupItemTraits> CefSelectPopupItem; 4638+ 4639 #endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_ 4640diff --git a/src/cef/libcef/browser/alloy/alloy_browser_context.cc b/src/cef/libcef/browser/alloy/alloy_browser_context.cc 4641index 6ede933824b83..2e09ea0d29090 4642--- a/src/cef/libcef/browser/alloy/alloy_browser_context.cc 4643+++ b/src/cef/libcef/browser/alloy/alloy_browser_context.cc 4644@@ -24,7 +24,6 @@ 4645 #include "base/strings/string_util.h" 4646 #include "chrome/browser/font_family_cache.h" 4647 #include "chrome/browser/media/media_device_id_salt.h" 4648-#include "chrome/browser/plugins/chrome_plugin_service_filter.h" 4649 #include "chrome/browser/profiles/profile_key.h" 4650 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" 4651 #include "chrome/common/pref_names.h" 4652@@ -49,6 +48,10 @@ 4653 #include "net/proxy_resolution/proxy_config_service.h" 4654 #include "services/network/public/mojom/cors_origin_pattern.mojom.h" 4655 4656+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 4657+#include "chrome/browser/plugins/chrome_plugin_service_filter.h" 4658+#endif 4659+ 4660 using content::BrowserThread; 4661 4662 // Creates and manages VisitedLinkEventListener objects for each 4663@@ -183,7 +186,9 @@ void AlloyBrowserContext::Initialize() { 4664 if (extensions_enabled) 4665 extension_system_->Init(); 4666 4667+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 4668 ChromePluginServiceFilter::GetInstance()->RegisterProfile(this); 4669+#endif 4670 4671 media_device_id_salt_ = new MediaDeviceIDSalt(pref_service); 4672 } 4673@@ -194,7 +199,9 @@ void AlloyBrowserContext::Shutdown() { 4674 // Send notifications to clean up objects associated with this Profile. 4675 MaybeSendDestroyedNotification(); 4676 4677+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 4678 ChromePluginServiceFilter::GetInstance()->UnregisterProfile(this); 4679+#endif 4680 4681 // Remove any BrowserContextKeyedServiceFactory associations. This must be 4682 // called before the ProxyService owned by AlloyBrowserContext is destroyed. 4683diff --git a/src/cef/libcef/browser/alloy/alloy_browser_host_impl.cc b/src/cef/libcef/browser/alloy/alloy_browser_host_impl.cc 4684index ee3704e8da89f..ec9cc632fb823 4685--- a/src/cef/libcef/browser/alloy/alloy_browser_host_impl.cc 4686+++ b/src/cef/libcef/browser/alloy/alloy_browser_host_impl.cc 4687@@ -331,6 +331,13 @@ void AlloyBrowserHostImpl::CloseBrowser(bool force_close) { 4688 // Will result in a call to BeforeUnloadFired() and, if the close isn't 4689 // canceled, CloseContents(). 4690 contents->DispatchBeforeUnload(false /* auto_cancel */); 4691+#if BUILDFLAG(IS_OHOS) 4692+ // In cef_life_span_handler.h file show DoClose step. 4693+ // Step 1 to Step 3 is over. 4694+ // This will replace Step 4 : User approves the close. Beause both in 4695+ // Android and OH close will not be blocked by beforeunload event. 4696+ CloseContents(contents); 4697+#endif 4698 } else { 4699 CloseContents(contents); 4700 } 4701@@ -1180,6 +1187,14 @@ void AlloyBrowserHostImpl::CloseContents(content::WebContents* source) { 4702 if (handler.get()) { 4703 close_browser = !handler->DoClose(this); 4704 } 4705+#if BUILDFLAG(IS_OHOS) 4706+ // |DoClose| will notify the UI to close, |DESTRUCTION_STATE_NONE| means 4707+ // |CloseBrowser| has not been triggered by UI. We should close browser 4708+ // when received |CloseBrowser| request from UI. 4709+ if (destruction_state_ == DESTRUCTION_STATE_NONE) { 4710+ close_browser = false; 4711+ } 4712+#endif 4713 } 4714 4715 if (close_browser) { 4716@@ -1254,7 +1269,6 @@ bool AlloyBrowserHostImpl::HandleContextMenu( 4717 auto rvh = web_contents()->GetRenderViewHost(); 4718 CefRenderWidgetHostViewOSR* view = 4719 static_cast<CefRenderWidgetHostViewOSR*>(rvh->GetWidget()->GetView()); 4720- touch_insert_handle_menu_show_ = true; 4721 if (view) { 4722 CefTouchSelectionControllerClientOSR* touch_client = 4723 static_cast<CefTouchSelectionControllerClientOSR*>( 4724@@ -1750,6 +1764,23 @@ void AlloyBrowserHostImpl::StartDragging( 4725 } 4726 } 4727 4728+void AlloyBrowserHostImpl::ShowPopupMenu( 4729+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client, 4730+ const gfx::Rect& bounds, 4731+ int item_height, 4732+ double item_font_size, 4733+ int selected_item, 4734+ std::vector<blink::mojom::MenuItemPtr> menu_items, 4735+ bool right_aligned, 4736+ bool allow_multiple_selection) { 4737+ if (platform_delegate_) { 4738+ platform_delegate_->ShowPopupMenu(std::move(popup_client), bounds, 4739+ item_height, item_font_size, selected_item, 4740+ std::move(menu_items), right_aligned, 4741+ allow_multiple_selection); 4742+ } 4743+} 4744+ 4745 void AlloyBrowserHostImpl::UpdateDragCursor( 4746 ui::mojom::DragOperation operation) { 4747 if (platform_delegate_) 4748diff --git a/src/cef/libcef/browser/alloy/alloy_browser_host_impl.h b/src/cef/libcef/browser/alloy/alloy_browser_host_impl.h 4749index a59dfe1562b11..f134101b58cf0 4750--- a/src/cef/libcef/browser/alloy/alloy_browser_host_impl.h 4751+++ b/src/cef/libcef/browser/alloy/alloy_browser_host_impl.h 4752@@ -28,6 +28,7 @@ 4753 #include "content/public/browser/web_contents_delegate.h" 4754 #include "content/public/browser/web_contents_observer.h" 4755 #include "extensions/common/mojom/view_type.mojom-forward.h" 4756+#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h" 4757 4758 class CefAudioCapturer; 4759 class CefBrowserInfo; 4760@@ -207,9 +208,20 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, 4761 /* ohos webview begin */ 4762 void SetBackgroundColor(int color) override; 4763 void SetTouchInsertHandleMenuShow(bool show) { 4764- touch_insert_handle_menu_show_ = show; 4765+ web_contents()->SetTouchInsertHandleMenuShow(show); 4766 } 4767- bool GetTouchInsertHandleMenuShow() { return touch_insert_handle_menu_show_; } 4768+ bool GetTouchInsertHandleMenuShow() { 4769+ return web_contents()->GetTouchInsertHandleMenuShow(); 4770+ } 4771+ void ShowPopupMenu( 4772+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client, 4773+ const gfx::Rect& bounds, 4774+ int item_height, 4775+ double item_font_size, 4776+ int selected_item, 4777+ std::vector<blink::mojom::MenuItemPtr> menu_items, 4778+ bool right_aligned, 4779+ bool allow_multiple_selection); 4780 /* ohos webview end */ 4781 4782 // content::WebContentsDelegate methods. 4783diff --git a/src/cef/libcef/browser/alloy/alloy_browser_main.cc b/src/cef/libcef/browser/alloy/alloy_browser_main.cc 4784index c6136251089ae..63e13b778d4f7 4785--- a/src/cef/libcef/browser/alloy/alloy_browser_main.cc 4786+++ b/src/cef/libcef/browser/alloy/alloy_browser_main.cc 4787@@ -13,8 +13,6 @@ 4788 #include "libcef/browser/context.h" 4789 #include "libcef/browser/devtools/devtools_manager_delegate.h" 4790 #include "libcef/browser/extensions/extension_system_factory.h" 4791-#include "libcef/browser/net/chrome_scheme_handler.h" 4792-#include "libcef/browser/printing/constrained_window_views_client.h" 4793 #include "libcef/browser/thread_util.h" 4794 #include "libcef/common/app_manager.h" 4795 #include "libcef/common/extensions/extensions_util.h" 4796@@ -25,11 +23,8 @@ 4797 #include "base/task/post_task.h" 4798 #include "base/task/thread_pool.h" 4799 #include "chrome/browser/browser_process.h" 4800-#include "chrome/browser/media/router/chrome_media_router_factory.h" 4801 #include "chrome/browser/net/system_network_context_manager.h" 4802-#include "chrome/browser/plugins/plugin_finder.h" 4803 #include "chrome/common/chrome_switches.h" 4804-#include "components/constrained_window/constrained_window_views.h" 4805 #include "content/public/browser/gpu_data_manager.h" 4806 #include "content/public/browser/network_service_instance.h" 4807 #include "content/public/common/result_codes.h" 4808@@ -92,12 +87,31 @@ 4809 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" 4810 #endif 4811 4812+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 4813+#include "libcef/browser/net/chrome_scheme_handler.h" 4814+#endif 4815+ 4816+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 4817+#include "components/constrained_window/constrained_window_views.h" 4818+#include "libcef/browser/printing/constrained_window_views_client.h" 4819+#endif 4820+ 4821+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 4822+#include "chrome/browser/plugins/plugin_finder.h" 4823+#endif 4824+ 4825+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 4826+#include "chrome/browser/media/router/chrome_media_router_factory.h" 4827+#endif 4828+ 4829 AlloyBrowserMainParts::AlloyBrowserMainParts( 4830 content::MainFunctionParams parameters) 4831 : BrowserMainParts(), parameters_(std::move(parameters)) {} 4832 4833 AlloyBrowserMainParts::~AlloyBrowserMainParts() { 4834+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 4835 constrained_window::SetConstrainedWindowViewsClient(nullptr); 4836+#endif 4837 } 4838 4839 int AlloyBrowserMainParts::PreEarlyInitialization() { 4840@@ -111,7 +125,9 @@ int AlloyBrowserMainParts::PreEarlyInitialization() { 4841 } 4842 4843 void AlloyBrowserMainParts::ToolkitInitialized() { 4844+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 4845 SetConstrainedWindowViewsClient(CreateCefConstrainedWindowViewsClient()); 4846+#endif 4847 #if defined(USE_AURA) 4848 CHECK(aura::Env::GetInstance()); 4849 4850@@ -147,7 +163,9 @@ void AlloyBrowserMainParts::PreCreateMainMessageLoop() { 4851 ChromeBrowserMainPartsWin::SetupInstallerUtilStrings(); 4852 #endif // BUILDFLAG(IS_WIN) 4853 4854+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 4855 media_router::ChromeMediaRouterFactory::DoPlatformInit(); 4856+#endif 4857 } 4858 4859 void AlloyBrowserMainParts::PostCreateMainMessageLoop() { 4860@@ -237,10 +255,14 @@ int AlloyBrowserMainParts::PreMainMessageLoopRun() { 4861 InitializeWinParentalControls(); 4862 #endif 4863 4864+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 4865 // Triggers initialization of the singleton instance on UI thread. 4866 PluginFinder::GetInstance()->Init(); 4867+#endif 4868 4869+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 4870 scheme::RegisterWebUIControllerFactory(); 4871+#endif 4872 4873 #if BUILDFLAG(ENABLE_MEDIA_FOUNDATION_WIDEVINE_CDM) || \ 4874 BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) 4875diff --git a/src/cef/libcef/browser/alloy/alloy_content_browser_client.cc b/src/cef/libcef/browser/alloy/alloy_content_browser_client.cc 4876index 1b8696bd6ece0..cce0ad6a752ef 4877--- a/src/cef/libcef/browser/alloy/alloy_content_browser_client.cc 4878+++ b/src/cef/libcef/browser/alloy/alloy_content_browser_client.cc 4879@@ -28,7 +28,6 @@ 4880 #include "libcef/browser/extensions/extension_system.h" 4881 #include "libcef/browser/extensions/extension_web_contents_observer.h" 4882 #include "libcef/browser/media_capture_devices_dispatcher.h" 4883-#include "libcef/browser/net/chrome_scheme_handler.h" 4884 #include "libcef/browser/net/throttle_handler.h" 4885 #include "libcef/browser/net_service/cookie_manager_impl.h" 4886 #include "libcef/browser/net_service/login_delegate.h" 4887@@ -36,7 +35,6 @@ 4888 #include "libcef/browser/net_service/resource_request_handler_wrapper.h" 4889 #include "libcef/browser/net_service/restrict_cookie_manager.h" 4890 #include "libcef/browser/prefs/renderer_prefs.h" 4891-#include "libcef/browser/printing/print_view_manager.h" 4892 #include "libcef/browser/speech_recognition_manager_delegate.h" 4893 #include "libcef/browser/ssl_info_impl.h" 4894 #include "libcef/browser/thread_util.h" 4895@@ -66,36 +64,24 @@ 4896 #include "chrome/browser/net/profile_network_context_service.h" 4897 #include "chrome/browser/net/profile_network_context_service_factory.h" 4898 #include "chrome/browser/net/system_network_context_manager.h" 4899-#include "chrome/browser/pdf/chrome_pdf_stream_delegate.h" 4900-#include "chrome/browser/plugins/pdf_iframe_navigation_throttle.h" 4901-#include "chrome/browser/plugins/plugin_info_host_impl.h" 4902-#include "chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h" 4903 #include "chrome/browser/plugins/plugin_utils.h" 4904 #include "chrome/browser/profiles/profile.h" 4905 #include "chrome/browser/profiles/renderer_updater.h" 4906 #include "chrome/browser/profiles/renderer_updater_factory.h" 4907-#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h" 4908 #include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h" 4909 #include "chrome/common/chrome_content_client.h" 4910 #include "chrome/common/chrome_paths.h" 4911 #include "chrome/common/chrome_switches.h" 4912 #include "chrome/common/google_url_loader_throttle.h" 4913-#include "chrome/common/pdf_util.h" 4914 #include "chrome/common/pref_names.h" 4915 #include "chrome/common/webui_url_constants.h" 4916 #include "chrome/grit/browser_resources.h" 4917 #include "chrome/grit/generated_resources.h" 4918-#include "chrome/services/printing/printing_service.h" 4919 #include "components/content_settings/core/browser/cookie_settings.h" 4920 #include "components/embedder_support/switches.h" 4921 #include "components/embedder_support/user_agent_utils.h" 4922-#include "components/pdf/browser/pdf_navigation_throttle.h" 4923-#include "components/pdf/browser/pdf_url_loader_request_interceptor.h" 4924-#include "components/pdf/browser/pdf_web_contents_helper.h" 4925-#include "components/pdf/common/internal_plugin_helpers.h" 4926 #include "components/spellcheck/common/spellcheck.mojom.h" 4927 #include "components/version_info/version_info.h" 4928-#include "content/browser/plugin_service_impl.h" 4929 #include "content/browser/renderer_host/render_frame_host_impl.h" 4930 #include "content/public/browser/browser_context.h" 4931 #include "content/public/browser/browser_ppapi_host.h" 4932@@ -180,6 +166,37 @@ 4933 #include "chrome/browser/spellchecker/spell_check_panel_host_impl.h" 4934 #endif 4935 4936+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 4937+#include "libcef/browser/net/chrome_scheme_handler.h" 4938+#endif 4939+ 4940+#if BUILDFLAG(IS_OHOS) 4941+#include "printing/buildflags/buildflags.h" 4942+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) 4943+#include "chrome/services/printing/printing_service.h" 4944+#include "libcef/browser/printing/print_view_manager.h" 4945+#endif 4946+#endif 4947+ 4948+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 4949+#include "chrome/browser/plugins/plugin_info_host_impl.h" 4950+#include "chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h" 4951+#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h" 4952+#include "content/browser/plugin_service_impl.h" 4953+#endif 4954+ 4955+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 4956+#include "chrome/browser/pdf/chrome_pdf_stream_delegate.h" 4957+#include "chrome/browser/plugins/pdf_iframe_navigation_throttle.h" 4958+#include "chrome/common/pdf_util.h" 4959+#include "components/pdf/browser/pdf_navigation_throttle.h" 4960+#include "components/pdf/browser/pdf_url_loader_request_interceptor.h" 4961+#include "components/pdf/browser/pdf_web_contents_helper.h" 4962+#include "components/pdf/common/internal_plugin_helpers.h" 4963+#else 4964+#include "content/public/browser/url_loader_request_interceptor.h" 4965+#endif 4966+ 4967 namespace { 4968 void TransferVector(const std::vector<std::string>& source, 4969 std::vector<CefString>& target) { 4970@@ -644,6 +661,7 @@ int GetCrashSignalFD(const base::CommandLine& command_line) { 4971 } 4972 #endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) 4973 4974+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 4975 // From chrome/browser/plugins/chrome_content_browser_client_plugins_part.cc. 4976 void BindPluginInfoHost( 4977 int render_process_id, 4978@@ -659,6 +677,7 @@ void BindPluginInfoHost( 4979 std::make_unique<PluginInfoHostImpl>(render_process_id, profile), 4980 std::move(receiver)); 4981 } 4982+#endif 4983 4984 base::FilePath GetRootCachePath() { 4985 // The CefContext::ValidateCachePath method enforces the requirement that all 4986@@ -817,7 +836,11 @@ void AlloyContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( 4987 4988 bool AlloyContentBrowserClient::IsWebUIAllowedToMakeNetworkRequests( 4989 const url::Origin& origin) { 4990+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 4991 return scheme::IsWebUIAllowedToMakeNetworkRequests(origin); 4992+#else 4993+ return false; 4994+#endif 4995 } 4996 4997 bool AlloyContentBrowserClient::IsHandledURL(const GURL& url) { 4998@@ -1270,7 +1293,9 @@ bool AlloyContentBrowserClient::OverrideWebPreferencesAfterNavigation( 4999 5000 void AlloyContentBrowserClient::BrowserURLHandlerCreated( 5001 content::BrowserURLHandler* handler) { 5002+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5003 scheme::BrowserURLHandlerCreated(handler); 5004+#endif 5005 } 5006 5007 std::string AlloyContentBrowserClient::GetDefaultDownloadName() { 5008@@ -1279,9 +1304,11 @@ std::string AlloyContentBrowserClient::GetDefaultDownloadName() { 5009 5010 void AlloyContentBrowserClient::DidCreatePpapiPlugin( 5011 content::BrowserPpapiHost* browser_host) { 5012+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 5013 browser_host->GetPpapiHost()->AddHostFactoryFilter( 5014 std::unique_ptr<ppapi::host::HostFactory>( 5015 new ChromeBrowserPepperHostFactory(browser_host))); 5016+#endif 5017 } 5018 5019 std::unique_ptr<content::DevToolsManagerDelegate> 5020@@ -1302,6 +1329,7 @@ void AlloyContentBrowserClient:: 5021 }, 5022 &render_frame_host)); 5023 5024+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5025 associated_registry.AddInterface(base::BindRepeating( 5026 [](content::RenderFrameHost* render_frame_host, 5027 mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> 5028@@ -1310,7 +1338,9 @@ void AlloyContentBrowserClient:: 5029 render_frame_host); 5030 }, 5031 &render_frame_host)); 5032+#endif 5033 5034+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 5035 associated_registry.AddInterface(base::BindRepeating( 5036 [](content::RenderFrameHost* render_frame_host, 5037 mojo::PendingAssociatedReceiver<pdf::mojom::PdfService> receiver) { 5038@@ -1318,6 +1348,7 @@ void AlloyContentBrowserClient:: 5039 render_frame_host); 5040 }, 5041 &render_frame_host)); 5042+#endif 5043 } 5044 5045 std::vector<std::unique_ptr<content::NavigationThrottle>> 5046@@ -1325,6 +1356,7 @@ AlloyContentBrowserClient::CreateThrottlesForNavigation( 5047 content::NavigationHandle* navigation_handle) { 5048 throttle::NavigationThrottleList throttles; 5049 5050+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 5051 if (extensions::ExtensionsEnabled()) { 5052 auto pdf_iframe_throttle = 5053 PDFIFrameNavigationThrottle::MaybeCreateThrottleFor(navigation_handle); 5054@@ -1336,6 +1368,7 @@ AlloyContentBrowserClient::CreateThrottlesForNavigation( 5055 if (pdf_throttle) 5056 throttles.push_back(std::move(pdf_throttle)); 5057 } 5058+#endif 5059 5060 throttle::CreateThrottlesForNavigation(navigation_handle, throttles); 5061 5062@@ -1351,9 +1384,11 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles( 5063 int frame_tree_node_id) { 5064 std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result; 5065 5066+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 5067 // Used to substitute View ID for PDF contents when using the PDF plugin. 5068 result.push_back(std::make_unique<PluginResponseInterceptorURLLoaderThrottle>( 5069 request.destination, frame_tree_node_id)); 5070+#endif 5071 5072 Profile* profile = Profile::FromBrowserContext(browser_context); 5073 5074@@ -1376,6 +1411,7 @@ AlloyContentBrowserClient::WillCreateURLLoaderRequestInterceptors( 5075 std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>> 5076 interceptors; 5077 5078+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 5079 if (extensions::ExtensionsEnabled()) { 5080 auto pdf_interceptor = 5081 pdf::PdfURLLoaderRequestInterceptor::MaybeCreateInterceptor( 5082@@ -1383,6 +1419,7 @@ AlloyContentBrowserClient::WillCreateURLLoaderRequestInterceptors( 5083 if (pdf_interceptor) 5084 interceptors.push_back(std::move(pdf_interceptor)); 5085 } 5086+#endif 5087 5088 return interceptors; 5089 } 5090@@ -1403,8 +1440,10 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer( 5091 service_manager::BinderRegistry* registry, 5092 blink::AssociatedInterfaceRegistry* associated_registry, 5093 content::RenderProcessHost* host) { 5094+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 5095 associated_registry->AddInterface( 5096 base::BindRepeating(&BindPluginInfoHost, host->GetID())); 5097+#endif 5098 5099 if (extensions::ExtensionsEnabled()) { 5100 associated_registry->AddInterface(base::BindRepeating( 5101@@ -1789,11 +1828,15 @@ base::flat_set<std::string> 5102 AlloyContentBrowserClient::GetPluginMimeTypesWithExternalHandlers( 5103 content::BrowserContext* browser_context) { 5104 base::flat_set<std::string> mime_types; 5105+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 5106 auto map = PluginUtils::GetMimeTypeToExtensionIdMap(browser_context); 5107 for (const auto& pair : map) 5108 mime_types.insert(pair.first); 5109+#endif 5110+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 5111 if (pdf::IsInternalPluginExternallyHandled()) 5112 mime_types.insert(pdf::kInternalPluginMimeType); 5113+#endif 5114 return mime_types; 5115 } 5116 5117@@ -1808,6 +1851,7 @@ bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed( 5118 ->IsFullCookieAccessAllowed(url, site_for_cookies, top_frame_origin); 5119 } 5120 5121+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 5122 bool AlloyContentBrowserClient::ShouldAllowPluginCreation( 5123 const url::Origin& embedder_origin, 5124 const content::PepperPluginInfo& plugin_info) { 5125@@ -1817,6 +1861,7 @@ bool AlloyContentBrowserClient::ShouldAllowPluginCreation( 5126 5127 return true; 5128 } 5129+#endif 5130 5131 #if BUILDFLAG(IS_OHOS) 5132 bool AlloyContentBrowserClient::ShouldTryToUseExistingProcessHost( 5133@@ -1895,10 +1940,14 @@ void AlloyContentBrowserClient::OnWebContentsCreated( 5134 5135 bool AlloyContentBrowserClient::IsFindInPageDisabledForOrigin( 5136 const url::Origin& origin) { 5137+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 5138 // For PDF viewing with the PPAPI-free PDF Viewer, find-in-page should only 5139 // display results from the PDF content, and not from the UI. 5140 return base::FeatureList::IsEnabled(chrome_pdf::features::kPdfUnseasoned) && 5141 IsPdfExtensionOrigin(origin); 5142+#else 5143+ return false; 5144+#endif 5145 } 5146 5147 CefRefPtr<CefRequestContextImpl> AlloyContentBrowserClient::request_context() 5148diff --git a/src/cef/libcef/browser/alloy/alloy_content_browser_client.h b/src/cef/libcef/browser/alloy/alloy_content_browser_client.h 5149index eed665622b379..6bab20215fa3c 5150--- a/src/cef/libcef/browser/alloy/alloy_content_browser_client.h 5151+++ b/src/cef/libcef/browser/alloy/alloy_content_browser_client.h 5152@@ -244,9 +244,11 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { 5153 const GURL& scope, 5154 const net::SiteForCookies& site_for_cookies, 5155 const absl::optional<url::Origin>& top_frame_origin) override; 5156+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 5157 bool ShouldAllowPluginCreation( 5158 const url::Origin& embedder_origin, 5159 const content::PepperPluginInfo& plugin_info) override; 5160+#endif 5161 void OnWebContentsCreated(content::WebContents* web_contents) override; 5162 bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override; 5163 5164diff --git a/src/cef/libcef/browser/alloy/browser_platform_delegate_alloy.cc b/src/cef/libcef/browser/alloy/browser_platform_delegate_alloy.cc 5165index 082421f19893c..8c27ed9a7c81d 5166--- a/src/cef/libcef/browser/alloy/browser_platform_delegate_alloy.cc 5167+++ b/src/cef/libcef/browser/alloy/browser_platform_delegate_alloy.cc 5168@@ -10,14 +10,11 @@ 5169 #include "libcef/browser/extensions/extension_system.h" 5170 #include "libcef/browser/extensions/extension_view_host.h" 5171 #include "libcef/browser/extensions/extension_web_contents_observer.h" 5172-#include "libcef/browser/printing/print_view_manager.h" 5173 #include "libcef/common/extensions/extensions_util.h" 5174 #include "libcef/common/net/url_util.h" 5175 #include "libcef/features/runtime_checks.h" 5176 5177 #include "base/logging.h" 5178-#include "chrome/browser/printing/print_view_manager.h" 5179-#include "chrome/browser/printing/print_view_manager_common.h" 5180 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" 5181 #include "components/find_in_page/find_tab_helper.h" 5182 #include "components/find_in_page/find_types.h" 5183@@ -31,12 +28,23 @@ 5184 #include "printing/mojom/print.mojom.h" 5185 #include "third_party/blink/public/mojom/frame/find_in_page.mojom.h" 5186 5187+#if BUILDFLAG(IS_OHOS) 5188+#include "printing/buildflags/buildflags.h" 5189+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) 5190+#include "libcef/browser/printing/print_view_manager.h" 5191+#include "chrome/browser/printing/print_view_manager.h" 5192+#include "chrome/browser/printing/print_view_manager_common.h" 5193+#endif 5194+#endif 5195+ 5196 namespace { 5197 5198+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5199 printing::CefPrintViewManager* GetPrintViewManager( 5200 content::WebContents* web_contents) { 5201 return printing::CefPrintViewManager::FromWebContents(web_contents); 5202 } 5203+#endif 5204 5205 } // namespace 5206 5207@@ -181,7 +189,9 @@ void CefBrowserPlatformDelegateAlloy::BrowserCreated( 5208 web_contents_->SetDelegate(static_cast<AlloyBrowserHostImpl*>(browser)); 5209 5210 PrefsTabHelper::CreateForWebContents(web_contents_); 5211+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5212 printing::CefPrintViewManager::CreateForWebContents(web_contents_); 5213+#endif 5214 5215 if (extensions::ExtensionsEnabled()) { 5216 // Used by the tabs extension API. 5217@@ -363,6 +373,7 @@ bool CefBrowserPlatformDelegateAlloy::IsPrintPreviewSupported() const { 5218 } 5219 5220 void CefBrowserPlatformDelegateAlloy::Print() { 5221+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5222 REQUIRE_ALLOY_RUNTIME(); 5223 5224 auto contents_to_use = printing::GetWebContentsToUse(web_contents_); 5225@@ -378,12 +389,14 @@ void CefBrowserPlatformDelegateAlloy::Print() { 5226 } else { 5227 GetPrintViewManager(contents_to_use)->PrintNow(rfh_to_use); 5228 } 5229+#endif 5230 } 5231 5232 void CefBrowserPlatformDelegateAlloy::PrintToPDF( 5233 const CefString& path, 5234 const CefPdfPrintSettings& settings, 5235 CefRefPtr<CefPdfPrintCallback> callback) { 5236+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5237 REQUIRE_ALLOY_RUNTIME(); 5238 5239 auto contents_to_use = printing::GetWebContentsToUse(web_contents_); 5240@@ -402,6 +415,7 @@ void CefBrowserPlatformDelegateAlloy::PrintToPDF( 5241 GetPrintViewManager(contents_to_use) 5242 ->PrintToPDF(rfh_to_use, base::FilePath(path), settings, 5243 std::move(pdf_callback)); 5244+#endif 5245 } 5246 5247 void CefBrowserPlatformDelegateAlloy::Find(const CefString& searchText, 5248diff --git a/src/cef/libcef/browser/alloy/chrome_browser_process_alloy.cc b/src/cef/libcef/browser/alloy/chrome_browser_process_alloy.cc 5249index 0e636b44e566f..72e3e714a4a77 5250--- a/src/cef/libcef/browser/alloy/chrome_browser_process_alloy.cc 5251+++ b/src/cef/libcef/browser/alloy/chrome_browser_process_alloy.cc 5252@@ -19,9 +19,7 @@ 5253 #include "chrome/browser/component_updater/chrome_component_updater_configurator.h" 5254 #include "chrome/browser/net/system_network_context_manager.h" 5255 #include "chrome/browser/policy/chrome_browser_policy_connector.h" 5256-#include "chrome/browser/printing/background_printing_manager.h" 5257 #include "chrome/browser/printing/print_job_manager.h" 5258-#include "chrome/browser/printing/print_preview_dialog_controller.h" 5259 #include "chrome/browser/ui/prefs/pref_watcher.h" 5260 #include "components/component_updater/component_updater_service.h" 5261 #include "components/component_updater/timer_update_scheduler.h" 5262@@ -94,7 +92,9 @@ void ChromeBrowserProcessAlloy::CleanupOnUIThread() { 5263 // tasks to run once teardown has started. 5264 print_job_manager_->Shutdown(); 5265 print_job_manager_.reset(nullptr); 5266+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5267 print_preview_dialog_controller_ = nullptr; 5268+#endif 5269 5270 profile_manager_.reset(); 5271 event_router_forwarder_ = nullptr; 5272@@ -112,16 +112,20 @@ void ChromeBrowserProcessAlloy::CleanupOnUIThread() { 5273 if (pref_watcher) 5274 pref_watcher->Shutdown(); 5275 5276+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5277 // Unregister observers for |background_printing_manager_|. 5278 if (background_printing_manager_) { 5279 background_printing_manager_->DeletePreviewContentsForBrowserContext( 5280 profile); 5281 } 5282+#endif 5283 } 5284 5285 local_state_.reset(); 5286 browser_policy_connector_.reset(); 5287+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5288 background_printing_manager_.reset(); 5289+#endif 5290 field_trial_list_.reset(); 5291 component_updater_.reset(); 5292 5293@@ -259,20 +263,28 @@ printing::PrintJobManager* ChromeBrowserProcessAlloy::print_job_manager() { 5294 5295 printing::PrintPreviewDialogController* 5296 ChromeBrowserProcessAlloy::print_preview_dialog_controller() { 5297+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5298 if (!print_preview_dialog_controller_.get()) { 5299 print_preview_dialog_controller_ = 5300 new printing::PrintPreviewDialogController(); 5301 } 5302 return print_preview_dialog_controller_.get(); 5303+#else 5304+ return nullptr; 5305+#endif 5306 } 5307 5308 printing::BackgroundPrintingManager* 5309 ChromeBrowserProcessAlloy::background_printing_manager() { 5310+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5311 if (!background_printing_manager_.get()) { 5312 background_printing_manager_.reset( 5313 new printing::BackgroundPrintingManager()); 5314 } 5315 return background_printing_manager_.get(); 5316+#else 5317+ return nullptr; 5318+#endif 5319 } 5320 5321 IntranetRedirectDetector* 5322diff --git a/src/cef/libcef/browser/alloy/chrome_browser_process_alloy.h b/src/cef/libcef/browser/alloy/chrome_browser_process_alloy.h 5323index 1a3fea0944156..b6a9253870c95 5324--- a/src/cef/libcef/browser/alloy/chrome_browser_process_alloy.h 5325+++ b/src/cef/libcef/browser/alloy/chrome_browser_process_alloy.h 5326@@ -18,6 +18,14 @@ 5327 #include "chrome/browser/extensions/event_router_forwarder.h" 5328 #include "media/media_buildflags.h" 5329 5330+#if BUILDFLAG(IS_OHOS) 5331+#include "printing/buildflags/buildflags.h" 5332+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) 5333+#include "chrome/browser/printing/background_printing_manager.h" 5334+#include "chrome/browser/printing/print_preview_dialog_controller.h" 5335+#endif 5336+#endif 5337+ 5338 namespace extensions { 5339 class ExtensionsBrowserClient; 5340 class ExtensionsClient; 5341@@ -127,10 +135,12 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { 5342 std::unique_ptr<printing::PrintJobManager> print_job_manager_; 5343 std::unique_ptr<ChromeProfileManagerAlloy> profile_manager_; 5344 scoped_refptr<extensions::EventRouterForwarder> event_router_forwarder_; 5345+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 5346 scoped_refptr<printing::PrintPreviewDialogController> 5347 print_preview_dialog_controller_; 5348 std::unique_ptr<printing::BackgroundPrintingManager> 5349 background_printing_manager_; 5350+#endif 5351 std::unique_ptr<PrefService> local_state_; 5352 // Must be destroyed after |local_state_|. 5353 std::unique_ptr<policy::ChromeBrowserPolicyConnector> 5354diff --git a/src/cef/libcef/browser/browser_context.cc b/src/cef/libcef/browser/browser_context.cc 5355index 63793430388b0..0fdd5a18c9d67 5356--- a/src/cef/libcef/browser/browser_context.cc 5357+++ b/src/cef/libcef/browser/browser_context.cc 5358@@ -8,7 +8,6 @@ 5359 #include <utility> 5360 5361 #include "libcef/browser/context.h" 5362-#include "libcef/browser/media_router/media_router_manager.h" 5363 #include "libcef/browser/request_context_impl.h" 5364 #include "libcef/browser/thread_util.h" 5365 #include "libcef/common/cef_switches.h" 5366@@ -28,6 +27,10 @@ 5367 #include "content/public/browser/browser_thread.h" 5368 #include "content/public/browser/storage_partition.h" 5369 5370+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 5371+#include "libcef/browser/media_router/media_router_manager.h" 5372+#endif 5373+ 5374 using content::BrowserThread; 5375 5376 namespace { 5377@@ -212,8 +215,10 @@ void CefBrowserContext::Shutdown() { 5378 // Unregister the context first to avoid re-entrancy during shutdown. 5379 g_manager.Get().RemoveImpl(this, cache_path_); 5380 5381+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 5382 // Destroy objects that may hold references to the MediaRouter. 5383 media_router_manager_.reset(); 5384+#endif 5385 5386 // Invalidate any Getter references to this object. 5387 weak_ptr_factory_.InvalidateWeakPtrs(); 5388@@ -264,6 +269,7 @@ CefBrowserContext* CefBrowserContext::FromProfile(const Profile* profile) { 5389 if (cef_context) 5390 return cef_context; 5391 5392+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5393 if (cef::IsChromeRuntimeEnabled()) { 5394 auto* original_profile = profile->GetOriginalProfile(); 5395 if (original_profile != profile) { 5396@@ -273,6 +279,7 @@ CefBrowserContext* CefBrowserContext::FromProfile(const Profile* profile) { 5397 return FromBrowserContext(original_profile); 5398 } 5399 } 5400+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5401 5402 return nullptr; 5403 } 5404@@ -403,6 +410,7 @@ network::mojom::NetworkContext* CefBrowserContext::GetNetworkContext() { 5405 return browser_context->GetDefaultStoragePartition()->GetNetworkContext(); 5406 } 5407 5408+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 5409 CefMediaRouterManager* CefBrowserContext::GetMediaRouterManager() { 5410 CEF_REQUIRE_UIT(); 5411 if (!media_router_manager_) { 5412@@ -410,6 +418,7 @@ CefMediaRouterManager* CefBrowserContext::GetMediaRouterManager() { 5413 } 5414 return media_router_manager_.get(); 5415 } 5416+#endif 5417 5418 CefBrowserContext::CookieableSchemes CefBrowserContext::GetCookieableSchemes() 5419 const { 5420diff --git a/src/cef/libcef/browser/browser_context.h b/src/cef/libcef/browser/browser_context.h 5421index 3bae0202a7521..f8d95ac12f29b 5422--- a/src/cef/libcef/browser/browser_context.h 5423+++ b/src/cef/libcef/browser/browser_context.h 5424@@ -22,6 +22,10 @@ 5425 #include "third_party/abseil-cpp/absl/types/optional.h" 5426 #include "url/origin.h" 5427 5428+#if BUILDFLAG(IS_OHOS) 5429+#include "media/media_buildflags.h" 5430+#endif 5431+ 5432 /* 5433 // Classes used in request processing (network, storage, service, etc.): 5434 // 5435@@ -220,7 +224,9 @@ class CefBrowserContext { 5436 5437 scoped_refptr<CefIOThreadState> iothread_state_; 5438 CookieableSchemes cookieable_schemes_; 5439+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 5440 std::unique_ptr<CefMediaRouterManager> media_router_manager_; 5441+#endif 5442 5443 // CefRequestContextImpl objects referencing this object. 5444 std::set<CefRequestContextImpl*> request_context_set_; 5445diff --git a/src/cef/libcef/browser/browser_context_keyed_service_factories.cc b/src/cef/libcef/browser/browser_context_keyed_service_factories.cc 5446index 32a11de3e1280..a46ac3be4a3f6 5447--- a/src/cef/libcef/browser/browser_context_keyed_service_factories.cc 5448+++ b/src/cef/libcef/browser/browser_context_keyed_service_factories.cc 5449@@ -6,8 +6,6 @@ 5450 #include "libcef/common/extensions/extensions_util.h" 5451 5452 #include "chrome/browser/content_settings/cookie_settings_factory.h" 5453-#include "chrome/browser/media/router/chrome_media_router_factory.h" 5454-#include "chrome/browser/plugins/plugin_prefs_factory.h" 5455 #include "chrome/browser/profiles/renderer_updater_factory.h" 5456 #include "chrome/browser/spellchecker/spellcheck_factory.h" 5457 #include "chrome/browser/themes/theme_service_factory.h" 5458@@ -16,12 +14,30 @@ 5459 #include "extensions/browser/api/storage/storage_frontend.h" 5460 #include "extensions/browser/renderer_startup_helper.h" 5461 5462+#if BUILDFLAG(IS_OHOS) 5463+#include "ppapi/buildflags/buildflags.h" 5464+#if BUILDFLAG(ENABLE_PLUGINS) 5465+#include "chrome/browser/plugins/plugin_prefs_factory.h" 5466+#endif 5467+#endif 5468+ 5469+#if BUILDFLAG(IS_OHOS) 5470+#include "media/media_buildflags.h" 5471+#if BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 5472+#include "chrome/browser/media/router/chrome_media_router_factory.h" 5473+#endif 5474+#endif 5475+ 5476 namespace cef { 5477 5478 void EnsureBrowserContextKeyedServiceFactoriesBuilt() { 5479 CookieSettingsFactory::GetInstance(); 5480+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 5481 media_router::ChromeMediaRouterFactory::GetInstance(); 5482+#endif 5483+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 5484 PluginPrefsFactory::GetInstance(); 5485+#endif 5486 PrefsTabHelper::GetServiceInstance(); 5487 RendererUpdaterFactory::GetInstance(); 5488 SpellcheckServiceFactory::GetInstance(); 5489diff --git a/src/cef/libcef/browser/browser_host_base.cc b/src/cef/libcef/browser/browser_host_base.cc 5490index d5981638bf6e3..0a405c3919a4b 5491--- a/src/cef/libcef/browser/browser_host_base.cc 5492+++ b/src/cef/libcef/browser/browser_host_base.cc 5493@@ -50,6 +50,7 @@ 5494 #include "base/strings/string_number_conversions.h" 5495 #include "chrome/browser/browser_process.h" 5496 #include "content/public/common/mhtml_generation_params.h" 5497+#include "libcef/browser/navigation_state_serializer.h" 5498 #include "libcef/browser/javascript/oh_javascript_injector.h" 5499 #include "ui/base/resource/resource_bundle.h" 5500 #endif 5501@@ -423,7 +424,9 @@ void CefBrowserHostBase::GetNavigationEntries( 5502 CefRefPtr<CefNavigationEntryImpl> entry = 5503 new CefNavigationEntryImpl(controller.GetEntryAtIndex(current)); 5504 visitor->Visit(entry.get(), true, current, total); 5505+#if !BUILDFLAG(IS_OHOS) 5506 std::ignore = entry->Detach(nullptr); 5507+#endif 5508 } else { 5509 // Visit all entries. 5510 bool cont = true; 5511@@ -431,7 +434,9 @@ void CefBrowserHostBase::GetNavigationEntries( 5512 CefRefPtr<CefNavigationEntryImpl> entry = 5513 new CefNavigationEntryImpl(controller.GetEntryAtIndex(i)); 5514 cont = visitor->Visit(entry.get(), (i == current), i, total); 5515+#if !BUILDFLAG(IS_OHOS) 5516 std::ignore = entry->Detach(nullptr); 5517+#endif 5518 } 5519 } 5520 } 5521@@ -494,6 +499,7 @@ void CefBrowserHostBase::UpdateBrowserSettings( 5522 // browser_settings.file_access_from_file_urls; 5523 /* ohos webview add*/ 5524 settings_.force_dark_mode_enabled = browser_settings.force_dark_mode_enabled; 5525+ settings_.dark_prefer_color_scheme_enabled = browser_settings.dark_prefer_color_scheme_enabled; 5526 settings_.javascript_can_open_windows_automatically = 5527 browser_settings.javascript_can_open_windows_automatically; 5528 settings_.loads_images_automatically = 5529@@ -515,6 +521,10 @@ void CefBrowserHostBase::UpdateBrowserSettings( 5530 settings_.viewport_meta_enabled = browser_settings.viewport_meta_enabled; 5531 settings_.user_gesture_required = browser_settings.user_gesture_required; 5532 settings_.pinch_smooth_mode = browser_settings.pinch_smooth_mode; 5533+#if BUILDFLAG(IS_OHOS) 5534+ settings_.hide_vertical_scrollbars = browser_settings.hide_vertical_scrollbars; 5535+ settings_.hide_horizontal_scrollbars = browser_settings.hide_horizontal_scrollbars; 5536+#endif 5537 } 5538 5539 void CefBrowserHostBase::SetWebPreferences( 5540@@ -706,6 +716,21 @@ void CefBrowserHostBase::GoBack() { 5541 } 5542 } 5543 5544+CefString CefBrowserHostBase::GetOriginalUrl() { 5545+ auto web_contents = GetWebContents(); 5546+ if (web_contents) { 5547+ return web_contents->GetController().GetOriginalUrl(); 5548+ } 5549+ return base::EmptyString(); 5550+} 5551+ 5552+void CefBrowserHostBase::PutNetworkAvailable(bool available) { 5553+ auto frame = GetMainFrame(); 5554+ if (frame && frame->IsValid()) { 5555+ static_cast<CefFrameHostImpl*>(frame.get())->SetJsOnlineProperty(available); 5556+ } 5557+} 5558+ 5559 bool CefBrowserHostBase::CanGoForward() { 5560 base::AutoLock lock_scope(state_lock_); 5561 auto wc = GetWebContents(); 5562@@ -747,7 +772,8 @@ void CefBrowserHostBase::ExitFullScreen() { 5563 return; 5564 } 5565 wc->GetMainFrame()->AllowInjectingJavaScript(); 5566- std::string jscode("{if(document.fullscreenElement){document.exitFullscreen()}}"); 5567+ std::string jscode( 5568+ "{if(document.fullscreenElement){document.exitFullscreen()}}"); 5569 wc->GetMainFrame()->ExecuteJavaScript(base::UTF8ToUTF16(jscode), 5570 base::NullCallback()); 5571 } 5572@@ -942,6 +968,74 @@ void CefBrowserHostBase::UpdateLocale(const CefString& locale) { 5573 g_browser_process->SetApplicationLocale(result); 5574 } 5575 } 5576+ 5577+void CefBrowserHostBase::RemoveCache(bool include_disk_files) { 5578+ auto frame = GetMainFrame(); 5579+ if (!frame) { 5580+ LOG(ERROR) << "browser host remove cache failed, frame is null"; 5581+ return; 5582+ } 5583+ if (frame->IsValid()) { 5584+ static_cast<CefFrameHostImpl*>(frame.get()) 5585+ ->RemoveCache(include_disk_files); 5586+ } else { 5587+ LOG(ERROR) << "browser host remove cache failed, frame is not valid"; 5588+ return; 5589+ } 5590+} 5591+void CefBrowserHostBase::ScrollPageUpDown(bool is_up, 5592+ bool is_half, 5593+ float view_height) { 5594+ auto frame = GetMainFrame(); 5595+ if (frame && frame->IsValid()) { 5596+ static_cast<CefFrameHostImpl*>(frame.get()) 5597+ ->ScrollPageUpDown(is_up, is_half, view_height); 5598+ } 5599+} 5600+ 5601+void CefBrowserHostBase::ScrollTo(float x, 5602+ float y) { 5603+ auto frame = GetMainFrame(); 5604+ if (frame && frame->IsValid()) { 5605+ static_cast<CefFrameHostImpl*>(frame.get()) 5606+ ->ScrollTo(x, y); 5607+ } 5608+} 5609+ 5610+void CefBrowserHostBase::ScrollBy(float delta_x, 5611+ float delta_y) { 5612+ auto frame = GetMainFrame(); 5613+ if (frame && frame->IsValid()) { 5614+ static_cast<CefFrameHostImpl*>(frame.get()) 5615+ ->ScrollBy(delta_x, delta_y); 5616+ } 5617+} 5618+ 5619+void CefBrowserHostBase::SlideScroll(float vx, 5620+ float vy) { 5621+ auto frame = GetMainFrame(); 5622+ if (frame && frame->IsValid()) { 5623+ static_cast<CefFrameHostImpl*>(frame.get()) 5624+ ->SlideScroll(vx, vy); 5625+ } 5626+} 5627+ 5628+CefRefPtr<CefBinaryValue> CefBrowserHostBase::GetWebState() { 5629+ auto web_contents = GetWebContents(); 5630+ if (!web_contents) { 5631+ return nullptr; 5632+ } 5633+ 5634+ return NavigationStateSerializer::WriteNavigationStatus(*web_contents); 5635+} 5636+ 5637+bool CefBrowserHostBase::RestoreWebState(const CefRefPtr<CefBinaryValue> state) { 5638+ auto web_contents = GetWebContents(); 5639+ if (!web_contents || !state) { 5640+ return false; 5641+ } 5642+ return NavigationStateSerializer::RestoreNavigationStatus(*web_contents, state); 5643+} 5644 #endif // IS_OHOS 5645 5646 void CefBrowserHostBase::StopLoad() { 5647@@ -1508,19 +1602,32 @@ void CefBrowserHostBase::ClosePort(CefString& portHandle) { 5648 } 5649 5650 void CefBrowserHostBase::PostPortMessage(CefString& portHandle, 5651- CefString& data) { 5652+ CefRefPtr<CefValue> data) { 5653 auto web_contents = GetWebContents(); 5654 if (!web_contents) { 5655 LOG(ERROR) << "GetWebContents null"; 5656 return; 5657 } 5658 5659- std::u16string message(base::UTF8ToUTF16(data.ToString())); 5660+ blink::WebMessagePort::Message message; 5661+ if (data->GetType() == VTYPE_STRING) { 5662+ message = blink::WebMessagePort::Message(base::UTF8ToUTF16(data->GetString().ToString())); 5663+ } else if (data->GetType() == VTYPE_BINARY) { 5664+ CefRefPtr<CefBinaryValue> binValue = data->GetBinary(); 5665+ size_t len = binValue->GetSize(); 5666+ std::vector<uint8_t> arr(len); 5667+ binValue->GetData(&arr[0], len, 0); 5668+ message = blink::WebMessagePort::Message(std::move(arr)); 5669+ } else { 5670+ LOG(ERROR) << "CefBrowserHostBase::PostPortMessage not support type"; 5671+ return; 5672+ } 5673+ 5674 // find the WebMessagePort in map 5675 for (auto iter = portMap_.begin(); iter != portMap_.end(); ++iter) { 5676 if (portHandle.ToString().compare(std::to_string(iter->first.first)) == 0) { 5677 if (iter->second.first.CanPostMessage()) { 5678- iter->second.first.PostMessage(blink::WebMessagePort::Message(message)); 5679+ iter->second.first.PostMessage(std::move(message)); 5680 } else { 5681 LOG(ERROR) << "port can not post messsage"; 5682 } 5683@@ -1528,8 +1635,7 @@ void CefBrowserHostBase::PostPortMessage(CefString& portHandle, 5684 } else if (portHandle.ToString().compare( 5685 std::to_string(iter->first.second)) == 0) { 5686 if (iter->second.second.CanPostMessage()) { 5687- iter->second.second.PostMessage( 5688- blink::WebMessagePort::Message(message)); 5689+ iter->second.second.PostMessage(std::move(message)); 5690 } else { 5691 LOG(ERROR) << "port can not post messsage"; 5692 } 5693@@ -1543,7 +1649,7 @@ void CefBrowserHostBase::PostPortMessage(CefString& portHandle, 5694 // WebMessagePort of the pipe. 5695 void CefBrowserHostBase::SetPortMessageCallback( 5696 CefString& portHandle, 5697- CefRefPtr<CefJavaScriptResultCallback> callback) { 5698+ CefRefPtr<CefWebMessageReceiver> callback) { 5699 auto web_contents = GetWebContents(); 5700 if (!web_contents) { 5701 LOG(ERROR) << "GetWebContents null"; 5702@@ -1609,7 +1715,7 @@ WebMessageReceiverImpl::~WebMessageReceiverImpl() { 5703 } 5704 5705 void WebMessageReceiverImpl::SetOnMessageCallback( 5706- CefRefPtr<CefJavaScriptResultCallback> callback) { 5707+ CefRefPtr<CefWebMessageReceiver> callback) { 5708 LOG(INFO) << "WebMessageReceiverImpl::SetOnMessageCallback "; 5709 callback_ = callback; 5710 } 5711@@ -1619,9 +1725,17 @@ bool WebMessageReceiverImpl::OnMessage(blink::WebMessagePort::Message message) { 5712 LOG(INFO) << "OnMessage start"; 5713 // Pass the message on to the receiver. 5714 if (callback_) { 5715- LOG(INFO) << "OnMessage:" << message.data; 5716- std::u16string data = message.data; 5717- callback_->OnJavaScriptExeResult(base::UTF16ToUTF8(data)); 5718+ CefRefPtr<CefValue> data = CefValue::Create(); 5719+ if (!message.data.empty()) { 5720+ data->SetString(base::UTF16ToUTF8(message.data)); 5721+ } else { 5722+ std::vector<uint8_t> vecBinary = message.array_buffer; 5723+ CefRefPtr<CefBinaryValue> value = 5724+ CefBinaryValue::Create(vecBinary.data(), vecBinary.size()); 5725+ data->SetBinary(value); 5726+ } 5727+ 5728+ callback_->OnMessage(data); 5729 } else { 5730 LOG(ERROR) << "u should set callback to receive message"; 5731 } 5732@@ -1686,8 +1800,10 @@ void CefBrowserHostBase::LoadWithDataAndBaseUrl(const CefString& baseUrl, 5733 const CefString& encoding, 5734 const CefString& historyUrl) { 5735 if (!CEF_CURRENTLY_ON_UIT()) { 5736- CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefBrowserHostBase::LoadWithDataAndBaseUrl, 5737- this, baseUrl, data, mimeType, encoding, historyUrl)); 5738+ CEF_POST_TASK( 5739+ CEF_UIT, 5740+ base::BindOnce(&CefBrowserHostBase::LoadWithDataAndBaseUrl, this, 5741+ baseUrl, data, mimeType, encoding, historyUrl)); 5742 return; 5743 } 5744 std::string dataBase = data.empty() ? "" : data; 5745@@ -1730,7 +1846,7 @@ void CefBrowserHostBase::LoadWithData(const CefString& data, 5746 const CefString& encoding) { 5747 if (!CEF_CURRENTLY_ON_UIT()) { 5748 CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefBrowserHostBase::LoadWithData, 5749- this, data, mimeType, encoding)); 5750+ this, data, mimeType, encoding)); 5751 return; 5752 } 5753 std::string dataBase = data.empty() ? "" : data; 5754@@ -1804,6 +1920,48 @@ bool CefBrowserHostBase::GetWebDebuggingAccess() { 5755 return is_web_debugging_access_; 5756 } 5757 5758+#if BUILDFLAG(IS_OHOS) 5759+void CefBrowserHostBase::SetFileAccess(bool flag) { 5760+ base::AutoLock lock_scope(state_lock_); 5761+ if (file_access_ == flag) { 5762+ return; 5763+ } 5764+ file_access_ = flag; 5765+} 5766+ 5767+void CefBrowserHostBase::SetBlockNetwork(bool flag) { 5768+ base::AutoLock lock_scope(state_lock_); 5769+ if (network_blocked_ == flag) { 5770+ return; 5771+ } 5772+ network_blocked_ = flag; 5773+} 5774+ 5775+void CefBrowserHostBase::SetCacheMode(int flag) { 5776+ base::AutoLock lock_scope(state_lock_); 5777+ if (cache_mode_ == flag) { 5778+ return; 5779+ } 5780+ cache_mode_ = flag; 5781+} 5782+ 5783+ 5784+bool CefBrowserHostBase::GetFileAccess() { 5785+ base::AutoLock lock_scope(state_lock_); 5786+ return file_access_; 5787+} 5788+ 5789+bool CefBrowserHostBase::GetBlockNetwork() { 5790+ base::AutoLock lock_scope(state_lock_); 5791+ return network_blocked_; 5792+} 5793+ 5794+int CefBrowserHostBase::GetCacheMode() { 5795+ base::AutoLock lock_scope(state_lock_); 5796+ return cache_mode_; 5797+} 5798+#endif 5799+ 5800 void CefBrowserHostBase::GetImageForContextNode() { 5801 auto frame = GetMainFrame(); 5802 if (frame && frame->IsValid()) { 5803diff --git a/src/cef/libcef/browser/browser_host_base.h b/src/cef/libcef/browser/browser_host_base.h 5804index 476fe0434206b..1576ef2b4d1d4 5805--- a/src/cef/libcef/browser/browser_host_base.h 5806+++ b/src/cef/libcef/browser/browser_host_base.h 5807@@ -108,10 +108,10 @@ class WebMessageReceiverImpl : public blink::WebMessagePort::MessageReceiver { 5808 // WebMessagePort::MessageReceiver implementation: 5809 bool OnMessage(blink::WebMessagePort::Message message) override; 5810 5811- void SetOnMessageCallback(CefRefPtr<CefJavaScriptResultCallback> callback); 5812+ void SetOnMessageCallback(CefRefPtr<CefWebMessageReceiver> callback); 5813 5814 private: 5815- CefRefPtr<CefJavaScriptResultCallback> callback_; 5816+ CefRefPtr<CefWebMessageReceiver> callback_; 5817 }; 5818 5819 struct CefHitData { 5820@@ -236,6 +236,15 @@ class CefBrowserHostBase : public CefBrowserHost, 5821 void SetBrowserUserAgentString(const CefString& user_agent) override; 5822 void ExitFullScreen() override; 5823 void UpdateLocale(const CefString& locale) override; 5824+ CefString GetOriginalUrl() override; 5825+ void PutNetworkAvailable(bool available) override; 5826+ void RemoveCache(bool include_disk_files) override; 5827+ CefRefPtr<CefBinaryValue> GetWebState() override; 5828+ bool RestoreWebState(const CefRefPtr<CefBinaryValue> state) override; 5829+ void ScrollPageUpDown(bool is_up, bool is_half, float view_height) override; 5830+ void ScrollTo(float x, float y) override; 5831+ void ScrollBy(float delta_x, float delta_y) override; 5832+ void SlideScroll(float vx, float vy) override; 5833 /* ohos webview end */ 5834 #endif 5835 5836@@ -273,10 +282,10 @@ class CefBrowserHostBase : public CefBrowserHost, 5837 std::vector<CefString>& ports, 5838 CefString& targetUri) override; 5839 void ClosePort(CefString& port_handle) override; 5840- void PostPortMessage(CefString& port_handle, CefString& data) override; 5841+ void PostPortMessage(CefString& port_handle, CefRefPtr<CefValue> message) override; 5842 void SetPortMessageCallback( 5843 CefString& port_handle, 5844- CefRefPtr<CefJavaScriptResultCallback> callback) override; 5845+ CefRefPtr<CefWebMessageReceiver> callback) override; 5846 void DestroyAllWebMessagePorts() override; 5847 #endif 5848 CefString Title() override; 5849@@ -406,6 +415,18 @@ class CefBrowserHostBase : public CefBrowserHost, 5850 void SetWebDebuggingAccess(bool isEnableDebug) override; 5851 bool GetWebDebuggingAccess() override; 5852 5853+#if BUILDFLAG(IS_OHOS) 5854+ void SetFileAccess(bool flag) override; 5855+ void SetBlockNetwork(bool flag) override; 5856+ void SetCacheMode(int flag) override; 5857+ bool GetFileAccess(); 5858+ bool GetBlockNetwork(); 5859+ int GetCacheMode(); 5860+ bool file_access_ = false; 5861+ bool network_blocked_ = false; 5862+ int cache_mode_ = 0; 5863+#endif 5864+ 5865 #if BUILDFLAG(IS_OHOS) 5866 bool ShouldShowLoadingUI() override; 5867 #endif 5868diff --git a/src/cef/libcef/browser/browser_host_create.cc b/src/cef/libcef/browser/browser_host_create.cc 5869index 21742d9599e16..60d14a5d4b9ae 5870--- a/src/cef/libcef/browser/browser_host_create.cc 5871+++ b/src/cef/libcef/browser/browser_host_create.cc 5872@@ -5,11 +5,14 @@ 5873 5874 #include "include/cef_browser.h" 5875 #include "libcef/browser/alloy/alloy_browser_host_impl.h" 5876-#include "libcef/browser/chrome/chrome_browser_host_impl.h" 5877 #include "libcef/browser/context.h" 5878 #include "libcef/browser/thread_util.h" 5879 #include "libcef/features/runtime.h" 5880 5881+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5882+#include "libcef/browser/chrome/chrome_browser_host_impl.h" 5883+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5884+ 5885 namespace { 5886 5887 class CreateBrowserHelper { 5888@@ -138,10 +141,12 @@ CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync( 5889 // static 5890 CefRefPtr<CefBrowserHostBase> CefBrowserHostBase::Create( 5891 CefBrowserCreateParams& create_params) { 5892+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5893 if (cef::IsChromeRuntimeEnabled()) { 5894 auto browser = ChromeBrowserHostImpl::Create(create_params); 5895 return browser.get(); 5896 } 5897+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5898 5899 auto browser = AlloyBrowserHostImpl::Create(create_params); 5900 return browser.get(); 5901diff --git a/src/cef/libcef/browser/browser_platform_delegate.cc b/src/cef/libcef/browser/browser_platform_delegate.cc 5902index d5ef0e763cfe8..d3f93c844f946 5903--- a/src/cef/libcef/browser/browser_platform_delegate.cc 5904+++ b/src/cef/libcef/browser/browser_platform_delegate.cc 5905@@ -393,6 +393,18 @@ void CefBrowserPlatformDelegate::StopFinding(bool clearSelection) { 5906 NOTIMPLEMENTED(); 5907 } 5908 5909+void CefBrowserPlatformDelegate::ShowPopupMenu( 5910+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client, 5911+ const gfx::Rect& bounds, 5912+ int item_height, 5913+ double item_font_size, 5914+ int selected_item, 5915+ std::vector<blink::mojom::MenuItemPtr> menu_items, 5916+ bool right_aligned, 5917+ bool allow_multiple_selection) { 5918+ NOTIMPLEMENTED(); 5919+} 5920+ 5921 // static 5922 int CefBrowserPlatformDelegate::TranslateWebEventModifiers( 5923 uint32 cef_modifiers) { 5924diff --git a/src/cef/libcef/browser/browser_platform_delegate.h b/src/cef/libcef/browser/browser_platform_delegate.h 5925index fbcb7521503ec..f69fa5b0c42e1 5926--- a/src/cef/libcef/browser/browser_platform_delegate.h 5927+++ b/src/cef/libcef/browser/browser_platform_delegate.h 5928@@ -17,6 +17,7 @@ 5929 #include "base/callback_forward.h" 5930 #include "extensions/common/mojom/view_type.mojom-forward.h" 5931 #include "third_party/blink/public/common/page/drag_operation.h" 5932+#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h" 5933 #include "third_party/blink/public/mojom/drag/drag.mojom-forward.h" 5934 #include "third_party/skia/include/core/SkColor.h" 5935 #include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h" 5936@@ -359,6 +360,15 @@ class CefBrowserPlatformDelegate { 5937 bool findNext, 5938 bool newSession); 5939 virtual void StopFinding(bool clearSelection); 5940+ virtual void ShowPopupMenu( 5941+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client, 5942+ const gfx::Rect& bounds, 5943+ int item_height, 5944+ double item_font_size, 5945+ int selected_item, 5946+ std::vector<blink::mojom::MenuItemPtr> menu_items, 5947+ bool right_aligned, 5948+ bool allow_multiple_selection); 5949 5950 protected: 5951 // Allow deletion via std::unique_ptr only. 5952diff --git a/src/cef/libcef/browser/browser_platform_delegate_create.cc b/src/cef/libcef/browser/browser_platform_delegate_create.cc 5953index da158b2a3a659..8c2723bb11048 5954--- a/src/cef/libcef/browser/browser_platform_delegate_create.cc 5955+++ b/src/cef/libcef/browser/browser_platform_delegate_create.cc 5956@@ -12,7 +12,6 @@ 5957 #include "build/build_config.h" 5958 5959 #include "libcef/browser/browser_host_base.h" 5960-#include "libcef/browser/chrome/browser_platform_delegate_chrome.h" 5961 #include "libcef/browser/extensions/browser_platform_delegate_background.h" 5962 #include "libcef/features/runtime_checks.h" 5963 5964@@ -30,10 +29,16 @@ 5965 #endif 5966 5967 #if defined(TOOLKIT_VIEWS) 5968+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5969 #include "libcef/browser/chrome/views/browser_platform_delegate_chrome_views.h" 5970+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5971 #include "libcef/browser/views/browser_platform_delegate_views.h" 5972 #endif 5973 5974+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5975+#include "libcef/browser/chrome/browser_platform_delegate_chrome.h" 5976+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5977+ 5978 namespace { 5979 5980 std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate( 5981@@ -79,6 +84,7 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create( 5982 const SkColor background_color = CefContext::Get()->GetBackgroundColor( 5983 &create_params.settings, is_windowless ? STATE_ENABLED : STATE_DISABLED); 5984 5985+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5986 if (cef::IsChromeRuntimeEnabled()) { 5987 // CefWindowInfo is not used in this case. 5988 std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate = 5989@@ -94,6 +100,7 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create( 5990 return std::make_unique<CefBrowserPlatformDelegateChrome>( 5991 std::move(native_delegate)); 5992 } 5993+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 5994 5995 if (create_params.window_info) { 5996 std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate = 5997diff --git a/src/cef/libcef/browser/context_menu_params_impl.cc b/src/cef/libcef/browser/context_menu_params_impl.cc 5998index c8d817852b2a3..3cff40a84c1d0 5999--- a/src/cef/libcef/browser/context_menu_params_impl.cc 6000+++ b/src/cef/libcef/browser/context_menu_params_impl.cc 6001@@ -147,3 +147,14 @@ bool CefContextMenuParamsImpl::IsCustomMenu() { 6002 CEF_VALUE_VERIFY_RETURN(false, false); 6003 return !const_value().custom_items.empty(); 6004 } 6005+ 6006+CefContextMenuParamsImpl::InputFieldType CefContextMenuParamsImpl::GetInputFieldType() { 6007+ CEF_VALUE_VERIFY_RETURN(false, CM_INPUTFIELDTYPE_NONE); 6008+ return static_cast<InputFieldType>(const_value().input_field_type); 6009+} 6010+ 6011+CefContextMenuParamsImpl::SourceType CefContextMenuParamsImpl::GetSourceType() { 6012+ CEF_VALUE_VERIFY_RETURN(false, CM_SOURCETYPE_NONE); 6013+ return static_cast<SourceType>(const_value().source_type); 6014+} 6015+ 6016diff --git a/src/cef/libcef/browser/context_menu_params_impl.h b/src/cef/libcef/browser/context_menu_params_impl.h 6017index 782848a03b7dd..eedb81e10f9ba 6018--- a/src/cef/libcef/browser/context_menu_params_impl.h 6019+++ b/src/cef/libcef/browser/context_menu_params_impl.h 6020@@ -41,6 +41,8 @@ class CefContextMenuParamsImpl 6021 bool IsSpellCheckEnabled() override; 6022 EditStateFlags GetEditStateFlags() override; 6023 bool IsCustomMenu() override; 6024+ InputFieldType GetInputFieldType() override; 6025+ SourceType GetSourceType() override; 6026 }; 6027 6028 #endif // CEF_LIBCEF_BROWSER_CONTEXT_MENU_PARAMS_IMPL_H_ 6029diff --git a/src/cef/libcef/browser/extensions/browser_extensions_util.cc b/src/cef/libcef/browser/extensions/browser_extensions_util.cc 6030index 74e94b9e26fc7..aff6b30e85345 6031--- a/src/cef/libcef/browser/extensions/browser_extensions_util.cc 6032+++ b/src/cef/libcef/browser/extensions/browser_extensions_util.cc 6033@@ -23,6 +23,10 @@ 6034 #include "content/public/browser/render_view_host.h" 6035 #include "extensions/browser/extension_registry.h" 6036 6037+#if BUILDFLAG(IS_OHOS) 6038+#include "printing/buildflags/buildflags.h" 6039+#endif 6040+ 6041 namespace extensions { 6042 6043 namespace { 6044@@ -52,10 +56,14 @@ content::WebContents* GetOwnerForGuestContents(content::WebContents* guest) { 6045 return plugin_guest->owner_web_contents(); 6046 } 6047 6048+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 6049 // Maybe it's a print preview dialog. 6050 auto print_preview_controller = 6051 g_browser_process->print_preview_dialog_controller(); 6052 return print_preview_controller->GetInitiator(guest); 6053+#else 6054+ return nullptr; 6055+#endif 6056 } 6057 6058 CefRefPtr<CefBrowserHostBase> GetOwnerBrowserForGlobalId( 6059diff --git a/src/cef/libcef/browser/extensions/component_extension_resource_manager.cc b/src/cef/libcef/browser/extensions/component_extension_resource_manager.cc 6060index 4c8f5666fb962..b9d1f2e716fda 6061--- a/src/cef/libcef/browser/extensions/component_extension_resource_manager.cc 6062+++ b/src/cef/libcef/browser/extensions/component_extension_resource_manager.cc 6063@@ -8,23 +8,33 @@ 6064 #include "base/logging.h" 6065 #include "base/path_service.h" 6066 #include "base/values.h" 6067-#include "chrome/browser/pdf/pdf_extension_util.h" 6068 #include "chrome/common/chrome_paths.h" 6069 #include "chrome/grit/component_extension_resources_map.h" 6070-#include "chrome/grit/pdf_resources_map.h" 6071 #include "extensions/common/constants.h" 6072 6073+#if BUILDFLAG(IS_OHOS) 6074+#include "pdf/buildflags.h" 6075+#if BUILDFLAG(ENABLE_PDF) 6076+#include "chrome/browser/pdf/pdf_extension_util.h" 6077+#include "chrome/grit/pdf_resources_map.h" 6078+#endif 6079+#endif 6080+ 6081 namespace extensions { 6082 6083 CefComponentExtensionResourceManager::CefComponentExtensionResourceManager() { 6084 AddComponentResourceEntries(kComponentExtensionResources, 6085 kComponentExtensionResourcesSize); 6086+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 6087 AddComponentResourceEntries(kPdfResources, kPdfResourcesSize); 6088+#endif 6089 6090 base::Value dict(base::Value::Type::DICTIONARY); 6091+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 6092 pdf_extension_util::AddStrings( 6093 pdf_extension_util::PdfViewerContext::kPdfViewer, &dict); 6094 pdf_extension_util::AddAdditionalData(/*enable_annotations=*/true, &dict); 6095+#endif 6096 6097 ui::TemplateReplacements pdf_viewer_replacements; 6098 ui::TemplateReplacementsFromDictionaryValue( 6099diff --git a/src/cef/libcef/browser/extensions/extension_system.cc b/src/cef/libcef/browser/extensions/extension_system.cc 6100index 21cfc861c382f..3f54b1fe7d5f5 6101--- a/src/cef/libcef/browser/extensions/extension_system.cc 6102+++ b/src/cef/libcef/browser/extensions/extension_system.cc 6103@@ -21,7 +21,6 @@ 6104 #include "base/strings/string_tokenizer.h" 6105 #include "base/strings/utf_string_conversions.h" 6106 #include "base/threading/thread_restrictions.h" 6107-#include "chrome/browser/pdf/pdf_extension_util.h" 6108 #include "chrome/browser/profiles/profile.h" 6109 #include "chrome/common/chrome_paths.h" 6110 #include "components/crx_file/id_util.h" 6111@@ -31,7 +30,6 @@ 6112 #include "content/public/browser/notification_details.h" 6113 #include "content/public/browser/notification_service.h" 6114 #include "content/public/browser/notification_source.h" 6115-#include "content/public/browser/plugin_service.h" 6116 #include "content/public/browser/render_process_host.h" 6117 #include "extensions/browser/api/app_runtime/app_runtime_api.h" 6118 #include "extensions/browser/extension_prefs.h" 6119@@ -52,6 +50,20 @@ 6120 #include "extensions/common/switches.h" 6121 #include "net/base/mime_util.h" 6122 6123+#if BUILDFLAG(IS_OHOS) 6124+#include "ppapi/buildflags/buildflags.h" 6125+#if BUILDFLAG(ENABLE_PLUGINS) 6126+#include "content/public/browser/plugin_service.h" 6127+#endif 6128+#endif 6129+ 6130+#if BUILDFLAG(IS_OHOS) 6131+#include "pdf/buildflags.h" 6132+#if BUILDFLAG(ENABLE_PDF) 6133+#include "chrome/browser/pdf/pdf_extension_util.h" 6134+#endif 6135+#endif 6136+ 6137 using content::BrowserContext; 6138 6139 namespace extensions { 6140@@ -263,11 +275,13 @@ void CefExtensionSystem::Init() { 6141 // the guest WebContents will be destroyed. This triggers a call to 6142 // CefMimeHandlerViewGuestDelegate::OnGuestDetached which removes the 6143 // routing ID association with the owner CefBrowser. 6144+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 6145 if (PdfExtensionEnabled()) { 6146 LoadExtension(ParseManifest(pdf_extension_util::GetManifest()), 6147 base::FilePath(FILE_PATH_LITERAL("pdf")), true /* internal */, 6148 nullptr, nullptr); 6149 } 6150+#endif 6151 6152 initialized_ = true; 6153 } 6154@@ -683,10 +697,12 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) { 6155 } 6156 info.mime_types.push_back(mime_type_info); 6157 } 6158+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 6159 content::PluginService* plugin_service = 6160 content::PluginService::GetInstance(); 6161 plugin_service->RefreshPlugins(); 6162 plugin_service->RegisterInternalPlugin(info, true); 6163+#endif 6164 } 6165 } 6166 6167@@ -707,10 +723,12 @@ void CefExtensionSystem::NotifyExtensionUnloaded( 6168 if (handler && !handler->handler_url().empty()) { 6169 base::FilePath path = 6170 base::FilePath::FromUTF8Unsafe(extension->url().spec()); 6171+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 6172 content::PluginService* plugin_service = 6173 content::PluginService::GetInstance(); 6174 plugin_service->UnregisterInternalPlugin(path); 6175 plugin_service->RefreshPlugins(); 6176+#endif 6177 } 6178 6179 registry_->TriggerOnUnloaded(extension, reason); 6180diff --git a/src/cef/libcef/browser/extensions/extensions_api_client.cc b/src/cef/libcef/browser/extensions/extensions_api_client.cc 6181index 97976cdebb1a1..9dd257baa66b6 6182--- a/src/cef/libcef/browser/extensions/extensions_api_client.cc 6183+++ b/src/cef/libcef/browser/extensions/extensions_api_client.cc 6184@@ -11,16 +11,29 @@ 6185 #include "libcef/browser/extensions/api/storage/sync_value_store_cache.h" 6186 #include "libcef/browser/extensions/extension_web_contents_observer.h" 6187 #include "libcef/browser/extensions/mime_handler_view_guest_delegate.h" 6188-#include "libcef/browser/printing/print_view_manager.h" 6189 6190 #include "base/memory/ptr_util.h" 6191-#include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h" 6192 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" 6193-#include "components/pdf/browser/pdf_web_contents_helper.h" 6194 #include "components/zoom/zoom_controller.h" 6195 #include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h" 6196 #include "printing/mojom/print.mojom.h" 6197 6198+#if BUILDFLAG(IS_OHOS) 6199+#include "printing/buildflags/buildflags.h" 6200+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) 6201+#include "libcef/browser/printing/print_view_manager.h" 6202+#endif 6203+#endif 6204+ 6205+#if BUILDFLAG(IS_OHOS) 6206+#include "pdf/buildflags.h" 6207+#endif 6208+ 6209+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 6210+#include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h" 6211+#include "components/pdf/browser/pdf_web_contents_helper.h" 6212+#endif 6213+ 6214 namespace extensions { 6215 6216 CefExtensionsAPIClient::CefExtensionsAPIClient() {} 6217@@ -51,12 +64,16 @@ CefExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate( 6218 void CefExtensionsAPIClient::AttachWebContentsHelpers( 6219 content::WebContents* web_contents) const { 6220 PrefsTabHelper::CreateForWebContents(web_contents); 6221+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 6222 printing::CefPrintViewManager::CreateForWebContents(web_contents); 6223+#endif 6224 6225+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 6226 // Used by the PDF extension. 6227 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( 6228 web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( 6229 new ChromePDFWebContentsHelperClient())); 6230+#endif 6231 6232 // Used by the tabs extension API. 6233 zoom::ZoomController::CreateForWebContents(web_contents); 6234diff --git a/src/cef/libcef/browser/frame_host_impl.cc b/src/cef/libcef/browser/frame_host_impl.cc 6235index b4630e8b29de5..b79a4ee9f5857 6236--- a/src/cef/libcef/browser/frame_host_impl.cc 6237+++ b/src/cef/libcef/browser/frame_host_impl.cc 6238@@ -18,6 +18,7 @@ 6239 #include "libcef/common/task_runner_impl.h" 6240 6241 #include "content/browser/renderer_host/frame_tree_node.h" 6242+#include "content/public/browser/browsing_data_remover.h" 6243 #include "content/public/browser/render_process_host.h" 6244 #include "content/public/browser/render_view_host.h" 6245 #include "services/service_manager/public/cpp/interface_provider.h" 6246@@ -293,11 +294,12 @@ void CefFrameHostImpl::RefreshAttributes() { 6247 } 6248 6249 void CefFrameHostImpl::UpdateLocale(const CefString& locale) { 6250- SendToRenderFrame(__FUNCTION__, 6251- base::BindOnce([](const std::string& locale, 6252- const RenderFrameType& render_frame) { 6253- render_frame->UpdateLocale(locale); 6254- }, locale.ToString())); 6255+ SendToRenderFrame(__FUNCTION__, base::BindOnce( 6256+ [](const std::string& locale, 6257+ const RenderFrameType& render_frame) { 6258+ render_frame->UpdateLocale(locale); 6259+ }, 6260+ locale.ToString())); 6261 } 6262 6263 void CefFrameHostImpl::NotifyMoveOrResizeStarted() { 6264@@ -777,6 +779,16 @@ void CefFrameHostImpl::SetInitialScale(float scale) { 6265 scale)); 6266 } 6267 6268+void CefFrameHostImpl::SetJsOnlineProperty(bool network_up) { 6269+ SendToRenderFrame( 6270+ __FUNCTION__, 6271+ base::BindOnce( 6272+ [](bool network_up, const RenderFrameType& render_frame) { 6273+ render_frame->SetJsOnlineProperty(network_up); 6274+ }, 6275+ network_up)); 6276+} 6277+ 6278 void CefFrameHostImpl::GetImageForContextNode() { 6279 SendToRenderFrame(__FUNCTION__, 6280 base::BindOnce([](const RenderFrameType& render_frame) { 6281@@ -793,6 +805,109 @@ void CefFrameHostImpl::PutZoomingForTextFactor(float factor) { 6282 }, 6283 factor)); 6284 } 6285+ 6286+void CefFrameHostImpl::GetImagesCallback( 6287+ CefRefPtr<CefFrameHostImpl> frame, 6288+ CefRefPtr<CefGetImagesCallback> callback, 6289+ bool response) { 6290+ if (auto browser = frame->GetBrowser()) { 6291+ callback->GetImages(response); 6292+ } 6293+} 6294+ 6295+void CefFrameHostImpl::GetImagesWithResponse( 6296+ cef::mojom::RenderFrame::GetImagesWithResponseCallback response_callback) { 6297+ SendToRenderFrame( 6298+ __FUNCTION__, 6299+ base::BindOnce( 6300+ [](cef::mojom::RenderFrame::GetImagesWithResponseCallback 6301+ response_callback, 6302+ const RenderFrameType& render_frame) { 6303+ render_frame->GetImagesWithResponse(std::move(response_callback)); 6304+ }, 6305+ std::move(response_callback))); 6306+} 6307+ 6308+void CefFrameHostImpl::GetImages(CefRefPtr<CefGetImagesCallback> callback) { 6309+ GetImagesWithResponse(base::BindOnce( 6310+ &CefFrameHostImpl::GetImagesCallback, base::Unretained(this), 6311+ CefRefPtr<CefFrameHostImpl>(this), callback)); 6312+} 6313+ 6314+void CefFrameHostImpl::RemoveCache(bool include_disk_files) { 6315+ SendToRenderFrame(__FUNCTION__, 6316+ base::BindOnce([](const RenderFrameType& render_frame) { 6317+ render_frame->RemoveCache(); 6318+ })); 6319+ 6320+ if (include_disk_files) { 6321+ auto browser = GetBrowserHostBase(); 6322+ if (!browser) { 6323+ LOG(ERROR) << "RemoveCache: browser is null"; 6324+ return; 6325+ } 6326+ 6327+ auto web_contents = browser->GetWebContents(); 6328+ if (!web_contents) { 6329+ LOG(ERROR) << "RemoveCache: web contents is null"; 6330+ return; 6331+ } 6332+ 6333+ content::BrowsingDataRemover* remover = 6334+ web_contents->GetBrowserContext()->GetBrowsingDataRemover(); 6335+ remover->Remove( 6336+ base::Time(), base::Time::Max(), 6337+ content::BrowsingDataRemover::DATA_TYPE_CACHE, 6338+ content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB | 6339+ content::BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB); 6340+ } 6341+} 6342+ 6343+void CefFrameHostImpl::ScrollPageUpDown(bool is_up, 6344+ bool is_half, 6345+ float view_height) { 6346+ SendToRenderFrame(__FUNCTION__, 6347+ base::BindOnce( 6348+ [](bool is_up, bool is_half, float view_height, 6349+ const RenderFrameType& render_frame) { 6350+ render_frame->ScrollPageUpDown(is_up, is_half, 6351+ view_height); 6352+ }, 6353+ is_up, is_half, view_height)); 6354+} 6355+ 6356+void CefFrameHostImpl::ScrollTo(float x, 6357+ float y) { 6358+ SendToRenderFrame(__FUNCTION__, 6359+ base::BindOnce( 6360+ [](float x, float y, 6361+ const RenderFrameType& render_frame) { 6362+ render_frame->ScrollTo(x, y); 6363+ }, 6364+ x, y)); 6365+} 6366+ 6367+void CefFrameHostImpl::ScrollBy(float delta_x, 6368+ float delta_y) { 6369+ SendToRenderFrame(__FUNCTION__, 6370+ base::BindOnce( 6371+ [](float delta_x, float delta_y, 6372+ const RenderFrameType& render_frame) { 6373+ render_frame->ScrollBy(delta_x, delta_y); 6374+ }, 6375+ delta_x, delta_y)); 6376+} 6377+ 6378+void CefFrameHostImpl::SlideScroll(float vx, 6379+ float vy) { 6380+ SendToRenderFrame(__FUNCTION__, 6381+ base::BindOnce( 6382+ [](float vx, float vy, 6383+ const RenderFrameType& render_frame) { 6384+ render_frame->SlideScroll(vx, vy); 6385+ }, 6386+ vx, vy)); 6387+} 6388 #endif // BUILDFLAG(IS_OHOS) 6389 6390 void CefExecuteJavaScriptWithUserGestureForTests(CefRefPtr<CefFrame> frame, 6391diff --git a/src/cef/libcef/browser/frame_host_impl.h b/src/cef/libcef/browser/frame_host_impl.h 6392index 0b307863b967e..5a43da2de74a0 6393--- a/src/cef/libcef/browser/frame_host_impl.h 6394+++ b/src/cef/libcef/browser/frame_host_impl.h 6395@@ -155,12 +155,24 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { 6396 void SendTouchEvent(const CefTouchEvent& event); 6397 6398 void SetInitialScale(float scale); 6399+ void SetJsOnlineProperty(bool network_up); 6400 6401 void GetImageForContextNode(); 6402 6403 // Sets the zoom factor for text only. Used in layout modes other than 6404 // Text Autosizing. 6405 void PutZoomingForTextFactor(float factor); 6406+ 6407+ void GetImagesCallback(CefRefPtr<CefFrameHostImpl> frame, 6408+ CefRefPtr<CefGetImagesCallback> callback, bool response); 6409+ void GetImagesWithResponse(cef::mojom::RenderFrame::GetImagesWithResponseCallback 6410+ response_callback); 6411+ void GetImages(CefRefPtr<CefGetImagesCallback> callback) override; 6412+ void RemoveCache(bool include_disk_files); 6413+ void ScrollPageUpDown(bool is_up, bool is_half, float view_height); 6414+ void ScrollTo(float x, float y); 6415+ void ScrollBy(float delta_x, float delta_y); 6416+ void SlideScroll(float vx, float vy); 6417 #endif // BUILDFLAG(IS_OHOS) 6418 6419 static const int64_t kMainFrameId; 6420diff --git a/src/cef/libcef/browser/icon_helper.cc b/src/cef/libcef/browser/icon_helper.cc 6421index 5a5db2e755a58..a35a195e514a3 6422--- a/src/cef/libcef/browser/icon_helper.cc 6423+++ b/src/cef/libcef/browser/icon_helper.cc 6424@@ -9,6 +9,8 @@ 6425 6426 #include "base/logging.h" 6427 #include "components/favicon_base/select_favicon_frames.h" 6428+#include "content/public/browser/favicon_status.h" 6429+#include "content/public/browser/navigation_entry.h" 6430 #include "content/public/browser/web_contents.h" 6431 #include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h" 6432 6433@@ -42,6 +44,10 @@ cef_alpha_type_t TransformSkAlphaType(SkAlphaType alpha_type) { 6434 6435 } // namespace 6436 6437+namespace content { 6438+struct FaviconStatus; 6439+} 6440+ 6441 void IconHelper::SetDisplayHandler( 6442 const CefRefPtr<CefDisplayHandler>& handler) { 6443 handler_ = handler; 6444@@ -92,6 +98,7 @@ void IconHelper::DownloadFavicon(const blink::mojom::FaviconURLPtr& candidate) { 6445 LOG(ERROR) << "WebContents is invalid"; 6446 return; 6447 } 6448+ 6449 web_contents_->DownloadImage( 6450 candidate->icon_url, 6451 true, // Is a favicon 6452@@ -139,6 +146,17 @@ void IconHelper::DownloadFaviconCallback( 6453 auto alpha_type = TransformSkAlphaType(bitmap_.alphaType()); 6454 size_t pixel_width = bitmap_.width(); 6455 size_t pixel_height = bitmap_.height(); 6456+ 6457+ if (web_contents_) { 6458+ content::NavigationEntry* entry = 6459+ web_contents_->GetController().GetLastCommittedEntry(); 6460+ if (entry) { 6461+ entry->GetFavicon().valid = true; 6462+ entry->GetFavicon().url = image_url; 6463+ entry->GetFavicon().image = gfx::Image::CreateFrom1xBitmap(bitmap); 6464+ } 6465+ } 6466+ 6467 OnReceivedIcon(pixels, pixel_width, pixel_height, color_type, alpha_type); 6468 OnReceivedIconUrl(CefString(image_url.spec()), pixels, pixel_width, 6469 pixel_height, color_type, alpha_type); 6470diff --git a/src/cef/libcef/browser/main_runner.cc b/src/cef/libcef/browser/main_runner.cc 6471index d4284ee6c27e8..4de525d6b94ce 6472--- a/src/cef/libcef/browser/main_runner.cc 6473+++ b/src/cef/libcef/browser/main_runner.cc 6474@@ -9,7 +9,6 @@ 6475 #include "libcef/browser/thread_util.h" 6476 #include "libcef/common/alloy/alloy_main_runner_delegate.h" 6477 #include "libcef/common/cef_switches.h" 6478-#include "libcef/common/chrome/chrome_main_runner_delegate.h" 6479 #include "libcef/features/runtime.h" 6480 6481 #include "base/at_exit.h" 6482@@ -40,12 +39,18 @@ 6483 #include "third_party/crashpad/crashpad/handler/handler_main.h" 6484 #endif 6485 6486+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6487+#include "libcef/common/chrome/chrome_main_runner_delegate.h" 6488+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6489+ 6490 namespace { 6491 6492 enum class RuntimeType { 6493 UNINITIALIZED, 6494 ALLOY, 6495+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6496 CHROME, 6497+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6498 }; 6499 RuntimeType g_runtime_type = RuntimeType::UNINITIALIZED; 6500 6501@@ -54,6 +59,7 @@ std::unique_ptr<CefMainRunnerDelegate> MakeDelegate( 6502 CefMainRunnerHandler* runner, 6503 CefSettings* settings, 6504 CefRefPtr<CefApp> application) { 6505+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6506 if (type == RuntimeType::ALLOY) { 6507 g_runtime_type = RuntimeType::ALLOY; 6508 return std::make_unique<AlloyMainRunnerDelegate>(runner, settings, 6509@@ -63,6 +69,11 @@ std::unique_ptr<CefMainRunnerDelegate> MakeDelegate( 6510 return std::make_unique<ChromeMainRunnerDelegate>(runner, settings, 6511 application); 6512 } 6513+#else 6514+ g_runtime_type = RuntimeType::ALLOY; 6515+ return std::make_unique<AlloyMainRunnerDelegate>(runner, settings, 6516+ application); 6517+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6518 } 6519 6520 #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) 6521@@ -229,9 +240,13 @@ bool CefMainRunner::Initialize(CefSettings* settings, 6522 bool* initialized, 6523 base::OnceClosure context_initialized) { 6524 DCHECK(!main_delegate_); 6525+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6526 main_delegate_ = MakeDelegate( 6527 settings->chrome_runtime ? RuntimeType::CHROME : RuntimeType::ALLOY, this, 6528 settings, application); 6529+#else 6530+ main_delegate_ = MakeDelegate(RuntimeType::ALLOY, this, settings, application); 6531+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6532 6533 const int exit_code = 6534 ContentMainInitialize(args, windows_sandbox_info, &settings->no_sandbox); 6535@@ -318,9 +333,13 @@ int CefMainRunner::RunAsHelperProcess(const CefMainArgs& args, 6536 if (process_type.empty()) 6537 return -1; 6538 6539+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6540 auto runtime_type = command_line.HasSwitch(switches::kEnableChromeRuntime) 6541 ? RuntimeType::CHROME 6542 : RuntimeType::ALLOY; 6543+#else 6544+ auto runtime_type = RuntimeType::ALLOY; 6545+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6546 auto main_delegate = MakeDelegate(runtime_type, /*runner=*/nullptr, 6547 /*settings=*/nullptr, application); 6548 main_delegate->BeforeExecuteProcess(args); 6549@@ -536,7 +555,11 @@ bool IsAlloyRuntimeEnabled() { 6550 } 6551 6552 bool IsChromeRuntimeEnabled() { 6553+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6554 return g_runtime_type == RuntimeType::CHROME; 6555+#else 6556+ return false; 6557+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6558 } 6559 6560 } // namespace cef 6561diff --git a/src/cef/libcef/browser/menu_manager.cc b/src/cef/libcef/browser/menu_manager.cc 6562index 2ad53d395c385..879b0f449f186 6563--- a/src/cef/libcef/browser/menu_manager.cc 6564+++ b/src/cef/libcef/browser/menu_manager.cc 6565@@ -21,9 +21,15 @@ 6566 #include "content/public/browser/render_process_host.h" 6567 #include "content/public/browser/render_widget_host_view.h" 6568 #include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h" 6569+#include "ui/base/clipboard/clipboard.h" 6570+#include "ui/base/data_transfer_policy/data_transfer_endpoint.h" 6571 6572 namespace { 6573 6574+constexpr cef_context_menu_edit_state_flags_t kMenuCommands[] = { 6575+ CM_EDITFLAG_CAN_CUT, CM_EDITFLAG_CAN_COPY, CM_EDITFLAG_CAN_PASTE, 6576+ CM_EDITFLAG_CAN_DELETE, CM_EDITFLAG_CAN_SELECT_ALL}; 6577+ 6578 CefString GetLabel(int message_id) { 6579 std::u16string label = 6580 CefAppManager::Get()->GetContentClient()->GetLocalizedString(message_id); 6581@@ -120,6 +126,53 @@ bool CefMenuManager::IsShowingContextMenu() { 6582 return web_contents()->IsShowingContextMenu(); 6583 } 6584 6585+bool CefMenuManager::IsCommandIdEnabled(int command_id, 6586+ content::ContextMenuParams& params) const { 6587+ bool editable = params.is_editable; 6588+ bool readable = params.input_field_type != blink::mojom::ContextMenuDataInputFieldType::kPassword; 6589+ bool has_selection = !params.selection_text.empty(); 6590+ bool has_image_contents = params.has_image_contents; 6591+ 6592+ switch (command_id) { 6593+ case CM_EDITFLAG_CAN_CUT: 6594+ case CM_EDITFLAG_CAN_DELETE: 6595+ return editable && readable && has_selection; 6596+ case CM_EDITFLAG_CAN_COPY: 6597+ return readable && (has_selection || has_image_contents); 6598+ case CM_EDITFLAG_CAN_PASTE: { 6599+ std::u16string result; 6600+ bool can_paste = false; 6601+ ui::DataTransferEndpoint data_dst = ui::DataTransferEndpoint( 6602+ ui::EndpointType::kDefault, false); 6603+ ui::Clipboard::GetForCurrentThread()->ReadText( 6604+ ui::ClipboardBuffer::kCopyPaste, &data_dst, &result); 6605+ 6606+ if (result.empty()) { 6607+ can_paste = ui::Clipboard::GetForCurrentThread()->IsFormatAvailable( 6608+ ui::ClipboardFormatType::BitmapType(), 6609+ ui::ClipboardBuffer::kCopyPaste, &data_dst); 6610+ } 6611+ can_paste = can_paste ? can_paste : !result.empty(); 6612+ return editable && can_paste; 6613+ } 6614+ case CM_EDITFLAG_CAN_SELECT_ALL: 6615+ return editable || readable; 6616+ default: 6617+ return false; 6618+ } 6619+} 6620+ 6621+void CefMenuManager::UpdateMenuEditStateFlags(content::ContextMenuParams& params) { 6622+ int menu_flags = 0; 6623+ for (const auto& command : kMenuCommands) { 6624+ if (IsCommandIdEnabled(command, params)) { 6625+ menu_flags |= command; 6626+ } 6627+ } 6628+ 6629+ params.edit_flags = menu_flags; 6630+} 6631+ 6632 bool CefMenuManager::CreateContextMenu( 6633 const content::ContextMenuParams& params) { 6634 // The renderer may send the "show context menu" message multiple times, one 6635@@ -134,6 +187,7 @@ bool CefMenuManager::CreateContextMenu( 6636 6637 params_ = params; 6638 model_->Clear(); 6639+ UpdateMenuEditStateFlags(params_); 6640 6641 // Create the default menu model. 6642 CreateDefaultModel(); 6643diff --git a/src/cef/libcef/browser/menu_manager.h b/src/cef/libcef/browser/menu_manager.h 6644index 239e3b7c3fab7..14da5e4ce6ee6 6645--- a/src/cef/libcef/browser/menu_manager.h 6646+++ b/src/cef/libcef/browser/menu_manager.h 6647@@ -63,6 +63,11 @@ class CefMenuManager : public CefMenuModelImpl::Delegate, 6648 // Returns true if the specified id is a custom context menu command. 6649 bool IsCustomContextMenuCommand(int command_id); 6650 6651+ bool IsCommandIdEnabled(int command_id, 6652+ content::ContextMenuParams& params) const; 6653+ 6654+ void UpdateMenuEditStateFlags(content::ContextMenuParams& params); 6655+ 6656 // AlloyBrowserHostImpl pointer is guaranteed to outlive this object. 6657 AlloyBrowserHostImpl* browser_; 6658 6659diff --git a/src/cef/libcef/browser/navigation_entry_impl.cc b/src/cef/libcef/browser/navigation_entry_impl.cc 6660index f06bb547aac5d..ffac694b895dd 6661--- a/src/cef/libcef/browser/navigation_entry_impl.cc 6662+++ b/src/cef/libcef/browser/navigation_entry_impl.cc 6663@@ -7,8 +7,11 @@ 6664 #include "libcef/browser/ssl_status_impl.h" 6665 #include "libcef/common/time_util.h" 6666 6667+#include "content/public/browser/favicon_status.h" 6668 #include "content/public/browser/navigation_entry.h" 6669 #include "url/gurl.h" 6670+#include "third_party/skia/include/core/SkBitmap.h" 6671+ 6672 6673 CefNavigationEntryImpl::CefNavigationEntryImpl(content::NavigationEntry* value) 6674 : CefValueBase<CefNavigationEntry, content::NavigationEntry>( 6675@@ -71,3 +74,25 @@ CefRefPtr<CefSSLStatus> CefNavigationEntryImpl::GetSSLStatus() { 6676 CEF_VALUE_VERIFY_RETURN(false, nullptr); 6677 return new CefSSLStatusImpl(mutable_value()->GetSSL()); 6678 } 6679+ 6680+bool CefNavigationEntryImpl::GetFavicon(void** pixel_data, 6681+ int& color_type, 6682+ int& alpha_type, 6683+ int& pixel_width, 6684+ int& pixel_height) { 6685+ CEF_VALUE_VERIFY_RETURN(false, false); 6686+ auto favicon_status = mutable_value()->GetFavicon(); 6687+ if (!favicon_status.valid) { 6688+ return false; 6689+ } 6690+ const SkBitmap* bitmap = favicon_status.image.ToSkBitmap(); 6691+ if (!bitmap) { 6692+ return false; 6693+ } 6694+ color_type = bitmap->colorType(); 6695+ alpha_type = bitmap->alphaType(); 6696+ pixel_width = bitmap->width(); 6697+ pixel_height = bitmap->height(); 6698+ *pixel_data = bitmap->getPixels(); 6699+ return true; 6700+} 6701\ No newline at end of file 6702diff --git a/src/cef/libcef/browser/navigation_entry_impl.h b/src/cef/libcef/browser/navigation_entry_impl.h 6703index c9afbafc67216..7c9e78ce0af3b 6704--- a/src/cef/libcef/browser/navigation_entry_impl.h 6705+++ b/src/cef/libcef/browser/navigation_entry_impl.h 6706@@ -33,6 +33,11 @@ class CefNavigationEntryImpl 6707 CefTime GetCompletionTime() override; 6708 int GetHttpStatusCode() override; 6709 CefRefPtr<CefSSLStatus> GetSSLStatus() override; 6710+ bool GetFavicon(void** pixel_data, 6711+ int& color_type, 6712+ int& alpha_type, 6713+ int& pixel_width, 6714+ int& pixel_height) override; 6715 }; 6716 6717 #endif // CEF_LIBCEF_BROWSER_NAVIGATION_ENTRY_IMPL_H_ 6718diff --git a/src/cef/libcef/browser/navigation_state_serializer.cc b/src/cef/libcef/browser/navigation_state_serializer.cc 6719new file mode 100755 6720index 0000000000000..7da18ce018344 6721--- /dev/null 6722+++ b/src/cef/libcef/browser/navigation_state_serializer.cc 6723@@ -0,0 +1,161 @@ 6724+/* 6725+ * Copyright (c) 2022 Huawei Device Co., Ltd. 6726+ * Licensed under the Apache License, Version 2.0 (the "License"); 6727+ * you may not use this file except in compliance with the License. 6728+ * You may obtain a copy of the License at 6729+ * 6730+ * http://www.apache.org/licenses/LICENSE-2.0 6731+ * 6732+ * Unless required by applicable law or agreed to in writing, software 6733+ * distributed under the License is distributed on an "AS IS" BASIS, 6734+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6735+ * See the License for the specific language governing permissions and 6736+ * limitations under the License. 6737+ */ 6738+ 6739+#include "libcef/browser/navigation_state_serializer.h" 6740+ 6741+#include "base/logging.h" 6742+#include "third_party/blink/public/common/page_state/page_state.h" 6743+ 6744+CefRefPtr<CefBinaryValue> 6745+NavigationStateSerializer::WriteNavigationStatus( 6746+ content::WebContents& web_contents) { 6747+ content::NavigationController& controller = web_contents.GetController(); 6748+ if (!web_contents.GetController().GetLastCommittedEntry() || 6749+ web_contents.GetController().GetLastCommittedEntry()->IsInitialEntry()) { 6750+ LOG(ERROR) << "navigation controller invalid"; 6751+ return nullptr; 6752+ } 6753+ base::Pickle pickle; 6754+ int entry_count = controller.GetEntryCount(); 6755+ int entry_index = controller.GetLastCommittedEntryIndex(); 6756+ pickle.WriteInt(entry_count); 6757+ pickle.WriteInt(entry_index); 6758+ for (int index = 0; index < entry_count; ++index) { 6759+ WriteNavigationEntry(*controller.GetEntryAtIndex(index), &pickle); 6760+ } 6761+ return CefBinaryValue::Create(pickle.data(), pickle.size()); 6762+} 6763+ 6764+void NavigationStateSerializer::WriteNavigationEntry( 6765+ content::NavigationEntry& entry, 6766+ base::Pickle* pickle) { 6767+ if (!pickle) 6768+ return; 6769+ pickle->WriteString(entry.GetURL().spec()); 6770+ pickle->WriteString(entry.GetVirtualURL().spec()); 6771+ 6772+ const content::Referrer& referrer = entry.GetReferrer(); 6773+ pickle->WriteString(referrer.url.spec()); 6774+ pickle->WriteInt(static_cast<int>(referrer.policy)); 6775+ pickle->WriteString16(entry.GetTitle()); 6776+ pickle->WriteString(entry.GetPageState().ToEncodedData()); 6777+ pickle->WriteBool(static_cast<int>(entry.GetHasPostData())); 6778+ pickle->WriteString(entry.GetOriginalRequestURL().spec()); 6779+ pickle->WriteString(entry.GetBaseURLForDataURL().spec()); 6780+ pickle->WriteBool(static_cast<int>(entry.GetIsOverridingUserAgent())); 6781+ pickle->WriteInt64(entry.GetTimestamp().ToInternalValue()); 6782+ pickle->WriteInt(entry.GetHttpStatusCode()); 6783+} 6784+ 6785+bool NavigationStateSerializer::RestoreNavigationStatus( 6786+ content::WebContents& web_contents, 6787+ const CefRefPtr<CefBinaryValue>& state) { 6788+ if (!state) { 6789+ LOG(ERROR) << "web state is nullptr."; 6790+ return false; 6791+ } 6792+ size_t state_size = state->GetSize(); 6793+ if (state_size <= 0) { 6794+ LOG(ERROR) << "web state size invalid."; 6795+ return false; 6796+ } 6797+ uint8_t temp_buffer[state_size]; 6798+ state->GetData(temp_buffer, state_size, 0); 6799+ base::Pickle pickle(reinterpret_cast<const char*>(temp_buffer), 6800+ state->GetSize()); 6801+ base::PickleIterator iterator(pickle); 6802+ int entry_count = -1; 6803+ int entry_index = -2; 6804+ if (!iterator.ReadInt(&entry_count) || !iterator.ReadInt(&entry_index) || 6805+ entry_index >= entry_count) { 6806+ LOG(ERROR) << "web state size invalid."; 6807+ return false; 6808+ } 6809+ 6810+ std::unique_ptr<content::NavigationEntryRestoreContext> context = 6811+ content::NavigationEntryRestoreContext::Create(); 6812+ std::vector<std::unique_ptr<content::NavigationEntry>> entries; 6813+ entries.reserve(entry_count); 6814+ for (int i = 0; i < entry_count; ++i) { 6815+ std::unique_ptr<content::NavigationEntry> entry = 6816+ content::NavigationEntry::Create(); 6817+ if (!RestoreNavigationEntry(&iterator, entry, context.get())) 6818+ return false; 6819+ entries.push_back(std::move(entry)); 6820+ } 6821+ 6822+ content::NavigationController& controller = web_contents.GetController(); 6823+ controller.Restore(entry_index, content::RestoreType::kRestored, &entries); 6824+ controller.LoadIfNecessary(); 6825+ return true; 6826+} 6827+ 6828+bool NavigationStateSerializer::RestoreNavigationEntry( 6829+ base::PickleIterator* iterator, 6830+ std::unique_ptr<content::NavigationEntry>& entry, 6831+ content::NavigationEntryRestoreContext* context) { 6832+ if (!iterator || !entry || !context) { 6833+ return false; 6834+ } 6835+ std::string url; 6836+ std::string virtual_url; 6837+ std::string original_request_url; 6838+ std::string base_url_for_data_url; 6839+ std::string referrer_url; 6840+ int policy; 6841+ std::u16string title; 6842+ std::string content_state; 6843+ bool has_post_data; 6844+ bool is_overriding_user_agent; 6845+ int64_t timestamp; 6846+ int http_status_code; 6847+ 6848+ if (!iterator->ReadString(&url) || !iterator->ReadString(&virtual_url) || 6849+ !iterator->ReadString(&referrer_url) || !iterator->ReadInt(&policy) || 6850+ !iterator->ReadString16(&title) || 6851+ !iterator->ReadString(&content_state) || 6852+ !iterator->ReadBool(&has_post_data) || 6853+ !iterator->ReadString(&original_request_url) || 6854+ !iterator->ReadString(&base_url_for_data_url) || 6855+ !iterator->ReadBool(&is_overriding_user_agent) || 6856+ !iterator->ReadInt64(×tamp) || 6857+ !iterator->ReadInt(&http_status_code)) { 6858+ LOG(ERROR) << "restore navigation entry failed."; 6859+ return false; 6860+ } 6861+ 6862+ GURL deserialized_url; 6863+ entry->SetURL(deserialized_url); 6864+ entry->SetVirtualURL(GURL(virtual_url)); 6865+ entry->SetTitle(title); 6866+ content::Referrer deserialized_referrer; 6867+ deserialized_referrer.url = GURL(referrer_url); 6868+ deserialized_referrer.policy = content::Referrer::ConvertToPolicy(policy); 6869+ if (content_state.empty()) { 6870+ entry->SetPageState(blink::PageState::CreateFromURL(deserialized_url), 6871+ context); 6872+ entry->SetReferrer(deserialized_referrer); 6873+ } else { 6874+ entry->SetPageState(blink::PageState::CreateFromEncodedData(content_state), 6875+ context); 6876+ } 6877+ entry->SetHasPostData(has_post_data); 6878+ entry->SetOriginalRequestURL(GURL(original_request_url)); 6879+ entry->SetBaseURLForDataURL(GURL(base_url_for_data_url)); 6880+ entry->SetIsOverridingUserAgent(is_overriding_user_agent); 6881+ entry->SetTimestamp(base::Time::FromInternalValue(timestamp)); 6882+ entry->SetHttpStatusCode(http_status_code); 6883+ return true; 6884+} 6885\ No newline at end of file 6886diff --git a/src/cef/libcef/browser/navigation_state_serializer.h b/src/cef/libcef/browser/navigation_state_serializer.h 6887new file mode 100755 6888index 0000000000000..73d0bbefe5d2e 6889--- /dev/null 6890+++ b/src/cef/libcef/browser/navigation_state_serializer.h 6891@@ -0,0 +1,45 @@ 6892+/* 6893+ * Copyright (c) 2022 Huawei Device Co., Ltd. 6894+ * Licensed under the Apache License, Version 2.0 (the "License"); 6895+ * you may not use this file except in compliance with the License. 6896+ * You may obtain a copy of the License at 6897+ * 6898+ * http://www.apache.org/licenses/LICENSE-2.0 6899+ * 6900+ * Unless required by applicable law or agreed to in writing, software 6901+ * distributed under the License is distributed on an "AS IS" BASIS, 6902+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 6903+ * See the License for the specific language governing permissions and 6904+ * limitations under the License. 6905+ */ 6906+ 6907+#ifndef NAVIGATION_STATE_SERIALIZER_H 6908+#define NAVIGATION_STATE_SERIALIZER_H 6909+#pragma once 6910+ 6911+#include <memory> 6912+#include <vector> 6913+ 6914+#include "base/pickle.h" 6915+#include "content/public/browser/navigation_entry.h" 6916+#include "content/public/browser/navigation_entry_restore_context.h" 6917+#include "content/public/browser/web_contents.h" 6918+#include "include/cef_values.h" 6919+ 6920+class NavigationStateSerializer { 6921+ public: 6922+ static CefRefPtr<CefBinaryValue> WriteNavigationStatus( 6923+ content::WebContents& web_contents); 6924+ static bool RestoreNavigationStatus(content::WebContents& web_contents, 6925+ const CefRefPtr<CefBinaryValue>& state); 6926+ 6927+ private: 6928+ static void WriteNavigationEntry(content::NavigationEntry& entry, 6929+ base::Pickle* pickle); 6930+ static bool RestoreNavigationEntry( 6931+ base::PickleIterator* iterator, 6932+ std::unique_ptr<content::NavigationEntry>& entry, 6933+ content::NavigationEntryRestoreContext* context); 6934+}; 6935+ 6936+#endif 6937\ No newline at end of file 6938diff --git a/src/cef/libcef/browser/net/chrome_scheme_handler.cc b/src/cef/libcef/browser/net/chrome_scheme_handler.cc 6939index 533483340a79b..98aaa94a2b703 6940--- a/src/cef/libcef/browser/net/chrome_scheme_handler.cc 6941+++ b/src/cef/libcef/browser/net/chrome_scheme_handler.cc 6942@@ -166,9 +166,11 @@ bool IsUnlistedHost(const std::string& host) { 6943 6944 // Returns true if a host is WebUI and should be allowed to load. 6945 bool IsAllowedWebUIHost(const std::string& host) { 6946+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6947 // Chrome runtime allows all WebUI hosts. 6948 if (cef::IsChromeRuntimeEnabled()) 6949 return true; 6950+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6951 6952 // Explicitly whitelisted WebUI hosts. 6953 for (size_t i = 0; 6954@@ -293,6 +295,7 @@ class TemplateParser { 6955 bool OnExtensionsSupportUI(std::string* mime_type, std::string* output) { 6956 *mime_type = "text/html"; 6957 6958+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6959 if (cef::IsChromeRuntimeEnabled()) { 6960 // Redirect to the Chrome documentation. 6961 *output = 6962@@ -302,6 +305,7 @@ bool OnExtensionsSupportUI(std::string* mime_type, std::string* output) { 6963 "</head></html>\n"; 6964 return true; 6965 } 6966+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6967 6968 static const char kDevURL[] = "https://developer.chrome.com/extensions/"; 6969 6970diff --git a/src/cef/libcef/browser/net/scheme_handler.cc b/src/cef/libcef/browser/net/scheme_handler.cc 6971index 9686e53fa94a5..701ff98e6a964 6972--- a/src/cef/libcef/browser/net/scheme_handler.cc 6973+++ b/src/cef/libcef/browser/net/scheme_handler.cc 6974@@ -6,13 +6,16 @@ 6975 6976 #include <string> 6977 6978-#include "libcef/browser/net/chrome_scheme_handler.h" 6979 #include "libcef/browser/net/devtools_scheme_handler.h" 6980 #include "libcef/common/net/scheme_registration.h" 6981 #include "libcef/features/runtime.h" 6982 6983 #include "content/public/common/url_constants.h" 6984 6985+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 6986+#include "libcef/browser/net/chrome_scheme_handler.h" 6987+#endif 6988+ 6989 namespace scheme { 6990 6991 void RegisterInternalHandlers(CefIOThreadState* iothread_state) { 6992diff --git a/src/cef/libcef/browser/net_database/cef_data_base_impl.cc b/src/cef/libcef/browser/net_database/cef_data_base_impl.cc 6993index ceb653c27b0f4..f91e981433c06 6994--- a/src/cef/libcef/browser/net_database/cef_data_base_impl.cc 6995+++ b/src/cef/libcef/browser/net_database/cef_data_base_impl.cc 6996@@ -57,17 +57,19 @@ void CefDataBaseImpl::SaveHttpAuthCredentials(const CefString& host, 6997 void CefDataBaseImpl::GetHttpAuthCredentials( 6998 const CefString& host, 6999 const CefString& realm, 7000- std::vector<CefString>& username_password) { 7001+ CefString& username, 7002+ char* password, 7003+ uint32_t passwordSize) { 7004 if (host.empty() || realm.empty()) { 7005 return; 7006 } 7007 7008- std::vector<std::string> result; 7009+ std::string usernameStr; 7010 OHOS::NWeb::OhosWebDataBaseAdapter& databaseAdapter = 7011 OHOS::NWeb::OhosAdapterHelper::GetInstance() 7012 .GetOhosWebDataBaseAdapterInstance(); 7013- databaseAdapter.GetHttpAuthCredentials(host, realm, result); 7014- TransferVector(result, username_password); 7015+ databaseAdapter.GetHttpAuthCredentials(host, realm, usernameStr, password, passwordSize); 7016+ username = usernameStr; 7017 return; 7018 } 7019 7020diff --git a/src/cef/libcef/browser/net_database/cef_data_base_impl.h b/src/cef/libcef/browser/net_database/cef_data_base_impl.h 7021index 439385953b998..b990d0ceae2a4 7022--- a/src/cef/libcef/browser/net_database/cef_data_base_impl.h 7023+++ b/src/cef/libcef/browser/net_database/cef_data_base_impl.h 7024@@ -28,7 +28,9 @@ class CefDataBaseImpl : public CefDataBase { 7025 void GetHttpAuthCredentials( 7026 const CefString& host, 7027 const CefString& realm, 7028- std::vector<CefString>& username_password) override; 7029+ CefString& username, 7030+ char* password, 7031+ uint32_t passwordSize) override; 7032 7033 bool ExistPermissionByOrigin(const CefString& origin, int type) override; 7034 7035diff --git a/src/cef/libcef/browser/net_database/cef_dns_data_base.cc b/src/cef/libcef/browser/net_database/cef_dns_data_base.cc 7036index a6ebf9267945b..e3e675675ef65 7037--- a/src/cef/libcef/browser/net_database/cef_dns_data_base.cc 7038+++ b/src/cef/libcef/browser/net_database/cef_dns_data_base.cc 7039@@ -4,20 +4,23 @@ 7040 7041 #include "cef_dns_data_base.h" 7042 7043+#include <set> 7044 #include "base/logging.h" 7045 #include "net/base/ip_endpoint.h" 7046 #include "nweb_pre_dns_adapter.h" 7047 #include "ohos_adapter_helper.h" 7048 #include "third_party/abseil-cpp/absl/types/optional.h" 7049 7050+namespace { 7051+std::set<const std::string> g_hostname; 7052+} 7053 void CacheHostName(const std::string& hostname) { 7054- OHOS::NWeb::OhosWebDnsDataBaseAdapter& dnsDatabaseAdapter = 7055+ if (g_hostname.count(hostname) == 0) { 7056+ g_hostname.insert(hostname); 7057+ OHOS::NWeb::OhosWebDnsDataBaseAdapter& dnsDatabaseAdapter = 7058 OHOS::NWeb::OhosAdapterHelper::GetInstance().GetWebDnsDataBaseInstance(); 7059- if (dnsDatabaseAdapter.ExistHostname(hostname)) { 7060- return; 7061+ dnsDatabaseAdapter.InsertHostname(hostname); 7062 } 7063- 7064- dnsDatabaseAdapter.InsertHostname(hostname); 7065 } 7066 7067 net::AddressList GetAddrList(const std::string& hostname) { 7068diff --git a/src/cef/libcef/browser/net_service/login_delegate.cc b/src/cef/libcef/browser/net_service/login_delegate.cc 7069index dc05f1f1a6945..326b285c0878c 7070--- a/src/cef/libcef/browser/net_service/login_delegate.cc 7071+++ b/src/cef/libcef/browser/net_service/login_delegate.cc 7072@@ -4,6 +4,8 @@ 7073 7074 #include "libcef/browser/net_service/login_delegate.h" 7075 7076+#include <securec.h> 7077+ 7078 #include "libcef/browser/browser_host_base.h" 7079 #include "libcef/browser/net_database/cef_data_base_impl.h" 7080 #include "libcef/browser/net_service/browser_urlrequest_impl.h" 7081@@ -17,8 +19,6 @@ 7082 namespace net_service { 7083 7084 namespace { 7085-const int USERNAME_PASSWORD_VECTOR_NUM = 2; 7086- 7087 class AuthCallbackImpl : public CefAuthCallback { 7088 public: 7089 explicit AuthCallbackImpl(base::WeakPtr<LoginDelegate> delegate, 7090@@ -68,6 +68,7 @@ class AuthCallbackImpl : public CefAuthCallback { 7091 } 7092 7093 bool IsHttpAuthInfoSaved() override { 7094+ constexpr int32_t MAX_PWD_LENGTH = 256; 7095 auto dataBase = CefDataBase::GetGlobalDataBase(); 7096 if (dataBase == nullptr) { 7097 return false; 7098@@ -75,25 +76,29 @@ class AuthCallbackImpl : public CefAuthCallback { 7099 if (!dataBase->ExistHttpAuthCredentials()) { 7100 return false; 7101 } 7102- std::vector<CefString> usernamePassword; 7103- usernamePassword.clear(); 7104- dataBase->GetHttpAuthCredentials(host_, realm_, usernamePassword); 7105- if (usernamePassword.size() < USERNAME_PASSWORD_VECTOR_NUM) { 7106+ CefString username; 7107+ char password[MAX_PWD_LENGTH + 1] = {0}; 7108+ dataBase->GetHttpAuthCredentials(host_, realm_, username, password, MAX_PWD_LENGTH + 1); 7109+ if (username.empty() || strlen(password) == 0) { 7110+ (void)memset_s(password, MAX_PWD_LENGTH + 1, 0, MAX_PWD_LENGTH + 1); 7111 return false; 7112 } 7113- CefString username = usernamePassword[0]; 7114- CefString password = usernamePassword[1]; 7115+ CefString passwordCef(password, strlen(password)); 7116+ (void)memset_s(password, MAX_PWD_LENGTH + 1, 0, MAX_PWD_LENGTH + 1); 7117 if (!task_runner_->RunsTasksInCurrentSequence()) { 7118 task_runner_->PostTask( 7119 FROM_HERE, base::BindOnce(&AuthCallbackImpl::Continue, this, username, 7120- password)); 7121+ passwordCef)); 7122+ passwordCef.MemsetToZero(); 7123 return true; 7124 } 7125 if (delegate_) { 7126- delegate_->Continue(username, password); 7127+ delegate_->Continue(username, passwordCef); 7128 delegate_ = nullptr; 7129+ passwordCef.MemsetToZero(); 7130 return true; 7131 } 7132+ passwordCef.MemsetToZero(); 7133 return false; 7134 } 7135 7136diff --git a/src/cef/libcef/browser/net_service/net_helpers.cc b/src/cef/libcef/browser/net_service/net_helpers.cc 7137index ee608d9f6eb2d..526513d35fca1 7138--- a/src/cef/libcef/browser/net_service/net_helpers.cc 7139+++ b/src/cef/libcef/browser/net_service/net_helpers.cc 7140@@ -38,8 +38,8 @@ bool NetHelpers::ShouldBlockContentUrls() { 7141 return !allow_content_access; 7142 } 7143 7144-bool NetHelpers::ShouldBlockFileUrls() { 7145- return !allow_file_access; 7146+bool NetHelpers::ShouldBlockFileUrls(struct NetHelperSetting setting) { 7147+ return !setting.file_access; 7148 } 7149 7150 bool NetHelpers::IsAllowAcceptCookies() { 7151@@ -77,33 +77,33 @@ bool IsSpecialFileUrl(const GURL& url) { 7152 return false; 7153 } 7154 7155-bool IsURLBlocked(const GURL& url) { 7156+bool IsURLBlocked(const GURL& url, struct NetHelperSetting setting) { 7157 // Part of implementation of NWebPreference.allowContentAccess. 7158 if (url.SchemeIs(url::kContentScheme) && NetHelpers::ShouldBlockContentUrls()) 7159 return true; 7160 7161 // Part of implementation of NWebPreference.allowFileAccess. 7162- if (url.SchemeIsFile() && NetHelpers::ShouldBlockFileUrls()) { 7163+ if (url.SchemeIsFile() && NetHelpers::ShouldBlockFileUrls(setting)) { 7164 // Appdatas are always available. 7165 return !IsSpecialFileUrl(url); 7166 } 7167 7168- return NetHelpers::is_network_blocked && url.SchemeIs(url::kFtpScheme); 7169+ return setting.block_network && url.SchemeIs(url::kFtpScheme); 7170 } 7171 7172-int UpdateLoadFlags(int load_flags) { 7173- if (NetHelpers::is_network_blocked) { 7174+int UpdateLoadFlags(int load_flags, NetHelperSetting setting) { 7175+ if (setting.block_network) { 7176 LOG(INFO) << "Update cache control flag to block network."; 7177 return UpdateCacheLoadFlags( 7178 load_flags, 7179 net::LOAD_ONLY_FROM_CACHE | net::LOAD_SKIP_CACHE_VALIDATION); 7180 } 7181 7182- if (!NetHelpers::cache_mode) { 7183+ if (!setting.cache_mode) { 7184 return load_flags; 7185 } 7186 7187- return UpdateCacheLoadFlags(load_flags, NetHelpers::cache_mode); 7188+ return UpdateCacheLoadFlags(load_flags, setting.cache_mode); 7189 } 7190 7191 } // namespace net_service 7192diff --git a/src/cef/libcef/browser/net_service/net_helpers.h b/src/cef/libcef/browser/net_service/net_helpers.h 7193index f2283769ec839..6c8fa83c33a74 7194--- a/src/cef/libcef/browser/net_service/net_helpers.h 7195+++ b/src/cef/libcef/browser/net_service/net_helpers.h 7196@@ -11,10 +11,16 @@ namespace net_service { 7197 7198 #define NETHELPERS_EXPORT __attribute__((visibility("default"))) 7199 7200+struct NetHelperSetting { 7201+ bool file_access; 7202+ bool block_network; 7203+ int cache_mode; 7204+}; 7205+ 7206 class NETHELPERS_EXPORT NetHelpers { 7207 public: 7208 static bool ShouldBlockContentUrls(); 7209- static bool ShouldBlockFileUrls(); 7210+ static bool ShouldBlockFileUrls(struct NetHelperSetting setting); 7211 static bool IsAllowAcceptCookies(); 7212 static bool IsThirdPartyCookieAllowed(); 7213 7214@@ -29,11 +35,11 @@ class NETHELPERS_EXPORT NetHelpers { 7215 bool IsSpecialFileUrl(const GURL& url); 7216 7217 // Update request's |load_flags| based on the settings. 7218-int UpdateLoadFlags(int load_flags); 7219+int UpdateLoadFlags(int load_flags, struct NetHelperSetting setting); 7220 7221 // Returns true if the given URL should be aborted with 7222 // net::ERR_ACCESS_DENIED. 7223-bool IsURLBlocked(const GURL& url); 7224+bool IsURLBlocked(const GURL& url, struct NetHelperSetting setting); 7225 7226 } // namespace net_service 7227 7228diff --git a/src/cef/libcef/browser/net_service/proxy_url_loader_factory.cc b/src/cef/libcef/browser/net_service/proxy_url_loader_factory.cc 7229index 93d08697df16e..a016633fb5382 7230--- a/src/cef/libcef/browser/net_service/proxy_url_loader_factory.cc 7231+++ b/src/cef/libcef/browser/net_service/proxy_url_loader_factory.cc 7232@@ -500,13 +500,15 @@ void InterceptedRequest::Restart() { 7233 } 7234 } 7235 7236- if (IsURLBlocked(request_.url)) { 7237+ struct NetHelperSetting setting; 7238+ factory_->request_handler_->GetSettingOfNetHelper(setting); 7239+ if (IsURLBlocked(request_.url, setting)) { 7240 SendErrorAndCompleteImmediately(net::ERR_ACCESS_DENIED); 7241 LOG(INFO) << "File url access denied! url=" << request_.url.spec(); 7242 return; 7243 } 7244 7245- request_.load_flags = UpdateLoadFlags(request_.load_flags); 7246+ request_.load_flags = UpdateLoadFlags(request_.load_flags, setting); 7247 7248 const GURL original_url = request_.url; 7249 7250@@ -612,11 +614,7 @@ void InterceptedRequest::OnReceiveResponse( 7251 request->SetURL(CefString(request_.url.spec())); 7252 request->SetMethod(CefString(request_.method)); 7253 request->Set(request_.headers); 7254- content::GetUIThreadTaskRunner({})->PostTask( 7255- FROM_HERE, base::BindOnce(&InterceptedRequest::OnHttpErrorForUIThread, 7256- base::Unretained(this), id_, request, 7257- request_.is_main_frame, 7258- request_.has_user_gesture, error_reponse)); 7259+ OnHttpErrorForUIThread(id_, request, request_.is_main_frame, request_.has_user_gesture, error_reponse); 7260 } 7261 7262 if (current_request_uses_header_client_) { 7263diff --git a/src/cef/libcef/browser/net_service/proxy_url_loader_factory.h b/src/cef/libcef/browser/net_service/proxy_url_loader_factory.h 7264index 53011b62b2981..c94b8eba97720 7265--- a/src/cef/libcef/browser/net_service/proxy_url_loader_factory.h 7266+++ b/src/cef/libcef/browser/net_service/proxy_url_loader_factory.h 7267@@ -140,6 +140,9 @@ class InterceptedRequestHandler { 7268 bool is_main_frame, 7269 bool has_user_gesture, 7270 CefRefPtr<CefResponse> error_response) {} 7271+ 7272+ // To get setting of net helper. 7273+ virtual void GetSettingOfNetHelper(struct NetHelperSetting& setting) {} 7274 }; 7275 7276 // URL Loader Factory that supports request/response interception, processing 7277diff --git a/src/cef/libcef/browser/net_service/resource_request_handler_wrapper.cc b/src/cef/libcef/browser/net_service/resource_request_handler_wrapper.cc 7278index 15b602200100b..dd61f9586dfcc 7279--- a/src/cef/libcef/browser/net_service/resource_request_handler_wrapper.cc 7280+++ b/src/cef/libcef/browser/net_service/resource_request_handler_wrapper.cc 7281@@ -1200,6 +1200,27 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { 7282 error_response); 7283 } 7284 7285+ void GetSettingOfNetHelper(struct NetHelperSetting& setting) override { 7286+ CEF_REQUIRE_UIT(); 7287+ if (!init_state_) { 7288+ // set the default value 7289+ setting.file_access = false; 7290+ setting.block_network = false; 7291+ setting.cache_mode = 0; 7292+ return; 7293+ } 7294+ if (!init_state_->browser_) { 7295+ // set the default value 7296+ setting.file_access = false; 7297+ setting.block_network = false; 7298+ setting.cache_mode = 0; 7299+ return; 7300+ } 7301+ setting.file_access = init_state_->browser_->GetFileAccess(); 7302+ setting.block_network = init_state_->browser_->GetBlockNetwork(); 7303+ setting.cache_mode = init_state_->browser_->GetCacheMode(); 7304+ } 7305+ 7306 private: 7307 void CallHandlerOnComplete(RequestState* state, 7308 const network::URLLoaderCompletionStatus& status) { 7309diff --git a/src/cef/libcef/browser/osr/browser_platform_delegate_osr.cc b/src/cef/libcef/browser/osr/browser_platform_delegate_osr.cc 7310index 69a0423ceb774..bdef16ae39192 7311--- a/src/cef/libcef/browser/osr/browser_platform_delegate_osr.cc 7312+++ b/src/cef/libcef/browser/osr/browser_platform_delegate_osr.cc 7313@@ -18,6 +18,48 @@ 7314 #include "content/public/browser/render_view_host.h" 7315 #include "ui/events/base_event_utils.h" 7316 7317+namespace { 7318+void ConvertSelectPopupItem(const blink::mojom::MenuItemPtr& menu_ptr, 7319+ CefSelectPopupItem& menu_item) { 7320+ CefString label = CefString(menu_ptr->label.value_or("")); 7321+ CefString tool_tip = CefString(menu_ptr->tool_tip.value_or("")); 7322+ cef_string_set(label.c_str(), label.length(), &(menu_item.label), true); 7323+ cef_string_set(tool_tip.c_str(), tool_tip.length(), &(menu_item.tool_tip), 7324+ true); 7325+ menu_item.action = menu_ptr->action; 7326+ menu_item.enabled = menu_ptr->enabled; 7327+ menu_item.checked = menu_ptr->checked; 7328+ menu_item.type = static_cast<cef_select_popup_item_type_t>(menu_ptr->type); 7329+ menu_item.text_direction = 7330+ static_cast<cef_text_direction_t>(menu_ptr->text_direction); 7331+ menu_item.has_text_direction_override = menu_ptr->has_text_direction_override; 7332+} 7333+} // namespace 7334+ 7335+class CefSelectPopupCallbackImpl : public CefSelectPopupCallback { 7336+ public: 7337+ explicit CefSelectPopupCallbackImpl( 7338+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client) { 7339+ popup_client_.Bind(std::move(popup_client)); 7340+ } 7341+ 7342+ void Continue(const std::vector<int>& indices) override { 7343+ if (popup_client_) { 7344+ popup_client_->DidAcceptIndices(indices); 7345+ } 7346+ } 7347+ 7348+ void Cancel() override { 7349+ if (popup_client_) { 7350+ popup_client_->DidCancel(); 7351+ } 7352+ } 7353+ 7354+ private: 7355+ mojo::Remote<blink::mojom::PopupMenuClient> popup_client_; 7356+ IMPLEMENT_REFCOUNTING(CefSelectPopupCallbackImpl); 7357+}; 7358+ 7359 CefBrowserPlatformDelegateOsr::CefBrowserPlatformDelegateOsr( 7360 std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate, 7361 bool use_shared_texture, 7362@@ -495,6 +537,34 @@ void CefBrowserPlatformDelegateOsr::StartDragging( 7363 DragSourceSystemDragEnded(); 7364 } 7365 7366+void CefBrowserPlatformDelegateOsr::ShowPopupMenu( 7367+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client, 7368+ const gfx::Rect& bounds, 7369+ int item_height, 7370+ double item_font_size, 7371+ int selected_item, 7372+ std::vector<blink::mojom::MenuItemPtr> menu_items, 7373+ bool right_aligned, 7374+ bool allow_multiple_selection) { 7375+ CefRefPtr<CefDialogHandler> handler = 7376+ browser_->GetClient()->GetDialogHandler(); 7377+ if (handler.get()) { 7378+ std::vector<CefSelectPopupItem> item_list; 7379+ for (int i = 0; i < menu_items.size(); i++) { 7380+ CefSelectPopupItem menu_item; 7381+ ConvertSelectPopupItem(menu_items[i], menu_item); 7382+ item_list.push_back(menu_item); 7383+ } 7384+ CefRefPtr<CefSelectPopupCallback> callback = 7385+ new CefSelectPopupCallbackImpl(std::move(popup_client)); 7386+ handler->OnSelectPopupMenu( 7387+ browser_, 7388+ CefRect(bounds.x(), bounds.y(), bounds.width(), bounds.height()), 7389+ item_height, item_font_size, selected_item, item_list, right_aligned, 7390+ allow_multiple_selection, callback); 7391+ } 7392+} 7393+ 7394 void CefBrowserPlatformDelegateOsr::UpdateDragCursor( 7395 ui::mojom::DragOperation operation) { 7396 CefRefPtr<CefRenderHandler> handler = 7397@@ -609,4 +679,4 @@ CefRenderWidgetHostViewOSR* CefBrowserPlatformDelegateOsr::GetOSRHostView() 7398 } 7399 7400 return nullptr; 7401-} 7402+} 7403\ No newline at end of file 7404diff --git a/src/cef/libcef/browser/osr/browser_platform_delegate_osr.h b/src/cef/libcef/browser/osr/browser_platform_delegate_osr.h 7405index 5efb3ee968db5..7074ae9d77398 7406--- a/src/cef/libcef/browser/osr/browser_platform_delegate_osr.h 7407+++ b/src/cef/libcef/browser/osr/browser_platform_delegate_osr.h 7408@@ -89,6 +89,15 @@ class CefBrowserPlatformDelegateOsr 7409 void AccessibilityLocationChangesReceived( 7410 const std::vector<content::AXLocationChangeNotificationDetails>& locData) 7411 override; 7412+ void ShowPopupMenu( 7413+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client, 7414+ const gfx::Rect& bounds, 7415+ int item_height, 7416+ double item_font_size, 7417+ int selected_item, 7418+ std::vector<blink::mojom::MenuItemPtr> menu_items, 7419+ bool right_aligned, 7420+ bool allow_multiple_selection) override; 7421 7422 // CefBrowserPlatformDelegateNative::WindowlessHandler methods: 7423 CefWindowHandle GetParentWindowHandle() const override; 7424diff --git a/src/cef/libcef/browser/osr/render_widget_host_view_osr.cc b/src/cef/libcef/browser/osr/render_widget_host_view_osr.cc 7425index 86b0da5a7d138..d0f64d4d7fcf1 7426--- a/src/cef/libcef/browser/osr/render_widget_host_view_osr.cc 7427+++ b/src/cef/libcef/browser/osr/render_widget_host_view_osr.cc 7428@@ -1599,6 +1599,9 @@ void CefRenderWidgetHostViewOSR::SetFocus(bool focus) { 7429 if (focus) { 7430 widget->GotFocus(); 7431 widget->SetActive(true); 7432+ if (selection_controller_client_) { 7433+ selection_controller_client_->SetTemporarilyHidden(false); 7434+ } 7435 } else { 7436 #if !BUILDFLAG(IS_OHOS) 7437 if (browser_impl_.get()) 7438@@ -1619,7 +1622,7 @@ void CefRenderWidgetHostViewOSR::OnUpdateTextInputStateCalled( 7439 bool did_update_state) { 7440 const auto state = text_input_manager->GetTextInputState(); 7441 if (state && !state->show_ime_if_needed) { 7442- LOG(INFO) << "OnUpdateTextInputStateCalled no need to show ime"; 7443+ return; 7444 } 7445 7446 CefRenderHandler::TextInputMode mode = CEF_TEXT_INPUT_MODE_NONE; 7447@@ -1641,6 +1644,21 @@ void CefRenderWidgetHostViewOSR::OnUpdateTextInputStateCalled( 7448 show_keyboard); 7449 } 7450 7451+void CefRenderWidgetHostViewOSR::FocusedNodeChanged(bool is_editable_node, 7452+ const gfx::Rect& node_bounds_in_screen) 7453+{ 7454+ CefRefPtr<CefRenderHandler> handler = 7455+ browser_impl_->GetClient()->GetRenderHandler(); 7456+ CHECK(handler); 7457+ if (is_editable_node) { 7458+ handler->OnVirtualKeyboardRequested(browser_impl_->GetBrowser(), 7459+ CEF_TEXT_INPUT_MODE_DEFAULT, false); 7460+ } else { 7461+ handler->OnVirtualKeyboardRequested(browser_impl_->GetBrowser(), 7462+ CEF_TEXT_INPUT_MODE_NONE, false); 7463+ } 7464+} 7465+ 7466 void CefRenderWidgetHostViewOSR::ProcessAckedTouchEvent( 7467 const content::TouchEventWithLatencyInfo& touch, 7468 blink::mojom::InputEventResultState ack_result) { 7469@@ -1967,8 +1985,13 @@ void CefRenderWidgetHostViewOSR::OnScrollOffsetChanged() { 7470 CefRefPtr<CefRenderHandler> handler = 7471 browser_impl_->client()->GetRenderHandler(); 7472 CHECK(handler); 7473+ #if BUILDFLAG(IS_OHOS) 7474+ handler->OnScrollOffsetChanged(browser_impl_.get(), std::round(last_scroll_offset_.x()), 7475+ std::round(last_scroll_offset_.y())); 7476+ #else 7477 handler->OnScrollOffsetChanged(browser_impl_.get(), last_scroll_offset_.x(), 7478 last_scroll_offset_.y()); 7479+ #endif 7480 } 7481 is_scroll_offset_changed_pending_ = false; 7482 } 7483diff --git a/src/cef/libcef/browser/osr/render_widget_host_view_osr.h b/src/cef/libcef/browser/osr/render_widget_host_view_osr.h 7484index bf5e49c14b13d..96cc2faf567a7 7485--- a/src/cef/libcef/browser/osr/render_widget_host_view_osr.h 7486+++ b/src/cef/libcef/browser/osr/render_widget_host_view_osr.h 7487@@ -225,6 +225,9 @@ class CefRenderWidgetHostViewOSR 7488 RenderWidgetHostViewBase* updated_view, 7489 bool did_update_state) override; 7490 7491+ void FocusedNodeChanged(bool is_editable_node, 7492+ const gfx::Rect& node_bounds_in_screen) override; 7493+ 7494 // ui::GestureProviderClient implementation. 7495 void ProcessAckedTouchEvent( 7496 const content::TouchEventWithLatencyInfo& touch, 7497diff --git a/src/cef/libcef/browser/osr/touch_selection_controller_client_osr.cc b/src/cef/libcef/browser/osr/touch_selection_controller_client_osr.cc 7498index a4566a8dbba89..f2751a7a4c027 7499--- a/src/cef/libcef/browser/osr/touch_selection_controller_client_osr.cc 7500+++ b/src/cef/libcef/browser/osr/touch_selection_controller_client_osr.cc 7501@@ -21,6 +21,7 @@ 7502 #include "ui/base/pointer/touch_editing_controller.h" 7503 #include "ui/gfx/geometry/point_conversions.h" 7504 #include "ui/gfx/geometry/size_conversions.h" 7505+#include "base/logging.h" 7506 7507 namespace { 7508 7509@@ -125,7 +126,22 @@ CefTouchSelectionControllerClientOSR::~CefTouchSelectionControllerClientOSR() { 7510 7511 void CefTouchSelectionControllerClientOSR::CloseQuickMenuAndHideHandles() { 7512 CloseQuickMenu(); 7513- rwhv_->selection_controller()->HideAndDisallowShowingAutomatically(); 7514+ auto controller = rwhv_->selection_controller(); 7515+ if (controller) { 7516+ if (!controller->GetInsertHandle() || !controller->GetInsertHandle()->GetEnabled()) { 7517+ rwhv_->selection_controller()->HideAndDisallowShowingAutomatically(); 7518+ } else if (controller->GetInsertHandle()->GetEnabled()) { 7519+ rwhv_->selection_controller()->SetTemporarilyHidden(true); 7520+ NotifyTouchSelectionChanged(true); 7521+ } 7522+ } 7523+} 7524+ 7525+void CefTouchSelectionControllerClientOSR::SetTemporarilyHidden(bool hidden) { 7526+ if (rwhv_ && rwhv_->selection_controller()) { 7527+ rwhv_->selection_controller()->SetTemporarilyHidden(hidden); 7528+ NotifyTouchSelectionChanged(false); 7529+ } 7530 } 7531 7532 void CefTouchSelectionControllerClientOSR::OnWindowMoved() { 7533@@ -290,7 +306,6 @@ void CefTouchSelectionControllerClientOSR::ShowQuickMenu() { 7534 new CefRunQuickMenuCallbackImpl(base::BindOnce( 7535 &CefTouchSelectionControllerClientOSR::ExecuteCommand, 7536 weak_ptr_factory_.GetWeakPtr()))); 7537- 7538 quick_menu_running_ = true; 7539 if (!handler->RunQuickMenu( 7540 browser, browser->GetFocusedFrame(), 7541@@ -307,6 +322,7 @@ void CefTouchSelectionControllerClientOSR::ShowQuickMenu() { 7542 if (browser->web_contents()) { 7543 browser->web_contents()->SetShowingContextMenu(true); 7544 } 7545+ browser->SetTouchInsertHandleMenuShow(false); 7546 } 7547 } 7548 } 7549@@ -404,6 +420,7 @@ void CefTouchSelectionControllerClientOSR::OnSelectionEvent( 7550 ui::SelectionEventType event) { 7551 // This function (implicitly) uses active_menu_client_, so we don't go to the 7552 // active view for this. 7553+ auto browser = rwhv_->browser_impl(); 7554 switch (event) { 7555 case ui::SELECTION_HANDLES_SHOWN: 7556 quick_menu_requested_ = true; 7557@@ -416,7 +433,9 @@ void CefTouchSelectionControllerClientOSR::OnSelectionEvent( 7558 rwhv_->browser_impl()->GetTouchInsertHandleMenuShow(); 7559 } 7560 NotifyTouchSelectionChanged(true); 7561- UpdateQuickMenu(); 7562+ if (quick_menu_requested_) { 7563+ ShowQuickMenu(); 7564+ } 7565 break; 7566 case ui::SELECTION_HANDLES_CLEARED: 7567 case ui::INSERTION_HANDLE_CLEARED: 7568@@ -433,11 +452,10 @@ void CefTouchSelectionControllerClientOSR::OnSelectionEvent( 7569 handle_drag_in_progress_ = false; 7570 break; 7571 case ui::SELECTION_HANDLES_MOVED: 7572+ case ui::INSERTION_HANDLE_MOVED: 7573 if (!handle_drag_in_progress_) { 7574 UpdateQuickMenu(); 7575 } 7576- [[fallthrough]]; 7577- case ui::INSERTION_HANDLE_MOVED: 7578 NotifyTouchSelectionChanged(true); 7579 break; 7580 case ui::INSERTION_HANDLE_TAPPED: 7581@@ -450,9 +468,6 @@ void CefTouchSelectionControllerClientOSR::OnSelectionEvent( 7582 } 7583 break; 7584 } 7585- if (rwhv_ && rwhv_->browser_impl()) { 7586- rwhv_->browser_impl()->SetTouchInsertHandleMenuShow(false); 7587- } 7588 } 7589 7590 void CefTouchSelectionControllerClientOSR::InternalClient::OnSelectionEvent( 7591@@ -616,4 +631,4 @@ bool CefTouchSelectionControllerClientOSR:: 7592 return true; 7593 } 7594 return false; 7595-} 7596+} 7597\ No newline at end of file 7598diff --git a/src/cef/libcef/browser/osr/touch_selection_controller_client_osr.h b/src/cef/libcef/browser/osr/touch_selection_controller_client_osr.h 7599index 9794cf9fc8ea0..b7de80ae61a1b 7600--- a/src/cef/libcef/browser/osr/touch_selection_controller_client_osr.h 7601+++ b/src/cef/libcef/browser/osr/touch_selection_controller_client_osr.h 7602@@ -41,6 +41,7 @@ class CefTouchSelectionControllerClientOSR 7603 ~CefTouchSelectionControllerClientOSR() override; 7604 7605 void CloseQuickMenuAndHideHandles(); 7606+ void SetTemporarilyHidden(bool hidden); 7607 7608 void OnWindowMoved(); 7609 7610diff --git a/src/cef/libcef/browser/osr/web_contents_view_osr.cc b/src/cef/libcef/browser/osr/web_contents_view_osr.cc 7611index e81a41ae714c1..3469cfdf25aa8 7612--- a/src/cef/libcef/browser/osr/web_contents_view_osr.cc 7613+++ b/src/cef/libcef/browser/osr/web_contents_view_osr.cc 7614@@ -148,6 +148,8 @@ bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() { 7615 } 7616 #endif // BUILDFLAG(IS_MAC) 7617 7618+void CefWebContentsViewOSR::FullscreenStateChanged(bool is_fullscreen) {} 7619+ 7620 void CefWebContentsViewOSR::StartDragging( 7621 const content::DropData& drop_data, 7622 blink::DragOperationsMask allowed_ops, 7623@@ -172,6 +174,27 @@ void CefWebContentsViewOSR::UpdateDragCursor( 7624 browser->UpdateDragCursor(operation); 7625 } 7626 7627+#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 7628+void CefWebContentsViewOSR::ShowPopupMenu( 7629+ content::RenderFrameHost* render_frame_host, 7630+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client, 7631+ const gfx::Rect& bounds, 7632+ int item_height, 7633+ double item_font_size, 7634+ int selected_item, 7635+ std::vector<blink::mojom::MenuItemPtr> menu_items, 7636+ bool right_aligned, 7637+ bool allow_multiple_selection) { 7638+ CefRefPtr<AlloyBrowserHostImpl> browser = GetBrowser(); 7639+ if (browser.get()) { 7640+ browser->ShowPopupMenu(std::move(popup_client), bounds, 7641+ item_height, item_font_size, selected_item, 7642+ std::move(menu_items), right_aligned, 7643+ allow_multiple_selection); 7644+ } 7645+} 7646+#endif 7647+ 7648 CefRenderWidgetHostViewOSR* CefWebContentsViewOSR::GetView() const { 7649 if (web_contents_) { 7650 return static_cast<CefRenderWidgetHostViewOSR*>( 7651diff --git a/src/cef/libcef/browser/osr/web_contents_view_osr.h b/src/cef/libcef/browser/osr/web_contents_view_osr.h 7652index 81b5689dcb6f7..e5dd7ae1c817b 7653--- a/src/cef/libcef/browser/osr/web_contents_view_osr.h 7654+++ b/src/cef/libcef/browser/osr/web_contents_view_osr.h 7655@@ -65,6 +65,8 @@ class CefWebContentsViewOSR : public content::WebContentsView, 7656 bool CloseTabAfterEventTrackingIfNeeded() override; 7657 #endif 7658 7659+ void FullscreenStateChanged(bool is_fullscreen) override; 7660+ 7661 // RenderViewHostDelegateView methods. 7662 void StartDragging(const content::DropData& drop_data, 7663 blink::DragOperationsMask allowed_ops, 7664@@ -78,6 +80,18 @@ class CefWebContentsViewOSR : public content::WebContentsView, 7665 virtual void LostFocus( 7666 content::RenderWidgetHostImpl* render_widget_host) override; 7667 virtual void TakeFocus(bool reverse) override; 7668+#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 7669+ void ShowPopupMenu( 7670+ content::RenderFrameHost* render_frame_host, 7671+ mojo::PendingRemote<blink::mojom::PopupMenuClient> popup_client, 7672+ const gfx::Rect& bounds, 7673+ int item_height, 7674+ double item_font_size, 7675+ int selected_item, 7676+ std::vector<blink::mojom::MenuItemPtr> menu_items, 7677+ bool right_aligned, 7678+ bool allow_multiple_selection) override; 7679+#endif 7680 7681 private: 7682 CefRenderWidgetHostViewOSR* GetView() const; 7683diff --git a/src/cef/libcef/browser/permission/alloy_permission_manager.cc b/src/cef/libcef/browser/permission/alloy_permission_manager.cc 7684index 146fd38451908..a773869340107 7685--- a/src/cef/libcef/browser/permission/alloy_permission_manager.cc 7686+++ b/src/cef/libcef/browser/permission/alloy_permission_manager.cc 7687@@ -9,12 +9,12 @@ 7688 7689 #include "base/callback.h" 7690 #include "base/logging.h" 7691+#include "components/permissions/permission_util.h" 7692 #include "content/public/browser/permission_controller.h" 7693 #include "content/public/browser/permission_type.h" 7694 #include "content/public/browser/render_frame_host.h" 7695 #include "content/public/browser/render_process_host.h" 7696 #include "content/public/browser/web_contents.h" 7697-#include "components/permissions/permission_util.h" 7698 7699 using blink::mojom::PermissionStatus; 7700 using content::PermissionType; 7701@@ -197,21 +197,23 @@ void AlloyPermissionManager::RequestPermissionByType( 7702 if (browser) 7703 browser->AskGeolocationPermission( 7704 pending_request_raw->requesting_origin_.spec(), 7705- base::BindRepeating(&AlloyPermissionManager::OnRequestResponseCallBack, 7706- weak_ptr_factory_.GetWeakPtr(), request_id, 7707- permission_type)); 7708+ base::BindRepeating( 7709+ &AlloyPermissionManager::OnRequestResponseCallBack, 7710+ weak_ptr_factory_.GetWeakPtr(), request_id, permission_type)); 7711 break; 7712 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: 7713 browser->AskProtectedMediaIdentifierPermission( 7714 pending_request_raw->requesting_origin_.spec(), 7715- base::BindRepeating(&AlloyPermissionManager::OnRequestResponseCallBack, weak_ptr_factory_.GetWeakPtr(), 7716- request_id, permission_type)); 7717+ base::BindRepeating( 7718+ &AlloyPermissionManager::OnRequestResponseCallBack, 7719+ weak_ptr_factory_.GetWeakPtr(), request_id, permission_type)); 7720 break; 7721 case PermissionType::MIDI_SYSEX: 7722 browser->AskMIDISysexPermission( 7723 pending_request_raw->requesting_origin_.spec(), 7724- base::BindRepeating(&AlloyPermissionManager::OnRequestResponseCallBack, weak_ptr_factory_.GetWeakPtr(), 7725- request_id, permission_type)); 7726+ base::BindRepeating( 7727+ &AlloyPermissionManager::OnRequestResponseCallBack, 7728+ weak_ptr_factory_.GetWeakPtr(), request_id, permission_type)); 7729 break; 7730 case PermissionType::AUDIO_CAPTURE: 7731 case PermissionType::VIDEO_CAPTURE: 7732@@ -219,8 +221,6 @@ void AlloyPermissionManager::RequestPermissionByType( 7733 case PermissionType::DURABLE_STORAGE: 7734 case PermissionType::BACKGROUND_SYNC: 7735 case PermissionType::ACCESSIBILITY_EVENTS: 7736- case PermissionType::CLIPBOARD_READ_WRITE: 7737- case PermissionType::CLIPBOARD_SANITIZED_WRITE: 7738 case PermissionType::PAYMENT_HANDLER: 7739 case PermissionType::BACKGROUND_FETCH: 7740 case PermissionType::IDLE_DETECTION: 7741@@ -241,6 +241,8 @@ void AlloyPermissionManager::RequestPermissionByType( 7742 pending_request_raw->SetPermissionStatus(permission_type, 7743 PermissionStatus::DENIED); 7744 break; 7745+ case PermissionType::CLIPBOARD_READ_WRITE: 7746+ case PermissionType::CLIPBOARD_SANITIZED_WRITE: 7747 case PermissionType::WAKE_LOCK_SCREEN: 7748 pending_request_raw->SetPermissionStatus(permission_type, 7749 PermissionStatus::GRANTED); 7750@@ -292,6 +294,10 @@ PermissionStatus AlloyPermissionManager::GetPermissionStatus( 7751 PermissionType permission, 7752 const GURL& requesting_origin, 7753 const GURL& embedding_origin) { 7754+ if (permission == PermissionType::CLIPBOARD_READ_WRITE || 7755+ permission == PermissionType::CLIPBOARD_SANITIZED_WRITE) { 7756+ return PermissionStatus::GRANTED; 7757+ } 7758 return PermissionStatus::DENIED; 7759 } 7760 7761@@ -302,14 +308,15 @@ PermissionStatus AlloyPermissionManager::GetPermissionStatusForFrame( 7762 return GetPermissionStatus( 7763 permission, requesting_origin, 7764 permissions::PermissionUtil::GetLastCommittedOriginAsURL( 7765- render_frame_host->GetMainFrame())); 7766+ render_frame_host->GetMainFrame())); 7767 } 7768 7769 void AlloyPermissionManager::ResetPermission(PermissionType permission, 7770 const GURL& requesting_origin, 7771 const GURL& embedding_origin) {} 7772 7773-AlloyPermissionManager::SubscriptionId AlloyPermissionManager::SubscribePermissionStatusChange( 7774+AlloyPermissionManager::SubscriptionId 7775+AlloyPermissionManager::SubscribePermissionStatusChange( 7776 content::PermissionType permission, 7777 content::RenderFrameHost* render_frame_host, 7778 const GURL& requesting_origin, 7779diff --git a/src/cef/libcef/browser/prefs/browser_prefs.cc b/src/cef/libcef/browser/prefs/browser_prefs.cc 7780index e34ca3e4edd42..0a964b7fe42c1 7781--- a/src/cef/libcef/browser/prefs/browser_prefs.cc 7782+++ b/src/cef/libcef/browser/prefs/browser_prefs.cc 7783@@ -22,10 +22,8 @@ 7784 #include "chrome/browser/accessibility/accessibility_ui.h" 7785 #include "chrome/browser/download/download_prefs.h" 7786 #include "chrome/browser/media/media_device_id_salt.h" 7787-#include "chrome/browser/media/router/media_router_feature.h" 7788 #include "chrome/browser/net/profile_network_context_service.h" 7789 #include "chrome/browser/net/system_network_context_manager.h" 7790-#include "chrome/browser/plugins/plugin_info_host_impl.h" 7791 #include "chrome/browser/prefetch/prefetch_prefs.h" 7792 #include "chrome/browser/prefs/chrome_command_line_pref_store.h" 7793 #include "chrome/browser/printing/print_preview_sticky_settings.h" 7794@@ -75,6 +73,14 @@ 7795 #include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h" 7796 #endif 7797 7798+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 7799+#include "chrome/browser/plugins/plugin_info_host_impl.h" 7800+#endif 7801+ 7802+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 7803+#include "chrome/browser/media/router/media_router_feature.h" 7804+#endif 7805+ 7806 namespace browser_prefs { 7807 7808 namespace { 7809@@ -223,8 +229,12 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile, 7810 CefMediaCaptureDevicesDispatcher::RegisterPrefs(registry.get()); 7811 certificate_transparency::prefs::RegisterPrefs(registry.get()); 7812 flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry.get()); 7813+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 7814 media_router::RegisterLocalStatePrefs(registry.get()); 7815+#endif 7816+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 7817 PluginInfoHostImpl::RegisterUserPrefs(registry.get()); 7818+#endif 7819 PrefProxyConfigTrackerImpl::RegisterPrefs(registry.get()); 7820 ProfileNetworkContextService::RegisterLocalStatePrefs(registry.get()); 7821 SSLConfigServiceManager::RegisterPrefs(registry.get()); 7822@@ -266,7 +276,9 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile, 7823 extensions::ExtensionPrefs::RegisterProfilePrefs(registry.get()); 7824 HostContentSettingsMap::RegisterProfilePrefs(registry.get()); 7825 language::LanguagePrefs::RegisterProfilePrefs(registry.get()); 7826+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 7827 media_router::RegisterProfilePrefs(registry.get()); 7828+#endif 7829 MediaDeviceIDSalt::RegisterProfilePrefs(registry.get()); 7830 prefetch::RegisterPredictionOptionsProfilePrefs(registry.get()); 7831 ProfileNetworkContextService::RegisterProfilePrefs(registry.get()); 7832@@ -291,8 +303,10 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile, 7833 prefs::kPrintPreviewDefaultDestinationSelectionRules, std::string()); 7834 registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, false); 7835 registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true); 7836+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 7837 printing::PolicySettings::RegisterProfilePrefs(registry.get()); 7838 printing::PrintPreviewStickySettings::RegisterProfilePrefs(registry.get()); 7839+#endif 7840 DownloadPrefs::RegisterProfilePrefs(registry.get()); 7841 7842 // Cache preferences. 7843diff --git a/src/cef/libcef/browser/prefs/renderer_prefs.cc b/src/cef/libcef/browser/prefs/renderer_prefs.cc 7844index 4fd9397b037f3..b35655acea8f0 7845--- a/src/cef/libcef/browser/prefs/renderer_prefs.cc 7846+++ b/src/cef/libcef/browser/prefs/renderer_prefs.cc 7847@@ -184,6 +184,7 @@ void SetBool(CommandLinePrefStore* prefs, const std::string& key, bool value) { 7848 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); 7849 } 7850 7851+#if !BUILDFLAG(IS_OHOS) 7852 blink::mojom::PreferredColorScheme ToBlinkPreferredColorScheme( 7853 ui::NativeTheme::PreferredColorScheme native_theme_scheme) { 7854 switch (native_theme_scheme) { 7855@@ -195,6 +196,7 @@ blink::mojom::PreferredColorScheme ToBlinkPreferredColorScheme( 7856 7857 NOTREACHED(); 7858 } 7859+#endif 7860 7861 // From chrome/browser/chrome_content_browser_client.cc 7862 // Returns true if preferred color scheme is modified based on at least one of 7863@@ -207,8 +209,10 @@ bool UpdatePreferredColorScheme(blink::web_pref::WebPreferences* web_prefs, 7864 auto old_preferred_color_scheme = web_prefs->preferred_color_scheme; 7865 7866 // Update based on native theme scheme. 7867+#if !BUILDFLAG(IS_OHOS) 7868 web_prefs->preferred_color_scheme = 7869 ToBlinkPreferredColorScheme(native_theme->GetPreferredColorScheme()); 7870+#endif 7871 7872 // Force a light preferred color scheme on certain URLs if kWebUIDarkMode is 7873 // disabled; some of the UI is not yet correctly themed. 7874@@ -359,6 +363,11 @@ void SetCefPrefs(const CefBrowserSettings& cef, 7875 7876 /* ohos webview begin*/ 7877 SET_STATE(cef.force_dark_mode_enabled, web.force_dark_mode_enabled); 7878+ if (cef.dark_prefer_color_scheme_enabled == STATE_ENABLED) { 7879+ web.preferred_color_scheme = blink::mojom::PreferredColorScheme::kDark; 7880+ } else { 7881+ web.preferred_color_scheme = blink::mojom::PreferredColorScheme::kLight; 7882+ } 7883 SET_STATE(cef.loads_images_automatically, web.loads_images_automatically); 7884 SET_STATE(cef.allow_running_insecure_content, 7885 web.allow_running_insecure_content); 7886@@ -367,10 +376,14 @@ void SetCefPrefs(const CefBrowserSettings& cef, 7887 SET_STATE(cef.allow_mixed_content_upgrades, web.allow_mixed_content_upgrades); 7888 SET_STATE(cef.initialize_at_minimum_page_scale, 7889 web.initialize_at_minimum_page_scale); 7890+#if BUILDFLAG(IS_OHOS) 7891+ SET_STATE(cef.hide_vertical_scrollbars, web.hide_vertical_scrollbars); 7892+ SET_STATE(cef.hide_horizontal_scrollbars, web.hide_horizontal_scrollbars); 7893+#endif 7894 web.viewport_meta_enabled = cef.viewport_meta_enabled; 7895 web.autoplay_policy = 7896 cef.user_gesture_required 7897- ? blink::mojom::AutoplayPolicy::kUserGestureRequired 7898+ ? blink::mojom::AutoplayPolicy::kDocumentUserActivationRequired 7899 : blink::mojom::AutoplayPolicy::kNoUserGestureRequired; 7900 /* ohos webview end */ 7901 } 7902@@ -421,6 +434,7 @@ void PopulateWebPreferences(content::RenderViewHost* rvh, 7903 } 7904 7905 auto* native_theme = ui::NativeTheme::GetInstanceForWeb(); 7906+#if !BUILDFLAG(IS_OHOS) 7907 switch (native_theme->GetPreferredColorScheme()) { 7908 case ui::NativeTheme::PreferredColorScheme::kDark: 7909 web.preferred_color_scheme = blink::mojom::PreferredColorScheme::kDark; 7910@@ -429,6 +443,7 @@ void PopulateWebPreferences(content::RenderViewHost* rvh, 7911 web.preferred_color_scheme = blink::mojom::PreferredColorScheme::kLight; 7912 break; 7913 } 7914+#endif 7915 7916 switch (native_theme->GetPreferredContrast()) { 7917 case ui::NativeTheme::PreferredContrast::kNoPreference: 7918diff --git a/src/cef/libcef/browser/request_context_impl.cc b/src/cef/libcef/browser/request_context_impl.cc 7919index bb4de98dbaca4..77543ac833990 7920--- a/src/cef/libcef/browser/request_context_impl.cc 7921+++ b/src/cef/libcef/browser/request_context_impl.cc 7922@@ -579,12 +579,14 @@ CefRefPtr<CefExtension> CefRequestContextImpl::GetExtension( 7923 return browser_context()->GetExtension(extension_id); 7924 } 7925 7926+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 7927 CefRefPtr<CefMediaRouter> CefRequestContextImpl::GetMediaRouter( 7928 CefRefPtr<CefCompletionCallback> callback) { 7929 CefRefPtr<CefMediaRouterImpl> media_router = new CefMediaRouterImpl(); 7930 InitializeMediaRouterInternal(media_router, callback); 7931 return media_router.get(); 7932 } 7933+#endif 7934 7935 void CefRequestContextImpl::OnRenderFrameCreated( 7936 const content::GlobalRenderFrameHostId& global_id, 7937@@ -805,6 +807,7 @@ void CefRequestContextImpl::InitializeWebStorageInternal( 7938 web_storage, callback)); 7939 } 7940 7941+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 7942 void CefRequestContextImpl::InitializeMediaRouterInternal( 7943 CefRefPtr<CefMediaRouterImpl> media_router, 7944 CefRefPtr<CefCompletionCallback> callback) { 7945@@ -818,6 +821,7 @@ void CefRequestContextImpl::InitializeMediaRouterInternal( 7946 }, 7947 media_router, callback)); 7948 } 7949+#endif 7950 7951 CefBrowserContext* CefRequestContextImpl::browser_context() const { 7952 return browser_context_; 7953diff --git a/src/cef/libcef/browser/request_context_impl.h b/src/cef/libcef/browser/request_context_impl.h 7954index e495dd1f3a619..6b145ef17e4df 7955--- a/src/cef/libcef/browser/request_context_impl.h 7956+++ b/src/cef/libcef/browser/request_context_impl.h 7957@@ -8,12 +8,15 @@ 7958 7959 #include "include/cef_request_context.h" 7960 #include "libcef/browser/browser_context.h" 7961-#include "libcef/browser/media_router/media_router_impl.h" 7962 #include "libcef/browser/net_database/cef_data_base_impl.h" 7963 #include "libcef/browser/net_service/cookie_manager_impl.h" 7964 #include "libcef/browser/storage/web_storage_impl.h" 7965 #include "libcef/browser/thread_util.h" 7966 7967+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 7968+#include "libcef/browser/media_router/media_router_impl.h" 7969+#endif 7970+ 7971 namespace content { 7972 struct GlobalRenderFrameHostId; 7973 } 7974@@ -100,8 +103,10 @@ class CefRequestContextImpl : public CefRequestContext { 7975 bool HasExtension(const CefString& extension_id) override; 7976 bool GetExtensions(std::vector<CefString>& extension_ids) override; 7977 CefRefPtr<CefExtension> GetExtension(const CefString& extension_id) override; 7978+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 7979 CefRefPtr<CefMediaRouter> GetMediaRouter( 7980 CefRefPtr<CefCompletionCallback> callback) override; 7981+#endif 7982 7983 const CefRequestContextSettings& settings() const { return config_.settings; } 7984 7985@@ -174,8 +179,10 @@ class CefRequestContextImpl : public CefRequestContext { 7986 CefRefPtr<CefCompletionCallback> callback); 7987 void InitializeWebStorageInternal(CefRefPtr<CefWebStorageImpl> web_storage, 7988 CefRefPtr<CefCompletionCallback> callback); 7989+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 7990 void InitializeMediaRouterInternal(CefRefPtr<CefMediaRouterImpl> media_router, 7991 CefRefPtr<CefCompletionCallback> callback); 7992+#endif 7993 7994 CefBrowserContext* browser_context() const; 7995 7996diff --git a/src/cef/libcef/browser/storage/web_storage_impl.cc b/src/cef/libcef/browser/storage/web_storage_impl.cc 7997index 7d246b423648e..1bc79467760e9 7998--- a/src/cef/libcef/browser/storage/web_storage_impl.cc 7999+++ b/src/cef/libcef/browser/storage/web_storage_impl.cc 8000@@ -71,6 +71,7 @@ void GetStorageKeysTask::OnStorageKeysObtained( 8001 blink::mojom::StorageType type, 8002 const std::set<blink::StorageKey>& storage_keys) { 8003 DCHECK(CEF_CURRENTLY_ON_IOT()); 8004+ LOG(INFO) << "OnStorageKeysObtained storage_keys size: " << storage_keys.size(); 8005 num_callbacks_to_wait_ = storage_keys.size(); 8006 num_callbacks_received_ = 0u; 8007 for (const blink::StorageKey& storage_key : storage_keys) { 8008diff --git a/src/cef/libcef/browser/views/browser_view_impl.cc b/src/cef/libcef/browser/views/browser_view_impl.cc 8009index 139dff2ad6053..045e9d17fb75e 8010--- a/src/cef/libcef/browser/views/browser_view_impl.cc 8011+++ b/src/cef/libcef/browser/views/browser_view_impl.cc 8012@@ -6,7 +6,6 @@ 8013 8014 #include "libcef/browser/browser_host_base.h" 8015 #include "libcef/browser/browser_util.h" 8016-#include "libcef/browser/chrome/views/chrome_browser_view.h" 8017 #include "libcef/browser/context.h" 8018 #include "libcef/browser/request_context_impl.h" 8019 #include "libcef/browser/thread_util.h" 8020@@ -15,6 +14,10 @@ 8021 #include "content/public/browser/native_web_keyboard_event.h" 8022 #include "ui/content_accelerators/accelerator_util.h" 8023 8024+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8025+#include "libcef/browser/chrome/views/chrome_browser_view.h" 8026+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8027+ 8028 // static 8029 CefRefPtr<CefBrowserView> CefBrowserView::CreateBrowserView( 8030 CefRefPtr<CefClient> client, 8031@@ -138,9 +141,11 @@ CefRefPtr<CefBrowser> CefBrowserViewImpl::GetBrowser() { 8032 8033 CefRefPtr<CefView> CefBrowserViewImpl::GetChromeToolbar() { 8034 CEF_REQUIRE_VALID_RETURN(nullptr); 8035+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8036 if (cef::IsChromeRuntimeEnabled()) { 8037 return static_cast<ChromeBrowserView*>(root_view())->cef_toolbar(); 8038 } 8039+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8040 8041 return nullptr; 8042 } 8043@@ -232,25 +237,33 @@ void CefBrowserViewImpl::SetDefaults(const CefBrowserSettings& settings) { 8044 } 8045 8046 views::View* CefBrowserViewImpl::CreateRootView() { 8047+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8048 if (cef::IsChromeRuntimeEnabled()) { 8049 return new ChromeBrowserView(delegate(), this); 8050 } 8051+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8052 8053 return new CefBrowserViewView(delegate(), this); 8054 } 8055 8056 void CefBrowserViewImpl::InitializeRootView() { 8057+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8058 if (cef::IsChromeRuntimeEnabled()) { 8059 static_cast<ChromeBrowserView*>(root_view())->Initialize(); 8060 } else { 8061 static_cast<CefBrowserViewView*>(root_view())->Initialize(); 8062 } 8063+#else 8064+ static_cast<CefBrowserViewView*>(root_view())->Initialize(); 8065+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8066 } 8067 8068 views::WebView* CefBrowserViewImpl::web_view() const { 8069+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8070 if (cef::IsChromeRuntimeEnabled()) { 8071 return static_cast<ChromeBrowserView*>(root_view())->contents_web_view(); 8072 } 8073+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8074 8075 return static_cast<CefBrowserViewView*>(root_view()); 8076 } 8077diff --git a/src/cef/libcef/browser/views/window_view.cc b/src/cef/libcef/browser/views/window_view.cc 8078index f1784a5a8735f..ab43771ebc8e3 8079--- a/src/cef/libcef/browser/views/window_view.cc 8080+++ b/src/cef/libcef/browser/views/window_view.cc 8081@@ -4,7 +4,6 @@ 8082 8083 #include "libcef/browser/views/window_view.h" 8084 8085-#include "libcef/browser/chrome/views/chrome_browser_frame.h" 8086 #include "libcef/browser/image_impl.h" 8087 #include "libcef/browser/views/window_impl.h" 8088 #include "libcef/features/runtime.h" 8089@@ -29,6 +28,10 @@ 8090 #include "ui/aura/window.h" 8091 #endif 8092 8093+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8094+#include "libcef/browser/chrome/views/chrome_browser_frame.h" 8095+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8096+ 8097 namespace { 8098 8099 // Specialize ClientView to handle Widget-related events. 8100@@ -259,8 +262,12 @@ void CefWindowView::CreateWidget() { 8101 8102 // |widget| is owned by the NativeWidget and will be destroyed in response to 8103 // a native destruction message. 8104+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8105 views::Widget* widget = cef::IsChromeRuntimeEnabled() ? new ChromeBrowserFrame 8106 : new views::Widget; 8107+#else 8108+ views::Widget* widget = new views::Widget; 8109+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 8110 8111 views::Widget::InitParams params; 8112 params.delegate = this; 8113diff --git a/src/cef/libcef/common/alloy/alloy_content_client.cc b/src/cef/libcef/common/alloy/alloy_content_client.cc 8114index fe1f5fa84f268..a6f52055f18db 8115--- a/src/cef/libcef/common/alloy/alloy_content_client.cc 8116+++ b/src/cef/libcef/common/alloy/alloy_content_client.cc 8117@@ -32,7 +32,6 @@ 8118 #include "content/public/common/cdm_info.h" 8119 #include "content/public/common/content_constants.h" 8120 #include "content/public/common/content_switches.h" 8121-#include "content/public/common/pepper_plugin_info.h" 8122 #include "ppapi/shared_impl/ppapi_permissions.h" 8123 #include "third_party/widevine/cdm/buildflags.h" 8124 #include "ui/base/l10n/l10n_util.h" 8125@@ -42,8 +41,13 @@ 8126 #include "chrome/common/media/cdm_host_file_path.h" 8127 #endif 8128 8129+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8130+#include "content/public/common/pepper_plugin_info.h" 8131+#endif 8132+ 8133 namespace { 8134 8135+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8136 // The following plugin-related methods are from 8137 // chrome/common/chrome_content_client.cc 8138 8139@@ -80,16 +84,19 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { 8140 plugins->push_back(pdf_info); 8141 } 8142 } 8143+#endif 8144 8145 } // namespace 8146 8147 AlloyContentClient::AlloyContentClient() = default; 8148 AlloyContentClient::~AlloyContentClient() = default; 8149 8150+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8151 void AlloyContentClient::AddPepperPlugins( 8152 std::vector<content::PepperPluginInfo>* plugins) { 8153 ComputeBuiltInPlugins(plugins); 8154 } 8155+#endif 8156 8157 void AlloyContentClient::AddContentDecryptionModules( 8158 std::vector<content::CdmInfo>* cdms, 8159@@ -158,6 +165,7 @@ gfx::Image& AlloyContentClient::GetNativeImageNamed(int resource_id) { 8160 return value; 8161 } 8162 8163+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8164 // static 8165 void AlloyContentClient::SetPDFEntryFunctions( 8166 content::PepperPluginInfo::GetInterfaceFunc get_interface, 8167@@ -167,3 +175,4 @@ void AlloyContentClient::SetPDFEntryFunctions( 8168 g_pdf_initialize_module = initialize_module; 8169 g_pdf_shutdown_module = shutdown_module; 8170 } 8171+#endif 8172diff --git a/src/cef/libcef/common/alloy/alloy_content_client.h b/src/cef/libcef/common/alloy/alloy_content_client.h 8173index 160bfe855c2b0..03200dbe45b6c 8174--- a/src/cef/libcef/common/alloy/alloy_content_client.h 8175+++ b/src/cef/libcef/common/alloy/alloy_content_client.h 8176@@ -9,7 +9,13 @@ 8177 8178 #include "base/compiler_specific.h" 8179 #include "content/public/common/content_client.h" 8180+ 8181+#if BUILDFLAG(IS_OHOS) 8182+#include "ppapi/buildflags/buildflags.h" 8183+#if BUILDFLAG(ENABLE_PLUGINS) 8184 #include "content/public/common/pepper_plugin_info.h" 8185+#endif 8186+#endif 8187 8188 class AlloyContentClient : public content::ContentClient { 8189 public: 8190@@ -17,8 +23,10 @@ class AlloyContentClient : public content::ContentClient { 8191 ~AlloyContentClient() override; 8192 8193 // content::ContentClient overrides. 8194+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8195 void AddPepperPlugins( 8196 std::vector<content::PepperPluginInfo>* plugins) override; 8197+#endif 8198 void AddContentDecryptionModules( 8199 std::vector<content::CdmInfo>* cdms, 8200 std::vector<media::CdmHostFilePath>* cdm_host_file_paths) override; 8201@@ -32,10 +40,12 @@ class AlloyContentClient : public content::ContentClient { 8202 base::RefCountedMemory* GetDataResourceBytes(int resource_id) override; 8203 gfx::Image& GetNativeImageNamed(int resource_id) override; 8204 8205+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8206 static void SetPDFEntryFunctions( 8207 content::PepperPluginInfo::GetInterfaceFunc get_interface, 8208 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, 8209 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module); 8210+#endif 8211 }; 8212 8213 #endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_CONTENT_CLIENT_H_ 8214diff --git a/src/cef/libcef/common/alloy/alloy_main_delegate.cc b/src/cef/libcef/common/alloy/alloy_main_delegate.cc 8215index 5022baa38ce1b..6aad28f238ab4 8216--- a/src/cef/libcef/common/alloy/alloy_main_delegate.cc 8217+++ b/src/cef/libcef/common/alloy/alloy_main_delegate.cc 8218@@ -25,7 +25,6 @@ 8219 #include "base/strings/string_util.h" 8220 #include "base/synchronization/waitable_event.h" 8221 #include "chrome/browser/browser_process.h" 8222-#include "chrome/child/pdf_child_init.h" 8223 #include "chrome/common/chrome_constants.h" 8224 #include "chrome/common/chrome_paths.h" 8225 #include "chrome/common/chrome_switches.h" 8226@@ -41,7 +40,6 @@ 8227 #include "content/public/common/url_constants.h" 8228 #include "extensions/common/constants.h" 8229 #include "net/base/features.h" 8230-#include "pdf/pdf_ppapi.h" 8231 #include "sandbox/policy/switches.h" 8232 #include "services/network/public/cpp/features.h" 8233 #include "third_party/blink/public/common/switches.h" 8234@@ -58,6 +56,14 @@ 8235 #include "ui/base/resource/resource_bundle_win.h" 8236 #endif 8237 8238+#if BUILDFLAG(IS_OHOS) 8239+#include "pdf/buildflags.h" 8240+#if BUILDFLAG(ENABLE_PDF) 8241+#include "chrome/child/pdf_child_init.h" 8242+#include "pdf/pdf_ppapi.h" 8243+#endif 8244+#endif 8245+ 8246 namespace { 8247 8248 const char* const kNonWildcardDomainNonPortSchemes[] = { 8249@@ -379,13 +385,17 @@ void AlloyMainDelegate::PreSandboxStartup() { 8250 chrome::DIR_USER_DATA); 8251 8252 InitializeResourceBundle(); 8253+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 8254 MaybePatchGdiGetFontData(); 8255+#endif 8256 } 8257 8258 void AlloyMainDelegate::SandboxInitialized(const std::string& process_type) { 8259+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8260 AlloyContentClient::SetPDFEntryFunctions(chrome_pdf::PPP_GetInterface, 8261 chrome_pdf::PPP_InitializeModule, 8262 chrome_pdf::PPP_ShutdownModule); 8263+#endif 8264 } 8265 8266 absl::variant<int, content::MainFunctionParams> AlloyMainDelegate::RunProcess( 8267diff --git a/src/cef/libcef/common/app_manager.cc b/src/cef/libcef/common/app_manager.cc 8268index 4c1e3c00e48c4..28fd16511ed29 8269--- a/src/cef/libcef/common/app_manager.cc 8270+++ b/src/cef/libcef/common/app_manager.cc 8271@@ -74,6 +74,20 @@ const CefAppManager::SchemeInfoList* CefAppManager::GetCustomSchemes() { 8272 return &scheme_info_list_; 8273 } 8274 8275+std::vector<std::string> CefAppManager::CustomSchemeCmdLineSplit(std::string str, const char split) 8276+{ 8277+ std::istringstream inStream(str); 8278+ std::vector<std::string> ret; 8279+ std::string token; 8280+ while (getline(inStream, token, split)) { 8281+ if (!token.empty()) { 8282+ ret.push_back(token); 8283+ token.clear(); 8284+ } 8285+ } 8286+ return ret; 8287+} 8288+ 8289 void CefAppManager::AddAdditionalSchemes( 8290 content::ContentClient::Schemes* schemes) { 8291 DCHECK(!scheme_info_list_locked_); 8292@@ -85,6 +99,34 @@ void CefAppManager::AddAdditionalSchemes( 8293 schemeRegistrar.GetSchemes(schemes); 8294 } 8295 8296+ CefRefPtr<CefCommandLine> cmdLine = CefCommandLine::GetGlobalCommandLine(); 8297+ if (cmdLine->HasSwitch(switches::kProcessType)) { 8298+ LOG(INFO) << "render Add custom schemes"; 8299+ if (cmdLine->HasSwitch(switches::kOhosCustomScheme)) { 8300+ std::string cmdlineSchemes = cmdLine->GetSwitchValue(switches::kOhosCustomScheme).ToString(); 8301+ LOG(INFO) << "render cmdlineScheme:" << cmdlineSchemes; 8302+ std::vector<std::string> schemesInfo = CustomSchemeCmdLineSplit(cmdlineSchemes, ';'); 8303+ for (auto it = schemesInfo.begin(); it != schemesInfo.end(); ++it) { 8304+ std::string schemeSplit = *it; 8305+ std::vector<std::string> scheme = CustomSchemeCmdLineSplit(schemeSplit, ','); 8306+ if (scheme.size() != 3) { 8307+ break; 8308+ } 8309+ CefSchemeInfo regScheme = {"", false, false, false, false, false, false, false}; 8310+ regScheme.scheme_name = scheme[0]; 8311+ if (scheme[1] == std::string("1")) { 8312+ regScheme.is_cors_enabled = true; 8313+ } 8314+ if (scheme[2] == std::string("1")) { 8315+ regScheme.is_fetch_enabled = true; 8316+ } 8317+ LOG(INFO) << "render add custom scheme name:" << regScheme.scheme_name 8318+ << " is_cors:"<< regScheme.is_cors_enabled << " is_fetch:" << regScheme.is_fetch_enabled; 8319+ AddCustomScheme(®Scheme); 8320+ } 8321+ } 8322+ } 8323+ 8324 scheme::AddInternalSchemes(schemes); 8325 8326 scheme_info_list_locked_ = true; 8327diff --git a/src/cef/libcef/common/app_manager.h b/src/cef/libcef/common/app_manager.h 8328index f50e1cb924eef..b1b9c7b31c4ab 8329--- a/src/cef/libcef/common/app_manager.h 8330+++ b/src/cef/libcef/common/app_manager.h 8331@@ -64,6 +64,7 @@ class CefAppManager { 8332 virtual ~CefAppManager(); 8333 8334 private: 8335+ std::vector<std::string> CustomSchemeCmdLineSplit(std::string str, const char split); 8336 // Custom schemes handled by the client. 8337 SchemeInfoList scheme_info_list_; 8338 bool scheme_info_list_locked_ = false; 8339diff --git a/src/cef/libcef/common/mojom/cef.mojom b/src/cef/libcef/common/mojom/cef.mojom 8340index 333764e86ade8..5fc111634eee8 8341--- a/src/cef/libcef/common/mojom/cef.mojom 8342+++ b/src/cef/libcef/common/mojom/cef.mojom 8343@@ -12,6 +12,7 @@ import "services/network/public/mojom/url_request.mojom"; 8344 import "third_party/blink/public/mojom/loader/referrer.mojom"; 8345 import "ui/gfx/geometry/mojom/geometry.mojom"; 8346 import "url/mojom/url.mojom"; 8347+import "mojo/public/mojom/base/time.mojom"; 8348 8349 [EnableIf=is_ohos] 8350 import "skia/public/mojom/bitmap.mojom"; 8351@@ -115,11 +116,33 @@ interface RenderFrame { 8352 [EnableIf=is_ohos] 8353 SetInitialScale(float initialScale); 8354 8355+ // Adjusts the javascript 'online' property value. 8356+ [EnableIf=is_ohos] 8357+ SetJsOnlineProperty(bool network_up); 8358+ 8359 [EnableIf=is_ohos] 8360 PutZoomingForTextFactor(float factor); 8361 8362 [EnableIf=is_ohos] 8363 GetImageForContextNode(); 8364+ 8365+ [EnableIf=is_ohos] 8366+ GetImagesWithResponse() => (bool response); 8367+ 8368+ [EnableIf=is_ohos] 8369+ RemoveCache(); 8370+ 8371+ [EnableIf=is_ohos] 8372+ ScrollPageUpDown(bool is_up, bool move_half, float view_height); 8373+ 8374+ [EnableIf=is_ohos] 8375+ ScrollTo(float x, float y); 8376+ 8377+ [EnableIf=is_ohos] 8378+ ScrollBy(float delta_x, float delta_y); 8379+ 8380+ [EnableIf=is_ohos] 8381+ SlideScroll(float vx, float vy); 8382 }; 8383 8384 // Interface for communicating with a frame in the browser process. 8385diff --git a/src/cef/libcef/common/soc_perf_util.cc b/src/cef/libcef/common/soc_perf_util.cc 8386index 1864b77cad2b1..6d7ca453ab84e 8387--- a/src/cef/libcef/common/soc_perf_util.cc 8388+++ b/src/cef/libcef/common/soc_perf_util.cc 8389@@ -20,22 +20,48 @@ base::Time SocPerUtil::last_time_boost_timestamp; 8390 8391 namespace { 8392 const int SOC_PERF_CONFIG_ID = 10020; 8393+const int SOC_PERF_SLIDE_NORMAL_CONFIG_ID = 10025; 8394+const int SOC_PERF_WEB_GUSTURE_ID = 10012; 8395 const int MIN_LAYER_NUM = 50; 8396 const int MIN_VIDEO_LAYOUT_NUM = 1; 8397 const int MAX_BOOST_RUN_TIME_IN_SECOND = 10; 8398 const int REST_TIME_IN_SECOND = 2; 8399 } // namespace 8400 8401-void SocPerUtil::ApplySocConfig() { 8402- TRACE_EVENT2("soc_perf", "SocPerUtil::ApplySocConfig", "layout_num", 8403+void SocPerUtil::EnableFlingBoost() { 8404+ TRACE_EVENT2("soc_perf", "SocPerUtil::EnableFlingBoost2", "layout_num", 8405 video_layout_num, "layer_num", layer_num); 8406+ OHOS::NWeb::OhosAdapterHelper::GetInstance() 8407+ .CreateSocPerfClientAdapter() 8408+ ->ApplySocPerfConfigByIdEx(SOC_PERF_WEB_GUSTURE_ID, false); 8409+ 8410+ OHOS::NWeb::OhosAdapterHelper::GetInstance() 8411+ .CreateSocPerfClientAdapter() 8412+ ->ApplySocPerfConfigByIdEx(SOC_PERF_SLIDE_NORMAL_CONFIG_ID, true); 8413+ 8414 if (video_layout_num >= MIN_VIDEO_LAYOUT_NUM || layer_num >= MIN_LAYER_NUM) { 8415 OHOS::NWeb::OhosAdapterHelper::GetInstance() 8416 .CreateSocPerfClientAdapter() 8417- ->ApplySocPerfConfigById(SOC_PERF_CONFIG_ID); 8418+ ->ApplySocPerfConfigByIdEx(SOC_PERF_CONFIG_ID, true); 8419 } 8420 } 8421 8422+void SocPerUtil::DisableFlingBoost() { 8423+ TRACE_EVENT0("soc_perf", "SocPerUtil::DisableFlingBoost"); 8424+ 8425+ OHOS::NWeb::OhosAdapterHelper::GetInstance() 8426+ .CreateSocPerfClientAdapter() 8427+ ->ApplySocPerfConfigByIdEx(SOC_PERF_SLIDE_NORMAL_CONFIG_ID, false); 8428+ 8429+ OHOS::NWeb::OhosAdapterHelper::GetInstance() 8430+ .CreateSocPerfClientAdapter() 8431+ ->ApplySocPerfConfigByIdEx(SOC_PERF_CONFIG_ID, false); 8432+ 8433+ OHOS::NWeb::OhosAdapterHelper::GetInstance() 8434+ .CreateSocPerfClientAdapter() 8435+ ->ApplySocPerfConfigByIdEx(SOC_PERF_WEB_GUSTURE_ID, false); 8436+} 8437+ 8438 void SocPerUtil::TryRunSocPerf() { 8439 if ((base::Time().Now() - first_time_boost_timestamp).InSeconds() >= 8440 MAX_BOOST_RUN_TIME_IN_SECOND) { 8441diff --git a/src/cef/libcef/common/soc_perf_util.h b/src/cef/libcef/common/soc_perf_util.h 8442index 87afb17332a97..cdfc6147b68c2 8443--- a/src/cef/libcef/common/soc_perf_util.h 8444+++ b/src/cef/libcef/common/soc_perf_util.h 8445@@ -14,7 +14,8 @@ extern int layer_num; 8446 8447 class SocPerUtil { 8448 public: 8449- static void ApplySocConfig(); 8450+ static void EnableFlingBoost(); 8451+ static void DisableFlingBoost(); 8452 static void StartBoost(); 8453 8454 private: 8455diff --git a/src/cef/libcef/renderer/alloy/alloy_content_renderer_client.cc b/src/cef/libcef/renderer/alloy/alloy_content_renderer_client.cc 8456index c43d739441ea6..c388996b30e4a 8457--- a/src/cef/libcef/renderer/alloy/alloy_content_renderer_client.cc 8458+++ b/src/cef/libcef/renderer/alloy/alloy_content_renderer_client.cc 8459@@ -33,7 +33,6 @@ 8460 #include "libcef/renderer/alloy/url_loader_throttle_provider_impl.h" 8461 #include "libcef/renderer/browser_impl.h" 8462 #include "libcef/renderer/extensions/extensions_renderer_client.h" 8463-#include "libcef/renderer/extensions/print_render_frame_helper_delegate.h" 8464 #include "libcef/renderer/render_frame_observer.h" 8465 #include "libcef/renderer/render_manager.h" 8466 #include "libcef/renderer/thread_util.h" 8467@@ -53,14 +52,9 @@ 8468 #include "chrome/renderer/chrome_content_renderer_client.h" 8469 #include "chrome/renderer/extensions/chrome_extensions_renderer_client.h" 8470 #include "chrome/renderer/loadtimes_extension_bindings.h" 8471-#include "chrome/renderer/pepper/chrome_pdf_print_client.h" 8472-#include "chrome/renderer/pepper/pepper_helper.h" 8473 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h" 8474 #include "components/content_settings/core/common/content_settings_types.h" 8475 #include "components/nacl/common/nacl_constants.h" 8476-#include "components/pdf/common/internal_plugin_helpers.h" 8477-#include "components/pdf/renderer/internal_plugin_renderer_helpers.h" 8478-#include "components/pdf/renderer/pdf_find_in_page.h" 8479 #include "components/printing/renderer/print_render_frame_helper.h" 8480 #include "components/spellcheck/renderer/spellcheck.h" 8481 #include "components/spellcheck/renderer/spellcheck_provider.h" 8482@@ -109,6 +103,21 @@ 8483 #include "base/strings/sys_string_conversions.h" 8484 #endif 8485 8486+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 8487+#include "libcef/renderer/extensions/print_render_frame_helper_delegate.h" 8488+#endif 8489+ 8490+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8491+#include "chrome/renderer/pepper/pepper_helper.h" 8492+#endif 8493+ 8494+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 8495+#include "chrome/renderer/pepper/chrome_pdf_print_client.h" 8496+#include "components/pdf/common/internal_plugin_helpers.h" 8497+#include "components/pdf/renderer/internal_plugin_renderer_helpers.h" 8498+#include "components/pdf/renderer/pdf_find_in_page.h" 8499+#endif 8500+ 8501 AlloyContentRendererClient::AlloyContentRendererClient() 8502 : main_entry_time_(base::TimeTicks::Now()), 8503 render_manager_(new CefRenderManager) { 8504@@ -232,10 +241,12 @@ void AlloyContentRendererClient::RenderThreadStarted() { 8505 } 8506 #endif // BUILDFLAG(IS_MAC) 8507 8508+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 8509 if (extensions::PdfExtensionEnabled()) { 8510 pdf_print_client_.reset(new ChromePDFPrintClient()); 8511 pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get()); 8512 } 8513+#endif 8514 8515 if (extensions::ExtensionsEnabled()) 8516 extensions_renderer_client_->RenderThreadStarted(); 8517@@ -276,7 +287,9 @@ void AlloyContentRendererClient::RenderFrameCreated( 8518 content::RenderFrame* render_frame) { 8519 auto render_frame_observer = new CefRenderFrameObserver(render_frame); 8520 8521+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8522 new PepperHelper(render_frame); 8523+#endif 8524 8525 if (extensions::ExtensionsEnabled()) { 8526 extensions_renderer_client_->RenderFrameCreated( 8527@@ -302,18 +315,22 @@ void AlloyContentRendererClient::RenderFrameCreated( 8528 OnBrowserCreated(render_frame->GetRenderView(), is_windowless); 8529 } 8530 8531+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PRINT_PREVIEW) 8532 if (is_windowless.has_value()) { 8533 new printing::PrintRenderFrameHelper( 8534 render_frame, 8535 base::WrapUnique( 8536 new extensions::CefPrintRenderFrameHelperDelegate(*is_windowless))); 8537 } 8538+#endif 8539 8540+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 8541 if (base::FeatureList::IsEnabled(chrome_pdf::features::kPdfUnseasoned)) { 8542 render_frame_observer->associated_interfaces()->AddInterface( 8543 base::BindRepeating(&pdf::PdfFindInPageFactory::BindReceiver, 8544 render_frame->GetRoutingID())); 8545 } 8546+#endif 8547 } 8548 8549 void AlloyContentRendererClient::WebViewCreated(blink::WebView* web_view) { 8550@@ -332,6 +349,7 @@ bool AlloyContentRendererClient::IsPluginHandledExternally( 8551 const blink::WebElement& plugin_element, 8552 const GURL& original_url, 8553 const std::string& mime_type) { 8554+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8555 if (!extensions::ExtensionsEnabled()) 8556 return false; 8557 8558@@ -373,12 +391,16 @@ bool AlloyContentRendererClient::IsPluginHandledExternally( 8559 return ChromeExtensionsRendererClient::MaybeCreateMimeHandlerView( 8560 plugin_element, original_url, plugin_info->actual_mime_type, 8561 plugin_info->plugin); 8562+#else 8563+ return false; 8564+#endif 8565 } 8566 8567 bool AlloyContentRendererClient::OverrideCreatePlugin( 8568 content::RenderFrame* render_frame, 8569 const blink::WebPluginParams& params, 8570 blink::WebPlugin** plugin) { 8571+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 8572 std::string orig_mime_type = params.mime_type.Utf8(); 8573 if (extensions::ExtensionsEnabled() && 8574 !extensions_renderer_client_->OverrideCreatePlugin(render_frame, 8575@@ -394,6 +416,7 @@ bool AlloyContentRendererClient::OverrideCreatePlugin( 8576 &plugin_info); 8577 *plugin = ChromeContentRendererClient::CreatePlugin(render_frame, params, 8578 *plugin_info); 8579+#endif 8580 return true; 8581 } 8582 8583diff --git a/src/cef/libcef/renderer/alloy/alloy_content_renderer_client.h b/src/cef/libcef/renderer/alloy/alloy_content_renderer_client.h 8584index 150978262a3ba..59680bb4b815c 8585--- a/src/cef/libcef/renderer/alloy/alloy_content_renderer_client.h 8586+++ b/src/cef/libcef/renderer/alloy/alloy_content_renderer_client.h 8587@@ -25,6 +25,10 @@ 8588 #include "mojo/public/cpp/bindings/generic_pending_receiver.h" 8589 #include "services/service_manager/public/cpp/local_interface_provider.h" 8590 8591+#if BUILDFLAG(IS_OHOS) 8592+#include "pdf/buildflags.h" 8593+#endif 8594+ 8595 namespace extensions { 8596 class CefExtensionsRendererClient; 8597 class Dispatcher; 8598@@ -152,7 +156,9 @@ class AlloyContentRendererClient 8599 std::unique_ptr<SpellCheck> spellcheck_; 8600 std::unique_ptr<visitedlink::VisitedLinkReader> visited_link_slave_; 8601 8602+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PDF) 8603 std::unique_ptr<ChromePDFPrintClient> pdf_print_client_; 8604+#endif 8605 8606 std::unique_ptr<extensions::ExtensionsClient> extensions_client_; 8607 std::unique_ptr<extensions::CefExtensionsRendererClient> 8608diff --git a/src/cef/libcef/renderer/frame_impl.cc b/src/cef/libcef/renderer/frame_impl.cc 8609index 04f9a9bca0d64..e74978a2fa7a4 8610--- a/src/cef/libcef/renderer/frame_impl.cc 8611+++ b/src/cef/libcef/renderer/frame_impl.cc 8612@@ -36,7 +36,9 @@ 8613 #include "content/renderer/render_frame_impl.h" 8614 #include "third_party/blink/public/mojom/frame/frame.mojom-blink.h" 8615 #include "third_party/blink/public/platform/web_back_forward_cache_loader_helper.h" 8616+#include "third_party/blink/public/platform/web_cache.h" 8617 #include "third_party/blink/public/platform/web_data.h" 8618+#include "third_party/blink/public/platform/web_network_state_notifier.h" 8619 #include "third_party/blink/public/platform/web_string.h" 8620 #include "third_party/blink/public/platform/web_url.h" 8621 #include "third_party/blink/public/web/blink.h" 8622@@ -69,6 +71,17 @@ const std::string kAddressPrefix = "geo:0,0?q="; 8623 const std::string kEmailPrefix = "mailto:"; 8624 const std::string kPhoneNumberPrefix = "tel:"; 8625 8626+// The amount of content to overlap between two screens when using 8627+// pageUp/pageDown methiods. static int PAGE_SCROLL_OVERLAP = 24; Standard 8628+// animated scroll speed. 8629+static int STD_SCROLL_ANIMATION_SPEED_PIX_PER_SEC = 480; 8630+// Time for the longest scroll animation. 8631+static int MAX_SCROLL_ANIMATION_DURATION_MILLISEC = 750; 8632+ 8633+static int DEFAULT_SCROLL_ANIMATION_DURATION_MILLISEC = 600; 8634+ 8635+static double POSITION_RATIO = 138.9; 8636+ 8637 enum HitTestDataType { 8638 kUnknown = 0, 8639 kPhone = 2, 8640@@ -79,6 +92,17 @@ enum HitTestDataType { 8641 kSrcImageLink = 8, 8642 kEditText = 9, 8643 }; 8644+ 8645+int computeDurationInMilliSec(int dx, int dy) { 8646+ int distance = std::max(std::abs(dx), std::abs(dy)); 8647+ int duration = distance * 1000 / STD_SCROLL_ANIMATION_SPEED_PIX_PER_SEC; 8648+ return std::min(duration, MAX_SCROLL_ANIMATION_DURATION_MILLISEC); 8649+} 8650+ 8651+float computeSlidePosition(float v) { 8652+ return (v * POSITION_RATIO / 1000); 8653+} 8654+ 8655 #endif // BUILDFLAG(IS_OHOS) 8656 8657 } // namespace 8658@@ -128,6 +152,10 @@ void CefFrameImpl::ViewSource() { 8659 NOTREACHED() << "ViewSource cannot be called from the renderer process"; 8660 } 8661 8662+void CefFrameImpl::GetImages(CefRefPtr<CefGetImagesCallback> callback) { 8663+ NOTREACHED() << "GetImages cannot be called from the renderer process"; 8664+} 8665+ 8666 void CefFrameImpl::GetSource(CefRefPtr<CefStringVisitor> visitor) { 8667 CEF_REQUIRE_RT_RETURN_VOID(); 8668 if (frame_) { 8669@@ -778,6 +806,10 @@ void CefFrameImpl::SendTouchEvent(cef::mojom::TouchEventParamsPtr params) { 8670 std::move(data))); 8671 } 8672 8673+void CefFrameImpl::RemoveCache() { 8674+ blink::WebCache::Clear(); 8675+} 8676+ 8677 void CefFrameImpl::SetInitialScale(float initialScale) { 8678 auto render_frame = content::RenderFrame::FromWebFrame(frame_); 8679 DCHECK(render_frame->IsMainFrame()); 8680@@ -788,44 +820,48 @@ void CefFrameImpl::SetInitialScale(float initialScale) { 8681 } 8682 webview->SetInitialPageScaleOverride(initialScale); 8683 } 8684- 8685+ 8686+void CefFrameImpl::SetJsOnlineProperty(bool network_up) { 8687+ LOG(INFO) << "SetJsOnlineProperty:" << network_up; 8688+ blink::WebNetworkStateNotifier::SetOnLine(network_up); 8689+} 8690+ 8691 void CefFrameImpl::PutZoomingForTextFactor(float factor) { 8692 auto render_frame = content::RenderFrame::FromWebFrame(frame_); 8693 DCHECK(render_frame->IsMainFrame()); 8694 blink::WebView* webview = render_frame->GetRenderView()->GetWebView(); 8695- 8696+ 8697 if (!webview) 8698 return; 8699 // Hide selection and autofill popups. 8700 webview->CancelPagePopup(); 8701- 8702+ 8703 render_frame->GetWebFrame()->FrameWidget()->SetTextZoomFactor(factor); 8704 } 8705- 8706+ 8707 void CefFrameImpl::GetImageForContextNode() { 8708 if (!frame_) { 8709 LOG(ERROR) << "GetImageForContextNode frame is nullptr"; 8710 return; 8711 } 8712 cef::mojom::GetImageForContextNodeParamsPtr params = 8713- cef::mojom::GetImageForContextNodeParams::New(); 8714+ cef::mojom::GetImageForContextNodeParams::New(); 8715 blink::WebNode context_node = frame_->ContextMenuImageNode(); 8716 std::vector<uint8_t> image_data; 8717 gfx::Size original_size; 8718 std::string image_extension; 8719 8720 if (context_node.IsNull() || !context_node.IsElementNode()) { 8721- SendToBrowserFrame( 8722- __FUNCTION__, 8723- base::BindOnce( 8724- [](cef::mojom::GetImageForContextNodeParamsPtr data, 8725- const BrowserFrameType& browser_frame) { 8726- browser_frame->OnGetImageForContextNodeNull(); 8727- }, 8728- std::move(params))); 8729+ SendToBrowserFrame(__FUNCTION__, 8730+ base::BindOnce( 8731+ [](cef::mojom::GetImageForContextNodeParamsPtr data, 8732+ const BrowserFrameType& browser_frame) { 8733+ browser_frame->OnGetImageForContextNodeNull(); 8734+ }, 8735+ std::move(params))); 8736 return; 8737 } 8738- 8739+ 8740 blink::WebElement web_element = context_node.To<blink::WebElement>(); 8741 original_size = web_element.GetImageSize(); 8742 8743@@ -948,12 +984,96 @@ void CefFrameImpl::UpdateLocale(const std::string& locale) { 8744 return; 8745 } 8746 std::string result = 8747- ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources( 8748- locale); 8749+ ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources(locale); 8750 if (result.empty()) { 8751 LOG(ERROR) << "CefFrameImpl update locale failed"; 8752 } 8753 } 8754+ 8755+void CefFrameImpl::GetImagesWithResponse( 8756+ cef::mojom::RenderFrame::GetImagesWithResponseCallback callback) { 8757+ ExecuteOnLocalFrame( 8758+ __FUNCTION__, 8759+ base::BindOnce( 8760+ [](cef::mojom::RenderFrame::GetImagesWithResponseCallback callback, 8761+ blink::WebLocalFrame* frame) { 8762+ blink::WebElementCollection collection = 8763+ frame->GetDocument().GetElementsByHTMLTagName("img"); 8764+ DCHECK(!collection.IsNull()); 8765+ bool response = !(collection.FirstItem()).IsNull(); 8766+ std::move(callback).Run(response); 8767+ }, 8768+ std::move(callback))); 8769+} 8770+ 8771+void CefFrameImpl::ScrollPageUpDown(bool is_up, 8772+ bool is_half, 8773+ float view_height) { 8774+ auto render_frame = content::RenderFrame::FromWebFrame(frame_); 8775+ DCHECK(render_frame->IsMainFrame()); 8776+ blink::WebView* webview = render_frame->GetRenderView()->GetWebView(); 8777+ if (!webview) { 8778+ LOG(ERROR) << "scorll page up down get webview failed"; 8779+ return; 8780+ } 8781+ auto scroll_offset = webview->GetScrollOffset(); 8782+ float dy; 8783+ if (is_up) { 8784+ dy = is_half ? -view_height : -scroll_offset.y(); 8785+ } else { 8786+ if (!is_half) { 8787+ float bottom_y = webview->GetScrollBottom(); 8788+ if (bottom_y <= 0) { 8789+ LOG(ERROR) << "get scroll bottom offset failed."; 8790+ return; 8791+ } 8792+ dy = bottom_y - scroll_offset.y(); 8793+ } else { 8794+ dy = view_height; 8795+ } 8796+ } 8797+ webview->SmoothScroll(scroll_offset.x(), scroll_offset.y() + dy, 8798+ base::Milliseconds(computeDurationInMilliSec(0, dy))); 8799+} 8800+ 8801+void CefFrameImpl::ScrollTo(float x, float y) { 8802+ auto render_frame = content::RenderFrame::FromWebFrame(frame_); 8803+ DCHECK(render_frame->IsMainFrame()); 8804+ blink::WebView* webview = render_frame->GetRenderView()->GetWebView(); 8805+ if (!webview) { 8806+ LOG(ERROR) << "scrollto get webview failed"; 8807+ return; 8808+ } 8809+ webview->SetScrollOffset(gfx::PointF(x, y)); 8810+} 8811+ 8812+void CefFrameImpl::ScrollBy(float delta_x, float delta_y) { 8813+ auto render_frame = content::RenderFrame::FromWebFrame(frame_); 8814+ DCHECK(render_frame->IsMainFrame()); 8815+ blink::WebView* webview = render_frame->GetRenderView()->GetWebView(); 8816+ if (!webview) { 8817+ LOG(ERROR) << "scrollby get webview failed"; 8818+ return; 8819+ } 8820+ auto scroll_offset = webview->GetScrollOffset(); 8821+ webview->SetScrollOffset(gfx::PointF(delta_x + scroll_offset.x(), 8822+ delta_y + scroll_offset.y())); 8823+} 8824+ 8825+void CefFrameImpl::SlideScroll(float vx, float vy) { 8826+ auto render_frame = content::RenderFrame::FromWebFrame(frame_); 8827+ DCHECK(render_frame->IsMainFrame()); 8828+ blink::WebView* webview = render_frame->GetRenderView()->GetWebView(); 8829+ if (!webview) { 8830+ LOG(ERROR) << "scrollby get webview failed"; 8831+ return; 8832+ } 8833+ float dx = vx == 0 ? 0 : computeSlidePosition(vx); 8834+ float dy = vy == 0 ? 0 : computeSlidePosition(vy); 8835+ auto scroll_offset = webview->GetScrollOffset(); 8836+ webview->SmoothScroll(dx + scroll_offset.x(), dy + scroll_offset.y(), 8837+ base::Milliseconds(DEFAULT_SCROLL_ANIMATION_DURATION_MILLISEC)); 8838+} 8839 #endif // BUILDFLAG(IS_OHOS) 8840 8841 // Enable deprecation warnings on Windows. See http://crbug.com/585142. 8842diff --git a/src/cef/libcef/renderer/frame_impl.h b/src/cef/libcef/renderer/frame_impl.h 8843index 0f974f6a3d523..d5d4f727493f4 8844--- a/src/cef/libcef/renderer/frame_impl.h 8845+++ b/src/cef/libcef/renderer/frame_impl.h 8846@@ -83,6 +83,7 @@ class CefFrameImpl : public CefFrame, public cef::mojom::RenderFrame { 8847 CefRefPtr<CefURLRequestClient> client) override; 8848 void SendProcessMessage(CefProcessId target_process, 8849 CefRefPtr<CefProcessMessage> message) override; 8850+ void GetImages(CefRefPtr<CefGetImagesCallback> callback) override; 8851 8852 // Used by CefRenderURLRequest. 8853 std::unique_ptr<blink::WebURLLoader> CreateURLLoader(); 8854@@ -151,10 +152,17 @@ class CefFrameImpl : public CefFrame, public cef::mojom::RenderFrame { 8855 #if BUILDFLAG(IS_OHOS) 8856 void SendTouchEvent(cef::mojom::TouchEventParamsPtr params) override; 8857 void SetInitialScale(float initialScale) override; 8858+ void SetJsOnlineProperty(bool network_up) override; 8859 void PutZoomingForTextFactor(float factor) override; 8860 void GetImageForContextNode() override; 8861 void UpdateLocale(const std::string& locale) override; 8862- 8863+ void GetImagesWithResponse( 8864+ cef::mojom::RenderFrame::GetImagesWithResponseCallback callback) override; 8865+ void RemoveCache() override; 8866+ void ScrollPageUpDown(bool is_up, bool is_half, float view_height) override; 8867+ void ScrollTo(float x, float y) override; 8868+ void ScrollBy(float delta_x, float delta_y) override; 8869+ void SlideScroll(float vx, float vy) override; 8870 GURL GetAbsoluteUrl(const blink::WebNode& node, 8871 const std::u16string& url_fragment); 8872 GURL GetAbsoluteSrcUrl(const blink::WebElement& element); 8873diff --git a/src/cef/libcef_dll/cpptoc/access_request_cpptoc.cc b/src/cef/libcef_dll/cpptoc/access_request_cpptoc.cc 8874index d97849ec3b453..f01822fdc08ec 8875--- a/src/cef/libcef_dll/cpptoc/access_request_cpptoc.cc 8876+++ b/src/cef/libcef_dll/cpptoc/access_request_cpptoc.cc 8877@@ -1,4 +1,4 @@ 8878-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 8879+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 8880 // reserved. Use of this source code is governed by a BSD-style license that 8881 // can be found in the LICENSE file. 8882 // 8883@@ -9,7 +9,7 @@ 8884 // implementations. See the translator.README.txt file in the tools directory 8885 // for more information. 8886 // 8887-// $hash=6b186aa2b1640034df797d439745503309071680$ 8888+// $hash=43f719c6388e6fb2ee41d8502b7f47983313cfc9$ 8889 // 8890 8891 #include "libcef_dll/cpptoc/access_request_cpptoc.h" 8892diff --git a/src/cef/libcef_dll/cpptoc/access_request_cpptoc.h b/src/cef/libcef_dll/cpptoc/access_request_cpptoc.h 8893index c5262807d7ce3..8ce9c60ae05ed 8894--- a/src/cef/libcef_dll/cpptoc/access_request_cpptoc.h 8895+++ b/src/cef/libcef_dll/cpptoc/access_request_cpptoc.h 8896@@ -1,4 +1,4 @@ 8897-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 8898+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 8899 // reserved. Use of this source code is governed by a BSD-style license that 8900 // can be found in the LICENSE file. 8901 // 8902@@ -9,7 +9,7 @@ 8903 // implementations. See the translator.README.txt file in the tools directory 8904 // for more information. 8905 // 8906-// $hash=7f780d77c50f8f64713a51f886c76adc70e44357$ 8907+// $hash=44c32953a5dc70e64d35222732817d6b065f0e33$ 8908 // 8909 8910 #ifndef CEF_LIBCEF_DLL_CPPTOC_ACCESS_REQUEST_CPPTOC_H_ 8911diff --git a/src/cef/libcef_dll/cpptoc/accessibility_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/accessibility_handler_cpptoc.cc 8912index 992a81d60965e..daa3ab86b14ba 8913--- a/src/cef/libcef_dll/cpptoc/accessibility_handler_cpptoc.cc 8914+++ b/src/cef/libcef_dll/cpptoc/accessibility_handler_cpptoc.cc 8915@@ -1,4 +1,4 @@ 8916-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 8917+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 8918 // reserved. Use of this source code is governed by a BSD-style license that 8919 // can be found in the LICENSE file. 8920 // 8921@@ -9,7 +9,7 @@ 8922 // implementations. See the translator.README.txt file in the tools directory 8923 // for more information. 8924 // 8925-// $hash=f20a2530c9b5ad72cccd301ee4234a16132c487d$ 8926+// $hash=63799a16d1ff311eb185eb57bae7d682d150d376$ 8927 // 8928 8929 #include "libcef_dll/cpptoc/accessibility_handler_cpptoc.h" 8930diff --git a/src/cef/libcef_dll/cpptoc/accessibility_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/accessibility_handler_cpptoc.h 8931index b6dce7abc847c..faf271035e848 8932--- a/src/cef/libcef_dll/cpptoc/accessibility_handler_cpptoc.h 8933+++ b/src/cef/libcef_dll/cpptoc/accessibility_handler_cpptoc.h 8934@@ -1,4 +1,4 @@ 8935-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 8936+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 8937 // reserved. Use of this source code is governed by a BSD-style license that 8938 // can be found in the LICENSE file. 8939 // 8940@@ -9,7 +9,7 @@ 8941 // implementations. See the translator.README.txt file in the tools directory 8942 // for more information. 8943 // 8944-// $hash=0605de17534cba62d36fc1160997660c4a38e40b$ 8945+// $hash=0d1469b1473cbef38092a2b0624ac33faa6e1d89$ 8946 // 8947 8948 #ifndef CEF_LIBCEF_DLL_CPPTOC_ACCESSIBILITY_HANDLER_CPPTOC_H_ 8949diff --git a/src/cef/libcef_dll/cpptoc/app_cpptoc.cc b/src/cef/libcef_dll/cpptoc/app_cpptoc.cc 8950index bc6f55efe8a81..58572b24012c9 8951--- a/src/cef/libcef_dll/cpptoc/app_cpptoc.cc 8952+++ b/src/cef/libcef_dll/cpptoc/app_cpptoc.cc 8953@@ -1,4 +1,4 @@ 8954-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 8955+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 8956 // reserved. Use of this source code is governed by a BSD-style license that 8957 // can be found in the LICENSE file. 8958 // 8959@@ -9,7 +9,7 @@ 8960 // implementations. See the translator.README.txt file in the tools directory 8961 // for more information. 8962 // 8963-// $hash=ee267b6567062246b9f82b4b50b68d82d2cc939f$ 8964+// $hash=04b98a2d9c374132d2149fd8e3cf8b110acba86f$ 8965 // 8966 8967 #include "libcef_dll/cpptoc/app_cpptoc.h" 8968diff --git a/src/cef/libcef_dll/cpptoc/app_cpptoc.h b/src/cef/libcef_dll/cpptoc/app_cpptoc.h 8969index c705f806df64a..fe94e85891294 8970--- a/src/cef/libcef_dll/cpptoc/app_cpptoc.h 8971+++ b/src/cef/libcef_dll/cpptoc/app_cpptoc.h 8972@@ -1,4 +1,4 @@ 8973-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 8974+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 8975 // reserved. Use of this source code is governed by a BSD-style license that 8976 // can be found in the LICENSE file. 8977 // 8978@@ -9,7 +9,7 @@ 8979 // implementations. See the translator.README.txt file in the tools directory 8980 // for more information. 8981 // 8982-// $hash=601455da6a16a7212debdb8184b8f731be4e2f8d$ 8983+// $hash=a4d3edb584e87581659ded4e0bb20739b2b0efea$ 8984 // 8985 8986 #ifndef CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ 8987diff --git a/src/cef/libcef_dll/cpptoc/audio_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/audio_handler_cpptoc.cc 8988index 0317067179b0d..36aec0d286c7d 8989--- a/src/cef/libcef_dll/cpptoc/audio_handler_cpptoc.cc 8990+++ b/src/cef/libcef_dll/cpptoc/audio_handler_cpptoc.cc 8991@@ -1,4 +1,4 @@ 8992-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 8993+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 8994 // reserved. Use of this source code is governed by a BSD-style license that 8995 // can be found in the LICENSE file. 8996 // 8997@@ -9,7 +9,7 @@ 8998 // implementations. See the translator.README.txt file in the tools directory 8999 // for more information. 9000 // 9001-// $hash=519a82bbea84ea39cadc72c55291e15cb2a74072$ 9002+// $hash=56d4812b8f81cbda67550a8b03e8b7af911e5e28$ 9003 // 9004 9005 #include "libcef_dll/cpptoc/audio_handler_cpptoc.h" 9006diff --git a/src/cef/libcef_dll/cpptoc/audio_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/audio_handler_cpptoc.h 9007index d2574a797abb7..1d574545486ef 9008--- a/src/cef/libcef_dll/cpptoc/audio_handler_cpptoc.h 9009+++ b/src/cef/libcef_dll/cpptoc/audio_handler_cpptoc.h 9010@@ -1,4 +1,4 @@ 9011-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9012+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9013 // reserved. Use of this source code is governed by a BSD-style license that 9014 // can be found in the LICENSE file. 9015 // 9016@@ -9,7 +9,7 @@ 9017 // implementations. See the translator.README.txt file in the tools directory 9018 // for more information. 9019 // 9020-// $hash=352ed71e6c70ef8e5f38e635ed8fc17b2fcc2b4e$ 9021+// $hash=6d31cfb9774514e0a15c999903fa4eb9ce76634d$ 9022 // 9023 9024 #ifndef CEF_LIBCEF_DLL_CPPTOC_AUDIO_HANDLER_CPPTOC_H_ 9025diff --git a/src/cef/libcef_dll/cpptoc/auth_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/auth_callback_cpptoc.cc 9026index 146cf8370d04b..caedf03194a5c 9027--- a/src/cef/libcef_dll/cpptoc/auth_callback_cpptoc.cc 9028+++ b/src/cef/libcef_dll/cpptoc/auth_callback_cpptoc.cc 9029@@ -1,4 +1,4 @@ 9030-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9031+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9032 // reserved. Use of this source code is governed by a BSD-style license that 9033 // can be found in the LICENSE file. 9034 // 9035@@ -9,7 +9,7 @@ 9036 // implementations. See the translator.README.txt file in the tools directory 9037 // for more information. 9038 // 9039-// $hash=1c155d75ccb34c91336d15446c10b7e476f23c44$ 9040+// $hash=b71adaa7f64de4164420e0f28f1c1064813c2beb$ 9041 // 9042 9043 #include "libcef_dll/cpptoc/auth_callback_cpptoc.h" 9044diff --git a/src/cef/libcef_dll/cpptoc/auth_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/auth_callback_cpptoc.h 9045index b9aae72ade919..6a1dd700efad2 9046--- a/src/cef/libcef_dll/cpptoc/auth_callback_cpptoc.h 9047+++ b/src/cef/libcef_dll/cpptoc/auth_callback_cpptoc.h 9048@@ -1,4 +1,4 @@ 9049-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9050+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9051 // reserved. Use of this source code is governed by a BSD-style license that 9052 // can be found in the LICENSE file. 9053 // 9054@@ -9,7 +9,7 @@ 9055 // implementations. See the translator.README.txt file in the tools directory 9056 // for more information. 9057 // 9058-// $hash=036ebbbaaa86b497dda11ef6371e5bc6c9171b04$ 9059+// $hash=be94cb2e319c4a42e8bc9ee41b78935834e8a59c$ 9060 // 9061 9062 #ifndef CEF_LIBCEF_DLL_CPPTOC_AUTH_CALLBACK_CPPTOC_H_ 9063diff --git a/src/cef/libcef_dll/cpptoc/before_download_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/before_download_callback_cpptoc.cc 9064index 6187dfa3f368c..97825a59f8046 9065--- a/src/cef/libcef_dll/cpptoc/before_download_callback_cpptoc.cc 9066+++ b/src/cef/libcef_dll/cpptoc/before_download_callback_cpptoc.cc 9067@@ -1,4 +1,4 @@ 9068-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9069+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9070 // reserved. Use of this source code is governed by a BSD-style license that 9071 // can be found in the LICENSE file. 9072 // 9073@@ -9,7 +9,7 @@ 9074 // implementations. See the translator.README.txt file in the tools directory 9075 // for more information. 9076 // 9077-// $hash=0f0475ffcd9ea6ca7f91616c52c21b3e51b075f3$ 9078+// $hash=5b940bd6e4a7e6a9cabd42b87ae9ff89eb1a0c5d$ 9079 // 9080 9081 #include "libcef_dll/cpptoc/before_download_callback_cpptoc.h" 9082diff --git a/src/cef/libcef_dll/cpptoc/before_download_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/before_download_callback_cpptoc.h 9083index fc31cf841792f..9f2944cd96091 9084--- a/src/cef/libcef_dll/cpptoc/before_download_callback_cpptoc.h 9085+++ b/src/cef/libcef_dll/cpptoc/before_download_callback_cpptoc.h 9086@@ -1,4 +1,4 @@ 9087-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9088+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9089 // reserved. Use of this source code is governed by a BSD-style license that 9090 // can be found in the LICENSE file. 9091 // 9092@@ -9,7 +9,7 @@ 9093 // implementations. See the translator.README.txt file in the tools directory 9094 // for more information. 9095 // 9096-// $hash=53a024e4e503f7e107c19ed638684c5708efd6e6$ 9097+// $hash=76dfadaa2d0f5ef6cdb8621cad3136e89b33ae25$ 9098 // 9099 9100 #ifndef CEF_LIBCEF_DLL_CPPTOC_BEFORE_DOWNLOAD_CALLBACK_CPPTOC_H_ 9101diff --git a/src/cef/libcef_dll/cpptoc/binary_value_cpptoc.cc b/src/cef/libcef_dll/cpptoc/binary_value_cpptoc.cc 9102index 51659b1677737..9ad3bd943056c 9103--- a/src/cef/libcef_dll/cpptoc/binary_value_cpptoc.cc 9104+++ b/src/cef/libcef_dll/cpptoc/binary_value_cpptoc.cc 9105@@ -1,4 +1,4 @@ 9106-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9107+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9108 // reserved. Use of this source code is governed by a BSD-style license that 9109 // can be found in the LICENSE file. 9110 // 9111@@ -9,7 +9,7 @@ 9112 // implementations. See the translator.README.txt file in the tools directory 9113 // for more information. 9114 // 9115-// $hash=fd59a248f99060800fc3bab5c381784eb3309a57$ 9116+// $hash=b1f1f6a65560c0607e7eb3c4a57dbc40cab0b811$ 9117 // 9118 9119 #include "libcef_dll/cpptoc/binary_value_cpptoc.h" 9120diff --git a/src/cef/libcef_dll/cpptoc/binary_value_cpptoc.h b/src/cef/libcef_dll/cpptoc/binary_value_cpptoc.h 9121index 994621aa25378..3f6a9e362ddc9 9122--- a/src/cef/libcef_dll/cpptoc/binary_value_cpptoc.h 9123+++ b/src/cef/libcef_dll/cpptoc/binary_value_cpptoc.h 9124@@ -1,4 +1,4 @@ 9125-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9126+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9127 // reserved. Use of this source code is governed by a BSD-style license that 9128 // can be found in the LICENSE file. 9129 // 9130@@ -9,7 +9,7 @@ 9131 // implementations. See the translator.README.txt file in the tools directory 9132 // for more information. 9133 // 9134-// $hash=83361bb9395a566ef5bfcd9d87eade8df222d075$ 9135+// $hash=bdc631b2bd2c0a68146e823e0ff23e1b3a455023$ 9136 // 9137 9138 #ifndef CEF_LIBCEF_DLL_CPPTOC_BINARY_VALUE_CPPTOC_H_ 9139diff --git a/src/cef/libcef_dll/cpptoc/browser_cpptoc.cc b/src/cef/libcef_dll/cpptoc/browser_cpptoc.cc 9140index 1cdfa28447136..d713abd8f25ec 9141--- a/src/cef/libcef_dll/cpptoc/browser_cpptoc.cc 9142+++ b/src/cef/libcef_dll/cpptoc/browser_cpptoc.cc 9143@@ -1,4 +1,4 @@ 9144-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9145+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9146 // reserved. Use of this source code is governed by a BSD-style license that 9147 // can be found in the LICENSE file. 9148 // 9149@@ -9,7 +9,7 @@ 9150 // implementations. See the translator.README.txt file in the tools directory 9151 // for more information. 9152 // 9153-// $hash=c1509a4a06a744e423e92c8d75b17128fd0601e1$ 9154+// $hash=de6d56ff06c32a54e999d9309218c6a546eaa146$ 9155 // 9156 9157 #include "libcef_dll/cpptoc/browser_cpptoc.h" 9158diff --git a/src/cef/libcef_dll/cpptoc/browser_cpptoc.h b/src/cef/libcef_dll/cpptoc/browser_cpptoc.h 9159index 08c927b4983fc..1a10254e25c87 9160--- a/src/cef/libcef_dll/cpptoc/browser_cpptoc.h 9161+++ b/src/cef/libcef_dll/cpptoc/browser_cpptoc.h 9162@@ -1,4 +1,4 @@ 9163-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9164+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9165 // reserved. Use of this source code is governed by a BSD-style license that 9166 // can be found in the LICENSE file. 9167 // 9168@@ -9,7 +9,7 @@ 9169 // implementations. See the translator.README.txt file in the tools directory 9170 // for more information. 9171 // 9172-// $hash=68e6a8ff4e47ec0c3c767d80746091550b9d11dc$ 9173+// $hash=01e044c521a174528e137e4b131d9df95875eb65$ 9174 // 9175 9176 #ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_CPPTOC_H_ 9177diff --git a/src/cef/libcef_dll/cpptoc/browser_host_cpptoc.cc b/src/cef/libcef_dll/cpptoc/browser_host_cpptoc.cc 9178index ddefc7bf8f16e..b7b75e6dd316f 9179--- a/src/cef/libcef_dll/cpptoc/browser_host_cpptoc.cc 9180+++ b/src/cef/libcef_dll/cpptoc/browser_host_cpptoc.cc 9181@@ -1,4 +1,4 @@ 9182-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9183+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9184 // reserved. Use of this source code is governed by a BSD-style license that 9185 // can be found in the LICENSE file. 9186 // 9187@@ -9,10 +9,11 @@ 9188 // implementations. See the translator.README.txt file in the tools directory 9189 // for more information. 9190 // 9191-// $hash=a582cbd1f35b0d3be99085bdd2092200a7d19c98$ 9192+// $hash=fbbfbf396665393a59e2487e84880bafe3568174$ 9193 // 9194 9195 #include "libcef_dll/cpptoc/browser_host_cpptoc.h" 9196+#include "libcef_dll/cpptoc/binary_value_cpptoc.h" 9197 #include "libcef_dll/cpptoc/browser_cpptoc.h" 9198 #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" 9199 #include "libcef_dll/cpptoc/drag_data_cpptoc.h" 9200@@ -20,6 +21,7 @@ 9201 #include "libcef_dll/cpptoc/navigation_entry_cpptoc.h" 9202 #include "libcef_dll/cpptoc/registration_cpptoc.h" 9203 #include "libcef_dll/cpptoc/request_context_cpptoc.h" 9204+#include "libcef_dll/cpptoc/value_cpptoc.h" 9205 #include "libcef_dll/ctocpp/client_ctocpp.h" 9206 #include "libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.h" 9207 #include "libcef_dll/ctocpp/download_image_callback_ctocpp.h" 9208@@ -29,6 +31,7 @@ 9209 #include "libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h" 9210 #include "libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.h" 9211 #include "libcef_dll/ctocpp/task_ctocpp.h" 9212+#include "libcef_dll/ctocpp/web_message_receiver_ctocpp.h" 9213 #include "libcef_dll/shutdown_checker.h" 9214 #include "libcef_dll/transfer_util.h" 9215 9216@@ -1251,7 +1254,7 @@ browser_host_destroy_all_web_message_ports(struct _cef_browser_host_t* self) { 9217 void CEF_CALLBACK 9218 browser_host_post_port_message(struct _cef_browser_host_t* self, 9219 cef_string_t* port_handle, 9220- cef_string_t* data) { 9221+ struct _cef_value_t* message) { 9222 shutdown_checker::AssertNotShutdown(); 9223 9224 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9225@@ -1263,24 +1266,23 @@ browser_host_post_port_message(struct _cef_browser_host_t* self, 9226 DCHECK(port_handle); 9227 if (!port_handle) 9228 return; 9229- // Verify param: data; type: string_byref 9230- DCHECK(data); 9231- if (!data) 9232+ // Verify param: message; type: refptr_same 9233+ DCHECK(message); 9234+ if (!message) 9235 return; 9236 9237 // Translate param: port_handle; type: string_byref 9238 CefString port_handleStr(port_handle); 9239- // Translate param: data; type: string_byref 9240- CefString dataStr(data); 9241 9242 // Execute 9243- CefBrowserHostCppToC::Get(self)->PostPortMessage(port_handleStr, dataStr); 9244+ CefBrowserHostCppToC::Get(self)->PostPortMessage( 9245+ port_handleStr, CefValueCppToC::Unwrap(message)); 9246 } 9247 9248 void CEF_CALLBACK browser_host_set_port_message_callback( 9249 struct _cef_browser_host_t* self, 9250 cef_string_t* port_handle, 9251- struct _cef_java_script_result_callback_t* callback) { 9252+ struct _cef_web_message_receiver_t* callback) { 9253 shutdown_checker::AssertNotShutdown(); 9254 9255 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9256@@ -1302,7 +1304,7 @@ void CEF_CALLBACK browser_host_set_port_message_callback( 9257 9258 // Execute 9259 CefBrowserHostCppToC::Get(self)->SetPortMessageCallback( 9260- port_handleStr, CefJavaScriptResultCallbackCToCpp::Wrap(callback)); 9261+ port_handleStr, CefWebMessageReceiverCToCpp::Wrap(callback)); 9262 } 9263 9264 void CEF_CALLBACK browser_host_get_hit_data(struct _cef_browser_host_t* self, 9265@@ -1937,6 +1939,200 @@ void CEF_CALLBACK browser_host_update_locale(struct _cef_browser_host_t* self, 9266 CefBrowserHostCppToC::Get(self)->UpdateLocale(CefString(locale)); 9267 } 9268 9269+cef_string_userfree_t CEF_CALLBACK 9270+browser_host_get_original_url(struct _cef_browser_host_t* self) { 9271+ shutdown_checker::AssertNotShutdown(); 9272+ 9273+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9274+ 9275+ DCHECK(self); 9276+ if (!self) 9277+ return NULL; 9278+ 9279+ // Execute 9280+ CefString _retval = CefBrowserHostCppToC::Get(self)->GetOriginalUrl(); 9281+ 9282+ // Return type: string 9283+ return _retval.DetachToUserFree(); 9284+} 9285+ 9286+void CEF_CALLBACK 9287+browser_host_put_network_available(struct _cef_browser_host_t* self, 9288+ int available) { 9289+ shutdown_checker::AssertNotShutdown(); 9290+ 9291+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9292+ 9293+ DCHECK(self); 9294+ if (!self) 9295+ return; 9296+ 9297+ // Execute 9298+ CefBrowserHostCppToC::Get(self)->PutNetworkAvailable(available ? true 9299+ : false); 9300+} 9301+ 9302+void CEF_CALLBACK browser_host_remove_cache(struct _cef_browser_host_t* self, 9303+ int include_disk_files) { 9304+ shutdown_checker::AssertNotShutdown(); 9305+ 9306+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9307+ 9308+ DCHECK(self); 9309+ if (!self) 9310+ return; 9311+ 9312+ // Execute 9313+ CefBrowserHostCppToC::Get(self)->RemoveCache(include_disk_files ? true 9314+ : false); 9315+} 9316+ 9317+void CEF_CALLBACK 9318+browser_host_scroll_page_up_down(struct _cef_browser_host_t* self, 9319+ int is_up, 9320+ int is_half, 9321+ float view_height) { 9322+ shutdown_checker::AssertNotShutdown(); 9323+ 9324+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9325+ 9326+ DCHECK(self); 9327+ if (!self) 9328+ return; 9329+ 9330+ // Execute 9331+ CefBrowserHostCppToC::Get(self)->ScrollPageUpDown( 9332+ is_up ? true : false, is_half ? true : false, view_height); 9333+} 9334+ 9335+struct _cef_binary_value_t* CEF_CALLBACK 9336+browser_host_get_web_state(struct _cef_browser_host_t* self) { 9337+ shutdown_checker::AssertNotShutdown(); 9338+ 9339+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9340+ 9341+ DCHECK(self); 9342+ if (!self) 9343+ return NULL; 9344+ 9345+ // Execute 9346+ CefRefPtr<CefBinaryValue> _retval = 9347+ CefBrowserHostCppToC::Get(self)->GetWebState(); 9348+ 9349+ // Return type: refptr_same 9350+ return CefBinaryValueCppToC::Wrap(_retval); 9351+} 9352+ 9353+int CEF_CALLBACK 9354+browser_host_restore_web_state(struct _cef_browser_host_t* self, 9355+ struct _cef_binary_value_t* state) { 9356+ shutdown_checker::AssertNotShutdown(); 9357+ 9358+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9359+ 9360+ DCHECK(self); 9361+ if (!self) 9362+ return 0; 9363+ // Verify param: state; type: refptr_same 9364+ DCHECK(state); 9365+ if (!state) 9366+ return 0; 9367+ 9368+ // Execute 9369+ bool _retval = CefBrowserHostCppToC::Get(self)->RestoreWebState( 9370+ CefBinaryValueCppToC::Unwrap(state)); 9371+ 9372+ // Return type: bool 9373+ return _retval; 9374+} 9375+ 9376+void CEF_CALLBACK browser_host_scroll_to(struct _cef_browser_host_t* self, 9377+ float x, 9378+ float y) { 9379+ shutdown_checker::AssertNotShutdown(); 9380+ 9381+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9382+ 9383+ DCHECK(self); 9384+ if (!self) 9385+ return; 9386+ 9387+ // Execute 9388+ CefBrowserHostCppToC::Get(self)->ScrollTo(x, y); 9389+} 9390+ 9391+void CEF_CALLBACK browser_host_scroll_by(struct _cef_browser_host_t* self, 9392+ float delta_x, 9393+ float delta_y) { 9394+ shutdown_checker::AssertNotShutdown(); 9395+ 9396+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9397+ 9398+ DCHECK(self); 9399+ if (!self) 9400+ return; 9401+ 9402+ // Execute 9403+ CefBrowserHostCppToC::Get(self)->ScrollBy(delta_x, delta_y); 9404+} 9405+ 9406+void CEF_CALLBACK browser_host_slide_scroll(struct _cef_browser_host_t* self, 9407+ float vx, 9408+ float vy) { 9409+ shutdown_checker::AssertNotShutdown(); 9410+ 9411+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9412+ 9413+ DCHECK(self); 9414+ if (!self) 9415+ return; 9416+ 9417+ // Execute 9418+ CefBrowserHostCppToC::Get(self)->SlideScroll(vx, vy); 9419+} 9420+ 9421+void CEF_CALLBACK browser_host_set_file_access(struct _cef_browser_host_t* self, 9422+ int falg) { 9423+ shutdown_checker::AssertNotShutdown(); 9424+ 9425+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9426+ 9427+ DCHECK(self); 9428+ if (!self) 9429+ return; 9430+ 9431+ // Execute 9432+ CefBrowserHostCppToC::Get(self)->SetFileAccess(falg ? true : false); 9433+} 9434+ 9435+void CEF_CALLBACK 9436+browser_host_set_block_network(struct _cef_browser_host_t* self, int falg) { 9437+ shutdown_checker::AssertNotShutdown(); 9438+ 9439+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9440+ 9441+ DCHECK(self); 9442+ if (!self) 9443+ return; 9444+ 9445+ // Execute 9446+ CefBrowserHostCppToC::Get(self)->SetBlockNetwork(falg ? true : false); 9447+} 9448+ 9449+void CEF_CALLBACK browser_host_set_cache_mode(struct _cef_browser_host_t* self, 9450+ int falg) { 9451+ shutdown_checker::AssertNotShutdown(); 9452+ 9453+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9454+ 9455+ DCHECK(self); 9456+ if (!self) 9457+ return; 9458+ 9459+ // Execute 9460+ CefBrowserHostCppToC::Get(self)->SetCacheMode(falg); 9461+} 9462+ 9463 } // namespace 9464 9465 // CONSTRUCTOR - Do not edit by hand. 9466@@ -2047,6 +2243,18 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() { 9467 GetStruct()->get_image_from_cache = browser_host_get_image_from_cache; 9468 GetStruct()->exit_full_screen = browser_host_exit_full_screen; 9469 GetStruct()->update_locale = browser_host_update_locale; 9470+ GetStruct()->get_original_url = browser_host_get_original_url; 9471+ GetStruct()->put_network_available = browser_host_put_network_available; 9472+ GetStruct()->remove_cache = browser_host_remove_cache; 9473+ GetStruct()->scroll_page_up_down = browser_host_scroll_page_up_down; 9474+ GetStruct()->get_web_state = browser_host_get_web_state; 9475+ GetStruct()->restore_web_state = browser_host_restore_web_state; 9476+ GetStruct()->scroll_to = browser_host_scroll_to; 9477+ GetStruct()->scroll_by = browser_host_scroll_by; 9478+ GetStruct()->slide_scroll = browser_host_slide_scroll; 9479+ GetStruct()->set_file_access = browser_host_set_file_access; 9480+ GetStruct()->set_block_network = browser_host_set_block_network; 9481+ GetStruct()->set_cache_mode = browser_host_set_cache_mode; 9482 } 9483 9484 // DESTRUCTOR - Do not edit by hand. 9485diff --git a/src/cef/libcef_dll/cpptoc/browser_host_cpptoc.h b/src/cef/libcef_dll/cpptoc/browser_host_cpptoc.h 9486index 3a7c59332962d..2f88bb3380b13 9487--- a/src/cef/libcef_dll/cpptoc/browser_host_cpptoc.h 9488+++ b/src/cef/libcef_dll/cpptoc/browser_host_cpptoc.h 9489@@ -1,4 +1,4 @@ 9490-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9491+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9492 // reserved. Use of this source code is governed by a BSD-style license that 9493 // can be found in the LICENSE file. 9494 // 9495@@ -9,7 +9,7 @@ 9496 // implementations. See the translator.README.txt file in the tools directory 9497 // for more information. 9498 // 9499-// $hash=244bcb519cd21d6febf70c4ce40fbc1cbb18176c$ 9500+// $hash=e51f496e40bd2b3b9573d2ca084e578bb1df1407$ 9501 // 9502 9503 #ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_HOST_CPPTOC_H_ 9504diff --git a/src/cef/libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.cc 9505index 821d80ab8fd34..49e9e4134c765 9506--- a/src/cef/libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.cc 9507+++ b/src/cef/libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.cc 9508@@ -1,4 +1,4 @@ 9509-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9510+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9511 // reserved. Use of this source code is governed by a BSD-style license that 9512 // can be found in the LICENSE file. 9513 // 9514@@ -9,7 +9,7 @@ 9515 // implementations. See the translator.README.txt file in the tools directory 9516 // for more information. 9517 // 9518-// $hash=2f9f0ebd4c8a44fb9c2d2136e0791770fc72dfe0$ 9519+// $hash=4200c2184c268c8a81967053abedbff5fcbc7582$ 9520 // 9521 9522 #include "libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.h" 9523@@ -21,8 +21,9 @@ namespace { 9524 9525 void CEF_CALLBACK 9526 browser_permission_request_delegate_ask_geolocation_permission( 9527- struct _cef_browser_permission_request_delegate_t *self, 9528- const cef_string_t *origin, cef_permission_callback_t callback) { 9529+ struct _cef_browser_permission_request_delegate_t* self, 9530+ const cef_string_t* origin, 9531+ cef_permission_callback_t callback) { 9532 shutdown_checker::AssertNotShutdown(); 9533 9534 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9535@@ -42,8 +43,8 @@ browser_permission_request_delegate_ask_geolocation_permission( 9536 9537 void CEF_CALLBACK 9538 browser_permission_request_delegate_abort_ask_geolocation_permission( 9539- struct _cef_browser_permission_request_delegate_t *self, 9540- const cef_string_t *origin) { 9541+ struct _cef_browser_permission_request_delegate_t* self, 9542+ const cef_string_t* origin) { 9543 shutdown_checker::AssertNotShutdown(); 9544 9545 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9546@@ -63,8 +64,9 @@ browser_permission_request_delegate_abort_ask_geolocation_permission( 9547 9548 void CEF_CALLBACK 9549 browser_permission_request_delegate_ask_protected_media_identifier_permission( 9550- struct _cef_browser_permission_request_delegate_t *self, 9551- const cef_string_t *origin, cef_permission_callback_t callback) { 9552+ struct _cef_browser_permission_request_delegate_t* self, 9553+ const cef_string_t* origin, 9554+ cef_permission_callback_t callback) { 9555 shutdown_checker::AssertNotShutdown(); 9556 9557 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9558@@ -84,8 +86,8 @@ browser_permission_request_delegate_ask_protected_media_identifier_permission( 9559 9560 void CEF_CALLBACK 9561 browser_permission_request_delegate_abort_ask_protected_media_identifier_permission( 9562- struct _cef_browser_permission_request_delegate_t *self, 9563- const cef_string_t *origin) { 9564+ struct _cef_browser_permission_request_delegate_t* self, 9565+ const cef_string_t* origin) { 9566 shutdown_checker::AssertNotShutdown(); 9567 9568 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9569@@ -104,8 +106,9 @@ browser_permission_request_delegate_abort_ask_protected_media_identifier_permiss 9570 } 9571 9572 void CEF_CALLBACK browser_permission_request_delegate_ask_midisysex_permission( 9573- struct _cef_browser_permission_request_delegate_t *self, 9574- const cef_string_t *origin, cef_permission_callback_t callback) { 9575+ struct _cef_browser_permission_request_delegate_t* self, 9576+ const cef_string_t* origin, 9577+ cef_permission_callback_t callback) { 9578 shutdown_checker::AssertNotShutdown(); 9579 9580 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9581@@ -125,8 +128,8 @@ void CEF_CALLBACK browser_permission_request_delegate_ask_midisysex_permission( 9582 9583 void CEF_CALLBACK 9584 browser_permission_request_delegate_abort_ask_midisysex_permission( 9585- struct _cef_browser_permission_request_delegate_t *self, 9586- const cef_string_t *origin) { 9587+ struct _cef_browser_permission_request_delegate_t* self, 9588+ const cef_string_t* origin) { 9589 shutdown_checker::AssertNotShutdown(); 9590 9591 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9592@@ -146,8 +149,9 @@ browser_permission_request_delegate_abort_ask_midisysex_permission( 9593 9594 void CEF_CALLBACK 9595 browser_permission_request_delegate_notify_geolocation_permission( 9596- struct _cef_browser_permission_request_delegate_t *self, int value, 9597- const cef_string_t *origin) { 9598+ struct _cef_browser_permission_request_delegate_t* self, 9599+ int value, 9600+ const cef_string_t* origin) { 9601 shutdown_checker::AssertNotShutdown(); 9602 9603 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9604@@ -165,7 +169,7 @@ browser_permission_request_delegate_notify_geolocation_permission( 9605 ->NotifyGeolocationPermission(value ? true : false, CefString(origin)); 9606 } 9607 9608-} // namespace 9609+} // namespace 9610 9611 // CONSTRUCTOR - Do not edit by hand. 9612 9613@@ -200,7 +204,7 @@ CefCppToCRefCounted<CefBrowserPermissionRequestDelegateCppToC, 9614 CefBrowserPermissionRequestDelegate, 9615 cef_browser_permission_request_delegate_t>:: 9616 UnwrapDerived(CefWrapperType type, 9617- cef_browser_permission_request_delegate_t *s) { 9618+ cef_browser_permission_request_delegate_t* s) { 9619 NOTREACHED() << "Unexpected class type: " << type; 9620 return nullptr; 9621 } 9622diff --git a/src/cef/libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.h b/src/cef/libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.h 9623index 34e1571c8b229..e7e22ba877c49 9624--- a/src/cef/libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.h 9625+++ b/src/cef/libcef_dll/cpptoc/browser_permission_request_delegate_cpptoc.h 9626@@ -1,4 +1,4 @@ 9627-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9628+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9629 // reserved. Use of this source code is governed by a BSD-style license that 9630 // can be found in the LICENSE file. 9631 // 9632@@ -9,7 +9,7 @@ 9633 // implementations. See the translator.README.txt file in the tools directory 9634 // for more information. 9635 // 9636-// $hash=56d5e14a811fca57a762921bdef1270c44af6b4c$ 9637+// $hash=add424cc39b4f5c546f8333e3c25dc8090880a81$ 9638 // 9639 9640 #ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_PERMISSION_REQUEST_DELEGATE_CPPTOC_H_ 9641diff --git a/src/cef/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc 9642index 0a3e0b0e0a668..c8c86a5ee47ba 9643--- a/src/cef/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc 9644+++ b/src/cef/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc 9645@@ -1,4 +1,4 @@ 9646-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9647+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9648 // reserved. Use of this source code is governed by a BSD-style license that 9649 // can be found in the LICENSE file. 9650 // 9651@@ -9,7 +9,7 @@ 9652 // implementations. See the translator.README.txt file in the tools directory 9653 // for more information. 9654 // 9655-// $hash=452f119327aff2ec0aaed162adf85bbd239b9033$ 9656+// $hash=a872b0755d60861a2ccf93526ba6b05a74274e7d$ 9657 // 9658 9659 #include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h" 9660diff --git a/src/cef/libcef_dll/cpptoc/browser_process_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/browser_process_handler_cpptoc.h 9661index 5ee18f0f521f1..19b902d512c28 9662--- a/src/cef/libcef_dll/cpptoc/browser_process_handler_cpptoc.h 9663+++ b/src/cef/libcef_dll/cpptoc/browser_process_handler_cpptoc.h 9664@@ -1,4 +1,4 @@ 9665-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9666+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9667 // reserved. Use of this source code is governed by a BSD-style license that 9668 // can be found in the LICENSE file. 9669 // 9670@@ -9,7 +9,7 @@ 9671 // implementations. See the translator.README.txt file in the tools directory 9672 // for more information. 9673 // 9674-// $hash=ebbabaa3d73f0266003818a764f8ca677a9ec6b2$ 9675+// $hash=508373dbbfcb411f218ad9688d56b49380d8ca75$ 9676 // 9677 9678 #ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_ 9679diff --git a/src/cef/libcef_dll/cpptoc/callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/callback_cpptoc.cc 9680index 5deff72b31bc4..fc1a46e0b4fd7 9681--- a/src/cef/libcef_dll/cpptoc/callback_cpptoc.cc 9682+++ b/src/cef/libcef_dll/cpptoc/callback_cpptoc.cc 9683@@ -1,4 +1,4 @@ 9684-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9685+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9686 // reserved. Use of this source code is governed by a BSD-style license that 9687 // can be found in the LICENSE file. 9688 // 9689@@ -9,7 +9,7 @@ 9690 // implementations. See the translator.README.txt file in the tools directory 9691 // for more information. 9692 // 9693-// $hash=01b8f661ca054d4a48ee00f1163011688b32e9f1$ 9694+// $hash=c692df579a3b5f6d780c1e26013c91e2eb2098c8$ 9695 // 9696 9697 #include "libcef_dll/cpptoc/callback_cpptoc.h" 9698diff --git a/src/cef/libcef_dll/cpptoc/callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/callback_cpptoc.h 9699index 8850a48171bc3..611c202b5be0f 9700--- a/src/cef/libcef_dll/cpptoc/callback_cpptoc.h 9701+++ b/src/cef/libcef_dll/cpptoc/callback_cpptoc.h 9702@@ -1,4 +1,4 @@ 9703-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9704+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9705 // reserved. Use of this source code is governed by a BSD-style license that 9706 // can be found in the LICENSE file. 9707 // 9708@@ -9,7 +9,7 @@ 9709 // implementations. See the translator.README.txt file in the tools directory 9710 // for more information. 9711 // 9712-// $hash=5b2fa7fef3cde7efde7df615769b6361ea81ce46$ 9713+// $hash=f0c92901c6462ad03d3c95c0ba92129784c808e1$ 9714 // 9715 9716 #ifndef CEF_LIBCEF_DLL_CPPTOC_CALLBACK_CPPTOC_H_ 9717diff --git a/src/cef/libcef_dll/cpptoc/client_cpptoc.cc b/src/cef/libcef_dll/cpptoc/client_cpptoc.cc 9718index b2144570d57e5..84bae5411537c 9719--- a/src/cef/libcef_dll/cpptoc/client_cpptoc.cc 9720+++ b/src/cef/libcef_dll/cpptoc/client_cpptoc.cc 9721@@ -1,4 +1,4 @@ 9722-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9723+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9724 // reserved. Use of this source code is governed by a BSD-style license that 9725 // can be found in the LICENSE file. 9726 // 9727@@ -9,7 +9,7 @@ 9728 // implementations. See the translator.README.txt file in the tools directory 9729 // for more information. 9730 // 9731-// $hash=be6ffc497bb625fc087fa38352b8f173f1de3d6d$ 9732+// $hash=9d36943180a6382a12e74a92d9d9967039f14ad3$ 9733 // 9734 9735 #include "libcef_dll/cpptoc/client_cpptoc.h" 9736@@ -39,8 +39,8 @@ namespace { 9737 9738 // MEMBER FUNCTIONS - Body may be edited by hand. 9739 9740-cef_audio_handler_t *CEF_CALLBACK 9741-client_get_audio_handler(struct _cef_client_t *self) { 9742+cef_audio_handler_t* CEF_CALLBACK 9743+client_get_audio_handler(struct _cef_client_t* self) { 9744 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9745 9746 DCHECK(self); 9747@@ -55,8 +55,8 @@ client_get_audio_handler(struct _cef_client_t *self) { 9748 return CefAudioHandlerCppToC::Wrap(_retval); 9749 } 9750 9751-struct _cef_context_menu_handler_t *CEF_CALLBACK 9752-client_get_context_menu_handler(struct _cef_client_t *self) { 9753+struct _cef_context_menu_handler_t* CEF_CALLBACK 9754+client_get_context_menu_handler(struct _cef_client_t* self) { 9755 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9756 9757 DCHECK(self); 9758@@ -71,8 +71,8 @@ client_get_context_menu_handler(struct _cef_client_t *self) { 9759 return CefContextMenuHandlerCppToC::Wrap(_retval); 9760 } 9761 9762-struct _cef_dialog_handler_t *CEF_CALLBACK 9763-client_get_dialog_handler(struct _cef_client_t *self) { 9764+struct _cef_dialog_handler_t* CEF_CALLBACK 9765+client_get_dialog_handler(struct _cef_client_t* self) { 9766 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9767 9768 DCHECK(self); 9769@@ -87,8 +87,8 @@ client_get_dialog_handler(struct _cef_client_t *self) { 9770 return CefDialogHandlerCppToC::Wrap(_retval); 9771 } 9772 9773-struct _cef_display_handler_t *CEF_CALLBACK 9774-client_get_display_handler(struct _cef_client_t *self) { 9775+struct _cef_display_handler_t* CEF_CALLBACK 9776+client_get_display_handler(struct _cef_client_t* self) { 9777 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9778 9779 DCHECK(self); 9780@@ -103,8 +103,8 @@ client_get_display_handler(struct _cef_client_t *self) { 9781 return CefDisplayHandlerCppToC::Wrap(_retval); 9782 } 9783 9784-struct _cef_download_handler_t *CEF_CALLBACK 9785-client_get_download_handler(struct _cef_client_t *self) { 9786+struct _cef_download_handler_t* CEF_CALLBACK 9787+client_get_download_handler(struct _cef_client_t* self) { 9788 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9789 9790 DCHECK(self); 9791@@ -119,8 +119,8 @@ client_get_download_handler(struct _cef_client_t *self) { 9792 return CefDownloadHandlerCppToC::Wrap(_retval); 9793 } 9794 9795-struct _cef_drag_handler_t *CEF_CALLBACK 9796-client_get_drag_handler(struct _cef_client_t *self) { 9797+struct _cef_drag_handler_t* CEF_CALLBACK 9798+client_get_drag_handler(struct _cef_client_t* self) { 9799 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9800 9801 DCHECK(self); 9802@@ -135,8 +135,8 @@ client_get_drag_handler(struct _cef_client_t *self) { 9803 return CefDragHandlerCppToC::Wrap(_retval); 9804 } 9805 9806-struct _cef_find_handler_t *CEF_CALLBACK 9807-client_get_find_handler(struct _cef_client_t *self) { 9808+struct _cef_find_handler_t* CEF_CALLBACK 9809+client_get_find_handler(struct _cef_client_t* self) { 9810 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9811 9812 DCHECK(self); 9813@@ -151,8 +151,8 @@ client_get_find_handler(struct _cef_client_t *self) { 9814 return CefFindHandlerCppToC::Wrap(_retval); 9815 } 9816 9817-struct _cef_focus_handler_t *CEF_CALLBACK 9818-client_get_focus_handler(struct _cef_client_t *self) { 9819+struct _cef_focus_handler_t* CEF_CALLBACK 9820+client_get_focus_handler(struct _cef_client_t* self) { 9821 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9822 9823 DCHECK(self); 9824@@ -167,8 +167,8 @@ client_get_focus_handler(struct _cef_client_t *self) { 9825 return CefFocusHandlerCppToC::Wrap(_retval); 9826 } 9827 9828-struct _cef_frame_handler_t *CEF_CALLBACK 9829-client_get_frame_handler(struct _cef_client_t *self) { 9830+struct _cef_frame_handler_t* CEF_CALLBACK 9831+client_get_frame_handler(struct _cef_client_t* self) { 9832 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9833 9834 DCHECK(self); 9835@@ -183,8 +183,8 @@ client_get_frame_handler(struct _cef_client_t *self) { 9836 return CefFrameHandlerCppToC::Wrap(_retval); 9837 } 9838 9839-struct _cef_jsdialog_handler_t *CEF_CALLBACK 9840-client_get_jsdialog_handler(struct _cef_client_t *self) { 9841+struct _cef_jsdialog_handler_t* CEF_CALLBACK 9842+client_get_jsdialog_handler(struct _cef_client_t* self) { 9843 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9844 9845 DCHECK(self); 9846@@ -199,8 +199,8 @@ client_get_jsdialog_handler(struct _cef_client_t *self) { 9847 return CefJSDialogHandlerCppToC::Wrap(_retval); 9848 } 9849 9850-struct _cef_keyboard_handler_t *CEF_CALLBACK 9851-client_get_keyboard_handler(struct _cef_client_t *self) { 9852+struct _cef_keyboard_handler_t* CEF_CALLBACK 9853+client_get_keyboard_handler(struct _cef_client_t* self) { 9854 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9855 9856 DCHECK(self); 9857@@ -215,8 +215,8 @@ client_get_keyboard_handler(struct _cef_client_t *self) { 9858 return CefKeyboardHandlerCppToC::Wrap(_retval); 9859 } 9860 9861-struct _cef_life_span_handler_t *CEF_CALLBACK 9862-client_get_life_span_handler(struct _cef_client_t *self) { 9863+struct _cef_life_span_handler_t* CEF_CALLBACK 9864+client_get_life_span_handler(struct _cef_client_t* self) { 9865 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9866 9867 DCHECK(self); 9868@@ -231,8 +231,8 @@ client_get_life_span_handler(struct _cef_client_t *self) { 9869 return CefLifeSpanHandlerCppToC::Wrap(_retval); 9870 } 9871 9872-struct _cef_load_handler_t *CEF_CALLBACK 9873-client_get_load_handler(struct _cef_client_t *self) { 9874+struct _cef_load_handler_t* CEF_CALLBACK 9875+client_get_load_handler(struct _cef_client_t* self) { 9876 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9877 9878 DCHECK(self); 9879@@ -247,8 +247,8 @@ client_get_load_handler(struct _cef_client_t *self) { 9880 return CefLoadHandlerCppToC::Wrap(_retval); 9881 } 9882 9883-struct _cef_print_handler_t *CEF_CALLBACK 9884-client_get_print_handler(struct _cef_client_t *self) { 9885+struct _cef_print_handler_t* CEF_CALLBACK 9886+client_get_print_handler(struct _cef_client_t* self) { 9887 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9888 9889 DCHECK(self); 9890@@ -263,8 +263,8 @@ client_get_print_handler(struct _cef_client_t *self) { 9891 return CefPrintHandlerCppToC::Wrap(_retval); 9892 } 9893 9894-struct _cef_render_handler_t *CEF_CALLBACK 9895-client_get_render_handler(struct _cef_client_t *self) { 9896+struct _cef_render_handler_t* CEF_CALLBACK 9897+client_get_render_handler(struct _cef_client_t* self) { 9898 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9899 9900 DCHECK(self); 9901@@ -279,8 +279,8 @@ client_get_render_handler(struct _cef_client_t *self) { 9902 return CefRenderHandlerCppToC::Wrap(_retval); 9903 } 9904 9905-struct _cef_request_handler_t *CEF_CALLBACK 9906-client_get_request_handler(struct _cef_client_t *self) { 9907+struct _cef_request_handler_t* CEF_CALLBACK 9908+client_get_request_handler(struct _cef_client_t* self) { 9909 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9910 9911 DCHECK(self); 9912@@ -295,8 +295,8 @@ client_get_request_handler(struct _cef_client_t *self) { 9913 return CefRequestHandlerCppToC::Wrap(_retval); 9914 } 9915 9916-struct _cef_permission_request_t *CEF_CALLBACK 9917-client_get_permission_request(struct _cef_client_t *self) { 9918+struct _cef_permission_request_t* CEF_CALLBACK 9919+client_get_permission_request(struct _cef_client_t* self) { 9920 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9921 9922 DCHECK(self); 9923@@ -311,10 +311,12 @@ client_get_permission_request(struct _cef_client_t *self) { 9924 return CefPermissionRequestCppToC::Wrap(_retval); 9925 } 9926 9927-int CEF_CALLBACK client_on_process_message_received( 9928- struct _cef_client_t *self, cef_browser_t *browser, 9929- struct _cef_frame_t *frame, cef_process_id_t source_process, 9930- struct _cef_process_message_t *message) { 9931+int CEF_CALLBACK 9932+client_on_process_message_received(struct _cef_client_t* self, 9933+ cef_browser_t* browser, 9934+ struct _cef_frame_t* frame, 9935+ cef_process_id_t source_process, 9936+ struct _cef_process_message_t* message) { 9937 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9938 9939 DCHECK(self); 9940@@ -342,10 +344,12 @@ int CEF_CALLBACK client_on_process_message_received( 9941 return _retval; 9942 } 9943 9944-int CEF_CALLBACK client_notify_java_script_result( 9945- struct _cef_client_t *self, struct _cef_list_value_t *args, 9946- const cef_string_t *method, const cef_string_t *object_name, 9947- struct _cef_list_value_t *result) { 9948+int CEF_CALLBACK 9949+client_notify_java_script_result(struct _cef_client_t* self, 9950+ struct _cef_list_value_t* args, 9951+ const cef_string_t* method, 9952+ const cef_string_t* object_name, 9953+ struct _cef_list_value_t* result) { 9954 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 9955 9956 DCHECK(self); 9957@@ -377,7 +381,7 @@ int CEF_CALLBACK client_notify_java_script_result( 9958 return _retval; 9959 } 9960 9961-} // namespace 9962+} // namespace 9963 9964 // CONSTRUCTOR - Do not edit by hand. 9965 9966@@ -410,11 +414,12 @@ CefClientCppToC::~CefClientCppToC() {} 9967 template <> 9968 CefRefPtr<CefClient> 9969 CefCppToCRefCounted<CefClientCppToC, CefClient, cef_client_t>::UnwrapDerived( 9970- CefWrapperType type, cef_client_t *s) { 9971+ CefWrapperType type, 9972+ cef_client_t* s) { 9973 NOTREACHED() << "Unexpected class type: " << type; 9974 return nullptr; 9975 } 9976 9977 template <> 9978-CefWrapperType CefCppToCRefCounted<CefClientCppToC, CefClient, 9979- cef_client_t>::kWrapperType = WT_CLIENT; 9980+CefWrapperType CefCppToCRefCounted<CefClientCppToC, CefClient, cef_client_t>:: 9981+ kWrapperType = WT_CLIENT; 9982diff --git a/src/cef/libcef_dll/cpptoc/client_cpptoc.h b/src/cef/libcef_dll/cpptoc/client_cpptoc.h 9983index e33730c9b5600..3898b87ee470e 9984--- a/src/cef/libcef_dll/cpptoc/client_cpptoc.h 9985+++ b/src/cef/libcef_dll/cpptoc/client_cpptoc.h 9986@@ -1,4 +1,4 @@ 9987-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 9988+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 9989 // reserved. Use of this source code is governed by a BSD-style license that 9990 // can be found in the LICENSE file. 9991 // 9992@@ -9,7 +9,7 @@ 9993 // implementations. See the translator.README.txt file in the tools directory 9994 // for more information. 9995 // 9996-// $hash=30d4264433606a5e29f5ec2a325f630b278d4be9$ 9997+// $hash=6dd8a3977d8a7d75da7399a9c15a160afbfcf744$ 9998 // 9999 10000 #ifndef CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ 10001diff --git a/src/cef/libcef_dll/cpptoc/command_line_cpptoc.cc b/src/cef/libcef_dll/cpptoc/command_line_cpptoc.cc 10002index 97e1a5ef50fbf..5eeb22109684e 10003--- a/src/cef/libcef_dll/cpptoc/command_line_cpptoc.cc 10004+++ b/src/cef/libcef_dll/cpptoc/command_line_cpptoc.cc 10005@@ -1,4 +1,4 @@ 10006-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10007+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10008 // reserved. Use of this source code is governed by a BSD-style license that 10009 // can be found in the LICENSE file. 10010 // 10011@@ -9,7 +9,7 @@ 10012 // implementations. See the translator.README.txt file in the tools directory 10013 // for more information. 10014 // 10015-// $hash=fec108946a9d826210e4fa3746839b56a123316c$ 10016+// $hash=69cdcccdd0b005cb929d250a0ccfe287d1df37ed$ 10017 // 10018 10019 #include "libcef_dll/cpptoc/command_line_cpptoc.h" 10020diff --git a/src/cef/libcef_dll/cpptoc/command_line_cpptoc.h b/src/cef/libcef_dll/cpptoc/command_line_cpptoc.h 10021index a466cc76fd052..45eb004c92d23 10022--- a/src/cef/libcef_dll/cpptoc/command_line_cpptoc.h 10023+++ b/src/cef/libcef_dll/cpptoc/command_line_cpptoc.h 10024@@ -1,4 +1,4 @@ 10025-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10026+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10027 // reserved. Use of this source code is governed by a BSD-style license that 10028 // can be found in the LICENSE file. 10029 // 10030@@ -9,7 +9,7 @@ 10031 // implementations. See the translator.README.txt file in the tools directory 10032 // for more information. 10033 // 10034-// $hash=395fccd246892782a1c4a26a87baa43f75436bd8$ 10035+// $hash=f8af58d9e62d25a46593ccebc487734730f6a1a3$ 10036 // 10037 10038 #ifndef CEF_LIBCEF_DLL_CPPTOC_COMMAND_LINE_CPPTOC_H_ 10039diff --git a/src/cef/libcef_dll/cpptoc/completion_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/completion_callback_cpptoc.cc 10040index dbfc0cab561e1..158c9b5df8783 10041--- a/src/cef/libcef_dll/cpptoc/completion_callback_cpptoc.cc 10042+++ b/src/cef/libcef_dll/cpptoc/completion_callback_cpptoc.cc 10043@@ -1,4 +1,4 @@ 10044-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10045+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10046 // reserved. Use of this source code is governed by a BSD-style license that 10047 // can be found in the LICENSE file. 10048 // 10049@@ -9,7 +9,7 @@ 10050 // implementations. See the translator.README.txt file in the tools directory 10051 // for more information. 10052 // 10053-// $hash=c16d5dc361785c620c9066fc473a443651afa7ab$ 10054+// $hash=0d30202496e04b3b51a914a480dca377de198807$ 10055 // 10056 10057 #include "libcef_dll/cpptoc/completion_callback_cpptoc.h" 10058diff --git a/src/cef/libcef_dll/cpptoc/completion_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/completion_callback_cpptoc.h 10059index 96b2bb1c78f0d..f57a9e4fae4f1 10060--- a/src/cef/libcef_dll/cpptoc/completion_callback_cpptoc.h 10061+++ b/src/cef/libcef_dll/cpptoc/completion_callback_cpptoc.h 10062@@ -1,4 +1,4 @@ 10063-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10064+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10065 // reserved. Use of this source code is governed by a BSD-style license that 10066 // can be found in the LICENSE file. 10067 // 10068@@ -9,7 +9,7 @@ 10069 // implementations. See the translator.README.txt file in the tools directory 10070 // for more information. 10071 // 10072-// $hash=7ac48d4ac56f3e31947f8f3b9d9bf54a3bc3383c$ 10073+// $hash=407df18b90244b245e73c4f69a199663df079f0d$ 10074 // 10075 10076 #ifndef CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_ 10077diff --git a/src/cef/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc 10078index 84eb030acc8b9..72ffa966fc5d1 10079--- a/src/cef/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc 10080+++ b/src/cef/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc 10081@@ -1,4 +1,4 @@ 10082-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10083+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10084 // reserved. Use of this source code is governed by a BSD-style license that 10085 // can be found in the LICENSE file. 10086 // 10087@@ -9,7 +9,7 @@ 10088 // implementations. See the translator.README.txt file in the tools directory 10089 // for more information. 10090 // 10091-// $hash=9652f02b935b2e77b689283cbc0b61e2efc95c17$ 10092+// $hash=2a6026a4c3f2190e968af0d43bf5a96ce3335c32$ 10093 // 10094 10095 #include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h" 10096diff --git a/src/cef/libcef_dll/cpptoc/context_menu_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/context_menu_handler_cpptoc.h 10097index f429b4b8593c1..fe010bf8565ba 10098--- a/src/cef/libcef_dll/cpptoc/context_menu_handler_cpptoc.h 10099+++ b/src/cef/libcef_dll/cpptoc/context_menu_handler_cpptoc.h 10100@@ -1,4 +1,4 @@ 10101-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10102+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10103 // reserved. Use of this source code is governed by a BSD-style license that 10104 // can be found in the LICENSE file. 10105 // 10106@@ -9,7 +9,7 @@ 10107 // implementations. See the translator.README.txt file in the tools directory 10108 // for more information. 10109 // 10110-// $hash=51d213cb8d40ba1f608944422e0522749e433a6f$ 10111+// $hash=68dd3aa1b0a216bdc63aa9ed3008b0b5815f8040$ 10112 // 10113 10114 #ifndef CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_HANDLER_CPPTOC_H_ 10115diff --git a/src/cef/libcef_dll/cpptoc/context_menu_params_cpptoc.cc b/src/cef/libcef_dll/cpptoc/context_menu_params_cpptoc.cc 10116index 6c26eac30765f..0f79a6583d0cb 10117--- a/src/cef/libcef_dll/cpptoc/context_menu_params_cpptoc.cc 10118+++ b/src/cef/libcef_dll/cpptoc/context_menu_params_cpptoc.cc 10119@@ -1,4 +1,4 @@ 10120-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10121+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10122 // reserved. Use of this source code is governed by a BSD-style license that 10123 // can be found in the LICENSE file. 10124 // 10125@@ -9,7 +9,7 @@ 10126 // implementations. See the translator.README.txt file in the tools directory 10127 // for more information. 10128 // 10129-// $hash=e2f6dee4f74c0eb0979d7a557b007fb8e495bcbb$ 10130+// $hash=b086ddccc396ae8b81f8847a2942325ea7b68faf$ 10131 // 10132 10133 #include "libcef_dll/cpptoc/context_menu_params_cpptoc.h" 10134@@ -383,6 +383,43 @@ context_menu_params_is_custom_menu(struct _cef_context_menu_params_t* self) { 10135 return _retval; 10136 } 10137 10138+cef_context_menu_input_field_type_t CEF_CALLBACK 10139+context_menu_params_get_input_field_type( 10140+ struct _cef_context_menu_params_t* self) { 10141+ shutdown_checker::AssertNotShutdown(); 10142+ 10143+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10144+ 10145+ DCHECK(self); 10146+ if (!self) 10147+ return CM_INPUTFIELDTYPE_NONE; 10148+ 10149+ // Execute 10150+ cef_context_menu_input_field_type_t _retval = 10151+ CefContextMenuParamsCppToC::Get(self)->GetInputFieldType(); 10152+ 10153+ // Return type: simple 10154+ return _retval; 10155+} 10156+ 10157+cef_context_menu_source_type_t CEF_CALLBACK 10158+context_menu_params_get_source_type(struct _cef_context_menu_params_t* self) { 10159+ shutdown_checker::AssertNotShutdown(); 10160+ 10161+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10162+ 10163+ DCHECK(self); 10164+ if (!self) 10165+ return CM_SOURCETYPE_NONE; 10166+ 10167+ // Execute 10168+ cef_context_menu_source_type_t _retval = 10169+ CefContextMenuParamsCppToC::Get(self)->GetSourceType(); 10170+ 10171+ // Return type: simple 10172+ return _retval; 10173+} 10174+ 10175 } // namespace 10176 10177 // CONSTRUCTOR - Do not edit by hand. 10178@@ -412,6 +449,8 @@ CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() { 10179 context_menu_params_is_spell_check_enabled; 10180 GetStruct()->get_edit_state_flags = context_menu_params_get_edit_state_flags; 10181 GetStruct()->is_custom_menu = context_menu_params_is_custom_menu; 10182+ GetStruct()->get_input_field_type = context_menu_params_get_input_field_type; 10183+ GetStruct()->get_source_type = context_menu_params_get_source_type; 10184 } 10185 10186 // DESTRUCTOR - Do not edit by hand. 10187diff --git a/src/cef/libcef_dll/cpptoc/context_menu_params_cpptoc.h b/src/cef/libcef_dll/cpptoc/context_menu_params_cpptoc.h 10188index e4cc567718318..ccae20acf3f51 10189--- a/src/cef/libcef_dll/cpptoc/context_menu_params_cpptoc.h 10190+++ b/src/cef/libcef_dll/cpptoc/context_menu_params_cpptoc.h 10191@@ -1,4 +1,4 @@ 10192-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10193+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10194 // reserved. Use of this source code is governed by a BSD-style license that 10195 // can be found in the LICENSE file. 10196 // 10197@@ -9,7 +9,7 @@ 10198 // implementations. See the translator.README.txt file in the tools directory 10199 // for more information. 10200 // 10201-// $hash=9612bbf58cbf1ee4c41d9cec79267e473d130172$ 10202+// $hash=289e9100aeb329f9ec7d1696354e31f2eb7d8ce9$ 10203 // 10204 10205 #ifndef CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_PARAMS_CPPTOC_H_ 10206diff --git a/src/cef/libcef_dll/cpptoc/cookie_access_filter_cpptoc.cc b/src/cef/libcef_dll/cpptoc/cookie_access_filter_cpptoc.cc 10207index eb095602c203c..300574a4085c8 10208--- a/src/cef/libcef_dll/cpptoc/cookie_access_filter_cpptoc.cc 10209+++ b/src/cef/libcef_dll/cpptoc/cookie_access_filter_cpptoc.cc 10210@@ -1,4 +1,4 @@ 10211-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10212+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10213 // reserved. Use of this source code is governed by a BSD-style license that 10214 // can be found in the LICENSE file. 10215 // 10216@@ -9,7 +9,7 @@ 10217 // implementations. See the translator.README.txt file in the tools directory 10218 // for more information. 10219 // 10220-// $hash=8a64cdcb148bd7c9cad278d57c353ebf48386a16$ 10221+// $hash=714da2b623c625391a0ca8415f5dcc3a434e212e$ 10222 // 10223 10224 #include "libcef_dll/cpptoc/cookie_access_filter_cpptoc.h" 10225diff --git a/src/cef/libcef_dll/cpptoc/cookie_access_filter_cpptoc.h b/src/cef/libcef_dll/cpptoc/cookie_access_filter_cpptoc.h 10226index 32c7864d66dc1..d3e150457aaba 10227--- a/src/cef/libcef_dll/cpptoc/cookie_access_filter_cpptoc.h 10228+++ b/src/cef/libcef_dll/cpptoc/cookie_access_filter_cpptoc.h 10229@@ -1,4 +1,4 @@ 10230-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10231+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10232 // reserved. Use of this source code is governed by a BSD-style license that 10233 // can be found in the LICENSE file. 10234 // 10235@@ -9,7 +9,7 @@ 10236 // implementations. See the translator.README.txt file in the tools directory 10237 // for more information. 10238 // 10239-// $hash=16e58fb5b73a0c13602b01a14afb4f6a882c094d$ 10240+// $hash=e0b8da1120abbbb306c6cc789ec94e38dc07ceb0$ 10241 // 10242 10243 #ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_ACCESS_FILTER_CPPTOC_H_ 10244diff --git a/src/cef/libcef_dll/cpptoc/cookie_manager_cpptoc.cc b/src/cef/libcef_dll/cpptoc/cookie_manager_cpptoc.cc 10245index c78c8f33be0c4..bb862918e0a8f 10246--- a/src/cef/libcef_dll/cpptoc/cookie_manager_cpptoc.cc 10247+++ b/src/cef/libcef_dll/cpptoc/cookie_manager_cpptoc.cc 10248@@ -1,4 +1,4 @@ 10249-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10250+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10251 // reserved. Use of this source code is governed by a BSD-style license that 10252 // can be found in the LICENSE file. 10253 // 10254@@ -9,7 +9,7 @@ 10255 // implementations. See the translator.README.txt file in the tools directory 10256 // for more information. 10257 // 10258-// $hash=e2ce6d109390673bbfa660a9a43b8f7ce2e3adf7$ 10259+// $hash=2efc0918bc483be69599cf2cd08c0f3894b560d0$ 10260 // 10261 10262 #include "libcef_dll/cpptoc/cookie_manager_cpptoc.h" 10263@@ -20,8 +20,8 @@ 10264 10265 // GLOBAL FUNCTIONS - Body may be edited by hand. 10266 10267-CEF_EXPORT cef_cookie_manager_t * 10268-cef_cookie_manager_get_global_manager(cef_completion_callback_t *callback) { 10269+CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager( 10270+ cef_completion_callback_t* callback) { 10271 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10272 10273 // Unverified params: callback 10274@@ -34,10 +34,10 @@ cef_cookie_manager_get_global_manager(cef_completion_callback_t *callback) { 10275 return CefCookieManagerCppToC::Wrap(_retval); 10276 } 10277 10278-CEF_EXPORT int 10279-cef_cookie_manager_create_cef_cookie(const cef_string_t *url, 10280- const cef_string_t *value, 10281- struct _cef_cookie_t *cef_cookie) { 10282+CEF_EXPORT int cef_cookie_manager_create_cef_cookie( 10283+ const cef_string_t* url, 10284+ const cef_string_t* value, 10285+ struct _cef_cookie_t* cef_cookie) { 10286 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10287 10288 // Verify param: url; type: string_byref_const 10289@@ -75,7 +75,7 @@ namespace { 10290 // MEMBER FUNCTIONS - Body may be edited by hand. 10291 10292 int CEF_CALLBACK 10293-cookie_manager_is_accept_cookie_allowed(struct _cef_cookie_manager_t *self) { 10294+cookie_manager_is_accept_cookie_allowed(struct _cef_cookie_manager_t* self) { 10295 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10296 10297 DCHECK(self); 10298@@ -89,8 +89,9 @@ cookie_manager_is_accept_cookie_allowed(struct _cef_cookie_manager_t *self) { 10299 return _retval; 10300 } 10301 10302-void CEF_CALLBACK cookie_manager_put_accept_cookie_enabled( 10303- struct _cef_cookie_manager_t *self, int accept) { 10304+void CEF_CALLBACK 10305+cookie_manager_put_accept_cookie_enabled(struct _cef_cookie_manager_t* self, 10306+ int accept) { 10307 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10308 10309 DCHECK(self); 10310@@ -103,7 +104,7 @@ void CEF_CALLBACK cookie_manager_put_accept_cookie_enabled( 10311 } 10312 10313 int CEF_CALLBACK cookie_manager_is_third_party_cookie_allowed( 10314- struct _cef_cookie_manager_t *self) { 10315+ struct _cef_cookie_manager_t* self) { 10316 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10317 10318 DCHECK(self); 10319@@ -118,7 +119,8 @@ int CEF_CALLBACK cookie_manager_is_third_party_cookie_allowed( 10320 } 10321 10322 void CEF_CALLBACK cookie_manager_put_accept_third_party_cookie_enabled( 10323- struct _cef_cookie_manager_t *self, int accept) { 10324+ struct _cef_cookie_manager_t* self, 10325+ int accept) { 10326 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10327 10328 DCHECK(self); 10329@@ -131,7 +133,7 @@ void CEF_CALLBACK cookie_manager_put_accept_third_party_cookie_enabled( 10330 } 10331 10332 int CEF_CALLBACK cookie_manager_is_file_urlscheme_cookies_allowed( 10333- struct _cef_cookie_manager_t *self) { 10334+ struct _cef_cookie_manager_t* self) { 10335 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10336 10337 DCHECK(self); 10338@@ -147,7 +149,8 @@ int CEF_CALLBACK cookie_manager_is_file_urlscheme_cookies_allowed( 10339 } 10340 10341 void CEF_CALLBACK cookie_manager_put_accept_file_urlscheme_cookies_enabled( 10342- struct _cef_cookie_manager_t *self, int allow) { 10343+ struct _cef_cookie_manager_t* self, 10344+ int allow) { 10345 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10346 10347 DCHECK(self); 10348@@ -159,8 +162,9 @@ void CEF_CALLBACK cookie_manager_put_accept_file_urlscheme_cookies_enabled( 10349 allow ? true : false); 10350 } 10351 10352-int CEF_CALLBACK cookie_manager_visit_all_cookies( 10353- struct _cef_cookie_manager_t *self, struct _cef_cookie_visitor_t *visitor) { 10354+int CEF_CALLBACK 10355+cookie_manager_visit_all_cookies(struct _cef_cookie_manager_t* self, 10356+ struct _cef_cookie_visitor_t* visitor) { 10357 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10358 10359 DCHECK(self); 10360@@ -179,9 +183,11 @@ int CEF_CALLBACK cookie_manager_visit_all_cookies( 10361 return _retval; 10362 } 10363 10364-int CEF_CALLBACK cookie_manager_visit_url_cookies( 10365- struct _cef_cookie_manager_t *self, const cef_string_t *url, 10366- int includeHttpOnly, struct _cef_cookie_visitor_t *visitor) { 10367+int CEF_CALLBACK 10368+cookie_manager_visit_url_cookies(struct _cef_cookie_manager_t* self, 10369+ const cef_string_t* url, 10370+ int includeHttpOnly, 10371+ struct _cef_cookie_visitor_t* visitor) { 10372 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10373 10374 DCHECK(self); 10375@@ -205,10 +211,11 @@ int CEF_CALLBACK cookie_manager_visit_url_cookies( 10376 return _retval; 10377 } 10378 10379-int CEF_CALLBACK cookie_manager_set_cookie( 10380- struct _cef_cookie_manager_t *self, const cef_string_t *url, 10381- const struct _cef_cookie_t *cookie, 10382- struct _cef_set_cookie_callback_t *callback) { 10383+int CEF_CALLBACK 10384+cookie_manager_set_cookie(struct _cef_cookie_manager_t* self, 10385+ const cef_string_t* url, 10386+ const struct _cef_cookie_t* cookie, 10387+ struct _cef_set_cookie_callback_t* callback) { 10388 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10389 10390 DCHECK(self); 10391@@ -237,10 +244,12 @@ int CEF_CALLBACK cookie_manager_set_cookie( 10392 return _retval; 10393 } 10394 10395-int CEF_CALLBACK cookie_manager_delete_cookies( 10396- struct _cef_cookie_manager_t *self, const cef_string_t *url, 10397- const cef_string_t *cookie_name, int is_session, 10398- struct _cef_delete_cookies_callback_t *callback) { 10399+int CEF_CALLBACK 10400+cookie_manager_delete_cookies(struct _cef_cookie_manager_t* self, 10401+ const cef_string_t* url, 10402+ const cef_string_t* cookie_name, 10403+ int is_session, 10404+ struct _cef_delete_cookies_callback_t* callback) { 10405 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10406 10407 DCHECK(self); 10408@@ -257,8 +266,9 @@ int CEF_CALLBACK cookie_manager_delete_cookies( 10409 return _retval; 10410 } 10411 10412-int CEF_CALLBACK cookie_manager_flush_store( 10413- struct _cef_cookie_manager_t *self, cef_completion_callback_t *callback) { 10414+int CEF_CALLBACK 10415+cookie_manager_flush_store(struct _cef_cookie_manager_t* self, 10416+ cef_completion_callback_t* callback) { 10417 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10418 10419 DCHECK(self); 10420@@ -274,7 +284,7 @@ int CEF_CALLBACK cookie_manager_flush_store( 10421 return _retval; 10422 } 10423 10424-} // namespace 10425+} // namespace 10426 10427 // CONSTRUCTOR - Do not edit by hand. 10428 10429@@ -303,16 +313,17 @@ CefCookieManagerCppToC::CefCookieManagerCppToC() { 10430 CefCookieManagerCppToC::~CefCookieManagerCppToC() {} 10431 10432 template <> 10433-CefRefPtr<CefCookieManager> 10434-CefCppToCRefCounted<CefCookieManagerCppToC, CefCookieManager, 10435- cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type, 10436- cef_cookie_manager_t 10437- *s) { 10438+CefRefPtr<CefCookieManager> CefCppToCRefCounted< 10439+ CefCookieManagerCppToC, 10440+ CefCookieManager, 10441+ cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type, 10442+ cef_cookie_manager_t* s) { 10443 NOTREACHED() << "Unexpected class type: " << type; 10444 return nullptr; 10445 } 10446 10447 template <> 10448-CefWrapperType CefCppToCRefCounted<CefCookieManagerCppToC, CefCookieManager, 10449+CefWrapperType CefCppToCRefCounted<CefCookieManagerCppToC, 10450+ CefCookieManager, 10451 cef_cookie_manager_t>::kWrapperType = 10452 WT_COOKIE_MANAGER; 10453diff --git a/src/cef/libcef_dll/cpptoc/cookie_manager_cpptoc.h b/src/cef/libcef_dll/cpptoc/cookie_manager_cpptoc.h 10454index b1088b73409db..9f4094feb8497 10455--- a/src/cef/libcef_dll/cpptoc/cookie_manager_cpptoc.h 10456+++ b/src/cef/libcef_dll/cpptoc/cookie_manager_cpptoc.h 10457@@ -1,4 +1,4 @@ 10458-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10459+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10460 // reserved. Use of this source code is governed by a BSD-style license that 10461 // can be found in the LICENSE file. 10462 // 10463@@ -9,7 +9,7 @@ 10464 // implementations. See the translator.README.txt file in the tools directory 10465 // for more information. 10466 // 10467-// $hash=75170ff033e8e382ba463d350493fab6e12e4192$ 10468+// $hash=3c70ed00438c00d85c27407d1c0947d2b310f401$ 10469 // 10470 10471 #ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_MANAGER_CPPTOC_H_ 10472diff --git a/src/cef/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc b/src/cef/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc 10473index d3d5ef089562e..82b09a1fc8348 10474--- a/src/cef/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc 10475+++ b/src/cef/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc 10476@@ -1,4 +1,4 @@ 10477-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10478+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10479 // reserved. Use of this source code is governed by a BSD-style license that 10480 // can be found in the LICENSE file. 10481 // 10482@@ -9,7 +9,7 @@ 10483 // implementations. See the translator.README.txt file in the tools directory 10484 // for more information. 10485 // 10486-// $hash=07483aea0b811fedba3da36f7a598f06edd22faf$ 10487+// $hash=399d62b7dd532222ab5e208d95acbd46985cc1aa$ 10488 // 10489 10490 #include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h" 10491diff --git a/src/cef/libcef_dll/cpptoc/cookie_visitor_cpptoc.h b/src/cef/libcef_dll/cpptoc/cookie_visitor_cpptoc.h 10492index 130318cd07a66..f0dd94f0541eb 10493--- a/src/cef/libcef_dll/cpptoc/cookie_visitor_cpptoc.h 10494+++ b/src/cef/libcef_dll/cpptoc/cookie_visitor_cpptoc.h 10495@@ -1,4 +1,4 @@ 10496-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10497+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10498 // reserved. Use of this source code is governed by a BSD-style license that 10499 // can be found in the LICENSE file. 10500 // 10501@@ -9,7 +9,7 @@ 10502 // implementations. See the translator.README.txt file in the tools directory 10503 // for more information. 10504 // 10505-// $hash=2c087a5613a69038aa9bba45c46a56d96c6a60ba$ 10506+// $hash=45985eb9f0544a0c90fea396ec66c921e44f55a5$ 10507 // 10508 10509 #ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ 10510diff --git a/src/cef/libcef_dll/cpptoc/data_base_cpptoc.cc b/src/cef/libcef_dll/cpptoc/data_base_cpptoc.cc 10511index 5493176c301e2..fb65d762c7cd5 10512--- a/src/cef/libcef_dll/cpptoc/data_base_cpptoc.cc 10513+++ b/src/cef/libcef_dll/cpptoc/data_base_cpptoc.cc 10514@@ -1,4 +1,4 @@ 10515-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10516+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10517 // reserved. Use of this source code is governed by a BSD-style license that 10518 // can be found in the LICENSE file. 10519 // 10520@@ -9,7 +9,7 @@ 10521 // implementations. See the translator.README.txt file in the tools directory 10522 // for more information. 10523 // 10524-// $hash=5cc7dfcfeb969f00a01d13456464b2811bda3a85$ 10525+// $hash=8781ffbbab1b14d126dd8e91270e04628354940e$ 10526 // 10527 10528 #include "libcef_dll/cpptoc/data_base_cpptoc.h" 10529@@ -95,7 +95,9 @@ void CEF_CALLBACK 10530 data_base_get_http_auth_credentials(struct _cef_data_base_t* self, 10531 const cef_string_t* host, 10532 const cef_string_t* realm, 10533- cef_string_list_t username_password) { 10534+ cef_string_t* username, 10535+ char* password, 10536+ uint32_t passwordSize) { 10537 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10538 10539 DCHECK(self); 10540@@ -109,26 +111,27 @@ data_base_get_http_auth_credentials(struct _cef_data_base_t* self, 10541 DCHECK(realm); 10542 if (!realm) 10543 return; 10544- // Verify param: username_password; type: string_vec_byref 10545- DCHECK(username_password); 10546- if (!username_password) 10547+ // Verify param: username; type: string_byref 10548+ DCHECK(username); 10549+ if (!username) 10550+ return; 10551+ // Verify param: password; type: simple_byaddr 10552+ DCHECK(password); 10553+ if (!password) 10554 return; 10555 10556- // Translate param: username_password; type: string_vec_byref 10557- std::vector<CefString> username_passwordList; 10558- transfer_string_list_contents(username_password, username_passwordList); 10559+ // Translate param: username; type: string_byref 10560+ CefString usernameStr(username); 10561 10562 // Execute 10563 CefDataBaseCppToC::Get(self)->GetHttpAuthCredentials( 10564- CefString(host), CefString(realm), username_passwordList); 10565- 10566- // Restore param: username_password; type: string_vec_byref 10567- cef_string_list_clear(username_password); 10568- transfer_string_list_contents(username_passwordList, username_password); 10569+ CefString(host), CefString(realm), usernameStr, password, passwordSize); 10570 } 10571 10572-int CEF_CALLBACK data_base_exist_permission_by_origin( 10573- struct _cef_data_base_t *self, const cef_string_t *origin, int type) { 10574+int CEF_CALLBACK 10575+data_base_exist_permission_by_origin(struct _cef_data_base_t* self, 10576+ const cef_string_t* origin, 10577+ int type) { 10578 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10579 10580 DCHECK(self); 10581@@ -147,9 +150,11 @@ int CEF_CALLBACK data_base_exist_permission_by_origin( 10582 return _retval; 10583 } 10584 10585-int CEF_CALLBACK data_base_get_permission_result_by_origin( 10586- struct _cef_data_base_t *self, const cef_string_t *origin, int type, 10587- int *result) { 10588+int CEF_CALLBACK 10589+data_base_get_permission_result_by_origin(struct _cef_data_base_t* self, 10590+ const cef_string_t* origin, 10591+ int type, 10592+ int* result) { 10593 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10594 10595 DCHECK(self); 10596@@ -179,9 +184,11 @@ int CEF_CALLBACK data_base_get_permission_result_by_origin( 10597 return _retval; 10598 } 10599 10600-void CEF_CALLBACK data_base_set_permission_by_origin( 10601- struct _cef_data_base_t *self, const cef_string_t *origin, int type, 10602- int result) { 10603+void CEF_CALLBACK 10604+data_base_set_permission_by_origin(struct _cef_data_base_t* self, 10605+ const cef_string_t* origin, 10606+ int type, 10607+ int result) { 10608 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10609 10610 DCHECK(self); 10611@@ -197,8 +204,10 @@ void CEF_CALLBACK data_base_set_permission_by_origin( 10612 result ? true : false); 10613 } 10614 10615-void CEF_CALLBACK data_base_clear_permission_by_origin( 10616- struct _cef_data_base_t *self, const cef_string_t *origin, int type) { 10617+void CEF_CALLBACK 10618+data_base_clear_permission_by_origin(struct _cef_data_base_t* self, 10619+ const cef_string_t* origin, 10620+ int type) { 10621 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10622 10623 DCHECK(self); 10624@@ -214,7 +223,7 @@ void CEF_CALLBACK data_base_clear_permission_by_origin( 10625 type); 10626 } 10627 10628-void CEF_CALLBACK data_base_clear_all_permission(struct _cef_data_base_t *self, 10629+void CEF_CALLBACK data_base_clear_all_permission(struct _cef_data_base_t* self, 10630 int type) { 10631 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10632 10633@@ -226,8 +235,10 @@ void CEF_CALLBACK data_base_clear_all_permission(struct _cef_data_base_t *self, 10634 CefDataBaseCppToC::Get(self)->ClearAllPermission(type); 10635 } 10636 10637-void CEF_CALLBACK data_base_get_origins_by_permission( 10638- struct _cef_data_base_t *self, int type, cef_string_list_t origins) { 10639+void CEF_CALLBACK 10640+data_base_get_origins_by_permission(struct _cef_data_base_t* self, 10641+ int type, 10642+ cef_string_list_t origins) { 10643 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10644 10645 DCHECK(self); 10646diff --git a/src/cef/libcef_dll/cpptoc/data_base_cpptoc.h b/src/cef/libcef_dll/cpptoc/data_base_cpptoc.h 10647index 345a8e2d6428e..5c3dfb18857bf 10648--- a/src/cef/libcef_dll/cpptoc/data_base_cpptoc.h 10649+++ b/src/cef/libcef_dll/cpptoc/data_base_cpptoc.h 10650@@ -1,4 +1,4 @@ 10651-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10652+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10653 // reserved. Use of this source code is governed by a BSD-style license that 10654 // can be found in the LICENSE file. 10655 // 10656@@ -9,7 +9,7 @@ 10657 // implementations. See the translator.README.txt file in the tools directory 10658 // for more information. 10659 // 10660-// $hash=556a51c2b0295892b98e2c6f62b27b99eba39286$ 10661+// $hash=bcd06269b419de539f58d0d17f5e568d370641ac$ 10662 // 10663 10664 #ifndef CEF_LIBCEF_DLL_CPPTOC_DATA_BASE_CPPTOC_H_ 10665diff --git a/src/cef/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc 10666index 8c5b758b23feb..529faf2314ef9 10667--- a/src/cef/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc 10668+++ b/src/cef/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc 10669@@ -1,4 +1,4 @@ 10670-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10671+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10672 // reserved. Use of this source code is governed by a BSD-style license that 10673 // can be found in the LICENSE file. 10674 // 10675@@ -9,7 +9,7 @@ 10676 // implementations. See the translator.README.txt file in the tools directory 10677 // for more information. 10678 // 10679-// $hash=0d2b19ca10e7a4ad389d3ce8de83addc1cad4b63$ 10680+// $hash=67304c5e02c51d987d2a4b4f0a03e019f44018ea$ 10681 // 10682 10683 #include "libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h" 10684diff --git a/src/cef/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h 10685index 5f8c4f6db10d4..bc1ebd9531521 10686--- a/src/cef/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h 10687+++ b/src/cef/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h 10688@@ -1,4 +1,4 @@ 10689-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10690+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10691 // reserved. Use of this source code is governed by a BSD-style license that 10692 // can be found in the LICENSE file. 10693 // 10694@@ -9,7 +9,7 @@ 10695 // implementations. See the translator.README.txt file in the tools directory 10696 // for more information. 10697 // 10698-// $hash=424b81efdcb5b86629d8388df5df13b1229155bb$ 10699+// $hash=9ef76b4e16c9ee12b2c5956a3e4789fe2e40d9f0$ 10700 // 10701 10702 #ifndef CEF_LIBCEF_DLL_CPPTOC_DELETE_COOKIES_CALLBACK_CPPTOC_H_ 10703diff --git a/src/cef/libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.cc b/src/cef/libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.cc 10704index 534d94072ac98..cb0e417f9ba56 10705--- a/src/cef/libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.cc 10706+++ b/src/cef/libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.cc 10707@@ -1,4 +1,4 @@ 10708-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10709+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10710 // reserved. Use of this source code is governed by a BSD-style license that 10711 // can be found in the LICENSE file. 10712 // 10713@@ -9,7 +9,7 @@ 10714 // implementations. See the translator.README.txt file in the tools directory 10715 // for more information. 10716 // 10717-// $hash=a8a10af1258edd37dbb8d079a10943070c1e9c4c$ 10718+// $hash=c39b7ad0cee7f051f5b2f374917910aae6e9a96a$ 10719 // 10720 10721 #include "libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.h" 10722diff --git a/src/cef/libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.h b/src/cef/libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.h 10723index cd0396a86b71e..6ab9e5c987ad9 10724--- a/src/cef/libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.h 10725+++ b/src/cef/libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.h 10726@@ -1,4 +1,4 @@ 10727-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10728+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10729 // reserved. Use of this source code is governed by a BSD-style license that 10730 // can be found in the LICENSE file. 10731 // 10732@@ -9,7 +9,7 @@ 10733 // implementations. See the translator.README.txt file in the tools directory 10734 // for more information. 10735 // 10736-// $hash=309236e96bdbd2d39e63f94872d2de18552bec80$ 10737+// $hash=4f034b01b5709e8012ff089e000216008f6232b6$ 10738 // 10739 10740 #ifndef CEF_LIBCEF_DLL_CPPTOC_DEV_TOOLS_MESSAGE_OBSERVER_CPPTOC_H_ 10741diff --git a/src/cef/libcef_dll/cpptoc/dialog_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/dialog_handler_cpptoc.cc 10742index e66a9617d455f..4e607b88d785b 10743--- a/src/cef/libcef_dll/cpptoc/dialog_handler_cpptoc.cc 10744+++ b/src/cef/libcef_dll/cpptoc/dialog_handler_cpptoc.cc 10745@@ -1,4 +1,4 @@ 10746-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10747+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10748 // reserved. Use of this source code is governed by a BSD-style license that 10749 // can be found in the LICENSE file. 10750 // 10751@@ -9,12 +9,13 @@ 10752 // implementations. See the translator.README.txt file in the tools directory 10753 // for more information. 10754 // 10755-// $hash=2f925fbe5bb419b6adf14c4b508c7330ec8dd84a$ 10756+// $hash=3c71c8ae9b8f6ae947bfccd7e018137d7f30737c$ 10757 // 10758 10759 #include "libcef_dll/cpptoc/dialog_handler_cpptoc.h" 10760 #include "libcef_dll/ctocpp/browser_ctocpp.h" 10761 #include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h" 10762+#include "libcef_dll/ctocpp/select_popup_callback_ctocpp.h" 10763 #include "libcef_dll/shutdown_checker.h" 10764 #include "libcef_dll/transfer_util.h" 10765 10766@@ -67,12 +68,68 @@ dialog_handler_on_file_dialog(struct _cef_dialog_handler_t* self, 10767 return _retval; 10768 } 10769 10770+void CEF_CALLBACK 10771+dialog_handler_on_select_popup_menu(struct _cef_dialog_handler_t* self, 10772+ cef_browser_t* browser, 10773+ const cef_rect_t* bounds, 10774+ int item_height, 10775+ double item_font_size, 10776+ int selected_item, 10777+ size_t menu_itemsCount, 10778+ cef_select_popup_item_t const* menu_items, 10779+ int right_aligned, 10780+ int allow_multiple_selection, 10781+ cef_select_popup_callback_t* callback) { 10782+ shutdown_checker::AssertNotShutdown(); 10783+ 10784+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 10785+ 10786+ DCHECK(self); 10787+ if (!self) 10788+ return; 10789+ // Verify param: browser; type: refptr_diff 10790+ DCHECK(browser); 10791+ if (!browser) 10792+ return; 10793+ // Verify param: bounds; type: simple_byref_const 10794+ DCHECK(bounds); 10795+ if (!bounds) 10796+ return; 10797+ // Verify param: menu_items; type: simple_vec_byref_const 10798+ DCHECK(menu_itemsCount == 0 || menu_items); 10799+ if (menu_itemsCount > 0 && !menu_items) 10800+ return; 10801+ // Verify param: callback; type: refptr_diff 10802+ DCHECK(callback); 10803+ if (!callback) 10804+ return; 10805+ 10806+ // Translate param: bounds; type: simple_byref_const 10807+ CefRect boundsVal = bounds ? *bounds : CefRect(); 10808+ // Translate param: menu_items; type: simple_vec_byref_const 10809+ std::vector<CefSelectPopupItem> menu_itemsList; 10810+ if (menu_itemsCount > 0) { 10811+ for (size_t i = 0; i < menu_itemsCount; ++i) { 10812+ CefSelectPopupItem menu_itemsVal = menu_items[i]; 10813+ menu_itemsList.push_back(menu_itemsVal); 10814+ } 10815+ } 10816+ 10817+ // Execute 10818+ CefDialogHandlerCppToC::Get(self)->OnSelectPopupMenu( 10819+ CefBrowserCToCpp::Wrap(browser), boundsVal, item_height, item_font_size, 10820+ selected_item, menu_itemsList, right_aligned ? true : false, 10821+ allow_multiple_selection ? true : false, 10822+ CefSelectPopupCallbackCToCpp::Wrap(callback)); 10823+} 10824+ 10825 } // namespace 10826 10827 // CONSTRUCTOR - Do not edit by hand. 10828 10829 CefDialogHandlerCppToC::CefDialogHandlerCppToC() { 10830 GetStruct()->on_file_dialog = dialog_handler_on_file_dialog; 10831+ GetStruct()->on_select_popup_menu = dialog_handler_on_select_popup_menu; 10832 } 10833 10834 // DESTRUCTOR - Do not edit by hand. 10835diff --git a/src/cef/libcef_dll/cpptoc/dialog_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/dialog_handler_cpptoc.h 10836index d1dbb38f3a85f..dcd88050832be 10837--- a/src/cef/libcef_dll/cpptoc/dialog_handler_cpptoc.h 10838+++ b/src/cef/libcef_dll/cpptoc/dialog_handler_cpptoc.h 10839@@ -1,4 +1,4 @@ 10840-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10841+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10842 // reserved. Use of this source code is governed by a BSD-style license that 10843 // can be found in the LICENSE file. 10844 // 10845@@ -9,7 +9,7 @@ 10846 // implementations. See the translator.README.txt file in the tools directory 10847 // for more information. 10848 // 10849-// $hash=52c108ee7b518b733b331b7d172f16bf3126fe3d$ 10850+// $hash=fca3fb90b8a74c5cdf3dc16e1489668ce80c7c07$ 10851 // 10852 10853 #ifndef CEF_LIBCEF_DLL_CPPTOC_DIALOG_HANDLER_CPPTOC_H_ 10854diff --git a/src/cef/libcef_dll/cpptoc/dictionary_value_cpptoc.cc b/src/cef/libcef_dll/cpptoc/dictionary_value_cpptoc.cc 10855index 450903a13bad7..aaaae4474a299 10856--- a/src/cef/libcef_dll/cpptoc/dictionary_value_cpptoc.cc 10857+++ b/src/cef/libcef_dll/cpptoc/dictionary_value_cpptoc.cc 10858@@ -1,4 +1,4 @@ 10859-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10860+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10861 // reserved. Use of this source code is governed by a BSD-style license that 10862 // can be found in the LICENSE file. 10863 // 10864@@ -9,7 +9,7 @@ 10865 // implementations. See the translator.README.txt file in the tools directory 10866 // for more information. 10867 // 10868-// $hash=c55e53ae76eba8e90a364cd6768764a4c56967ff$ 10869+// $hash=a3293282e7d3c476dc68b315b9d698d8c62768b6$ 10870 // 10871 10872 #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" 10873diff --git a/src/cef/libcef_dll/cpptoc/dictionary_value_cpptoc.h b/src/cef/libcef_dll/cpptoc/dictionary_value_cpptoc.h 10874index 4b2aeae7ebad4..038b5738ddb84 10875--- a/src/cef/libcef_dll/cpptoc/dictionary_value_cpptoc.h 10876+++ b/src/cef/libcef_dll/cpptoc/dictionary_value_cpptoc.h 10877@@ -1,4 +1,4 @@ 10878-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10879+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10880 // reserved. Use of this source code is governed by a BSD-style license that 10881 // can be found in the LICENSE file. 10882 // 10883@@ -9,7 +9,7 @@ 10884 // implementations. See the translator.README.txt file in the tools directory 10885 // for more information. 10886 // 10887-// $hash=ddb7429c3059bb7af3a285adde53aab78a99d39d$ 10888+// $hash=dd73e5b97103c4ad27620af89886e49bfbdc8d21$ 10889 // 10890 10891 #ifndef CEF_LIBCEF_DLL_CPPTOC_DICTIONARY_VALUE_CPPTOC_H_ 10892diff --git a/src/cef/libcef_dll/cpptoc/display_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/display_handler_cpptoc.cc 10893index 283d83b8c0186..c3f6c08414798 10894--- a/src/cef/libcef_dll/cpptoc/display_handler_cpptoc.cc 10895+++ b/src/cef/libcef_dll/cpptoc/display_handler_cpptoc.cc 10896@@ -1,4 +1,4 @@ 10897-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10898+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10899 // reserved. Use of this source code is governed by a BSD-style license that 10900 // can be found in the LICENSE file. 10901 // 10902@@ -9,7 +9,7 @@ 10903 // implementations. See the translator.README.txt file in the tools directory 10904 // for more information. 10905 // 10906-// $hash=dcec0d8e6a9a0d393173112aa81e0f9dc70f73db$ 10907+// $hash=a6d58b8140f21ae5130189a75c283510d7e712fd$ 10908 // 10909 10910 #include "libcef_dll/cpptoc/display_handler_cpptoc.h" 10911diff --git a/src/cef/libcef_dll/cpptoc/display_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/display_handler_cpptoc.h 10912index 9d5121a244837..ccc1e439a3c05 10913--- a/src/cef/libcef_dll/cpptoc/display_handler_cpptoc.h 10914+++ b/src/cef/libcef_dll/cpptoc/display_handler_cpptoc.h 10915@@ -1,4 +1,4 @@ 10916-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10917+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10918 // reserved. Use of this source code is governed by a BSD-style license that 10919 // can be found in the LICENSE file. 10920 // 10921@@ -9,7 +9,7 @@ 10922 // implementations. See the translator.README.txt file in the tools directory 10923 // for more information. 10924 // 10925-// $hash=db9ca0d224aa971d8912fc577c53cc9abe52fe58$ 10926+// $hash=8ba6fb9ce96e92ba80a05258060e530ddf822264$ 10927 // 10928 10929 #ifndef CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ 10930diff --git a/src/cef/libcef_dll/cpptoc/domdocument_cpptoc.cc b/src/cef/libcef_dll/cpptoc/domdocument_cpptoc.cc 10931index 4850dcd185b13..77469f6ad3f5e 10932--- a/src/cef/libcef_dll/cpptoc/domdocument_cpptoc.cc 10933+++ b/src/cef/libcef_dll/cpptoc/domdocument_cpptoc.cc 10934@@ -1,4 +1,4 @@ 10935-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10936+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10937 // reserved. Use of this source code is governed by a BSD-style license that 10938 // can be found in the LICENSE file. 10939 // 10940@@ -9,7 +9,7 @@ 10941 // implementations. See the translator.README.txt file in the tools directory 10942 // for more information. 10943 // 10944-// $hash=c4cad301694f35ea716d7c4376252140fcb0d78f$ 10945+// $hash=66706283cc184aece537eb9df570f7bd8a3281a5$ 10946 // 10947 10948 #include "libcef_dll/cpptoc/domdocument_cpptoc.h" 10949diff --git a/src/cef/libcef_dll/cpptoc/domdocument_cpptoc.h b/src/cef/libcef_dll/cpptoc/domdocument_cpptoc.h 10950index 919eb2a288105..bdf946cb6aabd 10951--- a/src/cef/libcef_dll/cpptoc/domdocument_cpptoc.h 10952+++ b/src/cef/libcef_dll/cpptoc/domdocument_cpptoc.h 10953@@ -1,4 +1,4 @@ 10954-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10955+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10956 // reserved. Use of this source code is governed by a BSD-style license that 10957 // can be found in the LICENSE file. 10958 // 10959@@ -9,7 +9,7 @@ 10960 // implementations. See the translator.README.txt file in the tools directory 10961 // for more information. 10962 // 10963-// $hash=8aea7ead4b6cbdefba65a1234213fee4eb4a1952$ 10964+// $hash=6a5b9bb0155acb8c5e6f796e68463825e00a8e53$ 10965 // 10966 10967 #ifndef CEF_LIBCEF_DLL_CPPTOC_DOMDOCUMENT_CPPTOC_H_ 10968diff --git a/src/cef/libcef_dll/cpptoc/domnode_cpptoc.cc b/src/cef/libcef_dll/cpptoc/domnode_cpptoc.cc 10969index 6496648c827d4..f965040ed3396 10970--- a/src/cef/libcef_dll/cpptoc/domnode_cpptoc.cc 10971+++ b/src/cef/libcef_dll/cpptoc/domnode_cpptoc.cc 10972@@ -1,4 +1,4 @@ 10973-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10974+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10975 // reserved. Use of this source code is governed by a BSD-style license that 10976 // can be found in the LICENSE file. 10977 // 10978@@ -9,7 +9,7 @@ 10979 // implementations. See the translator.README.txt file in the tools directory 10980 // for more information. 10981 // 10982-// $hash=d352693e8728b1ed586dc62d69a91dd92667760a$ 10983+// $hash=a83ee414291415564391c48a351d4ea2691d8358$ 10984 // 10985 10986 #include "libcef_dll/cpptoc/domnode_cpptoc.h" 10987diff --git a/src/cef/libcef_dll/cpptoc/domnode_cpptoc.h b/src/cef/libcef_dll/cpptoc/domnode_cpptoc.h 10988index a9325b62b0e04..c11783f8f7cb8 10989--- a/src/cef/libcef_dll/cpptoc/domnode_cpptoc.h 10990+++ b/src/cef/libcef_dll/cpptoc/domnode_cpptoc.h 10991@@ -1,4 +1,4 @@ 10992-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 10993+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 10994 // reserved. Use of this source code is governed by a BSD-style license that 10995 // can be found in the LICENSE file. 10996 // 10997@@ -9,7 +9,7 @@ 10998 // implementations. See the translator.README.txt file in the tools directory 10999 // for more information. 11000 // 11001-// $hash=e5c97231e7d369e8fb4bd73611ec49d7289af076$ 11002+// $hash=18f223a2671334b8bd8d463a94b5a3c0191141e8$ 11003 // 11004 11005 #ifndef CEF_LIBCEF_DLL_CPPTOC_DOMNODE_CPPTOC_H_ 11006diff --git a/src/cef/libcef_dll/cpptoc/domvisitor_cpptoc.cc b/src/cef/libcef_dll/cpptoc/domvisitor_cpptoc.cc 11007index fd1cff62815f1..8838f93c16549 11008--- a/src/cef/libcef_dll/cpptoc/domvisitor_cpptoc.cc 11009+++ b/src/cef/libcef_dll/cpptoc/domvisitor_cpptoc.cc 11010@@ -1,4 +1,4 @@ 11011-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11012+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11013 // reserved. Use of this source code is governed by a BSD-style license that 11014 // can be found in the LICENSE file. 11015 // 11016@@ -9,7 +9,7 @@ 11017 // implementations. See the translator.README.txt file in the tools directory 11018 // for more information. 11019 // 11020-// $hash=f809bcb5a3f1246b3a94aebe14ad36bbb7e185c7$ 11021+// $hash=7426be91c0a1a5d650b24d18f23cc5f559c9971e$ 11022 // 11023 11024 #include "libcef_dll/cpptoc/domvisitor_cpptoc.h" 11025diff --git a/src/cef/libcef_dll/cpptoc/domvisitor_cpptoc.h b/src/cef/libcef_dll/cpptoc/domvisitor_cpptoc.h 11026index 84a2b75baaa8a..3cd81a5e27ee6 11027--- a/src/cef/libcef_dll/cpptoc/domvisitor_cpptoc.h 11028+++ b/src/cef/libcef_dll/cpptoc/domvisitor_cpptoc.h 11029@@ -1,4 +1,4 @@ 11030-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11031+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11032 // reserved. Use of this source code is governed by a BSD-style license that 11033 // can be found in the LICENSE file. 11034 // 11035@@ -9,7 +9,7 @@ 11036 // implementations. See the translator.README.txt file in the tools directory 11037 // for more information. 11038 // 11039-// $hash=974358c3bab311f8a19af125f5ccf2dfd13ad8e7$ 11040+// $hash=2a64ff6edd81d5158997158c91e75b85dbd8da39$ 11041 // 11042 11043 #ifndef CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ 11044diff --git a/src/cef/libcef_dll/cpptoc/download_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/download_handler_cpptoc.cc 11045index 8c2aa1f202ce9..5354bf29bd782 11046--- a/src/cef/libcef_dll/cpptoc/download_handler_cpptoc.cc 11047+++ b/src/cef/libcef_dll/cpptoc/download_handler_cpptoc.cc 11048@@ -1,4 +1,4 @@ 11049-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11050+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11051 // reserved. Use of this source code is governed by a BSD-style license that 11052 // can be found in the LICENSE file. 11053 // 11054@@ -9,7 +9,7 @@ 11055 // implementations. See the translator.README.txt file in the tools directory 11056 // for more information. 11057 // 11058-// $hash=496b226297ba7d5fa5e7e7bd4117c417e26fae59$ 11059+// $hash=ed4452d7a096e5dfbd091bbcaeac61f3851d943a$ 11060 // 11061 11062 #include "libcef_dll/cpptoc/download_handler_cpptoc.h" 11063diff --git a/src/cef/libcef_dll/cpptoc/download_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/download_handler_cpptoc.h 11064index cd7580f8ab4c0..1c1c6ddb9d6e8 11065--- a/src/cef/libcef_dll/cpptoc/download_handler_cpptoc.h 11066+++ b/src/cef/libcef_dll/cpptoc/download_handler_cpptoc.h 11067@@ -1,4 +1,4 @@ 11068-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11069+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11070 // reserved. Use of this source code is governed by a BSD-style license that 11071 // can be found in the LICENSE file. 11072 // 11073@@ -9,7 +9,7 @@ 11074 // implementations. See the translator.README.txt file in the tools directory 11075 // for more information. 11076 // 11077-// $hash=d8c8f94bad7ee32841d16658b106158880edb5e0$ 11078+// $hash=1b301493e2f905a2761858e2d6623765a540f918$ 11079 // 11080 11081 #ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ 11082diff --git a/src/cef/libcef_dll/cpptoc/download_image_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/download_image_callback_cpptoc.cc 11083index 9b31d1e29604d..528e44fa60bda 11084--- a/src/cef/libcef_dll/cpptoc/download_image_callback_cpptoc.cc 11085+++ b/src/cef/libcef_dll/cpptoc/download_image_callback_cpptoc.cc 11086@@ -1,4 +1,4 @@ 11087-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11088+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11089 // reserved. Use of this source code is governed by a BSD-style license that 11090 // can be found in the LICENSE file. 11091 // 11092@@ -9,7 +9,7 @@ 11093 // implementations. See the translator.README.txt file in the tools directory 11094 // for more information. 11095 // 11096-// $hash=9313088260606d8b5a57b7e75c1d37e724924a40$ 11097+// $hash=83a570d6d3a6b45d9d7502bbeba9e2e8fa726d0e$ 11098 // 11099 11100 #include "libcef_dll/cpptoc/download_image_callback_cpptoc.h" 11101diff --git a/src/cef/libcef_dll/cpptoc/download_image_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/download_image_callback_cpptoc.h 11102index c7d6125bbb902..8e517c7cfaf23 11103--- a/src/cef/libcef_dll/cpptoc/download_image_callback_cpptoc.h 11104+++ b/src/cef/libcef_dll/cpptoc/download_image_callback_cpptoc.h 11105@@ -1,4 +1,4 @@ 11106-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11107+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11108 // reserved. Use of this source code is governed by a BSD-style license that 11109 // can be found in the LICENSE file. 11110 // 11111@@ -9,7 +9,7 @@ 11112 // implementations. See the translator.README.txt file in the tools directory 11113 // for more information. 11114 // 11115-// $hash=c5f83abc0a8e18b3f0c87d39f83df687dfff22e1$ 11116+// $hash=9a9250d7e4f3d2018c4b441e6616930627625b59$ 11117 // 11118 11119 #ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_IMAGE_CALLBACK_CPPTOC_H_ 11120diff --git a/src/cef/libcef_dll/cpptoc/download_item_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/download_item_callback_cpptoc.cc 11121index 7ef2878221aa1..11a34dabbdc4d 11122--- a/src/cef/libcef_dll/cpptoc/download_item_callback_cpptoc.cc 11123+++ b/src/cef/libcef_dll/cpptoc/download_item_callback_cpptoc.cc 11124@@ -1,4 +1,4 @@ 11125-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11126+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11127 // reserved. Use of this source code is governed by a BSD-style license that 11128 // can be found in the LICENSE file. 11129 // 11130@@ -9,7 +9,7 @@ 11131 // implementations. See the translator.README.txt file in the tools directory 11132 // for more information. 11133 // 11134-// $hash=7cb000dca30be501541fc16036c585a3cd6618cb$ 11135+// $hash=dad2dfff457e4c1ad5b2a8722f79b5dd74bc5448$ 11136 // 11137 11138 #include "libcef_dll/cpptoc/download_item_callback_cpptoc.h" 11139diff --git a/src/cef/libcef_dll/cpptoc/download_item_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/download_item_callback_cpptoc.h 11140index bd9dec4ef2e23..858baa2fc70f2 11141--- a/src/cef/libcef_dll/cpptoc/download_item_callback_cpptoc.h 11142+++ b/src/cef/libcef_dll/cpptoc/download_item_callback_cpptoc.h 11143@@ -1,4 +1,4 @@ 11144-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11145+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11146 // reserved. Use of this source code is governed by a BSD-style license that 11147 // can be found in the LICENSE file. 11148 // 11149@@ -9,7 +9,7 @@ 11150 // implementations. See the translator.README.txt file in the tools directory 11151 // for more information. 11152 // 11153-// $hash=d0baa6c264292da99e5c909d18450486435c9a8e$ 11154+// $hash=1c85860b0d21f2efc1610ed47af70ed570f63926$ 11155 // 11156 11157 #ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CALLBACK_CPPTOC_H_ 11158diff --git a/src/cef/libcef_dll/cpptoc/download_item_cpptoc.cc b/src/cef/libcef_dll/cpptoc/download_item_cpptoc.cc 11159index 357d285c90744..c41dd1e51959c 11160--- a/src/cef/libcef_dll/cpptoc/download_item_cpptoc.cc 11161+++ b/src/cef/libcef_dll/cpptoc/download_item_cpptoc.cc 11162@@ -1,4 +1,4 @@ 11163-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11164+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11165 // reserved. Use of this source code is governed by a BSD-style license that 11166 // can be found in the LICENSE file. 11167 // 11168@@ -9,7 +9,7 @@ 11169 // implementations. See the translator.README.txt file in the tools directory 11170 // for more information. 11171 // 11172-// $hash=64b3cee6b2de98140a1dc6f6aabff6b2c4ac7d78$ 11173+// $hash=86d4cf7d9ddcc2e20f09a6a7270b376e7de4fef8$ 11174 // 11175 11176 #include "libcef_dll/cpptoc/download_item_cpptoc.h" 11177diff --git a/src/cef/libcef_dll/cpptoc/download_item_cpptoc.h b/src/cef/libcef_dll/cpptoc/download_item_cpptoc.h 11178index 559b6c8f2d77d..dcf26cfd75389 11179--- a/src/cef/libcef_dll/cpptoc/download_item_cpptoc.h 11180+++ b/src/cef/libcef_dll/cpptoc/download_item_cpptoc.h 11181@@ -1,4 +1,4 @@ 11182-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11183+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11184 // reserved. Use of this source code is governed by a BSD-style license that 11185 // can be found in the LICENSE file. 11186 // 11187@@ -9,7 +9,7 @@ 11188 // implementations. See the translator.README.txt file in the tools directory 11189 // for more information. 11190 // 11191-// $hash=72609007d48530320ae4a0f210c4604108d896d9$ 11192+// $hash=3817a67cd4da8a318fe118f775a86a3daa22af67$ 11193 // 11194 11195 #ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CPPTOC_H_ 11196diff --git a/src/cef/libcef_dll/cpptoc/drag_data_cpptoc.cc b/src/cef/libcef_dll/cpptoc/drag_data_cpptoc.cc 11197index 6e682e5d89603..7bf1d73f280c4 11198--- a/src/cef/libcef_dll/cpptoc/drag_data_cpptoc.cc 11199+++ b/src/cef/libcef_dll/cpptoc/drag_data_cpptoc.cc 11200@@ -1,4 +1,4 @@ 11201-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11202+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11203 // reserved. Use of this source code is governed by a BSD-style license that 11204 // can be found in the LICENSE file. 11205 // 11206@@ -9,7 +9,7 @@ 11207 // implementations. See the translator.README.txt file in the tools directory 11208 // for more information. 11209 // 11210-// $hash=2a39ab30ca26c5c63ce557b31f86a5557cd96ebc$ 11211+// $hash=6fbfc46d229413699c26e2e8d669e04c5ce776b1$ 11212 // 11213 11214 #include "libcef_dll/cpptoc/drag_data_cpptoc.h" 11215diff --git a/src/cef/libcef_dll/cpptoc/drag_data_cpptoc.h b/src/cef/libcef_dll/cpptoc/drag_data_cpptoc.h 11216index fbeafd07458a8..1628e094b1bad 11217--- a/src/cef/libcef_dll/cpptoc/drag_data_cpptoc.h 11218+++ b/src/cef/libcef_dll/cpptoc/drag_data_cpptoc.h 11219@@ -1,4 +1,4 @@ 11220-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11221+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11222 // reserved. Use of this source code is governed by a BSD-style license that 11223 // can be found in the LICENSE file. 11224 // 11225@@ -9,7 +9,7 @@ 11226 // implementations. See the translator.README.txt file in the tools directory 11227 // for more information. 11228 // 11229-// $hash=c267ab21bb2e49ecade7ba3c7545003d7e072373$ 11230+// $hash=4ce3b8cfc691f8cb7aa224a00d7835283c5039ab$ 11231 // 11232 11233 #ifndef CEF_LIBCEF_DLL_CPPTOC_DRAG_DATA_CPPTOC_H_ 11234diff --git a/src/cef/libcef_dll/cpptoc/drag_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/drag_handler_cpptoc.cc 11235index 833c0cbeef279..88fe5e93d4c3d 11236--- a/src/cef/libcef_dll/cpptoc/drag_handler_cpptoc.cc 11237+++ b/src/cef/libcef_dll/cpptoc/drag_handler_cpptoc.cc 11238@@ -1,4 +1,4 @@ 11239-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11240+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11241 // reserved. Use of this source code is governed by a BSD-style license that 11242 // can be found in the LICENSE file. 11243 // 11244@@ -9,7 +9,7 @@ 11245 // implementations. See the translator.README.txt file in the tools directory 11246 // for more information. 11247 // 11248-// $hash=53febc1355422739c9de942f67f52fb4de462571$ 11249+// $hash=7569af91eb9b0d7bc5af403a6733d06ada294955$ 11250 // 11251 11252 #include "libcef_dll/cpptoc/drag_handler_cpptoc.h" 11253diff --git a/src/cef/libcef_dll/cpptoc/drag_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/drag_handler_cpptoc.h 11254index 865b8c94a9f99..e8f136b923d6a 11255--- a/src/cef/libcef_dll/cpptoc/drag_handler_cpptoc.h 11256+++ b/src/cef/libcef_dll/cpptoc/drag_handler_cpptoc.h 11257@@ -1,4 +1,4 @@ 11258-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11259+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11260 // reserved. Use of this source code is governed by a BSD-style license that 11261 // can be found in the LICENSE file. 11262 // 11263@@ -9,7 +9,7 @@ 11264 // implementations. See the translator.README.txt file in the tools directory 11265 // for more information. 11266 // 11267-// $hash=39ab6f4e1f88efb2d726995d7075c904e11091e6$ 11268+// $hash=9d82217b402aa41686392b0ba81169f4b41035e7$ 11269 // 11270 11271 #ifndef CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ 11272diff --git a/src/cef/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc 11273index efc5b12922865..3627ce4c13e77 11274--- a/src/cef/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc 11275+++ b/src/cef/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc 11276@@ -1,4 +1,4 @@ 11277-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11278+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11279 // reserved. Use of this source code is governed by a BSD-style license that 11280 // can be found in the LICENSE file. 11281 // 11282@@ -9,7 +9,7 @@ 11283 // implementations. See the translator.README.txt file in the tools directory 11284 // for more information. 11285 // 11286-// $hash=67836a9b2dfec98cab93231cb7e07ca2b9696123$ 11287+// $hash=d1cdc1747a3caa4b8aa4cc385c1164bc066bbefb$ 11288 // 11289 11290 #include "libcef_dll/cpptoc/end_tracing_callback_cpptoc.h" 11291diff --git a/src/cef/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h 11292index 89668d4d525a5..c6291697f7ea8 11293--- a/src/cef/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h 11294+++ b/src/cef/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h 11295@@ -1,4 +1,4 @@ 11296-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11297+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11298 // reserved. Use of this source code is governed by a BSD-style license that 11299 // can be found in the LICENSE file. 11300 // 11301@@ -9,7 +9,7 @@ 11302 // implementations. See the translator.README.txt file in the tools directory 11303 // for more information. 11304 // 11305-// $hash=0769e0fec9a6f3c0e33d35b23ebf1bec4a205844$ 11306+// $hash=81dc12ded9752671497f775c397ca120632c4ddb$ 11307 // 11308 11309 #ifndef CEF_LIBCEF_DLL_CPPTOC_END_TRACING_CALLBACK_CPPTOC_H_ 11310diff --git a/src/cef/libcef_dll/cpptoc/extension_cpptoc.cc b/src/cef/libcef_dll/cpptoc/extension_cpptoc.cc 11311index f601bb51c6c3a..7edf7b9111be8 11312--- a/src/cef/libcef_dll/cpptoc/extension_cpptoc.cc 11313+++ b/src/cef/libcef_dll/cpptoc/extension_cpptoc.cc 11314@@ -1,4 +1,4 @@ 11315-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11316+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11317 // reserved. Use of this source code is governed by a BSD-style license that 11318 // can be found in the LICENSE file. 11319 // 11320@@ -9,7 +9,7 @@ 11321 // implementations. See the translator.README.txt file in the tools directory 11322 // for more information. 11323 // 11324-// $hash=5ae76b861609dc9f1b0d033dcebf514d8ef68a57$ 11325+// $hash=e62a7361febcdb3a9608051a0e4902a571e94ebc$ 11326 // 11327 11328 #include "libcef_dll/cpptoc/extension_cpptoc.h" 11329diff --git a/src/cef/libcef_dll/cpptoc/extension_cpptoc.h b/src/cef/libcef_dll/cpptoc/extension_cpptoc.h 11330index f2c06267c08f1..32eca73369ccd 11331--- a/src/cef/libcef_dll/cpptoc/extension_cpptoc.h 11332+++ b/src/cef/libcef_dll/cpptoc/extension_cpptoc.h 11333@@ -1,4 +1,4 @@ 11334-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11335+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11336 // reserved. Use of this source code is governed by a BSD-style license that 11337 // can be found in the LICENSE file. 11338 // 11339@@ -9,7 +9,7 @@ 11340 // implementations. See the translator.README.txt file in the tools directory 11341 // for more information. 11342 // 11343-// $hash=46725937bd7ba35ca8ea8fb2d1bbdeac0c53dc80$ 11344+// $hash=924265d65cc81f721d9757d8b4a325260e1848d1$ 11345 // 11346 11347 #ifndef CEF_LIBCEF_DLL_CPPTOC_EXTENSION_CPPTOC_H_ 11348diff --git a/src/cef/libcef_dll/cpptoc/extension_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/extension_handler_cpptoc.cc 11349index 2aaccfbc5a858..93241efc0f1dd 11350--- a/src/cef/libcef_dll/cpptoc/extension_handler_cpptoc.cc 11351+++ b/src/cef/libcef_dll/cpptoc/extension_handler_cpptoc.cc 11352@@ -1,4 +1,4 @@ 11353-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11354+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11355 // reserved. Use of this source code is governed by a BSD-style license that 11356 // can be found in the LICENSE file. 11357 // 11358@@ -9,7 +9,7 @@ 11359 // implementations. See the translator.README.txt file in the tools directory 11360 // for more information. 11361 // 11362-// $hash=7cdd0564d9b129bf9f068764d4d1588645445d5b$ 11363+// $hash=d75d766c210dd2b55be991f962651b25047a14cf$ 11364 // 11365 11366 #include "libcef_dll/cpptoc/extension_handler_cpptoc.h" 11367diff --git a/src/cef/libcef_dll/cpptoc/extension_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/extension_handler_cpptoc.h 11368index fc3ff5d6a6603..13b489be281be 11369--- a/src/cef/libcef_dll/cpptoc/extension_handler_cpptoc.h 11370+++ b/src/cef/libcef_dll/cpptoc/extension_handler_cpptoc.h 11371@@ -1,4 +1,4 @@ 11372-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11373+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11374 // reserved. Use of this source code is governed by a BSD-style license that 11375 // can be found in the LICENSE file. 11376 // 11377@@ -9,7 +9,7 @@ 11378 // implementations. See the translator.README.txt file in the tools directory 11379 // for more information. 11380 // 11381-// $hash=b695266a9c10c4fc0b68f96b64a77cc5c0235827$ 11382+// $hash=db012b196983395c9684bf1275b638e9ccc57949$ 11383 // 11384 11385 #ifndef CEF_LIBCEF_DLL_CPPTOC_EXTENSION_HANDLER_CPPTOC_H_ 11386diff --git a/src/cef/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc 11387index 7a4bdbcf8d67f..8b5d6fb273cac 11388--- a/src/cef/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc 11389+++ b/src/cef/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc 11390@@ -1,4 +1,4 @@ 11391-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11392+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11393 // reserved. Use of this source code is governed by a BSD-style license that 11394 // can be found in the LICENSE file. 11395 // 11396@@ -9,7 +9,7 @@ 11397 // implementations. See the translator.README.txt file in the tools directory 11398 // for more information. 11399 // 11400-// $hash=d334e579f498ad7727721dfe4e10ad810b81035a$ 11401+// $hash=d226e92e69207d76675dc52b7ab5f4e68262ee7d$ 11402 // 11403 11404 #include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h" 11405diff --git a/src/cef/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h 11406index 046c02aa5f1a6..f0a754b929746 11407--- a/src/cef/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h 11408+++ b/src/cef/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h 11409@@ -1,4 +1,4 @@ 11410-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11411+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11412 // reserved. Use of this source code is governed by a BSD-style license that 11413 // can be found in the LICENSE file. 11414 // 11415@@ -9,7 +9,7 @@ 11416 // implementations. See the translator.README.txt file in the tools directory 11417 // for more information. 11418 // 11419-// $hash=2b6c5e5bd0bb44f1c916b317bccb0e0794c28f91$ 11420+// $hash=2db275ca5be351037a0e19531fb2ed4c3af4498d$ 11421 // 11422 11423 #ifndef CEF_LIBCEF_DLL_CPPTOC_FILE_DIALOG_CALLBACK_CPPTOC_H_ 11424diff --git a/src/cef/libcef_dll/cpptoc/find_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/find_handler_cpptoc.cc 11425index 7130f8058dc2e..2d71f4f000420 11426--- a/src/cef/libcef_dll/cpptoc/find_handler_cpptoc.cc 11427+++ b/src/cef/libcef_dll/cpptoc/find_handler_cpptoc.cc 11428@@ -1,4 +1,4 @@ 11429-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11430+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11431 // reserved. Use of this source code is governed by a BSD-style license that 11432 // can be found in the LICENSE file. 11433 // 11434@@ -9,7 +9,7 @@ 11435 // implementations. See the translator.README.txt file in the tools directory 11436 // for more information. 11437 // 11438-// $hash=022bd3d1f8fd0eb3de156647dd4f50d688747534$ 11439+// $hash=dec97de981cccf1e47dae36336011071a1a8e80b$ 11440 // 11441 11442 #include "libcef_dll/cpptoc/find_handler_cpptoc.h" 11443diff --git a/src/cef/libcef_dll/cpptoc/find_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/find_handler_cpptoc.h 11444index 0d2193718edb4..cf30c541ef2fa 11445--- a/src/cef/libcef_dll/cpptoc/find_handler_cpptoc.h 11446+++ b/src/cef/libcef_dll/cpptoc/find_handler_cpptoc.h 11447@@ -1,4 +1,4 @@ 11448-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11449+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11450 // reserved. Use of this source code is governed by a BSD-style license that 11451 // can be found in the LICENSE file. 11452 // 11453@@ -9,7 +9,7 @@ 11454 // implementations. See the translator.README.txt file in the tools directory 11455 // for more information. 11456 // 11457-// $hash=c6408d6714984291379f0113e7806cac21aee934$ 11458+// $hash=fd8c0866622e63f6564c0b00107ebcb0c82d60fe$ 11459 // 11460 11461 #ifndef CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_CPPTOC_H_ 11462diff --git a/src/cef/libcef_dll/cpptoc/focus_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/focus_handler_cpptoc.cc 11463index 2549edd6d6df0..43151b580fce6 11464--- a/src/cef/libcef_dll/cpptoc/focus_handler_cpptoc.cc 11465+++ b/src/cef/libcef_dll/cpptoc/focus_handler_cpptoc.cc 11466@@ -1,4 +1,4 @@ 11467-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11468+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11469 // reserved. Use of this source code is governed by a BSD-style license that 11470 // can be found in the LICENSE file. 11471 // 11472@@ -9,7 +9,7 @@ 11473 // implementations. See the translator.README.txt file in the tools directory 11474 // for more information. 11475 // 11476-// $hash=6d554e767e9e5eea0d9caefba61e35fbe4fff231$ 11477+// $hash=baed9b712645a466ab9c52ae814f31eb10c0ef3b$ 11478 // 11479 11480 #include "libcef_dll/cpptoc/focus_handler_cpptoc.h" 11481diff --git a/src/cef/libcef_dll/cpptoc/focus_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/focus_handler_cpptoc.h 11482index d384176fe8eea..1dc59c421bfde 11483--- a/src/cef/libcef_dll/cpptoc/focus_handler_cpptoc.h 11484+++ b/src/cef/libcef_dll/cpptoc/focus_handler_cpptoc.h 11485@@ -1,4 +1,4 @@ 11486-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11487+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11488 // reserved. Use of this source code is governed by a BSD-style license that 11489 // can be found in the LICENSE file. 11490 // 11491@@ -9,7 +9,7 @@ 11492 // implementations. See the translator.README.txt file in the tools directory 11493 // for more information. 11494 // 11495-// $hash=def50c909d368ef1d03f1932f2b0283c3cbf8165$ 11496+// $hash=b4e1894b64083f0045302da4840abf664c5a2429$ 11497 // 11498 11499 #ifndef CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ 11500diff --git a/src/cef/libcef_dll/cpptoc/frame_cpptoc.cc b/src/cef/libcef_dll/cpptoc/frame_cpptoc.cc 11501index 9c3a4a4fdd9f5..3661e43c0fb85 11502--- a/src/cef/libcef_dll/cpptoc/frame_cpptoc.cc 11503+++ b/src/cef/libcef_dll/cpptoc/frame_cpptoc.cc 11504@@ -1,4 +1,4 @@ 11505-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11506+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11507 // reserved. Use of this source code is governed by a BSD-style license that 11508 // can be found in the LICENSE file. 11509 // 11510@@ -9,7 +9,7 @@ 11511 // implementations. See the translator.README.txt file in the tools directory 11512 // for more information. 11513 // 11514-// $hash=e94035efbcc27884df78e43f4540ac38002c01e7$ 11515+// $hash=ebf943663fb2988ca0b2a0cd40d4dea389678604$ 11516 // 11517 11518 #include "libcef_dll/cpptoc/frame_cpptoc.h" 11519@@ -19,6 +19,7 @@ 11520 #include "libcef_dll/cpptoc/urlrequest_cpptoc.h" 11521 #include "libcef_dll/cpptoc/v8context_cpptoc.h" 11522 #include "libcef_dll/ctocpp/domvisitor_ctocpp.h" 11523+#include "libcef_dll/ctocpp/get_images_callback_ctocpp.h" 11524 #include "libcef_dll/ctocpp/string_visitor_ctocpp.h" 11525 #include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h" 11526 #include "libcef_dll/shutdown_checker.h" 11527@@ -457,6 +458,26 @@ frame_send_process_message(struct _cef_frame_t* self, 11528 target_process, CefProcessMessageCppToC::Unwrap(message)); 11529 } 11530 11531+void CEF_CALLBACK 11532+frame_get_images(struct _cef_frame_t* self, 11533+ struct _cef_get_images_callback_t* callback) { 11534+ shutdown_checker::AssertNotShutdown(); 11535+ 11536+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 11537+ 11538+ DCHECK(self); 11539+ if (!self) 11540+ return; 11541+ // Verify param: callback; type: refptr_diff 11542+ DCHECK(callback); 11543+ if (!callback) 11544+ return; 11545+ 11546+ // Execute 11547+ CefFrameCppToC::Get(self)->GetImages( 11548+ CefGetImagesCallbackCToCpp::Wrap(callback)); 11549+} 11550+ 11551 } // namespace 11552 11553 // CONSTRUCTOR - Do not edit by hand. 11554@@ -488,6 +509,7 @@ CefFrameCppToC::CefFrameCppToC() { 11555 GetStruct()->load_header_url = frame_load_header_url; 11556 GetStruct()->create_urlrequest = frame_create_urlrequest; 11557 GetStruct()->send_process_message = frame_send_process_message; 11558+ GetStruct()->get_images = frame_get_images; 11559 } 11560 11561 // DESTRUCTOR - Do not edit by hand. 11562diff --git a/src/cef/libcef_dll/cpptoc/frame_cpptoc.h b/src/cef/libcef_dll/cpptoc/frame_cpptoc.h 11563index 3e1e27fe923f4..dab946904c7aa 11564--- a/src/cef/libcef_dll/cpptoc/frame_cpptoc.h 11565+++ b/src/cef/libcef_dll/cpptoc/frame_cpptoc.h 11566@@ -1,4 +1,4 @@ 11567-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11568+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11569 // reserved. Use of this source code is governed by a BSD-style license that 11570 // can be found in the LICENSE file. 11571 // 11572@@ -9,7 +9,7 @@ 11573 // implementations. See the translator.README.txt file in the tools directory 11574 // for more information. 11575 // 11576-// $hash=5154f627049509d38f098549ea08fb26a0712963$ 11577+// $hash=e2af583c7a4b0b6b071e9e96ce8645375902673d$ 11578 // 11579 11580 #ifndef CEF_LIBCEF_DLL_CPPTOC_FRAME_CPPTOC_H_ 11581diff --git a/src/cef/libcef_dll/cpptoc/frame_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/frame_handler_cpptoc.cc 11582index 4fabd048f513c..40f490cb84be1 11583--- a/src/cef/libcef_dll/cpptoc/frame_handler_cpptoc.cc 11584+++ b/src/cef/libcef_dll/cpptoc/frame_handler_cpptoc.cc 11585@@ -1,4 +1,4 @@ 11586-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11587+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11588 // reserved. Use of this source code is governed by a BSD-style license that 11589 // can be found in the LICENSE file. 11590 // 11591@@ -9,7 +9,7 @@ 11592 // implementations. See the translator.README.txt file in the tools directory 11593 // for more information. 11594 // 11595-// $hash=276f4b15ecef989b38c2a6dd9cac5be7df5cb844$ 11596+// $hash=92d9c5512725c0532baa33ab9f324f18af40a641$ 11597 // 11598 11599 #include "libcef_dll/cpptoc/frame_handler_cpptoc.h" 11600diff --git a/src/cef/libcef_dll/cpptoc/frame_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/frame_handler_cpptoc.h 11601index 4310ea47b3d93..c553a2dd73ab1 11602--- a/src/cef/libcef_dll/cpptoc/frame_handler_cpptoc.h 11603+++ b/src/cef/libcef_dll/cpptoc/frame_handler_cpptoc.h 11604@@ -1,4 +1,4 @@ 11605-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11606+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11607 // reserved. Use of this source code is governed by a BSD-style license that 11608 // can be found in the LICENSE file. 11609 // 11610@@ -9,7 +9,7 @@ 11611 // implementations. See the translator.README.txt file in the tools directory 11612 // for more information. 11613 // 11614-// $hash=d0f6aac72a7795b0221831ffe475fa8b5062ab1a$ 11615+// $hash=72b035624f1edff425da000635d111f72186fffc$ 11616 // 11617 11618 #ifndef CEF_LIBCEF_DLL_CPPTOC_FRAME_HANDLER_CPPTOC_H_ 11619diff --git a/src/cef/libcef_dll/cpptoc/geolocation_acess_cpptoc.cc b/src/cef/libcef_dll/cpptoc/geolocation_acess_cpptoc.cc 11620index da6eb4aac594a..00a9414934b6f 11621--- a/src/cef/libcef_dll/cpptoc/geolocation_acess_cpptoc.cc 11622+++ b/src/cef/libcef_dll/cpptoc/geolocation_acess_cpptoc.cc 11623@@ -1,4 +1,4 @@ 11624-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11625+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11626 // reserved. Use of this source code is governed by a BSD-style license that 11627 // can be found in the LICENSE file. 11628 // 11629@@ -9,7 +9,7 @@ 11630 // implementations. See the translator.README.txt file in the tools directory 11631 // for more information. 11632 // 11633-// $hash=a21b3afd08841726e90bdc044e0dd0d22b277264$ 11634+// $hash=901fb04c00bd650e2e0bdff347fdd3ad460f5a21$ 11635 // 11636 11637 #include "libcef_dll/cpptoc/geolocation_acess_cpptoc.h" 11638diff --git a/src/cef/libcef_dll/cpptoc/geolocation_acess_cpptoc.h b/src/cef/libcef_dll/cpptoc/geolocation_acess_cpptoc.h 11639index 97b335d034aec..f2ab7de54a655 11640--- a/src/cef/libcef_dll/cpptoc/geolocation_acess_cpptoc.h 11641+++ b/src/cef/libcef_dll/cpptoc/geolocation_acess_cpptoc.h 11642@@ -1,4 +1,4 @@ 11643-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11644+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11645 // reserved. Use of this source code is governed by a BSD-style license that 11646 // can be found in the LICENSE file. 11647 // 11648@@ -9,7 +9,7 @@ 11649 // implementations. See the translator.README.txt file in the tools directory 11650 // for more information. 11651 // 11652-// $hash=42966754a9927c84debb6edfd37f8c41873ee268$ 11653+// $hash=66a1438642f8ff3dd315b9535336be8d6b2c3e99$ 11654 // 11655 11656 #ifndef CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_ACESS_CPPTOC_H_ 11657diff --git a/src/cef/libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.cc 11658index 4aeb4e9714070..3984352b69d80 11659--- a/src/cef/libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.cc 11660+++ b/src/cef/libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.cc 11661@@ -1,4 +1,4 @@ 11662-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11663+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11664 // reserved. Use of this source code is governed by a BSD-style license that 11665 // can be found in the LICENSE file. 11666 // 11667@@ -9,7 +9,7 @@ 11668 // implementations. See the translator.README.txt file in the tools directory 11669 // for more information. 11670 // 11671-// $hash=3f24789c79862889b5a0454c743bf70f71a98faf$ 11672+// $hash=b129eeac4e3e5ce621b58018d7516127f7a85aed$ 11673 // 11674 11675 #include "libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h" 11676diff --git a/src/cef/libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h 11677index 3ed16a181a54f..0056536b211aa 11678--- a/src/cef/libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h 11679+++ b/src/cef/libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h 11680@@ -1,4 +1,4 @@ 11681-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11682+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11683 // reserved. Use of this source code is governed by a BSD-style license that 11684 // can be found in the LICENSE file. 11685 // 11686@@ -9,7 +9,7 @@ 11687 // implementations. See the translator.README.txt file in the tools directory 11688 // for more information. 11689 // 11690-// $hash=8e0f89043319ecad378af6125bd4fcdbd8bdd34e$ 11691+// $hash=76b58a0d3f719bb4899c87ec701d89a96a45ae31$ 11692 // 11693 11694 #ifndef CEF_LIBCEF_DLL_CPPTOC_GET_EXTENSION_RESOURCE_CALLBACK_CPPTOC_H_ 11695diff --git a/src/cef/libcef_dll/cpptoc/get_images_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/get_images_callback_cpptoc.cc 11696new file mode 100644 11697index 0000000000000..c0efd5b4bdbb4 11698--- /dev/null 11699+++ b/src/cef/libcef_dll/cpptoc/get_images_callback_cpptoc.cc 11700@@ -0,0 +1,65 @@ 11701+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11702+// reserved. Use of this source code is governed by a BSD-style license that 11703+// can be found in the LICENSE file. 11704+// 11705+// --------------------------------------------------------------------------- 11706+// 11707+// This file was generated by the CEF translator tool. If making changes by 11708+// hand only do so within the body of existing method and function 11709+// implementations. See the translator.README.txt file in the tools directory 11710+// for more information. 11711+// 11712+// $hash=c8fcd18ac761a259a3dc23799f2b7ca3863b2ff2$ 11713+// 11714+ 11715+#include "libcef_dll/cpptoc/get_images_callback_cpptoc.h" 11716+#include "libcef_dll/shutdown_checker.h" 11717+ 11718+namespace { 11719+ 11720+// MEMBER FUNCTIONS - Body may be edited by hand. 11721+ 11722+void CEF_CALLBACK 11723+get_images_callback_get_images(struct _cef_get_images_callback_t* self, 11724+ int response) { 11725+ shutdown_checker::AssertNotShutdown(); 11726+ 11727+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 11728+ 11729+ DCHECK(self); 11730+ if (!self) 11731+ return; 11732+ 11733+ // Execute 11734+ CefGetImagesCallbackCppToC::Get(self)->GetImages(response ? true : false); 11735+} 11736+ 11737+} // namespace 11738+ 11739+// CONSTRUCTOR - Do not edit by hand. 11740+ 11741+CefGetImagesCallbackCppToC::CefGetImagesCallbackCppToC() { 11742+ GetStruct()->get_images = get_images_callback_get_images; 11743+} 11744+ 11745+// DESTRUCTOR - Do not edit by hand. 11746+ 11747+CefGetImagesCallbackCppToC::~CefGetImagesCallbackCppToC() { 11748+ shutdown_checker::AssertNotShutdown(); 11749+} 11750+ 11751+template <> 11752+CefRefPtr<CefGetImagesCallback> CefCppToCRefCounted< 11753+ CefGetImagesCallbackCppToC, 11754+ CefGetImagesCallback, 11755+ cef_get_images_callback_t>::UnwrapDerived(CefWrapperType type, 11756+ cef_get_images_callback_t* s) { 11757+ NOTREACHED() << "Unexpected class type: " << type; 11758+ return nullptr; 11759+} 11760+ 11761+template <> 11762+CefWrapperType CefCppToCRefCounted<CefGetImagesCallbackCppToC, 11763+ CefGetImagesCallback, 11764+ cef_get_images_callback_t>::kWrapperType = 11765+ WT_GET_IMAGES_CALLBACK; 11766diff --git a/src/cef/libcef_dll/cpptoc/get_images_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/get_images_callback_cpptoc.h 11767new file mode 100644 11768index 0000000000000..27cc93f4eaeef 11769--- /dev/null 11770+++ b/src/cef/libcef_dll/cpptoc/get_images_callback_cpptoc.h 11771@@ -0,0 +1,44 @@ 11772+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11773+// reserved. Use of this source code is governed by a BSD-style license that 11774+// can be found in the LICENSE file. 11775+// 11776+// --------------------------------------------------------------------------- 11777+// 11778+// This file was generated by the CEF translator tool. If making changes by 11779+// hand only do so within the body of existing method and function 11780+// implementations. See the translator.README.txt file in the tools directory 11781+// for more information. 11782+// 11783+// $hash=d5b18c7be26bf71b47bb68718126ef89fad457d3$ 11784+// 11785+ 11786+#ifndef CEF_LIBCEF_DLL_CPPTOC_GET_IMAGES_CALLBACK_CPPTOC_H_ 11787+#define CEF_LIBCEF_DLL_CPPTOC_GET_IMAGES_CALLBACK_CPPTOC_H_ 11788+#pragma once 11789+ 11790+#if !defined(WRAPPING_CEF_SHARED) 11791+#error This file can be included wrapper-side only 11792+#endif 11793+ 11794+#include "include/capi/cef_browser_capi.h" 11795+#include "include/capi/cef_frame_capi.h" 11796+#include "include/capi/cef_urlrequest_capi.h" 11797+#include "include/capi/cef_v8_capi.h" 11798+#include "include/cef_browser.h" 11799+#include "include/cef_frame.h" 11800+#include "include/cef_urlrequest.h" 11801+#include "include/cef_v8.h" 11802+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h" 11803+ 11804+// Wrap a C++ class with a C structure. 11805+// This class may be instantiated and accessed wrapper-side only. 11806+class CefGetImagesCallbackCppToC 11807+ : public CefCppToCRefCounted<CefGetImagesCallbackCppToC, 11808+ CefGetImagesCallback, 11809+ cef_get_images_callback_t> { 11810+ public: 11811+ CefGetImagesCallbackCppToC(); 11812+ virtual ~CefGetImagesCallbackCppToC(); 11813+}; 11814+ 11815+#endif // CEF_LIBCEF_DLL_CPPTOC_GET_IMAGES_CALLBACK_CPPTOC_H_ 11816diff --git a/src/cef/libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.cc 11817index 3876dba9e89e8..5ebe55e7b640b 11818--- a/src/cef/libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.cc 11819+++ b/src/cef/libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.cc 11820@@ -1,4 +1,4 @@ 11821-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11822+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11823 // reserved. Use of this source code is governed by a BSD-style license that 11824 // can be found in the LICENSE file. 11825 // 11826@@ -9,7 +9,7 @@ 11827 // implementations. See the translator.README.txt file in the tools directory 11828 // for more information. 11829 // 11830-// $hash=8c21d39cfec72fe99c8317906941d00cd3cbf0d0$ 11831+// $hash=4bf000010f6c757be8d561c82ebc8c6142f31a3d$ 11832 // 11833 11834 #include "libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.h" 11835diff --git a/src/cef/libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.h 11836index 4d219961ba523..97fdb9f9ec701 11837--- a/src/cef/libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.h 11838+++ b/src/cef/libcef_dll/cpptoc/get_origin_usage_or_quota_callback_cpptoc.h 11839@@ -1,4 +1,4 @@ 11840-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11841+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11842 // reserved. Use of this source code is governed by a BSD-style license that 11843 // can be found in the LICENSE file. 11844 // 11845@@ -9,7 +9,7 @@ 11846 // implementations. See the translator.README.txt file in the tools directory 11847 // for more information. 11848 // 11849-// $hash=6ba873fdbcca40051dd14bd26bc4a4c7a8999b5f$ 11850+// $hash=79d42142140e6b820264a3d723ee0f1ffa1747f2$ 11851 // 11852 11853 #ifndef CEF_LIBCEF_DLL_CPPTOC_GET_ORIGIN_USAGE_OR_QUOTA_CALLBACK_CPPTOC_H_ 11854diff --git a/src/cef/libcef_dll/cpptoc/get_origins_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/get_origins_callback_cpptoc.cc 11855index 66d66ad674fe3..f1c6c5bb7d12c 11856--- a/src/cef/libcef_dll/cpptoc/get_origins_callback_cpptoc.cc 11857+++ b/src/cef/libcef_dll/cpptoc/get_origins_callback_cpptoc.cc 11858@@ -1,4 +1,4 @@ 11859-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11860+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11861 // reserved. Use of this source code is governed by a BSD-style license that 11862 // can be found in the LICENSE file. 11863 // 11864@@ -9,7 +9,7 @@ 11865 // implementations. See the translator.README.txt file in the tools directory 11866 // for more information. 11867 // 11868-// $hash=aff05076c3fad1702ba17a27a4e4713ae1593596$ 11869+// $hash=c2fd30c49290abe08881da439bab727b9504b3da$ 11870 // 11871 11872 #include "libcef_dll/cpptoc/get_origins_callback_cpptoc.h" 11873diff --git a/src/cef/libcef_dll/cpptoc/get_origins_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/get_origins_callback_cpptoc.h 11874index d5318c9e17e80..5f09c5b4ad923 11875--- a/src/cef/libcef_dll/cpptoc/get_origins_callback_cpptoc.h 11876+++ b/src/cef/libcef_dll/cpptoc/get_origins_callback_cpptoc.h 11877@@ -1,4 +1,4 @@ 11878-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11879+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11880 // reserved. Use of this source code is governed by a BSD-style license that 11881 // can be found in the LICENSE file. 11882 // 11883@@ -9,7 +9,7 @@ 11884 // implementations. See the translator.README.txt file in the tools directory 11885 // for more information. 11886 // 11887-// $hash=86239d3281ad43ad93dcbe67a82a713044ab885d$ 11888+// $hash=a0d4dd8ca32ce2f249a5f36f798be8dfa594d25a$ 11889 // 11890 11891 #ifndef CEF_LIBCEF_DLL_CPPTOC_GET_ORIGINS_CALLBACK_CPPTOC_H_ 11892diff --git a/src/cef/libcef_dll/cpptoc/image_cpptoc.cc b/src/cef/libcef_dll/cpptoc/image_cpptoc.cc 11893index 81dc865b265bf..ca857bef796d0 11894--- a/src/cef/libcef_dll/cpptoc/image_cpptoc.cc 11895+++ b/src/cef/libcef_dll/cpptoc/image_cpptoc.cc 11896@@ -1,4 +1,4 @@ 11897-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11898+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11899 // reserved. Use of this source code is governed by a BSD-style license that 11900 // can be found in the LICENSE file. 11901 // 11902@@ -9,7 +9,7 @@ 11903 // implementations. See the translator.README.txt file in the tools directory 11904 // for more information. 11905 // 11906-// $hash=e9ee6df7e0e77e54dea7e2c1e4b24cdc88b79344$ 11907+// $hash=fce97ac2600da10ad5349abe49c2cf80aaa6b55d$ 11908 // 11909 11910 #include "libcef_dll/cpptoc/image_cpptoc.h" 11911diff --git a/src/cef/libcef_dll/cpptoc/image_cpptoc.h b/src/cef/libcef_dll/cpptoc/image_cpptoc.h 11912index acd84570c2669..3f63462f19aaf 11913--- a/src/cef/libcef_dll/cpptoc/image_cpptoc.h 11914+++ b/src/cef/libcef_dll/cpptoc/image_cpptoc.h 11915@@ -1,4 +1,4 @@ 11916-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11917+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11918 // reserved. Use of this source code is governed by a BSD-style license that 11919 // can be found in the LICENSE file. 11920 // 11921@@ -9,7 +9,7 @@ 11922 // implementations. See the translator.README.txt file in the tools directory 11923 // for more information. 11924 // 11925-// $hash=e82ca8d18a0367d4061f67afd33a8a486f338238$ 11926+// $hash=4ce026e90daa0a4d5d4be0baf1e8dbd3ede5974f$ 11927 // 11928 11929 #ifndef CEF_LIBCEF_DLL_CPPTOC_IMAGE_CPPTOC_H_ 11930diff --git a/src/cef/libcef_dll/cpptoc/java_script_result_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/java_script_result_callback_cpptoc.cc 11931index 1a0adf8512e6e..3ea3c17b15129 11932--- a/src/cef/libcef_dll/cpptoc/java_script_result_callback_cpptoc.cc 11933+++ b/src/cef/libcef_dll/cpptoc/java_script_result_callback_cpptoc.cc 11934@@ -1,4 +1,4 @@ 11935-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11936+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11937 // reserved. Use of this source code is governed by a BSD-style license that 11938 // can be found in the LICENSE file. 11939 // 11940@@ -9,7 +9,7 @@ 11941 // implementations. See the translator.README.txt file in the tools directory 11942 // for more information. 11943 // 11944-// $hash=b98959cda67200ef6a434297c5e9de53a2e948fb$ 11945+// $hash=98a8f58c5379ac345b36c7cde9ba25d31837447b$ 11946 // 11947 11948 #include "libcef_dll/cpptoc/java_script_result_callback_cpptoc.h" 11949diff --git a/src/cef/libcef_dll/cpptoc/java_script_result_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/java_script_result_callback_cpptoc.h 11950index 0f6e4290d339c..f029712a922ec 11951--- a/src/cef/libcef_dll/cpptoc/java_script_result_callback_cpptoc.h 11952+++ b/src/cef/libcef_dll/cpptoc/java_script_result_callback_cpptoc.h 11953@@ -1,4 +1,4 @@ 11954-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11955+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11956 // reserved. Use of this source code is governed by a BSD-style license that 11957 // can be found in the LICENSE file. 11958 // 11959@@ -9,7 +9,7 @@ 11960 // implementations. See the translator.README.txt file in the tools directory 11961 // for more information. 11962 // 11963-// $hash=fe951e9554ef1ba97fc78a2caac2f154497bde3f$ 11964+// $hash=d2e376ccc88d8547a4b4aca415a638f8b5fe6eab$ 11965 // 11966 11967 #ifndef CEF_LIBCEF_DLL_CPPTOC_JAVA_SCRIPT_RESULT_CALLBACK_CPPTOC_H_ 11968diff --git a/src/cef/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc 11969index 7b6b2d8d60db5..81a399101a90a 11970--- a/src/cef/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc 11971+++ b/src/cef/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc 11972@@ -1,4 +1,4 @@ 11973-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11974+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11975 // reserved. Use of this source code is governed by a BSD-style license that 11976 // can be found in the LICENSE file. 11977 // 11978@@ -9,7 +9,7 @@ 11979 // implementations. See the translator.README.txt file in the tools directory 11980 // for more information. 11981 // 11982-// $hash=8a66dc7024a4d368e8368b1be42deff60f4966dc$ 11983+// $hash=9486b9a33142d7af6d5635bef96621238ceadd5d$ 11984 // 11985 11986 #include "libcef_dll/cpptoc/jsdialog_callback_cpptoc.h" 11987diff --git a/src/cef/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h 11988index 1c6e3b5147fed..772ae287b6127 11989--- a/src/cef/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h 11990+++ b/src/cef/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h 11991@@ -1,4 +1,4 @@ 11992-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 11993+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 11994 // reserved. Use of this source code is governed by a BSD-style license that 11995 // can be found in the LICENSE file. 11996 // 11997@@ -9,7 +9,7 @@ 11998 // implementations. See the translator.README.txt file in the tools directory 11999 // for more information. 12000 // 12001-// $hash=5bc7b389cab53db3487532fbcae4ad156c814710$ 12002+// $hash=37aac75252a6f35a8abe927ca603849ce98ac1e1$ 12003 // 12004 12005 #ifndef CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_CALLBACK_CPPTOC_H_ 12006diff --git a/src/cef/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc 12007index 432323d8c3ab2..7148a942d24f4 12008--- a/src/cef/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc 12009+++ b/src/cef/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc 12010@@ -1,4 +1,4 @@ 12011-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12012+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12013 // reserved. Use of this source code is governed by a BSD-style license that 12014 // can be found in the LICENSE file. 12015 // 12016@@ -9,7 +9,7 @@ 12017 // implementations. See the translator.README.txt file in the tools directory 12018 // for more information. 12019 // 12020-// $hash=41c06df7feb0288f02c644bd633cce3f1754beba$ 12021+// $hash=93d039a400e46cc0b87bbab7a9b68b61e6dd6a66$ 12022 // 12023 12024 #include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h" 12025diff --git a/src/cef/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h 12026index d855c3a20e3b8..93f193d1db3de 12027--- a/src/cef/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h 12028+++ b/src/cef/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h 12029@@ -1,4 +1,4 @@ 12030-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12031+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12032 // reserved. Use of this source code is governed by a BSD-style license that 12033 // can be found in the LICENSE file. 12034 // 12035@@ -9,7 +9,7 @@ 12036 // implementations. See the translator.README.txt file in the tools directory 12037 // for more information. 12038 // 12039-// $hash=507a9b3192b98d0fad632714a8a4a4f97e5c19a3$ 12040+// $hash=c6a25a7ceb346f562302df398305f3d09a7c587d$ 12041 // 12042 12043 #ifndef CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ 12044diff --git a/src/cef/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc 12045index c9b7a0fa965ae..dd50c47adb2a7 12046--- a/src/cef/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc 12047+++ b/src/cef/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc 12048@@ -1,4 +1,4 @@ 12049-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12050+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12051 // reserved. Use of this source code is governed by a BSD-style license that 12052 // can be found in the LICENSE file. 12053 // 12054@@ -9,7 +9,7 @@ 12055 // implementations. See the translator.README.txt file in the tools directory 12056 // for more information. 12057 // 12058-// $hash=9f55775c0fcff5993efe9d8c9db75001d4335743$ 12059+// $hash=c1ff97a2d1992f704d02e1afc689a7d0b5426b6f$ 12060 // 12061 12062 #include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h" 12063diff --git a/src/cef/libcef_dll/cpptoc/keyboard_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/keyboard_handler_cpptoc.h 12064index 2d01998aa31aa..9ce294a166104 12065--- a/src/cef/libcef_dll/cpptoc/keyboard_handler_cpptoc.h 12066+++ b/src/cef/libcef_dll/cpptoc/keyboard_handler_cpptoc.h 12067@@ -1,4 +1,4 @@ 12068-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12069+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12070 // reserved. Use of this source code is governed by a BSD-style license that 12071 // can be found in the LICENSE file. 12072 // 12073@@ -9,7 +9,7 @@ 12074 // implementations. See the translator.README.txt file in the tools directory 12075 // for more information. 12076 // 12077-// $hash=5d3509b80dac95b50b7d3c7053562169055ad361$ 12078+// $hash=0798f508afacf2ed239982052247da9cd7f366e9$ 12079 // 12080 12081 #ifndef CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ 12082diff --git a/src/cef/libcef_dll/cpptoc/life_span_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/life_span_handler_cpptoc.cc 12083index d6f447c746260..ed436d9124b65 12084--- a/src/cef/libcef_dll/cpptoc/life_span_handler_cpptoc.cc 12085+++ b/src/cef/libcef_dll/cpptoc/life_span_handler_cpptoc.cc 12086@@ -1,4 +1,4 @@ 12087-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12088+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12089 // reserved. Use of this source code is governed by a BSD-style license that 12090 // can be found in the LICENSE file. 12091 // 12092@@ -9,7 +9,7 @@ 12093 // implementations. See the translator.README.txt file in the tools directory 12094 // for more information. 12095 // 12096-// $hash=46fab68760ab49b9a282aafb0e55d81de9cca943$ 12097+// $hash=402f069391e367a81c76fc24b1081e713acabcae$ 12098 // 12099 12100 #include "libcef_dll/cpptoc/life_span_handler_cpptoc.h" 12101diff --git a/src/cef/libcef_dll/cpptoc/life_span_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/life_span_handler_cpptoc.h 12102index 94eca4fb27d2c..531314a0f60b3 12103--- a/src/cef/libcef_dll/cpptoc/life_span_handler_cpptoc.h 12104+++ b/src/cef/libcef_dll/cpptoc/life_span_handler_cpptoc.h 12105@@ -1,4 +1,4 @@ 12106-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12107+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12108 // reserved. Use of this source code is governed by a BSD-style license that 12109 // can be found in the LICENSE file. 12110 // 12111@@ -9,7 +9,7 @@ 12112 // implementations. See the translator.README.txt file in the tools directory 12113 // for more information. 12114 // 12115-// $hash=85c8f684b4799cf1410174b0e29a41b192eaf7a4$ 12116+// $hash=74c66feec24c563e6f3f32230dcb0dbf45ed9350$ 12117 // 12118 12119 #ifndef CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ 12120diff --git a/src/cef/libcef_dll/cpptoc/list_value_cpptoc.cc b/src/cef/libcef_dll/cpptoc/list_value_cpptoc.cc 12121index db4fc4e9f1bdc..e3d7b6bab8392 12122--- a/src/cef/libcef_dll/cpptoc/list_value_cpptoc.cc 12123+++ b/src/cef/libcef_dll/cpptoc/list_value_cpptoc.cc 12124@@ -1,4 +1,4 @@ 12125-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12126+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12127 // reserved. Use of this source code is governed by a BSD-style license that 12128 // can be found in the LICENSE file. 12129 // 12130@@ -9,7 +9,7 @@ 12131 // implementations. See the translator.README.txt file in the tools directory 12132 // for more information. 12133 // 12134-// $hash=2d2041c7571bd613f92c2d80c100e92e7439df6e$ 12135+// $hash=b62e31a8e177869cf33c37c48d158802700a0080$ 12136 // 12137 12138 #include "libcef_dll/cpptoc/list_value_cpptoc.h" 12139diff --git a/src/cef/libcef_dll/cpptoc/list_value_cpptoc.h b/src/cef/libcef_dll/cpptoc/list_value_cpptoc.h 12140index 4385aa5c0cab8..3e7b9c5138a3a 12141--- a/src/cef/libcef_dll/cpptoc/list_value_cpptoc.h 12142+++ b/src/cef/libcef_dll/cpptoc/list_value_cpptoc.h 12143@@ -1,4 +1,4 @@ 12144-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12145+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12146 // reserved. Use of this source code is governed by a BSD-style license that 12147 // can be found in the LICENSE file. 12148 // 12149@@ -9,7 +9,7 @@ 12150 // implementations. See the translator.README.txt file in the tools directory 12151 // for more information. 12152 // 12153-// $hash=85db2149d4c843eae2145e9015c2062d8ad45695$ 12154+// $hash=bb4f6bacea8366b11d1526059c5ad4c3df495630$ 12155 // 12156 12157 #ifndef CEF_LIBCEF_DLL_CPPTOC_LIST_VALUE_CPPTOC_H_ 12158diff --git a/src/cef/libcef_dll/cpptoc/load_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/load_handler_cpptoc.cc 12159index e6a7312c38884..d27985a6a2c90 12160--- a/src/cef/libcef_dll/cpptoc/load_handler_cpptoc.cc 12161+++ b/src/cef/libcef_dll/cpptoc/load_handler_cpptoc.cc 12162@@ -1,4 +1,4 @@ 12163-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12164+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12165 // reserved. Use of this source code is governed by a BSD-style license that 12166 // can be found in the LICENSE file. 12167 // 12168@@ -9,7 +9,7 @@ 12169 // implementations. See the translator.README.txt file in the tools directory 12170 // for more information. 12171 // 12172-// $hash=1c8a4ef9964effea5d8f02abc6890794c7a22df7$ 12173+// $hash=c0c0bf119990d7ce088a2c9c7fc0fc4a0a378460$ 12174 // 12175 12176 #include "libcef_dll/cpptoc/load_handler_cpptoc.h" 12177diff --git a/src/cef/libcef_dll/cpptoc/load_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/load_handler_cpptoc.h 12178index 31ed258d8bdd8..b17e7746a1cd1 12179--- a/src/cef/libcef_dll/cpptoc/load_handler_cpptoc.h 12180+++ b/src/cef/libcef_dll/cpptoc/load_handler_cpptoc.h 12181@@ -1,4 +1,4 @@ 12182-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12183+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12184 // reserved. Use of this source code is governed by a BSD-style license that 12185 // can be found in the LICENSE file. 12186 // 12187@@ -9,7 +9,7 @@ 12188 // implementations. See the translator.README.txt file in the tools directory 12189 // for more information. 12190 // 12191-// $hash=67a49693f79a526ebb12c8352c13de8bf7c64784$ 12192+// $hash=60feef3855499ffd313c9e10fe4e8a6304acc871$ 12193 // 12194 12195 #ifndef CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ 12196diff --git a/src/cef/libcef_dll/cpptoc/menu_model_cpptoc.cc b/src/cef/libcef_dll/cpptoc/menu_model_cpptoc.cc 12197index 809b2184731f5..4e39df4d40934 12198--- a/src/cef/libcef_dll/cpptoc/menu_model_cpptoc.cc 12199+++ b/src/cef/libcef_dll/cpptoc/menu_model_cpptoc.cc 12200@@ -1,4 +1,4 @@ 12201-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12202+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12203 // reserved. Use of this source code is governed by a BSD-style license that 12204 // can be found in the LICENSE file. 12205 // 12206@@ -9,7 +9,7 @@ 12207 // implementations. See the translator.README.txt file in the tools directory 12208 // for more information. 12209 // 12210-// $hash=587be50ef3aefc00fadcf6fec431ebecc305b3eb$ 12211+// $hash=d5b8daec5b6d6a6632d664143e27361425c00212$ 12212 // 12213 12214 #include "libcef_dll/cpptoc/menu_model_cpptoc.h" 12215diff --git a/src/cef/libcef_dll/cpptoc/menu_model_cpptoc.h b/src/cef/libcef_dll/cpptoc/menu_model_cpptoc.h 12216index f8882f06df3bc..9344a7269361c 12217--- a/src/cef/libcef_dll/cpptoc/menu_model_cpptoc.h 12218+++ b/src/cef/libcef_dll/cpptoc/menu_model_cpptoc.h 12219@@ -1,4 +1,4 @@ 12220-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12221+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12222 // reserved. Use of this source code is governed by a BSD-style license that 12223 // can be found in the LICENSE file. 12224 // 12225@@ -9,7 +9,7 @@ 12226 // implementations. See the translator.README.txt file in the tools directory 12227 // for more information. 12228 // 12229-// $hash=8c46e7f774742f9834a61bc7657fdc03a0ed580c$ 12230+// $hash=5f39f05bb39da5ede094d0e9789c5ef1dee1cf7f$ 12231 // 12232 12233 #ifndef CEF_LIBCEF_DLL_CPPTOC_MENU_MODEL_CPPTOC_H_ 12234diff --git a/src/cef/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc 12235index ecc7682476239..3da06a32c64e8 12236--- a/src/cef/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc 12237+++ b/src/cef/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc 12238@@ -1,4 +1,4 @@ 12239-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12240+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12241 // reserved. Use of this source code is governed by a BSD-style license that 12242 // can be found in the LICENSE file. 12243 // 12244@@ -9,7 +9,7 @@ 12245 // implementations. See the translator.README.txt file in the tools directory 12246 // for more information. 12247 // 12248-// $hash=d46082f24a6ad01677700ac68ad424cc4951efed$ 12249+// $hash=57f03a43b0143d9f4f52cd110400c2fbe06d72e9$ 12250 // 12251 12252 #include "libcef_dll/cpptoc/menu_model_delegate_cpptoc.h" 12253diff --git a/src/cef/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h b/src/cef/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h 12254index 4f4a4e749fdf5..50a03ba4db0a6 12255--- a/src/cef/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h 12256+++ b/src/cef/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h 12257@@ -1,4 +1,4 @@ 12258-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12259+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12260 // reserved. Use of this source code is governed by a BSD-style license that 12261 // can be found in the LICENSE file. 12262 // 12263@@ -9,7 +9,7 @@ 12264 // implementations. See the translator.README.txt file in the tools directory 12265 // for more information. 12266 // 12267-// $hash=c48cb7ff4b3e506b4e1ca8b1442bfe91d260ec67$ 12268+// $hash=2277b8692532f706316bb97ffe611394a00e1023$ 12269 // 12270 12271 #ifndef CEF_LIBCEF_DLL_CPPTOC_MENU_MODEL_DELEGATE_CPPTOC_H_ 12272diff --git a/src/cef/libcef_dll/cpptoc/navigation_entry_cpptoc.cc b/src/cef/libcef_dll/cpptoc/navigation_entry_cpptoc.cc 12273index 9db40c38fa7f7..4b068202620b5 12274--- a/src/cef/libcef_dll/cpptoc/navigation_entry_cpptoc.cc 12275+++ b/src/cef/libcef_dll/cpptoc/navigation_entry_cpptoc.cc 12276@@ -1,4 +1,4 @@ 12277-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12278+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12279 // reserved. Use of this source code is governed by a BSD-style license that 12280 // can be found in the LICENSE file. 12281 // 12282@@ -9,7 +9,7 @@ 12283 // implementations. See the translator.README.txt file in the tools directory 12284 // for more information. 12285 // 12286-// $hash=081579d10d7dd1ad8906d54350c2b63f97930fd2$ 12287+// $hash=a55e8468667740e9e121e0d553a416d2337c15f6$ 12288 // 12289 12290 #include "libcef_dll/cpptoc/navigation_entry_cpptoc.h" 12291@@ -192,6 +192,72 @@ navigation_entry_get_sslstatus(struct _cef_navigation_entry_t* self) { 12292 return CefSSLStatusCppToC::Wrap(_retval); 12293 } 12294 12295+int CEF_CALLBACK 12296+navigation_entry_get_favicon(struct _cef_navigation_entry_t* self, 12297+ void** pixel_data, 12298+ int* color_type, 12299+ int* alpha_type, 12300+ int* pixel_width, 12301+ int* pixel_height) { 12302+ shutdown_checker::AssertNotShutdown(); 12303+ 12304+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 12305+ 12306+ DCHECK(self); 12307+ if (!self) 12308+ return 0; 12309+ // Verify param: pixel_data; type: simple_byaddr 12310+ DCHECK(pixel_data); 12311+ if (!pixel_data) 12312+ return 0; 12313+ // Verify param: color_type; type: simple_byref 12314+ DCHECK(color_type); 12315+ if (!color_type) 12316+ return 0; 12317+ // Verify param: alpha_type; type: simple_byref 12318+ DCHECK(alpha_type); 12319+ if (!alpha_type) 12320+ return 0; 12321+ // Verify param: pixel_width; type: simple_byref 12322+ DCHECK(pixel_width); 12323+ if (!pixel_width) 12324+ return 0; 12325+ // Verify param: pixel_height; type: simple_byref 12326+ DCHECK(pixel_height); 12327+ if (!pixel_height) 12328+ return 0; 12329+ 12330+ // Translate param: color_type; type: simple_byref 12331+ int color_typeVal = color_type ? *color_type : 0; 12332+ // Translate param: alpha_type; type: simple_byref 12333+ int alpha_typeVal = alpha_type ? *alpha_type : 0; 12334+ // Translate param: pixel_width; type: simple_byref 12335+ int pixel_widthVal = pixel_width ? *pixel_width : 0; 12336+ // Translate param: pixel_height; type: simple_byref 12337+ int pixel_heightVal = pixel_height ? *pixel_height : 0; 12338+ 12339+ // Execute 12340+ bool _retval = CefNavigationEntryCppToC::Get(self)->GetFavicon( 12341+ pixel_data, color_typeVal, alpha_typeVal, pixel_widthVal, 12342+ pixel_heightVal); 12343+ 12344+ // Restore param: color_type; type: simple_byref 12345+ if (color_type) 12346+ *color_type = color_typeVal; 12347+ // Restore param: alpha_type; type: simple_byref 12348+ if (alpha_type) 12349+ *alpha_type = alpha_typeVal; 12350+ // Restore param: pixel_width; type: simple_byref 12351+ if (pixel_width) 12352+ *pixel_width = pixel_widthVal; 12353+ // Restore param: pixel_height; type: simple_byref 12354+ if (pixel_height) 12355+ *pixel_height = pixel_heightVal; 12356+ 12357+ // Return type: bool 12358+ return _retval; 12359+} 12360+ 12361 } // namespace 12362 12363 // CONSTRUCTOR - Do not edit by hand. 12364@@ -207,6 +273,7 @@ CefNavigationEntryCppToC::CefNavigationEntryCppToC() { 12365 GetStruct()->get_completion_time = navigation_entry_get_completion_time; 12366 GetStruct()->get_http_status_code = navigation_entry_get_http_status_code; 12367 GetStruct()->get_sslstatus = navigation_entry_get_sslstatus; 12368+ GetStruct()->get_favicon = navigation_entry_get_favicon; 12369 } 12370 12371 // DESTRUCTOR - Do not edit by hand. 12372diff --git a/src/cef/libcef_dll/cpptoc/navigation_entry_cpptoc.h b/src/cef/libcef_dll/cpptoc/navigation_entry_cpptoc.h 12373index f4857ed61ebcb..38285d8148aa6 12374--- a/src/cef/libcef_dll/cpptoc/navigation_entry_cpptoc.h 12375+++ b/src/cef/libcef_dll/cpptoc/navigation_entry_cpptoc.h 12376@@ -1,4 +1,4 @@ 12377-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12378+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12379 // reserved. Use of this source code is governed by a BSD-style license that 12380 // can be found in the LICENSE file. 12381 // 12382@@ -9,7 +9,7 @@ 12383 // implementations. See the translator.README.txt file in the tools directory 12384 // for more information. 12385 // 12386-// $hash=888591dac662cceb022bc320c159fcba58fc6e24$ 12387+// $hash=213e6404f2260e81c41b20a42ae7788af80710dc$ 12388 // 12389 12390 #ifndef CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_CPPTOC_H_ 12391diff --git a/src/cef/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc b/src/cef/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc 12392index 3fe2dba37c603..2f28f1ee089f3 12393--- a/src/cef/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc 12394+++ b/src/cef/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc 12395@@ -1,4 +1,4 @@ 12396-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12397+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12398 // reserved. Use of this source code is governed by a BSD-style license that 12399 // can be found in the LICENSE file. 12400 // 12401@@ -9,7 +9,7 @@ 12402 // implementations. See the translator.README.txt file in the tools directory 12403 // for more information. 12404 // 12405-// $hash=dc5e1a5dece19a5168915d1a6816ac4a52c1078f$ 12406+// $hash=bb3302d31f5fe2e81cde418da8c25d16138ce3b7$ 12407 // 12408 12409 #include "libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h" 12410diff --git a/src/cef/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h b/src/cef/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h 12411index 30c02d6f876af..77bb1a6807fba 12412--- a/src/cef/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h 12413+++ b/src/cef/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h 12414@@ -1,4 +1,4 @@ 12415-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12416+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12417 // reserved. Use of this source code is governed by a BSD-style license that 12418 // can be found in the LICENSE file. 12419 // 12420@@ -9,7 +9,7 @@ 12421 // implementations. See the translator.README.txt file in the tools directory 12422 // for more information. 12423 // 12424-// $hash=112f7c12c88d09e4d300cd3d8bf1f72b1be54596$ 12425+// $hash=e2fe9b1846135732e7596c2ff7ab6efadbb5a519$ 12426 // 12427 12428 #ifndef CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_ 12429diff --git a/src/cef/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc 12430index 5a5d810c4fb72..11bc0594c5bc5 12431--- a/src/cef/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc 12432+++ b/src/cef/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc 12433@@ -1,4 +1,4 @@ 12434-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12435+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12436 // reserved. Use of this source code is governed by a BSD-style license that 12437 // can be found in the LICENSE file. 12438 // 12439@@ -9,7 +9,7 @@ 12440 // implementations. See the translator.README.txt file in the tools directory 12441 // for more information. 12442 // 12443-// $hash=388a87f728a292dc4e2101724656ac09b8fdaa1d$ 12444+// $hash=7f58256b38894ba0a8bf514cbdd2719e75bca5c3$ 12445 // 12446 12447 #include "libcef_dll/cpptoc/pdf_print_callback_cpptoc.h" 12448diff --git a/src/cef/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h 12449index df0c88723c98d..79130c8db5211 12450--- a/src/cef/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h 12451+++ b/src/cef/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h 12452@@ -1,4 +1,4 @@ 12453-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12454+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12455 // reserved. Use of this source code is governed by a BSD-style license that 12456 // can be found in the LICENSE file. 12457 // 12458@@ -9,7 +9,7 @@ 12459 // implementations. See the translator.README.txt file in the tools directory 12460 // for more information. 12461 // 12462-// $hash=0dfa6d58ed63c1e3be9992486e404a642df6e32a$ 12463+// $hash=5e9c671740881e345231547607160ce167d37728$ 12464 // 12465 12466 #ifndef CEF_LIBCEF_DLL_CPPTOC_PDF_PRINT_CALLBACK_CPPTOC_H_ 12467diff --git a/src/cef/libcef_dll/cpptoc/permission_request_cpptoc.cc b/src/cef/libcef_dll/cpptoc/permission_request_cpptoc.cc 12468index 4038e2c5cf85c..fe5ff538b45d3 12469--- a/src/cef/libcef_dll/cpptoc/permission_request_cpptoc.cc 12470+++ b/src/cef/libcef_dll/cpptoc/permission_request_cpptoc.cc 12471@@ -1,4 +1,4 @@ 12472-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12473+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12474 // reserved. Use of this source code is governed by a BSD-style license that 12475 // can be found in the LICENSE file. 12476 // 12477@@ -9,7 +9,7 @@ 12478 // implementations. See the translator.README.txt file in the tools directory 12479 // for more information. 12480 // 12481-// $hash=a0c1e9d26c0b0129b85719532cd7312019c2d5f3$ 12482+// $hash=26d002adb41352f89861e1da149863a378f00a1e$ 12483 // 12484 12485 #include "libcef_dll/cpptoc/permission_request_cpptoc.h" 12486diff --git a/src/cef/libcef_dll/cpptoc/permission_request_cpptoc.h b/src/cef/libcef_dll/cpptoc/permission_request_cpptoc.h 12487index fc597ec736bab..7446187b86322 12488--- a/src/cef/libcef_dll/cpptoc/permission_request_cpptoc.h 12489+++ b/src/cef/libcef_dll/cpptoc/permission_request_cpptoc.h 12490@@ -1,4 +1,4 @@ 12491-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12492+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12493 // reserved. Use of this source code is governed by a BSD-style license that 12494 // can be found in the LICENSE file. 12495 // 12496@@ -9,7 +9,7 @@ 12497 // implementations. See the translator.README.txt file in the tools directory 12498 // for more information. 12499 // 12500-// $hash=b4bca43d1905283a291f6df6cf1a15bccf569618$ 12501+// $hash=8ef60b5e6629947be455e0c402c9170bf7848cff$ 12502 // 12503 12504 #ifndef CEF_LIBCEF_DLL_CPPTOC_PERMISSION_REQUEST_CPPTOC_H_ 12505diff --git a/src/cef/libcef_dll/cpptoc/post_data_cpptoc.cc b/src/cef/libcef_dll/cpptoc/post_data_cpptoc.cc 12506index 2b1d0e145f88b..ecbbae66b2b42 12507--- a/src/cef/libcef_dll/cpptoc/post_data_cpptoc.cc 12508+++ b/src/cef/libcef_dll/cpptoc/post_data_cpptoc.cc 12509@@ -1,4 +1,4 @@ 12510-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12511+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12512 // reserved. Use of this source code is governed by a BSD-style license that 12513 // can be found in the LICENSE file. 12514 // 12515@@ -9,7 +9,7 @@ 12516 // implementations. See the translator.README.txt file in the tools directory 12517 // for more information. 12518 // 12519-// $hash=935efc8f333c6df95b783e1e80bb84aa26d55b9b$ 12520+// $hash=0de557ec053dbe8fd6ae4e455450549ff322e195$ 12521 // 12522 12523 #include "libcef_dll/cpptoc/post_data_cpptoc.h" 12524diff --git a/src/cef/libcef_dll/cpptoc/post_data_cpptoc.h b/src/cef/libcef_dll/cpptoc/post_data_cpptoc.h 12525index ff139f20d0f14..59518a2bd8aff 12526--- a/src/cef/libcef_dll/cpptoc/post_data_cpptoc.h 12527+++ b/src/cef/libcef_dll/cpptoc/post_data_cpptoc.h 12528@@ -1,4 +1,4 @@ 12529-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12530+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12531 // reserved. Use of this source code is governed by a BSD-style license that 12532 // can be found in the LICENSE file. 12533 // 12534@@ -9,7 +9,7 @@ 12535 // implementations. See the translator.README.txt file in the tools directory 12536 // for more information. 12537 // 12538-// $hash=c73c8a6c74113ead0251ca0afb007d2baa02030b$ 12539+// $hash=784458fd59458b07ba3c6eacac3803b9901c354c$ 12540 // 12541 12542 #ifndef CEF_LIBCEF_DLL_CPPTOC_POST_DATA_CPPTOC_H_ 12543diff --git a/src/cef/libcef_dll/cpptoc/post_data_element_cpptoc.cc b/src/cef/libcef_dll/cpptoc/post_data_element_cpptoc.cc 12544index 1dff9418b3137..55916e44b4499 12545--- a/src/cef/libcef_dll/cpptoc/post_data_element_cpptoc.cc 12546+++ b/src/cef/libcef_dll/cpptoc/post_data_element_cpptoc.cc 12547@@ -1,4 +1,4 @@ 12548-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12549+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12550 // reserved. Use of this source code is governed by a BSD-style license that 12551 // can be found in the LICENSE file. 12552 // 12553@@ -9,7 +9,7 @@ 12554 // implementations. See the translator.README.txt file in the tools directory 12555 // for more information. 12556 // 12557-// $hash=6148547c3504062984362b43db9e95ee68ef1358$ 12558+// $hash=eb33ec601cd24711837575d3bc19dc603a2d939a$ 12559 // 12560 12561 #include "libcef_dll/cpptoc/post_data_element_cpptoc.h" 12562diff --git a/src/cef/libcef_dll/cpptoc/post_data_element_cpptoc.h b/src/cef/libcef_dll/cpptoc/post_data_element_cpptoc.h 12563index 176e3081bf016..5b57b20450e85 12564--- a/src/cef/libcef_dll/cpptoc/post_data_element_cpptoc.h 12565+++ b/src/cef/libcef_dll/cpptoc/post_data_element_cpptoc.h 12566@@ -1,4 +1,4 @@ 12567-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12568+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12569 // reserved. Use of this source code is governed by a BSD-style license that 12570 // can be found in the LICENSE file. 12571 // 12572@@ -9,7 +9,7 @@ 12573 // implementations. See the translator.README.txt file in the tools directory 12574 // for more information. 12575 // 12576-// $hash=e29b5318c16ccbffa354d79176698d1709048e32$ 12577+// $hash=6d48d5f01f5cebcdca0fcfa7ce2b39a049fdc9cd$ 12578 // 12579 12580 #ifndef CEF_LIBCEF_DLL_CPPTOC_POST_DATA_ELEMENT_CPPTOC_H_ 12581diff --git a/src/cef/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc 12582index ac4a1fbd244ba..5eb17755a750a 12583--- a/src/cef/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc 12584+++ b/src/cef/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc 12585@@ -1,4 +1,4 @@ 12586-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12587+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12588 // reserved. Use of this source code is governed by a BSD-style license that 12589 // can be found in the LICENSE file. 12590 // 12591@@ -9,7 +9,7 @@ 12592 // implementations. See the translator.README.txt file in the tools directory 12593 // for more information. 12594 // 12595-// $hash=5332b8cb609fa0f5b98e607878678808d21da3a4$ 12596+// $hash=bca20d1cfd7f00c65784d4532b02f8a05cf06068$ 12597 // 12598 12599 #include "libcef_dll/cpptoc/print_dialog_callback_cpptoc.h" 12600diff --git a/src/cef/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h 12601index f16cff04f2825..281ef13984eb8 12602--- a/src/cef/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h 12603+++ b/src/cef/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h 12604@@ -1,4 +1,4 @@ 12605-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12606+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12607 // reserved. Use of this source code is governed by a BSD-style license that 12608 // can be found in the LICENSE file. 12609 // 12610@@ -9,7 +9,7 @@ 12611 // implementations. See the translator.README.txt file in the tools directory 12612 // for more information. 12613 // 12614-// $hash=88e44e22bb56d51ba9a60f38f59b89bb3e372748$ 12615+// $hash=ee6fd2ddae3899be82feca1e37cce919363bae99$ 12616 // 12617 12618 #ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_DIALOG_CALLBACK_CPPTOC_H_ 12619diff --git a/src/cef/libcef_dll/cpptoc/print_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/print_handler_cpptoc.cc 12620index dd6c36379ebb7..b2d5be1531e5c 12621--- a/src/cef/libcef_dll/cpptoc/print_handler_cpptoc.cc 12622+++ b/src/cef/libcef_dll/cpptoc/print_handler_cpptoc.cc 12623@@ -1,4 +1,4 @@ 12624-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12625+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12626 // reserved. Use of this source code is governed by a BSD-style license that 12627 // can be found in the LICENSE file. 12628 // 12629@@ -9,7 +9,7 @@ 12630 // implementations. See the translator.README.txt file in the tools directory 12631 // for more information. 12632 // 12633-// $hash=9c26e4bf9952a26541915f64dad82080f09dfd58$ 12634+// $hash=b23eaa74cd7c6a1075d6a8c4b7d1ecbc9effe142$ 12635 // 12636 12637 #include "libcef_dll/cpptoc/print_handler_cpptoc.h" 12638diff --git a/src/cef/libcef_dll/cpptoc/print_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/print_handler_cpptoc.h 12639index da73686680aab..f2d71b3cc5f52 12640--- a/src/cef/libcef_dll/cpptoc/print_handler_cpptoc.h 12641+++ b/src/cef/libcef_dll/cpptoc/print_handler_cpptoc.h 12642@@ -1,4 +1,4 @@ 12643-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12644+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12645 // reserved. Use of this source code is governed by a BSD-style license that 12646 // can be found in the LICENSE file. 12647 // 12648@@ -9,7 +9,7 @@ 12649 // implementations. See the translator.README.txt file in the tools directory 12650 // for more information. 12651 // 12652-// $hash=49bb73be2c56a31fff2e88875360591dd31bdd8c$ 12653+// $hash=cd0bb4e9c12f53896be544b28ae3c6f38b3504e2$ 12654 // 12655 12656 #ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ 12657diff --git a/src/cef/libcef_dll/cpptoc/print_job_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/print_job_callback_cpptoc.cc 12658index 45ec93c715f3a..038259e327373 12659--- a/src/cef/libcef_dll/cpptoc/print_job_callback_cpptoc.cc 12660+++ b/src/cef/libcef_dll/cpptoc/print_job_callback_cpptoc.cc 12661@@ -1,4 +1,4 @@ 12662-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12663+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12664 // reserved. Use of this source code is governed by a BSD-style license that 12665 // can be found in the LICENSE file. 12666 // 12667@@ -9,7 +9,7 @@ 12668 // implementations. See the translator.README.txt file in the tools directory 12669 // for more information. 12670 // 12671-// $hash=3becd112f5c17b36328e77fcdcd296cdf73291a3$ 12672+// $hash=e631d13c43819555aabf52b015d40ab9cd532b91$ 12673 // 12674 12675 #include "libcef_dll/cpptoc/print_job_callback_cpptoc.h" 12676diff --git a/src/cef/libcef_dll/cpptoc/print_job_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/print_job_callback_cpptoc.h 12677index ec169ba4a0ce8..cc5901085d0eb 12678--- a/src/cef/libcef_dll/cpptoc/print_job_callback_cpptoc.h 12679+++ b/src/cef/libcef_dll/cpptoc/print_job_callback_cpptoc.h 12680@@ -1,4 +1,4 @@ 12681-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12682+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12683 // reserved. Use of this source code is governed by a BSD-style license that 12684 // can be found in the LICENSE file. 12685 // 12686@@ -9,7 +9,7 @@ 12687 // implementations. See the translator.README.txt file in the tools directory 12688 // for more information. 12689 // 12690-// $hash=d3c680caf88e14fa8cd3c846fe44870900f82ea1$ 12691+// $hash=54a355e9511b5d0956f1a7269ee21766fa7f8c87$ 12692 // 12693 12694 #ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_JOB_CALLBACK_CPPTOC_H_ 12695diff --git a/src/cef/libcef_dll/cpptoc/print_settings_cpptoc.cc b/src/cef/libcef_dll/cpptoc/print_settings_cpptoc.cc 12696index 4138aaf281f20..0f012ca207606 12697--- a/src/cef/libcef_dll/cpptoc/print_settings_cpptoc.cc 12698+++ b/src/cef/libcef_dll/cpptoc/print_settings_cpptoc.cc 12699@@ -1,4 +1,4 @@ 12700-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12701+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12702 // reserved. Use of this source code is governed by a BSD-style license that 12703 // can be found in the LICENSE file. 12704 // 12705@@ -9,7 +9,7 @@ 12706 // implementations. See the translator.README.txt file in the tools directory 12707 // for more information. 12708 // 12709-// $hash=8840518039eff950764302105148c5da0b0c996a$ 12710+// $hash=fe89e407154f3696538e128f07da6d26767b7f5c$ 12711 // 12712 12713 #include "libcef_dll/cpptoc/print_settings_cpptoc.h" 12714diff --git a/src/cef/libcef_dll/cpptoc/print_settings_cpptoc.h b/src/cef/libcef_dll/cpptoc/print_settings_cpptoc.h 12715index 6e6eea2140648..c7ece39229d0d 12716--- a/src/cef/libcef_dll/cpptoc/print_settings_cpptoc.h 12717+++ b/src/cef/libcef_dll/cpptoc/print_settings_cpptoc.h 12718@@ -1,4 +1,4 @@ 12719-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12720+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12721 // reserved. Use of this source code is governed by a BSD-style license that 12722 // can be found in the LICENSE file. 12723 // 12724@@ -9,7 +9,7 @@ 12725 // implementations. See the translator.README.txt file in the tools directory 12726 // for more information. 12727 // 12728-// $hash=ab8680da4bc909d2c1a6cf723fafc1a561bfeb44$ 12729+// $hash=596144335f97b41394808d0de0908c2a69d04d7a$ 12730 // 12731 12732 #ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_SETTINGS_CPPTOC_H_ 12733diff --git a/src/cef/libcef_dll/cpptoc/process_message_cpptoc.cc b/src/cef/libcef_dll/cpptoc/process_message_cpptoc.cc 12734index f6473634e0b92..a26067d9b044f 12735--- a/src/cef/libcef_dll/cpptoc/process_message_cpptoc.cc 12736+++ b/src/cef/libcef_dll/cpptoc/process_message_cpptoc.cc 12737@@ -1,4 +1,4 @@ 12738-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12739+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12740 // reserved. Use of this source code is governed by a BSD-style license that 12741 // can be found in the LICENSE file. 12742 // 12743@@ -9,7 +9,7 @@ 12744 // implementations. See the translator.README.txt file in the tools directory 12745 // for more information. 12746 // 12747-// $hash=b63f665e68e4dc6269c3e88b81068190ea90abb3$ 12748+// $hash=380c4fce89031ac6da4de226f3007d1a8a1b26ef$ 12749 // 12750 12751 #include "libcef_dll/cpptoc/process_message_cpptoc.h" 12752diff --git a/src/cef/libcef_dll/cpptoc/process_message_cpptoc.h b/src/cef/libcef_dll/cpptoc/process_message_cpptoc.h 12753index 76f2c5d97bf9c..e3f2485893858 12754--- a/src/cef/libcef_dll/cpptoc/process_message_cpptoc.h 12755+++ b/src/cef/libcef_dll/cpptoc/process_message_cpptoc.h 12756@@ -1,4 +1,4 @@ 12757-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12758+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12759 // reserved. Use of this source code is governed by a BSD-style license that 12760 // can be found in the LICENSE file. 12761 // 12762@@ -9,7 +9,7 @@ 12763 // implementations. See the translator.README.txt file in the tools directory 12764 // for more information. 12765 // 12766-// $hash=e70a96835042a2ebf0a60f2130f31d24f1ca59fd$ 12767+// $hash=6d4c104d51d4d34c0ec8b767a13db58a6fb0fef8$ 12768 // 12769 12770 #ifndef CEF_LIBCEF_DLL_CPPTOC_PROCESS_MESSAGE_CPPTOC_H_ 12771diff --git a/src/cef/libcef_dll/cpptoc/read_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/read_handler_cpptoc.cc 12772index ca8ec58e351c2..f2990fc4d5605 12773--- a/src/cef/libcef_dll/cpptoc/read_handler_cpptoc.cc 12774+++ b/src/cef/libcef_dll/cpptoc/read_handler_cpptoc.cc 12775@@ -1,4 +1,4 @@ 12776-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12777+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12778 // reserved. Use of this source code is governed by a BSD-style license that 12779 // can be found in the LICENSE file. 12780 // 12781@@ -9,7 +9,7 @@ 12782 // implementations. See the translator.README.txt file in the tools directory 12783 // for more information. 12784 // 12785-// $hash=a0976edc09e822700d8f402b2dae7af4c434d86f$ 12786+// $hash=dead2ddfaea0555af195b8bb7bb858a57e96f25b$ 12787 // 12788 12789 #include "libcef_dll/cpptoc/read_handler_cpptoc.h" 12790diff --git a/src/cef/libcef_dll/cpptoc/read_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/read_handler_cpptoc.h 12791index eda92ed97ca9e..4c4ddc6ee3276 12792--- a/src/cef/libcef_dll/cpptoc/read_handler_cpptoc.h 12793+++ b/src/cef/libcef_dll/cpptoc/read_handler_cpptoc.h 12794@@ -1,4 +1,4 @@ 12795-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12796+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12797 // reserved. Use of this source code is governed by a BSD-style license that 12798 // can be found in the LICENSE file. 12799 // 12800@@ -9,7 +9,7 @@ 12801 // implementations. See the translator.README.txt file in the tools directory 12802 // for more information. 12803 // 12804-// $hash=3c16def2c698c26a175b1087db819d3894a264fa$ 12805+// $hash=8a5eb8ffc9a8857ac10a6586e954dc532d10618a$ 12806 // 12807 12808 #ifndef CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ 12809diff --git a/src/cef/libcef_dll/cpptoc/registration_cpptoc.cc b/src/cef/libcef_dll/cpptoc/registration_cpptoc.cc 12810index 5d959db487a0e..ab7f377f33f14 12811--- a/src/cef/libcef_dll/cpptoc/registration_cpptoc.cc 12812+++ b/src/cef/libcef_dll/cpptoc/registration_cpptoc.cc 12813@@ -1,4 +1,4 @@ 12814-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12815+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12816 // reserved. Use of this source code is governed by a BSD-style license that 12817 // can be found in the LICENSE file. 12818 // 12819@@ -9,7 +9,7 @@ 12820 // implementations. See the translator.README.txt file in the tools directory 12821 // for more information. 12822 // 12823-// $hash=bfa5ab4142b6fe56939a45241a39bb74f3a84acb$ 12824+// $hash=9256f12f40a70c8a2e6100882473516f80c097c4$ 12825 // 12826 12827 #include "libcef_dll/cpptoc/registration_cpptoc.h" 12828diff --git a/src/cef/libcef_dll/cpptoc/registration_cpptoc.h b/src/cef/libcef_dll/cpptoc/registration_cpptoc.h 12829index e623e5f7d471d..8fd4ce15dc226 12830--- a/src/cef/libcef_dll/cpptoc/registration_cpptoc.h 12831+++ b/src/cef/libcef_dll/cpptoc/registration_cpptoc.h 12832@@ -1,4 +1,4 @@ 12833-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12834+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12835 // reserved. Use of this source code is governed by a BSD-style license that 12836 // can be found in the LICENSE file. 12837 // 12838@@ -9,7 +9,7 @@ 12839 // implementations. See the translator.README.txt file in the tools directory 12840 // for more information. 12841 // 12842-// $hash=edd002ac63a0564820617ad44c5c30f9674b8122$ 12843+// $hash=461d6b9297ebd61bf8d2df2e3960458a9a3705f6$ 12844 // 12845 12846 #ifndef CEF_LIBCEF_DLL_CPPTOC_REGISTRATION_CPPTOC_H_ 12847diff --git a/src/cef/libcef_dll/cpptoc/render_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/render_handler_cpptoc.cc 12848index 32553b7017bae..4add57745a8f4 12849--- a/src/cef/libcef_dll/cpptoc/render_handler_cpptoc.cc 12850+++ b/src/cef/libcef_dll/cpptoc/render_handler_cpptoc.cc 12851@@ -1,4 +1,4 @@ 12852-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12853+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12854 // reserved. Use of this source code is governed by a BSD-style license that 12855 // can be found in the LICENSE file. 12856 // 12857@@ -9,7 +9,7 @@ 12858 // implementations. See the translator.README.txt file in the tools directory 12859 // for more information. 12860 // 12861-// $hash=c83f5f49a5411a5071750e238c12e22bfa82c48a$ 12862+// $hash=5da07c9f36d3f52ef73ea85ebd73fecb31838536$ 12863 // 12864 12865 #include "libcef_dll/cpptoc/render_handler_cpptoc.h" 12866diff --git a/src/cef/libcef_dll/cpptoc/render_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/render_handler_cpptoc.h 12867index c213ddf908607..f56251d7d1e9b 12868--- a/src/cef/libcef_dll/cpptoc/render_handler_cpptoc.h 12869+++ b/src/cef/libcef_dll/cpptoc/render_handler_cpptoc.h 12870@@ -1,4 +1,4 @@ 12871-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12872+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12873 // reserved. Use of this source code is governed by a BSD-style license that 12874 // can be found in the LICENSE file. 12875 // 12876@@ -9,7 +9,7 @@ 12877 // implementations. See the translator.README.txt file in the tools directory 12878 // for more information. 12879 // 12880-// $hash=18b7f5398b817f5d20f26aa4e139faa4f91cfe0b$ 12881+// $hash=a0cdfb84f8b30f01dd01556ad3e1725e043641e0$ 12882 // 12883 12884 #ifndef CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ 12885diff --git a/src/cef/libcef_dll/cpptoc/render_process_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/render_process_handler_cpptoc.cc 12886index 42c4ad45eceb8..fa68599a2be28 12887--- a/src/cef/libcef_dll/cpptoc/render_process_handler_cpptoc.cc 12888+++ b/src/cef/libcef_dll/cpptoc/render_process_handler_cpptoc.cc 12889@@ -1,4 +1,4 @@ 12890-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12891+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12892 // reserved. Use of this source code is governed by a BSD-style license that 12893 // can be found in the LICENSE file. 12894 // 12895@@ -9,7 +9,7 @@ 12896 // implementations. See the translator.README.txt file in the tools directory 12897 // for more information. 12898 // 12899-// $hash=08f14fa621595f247e87853c39c3375fce2c9326$ 12900+// $hash=05c223f2568d1c7deb34613ae3838bdcf6fdb0ee$ 12901 // 12902 12903 #include "libcef_dll/cpptoc/render_process_handler_cpptoc.h" 12904diff --git a/src/cef/libcef_dll/cpptoc/render_process_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/render_process_handler_cpptoc.h 12905index 599203043efa4..124c4a5092987 12906--- a/src/cef/libcef_dll/cpptoc/render_process_handler_cpptoc.h 12907+++ b/src/cef/libcef_dll/cpptoc/render_process_handler_cpptoc.h 12908@@ -1,4 +1,4 @@ 12909-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12910+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12911 // reserved. Use of this source code is governed by a BSD-style license that 12912 // can be found in the LICENSE file. 12913 // 12914@@ -9,7 +9,7 @@ 12915 // implementations. See the translator.README.txt file in the tools directory 12916 // for more information. 12917 // 12918-// $hash=8d832edacd5ccc0baac1314aaa9424ba2ab4837c$ 12919+// $hash=1686827d48e7c0d75a603a2b6b8ca05b4f158340$ 12920 // 12921 12922 #ifndef CEF_LIBCEF_DLL_CPPTOC_RENDER_PROCESS_HANDLER_CPPTOC_H_ 12923diff --git a/src/cef/libcef_dll/cpptoc/request_context_cpptoc.cc b/src/cef/libcef_dll/cpptoc/request_context_cpptoc.cc 12924index 228abbc4db996..5fb169abd4c74 12925--- a/src/cef/libcef_dll/cpptoc/request_context_cpptoc.cc 12926+++ b/src/cef/libcef_dll/cpptoc/request_context_cpptoc.cc 12927@@ -1,4 +1,4 @@ 12928-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12929+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12930 // reserved. Use of this source code is governed by a BSD-style license that 12931 // can be found in the LICENSE file. 12932 // 12933@@ -9,7 +9,7 @@ 12934 // implementations. See the translator.README.txt file in the tools directory 12935 // for more information. 12936 // 12937-// $hash=f895effb80d27ea9ae57687c81df2f8871e2ea53$ 12938+// $hash=8b3881774a33c2efa32765341a72e050d321db58$ 12939 // 12940 12941 #include "libcef_dll/cpptoc/request_context_cpptoc.h" 12942@@ -17,7 +17,6 @@ 12943 #include "libcef_dll/cpptoc/data_base_cpptoc.h" 12944 #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" 12945 #include "libcef_dll/cpptoc/extension_cpptoc.h" 12946-#include "libcef_dll/cpptoc/media_router_cpptoc.h" 12947 #include "libcef_dll/cpptoc/value_cpptoc.h" 12948 #include "libcef_dll/cpptoc/web_storage_cpptoc.h" 12949 #include "libcef_dll/ctocpp/completion_callback_ctocpp.h" 12950@@ -579,25 +578,6 @@ request_context_get_extension(struct _cef_request_context_t* self, 12951 return CefExtensionCppToC::Wrap(_retval); 12952 } 12953 12954-cef_media_router_t* CEF_CALLBACK 12955-request_context_get_media_router(struct _cef_request_context_t* self, 12956- cef_completion_callback_t* callback) { 12957- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 12958- 12959- DCHECK(self); 12960- if (!self) 12961- return NULL; 12962- // Unverified params: callback 12963- 12964- // Execute 12965- CefRefPtr<CefMediaRouter> _retval = 12966- CefRequestContextCppToC::Get(self)->GetMediaRouter( 12967- CefCompletionCallbackCToCpp::Wrap(callback)); 12968- 12969- // Return type: refptr_same 12970- return CefMediaRouterCppToC::Wrap(_retval); 12971-} 12972- 12973 } // namespace 12974 12975 // CONSTRUCTOR - Do not edit by hand. 12976@@ -633,7 +613,6 @@ CefRequestContextCppToC::CefRequestContextCppToC() { 12977 GetStruct()->has_extension = request_context_has_extension; 12978 GetStruct()->get_extensions = request_context_get_extensions; 12979 GetStruct()->get_extension = request_context_get_extension; 12980- GetStruct()->get_media_router = request_context_get_media_router; 12981 } 12982 12983 // DESTRUCTOR - Do not edit by hand. 12984diff --git a/src/cef/libcef_dll/cpptoc/request_context_cpptoc.h b/src/cef/libcef_dll/cpptoc/request_context_cpptoc.h 12985index bf9847b8d1767..f798fefbaecc2 12986--- a/src/cef/libcef_dll/cpptoc/request_context_cpptoc.h 12987+++ b/src/cef/libcef_dll/cpptoc/request_context_cpptoc.h 12988@@ -1,4 +1,4 @@ 12989-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 12990+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 12991 // reserved. Use of this source code is governed by a BSD-style license that 12992 // can be found in the LICENSE file. 12993 // 12994@@ -9,7 +9,7 @@ 12995 // implementations. See the translator.README.txt file in the tools directory 12996 // for more information. 12997 // 12998-// $hash=7350e36d25125a3560d0e0da5b46daa60295c7a7$ 12999+// $hash=07ccff0f6993fe1634467a76d9996081fca0ec3a$ 13000 // 13001 13002 #ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_CPPTOC_H_ 13003diff --git a/src/cef/libcef_dll/cpptoc/request_context_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/request_context_handler_cpptoc.cc 13004index 6bc9ece6db413..8d8a3464f80a5 13005--- a/src/cef/libcef_dll/cpptoc/request_context_handler_cpptoc.cc 13006+++ b/src/cef/libcef_dll/cpptoc/request_context_handler_cpptoc.cc 13007@@ -1,4 +1,4 @@ 13008-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13009+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13010 // reserved. Use of this source code is governed by a BSD-style license that 13011 // can be found in the LICENSE file. 13012 // 13013@@ -9,7 +9,7 @@ 13014 // implementations. See the translator.README.txt file in the tools directory 13015 // for more information. 13016 // 13017-// $hash=2e085c019a8e5c4701db0ee23fbd06b275e6342b$ 13018+// $hash=43bd770ac450f9f61d50ddebd85b209953c2fce0$ 13019 // 13020 13021 #include "libcef_dll/cpptoc/request_context_handler_cpptoc.h" 13022diff --git a/src/cef/libcef_dll/cpptoc/request_context_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/request_context_handler_cpptoc.h 13023index aaa029d91b30c..7a002b9517cb5 13024--- a/src/cef/libcef_dll/cpptoc/request_context_handler_cpptoc.h 13025+++ b/src/cef/libcef_dll/cpptoc/request_context_handler_cpptoc.h 13026@@ -1,4 +1,4 @@ 13027-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13028+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13029 // reserved. Use of this source code is governed by a BSD-style license that 13030 // can be found in the LICENSE file. 13031 // 13032@@ -9,7 +9,7 @@ 13033 // implementations. See the translator.README.txt file in the tools directory 13034 // for more information. 13035 // 13036-// $hash=e1cebce8a08c570f02235a53bab5f6aa0b13699c$ 13037+// $hash=0985ec29d8f7825abf5542f7bff3a0477431fc1a$ 13038 // 13039 13040 #ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_HANDLER_CPPTOC_H_ 13041diff --git a/src/cef/libcef_dll/cpptoc/request_cpptoc.cc b/src/cef/libcef_dll/cpptoc/request_cpptoc.cc 13042index ee7cd8b9be4b3..9086c22b3d087 13043--- a/src/cef/libcef_dll/cpptoc/request_cpptoc.cc 13044+++ b/src/cef/libcef_dll/cpptoc/request_cpptoc.cc 13045@@ -1,4 +1,4 @@ 13046-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13047+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13048 // reserved. Use of this source code is governed by a BSD-style license that 13049 // can be found in the LICENSE file. 13050 // 13051@@ -9,7 +9,7 @@ 13052 // implementations. See the translator.README.txt file in the tools directory 13053 // for more information. 13054 // 13055-// $hash=b1a7f857e453a625325a1a2847e60990eecc61ea$ 13056+// $hash=4f55af31ee0cf2bde8f353e26283210430f2d871$ 13057 // 13058 13059 #include "libcef_dll/cpptoc/request_cpptoc.h" 13060diff --git a/src/cef/libcef_dll/cpptoc/request_cpptoc.h b/src/cef/libcef_dll/cpptoc/request_cpptoc.h 13061index b93e0ba163e8c..723e1dec0ea38 13062--- a/src/cef/libcef_dll/cpptoc/request_cpptoc.h 13063+++ b/src/cef/libcef_dll/cpptoc/request_cpptoc.h 13064@@ -1,4 +1,4 @@ 13065-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13066+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13067 // reserved. Use of this source code is governed by a BSD-style license that 13068 // can be found in the LICENSE file. 13069 // 13070@@ -9,7 +9,7 @@ 13071 // implementations. See the translator.README.txt file in the tools directory 13072 // for more information. 13073 // 13074-// $hash=25a489e9a54195be43325a811956c66f578fbeb0$ 13075+// $hash=406c30cba514a450568bc341a7facf5495ab58a5$ 13076 // 13077 13078 #ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CPPTOC_H_ 13079diff --git a/src/cef/libcef_dll/cpptoc/request_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/request_handler_cpptoc.cc 13080index 04ed33bc8dda2..5607a0984816f 13081--- a/src/cef/libcef_dll/cpptoc/request_handler_cpptoc.cc 13082+++ b/src/cef/libcef_dll/cpptoc/request_handler_cpptoc.cc 13083@@ -1,4 +1,4 @@ 13084-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13085+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13086 // reserved. Use of this source code is governed by a BSD-style license that 13087 // can be found in the LICENSE file. 13088 // 13089@@ -9,7 +9,7 @@ 13090 // implementations. See the translator.README.txt file in the tools directory 13091 // for more information. 13092 // 13093-// $hash=162a493c73858bd96eb41016a031932bb23d4a70$ 13094+// $hash=bd54d0dce483d6e05e564e7fbe6a2743f4d6b277$ 13095 // 13096 13097 #include "libcef_dll/cpptoc/request_handler_cpptoc.h" 13098diff --git a/src/cef/libcef_dll/cpptoc/request_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/request_handler_cpptoc.h 13099index 70c502128ec88..73ff5d4c73743 13100--- a/src/cef/libcef_dll/cpptoc/request_handler_cpptoc.h 13101+++ b/src/cef/libcef_dll/cpptoc/request_handler_cpptoc.h 13102@@ -1,4 +1,4 @@ 13103-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13104+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13105 // reserved. Use of this source code is governed by a BSD-style license that 13106 // can be found in the LICENSE file. 13107 // 13108@@ -9,7 +9,7 @@ 13109 // implementations. See the translator.README.txt file in the tools directory 13110 // for more information. 13111 // 13112-// $hash=4cda9dc12a20ead4f6889fd26a176da22ca67c50$ 13113+// $hash=0167d427e72426d439b11b2655caac2b79a7b8de$ 13114 // 13115 13116 #ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ 13117diff --git a/src/cef/libcef_dll/cpptoc/resolve_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/resolve_callback_cpptoc.cc 13118index 6ec72fcf3acb4..7a1f12e0e1033 13119--- a/src/cef/libcef_dll/cpptoc/resolve_callback_cpptoc.cc 13120+++ b/src/cef/libcef_dll/cpptoc/resolve_callback_cpptoc.cc 13121@@ -1,4 +1,4 @@ 13122-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13123+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13124 // reserved. Use of this source code is governed by a BSD-style license that 13125 // can be found in the LICENSE file. 13126 // 13127@@ -9,7 +9,7 @@ 13128 // implementations. See the translator.README.txt file in the tools directory 13129 // for more information. 13130 // 13131-// $hash=d6f5224414a15d32a42ed2862b30c0076d0b5d95$ 13132+// $hash=0a182976f79666acbe49e7bc5fe2e8b07b3afe7c$ 13133 // 13134 13135 #include "libcef_dll/cpptoc/resolve_callback_cpptoc.h" 13136diff --git a/src/cef/libcef_dll/cpptoc/resolve_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/resolve_callback_cpptoc.h 13137index 76e790de0375f..cd35ce3d73963 13138--- a/src/cef/libcef_dll/cpptoc/resolve_callback_cpptoc.h 13139+++ b/src/cef/libcef_dll/cpptoc/resolve_callback_cpptoc.h 13140@@ -1,4 +1,4 @@ 13141-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13142+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13143 // reserved. Use of this source code is governed by a BSD-style license that 13144 // can be found in the LICENSE file. 13145 // 13146@@ -9,7 +9,7 @@ 13147 // implementations. See the translator.README.txt file in the tools directory 13148 // for more information. 13149 // 13150-// $hash=659df5decaf5cab4624f6f15b8bceeed0bd2d228$ 13151+// $hash=aea5c318f99d23b06478b765f81720890aa098b3$ 13152 // 13153 13154 #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOLVE_CALLBACK_CPPTOC_H_ 13155diff --git a/src/cef/libcef_dll/cpptoc/resource_bundle_cpptoc.cc b/src/cef/libcef_dll/cpptoc/resource_bundle_cpptoc.cc 13156index 97ad75f998995..8c2cd88f14cbd 13157--- a/src/cef/libcef_dll/cpptoc/resource_bundle_cpptoc.cc 13158+++ b/src/cef/libcef_dll/cpptoc/resource_bundle_cpptoc.cc 13159@@ -1,4 +1,4 @@ 13160-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13161+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13162 // reserved. Use of this source code is governed by a BSD-style license that 13163 // can be found in the LICENSE file. 13164 // 13165@@ -9,7 +9,7 @@ 13166 // implementations. See the translator.README.txt file in the tools directory 13167 // for more information. 13168 // 13169-// $hash=5081aa41e87ea1a44df19f1df060a478b3b902d8$ 13170+// $hash=99b8484b086c9f3d26e56621610e7761ba5d4f5e$ 13171 // 13172 13173 #include "libcef_dll/cpptoc/resource_bundle_cpptoc.h" 13174diff --git a/src/cef/libcef_dll/cpptoc/resource_bundle_cpptoc.h b/src/cef/libcef_dll/cpptoc/resource_bundle_cpptoc.h 13175index 429418a493091..8102bff0994ea 13176--- a/src/cef/libcef_dll/cpptoc/resource_bundle_cpptoc.h 13177+++ b/src/cef/libcef_dll/cpptoc/resource_bundle_cpptoc.h 13178@@ -1,4 +1,4 @@ 13179-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13180+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13181 // reserved. Use of this source code is governed by a BSD-style license that 13182 // can be found in the LICENSE file. 13183 // 13184@@ -9,7 +9,7 @@ 13185 // implementations. See the translator.README.txt file in the tools directory 13186 // for more information. 13187 // 13188-// $hash=808eba3682873dd7b948ed9f572d9960df9a1b2d$ 13189+// $hash=c126e6379765b577e7251c418bd3fe4dbe392522$ 13190 // 13191 13192 #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_CPPTOC_H_ 13193diff --git a/src/cef/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc 13194index 8e9a45951a4e3..e530d86a815ce 13195--- a/src/cef/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc 13196+++ b/src/cef/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc 13197@@ -1,4 +1,4 @@ 13198-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13199+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13200 // reserved. Use of this source code is governed by a BSD-style license that 13201 // can be found in the LICENSE file. 13202 // 13203@@ -9,7 +9,7 @@ 13204 // implementations. See the translator.README.txt file in the tools directory 13205 // for more information. 13206 // 13207-// $hash=486d1b31ccfd53e10dec622d3ae024c23b50e2c2$ 13208+// $hash=d7cb40bc1f7bbdf092b3c80b162f134f24253359$ 13209 // 13210 13211 #include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h" 13212diff --git a/src/cef/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h 13213index 12d1d945c5aa7..3b74d91484943 13214--- a/src/cef/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h 13215+++ b/src/cef/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h 13216@@ -1,4 +1,4 @@ 13217-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13218+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13219 // reserved. Use of this source code is governed by a BSD-style license that 13220 // can be found in the LICENSE file. 13221 // 13222@@ -9,7 +9,7 @@ 13223 // implementations. See the translator.README.txt file in the tools directory 13224 // for more information. 13225 // 13226-// $hash=26b5dfed49b7182c1bdf52f50547ccb26c4850fe$ 13227+// $hash=f6e9e2a12912ea7b9ab5060481e323c180698725$ 13228 // 13229 13230 #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_HANDLER_CPPTOC_H_ 13231diff --git a/src/cef/libcef_dll/cpptoc/resource_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/resource_handler_cpptoc.cc 13232index 078bd359c9ad8..cd59767ef3927 13233--- a/src/cef/libcef_dll/cpptoc/resource_handler_cpptoc.cc 13234+++ b/src/cef/libcef_dll/cpptoc/resource_handler_cpptoc.cc 13235@@ -1,4 +1,4 @@ 13236-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13237+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13238 // reserved. Use of this source code is governed by a BSD-style license that 13239 // can be found in the LICENSE file. 13240 // 13241@@ -9,7 +9,7 @@ 13242 // implementations. See the translator.README.txt file in the tools directory 13243 // for more information. 13244 // 13245-// $hash=72d9dc0e438de96161f262353c153c11b76f8ad0$ 13246+// $hash=19b5f403a0a77dfb38a0200046b35cf5d2053cfd$ 13247 // 13248 13249 #include "libcef_dll/cpptoc/resource_handler_cpptoc.h" 13250diff --git a/src/cef/libcef_dll/cpptoc/resource_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/resource_handler_cpptoc.h 13251index c3ed893b8db37..fc57f6477248c 13252--- a/src/cef/libcef_dll/cpptoc/resource_handler_cpptoc.h 13253+++ b/src/cef/libcef_dll/cpptoc/resource_handler_cpptoc.h 13254@@ -1,4 +1,4 @@ 13255-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13256+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13257 // reserved. Use of this source code is governed by a BSD-style license that 13258 // can be found in the LICENSE file. 13259 // 13260@@ -9,7 +9,7 @@ 13261 // implementations. See the translator.README.txt file in the tools directory 13262 // for more information. 13263 // 13264-// $hash=a2b9dcc0ff22bd3f1b0ecb70a3e10b6c1c7a0ed7$ 13265+// $hash=3853a8b89137fdd6c71bc86f801536517bde7c88$ 13266 // 13267 13268 #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_HANDLER_CPPTOC_H_ 13269diff --git a/src/cef/libcef_dll/cpptoc/resource_read_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/resource_read_callback_cpptoc.cc 13270index baffa6547229b..0e90a4bf6ea9d 13271--- a/src/cef/libcef_dll/cpptoc/resource_read_callback_cpptoc.cc 13272+++ b/src/cef/libcef_dll/cpptoc/resource_read_callback_cpptoc.cc 13273@@ -1,4 +1,4 @@ 13274-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13275+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13276 // reserved. Use of this source code is governed by a BSD-style license that 13277 // can be found in the LICENSE file. 13278 // 13279@@ -9,7 +9,7 @@ 13280 // implementations. See the translator.README.txt file in the tools directory 13281 // for more information. 13282 // 13283-// $hash=9d07f53404d3b90d1e386e37b0ed4535afb57b39$ 13284+// $hash=cf89b317501cd267ef18b96d934297412e7ddf5c$ 13285 // 13286 13287 #include "libcef_dll/cpptoc/resource_read_callback_cpptoc.h" 13288diff --git a/src/cef/libcef_dll/cpptoc/resource_read_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/resource_read_callback_cpptoc.h 13289index c1b4d1a5970fc..f152b5d2b300c 13290--- a/src/cef/libcef_dll/cpptoc/resource_read_callback_cpptoc.h 13291+++ b/src/cef/libcef_dll/cpptoc/resource_read_callback_cpptoc.h 13292@@ -1,4 +1,4 @@ 13293-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13294+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13295 // reserved. Use of this source code is governed by a BSD-style license that 13296 // can be found in the LICENSE file. 13297 // 13298@@ -9,7 +9,7 @@ 13299 // implementations. See the translator.README.txt file in the tools directory 13300 // for more information. 13301 // 13302-// $hash=7cd5016181dd61511cb1c1d3176d8aff5e5fba82$ 13303+// $hash=f5efbaafb5a54dfb9deb422cf31a0908c8a4cfc3$ 13304 // 13305 13306 #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_READ_CALLBACK_CPPTOC_H_ 13307diff --git a/src/cef/libcef_dll/cpptoc/resource_request_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/resource_request_handler_cpptoc.cc 13308index 3e9cea75bb47f..2462a281cf801 13309--- a/src/cef/libcef_dll/cpptoc/resource_request_handler_cpptoc.cc 13310+++ b/src/cef/libcef_dll/cpptoc/resource_request_handler_cpptoc.cc 13311@@ -1,4 +1,4 @@ 13312-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13313+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13314 // reserved. Use of this source code is governed by a BSD-style license that 13315 // can be found in the LICENSE file. 13316 // 13317@@ -9,7 +9,7 @@ 13318 // implementations. See the translator.README.txt file in the tools directory 13319 // for more information. 13320 // 13321-// $hash=57f1a169f2b2efb6ff3f1ca71aa390fb1d82ed2d$ 13322+// $hash=477291aae432b368ed8195975c5d93b5e19da36e$ 13323 // 13324 13325 #include "libcef_dll/cpptoc/resource_request_handler_cpptoc.h" 13326diff --git a/src/cef/libcef_dll/cpptoc/resource_request_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/resource_request_handler_cpptoc.h 13327index 813e38e8d4af7..7010001717ec1 13328--- a/src/cef/libcef_dll/cpptoc/resource_request_handler_cpptoc.h 13329+++ b/src/cef/libcef_dll/cpptoc/resource_request_handler_cpptoc.h 13330@@ -1,4 +1,4 @@ 13331-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13332+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13333 // reserved. Use of this source code is governed by a BSD-style license that 13334 // can be found in the LICENSE file. 13335 // 13336@@ -9,7 +9,7 @@ 13337 // implementations. See the translator.README.txt file in the tools directory 13338 // for more information. 13339 // 13340-// $hash=a8c2b0d3df6a4c6b336084598084d14f62860a53$ 13341+// $hash=0b8d614a76b9027970354dc850f7b491348a2941$ 13342 // 13343 13344 #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_REQUEST_HANDLER_CPPTOC_H_ 13345diff --git a/src/cef/libcef_dll/cpptoc/resource_skip_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/resource_skip_callback_cpptoc.cc 13346index 41bbad03226bf..2e0aa01963ee7 13347--- a/src/cef/libcef_dll/cpptoc/resource_skip_callback_cpptoc.cc 13348+++ b/src/cef/libcef_dll/cpptoc/resource_skip_callback_cpptoc.cc 13349@@ -1,4 +1,4 @@ 13350-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13351+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13352 // reserved. Use of this source code is governed by a BSD-style license that 13353 // can be found in the LICENSE file. 13354 // 13355@@ -9,7 +9,7 @@ 13356 // implementations. See the translator.README.txt file in the tools directory 13357 // for more information. 13358 // 13359-// $hash=3b4968443aafd1ee42fcc9a5e7b466b38fb98d28$ 13360+// $hash=ce7cc4f550ea769a9d8c3b757c19f9c48e0240d6$ 13361 // 13362 13363 #include "libcef_dll/cpptoc/resource_skip_callback_cpptoc.h" 13364diff --git a/src/cef/libcef_dll/cpptoc/resource_skip_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/resource_skip_callback_cpptoc.h 13365index c173a16715a9b..d7a82710cc2a3 13366--- a/src/cef/libcef_dll/cpptoc/resource_skip_callback_cpptoc.h 13367+++ b/src/cef/libcef_dll/cpptoc/resource_skip_callback_cpptoc.h 13368@@ -1,4 +1,4 @@ 13369-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13370+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13371 // reserved. Use of this source code is governed by a BSD-style license that 13372 // can be found in the LICENSE file. 13373 // 13374@@ -9,7 +9,7 @@ 13375 // implementations. See the translator.README.txt file in the tools directory 13376 // for more information. 13377 // 13378-// $hash=decf49c2d8a337c353d149e9b9392065740eb06d$ 13379+// $hash=5e756fb08a289333025a894573332555a1ab8e1f$ 13380 // 13381 13382 #ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_SKIP_CALLBACK_CPPTOC_H_ 13383diff --git a/src/cef/libcef_dll/cpptoc/response_cpptoc.cc b/src/cef/libcef_dll/cpptoc/response_cpptoc.cc 13384index 1cb1db789fabf..12493c5c8a052 13385--- a/src/cef/libcef_dll/cpptoc/response_cpptoc.cc 13386+++ b/src/cef/libcef_dll/cpptoc/response_cpptoc.cc 13387@@ -1,4 +1,4 @@ 13388-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13389+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13390 // reserved. Use of this source code is governed by a BSD-style license that 13391 // can be found in the LICENSE file. 13392 // 13393@@ -9,7 +9,7 @@ 13394 // implementations. See the translator.README.txt file in the tools directory 13395 // for more information. 13396 // 13397-// $hash=1dc0f59d37e6979ba3f431463671f0feefc45c31$ 13398+// $hash=09e7052fafc6202fa043603c97c56ae4b917a291$ 13399 // 13400 13401 #include "libcef_dll/cpptoc/response_cpptoc.h" 13402diff --git a/src/cef/libcef_dll/cpptoc/response_cpptoc.h b/src/cef/libcef_dll/cpptoc/response_cpptoc.h 13403index 209f550a13c05..b84c6990b56dc 13404--- a/src/cef/libcef_dll/cpptoc/response_cpptoc.h 13405+++ b/src/cef/libcef_dll/cpptoc/response_cpptoc.h 13406@@ -1,4 +1,4 @@ 13407-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13408+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13409 // reserved. Use of this source code is governed by a BSD-style license that 13410 // can be found in the LICENSE file. 13411 // 13412@@ -9,7 +9,7 @@ 13413 // implementations. See the translator.README.txt file in the tools directory 13414 // for more information. 13415 // 13416-// $hash=9bd9fdb8fe353f1af3ac543074cb74b12cdab0c5$ 13417+// $hash=624d1cb515a9f5f44d6e63574021689ccfe09b76$ 13418 // 13419 13420 #ifndef CEF_LIBCEF_DLL_CPPTOC_RESPONSE_CPPTOC_H_ 13421diff --git a/src/cef/libcef_dll/cpptoc/response_filter_cpptoc.cc b/src/cef/libcef_dll/cpptoc/response_filter_cpptoc.cc 13422index 1bc437f06fda8..bee2671e6cf58 13423--- a/src/cef/libcef_dll/cpptoc/response_filter_cpptoc.cc 13424+++ b/src/cef/libcef_dll/cpptoc/response_filter_cpptoc.cc 13425@@ -1,4 +1,4 @@ 13426-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13427+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13428 // reserved. Use of this source code is governed by a BSD-style license that 13429 // can be found in the LICENSE file. 13430 // 13431@@ -9,7 +9,7 @@ 13432 // implementations. See the translator.README.txt file in the tools directory 13433 // for more information. 13434 // 13435-// $hash=b6721a12a6b018187b3ccc87557beb29be130100$ 13436+// $hash=490594608437694d853b132444163af6352eb1e5$ 13437 // 13438 13439 #include "libcef_dll/cpptoc/response_filter_cpptoc.h" 13440diff --git a/src/cef/libcef_dll/cpptoc/response_filter_cpptoc.h b/src/cef/libcef_dll/cpptoc/response_filter_cpptoc.h 13441index b79d579543cd1..c17599dcf97cf 13442--- a/src/cef/libcef_dll/cpptoc/response_filter_cpptoc.h 13443+++ b/src/cef/libcef_dll/cpptoc/response_filter_cpptoc.h 13444@@ -1,4 +1,4 @@ 13445-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13446+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13447 // reserved. Use of this source code is governed by a BSD-style license that 13448 // can be found in the LICENSE file. 13449 // 13450@@ -9,7 +9,7 @@ 13451 // implementations. See the translator.README.txt file in the tools directory 13452 // for more information. 13453 // 13454-// $hash=6ef35ca53f2bd4523397d3f56b02ca9b40a811f9$ 13455+// $hash=55d4dc0a6467d6d084de5e1114be0fcd36ae89b9$ 13456 // 13457 13458 #ifndef CEF_LIBCEF_DLL_CPPTOC_RESPONSE_FILTER_CPPTOC_H_ 13459diff --git a/src/cef/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc 13460index 8cf46c83661fe..9f2df1a061d16 13461--- a/src/cef/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc 13462+++ b/src/cef/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc 13463@@ -1,4 +1,4 @@ 13464-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13465+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13466 // reserved. Use of this source code is governed by a BSD-style license that 13467 // can be found in the LICENSE file. 13468 // 13469@@ -9,7 +9,7 @@ 13470 // implementations. See the translator.README.txt file in the tools directory 13471 // for more information. 13472 // 13473-// $hash=d76ba7de3a561c71b88250340676e56dc7a9f84a$ 13474+// $hash=ee06834316c98179b98e7226f89b8a630a11de2b$ 13475 // 13476 13477 #include "libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h" 13478diff --git a/src/cef/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h 13479index 20124e44f363f..954af2789749f 13480--- a/src/cef/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h 13481+++ b/src/cef/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h 13482@@ -1,4 +1,4 @@ 13483-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13484+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13485 // reserved. Use of this source code is governed by a BSD-style license that 13486 // can be found in the LICENSE file. 13487 // 13488@@ -9,7 +9,7 @@ 13489 // implementations. See the translator.README.txt file in the tools directory 13490 // for more information. 13491 // 13492-// $hash=d8003b6de1b89c64b2d5b53ea1665dda982effb9$ 13493+// $hash=a41928b718004e3e8cc92ba620b20f76ad9181b7$ 13494 // 13495 13496 #ifndef CEF_LIBCEF_DLL_CPPTOC_RUN_CONTEXT_MENU_CALLBACK_CPPTOC_H_ 13497diff --git a/src/cef/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc 13498index 33705ecbbfad3..ddfba315fc959 13499--- a/src/cef/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc 13500+++ b/src/cef/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc 13501@@ -1,4 +1,4 @@ 13502-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13503+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13504 // reserved. Use of this source code is governed by a BSD-style license that 13505 // can be found in the LICENSE file. 13506 // 13507@@ -9,7 +9,7 @@ 13508 // implementations. See the translator.README.txt file in the tools directory 13509 // for more information. 13510 // 13511-// $hash=2e6aa9015192a3704df073f7dad0c6fa3b05f76c$ 13512+// $hash=9b4502e14a4597158e56d4a5ea3307e9798499f9$ 13513 // 13514 13515 #include "libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h" 13516diff --git a/src/cef/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h 13517index 50dc062cb0887..c5dac2e3f32ee 13518--- a/src/cef/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h 13519+++ b/src/cef/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h 13520@@ -1,4 +1,4 @@ 13521-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13522+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13523 // reserved. Use of this source code is governed by a BSD-style license that 13524 // can be found in the LICENSE file. 13525 // 13526@@ -9,7 +9,7 @@ 13527 // implementations. See the translator.README.txt file in the tools directory 13528 // for more information. 13529 // 13530-// $hash=6542e83e5f1a6694575c89e628ee11da17bb6624$ 13531+// $hash=7f45e5e5b3772e10b2eb6901c3e27e835a873163$ 13532 // 13533 13534 #ifndef CEF_LIBCEF_DLL_CPPTOC_RUN_FILE_DIALOG_CALLBACK_CPPTOC_H_ 13535diff --git a/src/cef/libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.cc 13536index 477c530ed458b..4102d17e00099 13537--- a/src/cef/libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.cc 13538+++ b/src/cef/libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.cc 13539@@ -1,4 +1,4 @@ 13540-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13541+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13542 // reserved. Use of this source code is governed by a BSD-style license that 13543 // can be found in the LICENSE file. 13544 // 13545@@ -9,7 +9,7 @@ 13546 // implementations. See the translator.README.txt file in the tools directory 13547 // for more information. 13548 // 13549-// $hash=51e850e2768a6ec8ec7d764830d27138334d82ac$ 13550+// $hash=2695b1c7532d10e5f337c353a51d1e5e97667b9e$ 13551 // 13552 13553 #include "libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.h" 13554diff --git a/src/cef/libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.h 13555index 355cfa24d1451..b8fa640fd2927 13556--- a/src/cef/libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.h 13557+++ b/src/cef/libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.h 13558@@ -1,4 +1,4 @@ 13559-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13560+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13561 // reserved. Use of this source code is governed by a BSD-style license that 13562 // can be found in the LICENSE file. 13563 // 13564@@ -9,7 +9,7 @@ 13565 // implementations. See the translator.README.txt file in the tools directory 13566 // for more information. 13567 // 13568-// $hash=b641fe8119fa5ab3e3a635105ca25985dec40bd0$ 13569+// $hash=acc845289f80273062c7fde7d81e0c034a80f4e1$ 13570 // 13571 13572 #ifndef CEF_LIBCEF_DLL_CPPTOC_RUN_QUICK_MENU_CALLBACK_CPPTOC_H_ 13573diff --git a/src/cef/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc b/src/cef/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc 13574index 759f5f9dc127d..40801cdfffd21 13575--- a/src/cef/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc 13576+++ b/src/cef/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc 13577@@ -1,4 +1,4 @@ 13578-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13579+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13580 // reserved. Use of this source code is governed by a BSD-style license that 13581 // can be found in the LICENSE file. 13582 // 13583@@ -9,7 +9,7 @@ 13584 // implementations. See the translator.README.txt file in the tools directory 13585 // for more information. 13586 // 13587-// $hash=abd81866575f873556b4ae40313ea65c89219756$ 13588+// $hash=96fb6718f22acb2425f9fe31f64bd7c71531a2a8$ 13589 // 13590 13591 #include "libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h" 13592diff --git a/src/cef/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h b/src/cef/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h 13593index 1c442fae769d1..75daf7c15c851 13594--- a/src/cef/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h 13595+++ b/src/cef/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h 13596@@ -1,4 +1,4 @@ 13597-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13598+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13599 // reserved. Use of this source code is governed by a BSD-style license that 13600 // can be found in the LICENSE file. 13601 // 13602@@ -9,7 +9,7 @@ 13603 // implementations. See the translator.README.txt file in the tools directory 13604 // for more information. 13605 // 13606-// $hash=b119c6e375aee04bc83623c73f61b7eb39af16f5$ 13607+// $hash=746b9d06b417c9730fa98fa456a08e5c53e5475b$ 13608 // 13609 13610 #ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ 13611diff --git a/src/cef/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc b/src/cef/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc 13612index aee5e11789d13..622aee176c3a7 13613--- a/src/cef/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc 13614+++ b/src/cef/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc 13615@@ -1,4 +1,4 @@ 13616-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13617+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13618 // reserved. Use of this source code is governed by a BSD-style license that 13619 // can be found in the LICENSE file. 13620 // 13621@@ -9,7 +9,7 @@ 13622 // implementations. See the translator.README.txt file in the tools directory 13623 // for more information. 13624 // 13625-// $hash=c028de29ae5b48ed41d4e8b8ae3df9a0ee765e14$ 13626+// $hash=aef6d4c3a2016f1cfd4c9aff12d59302b2dba3a8$ 13627 // 13628 13629 #include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h" 13630diff --git a/src/cef/libcef_dll/cpptoc/scheme_registrar_cpptoc.h b/src/cef/libcef_dll/cpptoc/scheme_registrar_cpptoc.h 13631index 6f0265be6a39d..3966e2167ad34 13632--- a/src/cef/libcef_dll/cpptoc/scheme_registrar_cpptoc.h 13633+++ b/src/cef/libcef_dll/cpptoc/scheme_registrar_cpptoc.h 13634@@ -1,4 +1,4 @@ 13635-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13636+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13637 // reserved. Use of this source code is governed by a BSD-style license that 13638 // can be found in the LICENSE file. 13639 // 13640@@ -9,7 +9,7 @@ 13641 // implementations. See the translator.README.txt file in the tools directory 13642 // for more information. 13643 // 13644-// $hash=f14ceae023fe1f52e53b26edb60667203b919178$ 13645+// $hash=92c5fb1f7d14753510b029f71579a26970f0304c$ 13646 // 13647 13648 #ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_REGISTRAR_CPPTOC_H_ 13649diff --git a/src/cef/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc 13650index 353d69c68b20f..a74df760f3773 13651--- a/src/cef/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc 13652+++ b/src/cef/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc 13653@@ -1,4 +1,4 @@ 13654-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13655+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13656 // reserved. Use of this source code is governed by a BSD-style license that 13657 // can be found in the LICENSE file. 13658 // 13659@@ -9,7 +9,7 @@ 13660 // implementations. See the translator.README.txt file in the tools directory 13661 // for more information. 13662 // 13663-// $hash=d20b8b121892f6d2fe0f944c4447464ab6657feb$ 13664+// $hash=09750a65f47197298e8600d97c627fb6ee233800$ 13665 // 13666 13667 #include "libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h" 13668diff --git a/src/cef/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h 13669index 678ce51dd6dd4..34cc05d56dfca 13670--- a/src/cef/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h 13671+++ b/src/cef/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h 13672@@ -1,4 +1,4 @@ 13673-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13674+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13675 // reserved. Use of this source code is governed by a BSD-style license that 13676 // can be found in the LICENSE file. 13677 // 13678@@ -9,7 +9,7 @@ 13679 // implementations. See the translator.README.txt file in the tools directory 13680 // for more information. 13681 // 13682-// $hash=3cfa40dde5fccdecbb2d598b20e1d76cc13f4c34$ 13683+// $hash=31869f5383d73caf6fa9b3fede9f2e47f54a01ae$ 13684 // 13685 13686 #ifndef CEF_LIBCEF_DLL_CPPTOC_SELECT_CLIENT_CERTIFICATE_CALLBACK_CPPTOC_H_ 13687diff --git a/src/cef/libcef_dll/cpptoc/select_popup_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/select_popup_callback_cpptoc.cc 13688new file mode 100644 13689index 0000000000000..15e1bd299ba6d 13690--- /dev/null 13691+++ b/src/cef/libcef_dll/cpptoc/select_popup_callback_cpptoc.cc 13692@@ -0,0 +1,95 @@ 13693+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13694+// reserved. Use of this source code is governed by a BSD-style license that 13695+// can be found in the LICENSE file. 13696+// 13697+// --------------------------------------------------------------------------- 13698+// 13699+// This file was generated by the CEF translator tool. If making changes by 13700+// hand only do so within the body of existing method and function 13701+// implementations. See the translator.README.txt file in the tools directory 13702+// for more information. 13703+// 13704+// $hash=8d79b93a23482ece6217a0a113578c32e6926f94$ 13705+// 13706+ 13707+#include "libcef_dll/cpptoc/select_popup_callback_cpptoc.h" 13708+#include "libcef_dll/shutdown_checker.h" 13709+ 13710+namespace { 13711+ 13712+// MEMBER FUNCTIONS - Body may be edited by hand. 13713+ 13714+void CEF_CALLBACK 13715+select_popup_callback_cont(struct _cef_select_popup_callback_t* self, 13716+ size_t indicesCount, 13717+ int const* indices) { 13718+ shutdown_checker::AssertNotShutdown(); 13719+ 13720+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 13721+ 13722+ DCHECK(self); 13723+ if (!self) 13724+ return; 13725+ // Verify param: indices; type: simple_vec_byref_const 13726+ DCHECK(indicesCount == 0 || indices); 13727+ if (indicesCount > 0 && !indices) 13728+ return; 13729+ 13730+ // Translate param: indices; type: simple_vec_byref_const 13731+ std::vector<int> indicesList; 13732+ if (indicesCount > 0) { 13733+ for (size_t i = 0; i < indicesCount; ++i) { 13734+ int indicesVal = indices[i]; 13735+ indicesList.push_back(indicesVal); 13736+ } 13737+ } 13738+ 13739+ // Execute 13740+ CefSelectPopupCallbackCppToC::Get(self)->Continue(indicesList); 13741+} 13742+ 13743+void CEF_CALLBACK 13744+select_popup_callback_cancel(struct _cef_select_popup_callback_t* self) { 13745+ shutdown_checker::AssertNotShutdown(); 13746+ 13747+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 13748+ 13749+ DCHECK(self); 13750+ if (!self) 13751+ return; 13752+ 13753+ // Execute 13754+ CefSelectPopupCallbackCppToC::Get(self)->Cancel(); 13755+} 13756+ 13757+} // namespace 13758+ 13759+// CONSTRUCTOR - Do not edit by hand. 13760+ 13761+CefSelectPopupCallbackCppToC::CefSelectPopupCallbackCppToC() { 13762+ GetStruct()->cont = select_popup_callback_cont; 13763+ GetStruct()->cancel = select_popup_callback_cancel; 13764+} 13765+ 13766+// DESTRUCTOR - Do not edit by hand. 13767+ 13768+CefSelectPopupCallbackCppToC::~CefSelectPopupCallbackCppToC() { 13769+ shutdown_checker::AssertNotShutdown(); 13770+} 13771+ 13772+template <> 13773+CefRefPtr<CefSelectPopupCallback> CefCppToCRefCounted< 13774+ CefSelectPopupCallbackCppToC, 13775+ CefSelectPopupCallback, 13776+ cef_select_popup_callback_t>::UnwrapDerived(CefWrapperType type, 13777+ cef_select_popup_callback_t* 13778+ s) { 13779+ NOTREACHED() << "Unexpected class type: " << type; 13780+ return nullptr; 13781+} 13782+ 13783+template <> 13784+CefWrapperType CefCppToCRefCounted<CefSelectPopupCallbackCppToC, 13785+ CefSelectPopupCallback, 13786+ cef_select_popup_callback_t>::kWrapperType = 13787+ WT_SELECT_POPUP_CALLBACK; 13788diff --git a/src/cef/libcef_dll/cpptoc/select_popup_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/select_popup_callback_cpptoc.h 13789new file mode 100644 13790index 0000000000000..75c11dffe90f1 13791--- /dev/null 13792+++ b/src/cef/libcef_dll/cpptoc/select_popup_callback_cpptoc.h 13793@@ -0,0 +1,38 @@ 13794+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13795+// reserved. Use of this source code is governed by a BSD-style license that 13796+// can be found in the LICENSE file. 13797+// 13798+// --------------------------------------------------------------------------- 13799+// 13800+// This file was generated by the CEF translator tool. If making changes by 13801+// hand only do so within the body of existing method and function 13802+// implementations. See the translator.README.txt file in the tools directory 13803+// for more information. 13804+// 13805+// $hash=38cd12caaee1fc018d0fd04eee914774eec7c41c$ 13806+// 13807+ 13808+#ifndef CEF_LIBCEF_DLL_CPPTOC_SELECT_POPUP_CALLBACK_CPPTOC_H_ 13809+#define CEF_LIBCEF_DLL_CPPTOC_SELECT_POPUP_CALLBACK_CPPTOC_H_ 13810+#pragma once 13811+ 13812+#if !defined(BUILDING_CEF_SHARED) 13813+#error This file can be included DLL-side only 13814+#endif 13815+ 13816+#include "include/capi/cef_dialog_handler_capi.h" 13817+#include "include/cef_dialog_handler.h" 13818+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h" 13819+ 13820+// Wrap a C++ class with a C structure. 13821+// This class may be instantiated and accessed DLL-side only. 13822+class CefSelectPopupCallbackCppToC 13823+ : public CefCppToCRefCounted<CefSelectPopupCallbackCppToC, 13824+ CefSelectPopupCallback, 13825+ cef_select_popup_callback_t> { 13826+ public: 13827+ CefSelectPopupCallbackCppToC(); 13828+ virtual ~CefSelectPopupCallbackCppToC(); 13829+}; 13830+ 13831+#endif // CEF_LIBCEF_DLL_CPPTOC_SELECT_POPUP_CALLBACK_CPPTOC_H_ 13832diff --git a/src/cef/libcef_dll/cpptoc/server_cpptoc.cc b/src/cef/libcef_dll/cpptoc/server_cpptoc.cc 13833index f6be3490c7cfb..48086176f16f6 13834--- a/src/cef/libcef_dll/cpptoc/server_cpptoc.cc 13835+++ b/src/cef/libcef_dll/cpptoc/server_cpptoc.cc 13836@@ -1,4 +1,4 @@ 13837-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13838+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13839 // reserved. Use of this source code is governed by a BSD-style license that 13840 // can be found in the LICENSE file. 13841 // 13842@@ -9,7 +9,7 @@ 13843 // implementations. See the translator.README.txt file in the tools directory 13844 // for more information. 13845 // 13846-// $hash=d0cfc5e4c052a2d1fe43d1c0ae264642db03c04c$ 13847+// $hash=abf39f5a0fa0be81e8c8fbd743ea6f4f4c2e14c3$ 13848 // 13849 13850 #include "libcef_dll/cpptoc/server_cpptoc.h" 13851diff --git a/src/cef/libcef_dll/cpptoc/server_cpptoc.h b/src/cef/libcef_dll/cpptoc/server_cpptoc.h 13852index fb99d54f7e0c5..fd191b03c17c5 13853--- a/src/cef/libcef_dll/cpptoc/server_cpptoc.h 13854+++ b/src/cef/libcef_dll/cpptoc/server_cpptoc.h 13855@@ -1,4 +1,4 @@ 13856-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13857+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13858 // reserved. Use of this source code is governed by a BSD-style license that 13859 // can be found in the LICENSE file. 13860 // 13861@@ -9,7 +9,7 @@ 13862 // implementations. See the translator.README.txt file in the tools directory 13863 // for more information. 13864 // 13865-// $hash=a36274939df284287ac49a8ec9321f8188d4fddb$ 13866+// $hash=edf9787173ef035101e1d1805f2926b6028530f8$ 13867 // 13868 13869 #ifndef CEF_LIBCEF_DLL_CPPTOC_SERVER_CPPTOC_H_ 13870diff --git a/src/cef/libcef_dll/cpptoc/server_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/server_handler_cpptoc.cc 13871index 2688d1cc03137..e72635d24eb69 13872--- a/src/cef/libcef_dll/cpptoc/server_handler_cpptoc.cc 13873+++ b/src/cef/libcef_dll/cpptoc/server_handler_cpptoc.cc 13874@@ -1,4 +1,4 @@ 13875-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13876+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13877 // reserved. Use of this source code is governed by a BSD-style license that 13878 // can be found in the LICENSE file. 13879 // 13880@@ -9,7 +9,7 @@ 13881 // implementations. See the translator.README.txt file in the tools directory 13882 // for more information. 13883 // 13884-// $hash=2ef239c7779477feb8808f2198e7d2063ab74156$ 13885+// $hash=37a840b566aadeeddaa21af7fa5fda4c222b5571$ 13886 // 13887 13888 #include "libcef_dll/cpptoc/server_handler_cpptoc.h" 13889diff --git a/src/cef/libcef_dll/cpptoc/server_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/server_handler_cpptoc.h 13890index a4c951c65a04f..c452567a21858 13891--- a/src/cef/libcef_dll/cpptoc/server_handler_cpptoc.h 13892+++ b/src/cef/libcef_dll/cpptoc/server_handler_cpptoc.h 13893@@ -1,4 +1,4 @@ 13894-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13895+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13896 // reserved. Use of this source code is governed by a BSD-style license that 13897 // can be found in the LICENSE file. 13898 // 13899@@ -9,7 +9,7 @@ 13900 // implementations. See the translator.README.txt file in the tools directory 13901 // for more information. 13902 // 13903-// $hash=754575fa090b971fc9105fecda97a407ef0d2484$ 13904+// $hash=ba72a7b9571b7e2d9d490a02972855eca1ff987f$ 13905 // 13906 13907 #ifndef CEF_LIBCEF_DLL_CPPTOC_SERVER_HANDLER_CPPTOC_H_ 13908diff --git a/src/cef/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc 13909index b4beccccd3aed..87bcae9676afe 13910--- a/src/cef/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc 13911+++ b/src/cef/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc 13912@@ -1,4 +1,4 @@ 13913-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13914+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13915 // reserved. Use of this source code is governed by a BSD-style license that 13916 // can be found in the LICENSE file. 13917 // 13918@@ -9,7 +9,7 @@ 13919 // implementations. See the translator.README.txt file in the tools directory 13920 // for more information. 13921 // 13922-// $hash=99f02c8911b913161cfd3834e19bbdc0ba542409$ 13923+// $hash=1672096b07c52bafaa15e3e195116c2a4b30f938$ 13924 // 13925 13926 #include "libcef_dll/cpptoc/set_cookie_callback_cpptoc.h" 13927diff --git a/src/cef/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h 13928index 72e21124994a8..85c34421bd1d8 13929--- a/src/cef/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h 13930+++ b/src/cef/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h 13931@@ -1,4 +1,4 @@ 13932-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13933+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13934 // reserved. Use of this source code is governed by a BSD-style license that 13935 // can be found in the LICENSE file. 13936 // 13937@@ -9,7 +9,7 @@ 13938 // implementations. See the translator.README.txt file in the tools directory 13939 // for more information. 13940 // 13941-// $hash=3e86bf9e36a3ef63e6777dcafee8847bd4965a60$ 13942+// $hash=886b832f912900c89787888566d4d5e803c91ebc$ 13943 // 13944 13945 #ifndef CEF_LIBCEF_DLL_CPPTOC_SET_COOKIE_CALLBACK_CPPTOC_H_ 13946diff --git a/src/cef/libcef_dll/cpptoc/sslinfo_cpptoc.cc b/src/cef/libcef_dll/cpptoc/sslinfo_cpptoc.cc 13947index 7251adfda8853..2da00fed8c046 13948--- a/src/cef/libcef_dll/cpptoc/sslinfo_cpptoc.cc 13949+++ b/src/cef/libcef_dll/cpptoc/sslinfo_cpptoc.cc 13950@@ -1,4 +1,4 @@ 13951-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13952+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13953 // reserved. Use of this source code is governed by a BSD-style license that 13954 // can be found in the LICENSE file. 13955 // 13956@@ -9,7 +9,7 @@ 13957 // implementations. See the translator.README.txt file in the tools directory 13958 // for more information. 13959 // 13960-// $hash=78b529fc88b9701f7cf8d40097576704b0ef35fc$ 13961+// $hash=bd192e23b1985c9413ec6b09b7b1854ea65b5590$ 13962 // 13963 13964 #include "libcef_dll/cpptoc/sslinfo_cpptoc.h" 13965diff --git a/src/cef/libcef_dll/cpptoc/sslinfo_cpptoc.h b/src/cef/libcef_dll/cpptoc/sslinfo_cpptoc.h 13966index 3dc2625904e5c..bb9576808edca 13967--- a/src/cef/libcef_dll/cpptoc/sslinfo_cpptoc.h 13968+++ b/src/cef/libcef_dll/cpptoc/sslinfo_cpptoc.h 13969@@ -1,4 +1,4 @@ 13970-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13971+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13972 // reserved. Use of this source code is governed by a BSD-style license that 13973 // can be found in the LICENSE file. 13974 // 13975@@ -9,7 +9,7 @@ 13976 // implementations. See the translator.README.txt file in the tools directory 13977 // for more information. 13978 // 13979-// $hash=00ab5a37c56c5bd5f14ae97f72338a32615214b7$ 13980+// $hash=2eaaaeef70817cde9783efe192d0f57cb73ddfad$ 13981 // 13982 13983 #ifndef CEF_LIBCEF_DLL_CPPTOC_SSLINFO_CPPTOC_H_ 13984diff --git a/src/cef/libcef_dll/cpptoc/sslstatus_cpptoc.cc b/src/cef/libcef_dll/cpptoc/sslstatus_cpptoc.cc 13985index 92073dfc08fc2..840136f745795 13986--- a/src/cef/libcef_dll/cpptoc/sslstatus_cpptoc.cc 13987+++ b/src/cef/libcef_dll/cpptoc/sslstatus_cpptoc.cc 13988@@ -1,4 +1,4 @@ 13989-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 13990+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 13991 // reserved. Use of this source code is governed by a BSD-style license that 13992 // can be found in the LICENSE file. 13993 // 13994@@ -9,7 +9,7 @@ 13995 // implementations. See the translator.README.txt file in the tools directory 13996 // for more information. 13997 // 13998-// $hash=8596e5de45842c1e1de8e6377c2b7d932218c370$ 13999+// $hash=f645a1528c4091733cdd8b93c7d076c11cb8a329$ 14000 // 14001 14002 #include "libcef_dll/cpptoc/sslstatus_cpptoc.h" 14003diff --git a/src/cef/libcef_dll/cpptoc/sslstatus_cpptoc.h b/src/cef/libcef_dll/cpptoc/sslstatus_cpptoc.h 14004index 2d45ad428005a..4e5379fbd6828 14005--- a/src/cef/libcef_dll/cpptoc/sslstatus_cpptoc.h 14006+++ b/src/cef/libcef_dll/cpptoc/sslstatus_cpptoc.h 14007@@ -1,4 +1,4 @@ 14008-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14009+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14010 // reserved. Use of this source code is governed by a BSD-style license that 14011 // can be found in the LICENSE file. 14012 // 14013@@ -9,7 +9,7 @@ 14014 // implementations. See the translator.README.txt file in the tools directory 14015 // for more information. 14016 // 14017-// $hash=8f0a00c305a6defdcbf4caa2ea437cefe49a191f$ 14018+// $hash=dba266754e189de39172bddaacf0dfa3fdd79351$ 14019 // 14020 14021 #ifndef CEF_LIBCEF_DLL_CPPTOC_SSLSTATUS_CPPTOC_H_ 14022diff --git a/src/cef/libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.cc 14023index 4c69ff14accfb..9289ae8db375b 14024--- a/src/cef/libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.cc 14025+++ b/src/cef/libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.cc 14026@@ -1,4 +1,4 @@ 14027-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14028+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14029 // reserved. Use of this source code is governed by a BSD-style license that 14030 // can be found in the LICENSE file. 14031 // 14032@@ -9,7 +9,7 @@ 14033 // implementations. See the translator.README.txt file in the tools directory 14034 // for more information. 14035 // 14036-// $hash=63e0d5c68603a8478c9b8a638618c9b6554665cb$ 14037+// $hash=018aea8a22d2cd56b94fdb4afe6cda26e5267e50$ 14038 // 14039 14040 #include "libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.h" 14041diff --git a/src/cef/libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.h 14042index c80f743fff7ae..3df50719b18f0 14043--- a/src/cef/libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.h 14044+++ b/src/cef/libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.h 14045@@ -1,4 +1,4 @@ 14046-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14047+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14048 // reserved. Use of this source code is governed by a BSD-style license that 14049 // can be found in the LICENSE file. 14050 // 14051@@ -9,7 +9,7 @@ 14052 // implementations. See the translator.README.txt file in the tools directory 14053 // for more information. 14054 // 14055-// $hash=1471041bc8e9230b7bef9e42aabaf441e641ab96$ 14056+// $hash=a9b06d8d2a8a85752732cfdc632a1c67070f2a3a$ 14057 // 14058 14059 #ifndef CEF_LIBCEF_DLL_CPPTOC_STORE_WEB_ARCHIVE_RESULT_CALLBACK_CPPTOC_H_ 14060diff --git a/src/cef/libcef_dll/cpptoc/stream_reader_cpptoc.cc b/src/cef/libcef_dll/cpptoc/stream_reader_cpptoc.cc 14061index 3d6b7f73788a9..3d1273476ce61 14062--- a/src/cef/libcef_dll/cpptoc/stream_reader_cpptoc.cc 14063+++ b/src/cef/libcef_dll/cpptoc/stream_reader_cpptoc.cc 14064@@ -1,4 +1,4 @@ 14065-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14066+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14067 // reserved. Use of this source code is governed by a BSD-style license that 14068 // can be found in the LICENSE file. 14069 // 14070@@ -9,7 +9,7 @@ 14071 // implementations. See the translator.README.txt file in the tools directory 14072 // for more information. 14073 // 14074-// $hash=fcbdc299c4f34868f817a9b77777a9b88f3cf07b$ 14075+// $hash=5301e5393a92345b12208721df602fd8f9d25abe$ 14076 // 14077 14078 #include "libcef_dll/cpptoc/stream_reader_cpptoc.h" 14079diff --git a/src/cef/libcef_dll/cpptoc/stream_reader_cpptoc.h b/src/cef/libcef_dll/cpptoc/stream_reader_cpptoc.h 14080index df8cc7fd6f642..d4d5dc5aab651 14081--- a/src/cef/libcef_dll/cpptoc/stream_reader_cpptoc.h 14082+++ b/src/cef/libcef_dll/cpptoc/stream_reader_cpptoc.h 14083@@ -1,4 +1,4 @@ 14084-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14085+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14086 // reserved. Use of this source code is governed by a BSD-style license that 14087 // can be found in the LICENSE file. 14088 // 14089@@ -9,7 +9,7 @@ 14090 // implementations. See the translator.README.txt file in the tools directory 14091 // for more information. 14092 // 14093-// $hash=c98bd38e350a4b24d11039a326e8df7fb86bfc75$ 14094+// $hash=6482aca1d5d2c06d39d226f2d085580abc8eee99$ 14095 // 14096 14097 #ifndef CEF_LIBCEF_DLL_CPPTOC_STREAM_READER_CPPTOC_H_ 14098diff --git a/src/cef/libcef_dll/cpptoc/stream_writer_cpptoc.cc b/src/cef/libcef_dll/cpptoc/stream_writer_cpptoc.cc 14099index d402161f2d7d7..8b73d15c90576 14100--- a/src/cef/libcef_dll/cpptoc/stream_writer_cpptoc.cc 14101+++ b/src/cef/libcef_dll/cpptoc/stream_writer_cpptoc.cc 14102@@ -1,4 +1,4 @@ 14103-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14104+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14105 // reserved. Use of this source code is governed by a BSD-style license that 14106 // can be found in the LICENSE file. 14107 // 14108@@ -9,7 +9,7 @@ 14109 // implementations. See the translator.README.txt file in the tools directory 14110 // for more information. 14111 // 14112-// $hash=ac20659d83a6efb764f3b55756dbc8c686fc5363$ 14113+// $hash=5f8cba4541a5f92cbbe2c9aad2ec270528f597cb$ 14114 // 14115 14116 #include "libcef_dll/cpptoc/stream_writer_cpptoc.h" 14117diff --git a/src/cef/libcef_dll/cpptoc/stream_writer_cpptoc.h b/src/cef/libcef_dll/cpptoc/stream_writer_cpptoc.h 14118index 815bc3feba6e9..0a5ed64e89418 14119--- a/src/cef/libcef_dll/cpptoc/stream_writer_cpptoc.h 14120+++ b/src/cef/libcef_dll/cpptoc/stream_writer_cpptoc.h 14121@@ -1,4 +1,4 @@ 14122-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14123+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14124 // reserved. Use of this source code is governed by a BSD-style license that 14125 // can be found in the LICENSE file. 14126 // 14127@@ -9,7 +9,7 @@ 14128 // implementations. See the translator.README.txt file in the tools directory 14129 // for more information. 14130 // 14131-// $hash=9204925136614f1d4e4f4609ea6ee30dad0c2782$ 14132+// $hash=7b95fc6bea4023038075ee6712eaceb6c0a153a8$ 14133 // 14134 14135 #ifndef CEF_LIBCEF_DLL_CPPTOC_STREAM_WRITER_CPPTOC_H_ 14136diff --git a/src/cef/libcef_dll/cpptoc/string_visitor_cpptoc.cc b/src/cef/libcef_dll/cpptoc/string_visitor_cpptoc.cc 14137index 34e6a844d3faa..cb498b859fe14 14138--- a/src/cef/libcef_dll/cpptoc/string_visitor_cpptoc.cc 14139+++ b/src/cef/libcef_dll/cpptoc/string_visitor_cpptoc.cc 14140@@ -1,4 +1,4 @@ 14141-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14142+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14143 // reserved. Use of this source code is governed by a BSD-style license that 14144 // can be found in the LICENSE file. 14145 // 14146@@ -9,7 +9,7 @@ 14147 // implementations. See the translator.README.txt file in the tools directory 14148 // for more information. 14149 // 14150-// $hash=cad58a7370ef2b36aacb2fdf527fe1c061f4a868$ 14151+// $hash=5e22146a6ab1326e04c4de9d822b663e9ce6dee4$ 14152 // 14153 14154 #include "libcef_dll/cpptoc/string_visitor_cpptoc.h" 14155diff --git a/src/cef/libcef_dll/cpptoc/string_visitor_cpptoc.h b/src/cef/libcef_dll/cpptoc/string_visitor_cpptoc.h 14156index 672cf3dab8c50..86a2b46fbd7f4 14157--- a/src/cef/libcef_dll/cpptoc/string_visitor_cpptoc.h 14158+++ b/src/cef/libcef_dll/cpptoc/string_visitor_cpptoc.h 14159@@ -1,4 +1,4 @@ 14160-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14161+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14162 // reserved. Use of this source code is governed by a BSD-style license that 14163 // can be found in the LICENSE file. 14164 // 14165@@ -9,7 +9,7 @@ 14166 // implementations. See the translator.README.txt file in the tools directory 14167 // for more information. 14168 // 14169-// $hash=4cf29c1d2d715dee4855acda840ca47d5f1fabbf$ 14170+// $hash=8f717e4df178cef8f90d5af081094a4952fcc90e$ 14171 // 14172 14173 #ifndef CEF_LIBCEF_DLL_CPPTOC_STRING_VISITOR_CPPTOC_H_ 14174diff --git a/src/cef/libcef_dll/cpptoc/task_cpptoc.cc b/src/cef/libcef_dll/cpptoc/task_cpptoc.cc 14175index ef51cfac7b44c..3a65c73ba29a3 14176--- a/src/cef/libcef_dll/cpptoc/task_cpptoc.cc 14177+++ b/src/cef/libcef_dll/cpptoc/task_cpptoc.cc 14178@@ -1,4 +1,4 @@ 14179-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14180+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14181 // reserved. Use of this source code is governed by a BSD-style license that 14182 // can be found in the LICENSE file. 14183 // 14184@@ -9,7 +9,7 @@ 14185 // implementations. See the translator.README.txt file in the tools directory 14186 // for more information. 14187 // 14188-// $hash=47bacb389bbb262f0be39b49c5d6251b8bf1c507$ 14189+// $hash=d9ce29d70c61b486d32a45e8908b317f3b191a8b$ 14190 // 14191 14192 #include "libcef_dll/cpptoc/task_cpptoc.h" 14193diff --git a/src/cef/libcef_dll/cpptoc/task_cpptoc.h b/src/cef/libcef_dll/cpptoc/task_cpptoc.h 14194index cdf9aab98e552..9a702d94f5a1d 14195--- a/src/cef/libcef_dll/cpptoc/task_cpptoc.h 14196+++ b/src/cef/libcef_dll/cpptoc/task_cpptoc.h 14197@@ -1,4 +1,4 @@ 14198-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14199+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14200 // reserved. Use of this source code is governed by a BSD-style license that 14201 // can be found in the LICENSE file. 14202 // 14203@@ -9,7 +9,7 @@ 14204 // implementations. See the translator.README.txt file in the tools directory 14205 // for more information. 14206 // 14207-// $hash=a22ba7af43964082c9e8570da140389ca9953a12$ 14208+// $hash=32859b75e638cd76a9319561b675fa3583818905$ 14209 // 14210 14211 #ifndef CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ 14212diff --git a/src/cef/libcef_dll/cpptoc/task_runner_cpptoc.cc b/src/cef/libcef_dll/cpptoc/task_runner_cpptoc.cc 14213index 435cada85f56c..b814b90b9d4f2 14214--- a/src/cef/libcef_dll/cpptoc/task_runner_cpptoc.cc 14215+++ b/src/cef/libcef_dll/cpptoc/task_runner_cpptoc.cc 14216@@ -1,4 +1,4 @@ 14217-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14218+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14219 // reserved. Use of this source code is governed by a BSD-style license that 14220 // can be found in the LICENSE file. 14221 // 14222@@ -9,7 +9,7 @@ 14223 // implementations. See the translator.README.txt file in the tools directory 14224 // for more information. 14225 // 14226-// $hash=7c1bd7fe9f9c91bc488299a2278f83a0850befe7$ 14227+// $hash=cc3f60147bbed7acd8e4d111a53bf519757687b2$ 14228 // 14229 14230 #include "libcef_dll/cpptoc/task_runner_cpptoc.h" 14231diff --git a/src/cef/libcef_dll/cpptoc/task_runner_cpptoc.h b/src/cef/libcef_dll/cpptoc/task_runner_cpptoc.h 14232index 9a8f6ded34aa7..d462c7e147832 14233--- a/src/cef/libcef_dll/cpptoc/task_runner_cpptoc.h 14234+++ b/src/cef/libcef_dll/cpptoc/task_runner_cpptoc.h 14235@@ -1,4 +1,4 @@ 14236-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14237+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14238 // reserved. Use of this source code is governed by a BSD-style license that 14239 // can be found in the LICENSE file. 14240 // 14241@@ -9,7 +9,7 @@ 14242 // implementations. See the translator.README.txt file in the tools directory 14243 // for more information. 14244 // 14245-// $hash=3422c7340cee9aaf51c62fa1868b3e665ef34b2f$ 14246+// $hash=66efea72ce623fbf542496f15d0b5fe33d426286$ 14247 // 14248 14249 #ifndef CEF_LIBCEF_DLL_CPPTOC_TASK_RUNNER_CPPTOC_H_ 14250diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_cpptoc.cc 14251index 4b5e412551bcd..1e897e06769ac 14252--- a/src/cef/libcef_dll/cpptoc/test/translator_test_cpptoc.cc 14253+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_cpptoc.cc 14254@@ -1,4 +1,4 @@ 14255-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14256+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14257 // reserved. Use of this source code is governed by a BSD-style license that 14258 // can be found in the LICENSE file. 14259 // 14260@@ -9,7 +9,7 @@ 14261 // implementations. See the translator.README.txt file in the tools directory 14262 // for more information. 14263 // 14264-// $hash=0192ac51914013c4452ffbb99c3a2589137f7c78$ 14265+// $hash=4117623ecedbef67bdfc9346f89208255798688e$ 14266 // 14267 14268 #include "libcef_dll/cpptoc/test/translator_test_cpptoc.h" 14269diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_cpptoc.h 14270index 60be8a4191550..c84b470058d6e 14271--- a/src/cef/libcef_dll/cpptoc/test/translator_test_cpptoc.h 14272+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_cpptoc.h 14273@@ -1,4 +1,4 @@ 14274-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14275+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14276 // reserved. Use of this source code is governed by a BSD-style license that 14277 // can be found in the LICENSE file. 14278 // 14279@@ -9,7 +9,7 @@ 14280 // implementations. See the translator.README.txt file in the tools directory 14281 // for more information. 14282 // 14283-// $hash=aeae16842d711fd6e5d54cd14333d27cbc06c400$ 14284+// $hash=5f0f8e9729af10fb258c197facf57ae150969f1a$ 14285 // 14286 14287 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_CPPTOC_H_ 14288diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc 14289index d3ac64f4981f0..4f77ecb7ff798 14290--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc 14291+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc 14292@@ -1,4 +1,4 @@ 14293-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14294+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14295 // reserved. Use of this source code is governed by a BSD-style license that 14296 // can be found in the LICENSE file. 14297 // 14298@@ -9,7 +9,7 @@ 14299 // implementations. See the translator.README.txt file in the tools directory 14300 // for more information. 14301 // 14302-// $hash=5eb9ef23f60f99db031e0e3da6cdfc81c979f5ff$ 14303+// $hash=e673b289ae45b277af9c33ee74fe9056cff6e265$ 14304 // 14305 14306 #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h" 14307diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h 14308index e32aee6a7f57f..71d3384f479d5 14309--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h 14310+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h 14311@@ -1,4 +1,4 @@ 14312-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14313+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14314 // reserved. Use of this source code is governed by a BSD-style license that 14315 // can be found in the LICENSE file. 14316 // 14317@@ -9,7 +9,7 @@ 14318 // implementations. See the translator.README.txt file in the tools directory 14319 // for more information. 14320 // 14321-// $hash=f84f12aa3e444b6ae98c620147bdacf6c32af8df$ 14322+// $hash=b6731cceb5f02011f2bafe6afa336b95355a1bf0$ 14323 // 14324 14325 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CPPTOC_H_ 14326diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc 14327index 22ddee2c75dc0..fe25e680782a3 14328--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc 14329+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc 14330@@ -1,4 +1,4 @@ 14331-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14332+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14333 // reserved. Use of this source code is governed by a BSD-style license that 14334 // can be found in the LICENSE file. 14335 // 14336@@ -9,7 +9,7 @@ 14337 // implementations. See the translator.README.txt file in the tools directory 14338 // for more information. 14339 // 14340-// $hash=f331b4d8e20683281cee5cf873950c236fc6cffd$ 14341+// $hash=7bbb368ca482601286a12f0ab7cc652fd16a1929$ 14342 // 14343 14344 #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h" 14345diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h 14346index 2f752aed77d7c..e8a5309622d43 14347--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h 14348+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h 14349@@ -1,4 +1,4 @@ 14350-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14351+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14352 // reserved. Use of this source code is governed by a BSD-style license that 14353 // can be found in the LICENSE file. 14354 // 14355@@ -9,7 +9,7 @@ 14356 // implementations. See the translator.README.txt file in the tools directory 14357 // for more information. 14358 // 14359-// $hash=abcdf3e219cfeac25ddf87a82c173189d0707bbd$ 14360+// $hash=871a3626f0e6928f2b1094b6fd01175f2bc82a29$ 14361 // 14362 14363 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CPPTOC_H_ 14364diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc 14365index 2709126202650..c6165f7552d67 14366--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc 14367+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc 14368@@ -1,4 +1,4 @@ 14369-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14370+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14371 // reserved. Use of this source code is governed by a BSD-style license that 14372 // can be found in the LICENSE file. 14373 // 14374@@ -9,7 +9,7 @@ 14375 // implementations. See the translator.README.txt file in the tools directory 14376 // for more information. 14377 // 14378-// $hash=693175fcf035e056074e56a8a5e39e3f5d1c218d$ 14379+// $hash=3c88df3fd064a4d053a17e1db85c95f2faa0f55a$ 14380 // 14381 14382 #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h" 14383diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h 14384index f9c3a093817da..c17f7181d86e9 14385--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h 14386+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h 14387@@ -1,4 +1,4 @@ 14388-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14389+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14390 // reserved. Use of this source code is governed by a BSD-style license that 14391 // can be found in the LICENSE file. 14392 // 14393@@ -9,7 +9,7 @@ 14394 // implementations. See the translator.README.txt file in the tools directory 14395 // for more information. 14396 // 14397-// $hash=602040c56e366821ec632f5675d22d5b1787d046$ 14398+// $hash=c578229af8491c038b4a036ca870c5dd268b9244$ 14399 // 14400 14401 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CPPTOC_H_ 14402diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc 14403index b807842346485..d58c36511144d 14404--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc 14405+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc 14406@@ -1,4 +1,4 @@ 14407-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14408+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14409 // reserved. Use of this source code is governed by a BSD-style license that 14410 // can be found in the LICENSE file. 14411 // 14412@@ -9,7 +9,7 @@ 14413 // implementations. See the translator.README.txt file in the tools directory 14414 // for more information. 14415 // 14416-// $hash=8331f68f4339fbe375428550af8c793d455ef432$ 14417+// $hash=1f115b393d5226e9be5216e8209cdd9d1a8df345$ 14418 // 14419 14420 #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h" 14421diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h 14422index a95b9af96faeb..0ed52386f0e2e 14423--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h 14424+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h 14425@@ -1,4 +1,4 @@ 14426-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14427+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14428 // reserved. Use of this source code is governed by a BSD-style license that 14429 // can be found in the LICENSE file. 14430 // 14431@@ -9,7 +9,7 @@ 14432 // implementations. See the translator.README.txt file in the tools directory 14433 // for more information. 14434 // 14435-// $hash=80d99f15db9d7a39f51b24769104d2daeb100ef7$ 14436+// $hash=f138313a94a2c2943926df60ee5293f5dc9f62b8$ 14437 // 14438 14439 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CPPTOC_H_ 14440diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc 14441index b0a9754827888..0159dc5bc28d1 14442--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc 14443+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc 14444@@ -1,4 +1,4 @@ 14445-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14446+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14447 // reserved. Use of this source code is governed by a BSD-style license that 14448 // can be found in the LICENSE file. 14449 // 14450@@ -9,7 +9,7 @@ 14451 // implementations. See the translator.README.txt file in the tools directory 14452 // for more information. 14453 // 14454-// $hash=215ecf50a38a26a660ebd9c9784ddba9ef9ac336$ 14455+// $hash=bf4d4b7f5a7395de486eeab67d16ad48310b0771$ 14456 // 14457 14458 #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h" 14459diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h 14460index c0011d3ce753a..e1420e8f2175d 14461--- a/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h 14462+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h 14463@@ -1,4 +1,4 @@ 14464-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14465+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14466 // reserved. Use of this source code is governed by a BSD-style license that 14467 // can be found in the LICENSE file. 14468 // 14469@@ -9,7 +9,7 @@ 14470 // implementations. See the translator.README.txt file in the tools directory 14471 // for more information. 14472 // 14473-// $hash=cf13344b75658fdc4d727598a1ca9cf1d2d9aebe$ 14474+// $hash=f431a7518ff642f5b307dbd716bfcd75c5bcb37a$ 14475 // 14476 14477 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CPPTOC_H_ 14478diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc 14479index 6912405ebfc68..e64cd734766e7 14480--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc 14481+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc 14482@@ -1,4 +1,4 @@ 14483-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14484+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14485 // reserved. Use of this source code is governed by a BSD-style license that 14486 // can be found in the LICENSE file. 14487 // 14488@@ -9,7 +9,7 @@ 14489 // implementations. See the translator.README.txt file in the tools directory 14490 // for more information. 14491 // 14492-// $hash=ba3de8f4ffca578355877eb66e19a61e337fab63$ 14493+// $hash=6bcfc2738c1acbf4476fe6fcdb62d3bb7f14f44b$ 14494 // 14495 14496 #include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h" 14497diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h 14498index afb925f57fb88..894345cccc680 14499--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h 14500+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h 14501@@ -1,4 +1,4 @@ 14502-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14503+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14504 // reserved. Use of this source code is governed by a BSD-style license that 14505 // can be found in the LICENSE file. 14506 // 14507@@ -9,7 +9,7 @@ 14508 // implementations. See the translator.README.txt file in the tools directory 14509 // for more information. 14510 // 14511-// $hash=3a46ac0b98d0a79f8506ffc09a5c3cdcca353f29$ 14512+// $hash=7a7900759a192fa0586d1ab7e2706c513ed9b715$ 14513 // 14514 14515 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CPPTOC_H_ 14516diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc 14517index f528e64e083eb..6fc05d57e3d58 14518--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc 14519+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc 14520@@ -1,4 +1,4 @@ 14521-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14522+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14523 // reserved. Use of this source code is governed by a BSD-style license that 14524 // can be found in the LICENSE file. 14525 // 14526@@ -9,7 +9,7 @@ 14527 // implementations. See the translator.README.txt file in the tools directory 14528 // for more information. 14529 // 14530-// $hash=da43c88a9d20786247371fa3a69230862f8619a6$ 14531+// $hash=9d7c60f524e97dfb4ef831ee5c00037372d42673$ 14532 // 14533 14534 #include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h" 14535diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h 14536index 591e1c7c41fea..d73036be67c74 14537--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h 14538+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h 14539@@ -1,4 +1,4 @@ 14540-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14541+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14542 // reserved. Use of this source code is governed by a BSD-style license that 14543 // can be found in the LICENSE file. 14544 // 14545@@ -9,7 +9,7 @@ 14546 // implementations. See the translator.README.txt file in the tools directory 14547 // for more information. 14548 // 14549-// $hash=c639d2f671cbfeb508e95a481c0d81ee92b87c29$ 14550+// $hash=bf705a17d41da4d434c122928b0f55c8760d3689$ 14551 // 14552 14553 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CPPTOC_H_ 14554diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc 14555index 09704c592128c..16cee5f001c7a 14556--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc 14557+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc 14558@@ -1,4 +1,4 @@ 14559-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14560+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14561 // reserved. Use of this source code is governed by a BSD-style license that 14562 // can be found in the LICENSE file. 14563 // 14564@@ -9,7 +9,7 @@ 14565 // implementations. See the translator.README.txt file in the tools directory 14566 // for more information. 14567 // 14568-// $hash=428d7bab8b87fe39bf70e53c8bf1d0a50bf88c33$ 14569+// $hash=b1ca84e5a38b7d473cdd8386868c9cc7372e1ebf$ 14570 // 14571 14572 #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h" 14573diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h 14574index 104f2992ef182..3602a4b03e324 14575--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h 14576+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h 14577@@ -1,4 +1,4 @@ 14578-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14579+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14580 // reserved. Use of this source code is governed by a BSD-style license that 14581 // can be found in the LICENSE file. 14582 // 14583@@ -9,7 +9,7 @@ 14584 // implementations. See the translator.README.txt file in the tools directory 14585 // for more information. 14586 // 14587-// $hash=26db238e377ea4db7b6c005d00dcaf270be64ce6$ 14588+// $hash=333a572bf8bb3cde5058ae36410b571d777cd157$ 14589 // 14590 14591 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CPPTOC_H_ 14592diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc 14593index 2dfe000ef0ecc..1ef86633a44e0 14594--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc 14595+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc 14596@@ -1,4 +1,4 @@ 14597-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14598+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14599 // reserved. Use of this source code is governed by a BSD-style license that 14600 // can be found in the LICENSE file. 14601 // 14602@@ -9,7 +9,7 @@ 14603 // implementations. See the translator.README.txt file in the tools directory 14604 // for more information. 14605 // 14606-// $hash=c7dafd30c4f75e38e507feabdc40dc234d21a06b$ 14607+// $hash=603f865fe40c123657e8d8213b6c03cb9fea36ad$ 14608 // 14609 14610 #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h" 14611diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h 14612index b6ee58dab1cb2..e1c516aa0f178 14613--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h 14614+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h 14615@@ -1,4 +1,4 @@ 14616-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14617+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14618 // reserved. Use of this source code is governed by a BSD-style license that 14619 // can be found in the LICENSE file. 14620 // 14621@@ -9,7 +9,7 @@ 14622 // implementations. See the translator.README.txt file in the tools directory 14623 // for more information. 14624 // 14625-// $hash=87924524eab4c309d13dc3e9656c601fd65c7449$ 14626+// $hash=df48c52988d69bfd94bc4245d1c2069f45512f7a$ 14627 // 14628 14629 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CPPTOC_H_ 14630diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc 14631index cc253be262b15..2359a3a4cf418 14632--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc 14633+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc 14634@@ -1,4 +1,4 @@ 14635-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14636+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14637 // reserved. Use of this source code is governed by a BSD-style license that 14638 // can be found in the LICENSE file. 14639 // 14640@@ -9,7 +9,7 @@ 14641 // implementations. See the translator.README.txt file in the tools directory 14642 // for more information. 14643 // 14644-// $hash=442b86286b5b3126fd0a0f0849ca661ef7487fb3$ 14645+// $hash=481e41d324069dcb26cfc0c69b51ad4281e95144$ 14646 // 14647 14648 #include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h" 14649diff --git a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h 14650index dbdd75ed0972f..f03840613b6c1 14651--- a/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h 14652+++ b/src/cef/libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h 14653@@ -1,4 +1,4 @@ 14654-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14655+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14656 // reserved. Use of this source code is governed by a BSD-style license that 14657 // can be found in the LICENSE file. 14658 // 14659@@ -9,7 +9,7 @@ 14660 // implementations. See the translator.README.txt file in the tools directory 14661 // for more information. 14662 // 14663-// $hash=43b0a0576a86ba1d2dda27c83af22554da773221$ 14664+// $hash=029af2aa3f312b751ca30b039f22e5c4fbd42295$ 14665 // 14666 14667 #ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CPPTOC_H_ 14668diff --git a/src/cef/libcef_dll/cpptoc/thread_cpptoc.cc b/src/cef/libcef_dll/cpptoc/thread_cpptoc.cc 14669index b48ba593ce01b..a63f79ed25c65 14670--- a/src/cef/libcef_dll/cpptoc/thread_cpptoc.cc 14671+++ b/src/cef/libcef_dll/cpptoc/thread_cpptoc.cc 14672@@ -1,4 +1,4 @@ 14673-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14674+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14675 // reserved. Use of this source code is governed by a BSD-style license that 14676 // can be found in the LICENSE file. 14677 // 14678@@ -9,7 +9,7 @@ 14679 // implementations. See the translator.README.txt file in the tools directory 14680 // for more information. 14681 // 14682-// $hash=9975067d09206080d5237a7d1e8dd70155deb554$ 14683+// $hash=d8f0260fca4ead50ef8cfc5856fa94e835844846$ 14684 // 14685 14686 #include "libcef_dll/cpptoc/thread_cpptoc.h" 14687diff --git a/src/cef/libcef_dll/cpptoc/thread_cpptoc.h b/src/cef/libcef_dll/cpptoc/thread_cpptoc.h 14688index 66da3dbc79e66..37f0be30ccfa2 14689--- a/src/cef/libcef_dll/cpptoc/thread_cpptoc.h 14690+++ b/src/cef/libcef_dll/cpptoc/thread_cpptoc.h 14691@@ -1,4 +1,4 @@ 14692-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14693+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14694 // reserved. Use of this source code is governed by a BSD-style license that 14695 // can be found in the LICENSE file. 14696 // 14697@@ -9,7 +9,7 @@ 14698 // implementations. See the translator.README.txt file in the tools directory 14699 // for more information. 14700 // 14701-// $hash=820a6a8e017c6ba2a19f5c0b8db0f8aa628a0cfa$ 14702+// $hash=684bc72317e634d7357bdea53bf7dfe81d9d536b$ 14703 // 14704 14705 #ifndef CEF_LIBCEF_DLL_CPPTOC_THREAD_CPPTOC_H_ 14706diff --git a/src/cef/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc b/src/cef/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc 14707index dc445270043ff..d36bb74093246 14708--- a/src/cef/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc 14709+++ b/src/cef/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc 14710@@ -1,4 +1,4 @@ 14711-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14712+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14713 // reserved. Use of this source code is governed by a BSD-style license that 14714 // can be found in the LICENSE file. 14715 // 14716@@ -9,7 +9,7 @@ 14717 // implementations. See the translator.README.txt file in the tools directory 14718 // for more information. 14719 // 14720-// $hash=db92b5330f0b984051a202144f77b389501a260e$ 14721+// $hash=e5112f59f64307d7059920de8a59527494dad903$ 14722 // 14723 14724 #include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h" 14725diff --git a/src/cef/libcef_dll/cpptoc/urlrequest_client_cpptoc.h b/src/cef/libcef_dll/cpptoc/urlrequest_client_cpptoc.h 14726index 085a6000827b7..551f69c51b8c1 14727--- a/src/cef/libcef_dll/cpptoc/urlrequest_client_cpptoc.h 14728+++ b/src/cef/libcef_dll/cpptoc/urlrequest_client_cpptoc.h 14729@@ -1,4 +1,4 @@ 14730-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14731+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14732 // reserved. Use of this source code is governed by a BSD-style license that 14733 // can be found in the LICENSE file. 14734 // 14735@@ -9,7 +9,7 @@ 14736 // implementations. See the translator.README.txt file in the tools directory 14737 // for more information. 14738 // 14739-// $hash=6ab5f8f6ff4a68382bd5e239ad2c8e2c12c39c6d$ 14740+// $hash=da593bcc58bec4b7dc1159fdc2fd2b8f472a6c93$ 14741 // 14742 14743 #ifndef CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_ 14744diff --git a/src/cef/libcef_dll/cpptoc/urlrequest_cpptoc.cc b/src/cef/libcef_dll/cpptoc/urlrequest_cpptoc.cc 14745index 805b66a820e23..f7d7f6805fd2c 14746--- a/src/cef/libcef_dll/cpptoc/urlrequest_cpptoc.cc 14747+++ b/src/cef/libcef_dll/cpptoc/urlrequest_cpptoc.cc 14748@@ -1,4 +1,4 @@ 14749-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14750+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14751 // reserved. Use of this source code is governed by a BSD-style license that 14752 // can be found in the LICENSE file. 14753 // 14754@@ -9,7 +9,7 @@ 14755 // implementations. See the translator.README.txt file in the tools directory 14756 // for more information. 14757 // 14758-// $hash=6193670d2d0577eaf226bd1825cde7b3f70c0f68$ 14759+// $hash=baa94bdc57a09aa7dfd6b040963510d037a6e37c$ 14760 // 14761 14762 #include "libcef_dll/cpptoc/urlrequest_cpptoc.h" 14763diff --git a/src/cef/libcef_dll/cpptoc/urlrequest_cpptoc.h b/src/cef/libcef_dll/cpptoc/urlrequest_cpptoc.h 14764index b798d658857f5..3ed15df73fd55 14765--- a/src/cef/libcef_dll/cpptoc/urlrequest_cpptoc.h 14766+++ b/src/cef/libcef_dll/cpptoc/urlrequest_cpptoc.h 14767@@ -1,4 +1,4 @@ 14768-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14769+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14770 // reserved. Use of this source code is governed by a BSD-style license that 14771 // can be found in the LICENSE file. 14772 // 14773@@ -9,7 +9,7 @@ 14774 // implementations. See the translator.README.txt file in the tools directory 14775 // for more information. 14776 // 14777-// $hash=1902918d90c40d3b524c0f7adcb56dc9a565df4d$ 14778+// $hash=f870036a626bd6ba126425b586b0a3116030c8d6$ 14779 // 14780 14781 #ifndef CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CPPTOC_H_ 14782diff --git a/src/cef/libcef_dll/cpptoc/v8accessor_cpptoc.cc b/src/cef/libcef_dll/cpptoc/v8accessor_cpptoc.cc 14783index a6bfe77e3b060..39ddef322cd2d 14784--- a/src/cef/libcef_dll/cpptoc/v8accessor_cpptoc.cc 14785+++ b/src/cef/libcef_dll/cpptoc/v8accessor_cpptoc.cc 14786@@ -1,4 +1,4 @@ 14787-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14788+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14789 // reserved. Use of this source code is governed by a BSD-style license that 14790 // can be found in the LICENSE file. 14791 // 14792@@ -9,7 +9,7 @@ 14793 // implementations. See the translator.README.txt file in the tools directory 14794 // for more information. 14795 // 14796-// $hash=35161ccb0b72898e250d905b4b245b4839fe7ecc$ 14797+// $hash=ff5e74bff88361fed356300624c8ee8deab15554$ 14798 // 14799 14800 #include "libcef_dll/cpptoc/v8accessor_cpptoc.h" 14801diff --git a/src/cef/libcef_dll/cpptoc/v8accessor_cpptoc.h b/src/cef/libcef_dll/cpptoc/v8accessor_cpptoc.h 14802index dd68c064bb05d..fb40f8632a3a8 14803--- a/src/cef/libcef_dll/cpptoc/v8accessor_cpptoc.h 14804+++ b/src/cef/libcef_dll/cpptoc/v8accessor_cpptoc.h 14805@@ -1,4 +1,4 @@ 14806-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14807+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14808 // reserved. Use of this source code is governed by a BSD-style license that 14809 // can be found in the LICENSE file. 14810 // 14811@@ -9,7 +9,7 @@ 14812 // implementations. See the translator.README.txt file in the tools directory 14813 // for more information. 14814 // 14815-// $hash=cbf062496a14d367e643c3e52afd460df4176fde$ 14816+// $hash=b8975b107d5912bdcc3e66229119fed6316d269c$ 14817 // 14818 14819 #ifndef CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ 14820diff --git a/src/cef/libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc b/src/cef/libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc 14821index 9c5e28070d88b..48587b103705b 14822--- a/src/cef/libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc 14823+++ b/src/cef/libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc 14824@@ -1,4 +1,4 @@ 14825-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14826+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14827 // reserved. Use of this source code is governed by a BSD-style license that 14828 // can be found in the LICENSE file. 14829 // 14830@@ -9,7 +9,7 @@ 14831 // implementations. See the translator.README.txt file in the tools directory 14832 // for more information. 14833 // 14834-// $hash=0a7885c5553c99c1ff7539c8aba3a340aa6f3d08$ 14835+// $hash=2b44fa06894c671a055dfbba079bc3373902fcb9$ 14836 // 14837 14838 #include "libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h" 14839diff --git a/src/cef/libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h b/src/cef/libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h 14840index a5b0463b7bb69..650881c3262d1 14841--- a/src/cef/libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h 14842+++ b/src/cef/libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h 14843@@ -1,4 +1,4 @@ 14844-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14845+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14846 // reserved. Use of this source code is governed by a BSD-style license that 14847 // can be found in the LICENSE file. 14848 // 14849@@ -9,7 +9,7 @@ 14850 // implementations. See the translator.README.txt file in the tools directory 14851 // for more information. 14852 // 14853-// $hash=aa87e37fdfa915cb160cb4b7577c46b9e903a698$ 14854+// $hash=f3cb7f220bf24ad178eed9b14d8b6e3d1baed6d5$ 14855 // 14856 14857 #ifndef CEF_LIBCEF_DLL_CPPTOC_V8ARRAY_BUFFER_RELEASE_CALLBACK_CPPTOC_H_ 14858diff --git a/src/cef/libcef_dll/cpptoc/v8context_cpptoc.cc b/src/cef/libcef_dll/cpptoc/v8context_cpptoc.cc 14859index fc02f3c2496bf..191e9714e89dc 14860--- a/src/cef/libcef_dll/cpptoc/v8context_cpptoc.cc 14861+++ b/src/cef/libcef_dll/cpptoc/v8context_cpptoc.cc 14862@@ -1,4 +1,4 @@ 14863-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14864+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14865 // reserved. Use of this source code is governed by a BSD-style license that 14866 // can be found in the LICENSE file. 14867 // 14868@@ -9,7 +9,7 @@ 14869 // implementations. See the translator.README.txt file in the tools directory 14870 // for more information. 14871 // 14872-// $hash=5fb43e3f68ef5f431fe6d6f84d399dc0cd292d7d$ 14873+// $hash=cf1f345f1f55c603ab3d5fb7dad775152bed8bd5$ 14874 // 14875 14876 #include "libcef_dll/cpptoc/v8context_cpptoc.h" 14877diff --git a/src/cef/libcef_dll/cpptoc/v8context_cpptoc.h b/src/cef/libcef_dll/cpptoc/v8context_cpptoc.h 14878index 073ea9e248be4..5b7746d2b41f8 14879--- a/src/cef/libcef_dll/cpptoc/v8context_cpptoc.h 14880+++ b/src/cef/libcef_dll/cpptoc/v8context_cpptoc.h 14881@@ -1,4 +1,4 @@ 14882-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14883+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14884 // reserved. Use of this source code is governed by a BSD-style license that 14885 // can be found in the LICENSE file. 14886 // 14887@@ -9,7 +9,7 @@ 14888 // implementations. See the translator.README.txt file in the tools directory 14889 // for more information. 14890 // 14891-// $hash=e0d02da9f3e8216559bd80e50b0e3d061455b0af$ 14892+// $hash=251051522f71e61a56b0844596a6ca2d858915c8$ 14893 // 14894 14895 #ifndef CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_CPPTOC_H_ 14896diff --git a/src/cef/libcef_dll/cpptoc/v8exception_cpptoc.cc b/src/cef/libcef_dll/cpptoc/v8exception_cpptoc.cc 14897index c142b061d5b85..bcbd9eb4a2a81 14898--- a/src/cef/libcef_dll/cpptoc/v8exception_cpptoc.cc 14899+++ b/src/cef/libcef_dll/cpptoc/v8exception_cpptoc.cc 14900@@ -1,4 +1,4 @@ 14901-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14902+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14903 // reserved. Use of this source code is governed by a BSD-style license that 14904 // can be found in the LICENSE file. 14905 // 14906@@ -9,7 +9,7 @@ 14907 // implementations. See the translator.README.txt file in the tools directory 14908 // for more information. 14909 // 14910-// $hash=bcf73c22701825bb552e78ece2e62c1e6b8da282$ 14911+// $hash=be0ac1aa2ae8d92bf3e2552497345e4559776b6f$ 14912 // 14913 14914 #include "libcef_dll/cpptoc/v8exception_cpptoc.h" 14915diff --git a/src/cef/libcef_dll/cpptoc/v8exception_cpptoc.h b/src/cef/libcef_dll/cpptoc/v8exception_cpptoc.h 14916index 83f329540cabb..d9f8725b58953 14917--- a/src/cef/libcef_dll/cpptoc/v8exception_cpptoc.h 14918+++ b/src/cef/libcef_dll/cpptoc/v8exception_cpptoc.h 14919@@ -1,4 +1,4 @@ 14920-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14921+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14922 // reserved. Use of this source code is governed by a BSD-style license that 14923 // can be found in the LICENSE file. 14924 // 14925@@ -9,7 +9,7 @@ 14926 // implementations. See the translator.README.txt file in the tools directory 14927 // for more information. 14928 // 14929-// $hash=8d6ac0b98bc8a8efc173365c7542907fe1d229ae$ 14930+// $hash=438f4efa56776c515c7c42c6a7dae68937729fef$ 14931 // 14932 14933 #ifndef CEF_LIBCEF_DLL_CPPTOC_V8EXCEPTION_CPPTOC_H_ 14934diff --git a/src/cef/libcef_dll/cpptoc/v8handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/v8handler_cpptoc.cc 14935index 63fe01b9c9490..931d8a7a0a177 14936--- a/src/cef/libcef_dll/cpptoc/v8handler_cpptoc.cc 14937+++ b/src/cef/libcef_dll/cpptoc/v8handler_cpptoc.cc 14938@@ -1,4 +1,4 @@ 14939-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14940+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14941 // reserved. Use of this source code is governed by a BSD-style license that 14942 // can be found in the LICENSE file. 14943 // 14944@@ -9,7 +9,7 @@ 14945 // implementations. See the translator.README.txt file in the tools directory 14946 // for more information. 14947 // 14948-// $hash=7a072d883f46856cf79bf868560689797b31e362$ 14949+// $hash=116eee182be2336fac01047c154a177dd5c6de49$ 14950 // 14951 14952 #include "libcef_dll/cpptoc/v8handler_cpptoc.h" 14953diff --git a/src/cef/libcef_dll/cpptoc/v8handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/v8handler_cpptoc.h 14954index bbf4e955e4f98..f3122ffc622aa 14955--- a/src/cef/libcef_dll/cpptoc/v8handler_cpptoc.h 14956+++ b/src/cef/libcef_dll/cpptoc/v8handler_cpptoc.h 14957@@ -1,4 +1,4 @@ 14958-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14959+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14960 // reserved. Use of this source code is governed by a BSD-style license that 14961 // can be found in the LICENSE file. 14962 // 14963@@ -9,7 +9,7 @@ 14964 // implementations. See the translator.README.txt file in the tools directory 14965 // for more information. 14966 // 14967-// $hash=8a1d3087cb27c365c8972bc22f712c8433db37a7$ 14968+// $hash=25ab4ee4f4c72c6be2e4df28dfaa8bbe5ec522d6$ 14969 // 14970 14971 #ifndef CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ 14972diff --git a/src/cef/libcef_dll/cpptoc/v8interceptor_cpptoc.cc b/src/cef/libcef_dll/cpptoc/v8interceptor_cpptoc.cc 14973index 6a590da10e22b..4367178dcc054 14974--- a/src/cef/libcef_dll/cpptoc/v8interceptor_cpptoc.cc 14975+++ b/src/cef/libcef_dll/cpptoc/v8interceptor_cpptoc.cc 14976@@ -1,4 +1,4 @@ 14977-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14978+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14979 // reserved. Use of this source code is governed by a BSD-style license that 14980 // can be found in the LICENSE file. 14981 // 14982@@ -9,7 +9,7 @@ 14983 // implementations. See the translator.README.txt file in the tools directory 14984 // for more information. 14985 // 14986-// $hash=fd651a7fef9dbbce9765c8200660c4057808e6cc$ 14987+// $hash=acc06c29fd11d4eecb3d8114c48f4f3f0548abce$ 14988 // 14989 14990 #include "libcef_dll/cpptoc/v8interceptor_cpptoc.h" 14991diff --git a/src/cef/libcef_dll/cpptoc/v8interceptor_cpptoc.h b/src/cef/libcef_dll/cpptoc/v8interceptor_cpptoc.h 14992index e13ff18779b9c..07f4a629dc3f0 14993--- a/src/cef/libcef_dll/cpptoc/v8interceptor_cpptoc.h 14994+++ b/src/cef/libcef_dll/cpptoc/v8interceptor_cpptoc.h 14995@@ -1,4 +1,4 @@ 14996-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 14997+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 14998 // reserved. Use of this source code is governed by a BSD-style license that 14999 // can be found in the LICENSE file. 15000 // 15001@@ -9,7 +9,7 @@ 15002 // implementations. See the translator.README.txt file in the tools directory 15003 // for more information. 15004 // 15005-// $hash=ea56a3340775acdee89516a9e1107f725e0f8c47$ 15006+// $hash=17704763b12cf8c125a358d2db96037f13613b17$ 15007 // 15008 15009 #ifndef CEF_LIBCEF_DLL_CPPTOC_V8INTERCEPTOR_CPPTOC_H_ 15010diff --git a/src/cef/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc b/src/cef/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc 15011index 68cf92f231984..0887c3f66a98a 15012--- a/src/cef/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc 15013+++ b/src/cef/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc 15014@@ -1,4 +1,4 @@ 15015-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15016+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15017 // reserved. Use of this source code is governed by a BSD-style license that 15018 // can be found in the LICENSE file. 15019 // 15020@@ -9,7 +9,7 @@ 15021 // implementations. See the translator.README.txt file in the tools directory 15022 // for more information. 15023 // 15024-// $hash=bcf0ccd2d4220eaa8f31b1f4f9b64440f81f563e$ 15025+// $hash=d57266ae37abe823a7a91d36416da50f75e7c663$ 15026 // 15027 15028 #include "libcef_dll/cpptoc/v8stack_frame_cpptoc.h" 15029diff --git a/src/cef/libcef_dll/cpptoc/v8stack_frame_cpptoc.h b/src/cef/libcef_dll/cpptoc/v8stack_frame_cpptoc.h 15030index 2c4659cbd5b3f..fabdf222e3fb2 15031--- a/src/cef/libcef_dll/cpptoc/v8stack_frame_cpptoc.h 15032+++ b/src/cef/libcef_dll/cpptoc/v8stack_frame_cpptoc.h 15033@@ -1,4 +1,4 @@ 15034-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15035+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15036 // reserved. Use of this source code is governed by a BSD-style license that 15037 // can be found in the LICENSE file. 15038 // 15039@@ -9,7 +9,7 @@ 15040 // implementations. See the translator.README.txt file in the tools directory 15041 // for more information. 15042 // 15043-// $hash=08e9e87d39ea58ed8bd7edc6dbf7cf2873218eee$ 15044+// $hash=a804ebb160de9a40b1e8ce65e1dfca67e5ffb658$ 15045 // 15046 15047 #ifndef CEF_LIBCEF_DLL_CPPTOC_V8STACK_FRAME_CPPTOC_H_ 15048diff --git a/src/cef/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc b/src/cef/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc 15049index 6e33464a3ceaa..d797ec93f65e4 15050--- a/src/cef/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc 15051+++ b/src/cef/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc 15052@@ -1,4 +1,4 @@ 15053-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15054+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15055 // reserved. Use of this source code is governed by a BSD-style license that 15056 // can be found in the LICENSE file. 15057 // 15058@@ -9,7 +9,7 @@ 15059 // implementations. See the translator.README.txt file in the tools directory 15060 // for more information. 15061 // 15062-// $hash=69faf917e01945c29e5f20a00abbcc69aac7c0a7$ 15063+// $hash=c9f42c7ec65dbe45094126c7668ecab5bc0dba4a$ 15064 // 15065 15066 #include "libcef_dll/cpptoc/v8stack_trace_cpptoc.h" 15067diff --git a/src/cef/libcef_dll/cpptoc/v8stack_trace_cpptoc.h b/src/cef/libcef_dll/cpptoc/v8stack_trace_cpptoc.h 15068index d7c2f079f5f5e..c0374479ea34f 15069--- a/src/cef/libcef_dll/cpptoc/v8stack_trace_cpptoc.h 15070+++ b/src/cef/libcef_dll/cpptoc/v8stack_trace_cpptoc.h 15071@@ -1,4 +1,4 @@ 15072-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15073+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15074 // reserved. Use of this source code is governed by a BSD-style license that 15075 // can be found in the LICENSE file. 15076 // 15077@@ -9,7 +9,7 @@ 15078 // implementations. See the translator.README.txt file in the tools directory 15079 // for more information. 15080 // 15081-// $hash=01a737cd8e6ea8e747d0a404c4b370a620eada94$ 15082+// $hash=7d064189557bf22631a1daf8a757128680743960$ 15083 // 15084 15085 #ifndef CEF_LIBCEF_DLL_CPPTOC_V8STACK_TRACE_CPPTOC_H_ 15086diff --git a/src/cef/libcef_dll/cpptoc/v8value_cpptoc.cc b/src/cef/libcef_dll/cpptoc/v8value_cpptoc.cc 15087index 49dd142b07ecd..fd550f13bee69 15088--- a/src/cef/libcef_dll/cpptoc/v8value_cpptoc.cc 15089+++ b/src/cef/libcef_dll/cpptoc/v8value_cpptoc.cc 15090@@ -1,4 +1,4 @@ 15091-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15092+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15093 // reserved. Use of this source code is governed by a BSD-style license that 15094 // can be found in the LICENSE file. 15095 // 15096@@ -9,7 +9,7 @@ 15097 // implementations. See the translator.README.txt file in the tools directory 15098 // for more information. 15099 // 15100-// $hash=0cb915346153880872b44bd1f857c24787ed52af$ 15101+// $hash=9a17d4cb73ff68c45251d606252cbcb84ddffbff$ 15102 // 15103 15104 #include "libcef_dll/cpptoc/v8value_cpptoc.h" 15105diff --git a/src/cef/libcef_dll/cpptoc/v8value_cpptoc.h b/src/cef/libcef_dll/cpptoc/v8value_cpptoc.h 15106index 363743ce1f016..87862ae754c8e 15107--- a/src/cef/libcef_dll/cpptoc/v8value_cpptoc.h 15108+++ b/src/cef/libcef_dll/cpptoc/v8value_cpptoc.h 15109@@ -1,4 +1,4 @@ 15110-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15111+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15112 // reserved. Use of this source code is governed by a BSD-style license that 15113 // can be found in the LICENSE file. 15114 // 15115@@ -9,7 +9,7 @@ 15116 // implementations. See the translator.README.txt file in the tools directory 15117 // for more information. 15118 // 15119-// $hash=0d07225656f5400129aca5cef75bbefcaaacb70d$ 15120+// $hash=5b314dd35111aa303aa5d695e75839076f874c90$ 15121 // 15122 15123 #ifndef CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_ 15124diff --git a/src/cef/libcef_dll/cpptoc/value_cpptoc.cc b/src/cef/libcef_dll/cpptoc/value_cpptoc.cc 15125index 1d4001b723399..196df482bdf67 15126--- a/src/cef/libcef_dll/cpptoc/value_cpptoc.cc 15127+++ b/src/cef/libcef_dll/cpptoc/value_cpptoc.cc 15128@@ -1,4 +1,4 @@ 15129-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15130+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15131 // reserved. Use of this source code is governed by a BSD-style license that 15132 // can be found in the LICENSE file. 15133 // 15134@@ -9,7 +9,7 @@ 15135 // implementations. See the translator.README.txt file in the tools directory 15136 // for more information. 15137 // 15138-// $hash=680adcc74e385af7d83fa8b28b36b2215bc20f2b$ 15139+// $hash=610af325d95f1242db8993e38da62713feafe0a7$ 15140 // 15141 15142 #include "libcef_dll/cpptoc/value_cpptoc.h" 15143diff --git a/src/cef/libcef_dll/cpptoc/value_cpptoc.h b/src/cef/libcef_dll/cpptoc/value_cpptoc.h 15144index 72b6a3dab4322..512155e5c6a0b 15145--- a/src/cef/libcef_dll/cpptoc/value_cpptoc.h 15146+++ b/src/cef/libcef_dll/cpptoc/value_cpptoc.h 15147@@ -1,4 +1,4 @@ 15148-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15149+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15150 // reserved. Use of this source code is governed by a BSD-style license that 15151 // can be found in the LICENSE file. 15152 // 15153@@ -9,7 +9,7 @@ 15154 // implementations. See the translator.README.txt file in the tools directory 15155 // for more information. 15156 // 15157-// $hash=108679f1ab32ec8b2e0ffe77602e89603f6c279f$ 15158+// $hash=19a491010366c91259449297ea4fb37414ae2a8e$ 15159 // 15160 15161 #ifndef CEF_LIBCEF_DLL_CPPTOC_VALUE_CPPTOC_H_ 15162diff --git a/src/cef/libcef_dll/cpptoc/views/box_layout_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/box_layout_cpptoc.cc 15163index 4e7d723cdeccb..6db8fb3acb527 15164--- a/src/cef/libcef_dll/cpptoc/views/box_layout_cpptoc.cc 15165+++ b/src/cef/libcef_dll/cpptoc/views/box_layout_cpptoc.cc 15166@@ -1,4 +1,4 @@ 15167-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15168+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15169 // reserved. Use of this source code is governed by a BSD-style license that 15170 // can be found in the LICENSE file. 15171 // 15172@@ -9,7 +9,7 @@ 15173 // implementations. See the translator.README.txt file in the tools directory 15174 // for more information. 15175 // 15176-// $hash=95678987551b26755e5dc718c3cad2e975b574c7$ 15177+// $hash=0603aa2ef3dd35d5630bafc47763307f77f64c8e$ 15178 // 15179 15180 #include "libcef_dll/cpptoc/views/box_layout_cpptoc.h" 15181diff --git a/src/cef/libcef_dll/cpptoc/views/box_layout_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/box_layout_cpptoc.h 15182index e67288a57d5d5..fc41243e66b16 15183--- a/src/cef/libcef_dll/cpptoc/views/box_layout_cpptoc.h 15184+++ b/src/cef/libcef_dll/cpptoc/views/box_layout_cpptoc.h 15185@@ -1,4 +1,4 @@ 15186-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15187+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15188 // reserved. Use of this source code is governed by a BSD-style license that 15189 // can be found in the LICENSE file. 15190 // 15191@@ -9,7 +9,7 @@ 15192 // implementations. See the translator.README.txt file in the tools directory 15193 // for more information. 15194 // 15195-// $hash=e665defe8e51c3405d75a3f1d9f382f6e9e9f81f$ 15196+// $hash=3f9e4984c1e1eff7e51ab13f9f7fe2ab249657ec$ 15197 // 15198 15199 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BOX_LAYOUT_CPPTOC_H_ 15200diff --git a/src/cef/libcef_dll/cpptoc/views/browser_view_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/browser_view_cpptoc.cc 15201index 2109aac1d9e5f..2bc455e6b441f 15202--- a/src/cef/libcef_dll/cpptoc/views/browser_view_cpptoc.cc 15203+++ b/src/cef/libcef_dll/cpptoc/views/browser_view_cpptoc.cc 15204@@ -1,4 +1,4 @@ 15205-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15206+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15207 // reserved. Use of this source code is governed by a BSD-style license that 15208 // can be found in the LICENSE file. 15209 // 15210@@ -9,7 +9,7 @@ 15211 // implementations. See the translator.README.txt file in the tools directory 15212 // for more information. 15213 // 15214-// $hash=ed2a9f38555ed559f342f6fd39f21192611771ee$ 15215+// $hash=a07b2f308b7192403cc92086f11545fd6adca28d$ 15216 // 15217 15218 #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h" 15219diff --git a/src/cef/libcef_dll/cpptoc/views/browser_view_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/browser_view_cpptoc.h 15220index f4e36ae4f19c1..2f9fd838f8df4 15221--- a/src/cef/libcef_dll/cpptoc/views/browser_view_cpptoc.h 15222+++ b/src/cef/libcef_dll/cpptoc/views/browser_view_cpptoc.h 15223@@ -1,4 +1,4 @@ 15224-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15225+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15226 // reserved. Use of this source code is governed by a BSD-style license that 15227 // can be found in the LICENSE file. 15228 // 15229@@ -9,7 +9,7 @@ 15230 // implementations. See the translator.README.txt file in the tools directory 15231 // for more information. 15232 // 15233-// $hash=dc07da6d436a7d99817045690a3932010cd1acfd$ 15234+// $hash=f981c5f7247ec57926549c145c47a7cdcbdd80a0$ 15235 // 15236 15237 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BROWSER_VIEW_CPPTOC_H_ 15238diff --git a/src/cef/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc 15239index 46d9fa3794932..2ef39d183df08 15240--- a/src/cef/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc 15241+++ b/src/cef/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc 15242@@ -1,4 +1,4 @@ 15243-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15244+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15245 // reserved. Use of this source code is governed by a BSD-style license that 15246 // can be found in the LICENSE file. 15247 // 15248@@ -9,7 +9,7 @@ 15249 // implementations. See the translator.README.txt file in the tools directory 15250 // for more information. 15251 // 15252-// $hash=8f3129779912a325240795e05610d6190997e028$ 15253+// $hash=d2fdb9e5fa608211f3583bafc74602d0573421c1$ 15254 // 15255 15256 #include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h" 15257diff --git a/src/cef/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h 15258index feb502ae7e5f2..f0761f3bbc572 15259--- a/src/cef/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h 15260+++ b/src/cef/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h 15261@@ -1,4 +1,4 @@ 15262-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15263+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15264 // reserved. Use of this source code is governed by a BSD-style license that 15265 // can be found in the LICENSE file. 15266 // 15267@@ -9,7 +9,7 @@ 15268 // implementations. See the translator.README.txt file in the tools directory 15269 // for more information. 15270 // 15271-// $hash=5bd6bbfbc74b0059f073463c28b74c9b31916e59$ 15272+// $hash=b091e620040d148171ce5c99d5376cb00356eb37$ 15273 // 15274 15275 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BROWSER_VIEW_DELEGATE_CPPTOC_H_ 15276diff --git a/src/cef/libcef_dll/cpptoc/views/button_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/button_cpptoc.cc 15277index 7ccd17db62912..890ca97f8b920 15278--- a/src/cef/libcef_dll/cpptoc/views/button_cpptoc.cc 15279+++ b/src/cef/libcef_dll/cpptoc/views/button_cpptoc.cc 15280@@ -1,4 +1,4 @@ 15281-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15282+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15283 // reserved. Use of this source code is governed by a BSD-style license that 15284 // can be found in the LICENSE file. 15285 // 15286@@ -9,7 +9,7 @@ 15287 // implementations. See the translator.README.txt file in the tools directory 15288 // for more information. 15289 // 15290-// $hash=f002c60074ac76bb3e4db3d070b5ea1b430e620d$ 15291+// $hash=d1d8ab075e6ac6cf29e2284f21b17a7e0648af71$ 15292 // 15293 15294 #include "libcef_dll/cpptoc/views/button_cpptoc.h" 15295diff --git a/src/cef/libcef_dll/cpptoc/views/button_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/button_cpptoc.h 15296index 5848a3fd83e7c..ed70f485bb601 15297--- a/src/cef/libcef_dll/cpptoc/views/button_cpptoc.h 15298+++ b/src/cef/libcef_dll/cpptoc/views/button_cpptoc.h 15299@@ -1,4 +1,4 @@ 15300-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15301+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15302 // reserved. Use of this source code is governed by a BSD-style license that 15303 // can be found in the LICENSE file. 15304 // 15305@@ -9,7 +9,7 @@ 15306 // implementations. See the translator.README.txt file in the tools directory 15307 // for more information. 15308 // 15309-// $hash=60660c0973fee97e850fcf4026b57a6f367ea294$ 15310+// $hash=3fc906cb8937c58418501c33ba81462806b26860$ 15311 // 15312 15313 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BUTTON_CPPTOC_H_ 15314diff --git a/src/cef/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc 15315index 05464b089ed6e..c04277528fc71 15316--- a/src/cef/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc 15317+++ b/src/cef/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc 15318@@ -1,4 +1,4 @@ 15319-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15320+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15321 // reserved. Use of this source code is governed by a BSD-style license that 15322 // can be found in the LICENSE file. 15323 // 15324@@ -9,7 +9,7 @@ 15325 // implementations. See the translator.README.txt file in the tools directory 15326 // for more information. 15327 // 15328-// $hash=4e776c8db93f07efd47e80fe380071539e94ec81$ 15329+// $hash=4bcd9e786dcddeb99de73e14839f121a211f0e2d$ 15330 // 15331 15332 #include "libcef_dll/cpptoc/views/button_delegate_cpptoc.h" 15333diff --git a/src/cef/libcef_dll/cpptoc/views/button_delegate_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/button_delegate_cpptoc.h 15334index 3a682e09bcf4d..b342d8c50d4fe 15335--- a/src/cef/libcef_dll/cpptoc/views/button_delegate_cpptoc.h 15336+++ b/src/cef/libcef_dll/cpptoc/views/button_delegate_cpptoc.h 15337@@ -1,4 +1,4 @@ 15338-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15339+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15340 // reserved. Use of this source code is governed by a BSD-style license that 15341 // can be found in the LICENSE file. 15342 // 15343@@ -9,7 +9,7 @@ 15344 // implementations. See the translator.README.txt file in the tools directory 15345 // for more information. 15346 // 15347-// $hash=f3b8ad78e8614f873ee581697ac29cad49a19260$ 15348+// $hash=455b4eb400cc642cfb4cf0089b12059b8be31af6$ 15349 // 15350 15351 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_BUTTON_DELEGATE_CPPTOC_H_ 15352diff --git a/src/cef/libcef_dll/cpptoc/views/display_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/display_cpptoc.cc 15353index 470fee9d11971..41d13961f52f4 15354--- a/src/cef/libcef_dll/cpptoc/views/display_cpptoc.cc 15355+++ b/src/cef/libcef_dll/cpptoc/views/display_cpptoc.cc 15356@@ -1,4 +1,4 @@ 15357-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15358+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15359 // reserved. Use of this source code is governed by a BSD-style license that 15360 // can be found in the LICENSE file. 15361 // 15362@@ -9,7 +9,7 @@ 15363 // implementations. See the translator.README.txt file in the tools directory 15364 // for more information. 15365 // 15366-// $hash=546b8f890852fb4df26a85aec6b83effe1bdc6e6$ 15367+// $hash=19b9c4f4c94c1109c599ccda41440f573c966009$ 15368 // 15369 15370 #include "libcef_dll/cpptoc/views/display_cpptoc.h" 15371diff --git a/src/cef/libcef_dll/cpptoc/views/display_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/display_cpptoc.h 15372index 6ae1863347202..13eb6a6591302 15373--- a/src/cef/libcef_dll/cpptoc/views/display_cpptoc.h 15374+++ b/src/cef/libcef_dll/cpptoc/views/display_cpptoc.h 15375@@ -1,4 +1,4 @@ 15376-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15377+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15378 // reserved. Use of this source code is governed by a BSD-style license that 15379 // can be found in the LICENSE file. 15380 // 15381@@ -9,7 +9,7 @@ 15382 // implementations. See the translator.README.txt file in the tools directory 15383 // for more information. 15384 // 15385-// $hash=5918cca150c476ead77121bb93599c763a3e13e7$ 15386+// $hash=73811073aeb490787e777b5e7f8e41ef34cd6369$ 15387 // 15388 15389 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_DISPLAY_CPPTOC_H_ 15390diff --git a/src/cef/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc 15391index b6b3a99c2a3a8..e42c249a84afc 15392--- a/src/cef/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc 15393+++ b/src/cef/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc 15394@@ -1,4 +1,4 @@ 15395-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15396+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15397 // reserved. Use of this source code is governed by a BSD-style license that 15398 // can be found in the LICENSE file. 15399 // 15400@@ -9,7 +9,7 @@ 15401 // implementations. See the translator.README.txt file in the tools directory 15402 // for more information. 15403 // 15404-// $hash=304f5db25f7e2a1e4cf169f7cc205013bb06f861$ 15405+// $hash=04718b744aa511fa8917dbcc464aecf6cda4550a$ 15406 // 15407 15408 #include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h" 15409diff --git a/src/cef/libcef_dll/cpptoc/views/fill_layout_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/fill_layout_cpptoc.h 15410index a9bdbaf9d538a..a695842261622 15411--- a/src/cef/libcef_dll/cpptoc/views/fill_layout_cpptoc.h 15412+++ b/src/cef/libcef_dll/cpptoc/views/fill_layout_cpptoc.h 15413@@ -1,4 +1,4 @@ 15414-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15415+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15416 // reserved. Use of this source code is governed by a BSD-style license that 15417 // can be found in the LICENSE file. 15418 // 15419@@ -9,7 +9,7 @@ 15420 // implementations. See the translator.README.txt file in the tools directory 15421 // for more information. 15422 // 15423-// $hash=e2bad567245e3e1bdf240be33a3b0008ec0e3b18$ 15424+// $hash=88b95199af576610e6ce7e71603fb3c8b1426046$ 15425 // 15426 15427 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_FILL_LAYOUT_CPPTOC_H_ 15428diff --git a/src/cef/libcef_dll/cpptoc/views/label_button_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/label_button_cpptoc.cc 15429index 9916f2ecfd30b..56c31670f73bd 15430--- a/src/cef/libcef_dll/cpptoc/views/label_button_cpptoc.cc 15431+++ b/src/cef/libcef_dll/cpptoc/views/label_button_cpptoc.cc 15432@@ -1,4 +1,4 @@ 15433-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15434+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15435 // reserved. Use of this source code is governed by a BSD-style license that 15436 // can be found in the LICENSE file. 15437 // 15438@@ -9,7 +9,7 @@ 15439 // implementations. See the translator.README.txt file in the tools directory 15440 // for more information. 15441 // 15442-// $hash=c32cf44685b993619659ae5f6fb681e40d0b4cd9$ 15443+// $hash=c71d13ab650b2516ba6ae3b3cfda6b2f67b45e97$ 15444 // 15445 15446 #include "libcef_dll/cpptoc/views/label_button_cpptoc.h" 15447diff --git a/src/cef/libcef_dll/cpptoc/views/label_button_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/label_button_cpptoc.h 15448index a26b71ad35f67..dad5d89582a65 15449--- a/src/cef/libcef_dll/cpptoc/views/label_button_cpptoc.h 15450+++ b/src/cef/libcef_dll/cpptoc/views/label_button_cpptoc.h 15451@@ -1,4 +1,4 @@ 15452-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15453+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15454 // reserved. Use of this source code is governed by a BSD-style license that 15455 // can be found in the LICENSE file. 15456 // 15457@@ -9,7 +9,7 @@ 15458 // implementations. See the translator.README.txt file in the tools directory 15459 // for more information. 15460 // 15461-// $hash=60d980037705be97fb1113e0b23b0e4bdd29b801$ 15462+// $hash=8e86fa292ee6e5debd2525e71eaa3ae8e42c8e55$ 15463 // 15464 15465 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_LABEL_BUTTON_CPPTOC_H_ 15466diff --git a/src/cef/libcef_dll/cpptoc/views/layout_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/layout_cpptoc.cc 15467index 5976c28b094d8..e4c688b99a411 15468--- a/src/cef/libcef_dll/cpptoc/views/layout_cpptoc.cc 15469+++ b/src/cef/libcef_dll/cpptoc/views/layout_cpptoc.cc 15470@@ -1,4 +1,4 @@ 15471-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15472+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15473 // reserved. Use of this source code is governed by a BSD-style license that 15474 // can be found in the LICENSE file. 15475 // 15476@@ -9,7 +9,7 @@ 15477 // implementations. See the translator.README.txt file in the tools directory 15478 // for more information. 15479 // 15480-// $hash=91327244b4a4c037841a54ea2a06ebe42efe5477$ 15481+// $hash=ef68f133e06458b067d4768ea64360b48f6f7b76$ 15482 // 15483 15484 #include "libcef_dll/cpptoc/views/layout_cpptoc.h" 15485diff --git a/src/cef/libcef_dll/cpptoc/views/layout_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/layout_cpptoc.h 15486index 93ac800c7ac30..76c9930eef23f 15487--- a/src/cef/libcef_dll/cpptoc/views/layout_cpptoc.h 15488+++ b/src/cef/libcef_dll/cpptoc/views/layout_cpptoc.h 15489@@ -1,4 +1,4 @@ 15490-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15491+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15492 // reserved. Use of this source code is governed by a BSD-style license that 15493 // can be found in the LICENSE file. 15494 // 15495@@ -9,7 +9,7 @@ 15496 // implementations. See the translator.README.txt file in the tools directory 15497 // for more information. 15498 // 15499-// $hash=8044bcf51ec6feacc1a186f6780c9076f5c1ec74$ 15500+// $hash=d0adda3ed7bbb825b0c9959960f832d23f75ccdc$ 15501 // 15502 15503 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_LAYOUT_CPPTOC_H_ 15504diff --git a/src/cef/libcef_dll/cpptoc/views/menu_button_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/menu_button_cpptoc.cc 15505index 4f3f0fb971be5..d43d7c55aed6a 15506--- a/src/cef/libcef_dll/cpptoc/views/menu_button_cpptoc.cc 15507+++ b/src/cef/libcef_dll/cpptoc/views/menu_button_cpptoc.cc 15508@@ -1,4 +1,4 @@ 15509-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15510+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15511 // reserved. Use of this source code is governed by a BSD-style license that 15512 // can be found in the LICENSE file. 15513 // 15514@@ -9,7 +9,7 @@ 15515 // implementations. See the translator.README.txt file in the tools directory 15516 // for more information. 15517 // 15518-// $hash=be533dcd2dd95060259a8baaece87bf2c6df0c27$ 15519+// $hash=b40df03337901e30bbd3db00a852dedc7ea500d8$ 15520 // 15521 15522 #include "libcef_dll/cpptoc/views/menu_button_cpptoc.h" 15523diff --git a/src/cef/libcef_dll/cpptoc/views/menu_button_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/menu_button_cpptoc.h 15524index 6b38233af507d..52f93e09a71c7 15525--- a/src/cef/libcef_dll/cpptoc/views/menu_button_cpptoc.h 15526+++ b/src/cef/libcef_dll/cpptoc/views/menu_button_cpptoc.h 15527@@ -1,4 +1,4 @@ 15528-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15529+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15530 // reserved. Use of this source code is governed by a BSD-style license that 15531 // can be found in the LICENSE file. 15532 // 15533@@ -9,7 +9,7 @@ 15534 // implementations. See the translator.README.txt file in the tools directory 15535 // for more information. 15536 // 15537-// $hash=d3b01ef1bca22e454dd4375df90a5a3fbd0f11f3$ 15538+// $hash=f2f44594e4cbcb3ef1ee3eb39d3d498f7a6cafbc$ 15539 // 15540 15541 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_CPPTOC_H_ 15542diff --git a/src/cef/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc 15543index 6fe5582d5c00f..295a2851e8ae2 15544--- a/src/cef/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc 15545+++ b/src/cef/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc 15546@@ -1,4 +1,4 @@ 15547-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15548+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15549 // reserved. Use of this source code is governed by a BSD-style license that 15550 // can be found in the LICENSE file. 15551 // 15552@@ -9,7 +9,7 @@ 15553 // implementations. See the translator.README.txt file in the tools directory 15554 // for more information. 15555 // 15556-// $hash=269173ab9f81796dec4b732e2050e26a177d8387$ 15557+// $hash=869a0291457438cf60cb7464dcc63dd0ac7a8cfc$ 15558 // 15559 15560 #include "libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h" 15561diff --git a/src/cef/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h 15562index 0ecc9e377eb0c..5f70f5a485c48 15563--- a/src/cef/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h 15564+++ b/src/cef/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h 15565@@ -1,4 +1,4 @@ 15566-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15567+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15568 // reserved. Use of this source code is governed by a BSD-style license that 15569 // can be found in the LICENSE file. 15570 // 15571@@ -9,7 +9,7 @@ 15572 // implementations. See the translator.README.txt file in the tools directory 15573 // for more information. 15574 // 15575-// $hash=670b8f7f67a5eacd3288724ec6439c56248477ec$ 15576+// $hash=9178b58c1b03965fc20636f3efd97c2385618574$ 15577 // 15578 15579 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_DELEGATE_CPPTOC_H_ 15580diff --git a/src/cef/libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.cc 15581index daa1e5fdd8d64..c3d85d202a0aa 15582--- a/src/cef/libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.cc 15583+++ b/src/cef/libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.cc 15584@@ -1,4 +1,4 @@ 15585-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15586+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15587 // reserved. Use of this source code is governed by a BSD-style license that 15588 // can be found in the LICENSE file. 15589 // 15590@@ -9,7 +9,7 @@ 15591 // implementations. See the translator.README.txt file in the tools directory 15592 // for more information. 15593 // 15594-// $hash=c6db7f8e7c031a323e9da96aed3aee7fd7a4f558$ 15595+// $hash=2dc6b6ba5f4b65f25877aa56083d0e6dea42e7ae$ 15596 // 15597 15598 #include "libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.h" 15599diff --git a/src/cef/libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.h 15600index 51cac8072d11e..79a8566ee59ac 15601--- a/src/cef/libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.h 15602+++ b/src/cef/libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.h 15603@@ -1,4 +1,4 @@ 15604-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15605+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15606 // reserved. Use of this source code is governed by a BSD-style license that 15607 // can be found in the LICENSE file. 15608 // 15609@@ -9,7 +9,7 @@ 15610 // implementations. See the translator.README.txt file in the tools directory 15611 // for more information. 15612 // 15613-// $hash=072279b56eeeaf089107f5f78ee431c907afda46$ 15614+// $hash=5d7f30f1265294fc8617b444bd35bee3da172746$ 15615 // 15616 15617 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_MENU_BUTTON_PRESSED_LOCK_CPPTOC_H_ 15618diff --git a/src/cef/libcef_dll/cpptoc/views/overlay_controller_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/overlay_controller_cpptoc.cc 15619index d830c864bcf15..d8ce4395261fd 15620--- a/src/cef/libcef_dll/cpptoc/views/overlay_controller_cpptoc.cc 15621+++ b/src/cef/libcef_dll/cpptoc/views/overlay_controller_cpptoc.cc 15622@@ -1,4 +1,4 @@ 15623-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15624+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15625 // reserved. Use of this source code is governed by a BSD-style license that 15626 // can be found in the LICENSE file. 15627 // 15628@@ -9,7 +9,7 @@ 15629 // implementations. See the translator.README.txt file in the tools directory 15630 // for more information. 15631 // 15632-// $hash=6cf61c4e2900a7776278d4a0542f2b3e32d4420b$ 15633+// $hash=eec6e92443829047f908febc6d9ce7e6eafc6566$ 15634 // 15635 15636 #include "libcef_dll/cpptoc/views/overlay_controller_cpptoc.h" 15637diff --git a/src/cef/libcef_dll/cpptoc/views/overlay_controller_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/overlay_controller_cpptoc.h 15638index 8e428ae9da78f..b89f8b4b273c0 15639--- a/src/cef/libcef_dll/cpptoc/views/overlay_controller_cpptoc.h 15640+++ b/src/cef/libcef_dll/cpptoc/views/overlay_controller_cpptoc.h 15641@@ -1,4 +1,4 @@ 15642-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15643+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15644 // reserved. Use of this source code is governed by a BSD-style license that 15645 // can be found in the LICENSE file. 15646 // 15647@@ -9,7 +9,7 @@ 15648 // implementations. See the translator.README.txt file in the tools directory 15649 // for more information. 15650 // 15651-// $hash=15c5e3c251b7a4f882b2e49e9a2ee6e84deb21e1$ 15652+// $hash=8d50609d2e79539752a8118f831e853b845892f4$ 15653 // 15654 15655 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_OVERLAY_CONTROLLER_CPPTOC_H_ 15656diff --git a/src/cef/libcef_dll/cpptoc/views/panel_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/panel_cpptoc.cc 15657index 3c7aeecd67dec..396ff3ee062b0 15658--- a/src/cef/libcef_dll/cpptoc/views/panel_cpptoc.cc 15659+++ b/src/cef/libcef_dll/cpptoc/views/panel_cpptoc.cc 15660@@ -1,4 +1,4 @@ 15661-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15662+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15663 // reserved. Use of this source code is governed by a BSD-style license that 15664 // can be found in the LICENSE file. 15665 // 15666@@ -9,7 +9,7 @@ 15667 // implementations. See the translator.README.txt file in the tools directory 15668 // for more information. 15669 // 15670-// $hash=fbec1a9b566580497409a7dbd3382e7c51db61ae$ 15671+// $hash=27650c566e4a7c056e5bb87a76df335ba641ab0f$ 15672 // 15673 15674 #include "libcef_dll/cpptoc/views/panel_cpptoc.h" 15675diff --git a/src/cef/libcef_dll/cpptoc/views/panel_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/panel_cpptoc.h 15676index ae2d99182ac5e..7411c0d35d823 15677--- a/src/cef/libcef_dll/cpptoc/views/panel_cpptoc.h 15678+++ b/src/cef/libcef_dll/cpptoc/views/panel_cpptoc.h 15679@@ -1,4 +1,4 @@ 15680-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15681+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15682 // reserved. Use of this source code is governed by a BSD-style license that 15683 // can be found in the LICENSE file. 15684 // 15685@@ -9,7 +9,7 @@ 15686 // implementations. See the translator.README.txt file in the tools directory 15687 // for more information. 15688 // 15689-// $hash=4fd7a58485d8ef00e6b2dff8ffdfcb1405eb4fcc$ 15690+// $hash=2c4b5c88fc2a00039dc5eb01aaa90ecd7c2ea0ad$ 15691 // 15692 15693 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_PANEL_CPPTOC_H_ 15694diff --git a/src/cef/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc 15695index ba1fabff98ba7..68f6d427f4ebb 15696--- a/src/cef/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc 15697+++ b/src/cef/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc 15698@@ -1,4 +1,4 @@ 15699-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15700+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15701 // reserved. Use of this source code is governed by a BSD-style license that 15702 // can be found in the LICENSE file. 15703 // 15704@@ -9,7 +9,7 @@ 15705 // implementations. See the translator.README.txt file in the tools directory 15706 // for more information. 15707 // 15708-// $hash=03a39472314a6cb7cf93fb0196be57e9ae308c53$ 15709+// $hash=7b91896f42ce5d096e4278d9e96dc3ac99a9e86b$ 15710 // 15711 15712 #include "libcef_dll/cpptoc/views/panel_delegate_cpptoc.h" 15713diff --git a/src/cef/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h 15714index 05fb713501368..578ce7c78238e 15715--- a/src/cef/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h 15716+++ b/src/cef/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h 15717@@ -1,4 +1,4 @@ 15718-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15719+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15720 // reserved. Use of this source code is governed by a BSD-style license that 15721 // can be found in the LICENSE file. 15722 // 15723@@ -9,7 +9,7 @@ 15724 // implementations. See the translator.README.txt file in the tools directory 15725 // for more information. 15726 // 15727-// $hash=821d48d74b437c7a0387b1d0ac1875621873b2e4$ 15728+// $hash=1eedf21b5a9e1edb24e6c24de55c991388b50c7c$ 15729 // 15730 15731 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_PANEL_DELEGATE_CPPTOC_H_ 15732diff --git a/src/cef/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc 15733index 2b15cdde26698..4b55421134531 15734--- a/src/cef/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc 15735+++ b/src/cef/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc 15736@@ -1,4 +1,4 @@ 15737-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15738+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15739 // reserved. Use of this source code is governed by a BSD-style license that 15740 // can be found in the LICENSE file. 15741 // 15742@@ -9,7 +9,7 @@ 15743 // implementations. See the translator.README.txt file in the tools directory 15744 // for more information. 15745 // 15746-// $hash=02f2588f9c40c510115d3279fbffdb9bf2f4dcfb$ 15747+// $hash=9d80193629328eede62d0da7ed5bf06b16781f52$ 15748 // 15749 15750 #include "libcef_dll/cpptoc/views/scroll_view_cpptoc.h" 15751diff --git a/src/cef/libcef_dll/cpptoc/views/scroll_view_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/scroll_view_cpptoc.h 15752index a08983a1fcb16..1861706c60cf3 15753--- a/src/cef/libcef_dll/cpptoc/views/scroll_view_cpptoc.h 15754+++ b/src/cef/libcef_dll/cpptoc/views/scroll_view_cpptoc.h 15755@@ -1,4 +1,4 @@ 15756-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15757+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15758 // reserved. Use of this source code is governed by a BSD-style license that 15759 // can be found in the LICENSE file. 15760 // 15761@@ -9,7 +9,7 @@ 15762 // implementations. See the translator.README.txt file in the tools directory 15763 // for more information. 15764 // 15765-// $hash=a5d02fd363950248101f5113ceeee2c280dd831c$ 15766+// $hash=f0b7e40e7ec1e3870dbc7f25430978c46eb1a51f$ 15767 // 15768 15769 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_SCROLL_VIEW_CPPTOC_H_ 15770diff --git a/src/cef/libcef_dll/cpptoc/views/textfield_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/textfield_cpptoc.cc 15771index 9ea6250ee730f..b8a8e7452d0ad 15772--- a/src/cef/libcef_dll/cpptoc/views/textfield_cpptoc.cc 15773+++ b/src/cef/libcef_dll/cpptoc/views/textfield_cpptoc.cc 15774@@ -1,4 +1,4 @@ 15775-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15776+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15777 // reserved. Use of this source code is governed by a BSD-style license that 15778 // can be found in the LICENSE file. 15779 // 15780@@ -9,7 +9,7 @@ 15781 // implementations. See the translator.README.txt file in the tools directory 15782 // for more information. 15783 // 15784-// $hash=1fab78c3e307dcdcdfbcc5d458121f50e23bf626$ 15785+// $hash=f21462763c1f6f19e8c0a18c100edb60cb13660c$ 15786 // 15787 15788 #include "libcef_dll/cpptoc/views/textfield_cpptoc.h" 15789diff --git a/src/cef/libcef_dll/cpptoc/views/textfield_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/textfield_cpptoc.h 15790index 730d6486d2022..790835306ec36 15791--- a/src/cef/libcef_dll/cpptoc/views/textfield_cpptoc.h 15792+++ b/src/cef/libcef_dll/cpptoc/views/textfield_cpptoc.h 15793@@ -1,4 +1,4 @@ 15794-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15795+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15796 // reserved. Use of this source code is governed by a BSD-style license that 15797 // can be found in the LICENSE file. 15798 // 15799@@ -9,7 +9,7 @@ 15800 // implementations. See the translator.README.txt file in the tools directory 15801 // for more information. 15802 // 15803-// $hash=2e8b2aebc574d685d1c39e7cb96b2e8c724a6d9c$ 15804+// $hash=0b5018c0b9d42f4ee100098365c46e0ea723ea29$ 15805 // 15806 15807 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_TEXTFIELD_CPPTOC_H_ 15808diff --git a/src/cef/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc 15809index 83590dc8889c2..dd9ad3ace4988 15810--- a/src/cef/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc 15811+++ b/src/cef/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc 15812@@ -1,4 +1,4 @@ 15813-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15814+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15815 // reserved. Use of this source code is governed by a BSD-style license that 15816 // can be found in the LICENSE file. 15817 // 15818@@ -9,7 +9,7 @@ 15819 // implementations. See the translator.README.txt file in the tools directory 15820 // for more information. 15821 // 15822-// $hash=0009ced13fa9f1e26064455df0c9f5043d7618cf$ 15823+// $hash=e9c21f1320ea2c7c750afbe1901f273f71df8213$ 15824 // 15825 15826 #include "libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h" 15827diff --git a/src/cef/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h 15828index 75abe63a36ebc..2ad4735f35999 15829--- a/src/cef/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h 15830+++ b/src/cef/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h 15831@@ -1,4 +1,4 @@ 15832-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15833+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15834 // reserved. Use of this source code is governed by a BSD-style license that 15835 // can be found in the LICENSE file. 15836 // 15837@@ -9,7 +9,7 @@ 15838 // implementations. See the translator.README.txt file in the tools directory 15839 // for more information. 15840 // 15841-// $hash=157e47e42dbb25aa2effd5bd085228d1dc3ad061$ 15842+// $hash=33ba2bd44c946bf204f2f7a929b8d208768ca3dd$ 15843 // 15844 15845 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_TEXTFIELD_DELEGATE_CPPTOC_H_ 15846diff --git a/src/cef/libcef_dll/cpptoc/views/view_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/view_cpptoc.cc 15847index f5728725a0bbf..e9b1fff41244a 15848--- a/src/cef/libcef_dll/cpptoc/views/view_cpptoc.cc 15849+++ b/src/cef/libcef_dll/cpptoc/views/view_cpptoc.cc 15850@@ -1,4 +1,4 @@ 15851-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15852+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15853 // reserved. Use of this source code is governed by a BSD-style license that 15854 // can be found in the LICENSE file. 15855 // 15856@@ -9,7 +9,7 @@ 15857 // implementations. See the translator.README.txt file in the tools directory 15858 // for more information. 15859 // 15860-// $hash=48694fa56762351ccd3369dca9e679efbda61160$ 15861+// $hash=4808be531e96aa028463b2713f2141d9d1d7cd8b$ 15862 // 15863 15864 #include "libcef_dll/cpptoc/views/view_cpptoc.h" 15865diff --git a/src/cef/libcef_dll/cpptoc/views/view_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/view_cpptoc.h 15866index e508ab45a5731..efb597517ef8d 15867--- a/src/cef/libcef_dll/cpptoc/views/view_cpptoc.h 15868+++ b/src/cef/libcef_dll/cpptoc/views/view_cpptoc.h 15869@@ -1,4 +1,4 @@ 15870-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15871+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15872 // reserved. Use of this source code is governed by a BSD-style license that 15873 // can be found in the LICENSE file. 15874 // 15875@@ -9,7 +9,7 @@ 15876 // implementations. See the translator.README.txt file in the tools directory 15877 // for more information. 15878 // 15879-// $hash=725abc7d1f25861799c54c827de37617b23a1bd5$ 15880+// $hash=0d24d12448e97907667f8347a38818e0a4d713ed$ 15881 // 15882 15883 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_VIEW_CPPTOC_H_ 15884diff --git a/src/cef/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc 15885index 28e568feef411..804f515ac3d06 15886--- a/src/cef/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc 15887+++ b/src/cef/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc 15888@@ -1,4 +1,4 @@ 15889-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15890+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15891 // reserved. Use of this source code is governed by a BSD-style license that 15892 // can be found in the LICENSE file. 15893 // 15894@@ -9,7 +9,7 @@ 15895 // implementations. See the translator.README.txt file in the tools directory 15896 // for more information. 15897 // 15898-// $hash=43217c47279478323050eef44d6403cb4b5c62a6$ 15899+// $hash=58ecca3b863657322cdb1280298486167d55bdfe$ 15900 // 15901 15902 #include "libcef_dll/cpptoc/views/view_delegate_cpptoc.h" 15903diff --git a/src/cef/libcef_dll/cpptoc/views/view_delegate_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/view_delegate_cpptoc.h 15904index 38d6332b824c5..a6903ef4f71e5 15905--- a/src/cef/libcef_dll/cpptoc/views/view_delegate_cpptoc.h 15906+++ b/src/cef/libcef_dll/cpptoc/views/view_delegate_cpptoc.h 15907@@ -1,4 +1,4 @@ 15908-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15909+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15910 // reserved. Use of this source code is governed by a BSD-style license that 15911 // can be found in the LICENSE file. 15912 // 15913@@ -9,7 +9,7 @@ 15914 // implementations. See the translator.README.txt file in the tools directory 15915 // for more information. 15916 // 15917-// $hash=ebd265b4907f2531eacce52bd6cfd1f8848b7abf$ 15918+// $hash=384b7d1f2df446d35d6ba46e62d89976d88fef7c$ 15919 // 15920 15921 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_VIEW_DELEGATE_CPPTOC_H_ 15922diff --git a/src/cef/libcef_dll/cpptoc/views/window_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/window_cpptoc.cc 15923index 53932f99f8248..b4c3387060178 15924--- a/src/cef/libcef_dll/cpptoc/views/window_cpptoc.cc 15925+++ b/src/cef/libcef_dll/cpptoc/views/window_cpptoc.cc 15926@@ -1,4 +1,4 @@ 15927-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15928+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15929 // reserved. Use of this source code is governed by a BSD-style license that 15930 // can be found in the LICENSE file. 15931 // 15932@@ -9,7 +9,7 @@ 15933 // implementations. See the translator.README.txt file in the tools directory 15934 // for more information. 15935 // 15936-// $hash=360b248f7f43cd62a111f59a79fc81b40f8d4023$ 15937+// $hash=e89c6c2ef5a7af05e58a2a7e76097910e97c9db4$ 15938 // 15939 15940 #include "libcef_dll/cpptoc/views/window_cpptoc.h" 15941diff --git a/src/cef/libcef_dll/cpptoc/views/window_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/window_cpptoc.h 15942index de348f70d4a58..e02be4494da84 15943--- a/src/cef/libcef_dll/cpptoc/views/window_cpptoc.h 15944+++ b/src/cef/libcef_dll/cpptoc/views/window_cpptoc.h 15945@@ -1,4 +1,4 @@ 15946-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15947+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15948 // reserved. Use of this source code is governed by a BSD-style license that 15949 // can be found in the LICENSE file. 15950 // 15951@@ -9,7 +9,7 @@ 15952 // implementations. See the translator.README.txt file in the tools directory 15953 // for more information. 15954 // 15955-// $hash=5b14236c7e00a7dafa47fdc32ce78d347de477a1$ 15956+// $hash=12ff3d7d14f9977ff1f62e9a35b04b153a135480$ 15957 // 15958 15959 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_WINDOW_CPPTOC_H_ 15960diff --git a/src/cef/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc 15961index 769c84a11a7f5..cdc36f8fac76e 15962--- a/src/cef/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc 15963+++ b/src/cef/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc 15964@@ -1,4 +1,4 @@ 15965-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15966+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15967 // reserved. Use of this source code is governed by a BSD-style license that 15968 // can be found in the LICENSE file. 15969 // 15970@@ -9,7 +9,7 @@ 15971 // implementations. See the translator.README.txt file in the tools directory 15972 // for more information. 15973 // 15974-// $hash=9a65c4a9e35ba40f01a3d27c772ef9b736eb75ea$ 15975+// $hash=cd7d5a65be4a9c5b983b390ec08670baf6f82be2$ 15976 // 15977 15978 #include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h" 15979diff --git a/src/cef/libcef_dll/cpptoc/views/window_delegate_cpptoc.h b/src/cef/libcef_dll/cpptoc/views/window_delegate_cpptoc.h 15980index dff58e097e217..441a2ca239b81 15981--- a/src/cef/libcef_dll/cpptoc/views/window_delegate_cpptoc.h 15982+++ b/src/cef/libcef_dll/cpptoc/views/window_delegate_cpptoc.h 15983@@ -1,4 +1,4 @@ 15984-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 15985+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 15986 // reserved. Use of this source code is governed by a BSD-style license that 15987 // can be found in the LICENSE file. 15988 // 15989@@ -9,7 +9,7 @@ 15990 // implementations. See the translator.README.txt file in the tools directory 15991 // for more information. 15992 // 15993-// $hash=594a3ff498c14872187e0ae8d466a023664c92b6$ 15994+// $hash=b4d82958ac79ac843f904c4aa8010a6909ca06fa$ 15995 // 15996 15997 #ifndef CEF_LIBCEF_DLL_CPPTOC_VIEWS_WINDOW_DELEGATE_CPPTOC_H_ 15998diff --git a/src/cef/libcef_dll/cpptoc/waitable_event_cpptoc.cc b/src/cef/libcef_dll/cpptoc/waitable_event_cpptoc.cc 15999index f65b2038dc345..3af7d1b6c0951 16000--- a/src/cef/libcef_dll/cpptoc/waitable_event_cpptoc.cc 16001+++ b/src/cef/libcef_dll/cpptoc/waitable_event_cpptoc.cc 16002@@ -1,4 +1,4 @@ 16003-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16004+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16005 // reserved. Use of this source code is governed by a BSD-style license that 16006 // can be found in the LICENSE file. 16007 // 16008@@ -9,7 +9,7 @@ 16009 // implementations. See the translator.README.txt file in the tools directory 16010 // for more information. 16011 // 16012-// $hash=ea0c4c4d8c202a47a9b5b63a57525dc726c1e40e$ 16013+// $hash=c74bf87e609f7e27581c49144f0c751199f7c2cb$ 16014 // 16015 16016 #include "libcef_dll/cpptoc/waitable_event_cpptoc.h" 16017diff --git a/src/cef/libcef_dll/cpptoc/waitable_event_cpptoc.h b/src/cef/libcef_dll/cpptoc/waitable_event_cpptoc.h 16018index cc466b7b3ed5e..1e1ba61868eaf 16019--- a/src/cef/libcef_dll/cpptoc/waitable_event_cpptoc.h 16020+++ b/src/cef/libcef_dll/cpptoc/waitable_event_cpptoc.h 16021@@ -1,4 +1,4 @@ 16022-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16023+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16024 // reserved. Use of this source code is governed by a BSD-style license that 16025 // can be found in the LICENSE file. 16026 // 16027@@ -9,7 +9,7 @@ 16028 // implementations. See the translator.README.txt file in the tools directory 16029 // for more information. 16030 // 16031-// $hash=f19f05824d06a9aadd3ad10b58e2041eb855a66e$ 16032+// $hash=c3d08738052ecc67921493df15ea0df38c040314$ 16033 // 16034 16035 #ifndef CEF_LIBCEF_DLL_CPPTOC_WAITABLE_EVENT_CPPTOC_H_ 16036diff --git a/src/cef/libcef_dll/cpptoc/web_message_receiver_cpptoc.cc b/src/cef/libcef_dll/cpptoc/web_message_receiver_cpptoc.cc 16037new file mode 100644 16038index 0000000000000..e791792deed44 16039--- /dev/null 16040+++ b/src/cef/libcef_dll/cpptoc/web_message_receiver_cpptoc.cc 16041@@ -0,0 +1,71 @@ 16042+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16043+// reserved. Use of this source code is governed by a BSD-style license that 16044+// can be found in the LICENSE file. 16045+// 16046+// --------------------------------------------------------------------------- 16047+// 16048+// This file was generated by the CEF translator tool. If making changes by 16049+// hand only do so within the body of existing method and function 16050+// implementations. See the translator.README.txt file in the tools directory 16051+// for more information. 16052+// 16053+// $hash=4a0b96e9541249b0a756bb5709359fade8df76f6$ 16054+// 16055+ 16056+#include "libcef_dll/cpptoc/web_message_receiver_cpptoc.h" 16057+#include "libcef_dll/ctocpp/value_ctocpp.h" 16058+#include "libcef_dll/shutdown_checker.h" 16059+ 16060+namespace { 16061+ 16062+// MEMBER FUNCTIONS - Body may be edited by hand. 16063+ 16064+void CEF_CALLBACK 16065+web_message_receiver_on_message(struct _cef_web_message_receiver_t* self, 16066+ struct _cef_value_t* message) { 16067+ shutdown_checker::AssertNotShutdown(); 16068+ 16069+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16070+ 16071+ DCHECK(self); 16072+ if (!self) 16073+ return; 16074+ // Verify param: message; type: refptr_diff 16075+ DCHECK(message); 16076+ if (!message) 16077+ return; 16078+ 16079+ // Execute 16080+ CefWebMessageReceiverCppToC::Get(self)->OnMessage( 16081+ CefValueCToCpp::Wrap(message)); 16082+} 16083+ 16084+} // namespace 16085+ 16086+// CONSTRUCTOR - Do not edit by hand. 16087+ 16088+CefWebMessageReceiverCppToC::CefWebMessageReceiverCppToC() { 16089+ GetStruct()->on_message = web_message_receiver_on_message; 16090+} 16091+ 16092+// DESTRUCTOR - Do not edit by hand. 16093+ 16094+CefWebMessageReceiverCppToC::~CefWebMessageReceiverCppToC() { 16095+ shutdown_checker::AssertNotShutdown(); 16096+} 16097+ 16098+template <> 16099+CefRefPtr<CefWebMessageReceiver> CefCppToCRefCounted< 16100+ CefWebMessageReceiverCppToC, 16101+ CefWebMessageReceiver, 16102+ cef_web_message_receiver_t>::UnwrapDerived(CefWrapperType type, 16103+ cef_web_message_receiver_t* s) { 16104+ NOTREACHED() << "Unexpected class type: " << type; 16105+ return nullptr; 16106+} 16107+ 16108+template <> 16109+CefWrapperType CefCppToCRefCounted<CefWebMessageReceiverCppToC, 16110+ CefWebMessageReceiver, 16111+ cef_web_message_receiver_t>::kWrapperType = 16112+ WT_WEB_MESSAGE_RECEIVER; 16113diff --git a/src/cef/libcef_dll/cpptoc/web_message_receiver_cpptoc.h b/src/cef/libcef_dll/cpptoc/web_message_receiver_cpptoc.h 16114new file mode 100644 16115index 0000000000000..9846b0985a9bf 16116--- /dev/null 16117+++ b/src/cef/libcef_dll/cpptoc/web_message_receiver_cpptoc.h 16118@@ -0,0 +1,40 @@ 16119+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16120+// reserved. Use of this source code is governed by a BSD-style license that 16121+// can be found in the LICENSE file. 16122+// 16123+// --------------------------------------------------------------------------- 16124+// 16125+// This file was generated by the CEF translator tool. If making changes by 16126+// hand only do so within the body of existing method and function 16127+// implementations. See the translator.README.txt file in the tools directory 16128+// for more information. 16129+// 16130+// $hash=849fd01178757316d7b9a87fcc89d7a862186798$ 16131+// 16132+ 16133+#ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_MESSAGE_RECEIVER_CPPTOC_H_ 16134+#define CEF_LIBCEF_DLL_CPPTOC_WEB_MESSAGE_RECEIVER_CPPTOC_H_ 16135+#pragma once 16136+ 16137+#if !defined(WRAPPING_CEF_SHARED) 16138+#error This file can be included wrapper-side only 16139+#endif 16140+ 16141+#include "include/capi/cef_browser_capi.h" 16142+#include "include/capi/cef_client_capi.h" 16143+#include "include/cef_browser.h" 16144+#include "include/cef_client.h" 16145+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h" 16146+ 16147+// Wrap a C++ class with a C structure. 16148+// This class may be instantiated and accessed wrapper-side only. 16149+class CefWebMessageReceiverCppToC 16150+ : public CefCppToCRefCounted<CefWebMessageReceiverCppToC, 16151+ CefWebMessageReceiver, 16152+ cef_web_message_receiver_t> { 16153+ public: 16154+ CefWebMessageReceiverCppToC(); 16155+ virtual ~CefWebMessageReceiverCppToC(); 16156+}; 16157+ 16158+#endif // CEF_LIBCEF_DLL_CPPTOC_WEB_MESSAGE_RECEIVER_CPPTOC_H_ 16159diff --git a/src/cef/libcef_dll/cpptoc/web_storage_cpptoc.cc b/src/cef/libcef_dll/cpptoc/web_storage_cpptoc.cc 16160index 5176cd1efbcd8..648fdc96bc2ee 16161--- a/src/cef/libcef_dll/cpptoc/web_storage_cpptoc.cc 16162+++ b/src/cef/libcef_dll/cpptoc/web_storage_cpptoc.cc 16163@@ -1,4 +1,4 @@ 16164-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16165+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16166 // reserved. Use of this source code is governed by a BSD-style license that 16167 // can be found in the LICENSE file. 16168 // 16169@@ -9,7 +9,7 @@ 16170 // implementations. See the translator.README.txt file in the tools directory 16171 // for more information. 16172 // 16173-// $hash=959e73af8a9517a5a2381606195efc0fde114317$ 16174+// $hash=53c636c06989583d0ad24c92f4aedce825e5e8ad$ 16175 // 16176 16177 #include "libcef_dll/cpptoc/web_storage_cpptoc.h" 16178diff --git a/src/cef/libcef_dll/cpptoc/web_storage_cpptoc.h b/src/cef/libcef_dll/cpptoc/web_storage_cpptoc.h 16179index 1e1b951eccc99..6c3ea996fbd0e 16180--- a/src/cef/libcef_dll/cpptoc/web_storage_cpptoc.h 16181+++ b/src/cef/libcef_dll/cpptoc/web_storage_cpptoc.h 16182@@ -1,4 +1,4 @@ 16183-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16184+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16185 // reserved. Use of this source code is governed by a BSD-style license that 16186 // can be found in the LICENSE file. 16187 // 16188@@ -9,7 +9,7 @@ 16189 // implementations. See the translator.README.txt file in the tools directory 16190 // for more information. 16191 // 16192-// $hash=e96ec830a2f1b20fc1ec99664ce7a2df266b73dc$ 16193+// $hash=811b936281434fdc17bbb33dc50640bfc8d5dd33$ 16194 // 16195 16196 #ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_STORAGE_CPPTOC_H_ 16197diff --git a/src/cef/libcef_dll/cpptoc/write_handler_cpptoc.cc b/src/cef/libcef_dll/cpptoc/write_handler_cpptoc.cc 16198index 8de6eb3a2e2fa..5cb60f31a9a19 16199--- a/src/cef/libcef_dll/cpptoc/write_handler_cpptoc.cc 16200+++ b/src/cef/libcef_dll/cpptoc/write_handler_cpptoc.cc 16201@@ -1,4 +1,4 @@ 16202-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16203+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16204 // reserved. Use of this source code is governed by a BSD-style license that 16205 // can be found in the LICENSE file. 16206 // 16207@@ -9,7 +9,7 @@ 16208 // implementations. See the translator.README.txt file in the tools directory 16209 // for more information. 16210 // 16211-// $hash=208b9651cb7a357f7665e6d449c6ba974dfae9e3$ 16212+// $hash=9c53b2b7086bf095aa4a4b39fbf5beb6b89b8ea7$ 16213 // 16214 16215 #include "libcef_dll/cpptoc/write_handler_cpptoc.h" 16216diff --git a/src/cef/libcef_dll/cpptoc/write_handler_cpptoc.h b/src/cef/libcef_dll/cpptoc/write_handler_cpptoc.h 16217index dfcfd5b41dadf..60a0ba7924f85 16218--- a/src/cef/libcef_dll/cpptoc/write_handler_cpptoc.h 16219+++ b/src/cef/libcef_dll/cpptoc/write_handler_cpptoc.h 16220@@ -1,4 +1,4 @@ 16221-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16222+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16223 // reserved. Use of this source code is governed by a BSD-style license that 16224 // can be found in the LICENSE file. 16225 // 16226@@ -9,7 +9,7 @@ 16227 // implementations. See the translator.README.txt file in the tools directory 16228 // for more information. 16229 // 16230-// $hash=b6360b7899237a1d616dd8c1cff016d397acbcd3$ 16231+// $hash=94c67ea9a0a7a44b92ef2d322f7dd34490f5b8e6$ 16232 // 16233 16234 #ifndef CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ 16235diff --git a/src/cef/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc b/src/cef/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc 16236index abbd87a9ba645..f0685aeada23c 16237--- a/src/cef/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc 16238+++ b/src/cef/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc 16239@@ -1,4 +1,4 @@ 16240-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16241+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16242 // reserved. Use of this source code is governed by a BSD-style license that 16243 // can be found in the LICENSE file. 16244 // 16245@@ -9,7 +9,7 @@ 16246 // implementations. See the translator.README.txt file in the tools directory 16247 // for more information. 16248 // 16249-// $hash=08b0ac0ef8621f8ce81753616044a5e04dc4a191$ 16250+// $hash=513c53172ce1c11c036ff200d1ea73c4015b7f3d$ 16251 // 16252 16253 #include "libcef_dll/cpptoc/x509cert_principal_cpptoc.h" 16254diff --git a/src/cef/libcef_dll/cpptoc/x509cert_principal_cpptoc.h b/src/cef/libcef_dll/cpptoc/x509cert_principal_cpptoc.h 16255index 244854b81a8d6..8aba2d611d836 16256--- a/src/cef/libcef_dll/cpptoc/x509cert_principal_cpptoc.h 16257+++ b/src/cef/libcef_dll/cpptoc/x509cert_principal_cpptoc.h 16258@@ -1,4 +1,4 @@ 16259-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16260+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16261 // reserved. Use of this source code is governed by a BSD-style license that 16262 // can be found in the LICENSE file. 16263 // 16264@@ -9,7 +9,7 @@ 16265 // implementations. See the translator.README.txt file in the tools directory 16266 // for more information. 16267 // 16268-// $hash=2041bbbdcbf9434c1a5205ebae8438d47725aa1f$ 16269+// $hash=6e97a51d6d111d04e88c67e98eff127d7ca09dc1$ 16270 // 16271 16272 #ifndef CEF_LIBCEF_DLL_CPPTOC_X509CERT_PRINCIPAL_CPPTOC_H_ 16273diff --git a/src/cef/libcef_dll/cpptoc/x509certificate_cpptoc.cc b/src/cef/libcef_dll/cpptoc/x509certificate_cpptoc.cc 16274index e510b4d19200f..6a0b07933fcd1 16275--- a/src/cef/libcef_dll/cpptoc/x509certificate_cpptoc.cc 16276+++ b/src/cef/libcef_dll/cpptoc/x509certificate_cpptoc.cc 16277@@ -1,4 +1,4 @@ 16278-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16279+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16280 // reserved. Use of this source code is governed by a BSD-style license that 16281 // can be found in the LICENSE file. 16282 // 16283@@ -9,7 +9,7 @@ 16284 // implementations. See the translator.README.txt file in the tools directory 16285 // for more information. 16286 // 16287-// $hash=cac3e88ea15965e3a7786500606845b0b6157212$ 16288+// $hash=42a3effdf914b981136faef4528708ea47aba8c1$ 16289 // 16290 16291 #include "libcef_dll/cpptoc/x509certificate_cpptoc.h" 16292diff --git a/src/cef/libcef_dll/cpptoc/x509certificate_cpptoc.h b/src/cef/libcef_dll/cpptoc/x509certificate_cpptoc.h 16293index 29644da070b96..6ef90271fca96 16294--- a/src/cef/libcef_dll/cpptoc/x509certificate_cpptoc.h 16295+++ b/src/cef/libcef_dll/cpptoc/x509certificate_cpptoc.h 16296@@ -1,4 +1,4 @@ 16297-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16298+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16299 // reserved. Use of this source code is governed by a BSD-style license that 16300 // can be found in the LICENSE file. 16301 // 16302@@ -9,7 +9,7 @@ 16303 // implementations. See the translator.README.txt file in the tools directory 16304 // for more information. 16305 // 16306-// $hash=6eb11abb213e5b3e50494c956c51d6286020ca39$ 16307+// $hash=11090b23faf77d87bde0a603e74a0697be58fa7c$ 16308 // 16309 16310 #ifndef CEF_LIBCEF_DLL_CPPTOC_X509CERTIFICATE_CPPTOC_H_ 16311diff --git a/src/cef/libcef_dll/cpptoc/xml_reader_cpptoc.cc b/src/cef/libcef_dll/cpptoc/xml_reader_cpptoc.cc 16312index ae117e5f241ce..a782ff1432587 16313--- a/src/cef/libcef_dll/cpptoc/xml_reader_cpptoc.cc 16314+++ b/src/cef/libcef_dll/cpptoc/xml_reader_cpptoc.cc 16315@@ -1,4 +1,4 @@ 16316-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16317+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16318 // reserved. Use of this source code is governed by a BSD-style license that 16319 // can be found in the LICENSE file. 16320 // 16321@@ -9,7 +9,7 @@ 16322 // implementations. See the translator.README.txt file in the tools directory 16323 // for more information. 16324 // 16325-// $hash=3ac5f5c45a59bad3310db431653227ceac42186e$ 16326+// $hash=e4ec9a462bd52b87a605d8c2c677b278943e55f9$ 16327 // 16328 16329 #include "libcef_dll/cpptoc/xml_reader_cpptoc.h" 16330diff --git a/src/cef/libcef_dll/cpptoc/xml_reader_cpptoc.h b/src/cef/libcef_dll/cpptoc/xml_reader_cpptoc.h 16331index 5f32d62c81f89..0a69e23f147a2 16332--- a/src/cef/libcef_dll/cpptoc/xml_reader_cpptoc.h 16333+++ b/src/cef/libcef_dll/cpptoc/xml_reader_cpptoc.h 16334@@ -1,4 +1,4 @@ 16335-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16336+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16337 // reserved. Use of this source code is governed by a BSD-style license that 16338 // can be found in the LICENSE file. 16339 // 16340@@ -9,7 +9,7 @@ 16341 // implementations. See the translator.README.txt file in the tools directory 16342 // for more information. 16343 // 16344-// $hash=397fee4bf9eb4c1dc2117bba9ac2b63542335196$ 16345+// $hash=1305b95acf584a0a0e5fd412e948f195233f476b$ 16346 // 16347 16348 #ifndef CEF_LIBCEF_DLL_CPPTOC_XML_READER_CPPTOC_H_ 16349diff --git a/src/cef/libcef_dll/cpptoc/zip_reader_cpptoc.cc b/src/cef/libcef_dll/cpptoc/zip_reader_cpptoc.cc 16350index a53a7a724eeb0..7231cc3ffead5 16351--- a/src/cef/libcef_dll/cpptoc/zip_reader_cpptoc.cc 16352+++ b/src/cef/libcef_dll/cpptoc/zip_reader_cpptoc.cc 16353@@ -1,4 +1,4 @@ 16354-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16355+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16356 // reserved. Use of this source code is governed by a BSD-style license that 16357 // can be found in the LICENSE file. 16358 // 16359@@ -9,7 +9,7 @@ 16360 // implementations. See the translator.README.txt file in the tools directory 16361 // for more information. 16362 // 16363-// $hash=9fe9e9199e284af22669ba2abfb715d0e7ae8de3$ 16364+// $hash=1fdbab5695a0c6e3eb026cd78dda309b620c75a7$ 16365 // 16366 16367 #include "libcef_dll/cpptoc/zip_reader_cpptoc.h" 16368diff --git a/src/cef/libcef_dll/cpptoc/zip_reader_cpptoc.h b/src/cef/libcef_dll/cpptoc/zip_reader_cpptoc.h 16369index c04789a0c9290..06233d39eae09 16370--- a/src/cef/libcef_dll/cpptoc/zip_reader_cpptoc.h 16371+++ b/src/cef/libcef_dll/cpptoc/zip_reader_cpptoc.h 16372@@ -1,4 +1,4 @@ 16373-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16374+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16375 // reserved. Use of this source code is governed by a BSD-style license that 16376 // can be found in the LICENSE file. 16377 // 16378@@ -9,7 +9,7 @@ 16379 // implementations. See the translator.README.txt file in the tools directory 16380 // for more information. 16381 // 16382-// $hash=10530d641ffc50165b89d16e76230b9ab3f9aca5$ 16383+// $hash=488ca93df16ff22fdd9d397aab117990f01f3331$ 16384 // 16385 16386 #ifndef CEF_LIBCEF_DLL_CPPTOC_ZIP_READER_CPPTOC_H_ 16387diff --git a/src/cef/libcef_dll/ctocpp/access_request_ctocpp.cc b/src/cef/libcef_dll/ctocpp/access_request_ctocpp.cc 16388index 4d7e095ef4da0..800bc7e9e08db 16389--- a/src/cef/libcef_dll/ctocpp/access_request_ctocpp.cc 16390+++ b/src/cef/libcef_dll/ctocpp/access_request_ctocpp.cc 16391@@ -1,4 +1,4 @@ 16392-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16393+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16394 // reserved. Use of this source code is governed by a BSD-style license that 16395 // can be found in the LICENSE file. 16396 // 16397@@ -9,7 +9,7 @@ 16398 // implementations. See the translator.README.txt file in the tools directory 16399 // for more information. 16400 // 16401-// $hash=05b34b1c04c69b654aad9a8136efbe83693d255f$ 16402+// $hash=1e70efca41e4964cb02f68b5f93dc4a4567b60da$ 16403 // 16404 16405 #include "libcef_dll/ctocpp/access_request_ctocpp.h" 16406diff --git a/src/cef/libcef_dll/ctocpp/access_request_ctocpp.h b/src/cef/libcef_dll/ctocpp/access_request_ctocpp.h 16407index fc0300402f19d..5eb1d7f759de9 16408--- a/src/cef/libcef_dll/ctocpp/access_request_ctocpp.h 16409+++ b/src/cef/libcef_dll/ctocpp/access_request_ctocpp.h 16410@@ -1,4 +1,4 @@ 16411-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16412+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16413 // reserved. Use of this source code is governed by a BSD-style license that 16414 // can be found in the LICENSE file. 16415 // 16416@@ -9,7 +9,7 @@ 16417 // implementations. See the translator.README.txt file in the tools directory 16418 // for more information. 16419 // 16420-// $hash=9a6a1dd32258b15f1694c3070c61bf0d0092f18f$ 16421+// $hash=08c6bc8913ed7dcf8134fe99745d8f9a4fbc7fa4$ 16422 // 16423 16424 #ifndef CEF_LIBCEF_DLL_CTOCPP_ACCESS_REQUEST_CTOCPP_H_ 16425diff --git a/src/cef/libcef_dll/ctocpp/accessibility_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/accessibility_handler_ctocpp.cc 16426index 544ecf2731753..1f6d139cc9793 16427--- a/src/cef/libcef_dll/ctocpp/accessibility_handler_ctocpp.cc 16428+++ b/src/cef/libcef_dll/ctocpp/accessibility_handler_ctocpp.cc 16429@@ -1,4 +1,4 @@ 16430-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16431+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16432 // reserved. Use of this source code is governed by a BSD-style license that 16433 // can be found in the LICENSE file. 16434 // 16435@@ -9,7 +9,7 @@ 16436 // implementations. See the translator.README.txt file in the tools directory 16437 // for more information. 16438 // 16439-// $hash=ced6517a7c7149502b418c5fb06386ff30777630$ 16440+// $hash=0613e7faeb146728fa191bcb163f5d2a7386378f$ 16441 // 16442 16443 #include "libcef_dll/ctocpp/accessibility_handler_ctocpp.h" 16444diff --git a/src/cef/libcef_dll/ctocpp/accessibility_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/accessibility_handler_ctocpp.h 16445index 17804af63428b..0a94e2ead1e4e 16446--- a/src/cef/libcef_dll/ctocpp/accessibility_handler_ctocpp.h 16447+++ b/src/cef/libcef_dll/ctocpp/accessibility_handler_ctocpp.h 16448@@ -1,4 +1,4 @@ 16449-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16450+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16451 // reserved. Use of this source code is governed by a BSD-style license that 16452 // can be found in the LICENSE file. 16453 // 16454@@ -9,7 +9,7 @@ 16455 // implementations. See the translator.README.txt file in the tools directory 16456 // for more information. 16457 // 16458-// $hash=7ab53ef41cd69320ac6441e514582fd583203207$ 16459+// $hash=3bfebc6542251128247e89a55fba8cbb3bc7061d$ 16460 // 16461 16462 #ifndef CEF_LIBCEF_DLL_CTOCPP_ACCESSIBILITY_HANDLER_CTOCPP_H_ 16463diff --git a/src/cef/libcef_dll/ctocpp/app_ctocpp.cc b/src/cef/libcef_dll/ctocpp/app_ctocpp.cc 16464index 6d60e8f0cd219..49ca33f2e07c5 16465--- a/src/cef/libcef_dll/ctocpp/app_ctocpp.cc 16466+++ b/src/cef/libcef_dll/ctocpp/app_ctocpp.cc 16467@@ -1,4 +1,4 @@ 16468-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16469+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16470 // reserved. Use of this source code is governed by a BSD-style license that 16471 // can be found in the LICENSE file. 16472 // 16473@@ -9,7 +9,7 @@ 16474 // implementations. See the translator.README.txt file in the tools directory 16475 // for more information. 16476 // 16477-// $hash=9986455b9b29bd88504e9b4c2b73bfebc87cfc61$ 16478+// $hash=60ccdb3fa2c50678bc2ba4aeb04a6ed9428f0671$ 16479 // 16480 16481 #include "libcef_dll/ctocpp/app_ctocpp.h" 16482diff --git a/src/cef/libcef_dll/ctocpp/app_ctocpp.h b/src/cef/libcef_dll/ctocpp/app_ctocpp.h 16483index bac5ba4bb12b3..80424a306c27b 16484--- a/src/cef/libcef_dll/ctocpp/app_ctocpp.h 16485+++ b/src/cef/libcef_dll/ctocpp/app_ctocpp.h 16486@@ -1,4 +1,4 @@ 16487-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16488+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16489 // reserved. Use of this source code is governed by a BSD-style license that 16490 // can be found in the LICENSE file. 16491 // 16492@@ -9,7 +9,7 @@ 16493 // implementations. See the translator.README.txt file in the tools directory 16494 // for more information. 16495 // 16496-// $hash=b1a38565477fd1c436d8a62bfa9d41747f7fe30f$ 16497+// $hash=ea433c4f09f9cc1c432e3406dacfe27ec81c20cb$ 16498 // 16499 16500 #ifndef CEF_LIBCEF_DLL_CTOCPP_APP_CTOCPP_H_ 16501diff --git a/src/cef/libcef_dll/ctocpp/audio_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/audio_handler_ctocpp.cc 16502index fcba4e08799dd..0352ecfc01bef 16503--- a/src/cef/libcef_dll/ctocpp/audio_handler_ctocpp.cc 16504+++ b/src/cef/libcef_dll/ctocpp/audio_handler_ctocpp.cc 16505@@ -1,4 +1,4 @@ 16506-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16507+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16508 // reserved. Use of this source code is governed by a BSD-style license that 16509 // can be found in the LICENSE file. 16510 // 16511@@ -9,7 +9,7 @@ 16512 // implementations. See the translator.README.txt file in the tools directory 16513 // for more information. 16514 // 16515-// $hash=e2df55073d0fb809dcd4cf0f6bb7ed36dcd4f73c$ 16516+// $hash=de4ec961ee7ee01943cf5a21b7e0729109d74d31$ 16517 // 16518 16519 #include "libcef_dll/ctocpp/audio_handler_ctocpp.h" 16520diff --git a/src/cef/libcef_dll/ctocpp/audio_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/audio_handler_ctocpp.h 16521index cdb6138637ad3..07bf46b6327a1 16522--- a/src/cef/libcef_dll/ctocpp/audio_handler_ctocpp.h 16523+++ b/src/cef/libcef_dll/ctocpp/audio_handler_ctocpp.h 16524@@ -1,4 +1,4 @@ 16525-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16526+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16527 // reserved. Use of this source code is governed by a BSD-style license that 16528 // can be found in the LICENSE file. 16529 // 16530@@ -9,7 +9,7 @@ 16531 // implementations. See the translator.README.txt file in the tools directory 16532 // for more information. 16533 // 16534-// $hash=9de91dcf5136e07c0d5c06ad9be8173b918f668a$ 16535+// $hash=761b05f6a7cd2f0cfc1968a3902bd874060ad79b$ 16536 // 16537 16538 #ifndef CEF_LIBCEF_DLL_CTOCPP_AUDIO_HANDLER_CTOCPP_H_ 16539diff --git a/src/cef/libcef_dll/ctocpp/auth_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/auth_callback_ctocpp.cc 16540index ee290eb9b4c8f..e86d64fbbb335 16541--- a/src/cef/libcef_dll/ctocpp/auth_callback_ctocpp.cc 16542+++ b/src/cef/libcef_dll/ctocpp/auth_callback_ctocpp.cc 16543@@ -1,4 +1,4 @@ 16544-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16545+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16546 // reserved. Use of this source code is governed by a BSD-style license that 16547 // can be found in the LICENSE file. 16548 // 16549@@ -9,7 +9,7 @@ 16550 // implementations. See the translator.README.txt file in the tools directory 16551 // for more information. 16552 // 16553-// $hash=e7ec4903d06110c27d271a7e946c90231b8d3f08$ 16554+// $hash=1397d65bac566cf536f65f10709e0cd0448692fa$ 16555 // 16556 16557 #include "libcef_dll/ctocpp/auth_callback_ctocpp.h" 16558diff --git a/src/cef/libcef_dll/ctocpp/auth_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/auth_callback_ctocpp.h 16559index c03f19aec0d3b..aba08fadedf4e 16560--- a/src/cef/libcef_dll/ctocpp/auth_callback_ctocpp.h 16561+++ b/src/cef/libcef_dll/ctocpp/auth_callback_ctocpp.h 16562@@ -1,4 +1,4 @@ 16563-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16564+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16565 // reserved. Use of this source code is governed by a BSD-style license that 16566 // can be found in the LICENSE file. 16567 // 16568@@ -9,7 +9,7 @@ 16569 // implementations. See the translator.README.txt file in the tools directory 16570 // for more information. 16571 // 16572-// $hash=74b470ef09c99a7d2ccbe7e9134e0b4d1f11be03$ 16573+// $hash=b21ded769da39fdf3e0ae7991bdc6a2175a4113d$ 16574 // 16575 16576 #ifndef CEF_LIBCEF_DLL_CTOCPP_AUTH_CALLBACK_CTOCPP_H_ 16577diff --git a/src/cef/libcef_dll/ctocpp/before_download_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/before_download_callback_ctocpp.cc 16578index 35b0bb6593a34..e98722822d887 16579--- a/src/cef/libcef_dll/ctocpp/before_download_callback_ctocpp.cc 16580+++ b/src/cef/libcef_dll/ctocpp/before_download_callback_ctocpp.cc 16581@@ -1,4 +1,4 @@ 16582-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16583+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16584 // reserved. Use of this source code is governed by a BSD-style license that 16585 // can be found in the LICENSE file. 16586 // 16587@@ -9,7 +9,7 @@ 16588 // implementations. See the translator.README.txt file in the tools directory 16589 // for more information. 16590 // 16591-// $hash=dab6c53c94db70fbeb54b440584a5147c52fe082$ 16592+// $hash=70cd50b1ed22e0b0068a90539de1f00ddd0511dd$ 16593 // 16594 16595 #include "libcef_dll/ctocpp/before_download_callback_ctocpp.h" 16596diff --git a/src/cef/libcef_dll/ctocpp/before_download_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/before_download_callback_ctocpp.h 16597index 52415e89675ad..23739dd84de11 16598--- a/src/cef/libcef_dll/ctocpp/before_download_callback_ctocpp.h 16599+++ b/src/cef/libcef_dll/ctocpp/before_download_callback_ctocpp.h 16600@@ -1,4 +1,4 @@ 16601-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16602+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16603 // reserved. Use of this source code is governed by a BSD-style license that 16604 // can be found in the LICENSE file. 16605 // 16606@@ -9,7 +9,7 @@ 16607 // implementations. See the translator.README.txt file in the tools directory 16608 // for more information. 16609 // 16610-// $hash=f2b6a61b2459566fef19ee3824d7c155bf7f25d1$ 16611+// $hash=743f5b5893055b96eb373b93368c727b3d36d3c6$ 16612 // 16613 16614 #ifndef CEF_LIBCEF_DLL_CTOCPP_BEFORE_DOWNLOAD_CALLBACK_CTOCPP_H_ 16615diff --git a/src/cef/libcef_dll/ctocpp/binary_value_ctocpp.cc b/src/cef/libcef_dll/ctocpp/binary_value_ctocpp.cc 16616index 307b982cde15b..b9c7809c3ece0 16617--- a/src/cef/libcef_dll/ctocpp/binary_value_ctocpp.cc 16618+++ b/src/cef/libcef_dll/ctocpp/binary_value_ctocpp.cc 16619@@ -1,4 +1,4 @@ 16620-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16621+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16622 // reserved. Use of this source code is governed by a BSD-style license that 16623 // can be found in the LICENSE file. 16624 // 16625@@ -9,7 +9,7 @@ 16626 // implementations. See the translator.README.txt file in the tools directory 16627 // for more information. 16628 // 16629-// $hash=80a91b8a85dc537cb49cbd5eaea974f92fbf9cde$ 16630+// $hash=50f74bf4eaafce6b10c91af2a9bf516fac113cf5$ 16631 // 16632 16633 #include "libcef_dll/ctocpp/binary_value_ctocpp.h" 16634diff --git a/src/cef/libcef_dll/ctocpp/binary_value_ctocpp.h b/src/cef/libcef_dll/ctocpp/binary_value_ctocpp.h 16635index 5a768b4747b97..414f70260ccf9 16636--- a/src/cef/libcef_dll/ctocpp/binary_value_ctocpp.h 16637+++ b/src/cef/libcef_dll/ctocpp/binary_value_ctocpp.h 16638@@ -1,4 +1,4 @@ 16639-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16640+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16641 // reserved. Use of this source code is governed by a BSD-style license that 16642 // can be found in the LICENSE file. 16643 // 16644@@ -9,7 +9,7 @@ 16645 // implementations. See the translator.README.txt file in the tools directory 16646 // for more information. 16647 // 16648-// $hash=e9e56607998130280b093c45987aa294c06f1912$ 16649+// $hash=b6f011a6c26b4264084eb68dae0d63032c07013c$ 16650 // 16651 16652 #ifndef CEF_LIBCEF_DLL_CTOCPP_BINARY_VALUE_CTOCPP_H_ 16653diff --git a/src/cef/libcef_dll/ctocpp/browser_ctocpp.cc b/src/cef/libcef_dll/ctocpp/browser_ctocpp.cc 16654index f2a84fea5f8a4..a9bdc2a55717a 16655--- a/src/cef/libcef_dll/ctocpp/browser_ctocpp.cc 16656+++ b/src/cef/libcef_dll/ctocpp/browser_ctocpp.cc 16657@@ -1,4 +1,4 @@ 16658-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16659+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16660 // reserved. Use of this source code is governed by a BSD-style license that 16661 // can be found in the LICENSE file. 16662 // 16663@@ -9,7 +9,7 @@ 16664 // implementations. See the translator.README.txt file in the tools directory 16665 // for more information. 16666 // 16667-// $hash=8a99c30f78379c8bac224637139db4110d8801cb$ 16668+// $hash=ab991c66f7028ebb53acbd5cf350c89a880f4383$ 16669 // 16670 16671 #include "libcef_dll/ctocpp/browser_ctocpp.h" 16672diff --git a/src/cef/libcef_dll/ctocpp/browser_ctocpp.h b/src/cef/libcef_dll/ctocpp/browser_ctocpp.h 16673index df1823631cb26..f59811147206e 16674--- a/src/cef/libcef_dll/ctocpp/browser_ctocpp.h 16675+++ b/src/cef/libcef_dll/ctocpp/browser_ctocpp.h 16676@@ -1,4 +1,4 @@ 16677-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16678+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16679 // reserved. Use of this source code is governed by a BSD-style license that 16680 // can be found in the LICENSE file. 16681 // 16682@@ -9,7 +9,7 @@ 16683 // implementations. See the translator.README.txt file in the tools directory 16684 // for more information. 16685 // 16686-// $hash=4e74199d2ef640e3276988dc06a53ff84140b3fc$ 16687+// $hash=66aac50bedd02f309bb3715b0d4cafb0cd824c4d$ 16688 // 16689 16690 #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ 16691diff --git a/src/cef/libcef_dll/ctocpp/browser_host_ctocpp.cc b/src/cef/libcef_dll/ctocpp/browser_host_ctocpp.cc 16692index d8cc8a629438f..188871e22d02a 16693--- a/src/cef/libcef_dll/ctocpp/browser_host_ctocpp.cc 16694+++ b/src/cef/libcef_dll/ctocpp/browser_host_ctocpp.cc 16695@@ -1,4 +1,4 @@ 16696-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16697+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16698 // reserved. Use of this source code is governed by a BSD-style license that 16699 // can be found in the LICENSE file. 16700 // 16701@@ -9,7 +9,7 @@ 16702 // implementations. See the translator.README.txt file in the tools directory 16703 // for more information. 16704 // 16705-// $hash=b32d8d2e7ae95dbd4a49292b8a1d44d5c74a8e30$ 16706+// $hash=4912cb91f0c5d4e550ab1441c8848477bc787a11$ 16707 // 16708 16709 #include "libcef_dll/ctocpp/browser_host_ctocpp.h" 16710@@ -22,6 +22,8 @@ 16711 #include "libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h" 16712 #include "libcef_dll/cpptoc/store_web_archive_result_callback_cpptoc.h" 16713 #include "libcef_dll/cpptoc/task_cpptoc.h" 16714+#include "libcef_dll/cpptoc/web_message_receiver_cpptoc.h" 16715+#include "libcef_dll/ctocpp/binary_value_ctocpp.h" 16716 #include "libcef_dll/ctocpp/browser_ctocpp.h" 16717 #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" 16718 #include "libcef_dll/ctocpp/drag_data_ctocpp.h" 16719@@ -29,6 +31,7 @@ 16720 #include "libcef_dll/ctocpp/navigation_entry_ctocpp.h" 16721 #include "libcef_dll/ctocpp/registration_ctocpp.h" 16722 #include "libcef_dll/ctocpp/request_context_ctocpp.h" 16723+#include "libcef_dll/ctocpp/value_ctocpp.h" 16724 #include "libcef_dll/shutdown_checker.h" 16725 #include "libcef_dll/transfer_util.h" 16726 16727@@ -1122,7 +1125,7 @@ void CefBrowserHostCToCpp::DestroyAllWebMessagePorts() { 16728 16729 NO_SANITIZE("cfi-icall") 16730 void CefBrowserHostCToCpp::PostPortMessage(CefString& port_handle, 16731- CefString& data) { 16732+ CefRefPtr<CefValue> message) { 16733 shutdown_checker::AssertNotShutdown(); 16734 16735 cef_browser_host_t* _struct = GetStruct(); 16736@@ -1131,15 +1134,20 @@ void CefBrowserHostCToCpp::PostPortMessage(CefString& port_handle, 16737 16738 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16739 16740+ // Verify param: message; type: refptr_same 16741+ DCHECK(message.get()); 16742+ if (!message.get()) 16743+ return; 16744+ 16745 // Execute 16746 _struct->post_port_message(_struct, port_handle.GetWritableStruct(), 16747- data.GetWritableStruct()); 16748+ CefValueCToCpp::Unwrap(message)); 16749 } 16750 16751 NO_SANITIZE("cfi-icall") 16752 void CefBrowserHostCToCpp::SetPortMessageCallback( 16753 CefString& port_handle, 16754- CefRefPtr<CefJavaScriptResultCallback> callback) { 16755+ CefRefPtr<CefWebMessageReceiver> callback) { 16756 shutdown_checker::AssertNotShutdown(); 16757 16758 cef_browser_host_t* _struct = GetStruct(); 16759@@ -1156,7 +1164,7 @@ void CefBrowserHostCToCpp::SetPortMessageCallback( 16760 // Execute 16761 _struct->set_port_message_callback( 16762 _struct, port_handle.GetWritableStruct(), 16763- CefJavaScriptResultCallbackCppToC::Wrap(callback)); 16764+ CefWebMessageReceiverCppToC::Wrap(callback)); 16765 } 16766 16767 NO_SANITIZE("cfi-icall") 16768@@ -1712,6 +1720,189 @@ void CefBrowserHostCToCpp::UpdateLocale(const CefString& locale) { 16769 _struct->update_locale(_struct, locale.GetStruct()); 16770 } 16771 16772+NO_SANITIZE("cfi-icall") CefString CefBrowserHostCToCpp::GetOriginalUrl() { 16773+ shutdown_checker::AssertNotShutdown(); 16774+ 16775+ cef_browser_host_t* _struct = GetStruct(); 16776+ if (CEF_MEMBER_MISSING(_struct, get_original_url)) 16777+ return CefString(); 16778+ 16779+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16780+ 16781+ // Execute 16782+ cef_string_userfree_t _retval = _struct->get_original_url(_struct); 16783+ 16784+ // Return type: string 16785+ CefString _retvalStr; 16786+ _retvalStr.AttachToUserFree(_retval); 16787+ return _retvalStr; 16788+} 16789+ 16790+NO_SANITIZE("cfi-icall") 16791+void CefBrowserHostCToCpp::PutNetworkAvailable(bool available) { 16792+ shutdown_checker::AssertNotShutdown(); 16793+ 16794+ cef_browser_host_t* _struct = GetStruct(); 16795+ if (CEF_MEMBER_MISSING(_struct, put_network_available)) 16796+ return; 16797+ 16798+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16799+ 16800+ // Execute 16801+ _struct->put_network_available(_struct, available); 16802+} 16803+ 16804+NO_SANITIZE("cfi-icall") 16805+void CefBrowserHostCToCpp::RemoveCache(bool include_disk_files) { 16806+ shutdown_checker::AssertNotShutdown(); 16807+ 16808+ cef_browser_host_t* _struct = GetStruct(); 16809+ if (CEF_MEMBER_MISSING(_struct, remove_cache)) 16810+ return; 16811+ 16812+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16813+ 16814+ // Execute 16815+ _struct->remove_cache(_struct, include_disk_files); 16816+} 16817+ 16818+NO_SANITIZE("cfi-icall") 16819+void CefBrowserHostCToCpp::ScrollPageUpDown(bool is_up, 16820+ bool is_half, 16821+ float view_height) { 16822+ shutdown_checker::AssertNotShutdown(); 16823+ 16824+ cef_browser_host_t* _struct = GetStruct(); 16825+ if (CEF_MEMBER_MISSING(_struct, scroll_page_up_down)) 16826+ return; 16827+ 16828+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16829+ 16830+ // Execute 16831+ _struct->scroll_page_up_down(_struct, is_up, is_half, view_height); 16832+} 16833+ 16834+NO_SANITIZE("cfi-icall") 16835+CefRefPtr<CefBinaryValue> CefBrowserHostCToCpp::GetWebState() { 16836+ shutdown_checker::AssertNotShutdown(); 16837+ 16838+ cef_browser_host_t* _struct = GetStruct(); 16839+ if (CEF_MEMBER_MISSING(_struct, get_web_state)) 16840+ return nullptr; 16841+ 16842+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16843+ 16844+ // Execute 16845+ cef_binary_value_t* _retval = _struct->get_web_state(_struct); 16846+ 16847+ // Return type: refptr_same 16848+ return CefBinaryValueCToCpp::Wrap(_retval); 16849+} 16850+ 16851+NO_SANITIZE("cfi-icall") 16852+bool CefBrowserHostCToCpp::RestoreWebState( 16853+ const CefRefPtr<CefBinaryValue> state) { 16854+ shutdown_checker::AssertNotShutdown(); 16855+ 16856+ cef_browser_host_t* _struct = GetStruct(); 16857+ if (CEF_MEMBER_MISSING(_struct, restore_web_state)) 16858+ return false; 16859+ 16860+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16861+ 16862+ // Verify param: state; type: refptr_same 16863+ DCHECK(state.get()); 16864+ if (!state.get()) 16865+ return false; 16866+ 16867+ // Execute 16868+ int _retval = 16869+ _struct->restore_web_state(_struct, CefBinaryValueCToCpp::Unwrap(state)); 16870+ 16871+ // Return type: bool 16872+ return _retval ? true : false; 16873+} 16874+ 16875+NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::ScrollTo(float x, float y) { 16876+ shutdown_checker::AssertNotShutdown(); 16877+ 16878+ cef_browser_host_t* _struct = GetStruct(); 16879+ if (CEF_MEMBER_MISSING(_struct, scroll_to)) 16880+ return; 16881+ 16882+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16883+ 16884+ // Execute 16885+ _struct->scroll_to(_struct, x, y); 16886+} 16887+ 16888+NO_SANITIZE("cfi-icall") 16889+void CefBrowserHostCToCpp::ScrollBy(float delta_x, float delta_y) { 16890+ shutdown_checker::AssertNotShutdown(); 16891+ 16892+ cef_browser_host_t* _struct = GetStruct(); 16893+ if (CEF_MEMBER_MISSING(_struct, scroll_by)) 16894+ return; 16895+ 16896+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16897+ 16898+ // Execute 16899+ _struct->scroll_by(_struct, delta_x, delta_y); 16900+} 16901+ 16902+NO_SANITIZE("cfi-icall") 16903+void CefBrowserHostCToCpp::SlideScroll(float vx, float vy) { 16904+ shutdown_checker::AssertNotShutdown(); 16905+ 16906+ cef_browser_host_t* _struct = GetStruct(); 16907+ if (CEF_MEMBER_MISSING(_struct, slide_scroll)) 16908+ return; 16909+ 16910+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16911+ 16912+ // Execute 16913+ _struct->slide_scroll(_struct, vx, vy); 16914+} 16915+ 16916+NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::SetFileAccess(bool falg) { 16917+ shutdown_checker::AssertNotShutdown(); 16918+ 16919+ cef_browser_host_t* _struct = GetStruct(); 16920+ if (CEF_MEMBER_MISSING(_struct, set_file_access)) 16921+ return; 16922+ 16923+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16924+ 16925+ // Execute 16926+ _struct->set_file_access(_struct, falg); 16927+} 16928+ 16929+NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::SetBlockNetwork(bool falg) { 16930+ shutdown_checker::AssertNotShutdown(); 16931+ 16932+ cef_browser_host_t* _struct = GetStruct(); 16933+ if (CEF_MEMBER_MISSING(_struct, set_block_network)) 16934+ return; 16935+ 16936+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16937+ 16938+ // Execute 16939+ _struct->set_block_network(_struct, falg); 16940+} 16941+ 16942+NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::SetCacheMode(int falg) { 16943+ shutdown_checker::AssertNotShutdown(); 16944+ 16945+ cef_browser_host_t* _struct = GetStruct(); 16946+ if (CEF_MEMBER_MISSING(_struct, set_cache_mode)) 16947+ return; 16948+ 16949+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 16950+ 16951+ // Execute 16952+ _struct->set_cache_mode(_struct, falg); 16953+} 16954+ 16955 // CONSTRUCTOR - Do not edit by hand. 16956 16957 CefBrowserHostCToCpp::CefBrowserHostCToCpp() {} 16958diff --git a/src/cef/libcef_dll/ctocpp/browser_host_ctocpp.h b/src/cef/libcef_dll/ctocpp/browser_host_ctocpp.h 16959index 2a925afdb35cf..f75f810a9f13e 16960--- a/src/cef/libcef_dll/ctocpp/browser_host_ctocpp.h 16961+++ b/src/cef/libcef_dll/ctocpp/browser_host_ctocpp.h 16962@@ -1,4 +1,4 @@ 16963-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 16964+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 16965 // reserved. Use of this source code is governed by a BSD-style license that 16966 // can be found in the LICENSE file. 16967 // 16968@@ -9,7 +9,7 @@ 16969 // implementations. See the translator.README.txt file in the tools directory 16970 // for more information. 16971 // 16972-// $hash=f54a67e13f96ef1da28ebbbe929d1bf4b9c5c71f$ 16973+// $hash=29c3bfce4a45f38ec3fd21096e13addeb83f6310$ 16974 // 16975 16976 #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_ 16977@@ -129,10 +129,11 @@ class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp, 16978 CefString& targetUri) override; 16979 void ClosePort(CefString& port_handle) override; 16980 void DestroyAllWebMessagePorts() override; 16981- void PostPortMessage(CefString& port_handle, CefString& data) override; 16982+ void PostPortMessage(CefString& port_handle, 16983+ CefRefPtr<CefValue> message) override; 16984 void SetPortMessageCallback( 16985 CefString& port_handle, 16986- CefRefPtr<CefJavaScriptResultCallback> callback) override; 16987+ CefRefPtr<CefWebMessageReceiver> callback) override; 16988 void GetHitData(int& type, CefString& extra_data) override; 16989 void SetInitialScale(float scale) override; 16990 int PageLoadProgress() override; 16991@@ -183,6 +184,18 @@ class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp, 16992 void GetImageFromCache(const CefString& url) override; 16993 void ExitFullScreen() override; 16994 void UpdateLocale(const CefString& locale) override; 16995+ CefString GetOriginalUrl() override; 16996+ void PutNetworkAvailable(bool available) override; 16997+ void RemoveCache(bool include_disk_files) override; 16998+ void ScrollPageUpDown(bool is_up, bool is_half, float view_height) override; 16999+ CefRefPtr<CefBinaryValue> GetWebState() override; 17000+ bool RestoreWebState(const CefRefPtr<CefBinaryValue> state) override; 17001+ void ScrollTo(float x, float y) override; 17002+ void ScrollBy(float delta_x, float delta_y) override; 17003+ void SlideScroll(float vx, float vy) override; 17004+ void SetFileAccess(bool falg) override; 17005+ void SetBlockNetwork(bool falg) override; 17006+ void SetCacheMode(int falg) override; 17007 }; 17008 17009 #endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_ 17010diff --git a/src/cef/libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.cc 17011index 378b2e54202dd..2cca93268f1ef 17012--- a/src/cef/libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.cc 17013+++ b/src/cef/libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.cc 17014@@ -1,4 +1,4 @@ 17015-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17016+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17017 // reserved. Use of this source code is governed by a BSD-style license that 17018 // can be found in the LICENSE file. 17019 // 17020@@ -9,7 +9,7 @@ 17021 // implementations. See the translator.README.txt file in the tools directory 17022 // for more information. 17023 // 17024-// $hash=4a9c34d8dd8e49725dd7288c3a8c3e2a978c977c$ 17025+// $hash=7af372362be16cd5150da026dbbf41c85daeba88$ 17026 // 17027 17028 #include "libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.h" 17029@@ -19,10 +19,11 @@ 17030 17031 NO_SANITIZE("cfi-icall") 17032 void CefBrowserPermissionRequestDelegateCToCpp::AskGeolocationPermission( 17033- const CefString &origin, cef_permission_callback_t callback) { 17034+ const CefString& origin, 17035+ cef_permission_callback_t callback) { 17036 shutdown_checker::AssertNotShutdown(); 17037 17038- cef_browser_permission_request_delegate_t *_struct = GetStruct(); 17039+ cef_browser_permission_request_delegate_t* _struct = GetStruct(); 17040 if (CEF_MEMBER_MISSING(_struct, ask_geolocation_permission)) 17041 return; 17042 17043@@ -39,10 +40,10 @@ void CefBrowserPermissionRequestDelegateCToCpp::AskGeolocationPermission( 17044 17045 NO_SANITIZE("cfi-icall") 17046 void CefBrowserPermissionRequestDelegateCToCpp::AbortAskGeolocationPermission( 17047- const CefString &origin) { 17048+ const CefString& origin) { 17049 shutdown_checker::AssertNotShutdown(); 17050 17051- cef_browser_permission_request_delegate_t *_struct = GetStruct(); 17052+ cef_browser_permission_request_delegate_t* _struct = GetStruct(); 17053 if (CEF_MEMBER_MISSING(_struct, abort_ask_geolocation_permission)) 17054 return; 17055 17056@@ -59,11 +60,11 @@ void CefBrowserPermissionRequestDelegateCToCpp::AbortAskGeolocationPermission( 17057 17058 NO_SANITIZE("cfi-icall") 17059 void CefBrowserPermissionRequestDelegateCToCpp:: 17060- AskProtectedMediaIdentifierPermission(const CefString &origin, 17061+ AskProtectedMediaIdentifierPermission(const CefString& origin, 17062 cef_permission_callback_t callback) { 17063 shutdown_checker::AssertNotShutdown(); 17064 17065- cef_browser_permission_request_delegate_t *_struct = GetStruct(); 17066+ cef_browser_permission_request_delegate_t* _struct = GetStruct(); 17067 if (CEF_MEMBER_MISSING(_struct, ask_protected_media_identifier_permission)) 17068 return; 17069 17070@@ -81,10 +82,10 @@ void CefBrowserPermissionRequestDelegateCToCpp:: 17071 17072 NO_SANITIZE("cfi-icall") 17073 void CefBrowserPermissionRequestDelegateCToCpp:: 17074- AbortAskProtectedMediaIdentifierPermission(const CefString &origin) { 17075+ AbortAskProtectedMediaIdentifierPermission(const CefString& origin) { 17076 shutdown_checker::AssertNotShutdown(); 17077 17078- cef_browser_permission_request_delegate_t *_struct = GetStruct(); 17079+ cef_browser_permission_request_delegate_t* _struct = GetStruct(); 17080 if (CEF_MEMBER_MISSING(_struct, 17081 abort_ask_protected_media_identifier_permission)) 17082 return; 17083@@ -103,10 +104,11 @@ void CefBrowserPermissionRequestDelegateCToCpp:: 17084 17085 NO_SANITIZE("cfi-icall") 17086 void CefBrowserPermissionRequestDelegateCToCpp::AskMIDISysexPermission( 17087- const CefString &origin, cef_permission_callback_t callback) { 17088+ const CefString& origin, 17089+ cef_permission_callback_t callback) { 17090 shutdown_checker::AssertNotShutdown(); 17091 17092- cef_browser_permission_request_delegate_t *_struct = GetStruct(); 17093+ cef_browser_permission_request_delegate_t* _struct = GetStruct(); 17094 if (CEF_MEMBER_MISSING(_struct, ask_midisysex_permission)) 17095 return; 17096 17097@@ -123,10 +125,10 @@ void CefBrowserPermissionRequestDelegateCToCpp::AskMIDISysexPermission( 17098 17099 NO_SANITIZE("cfi-icall") 17100 void CefBrowserPermissionRequestDelegateCToCpp::AbortAskMIDISysexPermission( 17101- const CefString &origin) { 17102+ const CefString& origin) { 17103 shutdown_checker::AssertNotShutdown(); 17104 17105- cef_browser_permission_request_delegate_t *_struct = GetStruct(); 17106+ cef_browser_permission_request_delegate_t* _struct = GetStruct(); 17107 if (CEF_MEMBER_MISSING(_struct, abort_ask_midisysex_permission)) 17108 return; 17109 17110@@ -143,10 +145,11 @@ void CefBrowserPermissionRequestDelegateCToCpp::AbortAskMIDISysexPermission( 17111 17112 NO_SANITIZE("cfi-icall") 17113 void CefBrowserPermissionRequestDelegateCToCpp::NotifyGeolocationPermission( 17114- bool value, const CefString &origin) { 17115+ bool value, 17116+ const CefString& origin) { 17117 shutdown_checker::AssertNotShutdown(); 17118 17119- cef_browser_permission_request_delegate_t *_struct = GetStruct(); 17120+ cef_browser_permission_request_delegate_t* _struct = GetStruct(); 17121 if (CEF_MEMBER_MISSING(_struct, notify_geolocation_permission)) 17122 return; 17123 17124@@ -174,11 +177,11 @@ CefBrowserPermissionRequestDelegateCToCpp:: 17125 } 17126 17127 template <> 17128-cef_browser_permission_request_delegate_t * 17129+cef_browser_permission_request_delegate_t* 17130 CefCToCppRefCounted<CefBrowserPermissionRequestDelegateCToCpp, 17131 CefBrowserPermissionRequestDelegate, 17132 cef_browser_permission_request_delegate_t>:: 17133- UnwrapDerived(CefWrapperType type, CefBrowserPermissionRequestDelegate *c) { 17134+ UnwrapDerived(CefWrapperType type, CefBrowserPermissionRequestDelegate* c) { 17135 NOTREACHED() << "Unexpected class type: " << type; 17136 return nullptr; 17137 } 17138diff --git a/src/cef/libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.h b/src/cef/libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.h 17139index 4b7598dc129c5..39c61973fe3be 17140--- a/src/cef/libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.h 17141+++ b/src/cef/libcef_dll/ctocpp/browser_permission_request_delegate_ctocpp.h 17142@@ -1,4 +1,4 @@ 17143-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17144+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17145 // reserved. Use of this source code is governed by a BSD-style license that 17146 // can be found in the LICENSE file. 17147 // 17148@@ -9,7 +9,7 @@ 17149 // implementations. See the translator.README.txt file in the tools directory 17150 // for more information. 17151 // 17152-// $hash=c9c5f759ffc22b4c39e35c6273d17966ec357b35$ 17153+// $hash=a2e7c9e77ee45cef4da269e9e613fd4fdef5f9ac$ 17154 // 17155 17156 #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PERMISSION_REQUEST_DELEGATE_CTOCPP_H_ 17157@@ -30,23 +30,24 @@ class CefBrowserPermissionRequestDelegateCToCpp 17158 : public CefCToCppRefCounted<CefBrowserPermissionRequestDelegateCToCpp, 17159 CefBrowserPermissionRequestDelegate, 17160 cef_browser_permission_request_delegate_t> { 17161-public: 17162+ public: 17163 CefBrowserPermissionRequestDelegateCToCpp(); 17164 virtual ~CefBrowserPermissionRequestDelegateCToCpp(); 17165 17166 // CefBrowserPermissionRequestDelegate methods. 17167- void AskGeolocationPermission(const CefString &origin, 17168+ void AskGeolocationPermission(const CefString& origin, 17169 cef_permission_callback_t callback) override; 17170- void AbortAskGeolocationPermission(const CefString &origin) override; 17171+ void AbortAskGeolocationPermission(const CefString& origin) override; 17172 void AskProtectedMediaIdentifierPermission( 17173- const CefString &origin, cef_permission_callback_t callback) override; 17174- void 17175- AbortAskProtectedMediaIdentifierPermission(const CefString &origin) override; 17176- void AskMIDISysexPermission(const CefString &origin, 17177+ const CefString& origin, 17178+ cef_permission_callback_t callback) override; 17179+ void AbortAskProtectedMediaIdentifierPermission( 17180+ const CefString& origin) override; 17181+ void AskMIDISysexPermission(const CefString& origin, 17182 cef_permission_callback_t callback) override; 17183- void AbortAskMIDISysexPermission(const CefString &origin) override; 17184+ void AbortAskMIDISysexPermission(const CefString& origin) override; 17185 void NotifyGeolocationPermission(bool value, 17186- const CefString &origin) override; 17187+ const CefString& origin) override; 17188 }; 17189 17190-#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_PERMISSION_REQUEST_DELEGATE_CTOCPP_H_ 17191+#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_PERMISSION_REQUEST_DELEGATE_CTOCPP_H_ 17192diff --git a/src/cef/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc 17193index 2338c499f1748..c8739c79bde6f 17194--- a/src/cef/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc 17195+++ b/src/cef/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc 17196@@ -1,4 +1,4 @@ 17197-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17198+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17199 // reserved. Use of this source code is governed by a BSD-style license that 17200 // can be found in the LICENSE file. 17201 // 17202@@ -9,7 +9,7 @@ 17203 // implementations. See the translator.README.txt file in the tools directory 17204 // for more information. 17205 // 17206-// $hash=3302f28c60da03b9f5ba5fa110523b353765d1a3$ 17207+// $hash=a2e2cd65794078959c9d31ee3a294fb937d6f802$ 17208 // 17209 17210 #include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h" 17211diff --git a/src/cef/libcef_dll/ctocpp/browser_process_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/browser_process_handler_ctocpp.h 17212index 3871506b1a685..50c763307fbc5 17213--- a/src/cef/libcef_dll/ctocpp/browser_process_handler_ctocpp.h 17214+++ b/src/cef/libcef_dll/ctocpp/browser_process_handler_ctocpp.h 17215@@ -1,4 +1,4 @@ 17216-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17217+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17218 // reserved. Use of this source code is governed by a BSD-style license that 17219 // can be found in the LICENSE file. 17220 // 17221@@ -9,7 +9,7 @@ 17222 // implementations. See the translator.README.txt file in the tools directory 17223 // for more information. 17224 // 17225-// $hash=7a13d15a99d1c92a757b776bb00d932296012054$ 17226+// $hash=66b5c3e001c23a720ae8a8e6d98afeb2419e5038$ 17227 // 17228 17229 #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_ 17230diff --git a/src/cef/libcef_dll/ctocpp/callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/callback_ctocpp.cc 17231index c0030004cbe5b..8c86cd7330e2d 17232--- a/src/cef/libcef_dll/ctocpp/callback_ctocpp.cc 17233+++ b/src/cef/libcef_dll/ctocpp/callback_ctocpp.cc 17234@@ -1,4 +1,4 @@ 17235-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17236+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17237 // reserved. Use of this source code is governed by a BSD-style license that 17238 // can be found in the LICENSE file. 17239 // 17240@@ -9,7 +9,7 @@ 17241 // implementations. See the translator.README.txt file in the tools directory 17242 // for more information. 17243 // 17244-// $hash=ef330e0d61e143966544b8a80f04b72dc32ec4e3$ 17245+// $hash=669523b79dbdfe2fff4015e8a1b247e7f90e62e0$ 17246 // 17247 17248 #include "libcef_dll/ctocpp/callback_ctocpp.h" 17249diff --git a/src/cef/libcef_dll/ctocpp/callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/callback_ctocpp.h 17250index f4d7a15e7851f..1e59651494167 17251--- a/src/cef/libcef_dll/ctocpp/callback_ctocpp.h 17252+++ b/src/cef/libcef_dll/ctocpp/callback_ctocpp.h 17253@@ -1,4 +1,4 @@ 17254-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17255+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17256 // reserved. Use of this source code is governed by a BSD-style license that 17257 // can be found in the LICENSE file. 17258 // 17259@@ -9,7 +9,7 @@ 17260 // implementations. See the translator.README.txt file in the tools directory 17261 // for more information. 17262 // 17263-// $hash=4a884b7737dd5ba552273873e63dd4df51a632b7$ 17264+// $hash=33a36c40703e1a794c2d8365f0ed692bad529e4b$ 17265 // 17266 17267 #ifndef CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_ 17268diff --git a/src/cef/libcef_dll/ctocpp/client_ctocpp.cc b/src/cef/libcef_dll/ctocpp/client_ctocpp.cc 17269index 5a741e37ed727..f31c0ee080445 17270--- a/src/cef/libcef_dll/ctocpp/client_ctocpp.cc 17271+++ b/src/cef/libcef_dll/ctocpp/client_ctocpp.cc 17272@@ -1,4 +1,4 @@ 17273-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17274+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17275 // reserved. Use of this source code is governed by a BSD-style license that 17276 // can be found in the LICENSE file. 17277 // 17278@@ -9,7 +9,7 @@ 17279 // implementations. See the translator.README.txt file in the tools directory 17280 // for more information. 17281 // 17282-// $hash=6c7761f17f60e6c3db928ffc15b373b0c50dfb47$ 17283+// $hash=d090744e28308c8ad6b47906ee231b4fe52fa6a2$ 17284 // 17285 17286 #include "libcef_dll/ctocpp/client_ctocpp.h" 17287@@ -39,14 +39,14 @@ 17288 17289 NO_SANITIZE("cfi-icall") 17290 CefRefPtr<CefAudioHandler> CefClientCToCpp::GetAudioHandler() { 17291- cef_client_t *_struct = GetStruct(); 17292+ cef_client_t* _struct = GetStruct(); 17293 if (CEF_MEMBER_MISSING(_struct, get_audio_handler)) 17294 return nullptr; 17295 17296 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17297 17298 // Execute 17299- cef_audio_handler_t *_retval = _struct->get_audio_handler(_struct); 17300+ cef_audio_handler_t* _retval = _struct->get_audio_handler(_struct); 17301 17302 // Return type: refptr_same 17303 return CefAudioHandlerCToCpp::Wrap(_retval); 17304@@ -54,14 +54,14 @@ CefRefPtr<CefAudioHandler> CefClientCToCpp::GetAudioHandler() { 17305 17306 NO_SANITIZE("cfi-icall") 17307 CefRefPtr<CefContextMenuHandler> CefClientCToCpp::GetContextMenuHandler() { 17308- cef_client_t *_struct = GetStruct(); 17309+ cef_client_t* _struct = GetStruct(); 17310 if (CEF_MEMBER_MISSING(_struct, get_context_menu_handler)) 17311 return nullptr; 17312 17313 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17314 17315 // Execute 17316- cef_context_menu_handler_t *_retval = 17317+ cef_context_menu_handler_t* _retval = 17318 _struct->get_context_menu_handler(_struct); 17319 17320 // Return type: refptr_same 17321@@ -70,14 +70,14 @@ CefRefPtr<CefContextMenuHandler> CefClientCToCpp::GetContextMenuHandler() { 17322 17323 NO_SANITIZE("cfi-icall") 17324 CefRefPtr<CefDialogHandler> CefClientCToCpp::GetDialogHandler() { 17325- cef_client_t *_struct = GetStruct(); 17326+ cef_client_t* _struct = GetStruct(); 17327 if (CEF_MEMBER_MISSING(_struct, get_dialog_handler)) 17328 return nullptr; 17329 17330 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17331 17332 // Execute 17333- cef_dialog_handler_t *_retval = _struct->get_dialog_handler(_struct); 17334+ cef_dialog_handler_t* _retval = _struct->get_dialog_handler(_struct); 17335 17336 // Return type: refptr_same 17337 return CefDialogHandlerCToCpp::Wrap(_retval); 17338@@ -85,14 +85,14 @@ CefRefPtr<CefDialogHandler> CefClientCToCpp::GetDialogHandler() { 17339 17340 NO_SANITIZE("cfi-icall") 17341 CefRefPtr<CefDisplayHandler> CefClientCToCpp::GetDisplayHandler() { 17342- cef_client_t *_struct = GetStruct(); 17343+ cef_client_t* _struct = GetStruct(); 17344 if (CEF_MEMBER_MISSING(_struct, get_display_handler)) 17345 return nullptr; 17346 17347 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17348 17349 // Execute 17350- cef_display_handler_t *_retval = _struct->get_display_handler(_struct); 17351+ cef_display_handler_t* _retval = _struct->get_display_handler(_struct); 17352 17353 // Return type: refptr_same 17354 return CefDisplayHandlerCToCpp::Wrap(_retval); 17355@@ -100,14 +100,14 @@ CefRefPtr<CefDisplayHandler> CefClientCToCpp::GetDisplayHandler() { 17356 17357 NO_SANITIZE("cfi-icall") 17358 CefRefPtr<CefDownloadHandler> CefClientCToCpp::GetDownloadHandler() { 17359- cef_client_t *_struct = GetStruct(); 17360+ cef_client_t* _struct = GetStruct(); 17361 if (CEF_MEMBER_MISSING(_struct, get_download_handler)) 17362 return nullptr; 17363 17364 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17365 17366 // Execute 17367- cef_download_handler_t *_retval = _struct->get_download_handler(_struct); 17368+ cef_download_handler_t* _retval = _struct->get_download_handler(_struct); 17369 17370 // Return type: refptr_same 17371 return CefDownloadHandlerCToCpp::Wrap(_retval); 17372@@ -115,14 +115,14 @@ CefRefPtr<CefDownloadHandler> CefClientCToCpp::GetDownloadHandler() { 17373 17374 NO_SANITIZE("cfi-icall") 17375 CefRefPtr<CefDragHandler> CefClientCToCpp::GetDragHandler() { 17376- cef_client_t *_struct = GetStruct(); 17377+ cef_client_t* _struct = GetStruct(); 17378 if (CEF_MEMBER_MISSING(_struct, get_drag_handler)) 17379 return nullptr; 17380 17381 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17382 17383 // Execute 17384- cef_drag_handler_t *_retval = _struct->get_drag_handler(_struct); 17385+ cef_drag_handler_t* _retval = _struct->get_drag_handler(_struct); 17386 17387 // Return type: refptr_same 17388 return CefDragHandlerCToCpp::Wrap(_retval); 17389@@ -130,14 +130,14 @@ CefRefPtr<CefDragHandler> CefClientCToCpp::GetDragHandler() { 17390 17391 NO_SANITIZE("cfi-icall") 17392 CefRefPtr<CefFindHandler> CefClientCToCpp::GetFindHandler() { 17393- cef_client_t *_struct = GetStruct(); 17394+ cef_client_t* _struct = GetStruct(); 17395 if (CEF_MEMBER_MISSING(_struct, get_find_handler)) 17396 return nullptr; 17397 17398 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17399 17400 // Execute 17401- cef_find_handler_t *_retval = _struct->get_find_handler(_struct); 17402+ cef_find_handler_t* _retval = _struct->get_find_handler(_struct); 17403 17404 // Return type: refptr_same 17405 return CefFindHandlerCToCpp::Wrap(_retval); 17406@@ -145,14 +145,14 @@ CefRefPtr<CefFindHandler> CefClientCToCpp::GetFindHandler() { 17407 17408 NO_SANITIZE("cfi-icall") 17409 CefRefPtr<CefFocusHandler> CefClientCToCpp::GetFocusHandler() { 17410- cef_client_t *_struct = GetStruct(); 17411+ cef_client_t* _struct = GetStruct(); 17412 if (CEF_MEMBER_MISSING(_struct, get_focus_handler)) 17413 return nullptr; 17414 17415 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17416 17417 // Execute 17418- cef_focus_handler_t *_retval = _struct->get_focus_handler(_struct); 17419+ cef_focus_handler_t* _retval = _struct->get_focus_handler(_struct); 17420 17421 // Return type: refptr_same 17422 return CefFocusHandlerCToCpp::Wrap(_retval); 17423@@ -160,14 +160,14 @@ CefRefPtr<CefFocusHandler> CefClientCToCpp::GetFocusHandler() { 17424 17425 NO_SANITIZE("cfi-icall") 17426 CefRefPtr<CefFrameHandler> CefClientCToCpp::GetFrameHandler() { 17427- cef_client_t *_struct = GetStruct(); 17428+ cef_client_t* _struct = GetStruct(); 17429 if (CEF_MEMBER_MISSING(_struct, get_frame_handler)) 17430 return nullptr; 17431 17432 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17433 17434 // Execute 17435- cef_frame_handler_t *_retval = _struct->get_frame_handler(_struct); 17436+ cef_frame_handler_t* _retval = _struct->get_frame_handler(_struct); 17437 17438 // Return type: refptr_same 17439 return CefFrameHandlerCToCpp::Wrap(_retval); 17440@@ -175,14 +175,14 @@ CefRefPtr<CefFrameHandler> CefClientCToCpp::GetFrameHandler() { 17441 17442 NO_SANITIZE("cfi-icall") 17443 CefRefPtr<CefJSDialogHandler> CefClientCToCpp::GetJSDialogHandler() { 17444- cef_client_t *_struct = GetStruct(); 17445+ cef_client_t* _struct = GetStruct(); 17446 if (CEF_MEMBER_MISSING(_struct, get_jsdialog_handler)) 17447 return nullptr; 17448 17449 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17450 17451 // Execute 17452- cef_jsdialog_handler_t *_retval = _struct->get_jsdialog_handler(_struct); 17453+ cef_jsdialog_handler_t* _retval = _struct->get_jsdialog_handler(_struct); 17454 17455 // Return type: refptr_same 17456 return CefJSDialogHandlerCToCpp::Wrap(_retval); 17457@@ -190,14 +190,14 @@ CefRefPtr<CefJSDialogHandler> CefClientCToCpp::GetJSDialogHandler() { 17458 17459 NO_SANITIZE("cfi-icall") 17460 CefRefPtr<CefKeyboardHandler> CefClientCToCpp::GetKeyboardHandler() { 17461- cef_client_t *_struct = GetStruct(); 17462+ cef_client_t* _struct = GetStruct(); 17463 if (CEF_MEMBER_MISSING(_struct, get_keyboard_handler)) 17464 return nullptr; 17465 17466 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17467 17468 // Execute 17469- cef_keyboard_handler_t *_retval = _struct->get_keyboard_handler(_struct); 17470+ cef_keyboard_handler_t* _retval = _struct->get_keyboard_handler(_struct); 17471 17472 // Return type: refptr_same 17473 return CefKeyboardHandlerCToCpp::Wrap(_retval); 17474@@ -205,14 +205,14 @@ CefRefPtr<CefKeyboardHandler> CefClientCToCpp::GetKeyboardHandler() { 17475 17476 NO_SANITIZE("cfi-icall") 17477 CefRefPtr<CefLifeSpanHandler> CefClientCToCpp::GetLifeSpanHandler() { 17478- cef_client_t *_struct = GetStruct(); 17479+ cef_client_t* _struct = GetStruct(); 17480 if (CEF_MEMBER_MISSING(_struct, get_life_span_handler)) 17481 return nullptr; 17482 17483 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17484 17485 // Execute 17486- cef_life_span_handler_t *_retval = _struct->get_life_span_handler(_struct); 17487+ cef_life_span_handler_t* _retval = _struct->get_life_span_handler(_struct); 17488 17489 // Return type: refptr_same 17490 return CefLifeSpanHandlerCToCpp::Wrap(_retval); 17491@@ -220,14 +220,14 @@ CefRefPtr<CefLifeSpanHandler> CefClientCToCpp::GetLifeSpanHandler() { 17492 17493 NO_SANITIZE("cfi-icall") 17494 CefRefPtr<CefLoadHandler> CefClientCToCpp::GetLoadHandler() { 17495- cef_client_t *_struct = GetStruct(); 17496+ cef_client_t* _struct = GetStruct(); 17497 if (CEF_MEMBER_MISSING(_struct, get_load_handler)) 17498 return nullptr; 17499 17500 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17501 17502 // Execute 17503- cef_load_handler_t *_retval = _struct->get_load_handler(_struct); 17504+ cef_load_handler_t* _retval = _struct->get_load_handler(_struct); 17505 17506 // Return type: refptr_same 17507 return CefLoadHandlerCToCpp::Wrap(_retval); 17508@@ -235,14 +235,14 @@ CefRefPtr<CefLoadHandler> CefClientCToCpp::GetLoadHandler() { 17509 17510 NO_SANITIZE("cfi-icall") 17511 CefRefPtr<CefPrintHandler> CefClientCToCpp::GetPrintHandler() { 17512- cef_client_t *_struct = GetStruct(); 17513+ cef_client_t* _struct = GetStruct(); 17514 if (CEF_MEMBER_MISSING(_struct, get_print_handler)) 17515 return nullptr; 17516 17517 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17518 17519 // Execute 17520- cef_print_handler_t *_retval = _struct->get_print_handler(_struct); 17521+ cef_print_handler_t* _retval = _struct->get_print_handler(_struct); 17522 17523 // Return type: refptr_same 17524 return CefPrintHandlerCToCpp::Wrap(_retval); 17525@@ -250,14 +250,14 @@ CefRefPtr<CefPrintHandler> CefClientCToCpp::GetPrintHandler() { 17526 17527 NO_SANITIZE("cfi-icall") 17528 CefRefPtr<CefRenderHandler> CefClientCToCpp::GetRenderHandler() { 17529- cef_client_t *_struct = GetStruct(); 17530+ cef_client_t* _struct = GetStruct(); 17531 if (CEF_MEMBER_MISSING(_struct, get_render_handler)) 17532 return nullptr; 17533 17534 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17535 17536 // Execute 17537- cef_render_handler_t *_retval = _struct->get_render_handler(_struct); 17538+ cef_render_handler_t* _retval = _struct->get_render_handler(_struct); 17539 17540 // Return type: refptr_same 17541 return CefRenderHandlerCToCpp::Wrap(_retval); 17542@@ -265,14 +265,14 @@ CefRefPtr<CefRenderHandler> CefClientCToCpp::GetRenderHandler() { 17543 17544 NO_SANITIZE("cfi-icall") 17545 CefRefPtr<CefRequestHandler> CefClientCToCpp::GetRequestHandler() { 17546- cef_client_t *_struct = GetStruct(); 17547+ cef_client_t* _struct = GetStruct(); 17548 if (CEF_MEMBER_MISSING(_struct, get_request_handler)) 17549 return nullptr; 17550 17551 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17552 17553 // Execute 17554- cef_request_handler_t *_retval = _struct->get_request_handler(_struct); 17555+ cef_request_handler_t* _retval = _struct->get_request_handler(_struct); 17556 17557 // Return type: refptr_same 17558 return CefRequestHandlerCToCpp::Wrap(_retval); 17559@@ -280,14 +280,14 @@ CefRefPtr<CefRequestHandler> CefClientCToCpp::GetRequestHandler() { 17560 17561 NO_SANITIZE("cfi-icall") 17562 CefRefPtr<CefPermissionRequest> CefClientCToCpp::GetPermissionRequest() { 17563- cef_client_t *_struct = GetStruct(); 17564+ cef_client_t* _struct = GetStruct(); 17565 if (CEF_MEMBER_MISSING(_struct, get_permission_request)) 17566 return nullptr; 17567 17568 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17569 17570 // Execute 17571- cef_permission_request_t *_retval = _struct->get_permission_request(_struct); 17572+ cef_permission_request_t* _retval = _struct->get_permission_request(_struct); 17573 17574 // Return type: refptr_same 17575 return CefPermissionRequestCToCpp::Wrap(_retval); 17576@@ -295,9 +295,11 @@ CefRefPtr<CefPermissionRequest> CefClientCToCpp::GetPermissionRequest() { 17577 17578 NO_SANITIZE("cfi-icall") 17579 bool CefClientCToCpp::OnProcessMessageReceived( 17580- CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, 17581- CefProcessId source_process, CefRefPtr<CefProcessMessage> message) { 17582- cef_client_t *_struct = GetStruct(); 17583+ CefRefPtr<CefBrowser> browser, 17584+ CefRefPtr<CefFrame> frame, 17585+ CefProcessId source_process, 17586+ CefRefPtr<CefProcessMessage> message) { 17587+ cef_client_t* _struct = GetStruct(); 17588 if (CEF_MEMBER_MISSING(_struct, on_process_message_received)) 17589 return false; 17590 17591@@ -327,10 +329,10 @@ bool CefClientCToCpp::OnProcessMessageReceived( 17592 17593 NO_SANITIZE("cfi-icall") 17594 int CefClientCToCpp::NotifyJavaScriptResult(CefRefPtr<CefListValue> args, 17595- const CefString &method, 17596- const CefString &object_name, 17597+ const CefString& method, 17598+ const CefString& object_name, 17599 CefRefPtr<CefListValue> result) { 17600- cef_client_t *_struct = GetStruct(); 17601+ cef_client_t* _struct = GetStruct(); 17602 if (CEF_MEMBER_MISSING(_struct, notify_java_script_result)) 17603 return 0; 17604 17605@@ -371,13 +373,14 @@ CefClientCToCpp::CefClientCToCpp() {} 17606 CefClientCToCpp::~CefClientCToCpp() {} 17607 17608 template <> 17609-cef_client_t * 17610+cef_client_t* 17611 CefCToCppRefCounted<CefClientCToCpp, CefClient, cef_client_t>::UnwrapDerived( 17612- CefWrapperType type, CefClient *c) { 17613+ CefWrapperType type, 17614+ CefClient* c) { 17615 NOTREACHED() << "Unexpected class type: " << type; 17616 return nullptr; 17617 } 17618 17619 template <> 17620-CefWrapperType CefCToCppRefCounted<CefClientCToCpp, CefClient, 17621- cef_client_t>::kWrapperType = WT_CLIENT; 17622+CefWrapperType CefCToCppRefCounted<CefClientCToCpp, CefClient, cef_client_t>:: 17623+ kWrapperType = WT_CLIENT; 17624diff --git a/src/cef/libcef_dll/ctocpp/client_ctocpp.h b/src/cef/libcef_dll/ctocpp/client_ctocpp.h 17625index 72c58879a1cc4..37f3eb67cc0ea 17626--- a/src/cef/libcef_dll/ctocpp/client_ctocpp.h 17627+++ b/src/cef/libcef_dll/ctocpp/client_ctocpp.h 17628@@ -1,4 +1,4 @@ 17629-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17630+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17631 // reserved. Use of this source code is governed by a BSD-style license that 17632 // can be found in the LICENSE file. 17633 // 17634@@ -9,7 +9,7 @@ 17635 // implementations. See the translator.README.txt file in the tools directory 17636 // for more information. 17637 // 17638-// $hash=7516e646aea8db0ff68ea79041e05ebb9a320cf2$ 17639+// $hash=13d421c7598593f4bee5b3e62cb8aaf348a350f9$ 17640 // 17641 17642 #ifndef CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ 17643@@ -28,7 +28,7 @@ 17644 // This class may be instantiated and accessed DLL-side only. 17645 class CefClientCToCpp 17646 : public CefCToCppRefCounted<CefClientCToCpp, CefClient, cef_client_t> { 17647-public: 17648+ public: 17649 CefClientCToCpp(); 17650 virtual ~CefClientCToCpp(); 17651 17652@@ -55,9 +55,9 @@ public: 17653 CefProcessId source_process, 17654 CefRefPtr<CefProcessMessage> message) override; 17655 int NotifyJavaScriptResult(CefRefPtr<CefListValue> args, 17656- const CefString &method, 17657- const CefString &object_name, 17658+ const CefString& method, 17659+ const CefString& object_name, 17660 CefRefPtr<CefListValue> result) override; 17661 }; 17662 17663-#endif // CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ 17664+#endif // CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ 17665diff --git a/src/cef/libcef_dll/ctocpp/command_line_ctocpp.cc b/src/cef/libcef_dll/ctocpp/command_line_ctocpp.cc 17666index a96b067677f06..e7b02e834fad5 17667--- a/src/cef/libcef_dll/ctocpp/command_line_ctocpp.cc 17668+++ b/src/cef/libcef_dll/ctocpp/command_line_ctocpp.cc 17669@@ -1,4 +1,4 @@ 17670-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17671+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17672 // reserved. Use of this source code is governed by a BSD-style license that 17673 // can be found in the LICENSE file. 17674 // 17675@@ -9,7 +9,7 @@ 17676 // implementations. See the translator.README.txt file in the tools directory 17677 // for more information. 17678 // 17679-// $hash=cc3c62b07c8e4d6f019637a0338673ac21ffa017$ 17680+// $hash=2f7f88a79dc5c9bb4c7af27e6abac4b4e7ba3d76$ 17681 // 17682 17683 #include "libcef_dll/ctocpp/command_line_ctocpp.h" 17684diff --git a/src/cef/libcef_dll/ctocpp/command_line_ctocpp.h b/src/cef/libcef_dll/ctocpp/command_line_ctocpp.h 17685index e11c013b6bf61..7beaa99e038c6 17686--- a/src/cef/libcef_dll/ctocpp/command_line_ctocpp.h 17687+++ b/src/cef/libcef_dll/ctocpp/command_line_ctocpp.h 17688@@ -1,4 +1,4 @@ 17689-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17690+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17691 // reserved. Use of this source code is governed by a BSD-style license that 17692 // can be found in the LICENSE file. 17693 // 17694@@ -9,7 +9,7 @@ 17695 // implementations. See the translator.README.txt file in the tools directory 17696 // for more information. 17697 // 17698-// $hash=6dffc109a4a5bdc10bda0a03950f1a8b81f964b7$ 17699+// $hash=c91f76be5a60016fa78afe2813b0d4df3bb422e7$ 17700 // 17701 17702 #ifndef CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ 17703diff --git a/src/cef/libcef_dll/ctocpp/completion_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/completion_callback_ctocpp.cc 17704index 4b9308d9569e9..302cfe2802419 17705--- a/src/cef/libcef_dll/ctocpp/completion_callback_ctocpp.cc 17706+++ b/src/cef/libcef_dll/ctocpp/completion_callback_ctocpp.cc 17707@@ -1,4 +1,4 @@ 17708-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17709+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17710 // reserved. Use of this source code is governed by a BSD-style license that 17711 // can be found in the LICENSE file. 17712 // 17713@@ -9,7 +9,7 @@ 17714 // implementations. See the translator.README.txt file in the tools directory 17715 // for more information. 17716 // 17717-// $hash=f65d432f0ca5891aa466010183e437ba5e2007be$ 17718+// $hash=bc0832e0b26f161d96d699a1922df4144ae6cf2d$ 17719 // 17720 17721 #include "libcef_dll/ctocpp/completion_callback_ctocpp.h" 17722diff --git a/src/cef/libcef_dll/ctocpp/completion_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/completion_callback_ctocpp.h 17723index a934d50e22740..37956aadac1fb 17724--- a/src/cef/libcef_dll/ctocpp/completion_callback_ctocpp.h 17725+++ b/src/cef/libcef_dll/ctocpp/completion_callback_ctocpp.h 17726@@ -1,4 +1,4 @@ 17727-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17728+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17729 // reserved. Use of this source code is governed by a BSD-style license that 17730 // can be found in the LICENSE file. 17731 // 17732@@ -9,7 +9,7 @@ 17733 // implementations. See the translator.README.txt file in the tools directory 17734 // for more information. 17735 // 17736-// $hash=d8c3f928349e064d8afe7853d4a47c90c1ed0114$ 17737+// $hash=bbdf6c23d87122deb5d3100430547b2c608497a9$ 17738 // 17739 17740 #ifndef CEF_LIBCEF_DLL_CTOCPP_COMPLETION_CALLBACK_CTOCPP_H_ 17741diff --git a/src/cef/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc 17742index eea53aa71656c..6d1bd15c9aa41 17743--- a/src/cef/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc 17744+++ b/src/cef/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc 17745@@ -1,4 +1,4 @@ 17746-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17747+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17748 // reserved. Use of this source code is governed by a BSD-style license that 17749 // can be found in the LICENSE file. 17750 // 17751@@ -9,7 +9,7 @@ 17752 // implementations. See the translator.README.txt file in the tools directory 17753 // for more information. 17754 // 17755-// $hash=e251b197b3369b44f3d66ce414094ac24ba1db10$ 17756+// $hash=074448a6721865377653c8625a38925aef5f3c7d$ 17757 // 17758 17759 #include "libcef_dll/ctocpp/context_menu_handler_ctocpp.h" 17760diff --git a/src/cef/libcef_dll/ctocpp/context_menu_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/context_menu_handler_ctocpp.h 17761index d5e0c793ac084..92e77bccbb2e8 17762--- a/src/cef/libcef_dll/ctocpp/context_menu_handler_ctocpp.h 17763+++ b/src/cef/libcef_dll/ctocpp/context_menu_handler_ctocpp.h 17764@@ -1,4 +1,4 @@ 17765-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17766+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17767 // reserved. Use of this source code is governed by a BSD-style license that 17768 // can be found in the LICENSE file. 17769 // 17770@@ -9,7 +9,7 @@ 17771 // implementations. See the translator.README.txt file in the tools directory 17772 // for more information. 17773 // 17774-// $hash=533df2bb508d88d0828f0da6284732c2ecbbafab$ 17775+// $hash=0d0bcb30d9e8b5894158c9ecf80fa710e4ce6b7d$ 17776 // 17777 17778 #ifndef CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_HANDLER_CTOCPP_H_ 17779diff --git a/src/cef/libcef_dll/ctocpp/context_menu_params_ctocpp.cc b/src/cef/libcef_dll/ctocpp/context_menu_params_ctocpp.cc 17780index c5dd4186ddc9e..18323da16151c 17781--- a/src/cef/libcef_dll/ctocpp/context_menu_params_ctocpp.cc 17782+++ b/src/cef/libcef_dll/ctocpp/context_menu_params_ctocpp.cc 17783@@ -1,4 +1,4 @@ 17784-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17785+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17786 // reserved. Use of this source code is governed by a BSD-style license that 17787 // can be found in the LICENSE file. 17788 // 17789@@ -9,7 +9,7 @@ 17790 // implementations. See the translator.README.txt file in the tools directory 17791 // for more information. 17792 // 17793-// $hash=233d530cb984468703b97752bda1178191d4ba75$ 17794+// $hash=bc04acf3a86598987676f33a6d39c10435dded70$ 17795 // 17796 17797 #include "libcef_dll/ctocpp/context_menu_params_ctocpp.h" 17798@@ -230,7 +230,7 @@ CefContextMenuParams::MediaType CefContextMenuParamsCToCpp::GetMediaType() { 17799 17800 NO_SANITIZE("cfi-icall") 17801 CefContextMenuParams::MediaStateFlags 17802-CefContextMenuParamsCToCpp::GetMediaStateFlags() { 17803+ CefContextMenuParamsCToCpp::GetMediaStateFlags() { 17804 shutdown_checker::AssertNotShutdown(); 17805 17806 cef_context_menu_params_t* _struct = GetStruct(); 17807@@ -351,7 +351,7 @@ bool CefContextMenuParamsCToCpp::IsSpellCheckEnabled() { 17808 17809 NO_SANITIZE("cfi-icall") 17810 CefContextMenuParams::EditStateFlags 17811-CefContextMenuParamsCToCpp::GetEditStateFlags() { 17812+ CefContextMenuParamsCToCpp::GetEditStateFlags() { 17813 shutdown_checker::AssertNotShutdown(); 17814 17815 cef_context_menu_params_t* _struct = GetStruct(); 17816@@ -384,6 +384,42 @@ NO_SANITIZE("cfi-icall") bool CefContextMenuParamsCToCpp::IsCustomMenu() { 17817 return _retval ? true : false; 17818 } 17819 17820+NO_SANITIZE("cfi-icall") 17821+CefContextMenuParams::InputFieldType 17822+ CefContextMenuParamsCToCpp::GetInputFieldType() { 17823+ shutdown_checker::AssertNotShutdown(); 17824+ 17825+ cef_context_menu_params_t* _struct = GetStruct(); 17826+ if (CEF_MEMBER_MISSING(_struct, get_input_field_type)) 17827+ return CM_INPUTFIELDTYPE_NONE; 17828+ 17829+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17830+ 17831+ // Execute 17832+ cef_context_menu_input_field_type_t _retval = 17833+ _struct->get_input_field_type(_struct); 17834+ 17835+ // Return type: simple 17836+ return _retval; 17837+} 17838+ 17839+NO_SANITIZE("cfi-icall") 17840+CefContextMenuParams::SourceType CefContextMenuParamsCToCpp::GetSourceType() { 17841+ shutdown_checker::AssertNotShutdown(); 17842+ 17843+ cef_context_menu_params_t* _struct = GetStruct(); 17844+ if (CEF_MEMBER_MISSING(_struct, get_source_type)) 17845+ return CM_SOURCETYPE_NONE; 17846+ 17847+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17848+ 17849+ // Execute 17850+ cef_context_menu_source_type_t _retval = _struct->get_source_type(_struct); 17851+ 17852+ // Return type: simple 17853+ return _retval; 17854+} 17855+ 17856 // CONSTRUCTOR - Do not edit by hand. 17857 17858 CefContextMenuParamsCToCpp::CefContextMenuParamsCToCpp() {} 17859diff --git a/src/cef/libcef_dll/ctocpp/context_menu_params_ctocpp.h b/src/cef/libcef_dll/ctocpp/context_menu_params_ctocpp.h 17860index b692a5160bbce..2540013e815c4 17861--- a/src/cef/libcef_dll/ctocpp/context_menu_params_ctocpp.h 17862+++ b/src/cef/libcef_dll/ctocpp/context_menu_params_ctocpp.h 17863@@ -1,4 +1,4 @@ 17864-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17865+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17866 // reserved. Use of this source code is governed by a BSD-style license that 17867 // can be found in the LICENSE file. 17868 // 17869@@ -9,7 +9,7 @@ 17870 // implementations. See the translator.README.txt file in the tools directory 17871 // for more information. 17872 // 17873-// $hash=de83ca0067722af09407abc0b7723a8d91d083ad$ 17874+// $hash=fd06aad327c518573e68c645f3facd55fea2da34$ 17875 // 17876 17877 #ifndef CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ 17878@@ -56,6 +56,8 @@ class CefContextMenuParamsCToCpp 17879 bool IsSpellCheckEnabled() override; 17880 EditStateFlags GetEditStateFlags() override; 17881 bool IsCustomMenu() override; 17882+ InputFieldType GetInputFieldType() override; 17883+ SourceType GetSourceType() override; 17884 }; 17885 17886 #endif // CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ 17887diff --git a/src/cef/libcef_dll/ctocpp/cookie_access_filter_ctocpp.cc b/src/cef/libcef_dll/ctocpp/cookie_access_filter_ctocpp.cc 17888index 3156b1db01495..53958890ff8c0 17889--- a/src/cef/libcef_dll/ctocpp/cookie_access_filter_ctocpp.cc 17890+++ b/src/cef/libcef_dll/ctocpp/cookie_access_filter_ctocpp.cc 17891@@ -1,4 +1,4 @@ 17892-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17893+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17894 // reserved. Use of this source code is governed by a BSD-style license that 17895 // can be found in the LICENSE file. 17896 // 17897@@ -9,7 +9,7 @@ 17898 // implementations. See the translator.README.txt file in the tools directory 17899 // for more information. 17900 // 17901-// $hash=b1ae8622378ad8661289554e6c542e970850aaed$ 17902+// $hash=d24bf7fb06a84dfbe57aa7bfe49cbb0de242a840$ 17903 // 17904 17905 #include "libcef_dll/ctocpp/cookie_access_filter_ctocpp.h" 17906diff --git a/src/cef/libcef_dll/ctocpp/cookie_access_filter_ctocpp.h b/src/cef/libcef_dll/ctocpp/cookie_access_filter_ctocpp.h 17907index 0170c33256d11..0da831215c084 17908--- a/src/cef/libcef_dll/ctocpp/cookie_access_filter_ctocpp.h 17909+++ b/src/cef/libcef_dll/ctocpp/cookie_access_filter_ctocpp.h 17910@@ -1,4 +1,4 @@ 17911-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17912+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17913 // reserved. Use of this source code is governed by a BSD-style license that 17914 // can be found in the LICENSE file. 17915 // 17916@@ -9,7 +9,7 @@ 17917 // implementations. See the translator.README.txt file in the tools directory 17918 // for more information. 17919 // 17920-// $hash=7a3357796fd02da5a233d4dfa6b8c7194ba8f969$ 17921+// $hash=b325a81a438e8e510eb826bc4e6acf5df04281c8$ 17922 // 17923 17924 #ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_ACCESS_FILTER_CTOCPP_H_ 17925diff --git a/src/cef/libcef_dll/ctocpp/cookie_manager_ctocpp.cc b/src/cef/libcef_dll/ctocpp/cookie_manager_ctocpp.cc 17926index 9f8b8ea1acbea..8d8bd262840d1 17927--- a/src/cef/libcef_dll/ctocpp/cookie_manager_ctocpp.cc 17928+++ b/src/cef/libcef_dll/ctocpp/cookie_manager_ctocpp.cc 17929@@ -1,4 +1,4 @@ 17930-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 17931+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 17932 // reserved. Use of this source code is governed by a BSD-style license that 17933 // can be found in the LICENSE file. 17934 // 17935@@ -9,7 +9,7 @@ 17936 // implementations. See the translator.README.txt file in the tools directory 17937 // for more information. 17938 // 17939-// $hash=6e1bd6af22e730b6d6a12a7296414250bf415979$ 17940+// $hash=3a8702e5b54310d93f9f43d60dd4d6d77b83da9d$ 17941 // 17942 17943 #include "libcef_dll/ctocpp/cookie_manager_ctocpp.h" 17944@@ -28,7 +28,7 @@ CefRefPtr<CefCookieManager> CefCookieManager::GetGlobalManager( 17945 // Unverified params: callback 17946 17947 // Execute 17948- cef_cookie_manager_t *_retval = cef_cookie_manager_get_global_manager( 17949+ cef_cookie_manager_t* _retval = cef_cookie_manager_get_global_manager( 17950 CefCompletionCallbackCppToC::Wrap(callback)); 17951 17952 // Return type: refptr_same 17953@@ -36,9 +36,9 @@ CefRefPtr<CefCookieManager> CefCookieManager::GetGlobalManager( 17954 } 17955 17956 NO_SANITIZE("cfi-icall") 17957-bool CefCookieManager::CreateCefCookie(const CefString &url, 17958- const CefString &value, 17959- CefCookie &cef_cookie) { 17960+bool CefCookieManager::CreateCefCookie(const CefString& url, 17961+ const CefString& value, 17962+ CefCookie& cef_cookie) { 17963 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 17964 17965 // Verify param: url; type: string_byref_const 17966@@ -61,7 +61,7 @@ bool CefCookieManager::CreateCefCookie(const CefString &url, 17967 // VIRTUAL METHODS - Body may be edited by hand. 17968 17969 NO_SANITIZE("cfi-icall") bool CefCookieManagerCToCpp::IsAcceptCookieAllowed() { 17970- cef_cookie_manager_t *_struct = GetStruct(); 17971+ cef_cookie_manager_t* _struct = GetStruct(); 17972 if (CEF_MEMBER_MISSING(_struct, is_accept_cookie_allowed)) 17973 return false; 17974 17975@@ -76,7 +76,7 @@ NO_SANITIZE("cfi-icall") bool CefCookieManagerCToCpp::IsAcceptCookieAllowed() { 17976 17977 NO_SANITIZE("cfi-icall") 17978 void CefCookieManagerCToCpp::PutAcceptCookieEnabled(bool accept) { 17979- cef_cookie_manager_t *_struct = GetStruct(); 17980+ cef_cookie_manager_t* _struct = GetStruct(); 17981 if (CEF_MEMBER_MISSING(_struct, put_accept_cookie_enabled)) 17982 return; 17983 17984@@ -88,7 +88,7 @@ void CefCookieManagerCToCpp::PutAcceptCookieEnabled(bool accept) { 17985 17986 NO_SANITIZE("cfi-icall") 17987 bool CefCookieManagerCToCpp::IsThirdPartyCookieAllowed() { 17988- cef_cookie_manager_t *_struct = GetStruct(); 17989+ cef_cookie_manager_t* _struct = GetStruct(); 17990 if (CEF_MEMBER_MISSING(_struct, is_third_party_cookie_allowed)) 17991 return false; 17992 17993@@ -103,7 +103,7 @@ bool CefCookieManagerCToCpp::IsThirdPartyCookieAllowed() { 17994 17995 NO_SANITIZE("cfi-icall") 17996 void CefCookieManagerCToCpp::PutAcceptThirdPartyCookieEnabled(bool accept) { 17997- cef_cookie_manager_t *_struct = GetStruct(); 17998+ cef_cookie_manager_t* _struct = GetStruct(); 17999 if (CEF_MEMBER_MISSING(_struct, put_accept_third_party_cookie_enabled)) 18000 return; 18001 18002@@ -115,7 +115,7 @@ void CefCookieManagerCToCpp::PutAcceptThirdPartyCookieEnabled(bool accept) { 18003 18004 NO_SANITIZE("cfi-icall") 18005 bool CefCookieManagerCToCpp::IsFileURLSchemeCookiesAllowed() { 18006- cef_cookie_manager_t *_struct = GetStruct(); 18007+ cef_cookie_manager_t* _struct = GetStruct(); 18008 if (CEF_MEMBER_MISSING(_struct, is_file_urlscheme_cookies_allowed)) 18009 return false; 18010 18011@@ -130,7 +130,7 @@ bool CefCookieManagerCToCpp::IsFileURLSchemeCookiesAllowed() { 18012 18013 NO_SANITIZE("cfi-icall") 18014 void CefCookieManagerCToCpp::PutAcceptFileURLSchemeCookiesEnabled(bool allow) { 18015- cef_cookie_manager_t *_struct = GetStruct(); 18016+ cef_cookie_manager_t* _struct = GetStruct(); 18017 if (CEF_MEMBER_MISSING(_struct, put_accept_file_urlscheme_cookies_enabled)) 18018 return; 18019 18020@@ -143,7 +143,7 @@ void CefCookieManagerCToCpp::PutAcceptFileURLSchemeCookiesEnabled(bool allow) { 18021 NO_SANITIZE("cfi-icall") 18022 bool CefCookieManagerCToCpp::VisitAllCookies( 18023 CefRefPtr<CefCookieVisitor> visitor) { 18024- cef_cookie_manager_t *_struct = GetStruct(); 18025+ cef_cookie_manager_t* _struct = GetStruct(); 18026 if (CEF_MEMBER_MISSING(_struct, visit_all_cookies)) 18027 return false; 18028 18029@@ -164,9 +164,10 @@ bool CefCookieManagerCToCpp::VisitAllCookies( 18030 18031 NO_SANITIZE("cfi-icall") 18032 bool CefCookieManagerCToCpp::VisitUrlCookies( 18033- const CefString &url, bool includeHttpOnly, 18034+ const CefString& url, 18035+ bool includeHttpOnly, 18036 CefRefPtr<CefCookieVisitor> visitor) { 18037- cef_cookie_manager_t *_struct = GetStruct(); 18038+ cef_cookie_manager_t* _struct = GetStruct(); 18039 if (CEF_MEMBER_MISSING(_struct, visit_url_cookies)) 18040 return false; 18041 18042@@ -192,9 +193,10 @@ bool CefCookieManagerCToCpp::VisitUrlCookies( 18043 18044 NO_SANITIZE("cfi-icall") 18045 bool CefCookieManagerCToCpp::SetCookie( 18046- const CefString &url, const CefCookie &cookie, 18047+ const CefString& url, 18048+ const CefCookie& cookie, 18049 CefRefPtr<CefSetCookieCallback> callback) { 18050- cef_cookie_manager_t *_struct = GetStruct(); 18051+ cef_cookie_manager_t* _struct = GetStruct(); 18052 if (CEF_MEMBER_MISSING(_struct, set_cookie)) 18053 return false; 18054 18055@@ -216,9 +218,11 @@ bool CefCookieManagerCToCpp::SetCookie( 18056 18057 NO_SANITIZE("cfi-icall") 18058 bool CefCookieManagerCToCpp::DeleteCookies( 18059- const CefString &url, const CefString &cookie_name, bool is_session, 18060+ const CefString& url, 18061+ const CefString& cookie_name, 18062+ bool is_session, 18063 CefRefPtr<CefDeleteCookiesCallback> callback) { 18064- cef_cookie_manager_t *_struct = GetStruct(); 18065+ cef_cookie_manager_t* _struct = GetStruct(); 18066 if (CEF_MEMBER_MISSING(_struct, delete_cookies)) 18067 return false; 18068 18069@@ -238,7 +242,7 @@ bool CefCookieManagerCToCpp::DeleteCookies( 18070 NO_SANITIZE("cfi-icall") 18071 bool CefCookieManagerCToCpp::FlushStore( 18072 CefRefPtr<CefCompletionCallback> callback) { 18073- cef_cookie_manager_t *_struct = GetStruct(); 18074+ cef_cookie_manager_t* _struct = GetStruct(); 18075 if (CEF_MEMBER_MISSING(_struct, flush_store)) 18076 return false; 18077 18078@@ -263,15 +267,17 @@ CefCookieManagerCToCpp::CefCookieManagerCToCpp() {} 18079 CefCookieManagerCToCpp::~CefCookieManagerCToCpp() {} 18080 18081 template <> 18082-cef_cookie_manager_t * 18083-CefCToCppRefCounted<CefCookieManagerCToCpp, CefCookieManager, 18084+cef_cookie_manager_t* 18085+CefCToCppRefCounted<CefCookieManagerCToCpp, 18086+ CefCookieManager, 18087 cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type, 18088- CefCookieManager *c) { 18089+ CefCookieManager* c) { 18090 NOTREACHED() << "Unexpected class type: " << type; 18091 return nullptr; 18092 } 18093 18094 template <> 18095-CefWrapperType CefCToCppRefCounted<CefCookieManagerCToCpp, CefCookieManager, 18096+CefWrapperType CefCToCppRefCounted<CefCookieManagerCToCpp, 18097+ CefCookieManager, 18098 cef_cookie_manager_t>::kWrapperType = 18099 WT_COOKIE_MANAGER; 18100diff --git a/src/cef/libcef_dll/ctocpp/cookie_manager_ctocpp.h b/src/cef/libcef_dll/ctocpp/cookie_manager_ctocpp.h 18101index cfdbc7af723a6..02e2ba430134b 18102--- a/src/cef/libcef_dll/ctocpp/cookie_manager_ctocpp.h 18103+++ b/src/cef/libcef_dll/ctocpp/cookie_manager_ctocpp.h 18104@@ -1,4 +1,4 @@ 18105-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18106+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18107 // reserved. Use of this source code is governed by a BSD-style license that 18108 // can be found in the LICENSE file. 18109 // 18110@@ -9,7 +9,7 @@ 18111 // implementations. See the translator.README.txt file in the tools directory 18112 // for more information. 18113 // 18114-// $hash=f92d6bb66153459fd6906db5e1fe32781dfafa2d$ 18115+// $hash=23d749e39a04142c1e7d09579460dba887d31d9b$ 18116 // 18117 18118 #ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_MANAGER_CTOCPP_H_ 18119diff --git a/src/cef/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc b/src/cef/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc 18120index c915510144dc1..9468de70c0879 18121--- a/src/cef/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc 18122+++ b/src/cef/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc 18123@@ -1,4 +1,4 @@ 18124-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18125+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18126 // reserved. Use of this source code is governed by a BSD-style license that 18127 // can be found in the LICENSE file. 18128 // 18129@@ -9,7 +9,7 @@ 18130 // implementations. See the translator.README.txt file in the tools directory 18131 // for more information. 18132 // 18133-// $hash=46632d6c9d6e3c6891abc90323313bea54d7419e$ 18134+// $hash=708c4aeb30bed97847155c90b86fecc6388b0a60$ 18135 // 18136 18137 #include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h" 18138diff --git a/src/cef/libcef_dll/ctocpp/cookie_visitor_ctocpp.h b/src/cef/libcef_dll/ctocpp/cookie_visitor_ctocpp.h 18139index 62d00723628ae..25aae27f205f1 18140--- a/src/cef/libcef_dll/ctocpp/cookie_visitor_ctocpp.h 18141+++ b/src/cef/libcef_dll/ctocpp/cookie_visitor_ctocpp.h 18142@@ -1,4 +1,4 @@ 18143-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18144+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18145 // reserved. Use of this source code is governed by a BSD-style license that 18146 // can be found in the LICENSE file. 18147 // 18148@@ -9,7 +9,7 @@ 18149 // implementations. See the translator.README.txt file in the tools directory 18150 // for more information. 18151 // 18152-// $hash=c1dca55691f6d564ad2a69b38acd141982368895$ 18153+// $hash=1824342f14e23ea975b7faed0406036568d88ba8$ 18154 // 18155 18156 #ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_VISITOR_CTOCPP_H_ 18157diff --git a/src/cef/libcef_dll/ctocpp/data_base_ctocpp.cc b/src/cef/libcef_dll/ctocpp/data_base_ctocpp.cc 18158index 28b630c8dd5b7..447b0734ffdb5 18159--- a/src/cef/libcef_dll/ctocpp/data_base_ctocpp.cc 18160+++ b/src/cef/libcef_dll/ctocpp/data_base_ctocpp.cc 18161@@ -1,4 +1,4 @@ 18162-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18163+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18164 // reserved. Use of this source code is governed by a BSD-style license that 18165 // can be found in the LICENSE file. 18166 // 18167@@ -9,7 +9,7 @@ 18168 // implementations. See the translator.README.txt file in the tools directory 18169 // for more information. 18170 // 18171-// $hash=3ab167d92ecbdc7c4c52483058038ed50a68231a$ 18172+// $hash=2cf79925fe0507a777cba65aadf5d72f57e38a3c$ 18173 // 18174 18175 #include "libcef_dll/ctocpp/data_base_ctocpp.h" 18176@@ -90,10 +90,11 @@ void CefDataBaseCToCpp::SaveHttpAuthCredentials(const CefString& host, 18177 } 18178 18179 NO_SANITIZE("cfi-icall") 18180-void CefDataBaseCToCpp::GetHttpAuthCredentials( 18181- const CefString& host, 18182- const CefString& realm, 18183- std::vector<CefString>& username_password) { 18184+void CefDataBaseCToCpp::GetHttpAuthCredentials(const CefString& host, 18185+ const CefString& realm, 18186+ CefString& username, 18187+ char* password, 18188+ uint32_t passwordSize) { 18189 cef_data_base_t* _struct = GetStruct(); 18190 if (CEF_MEMBER_MISSING(_struct, get_http_auth_credentials)) 18191 return; 18192@@ -108,29 +109,21 @@ void CefDataBaseCToCpp::GetHttpAuthCredentials( 18193 DCHECK(!realm.empty()); 18194 if (realm.empty()) 18195 return; 18196- 18197- // Translate param: username_password; type: string_vec_byref 18198- cef_string_list_t username_passwordList = cef_string_list_alloc(); 18199- DCHECK(username_passwordList); 18200- if (username_passwordList) 18201- transfer_string_list_contents(username_password, username_passwordList); 18202+ // Verify param: password; type: simple_byaddr 18203+ DCHECK(password); 18204+ if (!password) 18205+ return; 18206 18207 // Execute 18208- _struct->get_http_auth_credentials(_struct, host.GetStruct(), 18209- realm.GetStruct(), username_passwordList); 18210- 18211- // Restore param:username_password; type: string_vec_byref 18212- if (username_passwordList) { 18213- username_password.clear(); 18214- transfer_string_list_contents(username_passwordList, username_password); 18215- cef_string_list_free(username_passwordList); 18216- } 18217+ _struct->get_http_auth_credentials( 18218+ _struct, host.GetStruct(), realm.GetStruct(), 18219+ username.GetWritableStruct(), password, passwordSize); 18220 } 18221 18222 NO_SANITIZE("cfi-icall") 18223-bool CefDataBaseCToCpp::ExistPermissionByOrigin(const CefString &origin, 18224+bool CefDataBaseCToCpp::ExistPermissionByOrigin(const CefString& origin, 18225 int type) { 18226- cef_data_base_t *_struct = GetStruct(); 18227+ cef_data_base_t* _struct = GetStruct(); 18228 if (CEF_MEMBER_MISSING(_struct, exist_permission_by_origin)) 18229 return false; 18230 18231@@ -150,9 +143,10 @@ bool CefDataBaseCToCpp::ExistPermissionByOrigin(const CefString &origin, 18232 } 18233 18234 NO_SANITIZE("cfi-icall") 18235-bool CefDataBaseCToCpp::GetPermissionResultByOrigin(const CefString &origin, 18236- int type, bool &result) { 18237- cef_data_base_t *_struct = GetStruct(); 18238+bool CefDataBaseCToCpp::GetPermissionResultByOrigin(const CefString& origin, 18239+ int type, 18240+ bool& result) { 18241+ cef_data_base_t* _struct = GetStruct(); 18242 if (CEF_MEMBER_MISSING(_struct, get_permission_result_by_origin)) 18243 return false; 18244 18245@@ -178,9 +172,10 @@ bool CefDataBaseCToCpp::GetPermissionResultByOrigin(const CefString &origin, 18246 } 18247 18248 NO_SANITIZE("cfi-icall") 18249-void CefDataBaseCToCpp::SetPermissionByOrigin(const CefString &origin, int type, 18250+void CefDataBaseCToCpp::SetPermissionByOrigin(const CefString& origin, 18251+ int type, 18252 bool result) { 18253- cef_data_base_t *_struct = GetStruct(); 18254+ cef_data_base_t* _struct = GetStruct(); 18255 if (CEF_MEMBER_MISSING(_struct, set_permission_by_origin)) 18256 return; 18257 18258@@ -196,9 +191,9 @@ void CefDataBaseCToCpp::SetPermissionByOrigin(const CefString &origin, int type, 18259 } 18260 18261 NO_SANITIZE("cfi-icall") 18262-void CefDataBaseCToCpp::ClearPermissionByOrigin(const CefString &origin, 18263+void CefDataBaseCToCpp::ClearPermissionByOrigin(const CefString& origin, 18264 int type) { 18265- cef_data_base_t *_struct = GetStruct(); 18266+ cef_data_base_t* _struct = GetStruct(); 18267 if (CEF_MEMBER_MISSING(_struct, clear_permission_by_origin)) 18268 return; 18269 18270@@ -214,7 +209,7 @@ void CefDataBaseCToCpp::ClearPermissionByOrigin(const CefString &origin, 18271 } 18272 18273 NO_SANITIZE("cfi-icall") void CefDataBaseCToCpp::ClearAllPermission(int type) { 18274- cef_data_base_t *_struct = GetStruct(); 18275+ cef_data_base_t* _struct = GetStruct(); 18276 if (CEF_MEMBER_MISSING(_struct, clear_all_permission)) 18277 return; 18278 18279@@ -226,8 +221,9 @@ NO_SANITIZE("cfi-icall") void CefDataBaseCToCpp::ClearAllPermission(int type) { 18280 18281 NO_SANITIZE("cfi-icall") 18282 void CefDataBaseCToCpp::GetOriginsByPermission( 18283- int type, std::vector<CefString> &origins) { 18284- cef_data_base_t *_struct = GetStruct(); 18285+ int type, 18286+ std::vector<CefString>& origins) { 18287+ cef_data_base_t* _struct = GetStruct(); 18288 if (CEF_MEMBER_MISSING(_struct, get_origins_by_permission)) 18289 return; 18290 18291diff --git a/src/cef/libcef_dll/ctocpp/data_base_ctocpp.h b/src/cef/libcef_dll/ctocpp/data_base_ctocpp.h 18292index 36a158f4d2aa9..41b9a15b369a7 18293--- a/src/cef/libcef_dll/ctocpp/data_base_ctocpp.h 18294+++ b/src/cef/libcef_dll/ctocpp/data_base_ctocpp.h 18295@@ -1,4 +1,4 @@ 18296-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18297+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18298 // reserved. Use of this source code is governed by a BSD-style license that 18299 // can be found in the LICENSE file. 18300 // 18301@@ -9,7 +9,7 @@ 18302 // implementations. See the translator.README.txt file in the tools directory 18303 // for more information. 18304 // 18305-// $hash=7b5c7ec8ac08f9547744baa38e840cf35a3e7a25$ 18306+// $hash=0a76a650645cbe773c0109fd95ce88ff4c0841e5$ 18307 // 18308 18309 #ifndef CEF_LIBCEF_DLL_CTOCPP_DATA_BASE_CTOCPP_H_ 18310@@ -41,10 +41,11 @@ class CefDataBaseCToCpp : public CefCToCppRefCounted<CefDataBaseCToCpp, 18311 const CefString& realm, 18312 const CefString& username, 18313 const char* password) override; 18314- void GetHttpAuthCredentials( 18315- const CefString& host, 18316- const CefString& realm, 18317- std::vector<CefString>& username_password) override; 18318+ void GetHttpAuthCredentials(const CefString& host, 18319+ const CefString& realm, 18320+ CefString& username, 18321+ char* password, 18322+ uint32_t passwordSize) override; 18323 bool ExistPermissionByOrigin(const CefString& origin, int type) override; 18324 bool GetPermissionResultByOrigin(const CefString& origin, 18325 int type, 18326diff --git a/src/cef/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc 18327index 4f5301ec811ed..25be285954dae 18328--- a/src/cef/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc 18329+++ b/src/cef/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc 18330@@ -1,4 +1,4 @@ 18331-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18332+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18333 // reserved. Use of this source code is governed by a BSD-style license that 18334 // can be found in the LICENSE file. 18335 // 18336@@ -9,7 +9,7 @@ 18337 // implementations. See the translator.README.txt file in the tools directory 18338 // for more information. 18339 // 18340-// $hash=765b5a3f3e0ac077f2ff72541ae26ca342c4ca78$ 18341+// $hash=55be7ac3ac6c4e07af7c20c920c6c83b7d0a25d3$ 18342 // 18343 18344 #include "libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h" 18345diff --git a/src/cef/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h 18346index 90f109ac9e05b..7e7bdaf33bc11 18347--- a/src/cef/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h 18348+++ b/src/cef/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h 18349@@ -1,4 +1,4 @@ 18350-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18351+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18352 // reserved. Use of this source code is governed by a BSD-style license that 18353 // can be found in the LICENSE file. 18354 // 18355@@ -9,7 +9,7 @@ 18356 // implementations. See the translator.README.txt file in the tools directory 18357 // for more information. 18358 // 18359-// $hash=cd33af6263f686958bccf5907e1c4622950a7a40$ 18360+// $hash=e064baa776ef2fb9b70d51ec556613859a222067$ 18361 // 18362 18363 #ifndef CEF_LIBCEF_DLL_CTOCPP_DELETE_COOKIES_CALLBACK_CTOCPP_H_ 18364diff --git a/src/cef/libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.cc b/src/cef/libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.cc 18365index 367af2dd9ad49..b7da42aca079b 18366--- a/src/cef/libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.cc 18367+++ b/src/cef/libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.cc 18368@@ -1,4 +1,4 @@ 18369-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18370+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18371 // reserved. Use of this source code is governed by a BSD-style license that 18372 // can be found in the LICENSE file. 18373 // 18374@@ -9,7 +9,7 @@ 18375 // implementations. See the translator.README.txt file in the tools directory 18376 // for more information. 18377 // 18378-// $hash=610f96da1baaa48d1aa7fcff8a4c4fb33d2965ab$ 18379+// $hash=dc9df8e6b51991e751cb5f6607db87d3d9b3bb18$ 18380 // 18381 18382 #include "libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.h" 18383diff --git a/src/cef/libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.h b/src/cef/libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.h 18384index 99eb59beed067..c328e21fdbccb 18385--- a/src/cef/libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.h 18386+++ b/src/cef/libcef_dll/ctocpp/dev_tools_message_observer_ctocpp.h 18387@@ -1,4 +1,4 @@ 18388-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18389+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18390 // reserved. Use of this source code is governed by a BSD-style license that 18391 // can be found in the LICENSE file. 18392 // 18393@@ -9,7 +9,7 @@ 18394 // implementations. See the translator.README.txt file in the tools directory 18395 // for more information. 18396 // 18397-// $hash=3b8cfdd8e4bc8e1981634fdd6a78f8eb9a23da4b$ 18398+// $hash=13f5ab113bea9ee958f3d92e1c10898fd182c14e$ 18399 // 18400 18401 #ifndef CEF_LIBCEF_DLL_CTOCPP_DEV_TOOLS_MESSAGE_OBSERVER_CTOCPP_H_ 18402diff --git a/src/cef/libcef_dll/ctocpp/dialog_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/dialog_handler_ctocpp.cc 18403index 2cb31ef5631ed..01d360a03eabd 18404--- a/src/cef/libcef_dll/ctocpp/dialog_handler_ctocpp.cc 18405+++ b/src/cef/libcef_dll/ctocpp/dialog_handler_ctocpp.cc 18406@@ -1,4 +1,4 @@ 18407-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18408+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18409 // reserved. Use of this source code is governed by a BSD-style license that 18410 // can be found in the LICENSE file. 18411 // 18412@@ -9,12 +9,13 @@ 18413 // implementations. See the translator.README.txt file in the tools directory 18414 // for more information. 18415 // 18416-// $hash=df2505130721df8255b0d5bd511fb8ef394a7d8e$ 18417+// $hash=2ce0bd2dda4afb008613b357545251c4e498dd53$ 18418 // 18419 18420 #include "libcef_dll/ctocpp/dialog_handler_ctocpp.h" 18421 #include "libcef_dll/cpptoc/browser_cpptoc.h" 18422 #include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h" 18423+#include "libcef_dll/cpptoc/select_popup_callback_cpptoc.h" 18424 #include "libcef_dll/shutdown_checker.h" 18425 #include "libcef_dll/transfer_util.h" 18426 18427@@ -72,6 +73,59 @@ bool CefDialogHandlerCToCpp::OnFileDialog( 18428 return _retval ? true : false; 18429 } 18430 18431+NO_SANITIZE("cfi-icall") 18432+void CefDialogHandlerCToCpp::OnSelectPopupMenu( 18433+ CefRefPtr<CefBrowser> browser, 18434+ const CefRect& bounds, 18435+ int item_height, 18436+ double item_font_size, 18437+ int selected_item, 18438+ const std::vector<CefSelectPopupItem>& menu_items, 18439+ bool right_aligned, 18440+ bool allow_multiple_selection, 18441+ CefRefPtr<CefSelectPopupCallback> callback) { 18442+ shutdown_checker::AssertNotShutdown(); 18443+ 18444+ cef_dialog_handler_t* _struct = GetStruct(); 18445+ if (CEF_MEMBER_MISSING(_struct, on_select_popup_menu)) 18446+ return; 18447+ 18448+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 18449+ 18450+ // Verify param: browser; type: refptr_diff 18451+ DCHECK(browser.get()); 18452+ if (!browser.get()) 18453+ return; 18454+ // Verify param: callback; type: refptr_diff 18455+ DCHECK(callback.get()); 18456+ if (!callback.get()) 18457+ return; 18458+ 18459+ // Translate param: menu_items; type: simple_vec_byref_const 18460+ const size_t menu_itemsCount = menu_items.size(); 18461+ cef_select_popup_item_t* menu_itemsList = NULL; 18462+ if (menu_itemsCount > 0) { 18463+ menu_itemsList = new cef_select_popup_item_t[menu_itemsCount]; 18464+ DCHECK(menu_itemsList); 18465+ if (menu_itemsList) { 18466+ for (size_t i = 0; i < menu_itemsCount; ++i) { 18467+ menu_itemsList[i] = menu_items[i]; 18468+ } 18469+ } 18470+ } 18471+ 18472+ // Execute 18473+ _struct->on_select_popup_menu(_struct, CefBrowserCppToC::Wrap(browser), 18474+ &bounds, item_height, item_font_size, 18475+ selected_item, menu_itemsCount, menu_itemsList, 18476+ right_aligned, allow_multiple_selection, 18477+ CefSelectPopupCallbackCppToC::Wrap(callback)); 18478+ 18479+ // Restore param:menu_items; type: simple_vec_byref_const 18480+ if (menu_itemsList) 18481+ delete[] menu_itemsList; 18482+} 18483+ 18484 // CONSTRUCTOR - Do not edit by hand. 18485 18486 CefDialogHandlerCToCpp::CefDialogHandlerCToCpp() {} 18487diff --git a/src/cef/libcef_dll/ctocpp/dialog_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/dialog_handler_ctocpp.h 18488index 6ebdca55397a2..f3096ae0457b7 18489--- a/src/cef/libcef_dll/ctocpp/dialog_handler_ctocpp.h 18490+++ b/src/cef/libcef_dll/ctocpp/dialog_handler_ctocpp.h 18491@@ -1,4 +1,4 @@ 18492-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18493+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18494 // reserved. Use of this source code is governed by a BSD-style license that 18495 // can be found in the LICENSE file. 18496 // 18497@@ -9,7 +9,7 @@ 18498 // implementations. See the translator.README.txt file in the tools directory 18499 // for more information. 18500 // 18501-// $hash=fb268437c35b6a412dc6305ae83798d4d1db56d6$ 18502+// $hash=9d70e8e88a252b29a7157b30e487ce44b6d77404$ 18503 // 18504 18505 #ifndef CEF_LIBCEF_DLL_CTOCPP_DIALOG_HANDLER_CTOCPP_H_ 18506@@ -44,6 +44,15 @@ class CefDialogHandlerCToCpp 18507 int selected_accept_filter, 18508 bool capture, 18509 CefRefPtr<CefFileDialogCallback> callback) override; 18510+ void OnSelectPopupMenu(CefRefPtr<CefBrowser> browser, 18511+ const CefRect& bounds, 18512+ int item_height, 18513+ double item_font_size, 18514+ int selected_item, 18515+ const std::vector<CefSelectPopupItem>& menu_items, 18516+ bool right_aligned, 18517+ bool allow_multiple_selection, 18518+ CefRefPtr<CefSelectPopupCallback> callback) override; 18519 }; 18520 18521 #endif // CEF_LIBCEF_DLL_CTOCPP_DIALOG_HANDLER_CTOCPP_H_ 18522diff --git a/src/cef/libcef_dll/ctocpp/dictionary_value_ctocpp.cc b/src/cef/libcef_dll/ctocpp/dictionary_value_ctocpp.cc 18523index f7263738203fd..de5fa0b770e7f 18524--- a/src/cef/libcef_dll/ctocpp/dictionary_value_ctocpp.cc 18525+++ b/src/cef/libcef_dll/ctocpp/dictionary_value_ctocpp.cc 18526@@ -1,4 +1,4 @@ 18527-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18528+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18529 // reserved. Use of this source code is governed by a BSD-style license that 18530 // can be found in the LICENSE file. 18531 // 18532@@ -9,7 +9,7 @@ 18533 // implementations. See the translator.README.txt file in the tools directory 18534 // for more information. 18535 // 18536-// $hash=70aa25f8ab57f0c152666a730aff4247684108f9$ 18537+// $hash=aa3f8a292eeec9a65ab219958a3706b40500faa5$ 18538 // 18539 18540 #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" 18541diff --git a/src/cef/libcef_dll/ctocpp/dictionary_value_ctocpp.h b/src/cef/libcef_dll/ctocpp/dictionary_value_ctocpp.h 18542index a0af1d99608b4..ba9843f84957a 18543--- a/src/cef/libcef_dll/ctocpp/dictionary_value_ctocpp.h 18544+++ b/src/cef/libcef_dll/ctocpp/dictionary_value_ctocpp.h 18545@@ -1,4 +1,4 @@ 18546-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18547+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18548 // reserved. Use of this source code is governed by a BSD-style license that 18549 // can be found in the LICENSE file. 18550 // 18551@@ -9,7 +9,7 @@ 18552 // implementations. See the translator.README.txt file in the tools directory 18553 // for more information. 18554 // 18555-// $hash=ad04d2893bd8949c1384a4dcd68c9acb0f2b967d$ 18556+// $hash=68a7aff9f01e57edaeaa53bfbbc4c6121ebb3a1b$ 18557 // 18558 18559 #ifndef CEF_LIBCEF_DLL_CTOCPP_DICTIONARY_VALUE_CTOCPP_H_ 18560diff --git a/src/cef/libcef_dll/ctocpp/display_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/display_handler_ctocpp.cc 18561index 1281236ab0c23..8834d04bd513d 18562--- a/src/cef/libcef_dll/ctocpp/display_handler_ctocpp.cc 18563+++ b/src/cef/libcef_dll/ctocpp/display_handler_ctocpp.cc 18564@@ -1,4 +1,4 @@ 18565-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18566+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18567 // reserved. Use of this source code is governed by a BSD-style license that 18568 // can be found in the LICENSE file. 18569 // 18570@@ -9,7 +9,7 @@ 18571 // implementations. See the translator.README.txt file in the tools directory 18572 // for more information. 18573 // 18574-// $hash=dcdaebfe8fdc44caf9f4903321577b155b2ec959$ 18575+// $hash=c3f669584e3f282ce2eb05b3aca53e97e0548d8a$ 18576 // 18577 18578 #include "libcef_dll/ctocpp/display_handler_ctocpp.h" 18579diff --git a/src/cef/libcef_dll/ctocpp/display_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/display_handler_ctocpp.h 18580index b40137e95cf7a..dafe883cd9bd1 18581--- a/src/cef/libcef_dll/ctocpp/display_handler_ctocpp.h 18582+++ b/src/cef/libcef_dll/ctocpp/display_handler_ctocpp.h 18583@@ -1,4 +1,4 @@ 18584-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18585+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18586 // reserved. Use of this source code is governed by a BSD-style license that 18587 // can be found in the LICENSE file. 18588 // 18589@@ -9,7 +9,7 @@ 18590 // implementations. See the translator.README.txt file in the tools directory 18591 // for more information. 18592 // 18593-// $hash=dc1b9dda1a8f57d46d2c0049cd62a57dd5f56868$ 18594+// $hash=b242381316d4973e89fe4ae2c9f41e2ef7be2242$ 18595 // 18596 18597 #ifndef CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_ 18598diff --git a/src/cef/libcef_dll/ctocpp/domdocument_ctocpp.cc b/src/cef/libcef_dll/ctocpp/domdocument_ctocpp.cc 18599index 3506a6b90e091..e1bcbda6790a6 18600--- a/src/cef/libcef_dll/ctocpp/domdocument_ctocpp.cc 18601+++ b/src/cef/libcef_dll/ctocpp/domdocument_ctocpp.cc 18602@@ -1,4 +1,4 @@ 18603-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18604+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18605 // reserved. Use of this source code is governed by a BSD-style license that 18606 // can be found in the LICENSE file. 18607 // 18608@@ -9,7 +9,7 @@ 18609 // implementations. See the translator.README.txt file in the tools directory 18610 // for more information. 18611 // 18612-// $hash=e5f17a1d61c8211bcf16be848e8aaf48934c5b0c$ 18613+// $hash=4dddf3528abafd3fce06482308a76df0a056cd3c$ 18614 // 18615 18616 #include "libcef_dll/ctocpp/domdocument_ctocpp.h" 18617diff --git a/src/cef/libcef_dll/ctocpp/domdocument_ctocpp.h b/src/cef/libcef_dll/ctocpp/domdocument_ctocpp.h 18618index b795fe326dbac..29fe326f855a3 18619--- a/src/cef/libcef_dll/ctocpp/domdocument_ctocpp.h 18620+++ b/src/cef/libcef_dll/ctocpp/domdocument_ctocpp.h 18621@@ -1,4 +1,4 @@ 18622-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18623+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18624 // reserved. Use of this source code is governed by a BSD-style license that 18625 // can be found in the LICENSE file. 18626 // 18627@@ -9,7 +9,7 @@ 18628 // implementations. See the translator.README.txt file in the tools directory 18629 // for more information. 18630 // 18631-// $hash=50b7c300f95667c483dcb19c13f274fbc352f7d1$ 18632+// $hash=987816a9b106341068d08f3cd9254c98cf77f6ad$ 18633 // 18634 18635 #ifndef CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ 18636diff --git a/src/cef/libcef_dll/ctocpp/domnode_ctocpp.cc b/src/cef/libcef_dll/ctocpp/domnode_ctocpp.cc 18637index 566e426bf9015..f4b1c0e27a4ee 18638--- a/src/cef/libcef_dll/ctocpp/domnode_ctocpp.cc 18639+++ b/src/cef/libcef_dll/ctocpp/domnode_ctocpp.cc 18640@@ -1,4 +1,4 @@ 18641-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18642+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18643 // reserved. Use of this source code is governed by a BSD-style license that 18644 // can be found in the LICENSE file. 18645 // 18646@@ -9,7 +9,7 @@ 18647 // implementations. See the translator.README.txt file in the tools directory 18648 // for more information. 18649 // 18650-// $hash=64846f6de30a56d2aaed093cbfd9959c7cc2f1af$ 18651+// $hash=bc1d300ce01b57d299dff3b67d54508fa827489e$ 18652 // 18653 18654 #include "libcef_dll/ctocpp/domnode_ctocpp.h" 18655diff --git a/src/cef/libcef_dll/ctocpp/domnode_ctocpp.h b/src/cef/libcef_dll/ctocpp/domnode_ctocpp.h 18656index 4678361566ab3..a16b3109a5788 18657--- a/src/cef/libcef_dll/ctocpp/domnode_ctocpp.h 18658+++ b/src/cef/libcef_dll/ctocpp/domnode_ctocpp.h 18659@@ -1,4 +1,4 @@ 18660-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18661+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18662 // reserved. Use of this source code is governed by a BSD-style license that 18663 // can be found in the LICENSE file. 18664 // 18665@@ -9,7 +9,7 @@ 18666 // implementations. See the translator.README.txt file in the tools directory 18667 // for more information. 18668 // 18669-// $hash=a824395854fca10143c0329a0f95dcfc837c6d86$ 18670+// $hash=343a5f84d09a6933f005c3915582c73c43bda406$ 18671 // 18672 18673 #ifndef CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ 18674diff --git a/src/cef/libcef_dll/ctocpp/domvisitor_ctocpp.cc b/src/cef/libcef_dll/ctocpp/domvisitor_ctocpp.cc 18675index 3ece62f9ed3ad..1361ee52a0b28 18676--- a/src/cef/libcef_dll/ctocpp/domvisitor_ctocpp.cc 18677+++ b/src/cef/libcef_dll/ctocpp/domvisitor_ctocpp.cc 18678@@ -1,4 +1,4 @@ 18679-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18680+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18681 // reserved. Use of this source code is governed by a BSD-style license that 18682 // can be found in the LICENSE file. 18683 // 18684@@ -9,7 +9,7 @@ 18685 // implementations. See the translator.README.txt file in the tools directory 18686 // for more information. 18687 // 18688-// $hash=c3351e11fd6ae488bd77aeba4b4c8485f24119ad$ 18689+// $hash=7379b70849292e5b7709d2ff0a4e2541869c86a5$ 18690 // 18691 18692 #include "libcef_dll/ctocpp/domvisitor_ctocpp.h" 18693diff --git a/src/cef/libcef_dll/ctocpp/domvisitor_ctocpp.h b/src/cef/libcef_dll/ctocpp/domvisitor_ctocpp.h 18694index b1cf8b622addf..0504b52266ade 18695--- a/src/cef/libcef_dll/ctocpp/domvisitor_ctocpp.h 18696+++ b/src/cef/libcef_dll/ctocpp/domvisitor_ctocpp.h 18697@@ -1,4 +1,4 @@ 18698-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18699+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18700 // reserved. Use of this source code is governed by a BSD-style license that 18701 // can be found in the LICENSE file. 18702 // 18703@@ -9,7 +9,7 @@ 18704 // implementations. See the translator.README.txt file in the tools directory 18705 // for more information. 18706 // 18707-// $hash=950252a2903cd57d097fb9dcd4eacf0761914e7a$ 18708+// $hash=9f8a534b9feef5b972259d972bf30ad838e1a788$ 18709 // 18710 18711 #ifndef CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_ 18712diff --git a/src/cef/libcef_dll/ctocpp/download_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/download_handler_ctocpp.cc 18713index 981d59333f344..6da1c6e272d2c 18714--- a/src/cef/libcef_dll/ctocpp/download_handler_ctocpp.cc 18715+++ b/src/cef/libcef_dll/ctocpp/download_handler_ctocpp.cc 18716@@ -1,4 +1,4 @@ 18717-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18718+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18719 // reserved. Use of this source code is governed by a BSD-style license that 18720 // can be found in the LICENSE file. 18721 // 18722@@ -9,7 +9,7 @@ 18723 // implementations. See the translator.README.txt file in the tools directory 18724 // for more information. 18725 // 18726-// $hash=c4e47ffd023b528b9c5b658126f4a1d9fd05cf98$ 18727+// $hash=9fc07deae728fc443a569cc273456e5c5b98af4a$ 18728 // 18729 18730 #include "libcef_dll/ctocpp/download_handler_ctocpp.h" 18731diff --git a/src/cef/libcef_dll/ctocpp/download_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/download_handler_ctocpp.h 18732index a74b923cf19f8..71a554efaf5c9 18733--- a/src/cef/libcef_dll/ctocpp/download_handler_ctocpp.h 18734+++ b/src/cef/libcef_dll/ctocpp/download_handler_ctocpp.h 18735@@ -1,4 +1,4 @@ 18736-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18737+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18738 // reserved. Use of this source code is governed by a BSD-style license that 18739 // can be found in the LICENSE file. 18740 // 18741@@ -9,7 +9,7 @@ 18742 // implementations. See the translator.README.txt file in the tools directory 18743 // for more information. 18744 // 18745-// $hash=172a12dd9e68b65afff9eef5b93f0e480beaf904$ 18746+// $hash=2a8f0822ec7ffa38dc5a712c913a48adc216eead$ 18747 // 18748 18749 #ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_ 18750diff --git a/src/cef/libcef_dll/ctocpp/download_image_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/download_image_callback_ctocpp.cc 18751index 73a483afcb324..e9c3070ecfd63 18752--- a/src/cef/libcef_dll/ctocpp/download_image_callback_ctocpp.cc 18753+++ b/src/cef/libcef_dll/ctocpp/download_image_callback_ctocpp.cc 18754@@ -1,4 +1,4 @@ 18755-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18756+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18757 // reserved. Use of this source code is governed by a BSD-style license that 18758 // can be found in the LICENSE file. 18759 // 18760@@ -9,7 +9,7 @@ 18761 // implementations. See the translator.README.txt file in the tools directory 18762 // for more information. 18763 // 18764-// $hash=8568e306d0db860b1cd222f7c6dba344f349cb2d$ 18765+// $hash=b838fd3af2c144711044cae354ea86e336ce39a8$ 18766 // 18767 18768 #include "libcef_dll/ctocpp/download_image_callback_ctocpp.h" 18769diff --git a/src/cef/libcef_dll/ctocpp/download_image_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/download_image_callback_ctocpp.h 18770index ff4558668f291..5c7b7ccb064e2 18771--- a/src/cef/libcef_dll/ctocpp/download_image_callback_ctocpp.h 18772+++ b/src/cef/libcef_dll/ctocpp/download_image_callback_ctocpp.h 18773@@ -1,4 +1,4 @@ 18774-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18775+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18776 // reserved. Use of this source code is governed by a BSD-style license that 18777 // can be found in the LICENSE file. 18778 // 18779@@ -9,7 +9,7 @@ 18780 // implementations. See the translator.README.txt file in the tools directory 18781 // for more information. 18782 // 18783-// $hash=fa13abafcf97f6a71d08ca7ec67d45a71d636603$ 18784+// $hash=c281c09951a9b4f85556d0a9008b2524326254dd$ 18785 // 18786 18787 #ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_IMAGE_CALLBACK_CTOCPP_H_ 18788diff --git a/src/cef/libcef_dll/ctocpp/download_item_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/download_item_callback_ctocpp.cc 18789index 06081331571ee..e4b2d18132cde 18790--- a/src/cef/libcef_dll/ctocpp/download_item_callback_ctocpp.cc 18791+++ b/src/cef/libcef_dll/ctocpp/download_item_callback_ctocpp.cc 18792@@ -1,4 +1,4 @@ 18793-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18794+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18795 // reserved. Use of this source code is governed by a BSD-style license that 18796 // can be found in the LICENSE file. 18797 // 18798@@ -9,7 +9,7 @@ 18799 // implementations. See the translator.README.txt file in the tools directory 18800 // for more information. 18801 // 18802-// $hash=092e50c318b7d1c933ffb293ff062df17bfbb736$ 18803+// $hash=c7e4d15ade6e97ad9019c493941a06a5807b3e25$ 18804 // 18805 18806 #include "libcef_dll/ctocpp/download_item_callback_ctocpp.h" 18807diff --git a/src/cef/libcef_dll/ctocpp/download_item_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/download_item_callback_ctocpp.h 18808index 78eaf83b49c83..0f52a4120b1da 18809--- a/src/cef/libcef_dll/ctocpp/download_item_callback_ctocpp.h 18810+++ b/src/cef/libcef_dll/ctocpp/download_item_callback_ctocpp.h 18811@@ -1,4 +1,4 @@ 18812-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18813+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18814 // reserved. Use of this source code is governed by a BSD-style license that 18815 // can be found in the LICENSE file. 18816 // 18817@@ -9,7 +9,7 @@ 18818 // implementations. See the translator.README.txt file in the tools directory 18819 // for more information. 18820 // 18821-// $hash=dc38ebb20863207084498e6d14e8a5e8fde59eea$ 18822+// $hash=013ef6edbf734cdf4e6d00ba5b8be6c46284e2ca$ 18823 // 18824 18825 #ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CALLBACK_CTOCPP_H_ 18826diff --git a/src/cef/libcef_dll/ctocpp/download_item_ctocpp.cc b/src/cef/libcef_dll/ctocpp/download_item_ctocpp.cc 18827index 66f136e42f1cb..62e08e36a4ccf 18828--- a/src/cef/libcef_dll/ctocpp/download_item_ctocpp.cc 18829+++ b/src/cef/libcef_dll/ctocpp/download_item_ctocpp.cc 18830@@ -1,4 +1,4 @@ 18831-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18832+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18833 // reserved. Use of this source code is governed by a BSD-style license that 18834 // can be found in the LICENSE file. 18835 // 18836@@ -9,7 +9,7 @@ 18837 // implementations. See the translator.README.txt file in the tools directory 18838 // for more information. 18839 // 18840-// $hash=05c6527a7cdeb9495bca9da965956fb3006a7bdd$ 18841+// $hash=b99a604e59d6759cf17a05dbdb8e7dbf6080f43c$ 18842 // 18843 18844 #include "libcef_dll/ctocpp/download_item_ctocpp.h" 18845diff --git a/src/cef/libcef_dll/ctocpp/download_item_ctocpp.h b/src/cef/libcef_dll/ctocpp/download_item_ctocpp.h 18846index 07900a1549b1b..265c2e8a6a4d8 18847--- a/src/cef/libcef_dll/ctocpp/download_item_ctocpp.h 18848+++ b/src/cef/libcef_dll/ctocpp/download_item_ctocpp.h 18849@@ -1,4 +1,4 @@ 18850-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18851+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18852 // reserved. Use of this source code is governed by a BSD-style license that 18853 // can be found in the LICENSE file. 18854 // 18855@@ -9,7 +9,7 @@ 18856 // implementations. See the translator.README.txt file in the tools directory 18857 // for more information. 18858 // 18859-// $hash=800621bf853598aa11673f3c38e5f30858aa1ff1$ 18860+// $hash=30923eaf63fab5b36c95a1a8da4a2e229a794a86$ 18861 // 18862 18863 #ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_ 18864diff --git a/src/cef/libcef_dll/ctocpp/drag_data_ctocpp.cc b/src/cef/libcef_dll/ctocpp/drag_data_ctocpp.cc 18865index fc33a78e534a2..f6fb0e57c20c8 18866--- a/src/cef/libcef_dll/ctocpp/drag_data_ctocpp.cc 18867+++ b/src/cef/libcef_dll/ctocpp/drag_data_ctocpp.cc 18868@@ -1,4 +1,4 @@ 18869-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18870+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18871 // reserved. Use of this source code is governed by a BSD-style license that 18872 // can be found in the LICENSE file. 18873 // 18874@@ -9,7 +9,7 @@ 18875 // implementations. See the translator.README.txt file in the tools directory 18876 // for more information. 18877 // 18878-// $hash=57352ff85ca98fc34a0f2c58afbb1224ce1a1f09$ 18879+// $hash=a9a85999cc0792beae39e7b2796eedf435a88a1b$ 18880 // 18881 18882 #include "libcef_dll/ctocpp/drag_data_ctocpp.h" 18883diff --git a/src/cef/libcef_dll/ctocpp/drag_data_ctocpp.h b/src/cef/libcef_dll/ctocpp/drag_data_ctocpp.h 18884index 9b903e3b5cf52..c072f5811fec1 18885--- a/src/cef/libcef_dll/ctocpp/drag_data_ctocpp.h 18886+++ b/src/cef/libcef_dll/ctocpp/drag_data_ctocpp.h 18887@@ -1,4 +1,4 @@ 18888-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18889+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18890 // reserved. Use of this source code is governed by a BSD-style license that 18891 // can be found in the LICENSE file. 18892 // 18893@@ -9,7 +9,7 @@ 18894 // implementations. See the translator.README.txt file in the tools directory 18895 // for more information. 18896 // 18897-// $hash=0814e8ced30cbbd7c5867464550da973395b385b$ 18898+// $hash=acf7963e32fc361fd12874da55d86e4b0f9090d1$ 18899 // 18900 18901 #ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ 18902diff --git a/src/cef/libcef_dll/ctocpp/drag_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/drag_handler_ctocpp.cc 18903index ccf11d8fb5187..1109f595e3ce2 18904--- a/src/cef/libcef_dll/ctocpp/drag_handler_ctocpp.cc 18905+++ b/src/cef/libcef_dll/ctocpp/drag_handler_ctocpp.cc 18906@@ -1,4 +1,4 @@ 18907-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18908+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18909 // reserved. Use of this source code is governed by a BSD-style license that 18910 // can be found in the LICENSE file. 18911 // 18912@@ -9,7 +9,7 @@ 18913 // implementations. See the translator.README.txt file in the tools directory 18914 // for more information. 18915 // 18916-// $hash=83bbaf05bb87f369d819d4202110581c3bbe60a1$ 18917+// $hash=19cc3c5f296c806db31572ecc826788ba6d8e837$ 18918 // 18919 18920 #include "libcef_dll/ctocpp/drag_handler_ctocpp.h" 18921diff --git a/src/cef/libcef_dll/ctocpp/drag_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/drag_handler_ctocpp.h 18922index 47488db5e3326..153cf4982e17d 18923--- a/src/cef/libcef_dll/ctocpp/drag_handler_ctocpp.h 18924+++ b/src/cef/libcef_dll/ctocpp/drag_handler_ctocpp.h 18925@@ -1,4 +1,4 @@ 18926-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18927+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18928 // reserved. Use of this source code is governed by a BSD-style license that 18929 // can be found in the LICENSE file. 18930 // 18931@@ -9,7 +9,7 @@ 18932 // implementations. See the translator.README.txt file in the tools directory 18933 // for more information. 18934 // 18935-// $hash=87c40d04da449f1144f962dff8b3e0b5a1d70db7$ 18936+// $hash=a8523e82439b30828b0774d2eff240ea215b96d6$ 18937 // 18938 18939 #ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_ 18940diff --git a/src/cef/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc 18941index 9489292a433c0..523c04b3f5e12 18942--- a/src/cef/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc 18943+++ b/src/cef/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc 18944@@ -1,4 +1,4 @@ 18945-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18946+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18947 // reserved. Use of this source code is governed by a BSD-style license that 18948 // can be found in the LICENSE file. 18949 // 18950@@ -9,7 +9,7 @@ 18951 // implementations. See the translator.README.txt file in the tools directory 18952 // for more information. 18953 // 18954-// $hash=7f660f5500f6e299ef56d598c71ade363f5581b9$ 18955+// $hash=57b26c7374b16644439f70555241a061fa08c617$ 18956 // 18957 18958 #include "libcef_dll/ctocpp/end_tracing_callback_ctocpp.h" 18959diff --git a/src/cef/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h 18960index 81b82fc18031d..c915803e6a90b 18961--- a/src/cef/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h 18962+++ b/src/cef/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h 18963@@ -1,4 +1,4 @@ 18964-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18965+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18966 // reserved. Use of this source code is governed by a BSD-style license that 18967 // can be found in the LICENSE file. 18968 // 18969@@ -9,7 +9,7 @@ 18970 // implementations. See the translator.README.txt file in the tools directory 18971 // for more information. 18972 // 18973-// $hash=43c23da2432e1336afcd21889ae744bcc109e3ed$ 18974+// $hash=d798b3255a8ad2aea9d4afbe3492eaad538d8d0a$ 18975 // 18976 18977 #ifndef CEF_LIBCEF_DLL_CTOCPP_END_TRACING_CALLBACK_CTOCPP_H_ 18978diff --git a/src/cef/libcef_dll/ctocpp/extension_ctocpp.cc b/src/cef/libcef_dll/ctocpp/extension_ctocpp.cc 18979index a891cd0190f33..af426fa3b96ee 18980--- a/src/cef/libcef_dll/ctocpp/extension_ctocpp.cc 18981+++ b/src/cef/libcef_dll/ctocpp/extension_ctocpp.cc 18982@@ -1,4 +1,4 @@ 18983-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 18984+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 18985 // reserved. Use of this source code is governed by a BSD-style license that 18986 // can be found in the LICENSE file. 18987 // 18988@@ -9,7 +9,7 @@ 18989 // implementations. See the translator.README.txt file in the tools directory 18990 // for more information. 18991 // 18992-// $hash=de6b935b77168bd9b44f26643c510f360f8b6ebd$ 18993+// $hash=7bee2237c6ee537f23635d3fc6d1d62ca7eaf5c4$ 18994 // 18995 18996 #include "libcef_dll/ctocpp/extension_ctocpp.h" 18997diff --git a/src/cef/libcef_dll/ctocpp/extension_ctocpp.h b/src/cef/libcef_dll/ctocpp/extension_ctocpp.h 18998index 5192cba43ed57..b186810837867 18999--- a/src/cef/libcef_dll/ctocpp/extension_ctocpp.h 19000+++ b/src/cef/libcef_dll/ctocpp/extension_ctocpp.h 19001@@ -1,4 +1,4 @@ 19002-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19003+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19004 // reserved. Use of this source code is governed by a BSD-style license that 19005 // can be found in the LICENSE file. 19006 // 19007@@ -9,7 +9,7 @@ 19008 // implementations. See the translator.README.txt file in the tools directory 19009 // for more information. 19010 // 19011-// $hash=8e52bd30f4ec56b17b163c2daf4981ae55e72993$ 19012+// $hash=07a08b9dd260059e77dfb433f43686cbc5569bea$ 19013 // 19014 19015 #ifndef CEF_LIBCEF_DLL_CTOCPP_EXTENSION_CTOCPP_H_ 19016diff --git a/src/cef/libcef_dll/ctocpp/extension_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/extension_handler_ctocpp.cc 19017index b6826310cf3aa..0df341099031c 19018--- a/src/cef/libcef_dll/ctocpp/extension_handler_ctocpp.cc 19019+++ b/src/cef/libcef_dll/ctocpp/extension_handler_ctocpp.cc 19020@@ -1,4 +1,4 @@ 19021-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19022+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19023 // reserved. Use of this source code is governed by a BSD-style license that 19024 // can be found in the LICENSE file. 19025 // 19026@@ -9,7 +9,7 @@ 19027 // implementations. See the translator.README.txt file in the tools directory 19028 // for more information. 19029 // 19030-// $hash=befb9e9bd438e431bb55b7c67413d9d7a7b263f2$ 19031+// $hash=f2661cdc6ea68b840409c2fcf84fb31c25e0f1b8$ 19032 // 19033 19034 #include "libcef_dll/ctocpp/extension_handler_ctocpp.h" 19035diff --git a/src/cef/libcef_dll/ctocpp/extension_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/extension_handler_ctocpp.h 19036index b8bd638ea6643..eab84e7d05997 19037--- a/src/cef/libcef_dll/ctocpp/extension_handler_ctocpp.h 19038+++ b/src/cef/libcef_dll/ctocpp/extension_handler_ctocpp.h 19039@@ -1,4 +1,4 @@ 19040-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19041+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19042 // reserved. Use of this source code is governed by a BSD-style license that 19043 // can be found in the LICENSE file. 19044 // 19045@@ -9,7 +9,7 @@ 19046 // implementations. See the translator.README.txt file in the tools directory 19047 // for more information. 19048 // 19049-// $hash=147ef76bff631531a075ac9a2c823d3e9f84c409$ 19050+// $hash=5e432e7dd8e10b681b96bad3694ba2d0bf79fad6$ 19051 // 19052 19053 #ifndef CEF_LIBCEF_DLL_CTOCPP_EXTENSION_HANDLER_CTOCPP_H_ 19054diff --git a/src/cef/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc 19055index 3b90ba5a36928..229dfa874e1fa 19056--- a/src/cef/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc 19057+++ b/src/cef/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc 19058@@ -1,4 +1,4 @@ 19059-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19060+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19061 // reserved. Use of this source code is governed by a BSD-style license that 19062 // can be found in the LICENSE file. 19063 // 19064@@ -9,7 +9,7 @@ 19065 // implementations. See the translator.README.txt file in the tools directory 19066 // for more information. 19067 // 19068-// $hash=8fecb808fb6a84d630d1e8c5380a5ffd900b3654$ 19069+// $hash=ae1de0166e8b2c1f50d4ed5da69ae63a5bb8ebaf$ 19070 // 19071 19072 #include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h" 19073diff --git a/src/cef/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h 19074index f18ffeabcb4f7..b9eacd6adec9c 19075--- a/src/cef/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h 19076+++ b/src/cef/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h 19077@@ -1,4 +1,4 @@ 19078-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19079+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19080 // reserved. Use of this source code is governed by a BSD-style license that 19081 // can be found in the LICENSE file. 19082 // 19083@@ -9,7 +9,7 @@ 19084 // implementations. See the translator.README.txt file in the tools directory 19085 // for more information. 19086 // 19087-// $hash=d84ac439b3372160aa3886b28b3ff81e49f05a6d$ 19088+// $hash=190953cb1d900d253258bbbaae2220512509c3a9$ 19089 // 19090 19091 #ifndef CEF_LIBCEF_DLL_CTOCPP_FILE_DIALOG_CALLBACK_CTOCPP_H_ 19092diff --git a/src/cef/libcef_dll/ctocpp/find_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/find_handler_ctocpp.cc 19093index a12e2e089c172..47e3104366f05 19094--- a/src/cef/libcef_dll/ctocpp/find_handler_ctocpp.cc 19095+++ b/src/cef/libcef_dll/ctocpp/find_handler_ctocpp.cc 19096@@ -1,4 +1,4 @@ 19097-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19098+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19099 // reserved. Use of this source code is governed by a BSD-style license that 19100 // can be found in the LICENSE file. 19101 // 19102@@ -9,7 +9,7 @@ 19103 // implementations. See the translator.README.txt file in the tools directory 19104 // for more information. 19105 // 19106-// $hash=22af1e946668e89411cc87596b88c8a47880a78a$ 19107+// $hash=fbb70e4dd2af2d9cbc4377c0f62097933f26cea9$ 19108 // 19109 19110 #include "libcef_dll/ctocpp/find_handler_ctocpp.h" 19111diff --git a/src/cef/libcef_dll/ctocpp/find_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/find_handler_ctocpp.h 19112index ce9cffbae8051..98f75b2d51185 19113--- a/src/cef/libcef_dll/ctocpp/find_handler_ctocpp.h 19114+++ b/src/cef/libcef_dll/ctocpp/find_handler_ctocpp.h 19115@@ -1,4 +1,4 @@ 19116-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19117+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19118 // reserved. Use of this source code is governed by a BSD-style license that 19119 // can be found in the LICENSE file. 19120 // 19121@@ -9,7 +9,7 @@ 19122 // implementations. See the translator.README.txt file in the tools directory 19123 // for more information. 19124 // 19125-// $hash=d6ed1e4a341c9deecc217c49ecd52f444d18e236$ 19126+// $hash=8b86bd425ab5e9283d8fc8ac96b54740bf495cbb$ 19127 // 19128 19129 #ifndef CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_ 19130diff --git a/src/cef/libcef_dll/ctocpp/focus_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/focus_handler_ctocpp.cc 19131index 42f46d1d1257f..d12ed78ef9dbd 19132--- a/src/cef/libcef_dll/ctocpp/focus_handler_ctocpp.cc 19133+++ b/src/cef/libcef_dll/ctocpp/focus_handler_ctocpp.cc 19134@@ -1,4 +1,4 @@ 19135-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19136+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19137 // reserved. Use of this source code is governed by a BSD-style license that 19138 // can be found in the LICENSE file. 19139 // 19140@@ -9,7 +9,7 @@ 19141 // implementations. See the translator.README.txt file in the tools directory 19142 // for more information. 19143 // 19144-// $hash=fe5dc43b11c24ea7a1e9a1c31846cd433a425a48$ 19145+// $hash=adf870620ee814a41457a906d12265a23cd71bc1$ 19146 // 19147 19148 #include "libcef_dll/ctocpp/focus_handler_ctocpp.h" 19149diff --git a/src/cef/libcef_dll/ctocpp/focus_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/focus_handler_ctocpp.h 19150index 0c31eca72d2c9..6c0f92203cfd8 19151--- a/src/cef/libcef_dll/ctocpp/focus_handler_ctocpp.h 19152+++ b/src/cef/libcef_dll/ctocpp/focus_handler_ctocpp.h 19153@@ -1,4 +1,4 @@ 19154-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19155+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19156 // reserved. Use of this source code is governed by a BSD-style license that 19157 // can be found in the LICENSE file. 19158 // 19159@@ -9,7 +9,7 @@ 19160 // implementations. See the translator.README.txt file in the tools directory 19161 // for more information. 19162 // 19163-// $hash=7a41bfc84063e89ae6a9a02ad4252b6145e06d48$ 19164+// $hash=6a454cd9846e772380a72c5429d114f73cc3c1f5$ 19165 // 19166 19167 #ifndef CEF_LIBCEF_DLL_CTOCPP_FOCUS_HANDLER_CTOCPP_H_ 19168diff --git a/src/cef/libcef_dll/ctocpp/frame_ctocpp.cc b/src/cef/libcef_dll/ctocpp/frame_ctocpp.cc 19169index 68afd7bd7bab4..96c1964a67614 19170--- a/src/cef/libcef_dll/ctocpp/frame_ctocpp.cc 19171+++ b/src/cef/libcef_dll/ctocpp/frame_ctocpp.cc 19172@@ -1,4 +1,4 @@ 19173-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19174+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19175 // reserved. Use of this source code is governed by a BSD-style license that 19176 // can be found in the LICENSE file. 19177 // 19178@@ -9,11 +9,12 @@ 19179 // implementations. See the translator.README.txt file in the tools directory 19180 // for more information. 19181 // 19182-// $hash=58457cf1e745964f12e1266265fbc1fc1b0ebcd4$ 19183+// $hash=01a4bfc4420c23325504191dfa18a83e0e6d344f$ 19184 // 19185 19186 #include "libcef_dll/ctocpp/frame_ctocpp.h" 19187 #include "libcef_dll/cpptoc/domvisitor_cpptoc.h" 19188+#include "libcef_dll/cpptoc/get_images_callback_cpptoc.h" 19189 #include "libcef_dll/cpptoc/string_visitor_cpptoc.h" 19190 #include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h" 19191 #include "libcef_dll/ctocpp/browser_ctocpp.h" 19192@@ -464,6 +465,25 @@ void CefFrameCToCpp::SendProcessMessage(CefProcessId target_process, 19193 CefProcessMessageCToCpp::Unwrap(message)); 19194 } 19195 19196+NO_SANITIZE("cfi-icall") 19197+void CefFrameCToCpp::GetImages(CefRefPtr<CefGetImagesCallback> callback) { 19198+ shutdown_checker::AssertNotShutdown(); 19199+ 19200+ cef_frame_t* _struct = GetStruct(); 19201+ if (CEF_MEMBER_MISSING(_struct, get_images)) 19202+ return; 19203+ 19204+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 19205+ 19206+ // Verify param: callback; type: refptr_diff 19207+ DCHECK(callback.get()); 19208+ if (!callback.get()) 19209+ return; 19210+ 19211+ // Execute 19212+ _struct->get_images(_struct, CefGetImagesCallbackCppToC::Wrap(callback)); 19213+} 19214+ 19215 // CONSTRUCTOR - Do not edit by hand. 19216 19217 CefFrameCToCpp::CefFrameCToCpp() {} 19218diff --git a/src/cef/libcef_dll/ctocpp/frame_ctocpp.h b/src/cef/libcef_dll/ctocpp/frame_ctocpp.h 19219index e06add7ef560b..3fed19753264c 19220--- a/src/cef/libcef_dll/ctocpp/frame_ctocpp.h 19221+++ b/src/cef/libcef_dll/ctocpp/frame_ctocpp.h 19222@@ -1,4 +1,4 @@ 19223-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19224+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19225 // reserved. Use of this source code is governed by a BSD-style license that 19226 // can be found in the LICENSE file. 19227 // 19228@@ -9,7 +9,7 @@ 19229 // implementations. See the translator.README.txt file in the tools directory 19230 // for more information. 19231 // 19232-// $hash=32cd98f19dc4066d2a3bf801a79934d8a7270856$ 19233+// $hash=617aa71107c0089df6f4b832a7dd30c850abc171$ 19234 // 19235 19236 #ifndef CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ 19237@@ -71,6 +71,7 @@ class CefFrameCToCpp 19238 CefRefPtr<CefURLRequestClient> client) override; 19239 void SendProcessMessage(CefProcessId target_process, 19240 CefRefPtr<CefProcessMessage> message) override; 19241+ void GetImages(CefRefPtr<CefGetImagesCallback> callback) override; 19242 }; 19243 19244 #endif // CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ 19245diff --git a/src/cef/libcef_dll/ctocpp/frame_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/frame_handler_ctocpp.cc 19246index 370011e23830d..965b4a5dc577c 19247--- a/src/cef/libcef_dll/ctocpp/frame_handler_ctocpp.cc 19248+++ b/src/cef/libcef_dll/ctocpp/frame_handler_ctocpp.cc 19249@@ -1,4 +1,4 @@ 19250-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19251+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19252 // reserved. Use of this source code is governed by a BSD-style license that 19253 // can be found in the LICENSE file. 19254 // 19255@@ -9,7 +9,7 @@ 19256 // implementations. See the translator.README.txt file in the tools directory 19257 // for more information. 19258 // 19259-// $hash=2c1533712df282ba8ab092a2b42e69296c4d4771$ 19260+// $hash=805b22d1d623b4b536d2aa1f71ad05cc32e23fc2$ 19261 // 19262 19263 #include "libcef_dll/ctocpp/frame_handler_ctocpp.h" 19264diff --git a/src/cef/libcef_dll/ctocpp/frame_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/frame_handler_ctocpp.h 19265index d15a3f11990cd..be28fb88ae3ed 19266--- a/src/cef/libcef_dll/ctocpp/frame_handler_ctocpp.h 19267+++ b/src/cef/libcef_dll/ctocpp/frame_handler_ctocpp.h 19268@@ -1,4 +1,4 @@ 19269-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19270+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19271 // reserved. Use of this source code is governed by a BSD-style license that 19272 // can be found in the LICENSE file. 19273 // 19274@@ -9,7 +9,7 @@ 19275 // implementations. See the translator.README.txt file in the tools directory 19276 // for more information. 19277 // 19278-// $hash=caae9971af64aba87b484e5024603dd53c406df0$ 19279+// $hash=a1366f78329888eadf9121d7df819687d82a40c7$ 19280 // 19281 19282 #ifndef CEF_LIBCEF_DLL_CTOCPP_FRAME_HANDLER_CTOCPP_H_ 19283diff --git a/src/cef/libcef_dll/ctocpp/geolocation_acess_ctocpp.cc b/src/cef/libcef_dll/ctocpp/geolocation_acess_ctocpp.cc 19284index 8be91dcf1aac8..7fb2625b586f4 19285--- a/src/cef/libcef_dll/ctocpp/geolocation_acess_ctocpp.cc 19286+++ b/src/cef/libcef_dll/ctocpp/geolocation_acess_ctocpp.cc 19287@@ -1,4 +1,4 @@ 19288-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19289+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19290 // reserved. Use of this source code is governed by a BSD-style license that 19291 // can be found in the LICENSE file. 19292 // 19293@@ -9,7 +9,7 @@ 19294 // implementations. See the translator.README.txt file in the tools directory 19295 // for more information. 19296 // 19297-// $hash=3997657ceba0e011684fe481bdcc221dacd24369$ 19298+// $hash=dec8ab50f7084f8ea2bd48d74173c91134bc6d92$ 19299 // 19300 19301 #include "libcef_dll/ctocpp/geolocation_acess_ctocpp.h" 19302diff --git a/src/cef/libcef_dll/ctocpp/geolocation_acess_ctocpp.h b/src/cef/libcef_dll/ctocpp/geolocation_acess_ctocpp.h 19303index 0ab7994425856..ad8331787663d 19304--- a/src/cef/libcef_dll/ctocpp/geolocation_acess_ctocpp.h 19305+++ b/src/cef/libcef_dll/ctocpp/geolocation_acess_ctocpp.h 19306@@ -1,4 +1,4 @@ 19307-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19308+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19309 // reserved. Use of this source code is governed by a BSD-style license that 19310 // can be found in the LICENSE file. 19311 // 19312@@ -9,7 +9,7 @@ 19313 // implementations. See the translator.README.txt file in the tools directory 19314 // for more information. 19315 // 19316-// $hash=cfc297c4453970267ed52cecbc2469423ba4540f$ 19317+// $hash=d405020431caf6f891ba21f967b35cc9d08da93a$ 19318 // 19319 19320 #ifndef CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_ACESS_CTOCPP_H_ 19321diff --git a/src/cef/libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.cc 19322index faee8d512775d..5b0bbf37a1865 19323--- a/src/cef/libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.cc 19324+++ b/src/cef/libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.cc 19325@@ -1,4 +1,4 @@ 19326-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19327+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19328 // reserved. Use of this source code is governed by a BSD-style license that 19329 // can be found in the LICENSE file. 19330 // 19331@@ -9,7 +9,7 @@ 19332 // implementations. See the translator.README.txt file in the tools directory 19333 // for more information. 19334 // 19335-// $hash=2747a6d847a7abbc8adcde347308ff7826918884$ 19336+// $hash=de3ebaabf9a63c53433469d01241fd97197d7c60$ 19337 // 19338 19339 #include "libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h" 19340diff --git a/src/cef/libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h 19341index c0c5289edb963..afebabd4ca880 19342--- a/src/cef/libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h 19343+++ b/src/cef/libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h 19344@@ -1,4 +1,4 @@ 19345-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19346+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19347 // reserved. Use of this source code is governed by a BSD-style license that 19348 // can be found in the LICENSE file. 19349 // 19350@@ -9,7 +9,7 @@ 19351 // implementations. See the translator.README.txt file in the tools directory 19352 // for more information. 19353 // 19354-// $hash=f86929f0ec5dc6292a33e6f4d05b788e503bdad1$ 19355+// $hash=fd92d3650c1f3f04b84d9a0847631463b9e9ca2c$ 19356 // 19357 19358 #ifndef CEF_LIBCEF_DLL_CTOCPP_GET_EXTENSION_RESOURCE_CALLBACK_CTOCPP_H_ 19359diff --git a/src/cef/libcef_dll/ctocpp/get_images_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/get_images_callback_ctocpp.cc 19360new file mode 100644 19361index 0000000000000..39ad7b6b7807d 19362--- /dev/null 19363+++ b/src/cef/libcef_dll/ctocpp/get_images_callback_ctocpp.cc 19364@@ -0,0 +1,58 @@ 19365+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19366+// reserved. Use of this source code is governed by a BSD-style license that 19367+// can be found in the LICENSE file. 19368+// 19369+// --------------------------------------------------------------------------- 19370+// 19371+// This file was generated by the CEF translator tool. If making changes by 19372+// hand only do so within the body of existing method and function 19373+// implementations. See the translator.README.txt file in the tools directory 19374+// for more information. 19375+// 19376+// $hash=d5ba12d9fa862751e9c07d8b13afb7131c45c365$ 19377+// 19378+ 19379+#include "libcef_dll/ctocpp/get_images_callback_ctocpp.h" 19380+#include "libcef_dll/shutdown_checker.h" 19381+ 19382+// VIRTUAL METHODS - Body may be edited by hand. 19383+ 19384+NO_SANITIZE("cfi-icall") 19385+void CefGetImagesCallbackCToCpp::GetImages(bool response) { 19386+ shutdown_checker::AssertNotShutdown(); 19387+ 19388+ cef_get_images_callback_t* _struct = GetStruct(); 19389+ if (CEF_MEMBER_MISSING(_struct, get_images)) 19390+ return; 19391+ 19392+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 19393+ 19394+ // Execute 19395+ _struct->get_images(_struct, response); 19396+} 19397+ 19398+// CONSTRUCTOR - Do not edit by hand. 19399+ 19400+CefGetImagesCallbackCToCpp::CefGetImagesCallbackCToCpp() {} 19401+ 19402+// DESTRUCTOR - Do not edit by hand. 19403+ 19404+CefGetImagesCallbackCToCpp::~CefGetImagesCallbackCToCpp() { 19405+ shutdown_checker::AssertNotShutdown(); 19406+} 19407+ 19408+template <> 19409+cef_get_images_callback_t* CefCToCppRefCounted< 19410+ CefGetImagesCallbackCToCpp, 19411+ CefGetImagesCallback, 19412+ cef_get_images_callback_t>::UnwrapDerived(CefWrapperType type, 19413+ CefGetImagesCallback* c) { 19414+ NOTREACHED() << "Unexpected class type: " << type; 19415+ return nullptr; 19416+} 19417+ 19418+template <> 19419+CefWrapperType CefCToCppRefCounted<CefGetImagesCallbackCToCpp, 19420+ CefGetImagesCallback, 19421+ cef_get_images_callback_t>::kWrapperType = 19422+ WT_GET_IMAGES_CALLBACK; 19423diff --git a/src/cef/libcef_dll/ctocpp/get_images_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/get_images_callback_ctocpp.h 19424new file mode 100644 19425index 0000000000000..8d2c93af6fff1 19426--- /dev/null 19427+++ b/src/cef/libcef_dll/ctocpp/get_images_callback_ctocpp.h 19428@@ -0,0 +1,47 @@ 19429+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19430+// reserved. Use of this source code is governed by a BSD-style license that 19431+// can be found in the LICENSE file. 19432+// 19433+// --------------------------------------------------------------------------- 19434+// 19435+// This file was generated by the CEF translator tool. If making changes by 19436+// hand only do so within the body of existing method and function 19437+// implementations. See the translator.README.txt file in the tools directory 19438+// for more information. 19439+// 19440+// $hash=5569d10c20b8f19c8907133c7b21e293ebe9a2bd$ 19441+// 19442+ 19443+#ifndef CEF_LIBCEF_DLL_CTOCPP_GET_IMAGES_CALLBACK_CTOCPP_H_ 19444+#define CEF_LIBCEF_DLL_CTOCPP_GET_IMAGES_CALLBACK_CTOCPP_H_ 19445+#pragma once 19446+ 19447+#if !defined(BUILDING_CEF_SHARED) 19448+#error This file can be included DLL-side only 19449+#endif 19450+ 19451+#include "include/capi/cef_browser_capi.h" 19452+#include "include/capi/cef_frame_capi.h" 19453+#include "include/capi/cef_urlrequest_capi.h" 19454+#include "include/capi/cef_v8_capi.h" 19455+#include "include/cef_browser.h" 19456+#include "include/cef_frame.h" 19457+#include "include/cef_urlrequest.h" 19458+#include "include/cef_v8.h" 19459+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h" 19460+ 19461+// Wrap a C structure with a C++ class. 19462+// This class may be instantiated and accessed DLL-side only. 19463+class CefGetImagesCallbackCToCpp 19464+ : public CefCToCppRefCounted<CefGetImagesCallbackCToCpp, 19465+ CefGetImagesCallback, 19466+ cef_get_images_callback_t> { 19467+ public: 19468+ CefGetImagesCallbackCToCpp(); 19469+ virtual ~CefGetImagesCallbackCToCpp(); 19470+ 19471+ // CefGetImagesCallback methods. 19472+ void GetImages(bool response) override; 19473+}; 19474+ 19475+#endif // CEF_LIBCEF_DLL_CTOCPP_GET_IMAGES_CALLBACK_CTOCPP_H_ 19476diff --git a/src/cef/libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.cc 19477index 584b4d086729b..ea37e4f02f825 19478--- a/src/cef/libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.cc 19479+++ b/src/cef/libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.cc 19480@@ -1,4 +1,4 @@ 19481-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19482+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19483 // reserved. Use of this source code is governed by a BSD-style license that 19484 // can be found in the LICENSE file. 19485 // 19486@@ -9,7 +9,7 @@ 19487 // implementations. See the translator.README.txt file in the tools directory 19488 // for more information. 19489 // 19490-// $hash=070d1f0064cc25f4e3e13d9b2931a4ba1c8341d4$ 19491+// $hash=ffc3258b25dcb01dccb60e75f4d3f4b10e3224f8$ 19492 // 19493 19494 #include "libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.h" 19495diff --git a/src/cef/libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.h 19496index e8dc6f55ed97c..beab5ac78b35b 19497--- a/src/cef/libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.h 19498+++ b/src/cef/libcef_dll/ctocpp/get_origin_usage_or_quota_callback_ctocpp.h 19499@@ -1,4 +1,4 @@ 19500-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19501+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19502 // reserved. Use of this source code is governed by a BSD-style license that 19503 // can be found in the LICENSE file. 19504 // 19505@@ -9,7 +9,7 @@ 19506 // implementations. See the translator.README.txt file in the tools directory 19507 // for more information. 19508 // 19509-// $hash=128e55210f65fe29b0d2d84160fd2a9427bc6429$ 19510+// $hash=5a32e1b78e328e377d937e5f3d53afb869e153d9$ 19511 // 19512 19513 #ifndef CEF_LIBCEF_DLL_CTOCPP_GET_ORIGIN_USAGE_OR_QUOTA_CALLBACK_CTOCPP_H_ 19514diff --git a/src/cef/libcef_dll/ctocpp/get_origins_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/get_origins_callback_ctocpp.cc 19515index d0240181d2a5c..c834557b5914d 19516--- a/src/cef/libcef_dll/ctocpp/get_origins_callback_ctocpp.cc 19517+++ b/src/cef/libcef_dll/ctocpp/get_origins_callback_ctocpp.cc 19518@@ -1,4 +1,4 @@ 19519-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19520+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19521 // reserved. Use of this source code is governed by a BSD-style license that 19522 // can be found in the LICENSE file. 19523 // 19524@@ -9,7 +9,7 @@ 19525 // implementations. See the translator.README.txt file in the tools directory 19526 // for more information. 19527 // 19528-// $hash=c81051ff9ec3bd7b14f89c09f00eea970ed14b14$ 19529+// $hash=42082bd4962aa5bd8556918888da73635e4b36c5$ 19530 // 19531 19532 #include "libcef_dll/ctocpp/get_origins_callback_ctocpp.h" 19533diff --git a/src/cef/libcef_dll/ctocpp/get_origins_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/get_origins_callback_ctocpp.h 19534index b2edbb96bfd1d..0b85d91656698 19535--- a/src/cef/libcef_dll/ctocpp/get_origins_callback_ctocpp.h 19536+++ b/src/cef/libcef_dll/ctocpp/get_origins_callback_ctocpp.h 19537@@ -1,4 +1,4 @@ 19538-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19539+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19540 // reserved. Use of this source code is governed by a BSD-style license that 19541 // can be found in the LICENSE file. 19542 // 19543@@ -9,7 +9,7 @@ 19544 // implementations. See the translator.README.txt file in the tools directory 19545 // for more information. 19546 // 19547-// $hash=308fccc205e0e4ac146d6affbe48559dc1a27a5a$ 19548+// $hash=feb219add5c02bf679128a2abdf6817ba47c1b25$ 19549 // 19550 19551 #ifndef CEF_LIBCEF_DLL_CTOCPP_GET_ORIGINS_CALLBACK_CTOCPP_H_ 19552diff --git a/src/cef/libcef_dll/ctocpp/image_ctocpp.cc b/src/cef/libcef_dll/ctocpp/image_ctocpp.cc 19553index b766c79cd0f5c..ff463fbd992cf 19554--- a/src/cef/libcef_dll/ctocpp/image_ctocpp.cc 19555+++ b/src/cef/libcef_dll/ctocpp/image_ctocpp.cc 19556@@ -1,4 +1,4 @@ 19557-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19558+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19559 // reserved. Use of this source code is governed by a BSD-style license that 19560 // can be found in the LICENSE file. 19561 // 19562@@ -9,7 +9,7 @@ 19563 // implementations. See the translator.README.txt file in the tools directory 19564 // for more information. 19565 // 19566-// $hash=33aeaefa103664f5cead6898d2f957d8a9a97a92$ 19567+// $hash=a36ffa56b60291c4fb99a00413950d2315ddfc13$ 19568 // 19569 19570 #include "libcef_dll/ctocpp/image_ctocpp.h" 19571diff --git a/src/cef/libcef_dll/ctocpp/image_ctocpp.h b/src/cef/libcef_dll/ctocpp/image_ctocpp.h 19572index a234b97b6dcf3..8d635fddafb5d 19573--- a/src/cef/libcef_dll/ctocpp/image_ctocpp.h 19574+++ b/src/cef/libcef_dll/ctocpp/image_ctocpp.h 19575@@ -1,4 +1,4 @@ 19576-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19577+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19578 // reserved. Use of this source code is governed by a BSD-style license that 19579 // can be found in the LICENSE file. 19580 // 19581@@ -9,7 +9,7 @@ 19582 // implementations. See the translator.README.txt file in the tools directory 19583 // for more information. 19584 // 19585-// $hash=30ebbc8a004b2e371be3ee2bc305858c303f37fd$ 19586+// $hash=13afe421110fa07e94c1724d21302b018a71a633$ 19587 // 19588 19589 #ifndef CEF_LIBCEF_DLL_CTOCPP_IMAGE_CTOCPP_H_ 19590diff --git a/src/cef/libcef_dll/ctocpp/java_script_result_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/java_script_result_callback_ctocpp.cc 19591index 7e7ca331e740d..ee92ac0261b44 19592--- a/src/cef/libcef_dll/ctocpp/java_script_result_callback_ctocpp.cc 19593+++ b/src/cef/libcef_dll/ctocpp/java_script_result_callback_ctocpp.cc 19594@@ -1,4 +1,4 @@ 19595-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19596+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19597 // reserved. Use of this source code is governed by a BSD-style license that 19598 // can be found in the LICENSE file. 19599 // 19600@@ -9,7 +9,7 @@ 19601 // implementations. See the translator.README.txt file in the tools directory 19602 // for more information. 19603 // 19604-// $hash=d54225cb81f976412f5924f0342241e5e1c15604$ 19605+// $hash=ec746fb1184b4ac8124e90ddcb226035a06bfeb2$ 19606 // 19607 19608 #include "libcef_dll/ctocpp/java_script_result_callback_ctocpp.h" 19609diff --git a/src/cef/libcef_dll/ctocpp/java_script_result_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/java_script_result_callback_ctocpp.h 19610index b09edef38ac80..6cb9bf41c40d3 19611--- a/src/cef/libcef_dll/ctocpp/java_script_result_callback_ctocpp.h 19612+++ b/src/cef/libcef_dll/ctocpp/java_script_result_callback_ctocpp.h 19613@@ -1,4 +1,4 @@ 19614-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19615+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19616 // reserved. Use of this source code is governed by a BSD-style license that 19617 // can be found in the LICENSE file. 19618 // 19619@@ -9,7 +9,7 @@ 19620 // implementations. See the translator.README.txt file in the tools directory 19621 // for more information. 19622 // 19623-// $hash=2e761fc082e89fe46754e498234c96e873d519dc$ 19624+// $hash=17a3f0d9b77b19f01a9c147f900dc30016fa9e6e$ 19625 // 19626 19627 #ifndef CEF_LIBCEF_DLL_CTOCPP_JAVA_SCRIPT_RESULT_CALLBACK_CTOCPP_H_ 19628diff --git a/src/cef/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc 19629index ad5341aba0868..7f674dbf01a84 19630--- a/src/cef/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc 19631+++ b/src/cef/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc 19632@@ -1,4 +1,4 @@ 19633-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19634+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19635 // reserved. Use of this source code is governed by a BSD-style license that 19636 // can be found in the LICENSE file. 19637 // 19638@@ -9,7 +9,7 @@ 19639 // implementations. See the translator.README.txt file in the tools directory 19640 // for more information. 19641 // 19642-// $hash=8fa9cd400d5a9ecce87183cdbbee8673845b2228$ 19643+// $hash=a328cc485e128abc40fa08e69633f3d6be490ad0$ 19644 // 19645 19646 #include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h" 19647diff --git a/src/cef/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h 19648index b0a153944757e..a73df8ad32ea1 19649--- a/src/cef/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h 19650+++ b/src/cef/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h 19651@@ -1,4 +1,4 @@ 19652-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19653+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19654 // reserved. Use of this source code is governed by a BSD-style license that 19655 // can be found in the LICENSE file. 19656 // 19657@@ -9,7 +9,7 @@ 19658 // implementations. See the translator.README.txt file in the tools directory 19659 // for more information. 19660 // 19661-// $hash=8f505c768b727bd821e5d619227533b45fd6029b$ 19662+// $hash=5e91e201bc50f771d1ded89088fffcb0da8d34d7$ 19663 // 19664 19665 #ifndef CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_CALLBACK_CTOCPP_H_ 19666diff --git a/src/cef/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc 19667index 5293e9098def4..dba10ebfc9efe 19668--- a/src/cef/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc 19669+++ b/src/cef/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc 19670@@ -1,4 +1,4 @@ 19671-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19672+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19673 // reserved. Use of this source code is governed by a BSD-style license that 19674 // can be found in the LICENSE file. 19675 // 19676@@ -9,7 +9,7 @@ 19677 // implementations. See the translator.README.txt file in the tools directory 19678 // for more information. 19679 // 19680-// $hash=cf3f4ea060216018445b03ed1626f0698c01839b$ 19681+// $hash=c95849f5069d934dcca81e86a11e76931582a22b$ 19682 // 19683 19684 #include "libcef_dll/ctocpp/jsdialog_handler_ctocpp.h" 19685diff --git a/src/cef/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h 19686index 24f690eafad62..740330b350f62 19687--- a/src/cef/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h 19688+++ b/src/cef/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h 19689@@ -1,4 +1,4 @@ 19690-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19691+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19692 // reserved. Use of this source code is governed by a BSD-style license that 19693 // can be found in the LICENSE file. 19694 // 19695@@ -9,7 +9,7 @@ 19696 // implementations. See the translator.README.txt file in the tools directory 19697 // for more information. 19698 // 19699-// $hash=d486b4a8044df978ea21be7c6a48841ea48d7ad7$ 19700+// $hash=55b3bcb925cfaf44f79c0e03fc55878d748f55ce$ 19701 // 19702 19703 #ifndef CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_HANDLER_CTOCPP_H_ 19704diff --git a/src/cef/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc 19705index c9c167cbcccea..17ab239a26d1a 19706--- a/src/cef/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc 19707+++ b/src/cef/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc 19708@@ -1,4 +1,4 @@ 19709-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19710+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19711 // reserved. Use of this source code is governed by a BSD-style license that 19712 // can be found in the LICENSE file. 19713 // 19714@@ -9,7 +9,7 @@ 19715 // implementations. See the translator.README.txt file in the tools directory 19716 // for more information. 19717 // 19718-// $hash=d5ba873aeb2b734e753d47420bbe10e290e8658d$ 19719+// $hash=e6cddc00cf20f1abd640865c61a70dd54dc54d95$ 19720 // 19721 19722 #include "libcef_dll/ctocpp/keyboard_handler_ctocpp.h" 19723diff --git a/src/cef/libcef_dll/ctocpp/keyboard_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/keyboard_handler_ctocpp.h 19724index 48818cf81570a..65c681eba30ce 19725--- a/src/cef/libcef_dll/ctocpp/keyboard_handler_ctocpp.h 19726+++ b/src/cef/libcef_dll/ctocpp/keyboard_handler_ctocpp.h 19727@@ -1,4 +1,4 @@ 19728-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19729+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19730 // reserved. Use of this source code is governed by a BSD-style license that 19731 // can be found in the LICENSE file. 19732 // 19733@@ -9,7 +9,7 @@ 19734 // implementations. See the translator.README.txt file in the tools directory 19735 // for more information. 19736 // 19737-// $hash=ab70636733b9287db1e87f11f8c73610afa35337$ 19738+// $hash=a25080ecb1a098b748d8384bc5af591ea773deff$ 19739 // 19740 19741 #ifndef CEF_LIBCEF_DLL_CTOCPP_KEYBOARD_HANDLER_CTOCPP_H_ 19742diff --git a/src/cef/libcef_dll/ctocpp/life_span_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/life_span_handler_ctocpp.cc 19743index 3edea1aa767ae..5b9fe7e624a6d 19744--- a/src/cef/libcef_dll/ctocpp/life_span_handler_ctocpp.cc 19745+++ b/src/cef/libcef_dll/ctocpp/life_span_handler_ctocpp.cc 19746@@ -1,4 +1,4 @@ 19747-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19748+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19749 // reserved. Use of this source code is governed by a BSD-style license that 19750 // can be found in the LICENSE file. 19751 // 19752@@ -9,7 +9,7 @@ 19753 // implementations. See the translator.README.txt file in the tools directory 19754 // for more information. 19755 // 19756-// $hash=1c8c2d9b0eff1833a030f2e75515f7d7c60cada4$ 19757+// $hash=873c979fdd4b48e65375437e6a70a900de50840d$ 19758 // 19759 19760 #include "libcef_dll/ctocpp/life_span_handler_ctocpp.h" 19761diff --git a/src/cef/libcef_dll/ctocpp/life_span_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/life_span_handler_ctocpp.h 19762index d38e48851fd4d..9693f44b28917 19763--- a/src/cef/libcef_dll/ctocpp/life_span_handler_ctocpp.h 19764+++ b/src/cef/libcef_dll/ctocpp/life_span_handler_ctocpp.h 19765@@ -1,4 +1,4 @@ 19766-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19767+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19768 // reserved. Use of this source code is governed by a BSD-style license that 19769 // can be found in the LICENSE file. 19770 // 19771@@ -9,7 +9,7 @@ 19772 // implementations. See the translator.README.txt file in the tools directory 19773 // for more information. 19774 // 19775-// $hash=bfe3eba26049a9f15b7922d979395bc7b0ac4055$ 19776+// $hash=580b424b488c3974143484a05df444e91edfca5c$ 19777 // 19778 19779 #ifndef CEF_LIBCEF_DLL_CTOCPP_LIFE_SPAN_HANDLER_CTOCPP_H_ 19780diff --git a/src/cef/libcef_dll/ctocpp/list_value_ctocpp.cc b/src/cef/libcef_dll/ctocpp/list_value_ctocpp.cc 19781index 9194d1da62ba1..7fd13d4b65fce 19782--- a/src/cef/libcef_dll/ctocpp/list_value_ctocpp.cc 19783+++ b/src/cef/libcef_dll/ctocpp/list_value_ctocpp.cc 19784@@ -1,4 +1,4 @@ 19785-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19786+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19787 // reserved. Use of this source code is governed by a BSD-style license that 19788 // can be found in the LICENSE file. 19789 // 19790@@ -9,7 +9,7 @@ 19791 // implementations. See the translator.README.txt file in the tools directory 19792 // for more information. 19793 // 19794-// $hash=93f45c1e39dc2ba72a6cb44bc3d762f3870f2ef2$ 19795+// $hash=531f5719300934d7a039855559835715de9c765a$ 19796 // 19797 19798 #include "libcef_dll/ctocpp/list_value_ctocpp.h" 19799diff --git a/src/cef/libcef_dll/ctocpp/list_value_ctocpp.h b/src/cef/libcef_dll/ctocpp/list_value_ctocpp.h 19800index 0ebd5c120dfc9..d09dfb95d8c36 19801--- a/src/cef/libcef_dll/ctocpp/list_value_ctocpp.h 19802+++ b/src/cef/libcef_dll/ctocpp/list_value_ctocpp.h 19803@@ -1,4 +1,4 @@ 19804-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19805+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19806 // reserved. Use of this source code is governed by a BSD-style license that 19807 // can be found in the LICENSE file. 19808 // 19809@@ -9,7 +9,7 @@ 19810 // implementations. See the translator.README.txt file in the tools directory 19811 // for more information. 19812 // 19813-// $hash=2c6664443a865936b74fcea903f131011736d689$ 19814+// $hash=99b478c698261aa2aaf566b283fc938aacf3b2bf$ 19815 // 19816 19817 #ifndef CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_ 19818diff --git a/src/cef/libcef_dll/ctocpp/load_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/load_handler_ctocpp.cc 19819index 38699d565ae7c..e0bb3339e6564 19820--- a/src/cef/libcef_dll/ctocpp/load_handler_ctocpp.cc 19821+++ b/src/cef/libcef_dll/ctocpp/load_handler_ctocpp.cc 19822@@ -1,4 +1,4 @@ 19823-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19824+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19825 // reserved. Use of this source code is governed by a BSD-style license that 19826 // can be found in the LICENSE file. 19827 // 19828@@ -9,7 +9,7 @@ 19829 // implementations. See the translator.README.txt file in the tools directory 19830 // for more information. 19831 // 19832-// $hash=6be01fd6f359ff9960cea2ec422a489673b72bd6$ 19833+// $hash=710979924c3b6f6b6f1479dd75ed0e3c6dd02126$ 19834 // 19835 19836 #include "libcef_dll/ctocpp/load_handler_ctocpp.h" 19837diff --git a/src/cef/libcef_dll/ctocpp/load_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/load_handler_ctocpp.h 19838index c6795b684e589..cc7e15c185844 19839--- a/src/cef/libcef_dll/ctocpp/load_handler_ctocpp.h 19840+++ b/src/cef/libcef_dll/ctocpp/load_handler_ctocpp.h 19841@@ -1,4 +1,4 @@ 19842-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19843+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19844 // reserved. Use of this source code is governed by a BSD-style license that 19845 // can be found in the LICENSE file. 19846 // 19847@@ -9,7 +9,7 @@ 19848 // implementations. See the translator.README.txt file in the tools directory 19849 // for more information. 19850 // 19851-// $hash=1ae727d2a86654472d0312033fe4bd5df06556fe$ 19852+// $hash=12b88b0080727a6c6abf49b8ab17b8c18dc4e2f5$ 19853 // 19854 19855 #ifndef CEF_LIBCEF_DLL_CTOCPP_LOAD_HANDLER_CTOCPP_H_ 19856diff --git a/src/cef/libcef_dll/ctocpp/menu_model_ctocpp.cc b/src/cef/libcef_dll/ctocpp/menu_model_ctocpp.cc 19857index 7bf4664867269..ae5d52807f415 19858--- a/src/cef/libcef_dll/ctocpp/menu_model_ctocpp.cc 19859+++ b/src/cef/libcef_dll/ctocpp/menu_model_ctocpp.cc 19860@@ -1,4 +1,4 @@ 19861-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19862+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19863 // reserved. Use of this source code is governed by a BSD-style license that 19864 // can be found in the LICENSE file. 19865 // 19866@@ -9,7 +9,7 @@ 19867 // implementations. See the translator.README.txt file in the tools directory 19868 // for more information. 19869 // 19870-// $hash=16bf2696e26746eddb06f7c6003eec81d3fc1c23$ 19871+// $hash=042362d0195aca3ce86ceea3d2f42e34c1ad2f03$ 19872 // 19873 19874 #include "libcef_dll/ctocpp/menu_model_ctocpp.h" 19875diff --git a/src/cef/libcef_dll/ctocpp/menu_model_ctocpp.h b/src/cef/libcef_dll/ctocpp/menu_model_ctocpp.h 19876index edd9ef704f59f..10f461e4bdfb2 19877--- a/src/cef/libcef_dll/ctocpp/menu_model_ctocpp.h 19878+++ b/src/cef/libcef_dll/ctocpp/menu_model_ctocpp.h 19879@@ -1,4 +1,4 @@ 19880-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19881+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19882 // reserved. Use of this source code is governed by a BSD-style license that 19883 // can be found in the LICENSE file. 19884 // 19885@@ -9,7 +9,7 @@ 19886 // implementations. See the translator.README.txt file in the tools directory 19887 // for more information. 19888 // 19889-// $hash=4cb6a46bc1c8fa0d912c04d58a07afddd250d9b9$ 19890+// $hash=f7d0cf26743b3559f4e826452f3cb2c561dd75d1$ 19891 // 19892 19893 #ifndef CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_ 19894diff --git a/src/cef/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc 19895index 407692062f05a..b9f47a865277e 19896--- a/src/cef/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc 19897+++ b/src/cef/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc 19898@@ -1,4 +1,4 @@ 19899-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19900+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19901 // reserved. Use of this source code is governed by a BSD-style license that 19902 // can be found in the LICENSE file. 19903 // 19904@@ -9,7 +9,7 @@ 19905 // implementations. See the translator.README.txt file in the tools directory 19906 // for more information. 19907 // 19908-// $hash=09421982fe76735de86b67b1f7d8828a1cc36f6e$ 19909+// $hash=9445255c84ab78ee3b9b61cbd10abe5233f0688b$ 19910 // 19911 19912 #include "libcef_dll/ctocpp/menu_model_delegate_ctocpp.h" 19913diff --git a/src/cef/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h b/src/cef/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h 19914index 6fc6c44150a55..7762f4e8c32b3 19915--- a/src/cef/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h 19916+++ b/src/cef/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h 19917@@ -1,4 +1,4 @@ 19918-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19919+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19920 // reserved. Use of this source code is governed by a BSD-style license that 19921 // can be found in the LICENSE file. 19922 // 19923@@ -9,7 +9,7 @@ 19924 // implementations. See the translator.README.txt file in the tools directory 19925 // for more information. 19926 // 19927-// $hash=0dcaca76119b9db970c61a30ba90d841f2fb7186$ 19928+// $hash=6ac8a9990cf50850d8f8716096094d1180215be9$ 19929 // 19930 19931 #ifndef CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_DELEGATE_CTOCPP_H_ 19932diff --git a/src/cef/libcef_dll/ctocpp/navigation_entry_ctocpp.cc b/src/cef/libcef_dll/ctocpp/navigation_entry_ctocpp.cc 19933index a2a8f5937337f..98165391165e4 19934--- a/src/cef/libcef_dll/ctocpp/navigation_entry_ctocpp.cc 19935+++ b/src/cef/libcef_dll/ctocpp/navigation_entry_ctocpp.cc 19936@@ -1,4 +1,4 @@ 19937-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 19938+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 19939 // reserved. Use of this source code is governed by a BSD-style license that 19940 // can be found in the LICENSE file. 19941 // 19942@@ -9,7 +9,7 @@ 19943 // implementations. See the translator.README.txt file in the tools directory 19944 // for more information. 19945 // 19946-// $hash=824aed5040e7aee5f9bf2079eafdf6d612b7d2d0$ 19947+// $hash=47dac2be50c91cdd5c314a6d78a64ad90fa6b1a3$ 19948 // 19949 19950 #include "libcef_dll/ctocpp/navigation_entry_ctocpp.h" 19951@@ -108,7 +108,7 @@ NO_SANITIZE("cfi-icall") CefString CefNavigationEntryCToCpp::GetTitle() { 19952 19953 NO_SANITIZE("cfi-icall") 19954 CefNavigationEntry::TransitionType 19955-CefNavigationEntryCToCpp::GetTransitionType() { 19956+ CefNavigationEntryCToCpp::GetTransitionType() { 19957 shutdown_checker::AssertNotShutdown(); 19958 19959 cef_navigation_entry_t* _struct = GetStruct(); 19960@@ -189,6 +189,33 @@ CefRefPtr<CefSSLStatus> CefNavigationEntryCToCpp::GetSSLStatus() { 19961 return CefSSLStatusCToCpp::Wrap(_retval); 19962 } 19963 19964+NO_SANITIZE("cfi-icall") 19965+bool CefNavigationEntryCToCpp::GetFavicon(void** pixel_data, 19966+ int& color_type, 19967+ int& alpha_type, 19968+ int& pixel_width, 19969+ int& pixel_height) { 19970+ shutdown_checker::AssertNotShutdown(); 19971+ 19972+ cef_navigation_entry_t* _struct = GetStruct(); 19973+ if (CEF_MEMBER_MISSING(_struct, get_favicon)) 19974+ return false; 19975+ 19976+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 19977+ 19978+ // Verify param: pixel_data; type: simple_byaddr 19979+ DCHECK(pixel_data); 19980+ if (!pixel_data) 19981+ return false; 19982+ 19983+ // Execute 19984+ int _retval = _struct->get_favicon(_struct, pixel_data, &color_type, 19985+ &alpha_type, &pixel_width, &pixel_height); 19986+ 19987+ // Return type: bool 19988+ return _retval ? true : false; 19989+} 19990+ 19991 // CONSTRUCTOR - Do not edit by hand. 19992 19993 CefNavigationEntryCToCpp::CefNavigationEntryCToCpp() {} 19994diff --git a/src/cef/libcef_dll/ctocpp/navigation_entry_ctocpp.h b/src/cef/libcef_dll/ctocpp/navigation_entry_ctocpp.h 19995index ebaf7230e5b38..5e5e6ab1ecdbd 19996--- a/src/cef/libcef_dll/ctocpp/navigation_entry_ctocpp.h 19997+++ b/src/cef/libcef_dll/ctocpp/navigation_entry_ctocpp.h 19998@@ -1,4 +1,4 @@ 19999-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20000+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20001 // reserved. Use of this source code is governed by a BSD-style license that 20002 // can be found in the LICENSE file. 20003 // 20004@@ -9,7 +9,7 @@ 20005 // implementations. See the translator.README.txt file in the tools directory 20006 // for more information. 20007 // 20008-// $hash=6f127ca09c0419845e4fc6aec71b0bf9373ff290$ 20009+// $hash=a76314c5c7b7732bcc2b87df342cbdf78f36b8d6$ 20010 // 20011 20012 #ifndef CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_CTOCPP_H_ 20013@@ -45,6 +45,11 @@ class CefNavigationEntryCToCpp 20014 CefTime GetCompletionTime() override; 20015 int GetHttpStatusCode() override; 20016 CefRefPtr<CefSSLStatus> GetSSLStatus() override; 20017+ bool GetFavicon(void** pixel_data, 20018+ int& color_type, 20019+ int& alpha_type, 20020+ int& pixel_width, 20021+ int& pixel_height) override; 20022 }; 20023 20024 #endif // CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_CTOCPP_H_ 20025diff --git a/src/cef/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc b/src/cef/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc 20026index e9f156b0bdd53..66ecd5a110459 20027--- a/src/cef/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc 20028+++ b/src/cef/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc 20029@@ -1,4 +1,4 @@ 20030-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20031+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20032 // reserved. Use of this source code is governed by a BSD-style license that 20033 // can be found in the LICENSE file. 20034 // 20035@@ -9,7 +9,7 @@ 20036 // implementations. See the translator.README.txt file in the tools directory 20037 // for more information. 20038 // 20039-// $hash=057910c31bf56f3bb5def469638942802300c7d8$ 20040+// $hash=606184483441192c6ede228dd014eca4baa1e2ac$ 20041 // 20042 20043 #include "libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h" 20044diff --git a/src/cef/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h b/src/cef/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h 20045index f619bfc41d302..bcaa2c93351c0 20046--- a/src/cef/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h 20047+++ b/src/cef/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h 20048@@ -1,4 +1,4 @@ 20049-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20050+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20051 // reserved. Use of this source code is governed by a BSD-style license that 20052 // can be found in the LICENSE file. 20053 // 20054@@ -9,7 +9,7 @@ 20055 // implementations. See the translator.README.txt file in the tools directory 20056 // for more information. 20057 // 20058-// $hash=478d39c2ee5c0e2dcd0e0923d47b20bc05e8a3b7$ 20059+// $hash=3dbe29abccbfa1d1cc7014630bbe312d9de42ac8$ 20060 // 20061 20062 #ifndef CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_VISITOR_CTOCPP_H_ 20063diff --git a/src/cef/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc 20064index 74720e7fdc612..729223d21001d 20065--- a/src/cef/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc 20066+++ b/src/cef/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc 20067@@ -1,4 +1,4 @@ 20068-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20069+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20070 // reserved. Use of this source code is governed by a BSD-style license that 20071 // can be found in the LICENSE file. 20072 // 20073@@ -9,7 +9,7 @@ 20074 // implementations. See the translator.README.txt file in the tools directory 20075 // for more information. 20076 // 20077-// $hash=970ecf239bb133f5c62c372762e00ba913e492a2$ 20078+// $hash=296e7ba74dedad13612fea5dfbc09163a5b15872$ 20079 // 20080 20081 #include "libcef_dll/ctocpp/pdf_print_callback_ctocpp.h" 20082diff --git a/src/cef/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h 20083index ba235369d5b27..7abf1c11c7644 20084--- a/src/cef/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h 20085+++ b/src/cef/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h 20086@@ -1,4 +1,4 @@ 20087-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20088+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20089 // reserved. Use of this source code is governed by a BSD-style license that 20090 // can be found in the LICENSE file. 20091 // 20092@@ -9,7 +9,7 @@ 20093 // implementations. See the translator.README.txt file in the tools directory 20094 // for more information. 20095 // 20096-// $hash=6ec768e5cc0ef58766105bee24c3841367995a1e$ 20097+// $hash=0387fbd8f6ad59dac67959eeded82630a2bba935$ 20098 // 20099 20100 #ifndef CEF_LIBCEF_DLL_CTOCPP_PDF_PRINT_CALLBACK_CTOCPP_H_ 20101diff --git a/src/cef/libcef_dll/ctocpp/permission_request_ctocpp.cc b/src/cef/libcef_dll/ctocpp/permission_request_ctocpp.cc 20102index 1b5876d57113e..89e5e16bd7371 20103--- a/src/cef/libcef_dll/ctocpp/permission_request_ctocpp.cc 20104+++ b/src/cef/libcef_dll/ctocpp/permission_request_ctocpp.cc 20105@@ -1,4 +1,4 @@ 20106-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20107+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20108 // reserved. Use of this source code is governed by a BSD-style license that 20109 // can be found in the LICENSE file. 20110 // 20111@@ -9,7 +9,7 @@ 20112 // implementations. See the translator.README.txt file in the tools directory 20113 // for more information. 20114 // 20115-// $hash=12f03dbc264ba05a28f5dc8273117ca6c6c74b8b$ 20116+// $hash=62fd641af7c0e8767c775f3e5d0148103822d62d$ 20117 // 20118 20119 #include "libcef_dll/ctocpp/permission_request_ctocpp.h" 20120diff --git a/src/cef/libcef_dll/ctocpp/permission_request_ctocpp.h b/src/cef/libcef_dll/ctocpp/permission_request_ctocpp.h 20121index 2ed4bcebcafae..d5060b5b50160 20122--- a/src/cef/libcef_dll/ctocpp/permission_request_ctocpp.h 20123+++ b/src/cef/libcef_dll/ctocpp/permission_request_ctocpp.h 20124@@ -1,4 +1,4 @@ 20125-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20126+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20127 // reserved. Use of this source code is governed by a BSD-style license that 20128 // can be found in the LICENSE file. 20129 // 20130@@ -9,7 +9,7 @@ 20131 // implementations. See the translator.README.txt file in the tools directory 20132 // for more information. 20133 // 20134-// $hash=d3dcf1dc594597e78adcd93c64e185a6223992d1$ 20135+// $hash=8600f1096fac8d37c3506fce7d76157ae067b427$ 20136 // 20137 20138 #ifndef CEF_LIBCEF_DLL_CTOCPP_PERMISSION_REQUEST_CTOCPP_H_ 20139diff --git a/src/cef/libcef_dll/ctocpp/post_data_ctocpp.cc b/src/cef/libcef_dll/ctocpp/post_data_ctocpp.cc 20140index 123d5c364a8f0..cdf909ef85077 20141--- a/src/cef/libcef_dll/ctocpp/post_data_ctocpp.cc 20142+++ b/src/cef/libcef_dll/ctocpp/post_data_ctocpp.cc 20143@@ -1,4 +1,4 @@ 20144-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20145+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20146 // reserved. Use of this source code is governed by a BSD-style license that 20147 // can be found in the LICENSE file. 20148 // 20149@@ -9,7 +9,7 @@ 20150 // implementations. See the translator.README.txt file in the tools directory 20151 // for more information. 20152 // 20153-// $hash=7a24d4020666f0277e76e190926df2081637a174$ 20154+// $hash=16d0f97a19f6cab36f8a40bb7a5db900bc74c872$ 20155 // 20156 20157 #include "libcef_dll/ctocpp/post_data_ctocpp.h" 20158diff --git a/src/cef/libcef_dll/ctocpp/post_data_ctocpp.h b/src/cef/libcef_dll/ctocpp/post_data_ctocpp.h 20159index 068d9d84c5b82..7666035c6a12d 20160--- a/src/cef/libcef_dll/ctocpp/post_data_ctocpp.h 20161+++ b/src/cef/libcef_dll/ctocpp/post_data_ctocpp.h 20162@@ -1,4 +1,4 @@ 20163-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20164+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20165 // reserved. Use of this source code is governed by a BSD-style license that 20166 // can be found in the LICENSE file. 20167 // 20168@@ -9,7 +9,7 @@ 20169 // implementations. See the translator.README.txt file in the tools directory 20170 // for more information. 20171 // 20172-// $hash=7f744704ab0c6d50b814469b168b610f74a118d8$ 20173+// $hash=e70d58d7c779528d03b49ead50c162ebf0eb0ca7$ 20174 // 20175 20176 #ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ 20177diff --git a/src/cef/libcef_dll/ctocpp/post_data_element_ctocpp.cc b/src/cef/libcef_dll/ctocpp/post_data_element_ctocpp.cc 20178index ac01ab2ad7355..0bf45f1027433 20179--- a/src/cef/libcef_dll/ctocpp/post_data_element_ctocpp.cc 20180+++ b/src/cef/libcef_dll/ctocpp/post_data_element_ctocpp.cc 20181@@ -1,4 +1,4 @@ 20182-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20183+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20184 // reserved. Use of this source code is governed by a BSD-style license that 20185 // can be found in the LICENSE file. 20186 // 20187@@ -9,7 +9,7 @@ 20188 // implementations. See the translator.README.txt file in the tools directory 20189 // for more information. 20190 // 20191-// $hash=027842b89846614ba6d0e3056db65004bc3a6b06$ 20192+// $hash=21bd5d7adae7aad41bf500eb30bfb917f33f1750$ 20193 // 20194 20195 #include "libcef_dll/ctocpp/post_data_element_ctocpp.h" 20196diff --git a/src/cef/libcef_dll/ctocpp/post_data_element_ctocpp.h b/src/cef/libcef_dll/ctocpp/post_data_element_ctocpp.h 20197index ac2442ccb16a5..e422be541b1a3 20198--- a/src/cef/libcef_dll/ctocpp/post_data_element_ctocpp.h 20199+++ b/src/cef/libcef_dll/ctocpp/post_data_element_ctocpp.h 20200@@ -1,4 +1,4 @@ 20201-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20202+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20203 // reserved. Use of this source code is governed by a BSD-style license that 20204 // can be found in the LICENSE file. 20205 // 20206@@ -9,7 +9,7 @@ 20207 // implementations. See the translator.README.txt file in the tools directory 20208 // for more information. 20209 // 20210-// $hash=7f8d7ce807aae88cd94eb0bf8fed88208b052dce$ 20211+// $hash=a81732545889a9d401edb7f5540e0762bb787526$ 20212 // 20213 20214 #ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ 20215diff --git a/src/cef/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc 20216index 27c6e0b33145c..6bd053f64753f 20217--- a/src/cef/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc 20218+++ b/src/cef/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc 20219@@ -1,4 +1,4 @@ 20220-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20221+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20222 // reserved. Use of this source code is governed by a BSD-style license that 20223 // can be found in the LICENSE file. 20224 // 20225@@ -9,7 +9,7 @@ 20226 // implementations. See the translator.README.txt file in the tools directory 20227 // for more information. 20228 // 20229-// $hash=2e3cda6569368540518b84119205e1e5f6e0d36b$ 20230+// $hash=a251f867872c76ea64f247d745b7eb895f24e477$ 20231 // 20232 20233 #include "libcef_dll/ctocpp/print_dialog_callback_ctocpp.h" 20234diff --git a/src/cef/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h 20235index ffba4100bc864..cf5e9cbe36f38 20236--- a/src/cef/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h 20237+++ b/src/cef/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h 20238@@ -1,4 +1,4 @@ 20239-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20240+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20241 // reserved. Use of this source code is governed by a BSD-style license that 20242 // can be found in the LICENSE file. 20243 // 20244@@ -9,7 +9,7 @@ 20245 // implementations. See the translator.README.txt file in the tools directory 20246 // for more information. 20247 // 20248-// $hash=7d1df66731aeda9ede696254998eb6531a5d3531$ 20249+// $hash=7c49e07c9ba8bfc8f7620952b19140828a3bf011$ 20250 // 20251 20252 #ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_DIALOG_CALLBACK_CTOCPP_H_ 20253diff --git a/src/cef/libcef_dll/ctocpp/print_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/print_handler_ctocpp.cc 20254index b5f02d80bff8b..5bfb4c37d601e 20255--- a/src/cef/libcef_dll/ctocpp/print_handler_ctocpp.cc 20256+++ b/src/cef/libcef_dll/ctocpp/print_handler_ctocpp.cc 20257@@ -1,4 +1,4 @@ 20258-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20259+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20260 // reserved. Use of this source code is governed by a BSD-style license that 20261 // can be found in the LICENSE file. 20262 // 20263@@ -9,7 +9,7 @@ 20264 // implementations. See the translator.README.txt file in the tools directory 20265 // for more information. 20266 // 20267-// $hash=f81708853d5cb6ee2fb397f401787068b722b060$ 20268+// $hash=d1160c71777c77bffaaef2db26b53d3a4ab269b3$ 20269 // 20270 20271 #include "libcef_dll/ctocpp/print_handler_ctocpp.h" 20272diff --git a/src/cef/libcef_dll/ctocpp/print_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/print_handler_ctocpp.h 20273index e82154e3e7c62..5e7722f26575b 20274--- a/src/cef/libcef_dll/ctocpp/print_handler_ctocpp.h 20275+++ b/src/cef/libcef_dll/ctocpp/print_handler_ctocpp.h 20276@@ -1,4 +1,4 @@ 20277-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20278+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20279 // reserved. Use of this source code is governed by a BSD-style license that 20280 // can be found in the LICENSE file. 20281 // 20282@@ -9,7 +9,7 @@ 20283 // implementations. See the translator.README.txt file in the tools directory 20284 // for more information. 20285 // 20286-// $hash=861bf98595a13f8c42a23b5742471332c066b57a$ 20287+// $hash=b1d082ab9bea88f46372a371b68b9b4c25a96ca2$ 20288 // 20289 20290 #ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_HANDLER_CTOCPP_H_ 20291diff --git a/src/cef/libcef_dll/ctocpp/print_job_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/print_job_callback_ctocpp.cc 20292index 072666c9d1f8a..3069f55a35a3d 20293--- a/src/cef/libcef_dll/ctocpp/print_job_callback_ctocpp.cc 20294+++ b/src/cef/libcef_dll/ctocpp/print_job_callback_ctocpp.cc 20295@@ -1,4 +1,4 @@ 20296-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20297+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20298 // reserved. Use of this source code is governed by a BSD-style license that 20299 // can be found in the LICENSE file. 20300 // 20301@@ -9,7 +9,7 @@ 20302 // implementations. See the translator.README.txt file in the tools directory 20303 // for more information. 20304 // 20305-// $hash=c952b7985eb56fd18e552e4905a5563380277bac$ 20306+// $hash=a3bb609c6cbc5d38d8359a427664780c8e8a5625$ 20307 // 20308 20309 #include "libcef_dll/ctocpp/print_job_callback_ctocpp.h" 20310diff --git a/src/cef/libcef_dll/ctocpp/print_job_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/print_job_callback_ctocpp.h 20311index 29e7d30de0968..6f7710e1bf53e 20312--- a/src/cef/libcef_dll/ctocpp/print_job_callback_ctocpp.h 20313+++ b/src/cef/libcef_dll/ctocpp/print_job_callback_ctocpp.h 20314@@ -1,4 +1,4 @@ 20315-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20316+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20317 // reserved. Use of this source code is governed by a BSD-style license that 20318 // can be found in the LICENSE file. 20319 // 20320@@ -9,7 +9,7 @@ 20321 // implementations. See the translator.README.txt file in the tools directory 20322 // for more information. 20323 // 20324-// $hash=6e70e242c6ffef77f0c3ceeeb5773f0b8037395e$ 20325+// $hash=6ac2e8d5475582b66e40e297b192bdbdc8acbeed$ 20326 // 20327 20328 #ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_JOB_CALLBACK_CTOCPP_H_ 20329diff --git a/src/cef/libcef_dll/ctocpp/print_settings_ctocpp.cc b/src/cef/libcef_dll/ctocpp/print_settings_ctocpp.cc 20330index 04880402b9982..ce25e243fa934 20331--- a/src/cef/libcef_dll/ctocpp/print_settings_ctocpp.cc 20332+++ b/src/cef/libcef_dll/ctocpp/print_settings_ctocpp.cc 20333@@ -1,4 +1,4 @@ 20334-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20335+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20336 // reserved. Use of this source code is governed by a BSD-style license that 20337 // can be found in the LICENSE file. 20338 // 20339@@ -9,7 +9,7 @@ 20340 // implementations. See the translator.README.txt file in the tools directory 20341 // for more information. 20342 // 20343-// $hash=70eeeda85eb67d546066854051f2f921fadcca18$ 20344+// $hash=953bf2909c532598f70a4f7ad09c16d774dad5f8$ 20345 // 20346 20347 #include "libcef_dll/ctocpp/print_settings_ctocpp.h" 20348diff --git a/src/cef/libcef_dll/ctocpp/print_settings_ctocpp.h b/src/cef/libcef_dll/ctocpp/print_settings_ctocpp.h 20349index 5ce656192a282..3c23fc18fd3be 20350--- a/src/cef/libcef_dll/ctocpp/print_settings_ctocpp.h 20351+++ b/src/cef/libcef_dll/ctocpp/print_settings_ctocpp.h 20352@@ -1,4 +1,4 @@ 20353-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20354+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20355 // reserved. Use of this source code is governed by a BSD-style license that 20356 // can be found in the LICENSE file. 20357 // 20358@@ -9,7 +9,7 @@ 20359 // implementations. See the translator.README.txt file in the tools directory 20360 // for more information. 20361 // 20362-// $hash=e74e75adf68001ef29e441fa1bbac27e3aa5c3c1$ 20363+// $hash=75238f577e768438cead970fa7362e4b04856894$ 20364 // 20365 20366 #ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_SETTINGS_CTOCPP_H_ 20367diff --git a/src/cef/libcef_dll/ctocpp/process_message_ctocpp.cc b/src/cef/libcef_dll/ctocpp/process_message_ctocpp.cc 20368index afa319731a6c6..3e3aa68804d74 20369--- a/src/cef/libcef_dll/ctocpp/process_message_ctocpp.cc 20370+++ b/src/cef/libcef_dll/ctocpp/process_message_ctocpp.cc 20371@@ -1,4 +1,4 @@ 20372-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20373+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20374 // reserved. Use of this source code is governed by a BSD-style license that 20375 // can be found in the LICENSE file. 20376 // 20377@@ -9,7 +9,7 @@ 20378 // implementations. See the translator.README.txt file in the tools directory 20379 // for more information. 20380 // 20381-// $hash=7ab779c6c98a1bd2385f14d514304a28ef58717f$ 20382+// $hash=c68e571b03dfbb3e50a989f5e8abde1fe21837e2$ 20383 // 20384 20385 #include "libcef_dll/ctocpp/process_message_ctocpp.h" 20386diff --git a/src/cef/libcef_dll/ctocpp/process_message_ctocpp.h b/src/cef/libcef_dll/ctocpp/process_message_ctocpp.h 20387index 1b786f5b2ce1e..db214ff09789a 20388--- a/src/cef/libcef_dll/ctocpp/process_message_ctocpp.h 20389+++ b/src/cef/libcef_dll/ctocpp/process_message_ctocpp.h 20390@@ -1,4 +1,4 @@ 20391-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20392+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20393 // reserved. Use of this source code is governed by a BSD-style license that 20394 // can be found in the LICENSE file. 20395 // 20396@@ -9,7 +9,7 @@ 20397 // implementations. See the translator.README.txt file in the tools directory 20398 // for more information. 20399 // 20400-// $hash=39bf2321370b32cf02bf502529568e935b303550$ 20401+// $hash=ce134ef72dcd3df8303e202db7489cc2920a3ad2$ 20402 // 20403 20404 #ifndef CEF_LIBCEF_DLL_CTOCPP_PROCESS_MESSAGE_CTOCPP_H_ 20405diff --git a/src/cef/libcef_dll/ctocpp/read_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/read_handler_ctocpp.cc 20406index 858a1cc301c06..e05dfadd698c0 20407--- a/src/cef/libcef_dll/ctocpp/read_handler_ctocpp.cc 20408+++ b/src/cef/libcef_dll/ctocpp/read_handler_ctocpp.cc 20409@@ -1,4 +1,4 @@ 20410-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20411+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20412 // reserved. Use of this source code is governed by a BSD-style license that 20413 // can be found in the LICENSE file. 20414 // 20415@@ -9,7 +9,7 @@ 20416 // implementations. See the translator.README.txt file in the tools directory 20417 // for more information. 20418 // 20419-// $hash=0332caff5ce6230d2cb2d7663fc0bbfac8e45069$ 20420+// $hash=a0abf42da8392486549644489052218f494ae8dd$ 20421 // 20422 20423 #include "libcef_dll/ctocpp/read_handler_ctocpp.h" 20424diff --git a/src/cef/libcef_dll/ctocpp/read_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/read_handler_ctocpp.h 20425index a1b88e03fb474..546462a4dcf88 20426--- a/src/cef/libcef_dll/ctocpp/read_handler_ctocpp.h 20427+++ b/src/cef/libcef_dll/ctocpp/read_handler_ctocpp.h 20428@@ -1,4 +1,4 @@ 20429-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20430+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20431 // reserved. Use of this source code is governed by a BSD-style license that 20432 // can be found in the LICENSE file. 20433 // 20434@@ -9,7 +9,7 @@ 20435 // implementations. See the translator.README.txt file in the tools directory 20436 // for more information. 20437 // 20438-// $hash=f3d43ae771f8e17084fd9397fd4e2bef9471ea73$ 20439+// $hash=d4b05ef2f8edd18da8b5ed9c5d4afe8162f81069$ 20440 // 20441 20442 #ifndef CEF_LIBCEF_DLL_CTOCPP_READ_HANDLER_CTOCPP_H_ 20443diff --git a/src/cef/libcef_dll/ctocpp/registration_ctocpp.cc b/src/cef/libcef_dll/ctocpp/registration_ctocpp.cc 20444index fad182ef7bc54..a0b5a00b4f57f 20445--- a/src/cef/libcef_dll/ctocpp/registration_ctocpp.cc 20446+++ b/src/cef/libcef_dll/ctocpp/registration_ctocpp.cc 20447@@ -1,4 +1,4 @@ 20448-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20449+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20450 // reserved. Use of this source code is governed by a BSD-style license that 20451 // can be found in the LICENSE file. 20452 // 20453@@ -9,7 +9,7 @@ 20454 // implementations. See the translator.README.txt file in the tools directory 20455 // for more information. 20456 // 20457-// $hash=36f275457b15025ac7b979eca3179cd127f45ffb$ 20458+// $hash=e1eade4ceaefc7079366e8b0d29d499590273e8c$ 20459 // 20460 20461 #include "libcef_dll/ctocpp/registration_ctocpp.h" 20462diff --git a/src/cef/libcef_dll/ctocpp/registration_ctocpp.h b/src/cef/libcef_dll/ctocpp/registration_ctocpp.h 20463index 00c48e0213577..b60a76fd07dea 20464--- a/src/cef/libcef_dll/ctocpp/registration_ctocpp.h 20465+++ b/src/cef/libcef_dll/ctocpp/registration_ctocpp.h 20466@@ -1,4 +1,4 @@ 20467-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20468+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20469 // reserved. Use of this source code is governed by a BSD-style license that 20470 // can be found in the LICENSE file. 20471 // 20472@@ -9,7 +9,7 @@ 20473 // implementations. See the translator.README.txt file in the tools directory 20474 // for more information. 20475 // 20476-// $hash=84ca9a25ae345642994cc1b44cd71f90e7406f19$ 20477+// $hash=8b9f37f2e0d395e737bc158d7d4bfb5f5e85e5c4$ 20478 // 20479 20480 #ifndef CEF_LIBCEF_DLL_CTOCPP_REGISTRATION_CTOCPP_H_ 20481diff --git a/src/cef/libcef_dll/ctocpp/render_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/render_handler_ctocpp.cc 20482index 0f7259200dd2d..52053ab91a14c 20483--- a/src/cef/libcef_dll/ctocpp/render_handler_ctocpp.cc 20484+++ b/src/cef/libcef_dll/ctocpp/render_handler_ctocpp.cc 20485@@ -1,4 +1,4 @@ 20486-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20487+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20488 // reserved. Use of this source code is governed by a BSD-style license that 20489 // can be found in the LICENSE file. 20490 // 20491@@ -9,7 +9,7 @@ 20492 // implementations. See the translator.README.txt file in the tools directory 20493 // for more information. 20494 // 20495-// $hash=4542e0e52791a8d283c997922779ab33d40ad54c$ 20496+// $hash=f2f817e11a4ff708bf3e1be68b75527681387d39$ 20497 // 20498 20499 #include "libcef_dll/ctocpp/render_handler_ctocpp.h" 20500diff --git a/src/cef/libcef_dll/ctocpp/render_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/render_handler_ctocpp.h 20501index 66d289eea55e9..4b830fb9b0bb6 20502--- a/src/cef/libcef_dll/ctocpp/render_handler_ctocpp.h 20503+++ b/src/cef/libcef_dll/ctocpp/render_handler_ctocpp.h 20504@@ -1,4 +1,4 @@ 20505-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20506+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20507 // reserved. Use of this source code is governed by a BSD-style license that 20508 // can be found in the LICENSE file. 20509 // 20510@@ -9,7 +9,7 @@ 20511 // implementations. See the translator.README.txt file in the tools directory 20512 // for more information. 20513 // 20514-// $hash=f70633e6b53acb79709008ad6aaa692c77f7d136$ 20515+// $hash=db2cc3ecd0fa1658ae8ce19b1347175a1902daec$ 20516 // 20517 20518 #ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_ 20519diff --git a/src/cef/libcef_dll/ctocpp/render_process_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/render_process_handler_ctocpp.cc 20520index c5c5cc3b2649c..af212bedabe0b 20521--- a/src/cef/libcef_dll/ctocpp/render_process_handler_ctocpp.cc 20522+++ b/src/cef/libcef_dll/ctocpp/render_process_handler_ctocpp.cc 20523@@ -1,4 +1,4 @@ 20524-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20525+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20526 // reserved. Use of this source code is governed by a BSD-style license that 20527 // can be found in the LICENSE file. 20528 // 20529@@ -9,7 +9,7 @@ 20530 // implementations. See the translator.README.txt file in the tools directory 20531 // for more information. 20532 // 20533-// $hash=a75829d0f47e772086a586f213cfdfe54ff5554c$ 20534+// $hash=7e1d2051125a7c9845153bb1ed978e92c00d101b$ 20535 // 20536 20537 #include "libcef_dll/ctocpp/render_process_handler_ctocpp.h" 20538diff --git a/src/cef/libcef_dll/ctocpp/render_process_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/render_process_handler_ctocpp.h 20539index b587be7aa25d2..dcf49a67e967b 20540--- a/src/cef/libcef_dll/ctocpp/render_process_handler_ctocpp.h 20541+++ b/src/cef/libcef_dll/ctocpp/render_process_handler_ctocpp.h 20542@@ -1,4 +1,4 @@ 20543-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20544+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20545 // reserved. Use of this source code is governed by a BSD-style license that 20546 // can be found in the LICENSE file. 20547 // 20548@@ -9,7 +9,7 @@ 20549 // implementations. See the translator.README.txt file in the tools directory 20550 // for more information. 20551 // 20552-// $hash=c87a2a5637615d6b7994f80cef17651c73cdb8e2$ 20553+// $hash=1e5030658a4775df8e1eb8bbd54c43cdacf4572a$ 20554 // 20555 20556 #ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_PROCESS_HANDLER_CTOCPP_H_ 20557diff --git a/src/cef/libcef_dll/ctocpp/request_context_ctocpp.cc b/src/cef/libcef_dll/ctocpp/request_context_ctocpp.cc 20558index 50855c12ec282..579120bf14025 20559--- a/src/cef/libcef_dll/ctocpp/request_context_ctocpp.cc 20560+++ b/src/cef/libcef_dll/ctocpp/request_context_ctocpp.cc 20561@@ -1,4 +1,4 @@ 20562-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20563+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20564 // reserved. Use of this source code is governed by a BSD-style license that 20565 // can be found in the LICENSE file. 20566 // 20567@@ -9,7 +9,7 @@ 20568 // implementations. See the translator.README.txt file in the tools directory 20569 // for more information. 20570 // 20571-// $hash=30c4985c5d42f2b4409c2650ded5265209f210f4$ 20572+// $hash=dc0625b92b6258aa5bad4b5407431a7fff11124b$ 20573 // 20574 20575 #include "libcef_dll/ctocpp/request_context_ctocpp.h" 20576@@ -22,7 +22,6 @@ 20577 #include "libcef_dll/ctocpp/data_base_ctocpp.h" 20578 #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" 20579 #include "libcef_dll/ctocpp/extension_ctocpp.h" 20580-#include "libcef_dll/ctocpp/media_router_ctocpp.h" 20581 #include "libcef_dll/ctocpp/value_ctocpp.h" 20582 #include "libcef_dll/ctocpp/web_storage_ctocpp.h" 20583 #include "libcef_dll/transfer_util.h" 20584@@ -566,25 +565,6 @@ CefRefPtr<CefExtension> CefRequestContextCToCpp::GetExtension( 20585 return CefExtensionCToCpp::Wrap(_retval); 20586 } 20587 20588-NO_SANITIZE("cfi-icall") 20589-CefRefPtr<CefMediaRouter> CefRequestContextCToCpp::GetMediaRouter( 20590- CefRefPtr<CefCompletionCallback> callback) { 20591- cef_request_context_t* _struct = GetStruct(); 20592- if (CEF_MEMBER_MISSING(_struct, get_media_router)) 20593- return nullptr; 20594- 20595- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 20596- 20597- // Unverified params: callback 20598- 20599- // Execute 20600- cef_media_router_t* _retval = _struct->get_media_router( 20601- _struct, CefCompletionCallbackCppToC::Wrap(callback)); 20602- 20603- // Return type: refptr_same 20604- return CefMediaRouterCToCpp::Wrap(_retval); 20605-} 20606- 20607 // CONSTRUCTOR - Do not edit by hand. 20608 20609 CefRequestContextCToCpp::CefRequestContextCToCpp() {} 20610diff --git a/src/cef/libcef_dll/ctocpp/request_context_ctocpp.h b/src/cef/libcef_dll/ctocpp/request_context_ctocpp.h 20611index a4b3680ddd315..bc46f069c3a57 20612--- a/src/cef/libcef_dll/ctocpp/request_context_ctocpp.h 20613+++ b/src/cef/libcef_dll/ctocpp/request_context_ctocpp.h 20614@@ -1,4 +1,4 @@ 20615-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20616+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20617 // reserved. Use of this source code is governed by a BSD-style license that 20618 // can be found in the LICENSE file. 20619 // 20620@@ -9,7 +9,7 @@ 20621 // implementations. See the translator.README.txt file in the tools directory 20622 // for more information. 20623 // 20624-// $hash=caa6b1e4b3ff4716bb47e181b96c9483342b28de$ 20625+// $hash=178710b8193986502c91eff7bbe6cbfe0e158055$ 20626 // 20627 20628 #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_ 20629@@ -79,8 +79,6 @@ class CefRequestContextCToCpp 20630 bool HasExtension(const CefString& extension_id) override; 20631 bool GetExtensions(std::vector<CefString>& extension_ids) override; 20632 CefRefPtr<CefExtension> GetExtension(const CefString& extension_id) override; 20633- CefRefPtr<CefMediaRouter> GetMediaRouter( 20634- CefRefPtr<CefCompletionCallback> callback) override; 20635 }; 20636 20637 #endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_ 20638diff --git a/src/cef/libcef_dll/ctocpp/request_context_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/request_context_handler_ctocpp.cc 20639index fd2bde57aad07..d4ff6e78f085a 20640--- a/src/cef/libcef_dll/ctocpp/request_context_handler_ctocpp.cc 20641+++ b/src/cef/libcef_dll/ctocpp/request_context_handler_ctocpp.cc 20642@@ -1,4 +1,4 @@ 20643-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20644+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20645 // reserved. Use of this source code is governed by a BSD-style license that 20646 // can be found in the LICENSE file. 20647 // 20648@@ -9,7 +9,7 @@ 20649 // implementations. See the translator.README.txt file in the tools directory 20650 // for more information. 20651 // 20652-// $hash=a57c9c762ed21459113a931ad31387aa1ab2c441$ 20653+// $hash=8a94f1c67a481d85041012d944a85e9a1bcce7c8$ 20654 // 20655 20656 #include "libcef_dll/ctocpp/request_context_handler_ctocpp.h" 20657@@ -41,15 +41,14 @@ void CefRequestContextHandlerCToCpp::OnRequestContextInitialized( 20658 } 20659 20660 NO_SANITIZE("cfi-icall") 20661-CefRefPtr<CefResourceRequestHandler> 20662-CefRequestContextHandlerCToCpp::GetResourceRequestHandler( 20663- CefRefPtr<CefBrowser> browser, 20664- CefRefPtr<CefFrame> frame, 20665- CefRefPtr<CefRequest> request, 20666- bool is_navigation, 20667- bool is_download, 20668- const CefString& request_initiator, 20669- bool& disable_default_handling) { 20670+CefRefPtr<CefResourceRequestHandler> CefRequestContextHandlerCToCpp:: 20671+ GetResourceRequestHandler(CefRefPtr<CefBrowser> browser, 20672+ CefRefPtr<CefFrame> frame, 20673+ CefRefPtr<CefRequest> request, 20674+ bool is_navigation, 20675+ bool is_download, 20676+ const CefString& request_initiator, 20677+ bool& disable_default_handling) { 20678 cef_request_context_handler_t* _struct = GetStruct(); 20679 if (CEF_MEMBER_MISSING(_struct, get_resource_request_handler)) 20680 return nullptr; 20681diff --git a/src/cef/libcef_dll/ctocpp/request_context_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/request_context_handler_ctocpp.h 20682index aec6839cae6b5..004f130ab8a39 20683--- a/src/cef/libcef_dll/ctocpp/request_context_handler_ctocpp.h 20684+++ b/src/cef/libcef_dll/ctocpp/request_context_handler_ctocpp.h 20685@@ -1,4 +1,4 @@ 20686-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20687+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20688 // reserved. Use of this source code is governed by a BSD-style license that 20689 // can be found in the LICENSE file. 20690 // 20691@@ -9,7 +9,7 @@ 20692 // implementations. See the translator.README.txt file in the tools directory 20693 // for more information. 20694 // 20695-// $hash=f1c0285ef66144b395f364bf1e6d211634028df7$ 20696+// $hash=8f4c9ab7910a1497890d9bb3bc7aef80e23b7306$ 20697 // 20698 20699 #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_HANDLER_CTOCPP_H_ 20700diff --git a/src/cef/libcef_dll/ctocpp/request_ctocpp.cc b/src/cef/libcef_dll/ctocpp/request_ctocpp.cc 20701index 5626e4c25d07c..85b7fb9ceabbe 20702--- a/src/cef/libcef_dll/ctocpp/request_ctocpp.cc 20703+++ b/src/cef/libcef_dll/ctocpp/request_ctocpp.cc 20704@@ -1,4 +1,4 @@ 20705-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20706+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20707 // reserved. Use of this source code is governed by a BSD-style license that 20708 // can be found in the LICENSE file. 20709 // 20710@@ -9,7 +9,7 @@ 20711 // implementations. See the translator.README.txt file in the tools directory 20712 // for more information. 20713 // 20714-// $hash=b1dd4486a797ac139f453e02e3a49c74b7568ca8$ 20715+// $hash=0cd351db644cd18b1cde6adf5355d2ceff949827$ 20716 // 20717 20718 #include "libcef_dll/ctocpp/request_ctocpp.h" 20719diff --git a/src/cef/libcef_dll/ctocpp/request_ctocpp.h b/src/cef/libcef_dll/ctocpp/request_ctocpp.h 20720index ec852c0757a6d..7b3b665425029 20721--- a/src/cef/libcef_dll/ctocpp/request_ctocpp.h 20722+++ b/src/cef/libcef_dll/ctocpp/request_ctocpp.h 20723@@ -1,4 +1,4 @@ 20724-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20725+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20726 // reserved. Use of this source code is governed by a BSD-style license that 20727 // can be found in the LICENSE file. 20728 // 20729@@ -9,7 +9,7 @@ 20730 // implementations. See the translator.README.txt file in the tools directory 20731 // for more information. 20732 // 20733-// $hash=6a1638068718eb98ce3311395809c7da4c9f7422$ 20734+// $hash=7e87acb36c494058615248f36c7536368d3d5fb5$ 20735 // 20736 20737 #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ 20738diff --git a/src/cef/libcef_dll/ctocpp/request_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/request_handler_ctocpp.cc 20739index 62b1ce741dc2b..8dee0dc3edec7 20740--- a/src/cef/libcef_dll/ctocpp/request_handler_ctocpp.cc 20741+++ b/src/cef/libcef_dll/ctocpp/request_handler_ctocpp.cc 20742@@ -1,4 +1,4 @@ 20743-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20744+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20745 // reserved. Use of this source code is governed by a BSD-style license that 20746 // can be found in the LICENSE file. 20747 // 20748@@ -9,7 +9,7 @@ 20749 // implementations. See the translator.README.txt file in the tools directory 20750 // for more information. 20751 // 20752-// $hash=1622488c5f5a264c0672564c1862e3d64b87e8e8$ 20753+// $hash=f65a730888f266775539eaa278925d619b5a4be2$ 20754 // 20755 20756 #include "libcef_dll/ctocpp/request_handler_ctocpp.h" 20757diff --git a/src/cef/libcef_dll/ctocpp/request_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/request_handler_ctocpp.h 20758index 75aeadbcda6ee..6c1eb88effee5 20759--- a/src/cef/libcef_dll/ctocpp/request_handler_ctocpp.h 20760+++ b/src/cef/libcef_dll/ctocpp/request_handler_ctocpp.h 20761@@ -1,4 +1,4 @@ 20762-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20763+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20764 // reserved. Use of this source code is governed by a BSD-style license that 20765 // can be found in the LICENSE file. 20766 // 20767@@ -9,7 +9,7 @@ 20768 // implementations. See the translator.README.txt file in the tools directory 20769 // for more information. 20770 // 20771-// $hash=da31c462d342652746056a6a1013bcf5f4f5155c$ 20772+// $hash=e407bf6537c825d8fe5e340aa3e29b61f78574ae$ 20773 // 20774 20775 #ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_ 20776diff --git a/src/cef/libcef_dll/ctocpp/resolve_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/resolve_callback_ctocpp.cc 20777index d348c199a617a..fe697c32c50fe 20778--- a/src/cef/libcef_dll/ctocpp/resolve_callback_ctocpp.cc 20779+++ b/src/cef/libcef_dll/ctocpp/resolve_callback_ctocpp.cc 20780@@ -1,4 +1,4 @@ 20781-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20782+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20783 // reserved. Use of this source code is governed by a BSD-style license that 20784 // can be found in the LICENSE file. 20785 // 20786@@ -9,7 +9,7 @@ 20787 // implementations. See the translator.README.txt file in the tools directory 20788 // for more information. 20789 // 20790-// $hash=c71d6fd8b0ee493102fdae90612f15b01e4a9f6b$ 20791+// $hash=e8659cb8919878e3ad14e22b9c30b61eae0fe71d$ 20792 // 20793 20794 #include "libcef_dll/ctocpp/resolve_callback_ctocpp.h" 20795diff --git a/src/cef/libcef_dll/ctocpp/resolve_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/resolve_callback_ctocpp.h 20796index b1f00880bc8a2..f9e115e76f528 20797--- a/src/cef/libcef_dll/ctocpp/resolve_callback_ctocpp.h 20798+++ b/src/cef/libcef_dll/ctocpp/resolve_callback_ctocpp.h 20799@@ -1,4 +1,4 @@ 20800-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20801+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20802 // reserved. Use of this source code is governed by a BSD-style license that 20803 // can be found in the LICENSE file. 20804 // 20805@@ -9,7 +9,7 @@ 20806 // implementations. See the translator.README.txt file in the tools directory 20807 // for more information. 20808 // 20809-// $hash=493826dcfb1c8e1b46489225a74332552d591d63$ 20810+// $hash=648f3d66272798ab00f7a97d33126aef193d5fa5$ 20811 // 20812 20813 #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOLVE_CALLBACK_CTOCPP_H_ 20814diff --git a/src/cef/libcef_dll/ctocpp/resource_bundle_ctocpp.cc b/src/cef/libcef_dll/ctocpp/resource_bundle_ctocpp.cc 20815index 66bc65cc316a9..98cc508a1a452 20816--- a/src/cef/libcef_dll/ctocpp/resource_bundle_ctocpp.cc 20817+++ b/src/cef/libcef_dll/ctocpp/resource_bundle_ctocpp.cc 20818@@ -1,4 +1,4 @@ 20819-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20820+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20821 // reserved. Use of this source code is governed by a BSD-style license that 20822 // can be found in the LICENSE file. 20823 // 20824@@ -9,7 +9,7 @@ 20825 // implementations. See the translator.README.txt file in the tools directory 20826 // for more information. 20827 // 20828-// $hash=a62aa669321b0f86ea3508ce31ea5b1a0bc3f9b5$ 20829+// $hash=8ac944f0c572916a56506165359595f4c607a66c$ 20830 // 20831 20832 #include "libcef_dll/ctocpp/resource_bundle_ctocpp.h" 20833diff --git a/src/cef/libcef_dll/ctocpp/resource_bundle_ctocpp.h b/src/cef/libcef_dll/ctocpp/resource_bundle_ctocpp.h 20834index 08d8f47fc8a7b..9d0444e6cea3a 20835--- a/src/cef/libcef_dll/ctocpp/resource_bundle_ctocpp.h 20836+++ b/src/cef/libcef_dll/ctocpp/resource_bundle_ctocpp.h 20837@@ -1,4 +1,4 @@ 20838-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20839+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20840 // reserved. Use of this source code is governed by a BSD-style license that 20841 // can be found in the LICENSE file. 20842 // 20843@@ -9,7 +9,7 @@ 20844 // implementations. See the translator.README.txt file in the tools directory 20845 // for more information. 20846 // 20847-// $hash=faa11d38d989eb250f28646485cd2f0d38438807$ 20848+// $hash=e18e48353500f27c27160812032cadc398fe00f9$ 20849 // 20850 20851 #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_CTOCPP_H_ 20852diff --git a/src/cef/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc 20853index 722f909420153..e5d1de8a5b83b 20854--- a/src/cef/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc 20855+++ b/src/cef/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc 20856@@ -1,4 +1,4 @@ 20857-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20858+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20859 // reserved. Use of this source code is governed by a BSD-style license that 20860 // can be found in the LICENSE file. 20861 // 20862@@ -9,7 +9,7 @@ 20863 // implementations. See the translator.README.txt file in the tools directory 20864 // for more information. 20865 // 20866-// $hash=12556834893a7ae50b8f8bef2b71915fa1a141ca$ 20867+// $hash=dd0ca54416131ada6010e1e578eaff359488f11a$ 20868 // 20869 20870 #include "libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h" 20871diff --git a/src/cef/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h 20872index 354a15e0781d3..0b427b1fa6b9e 20873--- a/src/cef/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h 20874+++ b/src/cef/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h 20875@@ -1,4 +1,4 @@ 20876-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20877+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20878 // reserved. Use of this source code is governed by a BSD-style license that 20879 // can be found in the LICENSE file. 20880 // 20881@@ -9,7 +9,7 @@ 20882 // implementations. See the translator.README.txt file in the tools directory 20883 // for more information. 20884 // 20885-// $hash=ba179fe7fc169637ab6f1727351a81952c82826d$ 20886+// $hash=52b1821c0ed82e859eddbb113d4a73ba2b178548$ 20887 // 20888 20889 #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_HANDLER_CTOCPP_H_ 20890diff --git a/src/cef/libcef_dll/ctocpp/resource_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/resource_handler_ctocpp.cc 20891index 4396a57db1abc..93baa9b22cf23 20892--- a/src/cef/libcef_dll/ctocpp/resource_handler_ctocpp.cc 20893+++ b/src/cef/libcef_dll/ctocpp/resource_handler_ctocpp.cc 20894@@ -1,4 +1,4 @@ 20895-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20896+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20897 // reserved. Use of this source code is governed by a BSD-style license that 20898 // can be found in the LICENSE file. 20899 // 20900@@ -9,7 +9,7 @@ 20901 // implementations. See the translator.README.txt file in the tools directory 20902 // for more information. 20903 // 20904-// $hash=16d3a6bd2555917b295d7dbb3ccd95ccfc35b111$ 20905+// $hash=8641dd9a90013088eb4840c691effe87c7a38348$ 20906 // 20907 20908 #include "libcef_dll/ctocpp/resource_handler_ctocpp.h" 20909diff --git a/src/cef/libcef_dll/ctocpp/resource_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/resource_handler_ctocpp.h 20910index ae74e58fd3106..da05687c859bb 20911--- a/src/cef/libcef_dll/ctocpp/resource_handler_ctocpp.h 20912+++ b/src/cef/libcef_dll/ctocpp/resource_handler_ctocpp.h 20913@@ -1,4 +1,4 @@ 20914-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20915+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20916 // reserved. Use of this source code is governed by a BSD-style license that 20917 // can be found in the LICENSE file. 20918 // 20919@@ -9,7 +9,7 @@ 20920 // implementations. See the translator.README.txt file in the tools directory 20921 // for more information. 20922 // 20923-// $hash=2b60744909728ffbff2e846438bf122a61fec5c7$ 20924+// $hash=8cf5fea5fc1d33f8268a4608417a75ef6ee9bf51$ 20925 // 20926 20927 #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_HANDLER_CTOCPP_H_ 20928diff --git a/src/cef/libcef_dll/ctocpp/resource_read_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/resource_read_callback_ctocpp.cc 20929index 1e9523ef77cdd..80ba66ece67a4 20930--- a/src/cef/libcef_dll/ctocpp/resource_read_callback_ctocpp.cc 20931+++ b/src/cef/libcef_dll/ctocpp/resource_read_callback_ctocpp.cc 20932@@ -1,4 +1,4 @@ 20933-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20934+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20935 // reserved. Use of this source code is governed by a BSD-style license that 20936 // can be found in the LICENSE file. 20937 // 20938@@ -9,7 +9,7 @@ 20939 // implementations. See the translator.README.txt file in the tools directory 20940 // for more information. 20941 // 20942-// $hash=c251aa59688ffe5c12d2ec3c8a4a896d016e86a0$ 20943+// $hash=4f01fc764e74bb4a40a53b43ddc4e4857e51e4e2$ 20944 // 20945 20946 #include "libcef_dll/ctocpp/resource_read_callback_ctocpp.h" 20947diff --git a/src/cef/libcef_dll/ctocpp/resource_read_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/resource_read_callback_ctocpp.h 20948index 4a304a20b054c..37b79c96656b9 20949--- a/src/cef/libcef_dll/ctocpp/resource_read_callback_ctocpp.h 20950+++ b/src/cef/libcef_dll/ctocpp/resource_read_callback_ctocpp.h 20951@@ -1,4 +1,4 @@ 20952-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20953+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20954 // reserved. Use of this source code is governed by a BSD-style license that 20955 // can be found in the LICENSE file. 20956 // 20957@@ -9,7 +9,7 @@ 20958 // implementations. See the translator.README.txt file in the tools directory 20959 // for more information. 20960 // 20961-// $hash=b655936b8ea2584164546d261263876bf9d3f0ac$ 20962+// $hash=aeb2eaecc30bb2498b709af0ec45dd6b5dc9b392$ 20963 // 20964 20965 #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_READ_CALLBACK_CTOCPP_H_ 20966diff --git a/src/cef/libcef_dll/ctocpp/resource_request_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/resource_request_handler_ctocpp.cc 20967index 1d8cbac585eac..1a5e9edc413b3 20968--- a/src/cef/libcef_dll/ctocpp/resource_request_handler_ctocpp.cc 20969+++ b/src/cef/libcef_dll/ctocpp/resource_request_handler_ctocpp.cc 20970@@ -1,4 +1,4 @@ 20971-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 20972+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 20973 // reserved. Use of this source code is governed by a BSD-style license that 20974 // can be found in the LICENSE file. 20975 // 20976@@ -9,7 +9,7 @@ 20977 // implementations. See the translator.README.txt file in the tools directory 20978 // for more information. 20979 // 20980-// $hash=76e8ba6d6c7860c2a1b630dd632f5c647391f564$ 20981+// $hash=7a1e7b377527ff331e4950f3f52c85f2a341517d$ 20982 // 20983 20984 #include "libcef_dll/ctocpp/resource_request_handler_ctocpp.h" 20985@@ -25,11 +25,10 @@ 20986 // VIRTUAL METHODS - Body may be edited by hand. 20987 20988 NO_SANITIZE("cfi-icall") 20989-CefRefPtr<CefCookieAccessFilter> 20990-CefResourceRequestHandlerCToCpp::GetCookieAccessFilter( 20991- CefRefPtr<CefBrowser> browser, 20992- CefRefPtr<CefFrame> frame, 20993- CefRefPtr<CefRequest> request) { 20994+CefRefPtr<CefCookieAccessFilter> CefResourceRequestHandlerCToCpp:: 20995+ GetCookieAccessFilter(CefRefPtr<CefBrowser> browser, 20996+ CefRefPtr<CefFrame> frame, 20997+ CefRefPtr<CefRequest> request) { 20998 cef_resource_request_handler_t* _struct = GetStruct(); 20999 if (CEF_MEMBER_MISSING(_struct, get_cookie_access_filter)) 21000 return nullptr; 21001@@ -53,11 +52,11 @@ CefResourceRequestHandlerCToCpp::GetCookieAccessFilter( 21002 21003 NO_SANITIZE("cfi-icall") 21004 CefResourceRequestHandler::ReturnValue 21005-CefResourceRequestHandlerCToCpp::OnBeforeResourceLoad( 21006- CefRefPtr<CefBrowser> browser, 21007- CefRefPtr<CefFrame> frame, 21008- CefRefPtr<CefRequest> request, 21009- CefRefPtr<CefCallback> callback) { 21010+ CefResourceRequestHandlerCToCpp::OnBeforeResourceLoad( 21011+ CefRefPtr<CefBrowser> browser, 21012+ CefRefPtr<CefFrame> frame, 21013+ CefRefPtr<CefRequest> request, 21014+ CefRefPtr<CefCallback> callback) { 21015 cef_resource_request_handler_t* _struct = GetStruct(); 21016 if (CEF_MEMBER_MISSING(_struct, on_before_resource_load)) 21017 return RV_CONTINUE; 21018@@ -84,11 +83,10 @@ CefResourceRequestHandlerCToCpp::OnBeforeResourceLoad( 21019 } 21020 21021 NO_SANITIZE("cfi-icall") 21022-CefRefPtr<CefResourceHandler> 21023-CefResourceRequestHandlerCToCpp::GetResourceHandler( 21024- CefRefPtr<CefBrowser> browser, 21025- CefRefPtr<CefFrame> frame, 21026- CefRefPtr<CefRequest> request) { 21027+CefRefPtr<CefResourceHandler> CefResourceRequestHandlerCToCpp:: 21028+ GetResourceHandler(CefRefPtr<CefBrowser> browser, 21029+ CefRefPtr<CefFrame> frame, 21030+ CefRefPtr<CefRequest> request) { 21031 cef_resource_request_handler_t* _struct = GetStruct(); 21032 if (CEF_MEMBER_MISSING(_struct, get_resource_handler)) 21033 return nullptr; 21034@@ -172,12 +170,11 @@ bool CefResourceRequestHandlerCToCpp::OnResourceResponse( 21035 } 21036 21037 NO_SANITIZE("cfi-icall") 21038-CefRefPtr<CefResponseFilter> 21039-CefResourceRequestHandlerCToCpp::GetResourceResponseFilter( 21040- CefRefPtr<CefBrowser> browser, 21041- CefRefPtr<CefFrame> frame, 21042- CefRefPtr<CefRequest> request, 21043- CefRefPtr<CefResponse> response) { 21044+CefRefPtr<CefResponseFilter> CefResourceRequestHandlerCToCpp:: 21045+ GetResourceResponseFilter(CefRefPtr<CefBrowser> browser, 21046+ CefRefPtr<CefFrame> frame, 21047+ CefRefPtr<CefRequest> request, 21048+ CefRefPtr<CefResponse> response) { 21049 cef_resource_request_handler_t* _struct = GetStruct(); 21050 if (CEF_MEMBER_MISSING(_struct, get_resource_response_filter)) 21051 return nullptr; 21052diff --git a/src/cef/libcef_dll/ctocpp/resource_request_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/resource_request_handler_ctocpp.h 21053index e2d2aa6596c53..4d2c5cd332121 21054--- a/src/cef/libcef_dll/ctocpp/resource_request_handler_ctocpp.h 21055+++ b/src/cef/libcef_dll/ctocpp/resource_request_handler_ctocpp.h 21056@@ -1,4 +1,4 @@ 21057-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21058+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21059 // reserved. Use of this source code is governed by a BSD-style license that 21060 // can be found in the LICENSE file. 21061 // 21062@@ -9,7 +9,7 @@ 21063 // implementations. See the translator.README.txt file in the tools directory 21064 // for more information. 21065 // 21066-// $hash=2a3124a23f18f81fe2effd7df7848aa999370f31$ 21067+// $hash=4564ea5efd8c4be32e2df7c98fd70a645eb9f696$ 21068 // 21069 21070 #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_REQUEST_HANDLER_CTOCPP_H_ 21071diff --git a/src/cef/libcef_dll/ctocpp/resource_skip_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/resource_skip_callback_ctocpp.cc 21072index cdafb7bea0301..109e4ce8f41ff 21073--- a/src/cef/libcef_dll/ctocpp/resource_skip_callback_ctocpp.cc 21074+++ b/src/cef/libcef_dll/ctocpp/resource_skip_callback_ctocpp.cc 21075@@ -1,4 +1,4 @@ 21076-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21077+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21078 // reserved. Use of this source code is governed by a BSD-style license that 21079 // can be found in the LICENSE file. 21080 // 21081@@ -9,7 +9,7 @@ 21082 // implementations. See the translator.README.txt file in the tools directory 21083 // for more information. 21084 // 21085-// $hash=df7b14a723e4f2b9dd7946fddfbe8dc9652ccb75$ 21086+// $hash=9b1ffc7f2bb483a6657867c8369e56b821b44684$ 21087 // 21088 21089 #include "libcef_dll/ctocpp/resource_skip_callback_ctocpp.h" 21090diff --git a/src/cef/libcef_dll/ctocpp/resource_skip_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/resource_skip_callback_ctocpp.h 21091index ac22d12ca33cc..5d8a347bbb2d9 21092--- a/src/cef/libcef_dll/ctocpp/resource_skip_callback_ctocpp.h 21093+++ b/src/cef/libcef_dll/ctocpp/resource_skip_callback_ctocpp.h 21094@@ -1,4 +1,4 @@ 21095-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21096+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21097 // reserved. Use of this source code is governed by a BSD-style license that 21098 // can be found in the LICENSE file. 21099 // 21100@@ -9,7 +9,7 @@ 21101 // implementations. See the translator.README.txt file in the tools directory 21102 // for more information. 21103 // 21104-// $hash=de37dc0b6e8570fc2f0d1912a5ac9e264ef5d6dc$ 21105+// $hash=ace627f34f6c16512fb0d7a9a4ebb96e9c00c78d$ 21106 // 21107 21108 #ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_SKIP_CALLBACK_CTOCPP_H_ 21109diff --git a/src/cef/libcef_dll/ctocpp/response_ctocpp.cc b/src/cef/libcef_dll/ctocpp/response_ctocpp.cc 21110index e34c60e857b7c..0c9aa8713cd3e 21111--- a/src/cef/libcef_dll/ctocpp/response_ctocpp.cc 21112+++ b/src/cef/libcef_dll/ctocpp/response_ctocpp.cc 21113@@ -1,4 +1,4 @@ 21114-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21115+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21116 // reserved. Use of this source code is governed by a BSD-style license that 21117 // can be found in the LICENSE file. 21118 // 21119@@ -9,7 +9,7 @@ 21120 // implementations. See the translator.README.txt file in the tools directory 21121 // for more information. 21122 // 21123-// $hash=ac30aa16fee147cd041b64db7f2743d578dc6384$ 21124+// $hash=85da34bbec6032ab48c11a9c64927c9da40fa5dc$ 21125 // 21126 21127 #include "libcef_dll/ctocpp/response_ctocpp.h" 21128diff --git a/src/cef/libcef_dll/ctocpp/response_ctocpp.h b/src/cef/libcef_dll/ctocpp/response_ctocpp.h 21129index cb1187f23a55e..00a127929b37c 21130--- a/src/cef/libcef_dll/ctocpp/response_ctocpp.h 21131+++ b/src/cef/libcef_dll/ctocpp/response_ctocpp.h 21132@@ -1,4 +1,4 @@ 21133-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21134+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21135 // reserved. Use of this source code is governed by a BSD-style license that 21136 // can be found in the LICENSE file. 21137 // 21138@@ -9,7 +9,7 @@ 21139 // implementations. See the translator.README.txt file in the tools directory 21140 // for more information. 21141 // 21142-// $hash=8e61de9ab82c665913039fa45903fa8b2213d3c2$ 21143+// $hash=3ec4c709bcd18d24997d554134b1b01e17bbd0fb$ 21144 // 21145 21146 #ifndef CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ 21147diff --git a/src/cef/libcef_dll/ctocpp/response_filter_ctocpp.cc b/src/cef/libcef_dll/ctocpp/response_filter_ctocpp.cc 21148index 668cfa6f1d3d1..336567dfd16bc 21149--- a/src/cef/libcef_dll/ctocpp/response_filter_ctocpp.cc 21150+++ b/src/cef/libcef_dll/ctocpp/response_filter_ctocpp.cc 21151@@ -1,4 +1,4 @@ 21152-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21153+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21154 // reserved. Use of this source code is governed by a BSD-style license that 21155 // can be found in the LICENSE file. 21156 // 21157@@ -9,7 +9,7 @@ 21158 // implementations. See the translator.README.txt file in the tools directory 21159 // for more information. 21160 // 21161-// $hash=ddb4710d1e5bc73df68f132d56661b0d22520ad9$ 21162+// $hash=dc1f2774aa0a5d586afb09a77cd4fdf5022af04a$ 21163 // 21164 21165 #include "libcef_dll/ctocpp/response_filter_ctocpp.h" 21166@@ -34,13 +34,13 @@ NO_SANITIZE("cfi-icall") bool CefResponseFilterCToCpp::InitFilter() { 21167 } 21168 21169 NO_SANITIZE("cfi-icall") 21170-CefResponseFilter::FilterStatus CefResponseFilterCToCpp::Filter( 21171- void* data_in, 21172- size_t data_in_size, 21173- size_t& data_in_read, 21174- void* data_out, 21175- size_t data_out_size, 21176- size_t& data_out_written) { 21177+CefResponseFilter::FilterStatus 21178+ CefResponseFilterCToCpp::Filter(void* data_in, 21179+ size_t data_in_size, 21180+ size_t& data_in_read, 21181+ void* data_out, 21182+ size_t data_out_size, 21183+ size_t& data_out_written) { 21184 shutdown_checker::AssertNotShutdown(); 21185 21186 cef_response_filter_t* _struct = GetStruct(); 21187diff --git a/src/cef/libcef_dll/ctocpp/response_filter_ctocpp.h b/src/cef/libcef_dll/ctocpp/response_filter_ctocpp.h 21188index a1f7a5eff4ecb..a15d97ff0d320 21189--- a/src/cef/libcef_dll/ctocpp/response_filter_ctocpp.h 21190+++ b/src/cef/libcef_dll/ctocpp/response_filter_ctocpp.h 21191@@ -1,4 +1,4 @@ 21192-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21193+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21194 // reserved. Use of this source code is governed by a BSD-style license that 21195 // can be found in the LICENSE file. 21196 // 21197@@ -9,7 +9,7 @@ 21198 // implementations. See the translator.README.txt file in the tools directory 21199 // for more information. 21200 // 21201-// $hash=3e7c6b0f991e335db755172d65e2a03e5e00a270$ 21202+// $hash=b9ca51a2ee848580b14c1a06b49b2b9e048ab798$ 21203 // 21204 21205 #ifndef CEF_LIBCEF_DLL_CTOCPP_RESPONSE_FILTER_CTOCPP_H_ 21206diff --git a/src/cef/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc 21207index 4e82c15bcdfa5..c608f07f255d3 21208--- a/src/cef/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc 21209+++ b/src/cef/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc 21210@@ -1,4 +1,4 @@ 21211-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21212+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21213 // reserved. Use of this source code is governed by a BSD-style license that 21214 // can be found in the LICENSE file. 21215 // 21216@@ -9,7 +9,7 @@ 21217 // implementations. See the translator.README.txt file in the tools directory 21218 // for more information. 21219 // 21220-// $hash=427fe84b74eec6346d7da729cba2fdf52d1c0fd7$ 21221+// $hash=be8368d8aea24196357d54e79c935ad40b5e7d9d$ 21222 // 21223 21224 #include "libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h" 21225diff --git a/src/cef/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h 21226index 6e413df2f4957..90d9cd66050e0 21227--- a/src/cef/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h 21228+++ b/src/cef/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h 21229@@ -1,4 +1,4 @@ 21230-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21231+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21232 // reserved. Use of this source code is governed by a BSD-style license that 21233 // can be found in the LICENSE file. 21234 // 21235@@ -9,7 +9,7 @@ 21236 // implementations. See the translator.README.txt file in the tools directory 21237 // for more information. 21238 // 21239-// $hash=ffa640e35d08dd0f9b8c0ea291db190947826915$ 21240+// $hash=7663b13ecb057bba0158685bc34783f37ef2f030$ 21241 // 21242 21243 #ifndef CEF_LIBCEF_DLL_CTOCPP_RUN_CONTEXT_MENU_CALLBACK_CTOCPP_H_ 21244diff --git a/src/cef/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc 21245index fb42b0d4cfcda..6999776b45c9c 21246--- a/src/cef/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc 21247+++ b/src/cef/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc 21248@@ -1,4 +1,4 @@ 21249-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21250+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21251 // reserved. Use of this source code is governed by a BSD-style license that 21252 // can be found in the LICENSE file. 21253 // 21254@@ -9,7 +9,7 @@ 21255 // implementations. See the translator.README.txt file in the tools directory 21256 // for more information. 21257 // 21258-// $hash=cb29585261ed25ddd2ee1b4b5c890565e72e5d22$ 21259+// $hash=2e7f10559c5c3458ee2a5055d55ec4df6be246cf$ 21260 // 21261 21262 #include "libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h" 21263diff --git a/src/cef/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h 21264index 2b4fc7dde8ffc..1d7e8588b7db3 21265--- a/src/cef/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h 21266+++ b/src/cef/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h 21267@@ -1,4 +1,4 @@ 21268-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21269+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21270 // reserved. Use of this source code is governed by a BSD-style license that 21271 // can be found in the LICENSE file. 21272 // 21273@@ -9,7 +9,7 @@ 21274 // implementations. See the translator.README.txt file in the tools directory 21275 // for more information. 21276 // 21277-// $hash=63d2d1da715395296899acc4ed165cf7dae4d78c$ 21278+// $hash=85e5a1624f1ed7c3a154f55edc0682f723374197$ 21279 // 21280 21281 #ifndef CEF_LIBCEF_DLL_CTOCPP_RUN_FILE_DIALOG_CALLBACK_CTOCPP_H_ 21282diff --git a/src/cef/libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.cc 21283index 095624f724b13..1e649a0955cfb 21284--- a/src/cef/libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.cc 21285+++ b/src/cef/libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.cc 21286@@ -1,4 +1,4 @@ 21287-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21288+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21289 // reserved. Use of this source code is governed by a BSD-style license that 21290 // can be found in the LICENSE file. 21291 // 21292@@ -9,7 +9,7 @@ 21293 // implementations. See the translator.README.txt file in the tools directory 21294 // for more information. 21295 // 21296-// $hash=c0d516016a14eeed0c73bde99e2495ae691c2326$ 21297+// $hash=7d0f87f5e909c52e5424e018ff46f806960f7df2$ 21298 // 21299 21300 #include "libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.h" 21301diff --git a/src/cef/libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.h 21302index 285335e2c424c..155b0b937cfb1 21303--- a/src/cef/libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.h 21304+++ b/src/cef/libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.h 21305@@ -1,4 +1,4 @@ 21306-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21307+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21308 // reserved. Use of this source code is governed by a BSD-style license that 21309 // can be found in the LICENSE file. 21310 // 21311@@ -9,7 +9,7 @@ 21312 // implementations. See the translator.README.txt file in the tools directory 21313 // for more information. 21314 // 21315-// $hash=519977d5976a7486e0fda9d9b9b0d6fd0fd9b44f$ 21316+// $hash=c079137f43167df4c21e63f38cdd8c33f4423445$ 21317 // 21318 21319 #ifndef CEF_LIBCEF_DLL_CTOCPP_RUN_QUICK_MENU_CALLBACK_CTOCPP_H_ 21320diff --git a/src/cef/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc b/src/cef/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc 21321index 9be13e699bdee..8f3f3f86d99b8 21322--- a/src/cef/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc 21323+++ b/src/cef/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc 21324@@ -1,4 +1,4 @@ 21325-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21326+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21327 // reserved. Use of this source code is governed by a BSD-style license that 21328 // can be found in the LICENSE file. 21329 // 21330@@ -9,7 +9,7 @@ 21331 // implementations. See the translator.README.txt file in the tools directory 21332 // for more information. 21333 // 21334-// $hash=5e94a999784332a91c40a4608644bf7dc36e0729$ 21335+// $hash=ea86d74aea74e67a896aa51760e61219743a478f$ 21336 // 21337 21338 #include "libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h" 21339diff --git a/src/cef/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h b/src/cef/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h 21340index 8e1d45052d967..6e20d97da3418 21341--- a/src/cef/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h 21342+++ b/src/cef/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h 21343@@ -1,4 +1,4 @@ 21344-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21345+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21346 // reserved. Use of this source code is governed by a BSD-style license that 21347 // can be found in the LICENSE file. 21348 // 21349@@ -9,7 +9,7 @@ 21350 // implementations. See the translator.README.txt file in the tools directory 21351 // for more information. 21352 // 21353-// $hash=ff0cb366799a5abce0f4e43bd98fcaf993fad77d$ 21354+// $hash=8553de031f140b9c850e487863fc91b97633314b$ 21355 // 21356 21357 #ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_FACTORY_CTOCPP_H_ 21358diff --git a/src/cef/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc b/src/cef/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc 21359index c86d129734cc9..2b548187656ba 21360--- a/src/cef/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc 21361+++ b/src/cef/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc 21362@@ -1,4 +1,4 @@ 21363-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21364+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21365 // reserved. Use of this source code is governed by a BSD-style license that 21366 // can be found in the LICENSE file. 21367 // 21368@@ -9,7 +9,7 @@ 21369 // implementations. See the translator.README.txt file in the tools directory 21370 // for more information. 21371 // 21372-// $hash=3f55a43485f2833e5000e7444d57ef47ff7af0e9$ 21373+// $hash=722531dae407df607f2454823d375a34db168075$ 21374 // 21375 21376 #include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h" 21377diff --git a/src/cef/libcef_dll/ctocpp/scheme_registrar_ctocpp.h b/src/cef/libcef_dll/ctocpp/scheme_registrar_ctocpp.h 21378index 110a6858a3331..8ac7075b830aa 21379--- a/src/cef/libcef_dll/ctocpp/scheme_registrar_ctocpp.h 21380+++ b/src/cef/libcef_dll/ctocpp/scheme_registrar_ctocpp.h 21381@@ -1,4 +1,4 @@ 21382-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21383+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21384 // reserved. Use of this source code is governed by a BSD-style license that 21385 // can be found in the LICENSE file. 21386 // 21387@@ -9,7 +9,7 @@ 21388 // implementations. See the translator.README.txt file in the tools directory 21389 // for more information. 21390 // 21391-// $hash=6c522fb5e064daeea21350a548af4bee6c0a2acf$ 21392+// $hash=a30e0b019ab6b34998563c8bf46f7b0c8089c3ba$ 21393 // 21394 21395 #ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_ 21396diff --git a/src/cef/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc 21397index fda61b5069f30..1bf872280f115 21398--- a/src/cef/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc 21399+++ b/src/cef/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc 21400@@ -1,4 +1,4 @@ 21401-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21402+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21403 // reserved. Use of this source code is governed by a BSD-style license that 21404 // can be found in the LICENSE file. 21405 // 21406@@ -9,7 +9,7 @@ 21407 // implementations. See the translator.README.txt file in the tools directory 21408 // for more information. 21409 // 21410-// $hash=f77cbb1874239eff164c3654befdc0f4fe81fed9$ 21411+// $hash=6fd8a2097b3275a73b28725e5747cc8e5c895a63$ 21412 // 21413 21414 #include "libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h" 21415diff --git a/src/cef/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h 21416index 0085926df555e..318fa12d74e73 21417--- a/src/cef/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h 21418+++ b/src/cef/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h 21419@@ -1,4 +1,4 @@ 21420-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21421+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21422 // reserved. Use of this source code is governed by a BSD-style license that 21423 // can be found in the LICENSE file. 21424 // 21425@@ -9,7 +9,7 @@ 21426 // implementations. See the translator.README.txt file in the tools directory 21427 // for more information. 21428 // 21429-// $hash=0de5941ff724adcd6ca8fcb5e1a5266143afa820$ 21430+// $hash=3ab940de86fd7e4fd434758c7064f4eea9a3de47$ 21431 // 21432 21433 #ifndef CEF_LIBCEF_DLL_CTOCPP_SELECT_CLIENT_CERTIFICATE_CALLBACK_CTOCPP_H_ 21434diff --git a/src/cef/libcef_dll/ctocpp/select_popup_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/select_popup_callback_ctocpp.cc 21435new file mode 100644 21436index 0000000000000..d45fb69daa75d 21437--- /dev/null 21438+++ b/src/cef/libcef_dll/ctocpp/select_popup_callback_ctocpp.cc 21439@@ -0,0 +1,88 @@ 21440+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21441+// reserved. Use of this source code is governed by a BSD-style license that 21442+// can be found in the LICENSE file. 21443+// 21444+// --------------------------------------------------------------------------- 21445+// 21446+// This file was generated by the CEF translator tool. If making changes by 21447+// hand only do so within the body of existing method and function 21448+// implementations. See the translator.README.txt file in the tools directory 21449+// for more information. 21450+// 21451+// $hash=79f5a4ff76eac8f4149c11465623c3b177887128$ 21452+// 21453+ 21454+#include "libcef_dll/ctocpp/select_popup_callback_ctocpp.h" 21455+#include "libcef_dll/shutdown_checker.h" 21456+ 21457+// VIRTUAL METHODS - Body may be edited by hand. 21458+ 21459+NO_SANITIZE("cfi-icall") 21460+void CefSelectPopupCallbackCToCpp::Continue(const std::vector<int>& indices) { 21461+ shutdown_checker::AssertNotShutdown(); 21462+ 21463+ cef_select_popup_callback_t* _struct = GetStruct(); 21464+ if (CEF_MEMBER_MISSING(_struct, cont)) 21465+ return; 21466+ 21467+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 21468+ 21469+ // Translate param: indices; type: simple_vec_byref_const 21470+ const size_t indicesCount = indices.size(); 21471+ int* indicesList = NULL; 21472+ if (indicesCount > 0) { 21473+ indicesList = new int[indicesCount]; 21474+ DCHECK(indicesList); 21475+ if (indicesList) { 21476+ for (size_t i = 0; i < indicesCount; ++i) { 21477+ indicesList[i] = indices[i]; 21478+ } 21479+ } 21480+ } 21481+ 21482+ // Execute 21483+ _struct->cont(_struct, indicesCount, indicesList); 21484+ 21485+ // Restore param:indices; type: simple_vec_byref_const 21486+ if (indicesList) 21487+ delete[] indicesList; 21488+} 21489+ 21490+NO_SANITIZE("cfi-icall") void CefSelectPopupCallbackCToCpp::Cancel() { 21491+ shutdown_checker::AssertNotShutdown(); 21492+ 21493+ cef_select_popup_callback_t* _struct = GetStruct(); 21494+ if (CEF_MEMBER_MISSING(_struct, cancel)) 21495+ return; 21496+ 21497+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 21498+ 21499+ // Execute 21500+ _struct->cancel(_struct); 21501+} 21502+ 21503+// CONSTRUCTOR - Do not edit by hand. 21504+ 21505+CefSelectPopupCallbackCToCpp::CefSelectPopupCallbackCToCpp() {} 21506+ 21507+// DESTRUCTOR - Do not edit by hand. 21508+ 21509+CefSelectPopupCallbackCToCpp::~CefSelectPopupCallbackCToCpp() { 21510+ shutdown_checker::AssertNotShutdown(); 21511+} 21512+ 21513+template <> 21514+cef_select_popup_callback_t* CefCToCppRefCounted< 21515+ CefSelectPopupCallbackCToCpp, 21516+ CefSelectPopupCallback, 21517+ cef_select_popup_callback_t>::UnwrapDerived(CefWrapperType type, 21518+ CefSelectPopupCallback* c) { 21519+ NOTREACHED() << "Unexpected class type: " << type; 21520+ return nullptr; 21521+} 21522+ 21523+template <> 21524+CefWrapperType CefCToCppRefCounted<CefSelectPopupCallbackCToCpp, 21525+ CefSelectPopupCallback, 21526+ cef_select_popup_callback_t>::kWrapperType = 21527+ WT_SELECT_POPUP_CALLBACK; 21528diff --git a/src/cef/libcef_dll/ctocpp/select_popup_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/select_popup_callback_ctocpp.h 21529new file mode 100644 21530index 0000000000000..aa46a0ef6f8e8 21531--- /dev/null 21532+++ b/src/cef/libcef_dll/ctocpp/select_popup_callback_ctocpp.h 21533@@ -0,0 +1,43 @@ 21534+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21535+// reserved. Use of this source code is governed by a BSD-style license that 21536+// can be found in the LICENSE file. 21537+// 21538+// --------------------------------------------------------------------------- 21539+// 21540+// This file was generated by the CEF translator tool. If making changes by 21541+// hand only do so within the body of existing method and function 21542+// implementations. See the translator.README.txt file in the tools directory 21543+// for more information. 21544+// 21545+// $hash=511a4146e38cfe2e2242f3d79950cf67415fe4d5$ 21546+// 21547+ 21548+#ifndef CEF_LIBCEF_DLL_CTOCPP_SELECT_POPUP_CALLBACK_CTOCPP_H_ 21549+#define CEF_LIBCEF_DLL_CTOCPP_SELECT_POPUP_CALLBACK_CTOCPP_H_ 21550+#pragma once 21551+ 21552+#if !defined(WRAPPING_CEF_SHARED) 21553+#error This file can be included wrapper-side only 21554+#endif 21555+ 21556+#include <vector> 21557+#include "include/capi/cef_dialog_handler_capi.h" 21558+#include "include/cef_dialog_handler.h" 21559+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h" 21560+ 21561+// Wrap a C structure with a C++ class. 21562+// This class may be instantiated and accessed wrapper-side only. 21563+class CefSelectPopupCallbackCToCpp 21564+ : public CefCToCppRefCounted<CefSelectPopupCallbackCToCpp, 21565+ CefSelectPopupCallback, 21566+ cef_select_popup_callback_t> { 21567+ public: 21568+ CefSelectPopupCallbackCToCpp(); 21569+ virtual ~CefSelectPopupCallbackCToCpp(); 21570+ 21571+ // CefSelectPopupCallback methods. 21572+ void Continue(const std::vector<int>& indices) override; 21573+ void Cancel() override; 21574+}; 21575+ 21576+#endif // CEF_LIBCEF_DLL_CTOCPP_SELECT_POPUP_CALLBACK_CTOCPP_H_ 21577diff --git a/src/cef/libcef_dll/ctocpp/server_ctocpp.cc b/src/cef/libcef_dll/ctocpp/server_ctocpp.cc 21578index 51fe2ead4bd91..ba95ec8e2eaac 21579--- a/src/cef/libcef_dll/ctocpp/server_ctocpp.cc 21580+++ b/src/cef/libcef_dll/ctocpp/server_ctocpp.cc 21581@@ -1,4 +1,4 @@ 21582-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21583+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21584 // reserved. Use of this source code is governed by a BSD-style license that 21585 // can be found in the LICENSE file. 21586 // 21587@@ -9,7 +9,7 @@ 21588 // implementations. See the translator.README.txt file in the tools directory 21589 // for more information. 21590 // 21591-// $hash=d8cfb6cafc2a9aa0cffe4a998071e8a96b04740b$ 21592+// $hash=31e56774368e5a843a41c99e9446d8d97d6fc9da$ 21593 // 21594 21595 #include "libcef_dll/ctocpp/server_ctocpp.h" 21596diff --git a/src/cef/libcef_dll/ctocpp/server_ctocpp.h b/src/cef/libcef_dll/ctocpp/server_ctocpp.h 21597index b35a3255ebaa4..b9a038e2f88e0 21598--- a/src/cef/libcef_dll/ctocpp/server_ctocpp.h 21599+++ b/src/cef/libcef_dll/ctocpp/server_ctocpp.h 21600@@ -1,4 +1,4 @@ 21601-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21602+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21603 // reserved. Use of this source code is governed by a BSD-style license that 21604 // can be found in the LICENSE file. 21605 // 21606@@ -9,7 +9,7 @@ 21607 // implementations. See the translator.README.txt file in the tools directory 21608 // for more information. 21609 // 21610-// $hash=ed13956e5941bbb0885224ef57016cf7f34d389c$ 21611+// $hash=efb9652f9e2a17079ff20457264e8b0ecfd19499$ 21612 // 21613 21614 #ifndef CEF_LIBCEF_DLL_CTOCPP_SERVER_CTOCPP_H_ 21615diff --git a/src/cef/libcef_dll/ctocpp/server_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/server_handler_ctocpp.cc 21616index b82fd8f5b1cd5..3300e1734bb0f 21617--- a/src/cef/libcef_dll/ctocpp/server_handler_ctocpp.cc 21618+++ b/src/cef/libcef_dll/ctocpp/server_handler_ctocpp.cc 21619@@ -1,4 +1,4 @@ 21620-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21621+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21622 // reserved. Use of this source code is governed by a BSD-style license that 21623 // can be found in the LICENSE file. 21624 // 21625@@ -9,7 +9,7 @@ 21626 // implementations. See the translator.README.txt file in the tools directory 21627 // for more information. 21628 // 21629-// $hash=a14c40cc86f5fd61d548d981c99c59a559619eda$ 21630+// $hash=eff1ec14b02da387e1504034a7eace1325a4ee94$ 21631 // 21632 21633 #include "libcef_dll/ctocpp/server_handler_ctocpp.h" 21634diff --git a/src/cef/libcef_dll/ctocpp/server_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/server_handler_ctocpp.h 21635index 08df48f950e4c..fbb9d76162c4a 21636--- a/src/cef/libcef_dll/ctocpp/server_handler_ctocpp.h 21637+++ b/src/cef/libcef_dll/ctocpp/server_handler_ctocpp.h 21638@@ -1,4 +1,4 @@ 21639-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21640+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21641 // reserved. Use of this source code is governed by a BSD-style license that 21642 // can be found in the LICENSE file. 21643 // 21644@@ -9,7 +9,7 @@ 21645 // implementations. See the translator.README.txt file in the tools directory 21646 // for more information. 21647 // 21648-// $hash=b9b38b204c2b9d385ebefb11aa0b45efcd684cbc$ 21649+// $hash=0bed1f616f1ae42a7eb755dba59b329cd600abff$ 21650 // 21651 21652 #ifndef CEF_LIBCEF_DLL_CTOCPP_SERVER_HANDLER_CTOCPP_H_ 21653diff --git a/src/cef/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc 21654index 63048eec4be0c..2b8851b9f93a2 21655--- a/src/cef/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc 21656+++ b/src/cef/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc 21657@@ -1,4 +1,4 @@ 21658-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21659+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21660 // reserved. Use of this source code is governed by a BSD-style license that 21661 // can be found in the LICENSE file. 21662 // 21663@@ -9,7 +9,7 @@ 21664 // implementations. See the translator.README.txt file in the tools directory 21665 // for more information. 21666 // 21667-// $hash=5767c600167159c0ad3f5d10461f1bf107c668cc$ 21668+// $hash=0114a4f38f6355d772659f7a3d83e086ef2079c3$ 21669 // 21670 21671 #include "libcef_dll/ctocpp/set_cookie_callback_ctocpp.h" 21672diff --git a/src/cef/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h 21673index f4ca2b5612faf..067807169e6ad 21674--- a/src/cef/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h 21675+++ b/src/cef/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h 21676@@ -1,4 +1,4 @@ 21677-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21678+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21679 // reserved. Use of this source code is governed by a BSD-style license that 21680 // can be found in the LICENSE file. 21681 // 21682@@ -9,7 +9,7 @@ 21683 // implementations. See the translator.README.txt file in the tools directory 21684 // for more information. 21685 // 21686-// $hash=83c8143e3d126fca9a02f8e5ffa75bf99d291518$ 21687+// $hash=26be0ed7d7165630ee23b480419768f1fd9b95fe$ 21688 // 21689 21690 #ifndef CEF_LIBCEF_DLL_CTOCPP_SET_COOKIE_CALLBACK_CTOCPP_H_ 21691diff --git a/src/cef/libcef_dll/ctocpp/sslinfo_ctocpp.cc b/src/cef/libcef_dll/ctocpp/sslinfo_ctocpp.cc 21692index 81512b8b693f3..57eb40cd3ed1f 21693--- a/src/cef/libcef_dll/ctocpp/sslinfo_ctocpp.cc 21694+++ b/src/cef/libcef_dll/ctocpp/sslinfo_ctocpp.cc 21695@@ -1,4 +1,4 @@ 21696-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21697+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21698 // reserved. Use of this source code is governed by a BSD-style license that 21699 // can be found in the LICENSE file. 21700 // 21701@@ -9,7 +9,7 @@ 21702 // implementations. See the translator.README.txt file in the tools directory 21703 // for more information. 21704 // 21705-// $hash=67037943cdfae2a56924694d302a4b5697dc9a22$ 21706+// $hash=ca0daba10b2ed5ebb9610092967d60efde837706$ 21707 // 21708 21709 #include "libcef_dll/ctocpp/sslinfo_ctocpp.h" 21710diff --git a/src/cef/libcef_dll/ctocpp/sslinfo_ctocpp.h b/src/cef/libcef_dll/ctocpp/sslinfo_ctocpp.h 21711index 957fe16ce775c..80ed6f17a515f 21712--- a/src/cef/libcef_dll/ctocpp/sslinfo_ctocpp.h 21713+++ b/src/cef/libcef_dll/ctocpp/sslinfo_ctocpp.h 21714@@ -1,4 +1,4 @@ 21715-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21716+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21717 // reserved. Use of this source code is governed by a BSD-style license that 21718 // can be found in the LICENSE file. 21719 // 21720@@ -9,7 +9,7 @@ 21721 // implementations. See the translator.README.txt file in the tools directory 21722 // for more information. 21723 // 21724-// $hash=bd6c2733149181808f331fa69f9c6199a43eb730$ 21725+// $hash=d08212eed1df4078ed5bb72dd7fc6d478f476ecb$ 21726 // 21727 21728 #ifndef CEF_LIBCEF_DLL_CTOCPP_SSLINFO_CTOCPP_H_ 21729diff --git a/src/cef/libcef_dll/ctocpp/sslstatus_ctocpp.cc b/src/cef/libcef_dll/ctocpp/sslstatus_ctocpp.cc 21730index b0392d95c4ea7..5defe8fee422e 21731--- a/src/cef/libcef_dll/ctocpp/sslstatus_ctocpp.cc 21732+++ b/src/cef/libcef_dll/ctocpp/sslstatus_ctocpp.cc 21733@@ -1,4 +1,4 @@ 21734-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21735+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21736 // reserved. Use of this source code is governed by a BSD-style license that 21737 // can be found in the LICENSE file. 21738 // 21739@@ -9,7 +9,7 @@ 21740 // implementations. See the translator.README.txt file in the tools directory 21741 // for more information. 21742 // 21743-// $hash=18492d14d83b0dfd272ddd9dd95a2fc292bf8904$ 21744+// $hash=82f44b0f9739a59e0d9cfad14282998f281dd0a8$ 21745 // 21746 21747 #include "libcef_dll/ctocpp/sslstatus_ctocpp.h" 21748diff --git a/src/cef/libcef_dll/ctocpp/sslstatus_ctocpp.h b/src/cef/libcef_dll/ctocpp/sslstatus_ctocpp.h 21749index 8b9e5febfb588..c36c525480511 21750--- a/src/cef/libcef_dll/ctocpp/sslstatus_ctocpp.h 21751+++ b/src/cef/libcef_dll/ctocpp/sslstatus_ctocpp.h 21752@@ -1,4 +1,4 @@ 21753-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21754+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21755 // reserved. Use of this source code is governed by a BSD-style license that 21756 // can be found in the LICENSE file. 21757 // 21758@@ -9,7 +9,7 @@ 21759 // implementations. See the translator.README.txt file in the tools directory 21760 // for more information. 21761 // 21762-// $hash=75331cb462e0944adffd05e9138561eb1cd68226$ 21763+// $hash=af612f99d0ccc287b152a20b3e9956af223f82e0$ 21764 // 21765 21766 #ifndef CEF_LIBCEF_DLL_CTOCPP_SSLSTATUS_CTOCPP_H_ 21767diff --git a/src/cef/libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.cc 21768index 282357f875619..8295518883e1c 21769--- a/src/cef/libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.cc 21770+++ b/src/cef/libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.cc 21771@@ -1,4 +1,4 @@ 21772-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21773+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21774 // reserved. Use of this source code is governed by a BSD-style license that 21775 // can be found in the LICENSE file. 21776 // 21777@@ -9,7 +9,7 @@ 21778 // implementations. See the translator.README.txt file in the tools directory 21779 // for more information. 21780 // 21781-// $hash=3ea3777da287fb256c81d7659000104b85d99c45$ 21782+// $hash=ef42fcbe56e93182d9f4b5063d55b33ce9086e55$ 21783 // 21784 21785 #include "libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.h" 21786diff --git a/src/cef/libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.h 21787index 75369b7e2e97c..9e1fffd6d1020 21788--- a/src/cef/libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.h 21789+++ b/src/cef/libcef_dll/ctocpp/store_web_archive_result_callback_ctocpp.h 21790@@ -1,4 +1,4 @@ 21791-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21792+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21793 // reserved. Use of this source code is governed by a BSD-style license that 21794 // can be found in the LICENSE file. 21795 // 21796@@ -9,7 +9,7 @@ 21797 // implementations. See the translator.README.txt file in the tools directory 21798 // for more information. 21799 // 21800-// $hash=ad8ad631ed5942baa7ae146fe31316d0952d3d36$ 21801+// $hash=13d8e7ac8493bcf02b39067e63e0d9fe3e7e8e65$ 21802 // 21803 21804 #ifndef CEF_LIBCEF_DLL_CTOCPP_STORE_WEB_ARCHIVE_RESULT_CALLBACK_CTOCPP_H_ 21805diff --git a/src/cef/libcef_dll/ctocpp/stream_reader_ctocpp.cc b/src/cef/libcef_dll/ctocpp/stream_reader_ctocpp.cc 21806index 522ebdea8882e..4cf6ae4b55cec 21807--- a/src/cef/libcef_dll/ctocpp/stream_reader_ctocpp.cc 21808+++ b/src/cef/libcef_dll/ctocpp/stream_reader_ctocpp.cc 21809@@ -1,4 +1,4 @@ 21810-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21811+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21812 // reserved. Use of this source code is governed by a BSD-style license that 21813 // can be found in the LICENSE file. 21814 // 21815@@ -9,7 +9,7 @@ 21816 // implementations. See the translator.README.txt file in the tools directory 21817 // for more information. 21818 // 21819-// $hash=964179bd73f8b5fa8d8adbd955deb7e720caaca7$ 21820+// $hash=7a5ee0caa0def472edae4f8fee336bf1db392071$ 21821 // 21822 21823 #include "libcef_dll/ctocpp/stream_reader_ctocpp.h" 21824diff --git a/src/cef/libcef_dll/ctocpp/stream_reader_ctocpp.h b/src/cef/libcef_dll/ctocpp/stream_reader_ctocpp.h 21825index 4faf464409784..1376f71494d90 21826--- a/src/cef/libcef_dll/ctocpp/stream_reader_ctocpp.h 21827+++ b/src/cef/libcef_dll/ctocpp/stream_reader_ctocpp.h 21828@@ -1,4 +1,4 @@ 21829-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21830+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21831 // reserved. Use of this source code is governed by a BSD-style license that 21832 // can be found in the LICENSE file. 21833 // 21834@@ -9,7 +9,7 @@ 21835 // implementations. See the translator.README.txt file in the tools directory 21836 // for more information. 21837 // 21838-// $hash=e512b79f803ab83f9f67e677ea916dd9f6bb8868$ 21839+// $hash=8a1cd61b67d54a528ac936415fa11ff1936cd628$ 21840 // 21841 21842 #ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ 21843diff --git a/src/cef/libcef_dll/ctocpp/stream_writer_ctocpp.cc b/src/cef/libcef_dll/ctocpp/stream_writer_ctocpp.cc 21844index d11649c31b07c..e4d6690e3af65 21845--- a/src/cef/libcef_dll/ctocpp/stream_writer_ctocpp.cc 21846+++ b/src/cef/libcef_dll/ctocpp/stream_writer_ctocpp.cc 21847@@ -1,4 +1,4 @@ 21848-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21849+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21850 // reserved. Use of this source code is governed by a BSD-style license that 21851 // can be found in the LICENSE file. 21852 // 21853@@ -9,7 +9,7 @@ 21854 // implementations. See the translator.README.txt file in the tools directory 21855 // for more information. 21856 // 21857-// $hash=e32b4745b887e33f589cb04e8b46a7317686e4c2$ 21858+// $hash=af95b6ab0679c220a35569ae4dc4c11907d30084$ 21859 // 21860 21861 #include "libcef_dll/ctocpp/stream_writer_ctocpp.h" 21862diff --git a/src/cef/libcef_dll/ctocpp/stream_writer_ctocpp.h b/src/cef/libcef_dll/ctocpp/stream_writer_ctocpp.h 21863index e091a67d61403..eceb31ac95f3c 21864--- a/src/cef/libcef_dll/ctocpp/stream_writer_ctocpp.h 21865+++ b/src/cef/libcef_dll/ctocpp/stream_writer_ctocpp.h 21866@@ -1,4 +1,4 @@ 21867-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21868+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21869 // reserved. Use of this source code is governed by a BSD-style license that 21870 // can be found in the LICENSE file. 21871 // 21872@@ -9,7 +9,7 @@ 21873 // implementations. See the translator.README.txt file in the tools directory 21874 // for more information. 21875 // 21876-// $hash=76a03eb8bf25cc337e838994c2bf4fe3f677aa6c$ 21877+// $hash=f1156f9657858024d8d0dc20af0b5f53e82b5d74$ 21878 // 21879 21880 #ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ 21881diff --git a/src/cef/libcef_dll/ctocpp/string_visitor_ctocpp.cc b/src/cef/libcef_dll/ctocpp/string_visitor_ctocpp.cc 21882index c1ece7b76fe24..e44f6335b2085 21883--- a/src/cef/libcef_dll/ctocpp/string_visitor_ctocpp.cc 21884+++ b/src/cef/libcef_dll/ctocpp/string_visitor_ctocpp.cc 21885@@ -1,4 +1,4 @@ 21886-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21887+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21888 // reserved. Use of this source code is governed by a BSD-style license that 21889 // can be found in the LICENSE file. 21890 // 21891@@ -9,7 +9,7 @@ 21892 // implementations. See the translator.README.txt file in the tools directory 21893 // for more information. 21894 // 21895-// $hash=97c52e0e29be9e4452825fb57d4014221c537baa$ 21896+// $hash=ae0e93265c6fa1d984a669177c162602f99be475$ 21897 // 21898 21899 #include "libcef_dll/ctocpp/string_visitor_ctocpp.h" 21900diff --git a/src/cef/libcef_dll/ctocpp/string_visitor_ctocpp.h b/src/cef/libcef_dll/ctocpp/string_visitor_ctocpp.h 21901index c107e783ea44d..53e15edcd50a5 21902--- a/src/cef/libcef_dll/ctocpp/string_visitor_ctocpp.h 21903+++ b/src/cef/libcef_dll/ctocpp/string_visitor_ctocpp.h 21904@@ -1,4 +1,4 @@ 21905-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21906+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21907 // reserved. Use of this source code is governed by a BSD-style license that 21908 // can be found in the LICENSE file. 21909 // 21910@@ -9,7 +9,7 @@ 21911 // implementations. See the translator.README.txt file in the tools directory 21912 // for more information. 21913 // 21914-// $hash=470dd514d2a3091216588819ee28296424649b57$ 21915+// $hash=6e693b6dd1a72803aa7243d7cd5de54354338c37$ 21916 // 21917 21918 #ifndef CEF_LIBCEF_DLL_CTOCPP_STRING_VISITOR_CTOCPP_H_ 21919diff --git a/src/cef/libcef_dll/ctocpp/task_ctocpp.cc b/src/cef/libcef_dll/ctocpp/task_ctocpp.cc 21920index d621f77995218..3296e28b1794c 21921--- a/src/cef/libcef_dll/ctocpp/task_ctocpp.cc 21922+++ b/src/cef/libcef_dll/ctocpp/task_ctocpp.cc 21923@@ -1,4 +1,4 @@ 21924-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21925+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21926 // reserved. Use of this source code is governed by a BSD-style license that 21927 // can be found in the LICENSE file. 21928 // 21929@@ -9,7 +9,7 @@ 21930 // implementations. See the translator.README.txt file in the tools directory 21931 // for more information. 21932 // 21933-// $hash=b99582b454aa33c5e9b2fa3f891ed0754621c377$ 21934+// $hash=26d9172375112a2aa89c76d7a371796c5a7b9892$ 21935 // 21936 21937 #include "libcef_dll/ctocpp/task_ctocpp.h" 21938diff --git a/src/cef/libcef_dll/ctocpp/task_ctocpp.h b/src/cef/libcef_dll/ctocpp/task_ctocpp.h 21939index 0fdb427d2e673..ccd90edb97cc1 21940--- a/src/cef/libcef_dll/ctocpp/task_ctocpp.h 21941+++ b/src/cef/libcef_dll/ctocpp/task_ctocpp.h 21942@@ -1,4 +1,4 @@ 21943-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21944+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21945 // reserved. Use of this source code is governed by a BSD-style license that 21946 // can be found in the LICENSE file. 21947 // 21948@@ -9,7 +9,7 @@ 21949 // implementations. See the translator.README.txt file in the tools directory 21950 // for more information. 21951 // 21952-// $hash=ec78aa696165cd02a3b7f19e877b89d58518d5ad$ 21953+// $hash=e722a5b9ae2bb6e3d3236a199930600dc3b5e0f8$ 21954 // 21955 21956 #ifndef CEF_LIBCEF_DLL_CTOCPP_TASK_CTOCPP_H_ 21957diff --git a/src/cef/libcef_dll/ctocpp/task_runner_ctocpp.cc b/src/cef/libcef_dll/ctocpp/task_runner_ctocpp.cc 21958index 89bf91e95c499..5613e36b34f42 21959--- a/src/cef/libcef_dll/ctocpp/task_runner_ctocpp.cc 21960+++ b/src/cef/libcef_dll/ctocpp/task_runner_ctocpp.cc 21961@@ -1,4 +1,4 @@ 21962-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21963+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21964 // reserved. Use of this source code is governed by a BSD-style license that 21965 // can be found in the LICENSE file. 21966 // 21967@@ -9,7 +9,7 @@ 21968 // implementations. See the translator.README.txt file in the tools directory 21969 // for more information. 21970 // 21971-// $hash=c4e54b985b45c9cf57f70a3c560fb1d6c5230f9a$ 21972+// $hash=9d367936047c38f9b70488ef5caf6d8ca081bb50$ 21973 // 21974 21975 #include "libcef_dll/ctocpp/task_runner_ctocpp.h" 21976diff --git a/src/cef/libcef_dll/ctocpp/task_runner_ctocpp.h b/src/cef/libcef_dll/ctocpp/task_runner_ctocpp.h 21977index ecec13d9cf48d..2f33aaffbd2cb 21978--- a/src/cef/libcef_dll/ctocpp/task_runner_ctocpp.h 21979+++ b/src/cef/libcef_dll/ctocpp/task_runner_ctocpp.h 21980@@ -1,4 +1,4 @@ 21981-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 21982+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 21983 // reserved. Use of this source code is governed by a BSD-style license that 21984 // can be found in the LICENSE file. 21985 // 21986@@ -9,7 +9,7 @@ 21987 // implementations. See the translator.README.txt file in the tools directory 21988 // for more information. 21989 // 21990-// $hash=795e78c45943dd3c23d95ed1b85e889288f2dcf1$ 21991+// $hash=372cc40047bb36d78f80f4d1edbbba30faad2c7f$ 21992 // 21993 21994 #ifndef CEF_LIBCEF_DLL_CTOCPP_TASK_RUNNER_CTOCPP_H_ 21995diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_ctocpp.cc 21996index affb998f98792..62491362aa47a 21997--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ctocpp.cc 21998+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ctocpp.cc 21999@@ -1,4 +1,4 @@ 22000-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22001+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22002 // reserved. Use of this source code is governed by a BSD-style license that 22003 // can be found in the LICENSE file. 22004 // 22005@@ -9,7 +9,7 @@ 22006 // implementations. See the translator.README.txt file in the tools directory 22007 // for more information. 22008 // 22009-// $hash=a28e85dbec92b031978a0d4c998c9cb1a853c9f8$ 22010+// $hash=fd81a3bbebda49174033f19fe2eafd501b367837$ 22011 // 22012 22013 #include "libcef_dll/ctocpp/test/translator_test_ctocpp.h" 22014@@ -692,8 +692,8 @@ NO_SANITIZE("cfi-icall") size_t CefTranslatorTestCToCpp::GetPointListSize() { 22015 } 22016 22017 NO_SANITIZE("cfi-icall") 22018-CefRefPtr<CefTranslatorTestRefPtrLibrary> 22019-CefTranslatorTestCToCpp::GetRefPtrLibrary(int val) { 22020+CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp:: 22021+ GetRefPtrLibrary(int val) { 22022 shutdown_checker::AssertNotShutdown(); 22023 22024 cef_translator_test_t* _struct = GetStruct(); 22025@@ -735,9 +735,8 @@ int CefTranslatorTestCToCpp::SetRefPtrLibrary( 22026 } 22027 22028 NO_SANITIZE("cfi-icall") 22029-CefRefPtr<CefTranslatorTestRefPtrLibrary> 22030-CefTranslatorTestCToCpp::SetRefPtrLibraryAndReturn( 22031- CefRefPtr<CefTranslatorTestRefPtrLibrary> val) { 22032+CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp:: 22033+ SetRefPtrLibraryAndReturn(CefRefPtr<CefTranslatorTestRefPtrLibrary> val) { 22034 shutdown_checker::AssertNotShutdown(); 22035 22036 cef_translator_test_t* _struct = GetStruct(); 22037@@ -785,9 +784,9 @@ int CefTranslatorTestCToCpp::SetChildRefPtrLibrary( 22038 } 22039 22040 NO_SANITIZE("cfi-icall") 22041-CefRefPtr<CefTranslatorTestRefPtrLibrary> 22042-CefTranslatorTestCToCpp::SetChildRefPtrLibraryAndReturnParent( 22043- CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) { 22044+CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp:: 22045+ SetChildRefPtrLibraryAndReturnParent( 22046+ CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) { 22047 shutdown_checker::AssertNotShutdown(); 22048 22049 cef_translator_test_t* _struct = GetStruct(); 22050@@ -937,9 +936,8 @@ int CefTranslatorTestCToCpp::SetRefPtrClient( 22051 } 22052 22053 NO_SANITIZE("cfi-icall") 22054-CefRefPtr<CefTranslatorTestRefPtrClient> 22055-CefTranslatorTestCToCpp::SetRefPtrClientAndReturn( 22056- CefRefPtr<CefTranslatorTestRefPtrClient> val) { 22057+CefRefPtr<CefTranslatorTestRefPtrClient> CefTranslatorTestCToCpp:: 22058+ SetRefPtrClientAndReturn(CefRefPtr<CefTranslatorTestRefPtrClient> val) { 22059 shutdown_checker::AssertNotShutdown(); 22060 22061 cef_translator_test_t* _struct = GetStruct(); 22062@@ -987,9 +985,9 @@ int CefTranslatorTestCToCpp::SetChildRefPtrClient( 22063 } 22064 22065 NO_SANITIZE("cfi-icall") 22066-CefRefPtr<CefTranslatorTestRefPtrClient> 22067-CefTranslatorTestCToCpp::SetChildRefPtrClientAndReturnParent( 22068- CefRefPtr<CefTranslatorTestRefPtrClientChild> val) { 22069+CefRefPtr<CefTranslatorTestRefPtrClient> CefTranslatorTestCToCpp:: 22070+ SetChildRefPtrClientAndReturnParent( 22071+ CefRefPtr<CefTranslatorTestRefPtrClientChild> val) { 22072 shutdown_checker::AssertNotShutdown(); 22073 22074 cef_translator_test_t* _struct = GetStruct(); 22075@@ -1127,8 +1125,8 @@ size_t CefTranslatorTestCToCpp::GetRefPtrClientListSize() { 22076 } 22077 22078 NO_SANITIZE("cfi-icall") 22079-CefOwnPtr<CefTranslatorTestScopedLibrary> 22080-CefTranslatorTestCToCpp::GetOwnPtrLibrary(int val) { 22081+CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp:: 22082+ GetOwnPtrLibrary(int val) { 22083 shutdown_checker::AssertNotShutdown(); 22084 22085 cef_translator_test_t* _struct = GetStruct(); 22086@@ -1170,9 +1168,8 @@ int CefTranslatorTestCToCpp::SetOwnPtrLibrary( 22087 } 22088 22089 NO_SANITIZE("cfi-icall") 22090-CefOwnPtr<CefTranslatorTestScopedLibrary> 22091-CefTranslatorTestCToCpp::SetOwnPtrLibraryAndReturn( 22092- CefOwnPtr<CefTranslatorTestScopedLibrary> val) { 22093+CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp:: 22094+ SetOwnPtrLibraryAndReturn(CefOwnPtr<CefTranslatorTestScopedLibrary> val) { 22095 shutdown_checker::AssertNotShutdown(); 22096 22097 cef_translator_test_t* _struct = GetStruct(); 22098@@ -1222,9 +1219,9 @@ int CefTranslatorTestCToCpp::SetChildOwnPtrLibrary( 22099 } 22100 22101 NO_SANITIZE("cfi-icall") 22102-CefOwnPtr<CefTranslatorTestScopedLibrary> 22103-CefTranslatorTestCToCpp::SetChildOwnPtrLibraryAndReturnParent( 22104- CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) { 22105+CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp:: 22106+ SetChildOwnPtrLibraryAndReturnParent( 22107+ CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) { 22108 shutdown_checker::AssertNotShutdown(); 22109 22110 cef_translator_test_t* _struct = GetStruct(); 22111@@ -1273,9 +1270,8 @@ int CefTranslatorTestCToCpp::SetOwnPtrClient( 22112 } 22113 22114 NO_SANITIZE("cfi-icall") 22115-CefOwnPtr<CefTranslatorTestScopedClient> 22116-CefTranslatorTestCToCpp::SetOwnPtrClientAndReturn( 22117- CefOwnPtr<CefTranslatorTestScopedClient> val) { 22118+CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp:: 22119+ SetOwnPtrClientAndReturn(CefOwnPtr<CefTranslatorTestScopedClient> val) { 22120 shutdown_checker::AssertNotShutdown(); 22121 22122 cef_translator_test_t* _struct = GetStruct(); 22123@@ -1325,9 +1321,9 @@ int CefTranslatorTestCToCpp::SetChildOwnPtrClient( 22124 } 22125 22126 NO_SANITIZE("cfi-icall") 22127-CefOwnPtr<CefTranslatorTestScopedClient> 22128-CefTranslatorTestCToCpp::SetChildOwnPtrClientAndReturnParent( 22129- CefOwnPtr<CefTranslatorTestScopedClientChild> val) { 22130+CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp:: 22131+ SetChildOwnPtrClientAndReturnParent( 22132+ CefOwnPtr<CefTranslatorTestScopedClientChild> val) { 22133 shutdown_checker::AssertNotShutdown(); 22134 22135 cef_translator_test_t* _struct = GetStruct(); 22136diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_ctocpp.h 22137index 35da08479b6b4..8384cefe5b8ca 22138--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ctocpp.h 22139+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ctocpp.h 22140@@ -1,4 +1,4 @@ 22141-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22142+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22143 // reserved. Use of this source code is governed by a BSD-style license that 22144 // can be found in the LICENSE file. 22145 // 22146@@ -9,7 +9,7 @@ 22147 // implementations. See the translator.README.txt file in the tools directory 22148 // for more information. 22149 // 22150-// $hash=774d22a8a54e71a2511ce6a66491d9563302f0bf$ 22151+// $hash=915917340262b6243b06022fe96cc1e96625cac9$ 22152 // 22153 22154 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_ 22155diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc 22156index 89c9f27dba596..b491fb2541c8f 22157--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc 22158+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc 22159@@ -1,4 +1,4 @@ 22160-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22161+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22162 // reserved. Use of this source code is governed by a BSD-style license that 22163 // can be found in the LICENSE file. 22164 // 22165@@ -9,7 +9,7 @@ 22166 // implementations. See the translator.README.txt file in the tools directory 22167 // for more information. 22168 // 22169-// $hash=6aacf410858db1defe08179c985f4466fca2751f$ 22170+// $hash=aa0f3c0f4378474dbd62f65751378c4402bd591c$ 22171 // 22172 22173 #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h" 22174diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h 22175index 944ad33402a0d..d59c50cf4f9a2 22176--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h 22177+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h 22178@@ -1,4 +1,4 @@ 22179-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22180+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22181 // reserved. Use of this source code is governed by a BSD-style license that 22182 // can be found in the LICENSE file. 22183 // 22184@@ -9,7 +9,7 @@ 22185 // implementations. See the translator.README.txt file in the tools directory 22186 // for more information. 22187 // 22188-// $hash=f3c4158147b008b8fff038ff6f731419a9950c4d$ 22189+// $hash=971a30d8a2814ecdddb08763016621ce94b9da92$ 22190 // 22191 22192 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CTOCPP_H_ 22193diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc 22194index 014e615300eda..720d5e6dc34aa 22195--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc 22196+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc 22197@@ -1,4 +1,4 @@ 22198-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22199+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22200 // reserved. Use of this source code is governed by a BSD-style license that 22201 // can be found in the LICENSE file. 22202 // 22203@@ -9,7 +9,7 @@ 22204 // implementations. See the translator.README.txt file in the tools directory 22205 // for more information. 22206 // 22207-// $hash=ca187683ddab3822fcf3d957c76ed27db6e8e433$ 22208+// $hash=06ef08d535f3cc8b9ac7da2cb38711b01c58ca8e$ 22209 // 22210 22211 #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h" 22212diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h 22213index 0c06f5828dad6..968847f2b10ca 22214--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h 22215+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h 22216@@ -1,4 +1,4 @@ 22217-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22218+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22219 // reserved. Use of this source code is governed by a BSD-style license that 22220 // can be found in the LICENSE file. 22221 // 22222@@ -9,7 +9,7 @@ 22223 // implementations. See the translator.README.txt file in the tools directory 22224 // for more information. 22225 // 22226-// $hash=2e2a98039972801804b3b4d7b1d1220406489ad3$ 22227+// $hash=a083f0198c6c93ee0fccdb262dce8dc567abbf9c$ 22228 // 22229 22230 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CTOCPP_H_ 22231diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc 22232index 2dd42a1b3e172..3e6da2333e58d 22233--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc 22234+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc 22235@@ -1,4 +1,4 @@ 22236-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22237+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22238 // reserved. Use of this source code is governed by a BSD-style license that 22239 // can be found in the LICENSE file. 22240 // 22241@@ -9,7 +9,7 @@ 22242 // implementations. See the translator.README.txt file in the tools directory 22243 // for more information. 22244 // 22245-// $hash=5e599a9605e47372695d89a86eab37827e5971f2$ 22246+// $hash=ed0f0c476f97fffa6f0b29c005508b475268f4c2$ 22247 // 22248 22249 #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h" 22250@@ -18,10 +18,9 @@ 22251 // STATIC METHODS - Body may be edited by hand. 22252 22253 NO_SANITIZE("cfi-icall") 22254-CefRefPtr<CefTranslatorTestRefPtrLibraryChildChild> 22255-CefTranslatorTestRefPtrLibraryChildChild::Create(int value, 22256- int other_value, 22257- int other_other_value) { 22258+CefRefPtr< 22259+ CefTranslatorTestRefPtrLibraryChildChild> CefTranslatorTestRefPtrLibraryChildChild:: 22260+ Create(int value, int other_value, int other_other_value) { 22261 shutdown_checker::AssertNotShutdown(); 22262 22263 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 22264diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h 22265index 91721a654561f..f6a503a2956b1 22266--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h 22267+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h 22268@@ -1,4 +1,4 @@ 22269-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22270+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22271 // reserved. Use of this source code is governed by a BSD-style license that 22272 // can be found in the LICENSE file. 22273 // 22274@@ -9,7 +9,7 @@ 22275 // implementations. See the translator.README.txt file in the tools directory 22276 // for more information. 22277 // 22278-// $hash=32cd86770e8fac3498f23bff1a0efac7a875997e$ 22279+// $hash=49af27e043172c178c3ef4f37805069e6af739e6$ 22280 // 22281 22282 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CTOCPP_H_ 22283diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc 22284index ed17322cde510..17cd2c16deeca 22285--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc 22286+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc 22287@@ -1,4 +1,4 @@ 22288-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22289+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22290 // reserved. Use of this source code is governed by a BSD-style license that 22291 // can be found in the LICENSE file. 22292 // 22293@@ -9,7 +9,7 @@ 22294 // implementations. See the translator.README.txt file in the tools directory 22295 // for more information. 22296 // 22297-// $hash=8559b9fd1e73bb91333d687174f5730e67f1f0f2$ 22298+// $hash=f6e8f53e06ca266f08582a01a75da91669335bb4$ 22299 // 22300 22301 #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h" 22302@@ -19,8 +19,9 @@ 22303 // STATIC METHODS - Body may be edited by hand. 22304 22305 NO_SANITIZE("cfi-icall") 22306-CefRefPtr<CefTranslatorTestRefPtrLibraryChild> 22307-CefTranslatorTestRefPtrLibraryChild::Create(int value, int other_value) { 22308+CefRefPtr< 22309+ CefTranslatorTestRefPtrLibraryChild> CefTranslatorTestRefPtrLibraryChild:: 22310+ Create(int value, int other_value) { 22311 shutdown_checker::AssertNotShutdown(); 22312 22313 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 22314diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h 22315index da6b1bcfc8c3c..a5e5b711626ec 22316--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h 22317+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h 22318@@ -1,4 +1,4 @@ 22319-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22320+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22321 // reserved. Use of this source code is governed by a BSD-style license that 22322 // can be found in the LICENSE file. 22323 // 22324@@ -9,7 +9,7 @@ 22325 // implementations. See the translator.README.txt file in the tools directory 22326 // for more information. 22327 // 22328-// $hash=9d4419c7bdfefd05f890a65b0660459aaf2d09b5$ 22329+// $hash=ef77c876031b14fdee487305c5cfded6a9cb910f$ 22330 // 22331 22332 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CTOCPP_H_ 22333diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc 22334index 9d0f21f5a6257..ba122a70e23ab 22335--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc 22336+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc 22337@@ -1,4 +1,4 @@ 22338-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22339+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22340 // reserved. Use of this source code is governed by a BSD-style license that 22341 // can be found in the LICENSE file. 22342 // 22343@@ -9,7 +9,7 @@ 22344 // implementations. See the translator.README.txt file in the tools directory 22345 // for more information. 22346 // 22347-// $hash=f320ce71f5396e28767dfdb2292c87a8c2396cf8$ 22348+// $hash=9350838bdab0fb5944a83d88f3cdd07485934de3$ 22349 // 22350 22351 #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h" 22352@@ -20,8 +20,8 @@ 22353 // STATIC METHODS - Body may be edited by hand. 22354 22355 NO_SANITIZE("cfi-icall") 22356-CefRefPtr<CefTranslatorTestRefPtrLibrary> 22357-CefTranslatorTestRefPtrLibrary::Create(int value) { 22358+CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestRefPtrLibrary:: 22359+ Create(int value) { 22360 shutdown_checker::AssertNotShutdown(); 22361 22362 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 22363diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h 22364index c272ec8dba8df..94ff9da719a4a 22365--- a/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h 22366+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h 22367@@ -1,4 +1,4 @@ 22368-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22369+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22370 // reserved. Use of this source code is governed by a BSD-style license that 22371 // can be found in the LICENSE file. 22372 // 22373@@ -9,7 +9,7 @@ 22374 // implementations. See the translator.README.txt file in the tools directory 22375 // for more information. 22376 // 22377-// $hash=231daa6fa72550190c115cce1bd560cb6c1bff3d$ 22378+// $hash=9fa8897ee5081b7cd95a6cb791fb69871f61406e$ 22379 // 22380 22381 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CTOCPP_H_ 22382diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc 22383index 2d9a98250d86d..fa073a3022440 22384--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc 22385+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc 22386@@ -1,4 +1,4 @@ 22387-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22388+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22389 // reserved. Use of this source code is governed by a BSD-style license that 22390 // can be found in the LICENSE file. 22391 // 22392@@ -9,7 +9,7 @@ 22393 // implementations. See the translator.README.txt file in the tools directory 22394 // for more information. 22395 // 22396-// $hash=fa5ba1bf14400032e49a447b7fe9dbe9cf1ba397$ 22397+// $hash=80f2c8ea70fc27532676263174c3bb9dab73cd7f$ 22398 // 22399 22400 #include "libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h" 22401diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h 22402index 7476a3f9cf4a5..36339c17754ef 22403--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h 22404+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h 22405@@ -1,4 +1,4 @@ 22406-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22407+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22408 // reserved. Use of this source code is governed by a BSD-style license that 22409 // can be found in the LICENSE file. 22410 // 22411@@ -9,7 +9,7 @@ 22412 // implementations. See the translator.README.txt file in the tools directory 22413 // for more information. 22414 // 22415-// $hash=4ab24d3002067939ef0106a8686ca59559b2270e$ 22416+// $hash=ec4bff6137c66581b34dc2ef11beb02276de163a$ 22417 // 22418 22419 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CTOCPP_H_ 22420diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc 22421index 3756c08be5082..d07db6f3ca934 22422--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc 22423+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc 22424@@ -1,4 +1,4 @@ 22425-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22426+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22427 // reserved. Use of this source code is governed by a BSD-style license that 22428 // can be found in the LICENSE file. 22429 // 22430@@ -9,7 +9,7 @@ 22431 // implementations. See the translator.README.txt file in the tools directory 22432 // for more information. 22433 // 22434-// $hash=64d48341c3629153282b16d20e858e8166f6dbbd$ 22435+// $hash=d4be1c7299a237b9c5fc3ef0629e4fc502bd94d5$ 22436 // 22437 22438 #include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h" 22439diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h 22440index 8ca713b78e3d6..caeaf6941d6fa 22441--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h 22442+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h 22443@@ -1,4 +1,4 @@ 22444-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22445+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22446 // reserved. Use of this source code is governed by a BSD-style license that 22447 // can be found in the LICENSE file. 22448 // 22449@@ -9,7 +9,7 @@ 22450 // implementations. See the translator.README.txt file in the tools directory 22451 // for more information. 22452 // 22453-// $hash=d0a9d6ca17834c09fbd63e06ebb38c337dc64f62$ 22454+// $hash=d511f3a8273e4d9c6acff3d183b7bfa84e1385e3$ 22455 // 22456 22457 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CTOCPP_H_ 22458diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc 22459index bfeea0faffda6..be5ec972a64a9 22460--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc 22461+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc 22462@@ -1,4 +1,4 @@ 22463-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22464+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22465 // reserved. Use of this source code is governed by a BSD-style license that 22466 // can be found in the LICENSE file. 22467 // 22468@@ -9,7 +9,7 @@ 22469 // implementations. See the translator.README.txt file in the tools directory 22470 // for more information. 22471 // 22472-// $hash=2663f92f7373738d13ee8d194684e6f818afa950$ 22473+// $hash=48599a7413e48d0e2f053aa6fdfdec866387e149$ 22474 // 22475 22476 #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h" 22477@@ -17,10 +17,9 @@ 22478 // STATIC METHODS - Body may be edited by hand. 22479 22480 NO_SANITIZE("cfi-icall") 22481-CefOwnPtr<CefTranslatorTestScopedLibraryChildChild> 22482-CefTranslatorTestScopedLibraryChildChild::Create(int value, 22483- int other_value, 22484- int other_other_value) { 22485+CefOwnPtr< 22486+ CefTranslatorTestScopedLibraryChildChild> CefTranslatorTestScopedLibraryChildChild:: 22487+ Create(int value, int other_value, int other_other_value) { 22488 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 22489 22490 // Execute 22491diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h 22492index e3e05d1c1a1b2..8b3fd3485db40 22493--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h 22494+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h 22495@@ -1,4 +1,4 @@ 22496-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22497+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22498 // reserved. Use of this source code is governed by a BSD-style license that 22499 // can be found in the LICENSE file. 22500 // 22501@@ -9,7 +9,7 @@ 22502 // implementations. See the translator.README.txt file in the tools directory 22503 // for more information. 22504 // 22505-// $hash=d430f8b9888494995d534bac8a61d809acb5fde7$ 22506+// $hash=b6fc182f3444ce3926bff6d2b30d14aeca4cb9ba$ 22507 // 22508 22509 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CTOCPP_H_ 22510diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc 22511index c2d2a73720920..916749490414f 22512--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc 22513+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc 22514@@ -1,4 +1,4 @@ 22515-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22516+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22517 // reserved. Use of this source code is governed by a BSD-style license that 22518 // can be found in the LICENSE file. 22519 // 22520@@ -9,7 +9,7 @@ 22521 // implementations. See the translator.README.txt file in the tools directory 22522 // for more information. 22523 // 22524-// $hash=cf0153094b5c99af0d2ff0f278da810e13a6d889$ 22525+// $hash=b591e72d8eb23b5ed62a7d877e5a498211fd029f$ 22526 // 22527 22528 #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h" 22529@@ -18,8 +18,9 @@ 22530 // STATIC METHODS - Body may be edited by hand. 22531 22532 NO_SANITIZE("cfi-icall") 22533-CefOwnPtr<CefTranslatorTestScopedLibraryChild> 22534-CefTranslatorTestScopedLibraryChild::Create(int value, int other_value) { 22535+CefOwnPtr< 22536+ CefTranslatorTestScopedLibraryChild> CefTranslatorTestScopedLibraryChild:: 22537+ Create(int value, int other_value) { 22538 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 22539 22540 // Execute 22541diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h 22542index ed77db0d85abf..e4ab2f9ea42ae 22543--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h 22544+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h 22545@@ -1,4 +1,4 @@ 22546-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22547+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22548 // reserved. Use of this source code is governed by a BSD-style license that 22549 // can be found in the LICENSE file. 22550 // 22551@@ -9,7 +9,7 @@ 22552 // implementations. See the translator.README.txt file in the tools directory 22553 // for more information. 22554 // 22555-// $hash=76f7b6c6e70c1a0e516bb840287553e4163866b7$ 22556+// $hash=954fc390e3b474eedcf0bbb3df41e717c00449d3$ 22557 // 22558 22559 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CTOCPP_H_ 22560diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc 22561index e619944d5e172..2bc97d33bcd92 22562--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc 22563+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc 22564@@ -1,4 +1,4 @@ 22565-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22566+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22567 // reserved. Use of this source code is governed by a BSD-style license that 22568 // can be found in the LICENSE file. 22569 // 22570@@ -9,7 +9,7 @@ 22571 // implementations. See the translator.README.txt file in the tools directory 22572 // for more information. 22573 // 22574-// $hash=a3fd73f0bc089be47e4ebaf9db033d51bebe1498$ 22575+// $hash=75d382a064212122a7aba39519a9ab4bf8e36160$ 22576 // 22577 22578 #include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h" 22579@@ -19,8 +19,8 @@ 22580 // STATIC METHODS - Body may be edited by hand. 22581 22582 NO_SANITIZE("cfi-icall") 22583-CefOwnPtr<CefTranslatorTestScopedLibrary> 22584-CefTranslatorTestScopedLibrary::Create(int value) { 22585+CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestScopedLibrary:: 22586+ Create(int value) { 22587 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 22588 22589 // Execute 22590diff --git a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h 22591index 3ff0bbe1694eb..c40e19efc74b2 22592--- a/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h 22593+++ b/src/cef/libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h 22594@@ -1,4 +1,4 @@ 22595-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22596+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22597 // reserved. Use of this source code is governed by a BSD-style license that 22598 // can be found in the LICENSE file. 22599 // 22600@@ -9,7 +9,7 @@ 22601 // implementations. See the translator.README.txt file in the tools directory 22602 // for more information. 22603 // 22604-// $hash=0c47852a4585753b8775a38b380be6f38fe45027$ 22605+// $hash=5fafb4986f557d448f6f234fd49ea899eac81af1$ 22606 // 22607 22608 #ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CTOCPP_H_ 22609diff --git a/src/cef/libcef_dll/ctocpp/thread_ctocpp.cc b/src/cef/libcef_dll/ctocpp/thread_ctocpp.cc 22610index 9409fb6c2d5ad..abeaabd45f539 22611--- a/src/cef/libcef_dll/ctocpp/thread_ctocpp.cc 22612+++ b/src/cef/libcef_dll/ctocpp/thread_ctocpp.cc 22613@@ -1,4 +1,4 @@ 22614-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22615+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22616 // reserved. Use of this source code is governed by a BSD-style license that 22617 // can be found in the LICENSE file. 22618 // 22619@@ -9,7 +9,7 @@ 22620 // implementations. See the translator.README.txt file in the tools directory 22621 // for more information. 22622 // 22623-// $hash=207fe292d5fec167e20971c9948d0b183e6b3b20$ 22624+// $hash=20ac33e64e1f0d3ada4403665da43b34c2ae635d$ 22625 // 22626 22627 #include "libcef_dll/ctocpp/thread_ctocpp.h" 22628diff --git a/src/cef/libcef_dll/ctocpp/thread_ctocpp.h b/src/cef/libcef_dll/ctocpp/thread_ctocpp.h 22629index cfccc6ade380a..5bdc3574ce620 22630--- a/src/cef/libcef_dll/ctocpp/thread_ctocpp.h 22631+++ b/src/cef/libcef_dll/ctocpp/thread_ctocpp.h 22632@@ -1,4 +1,4 @@ 22633-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22634+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22635 // reserved. Use of this source code is governed by a BSD-style license that 22636 // can be found in the LICENSE file. 22637 // 22638@@ -9,7 +9,7 @@ 22639 // implementations. See the translator.README.txt file in the tools directory 22640 // for more information. 22641 // 22642-// $hash=44235fe8d735fdbbb7482c647f7779247f43a2f5$ 22643+// $hash=63729fa2f06672498bde63eaa8151b20db9e6fd8$ 22644 // 22645 22646 #ifndef CEF_LIBCEF_DLL_CTOCPP_THREAD_CTOCPP_H_ 22647diff --git a/src/cef/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc b/src/cef/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc 22648index 8e6bf46cafb25..4471ec7c1caf5 22649--- a/src/cef/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc 22650+++ b/src/cef/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc 22651@@ -1,4 +1,4 @@ 22652-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22653+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22654 // reserved. Use of this source code is governed by a BSD-style license that 22655 // can be found in the LICENSE file. 22656 // 22657@@ -9,7 +9,7 @@ 22658 // implementations. See the translator.README.txt file in the tools directory 22659 // for more information. 22660 // 22661-// $hash=54962c13fcad1a38aaad37a7dae6744090ebee97$ 22662+// $hash=aff88b737847eb0217c13f396e450ce68c554bb7$ 22663 // 22664 22665 #include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h" 22666diff --git a/src/cef/libcef_dll/ctocpp/urlrequest_client_ctocpp.h b/src/cef/libcef_dll/ctocpp/urlrequest_client_ctocpp.h 22667index 7cef3061cc6f9..dd081f9c62504 22668--- a/src/cef/libcef_dll/ctocpp/urlrequest_client_ctocpp.h 22669+++ b/src/cef/libcef_dll/ctocpp/urlrequest_client_ctocpp.h 22670@@ -1,4 +1,4 @@ 22671-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22672+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22673 // reserved. Use of this source code is governed by a BSD-style license that 22674 // can be found in the LICENSE file. 22675 // 22676@@ -9,7 +9,7 @@ 22677 // implementations. See the translator.README.txt file in the tools directory 22678 // for more information. 22679 // 22680-// $hash=31b2f537bea0b8088a861224b42c313ee87927d6$ 22681+// $hash=50740eddae0ae234cf24d2b73eadcfdb16fcf0f0$ 22682 // 22683 22684 #ifndef CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CLIENT_CTOCPP_H_ 22685diff --git a/src/cef/libcef_dll/ctocpp/urlrequest_ctocpp.cc b/src/cef/libcef_dll/ctocpp/urlrequest_ctocpp.cc 22686index 6acd4a9cd2be2..b754fc9e00288 22687--- a/src/cef/libcef_dll/ctocpp/urlrequest_ctocpp.cc 22688+++ b/src/cef/libcef_dll/ctocpp/urlrequest_ctocpp.cc 22689@@ -1,4 +1,4 @@ 22690-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22691+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22692 // reserved. Use of this source code is governed by a BSD-style license that 22693 // can be found in the LICENSE file. 22694 // 22695@@ -9,7 +9,7 @@ 22696 // implementations. See the translator.README.txt file in the tools directory 22697 // for more information. 22698 // 22699-// $hash=d3d0a83754df9a39d8f951ea488dd5417d20e9b2$ 22700+// $hash=eb0b6de22dac921f6fc10121ca33f3dd31ddf6c9$ 22701 // 22702 22703 #include "libcef_dll/ctocpp/urlrequest_ctocpp.h" 22704diff --git a/src/cef/libcef_dll/ctocpp/urlrequest_ctocpp.h b/src/cef/libcef_dll/ctocpp/urlrequest_ctocpp.h 22705index 5c879dd06436f..7a2bff5eac300 22706--- a/src/cef/libcef_dll/ctocpp/urlrequest_ctocpp.h 22707+++ b/src/cef/libcef_dll/ctocpp/urlrequest_ctocpp.h 22708@@ -1,4 +1,4 @@ 22709-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22710+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22711 // reserved. Use of this source code is governed by a BSD-style license that 22712 // can be found in the LICENSE file. 22713 // 22714@@ -9,7 +9,7 @@ 22715 // implementations. See the translator.README.txt file in the tools directory 22716 // for more information. 22717 // 22718-// $hash=896c3b5eea61c12c9101ddc5795ed63125ec3445$ 22719+// $hash=8c953a3dd5cdec5cba6160e848884c2f7c9b3ac6$ 22720 // 22721 22722 #ifndef CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_ 22723diff --git a/src/cef/libcef_dll/ctocpp/v8accessor_ctocpp.cc b/src/cef/libcef_dll/ctocpp/v8accessor_ctocpp.cc 22724index 8b6fd3bd718f1..ac60daf2a2712 22725--- a/src/cef/libcef_dll/ctocpp/v8accessor_ctocpp.cc 22726+++ b/src/cef/libcef_dll/ctocpp/v8accessor_ctocpp.cc 22727@@ -1,4 +1,4 @@ 22728-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22729+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22730 // reserved. Use of this source code is governed by a BSD-style license that 22731 // can be found in the LICENSE file. 22732 // 22733@@ -9,7 +9,7 @@ 22734 // implementations. See the translator.README.txt file in the tools directory 22735 // for more information. 22736 // 22737-// $hash=c2815712e9960e6850bb646ba0009fe42e8a2624$ 22738+// $hash=5bcd3bf00cfea75a32f61b539fd3232a87b0ccdc$ 22739 // 22740 22741 #include "libcef_dll/ctocpp/v8accessor_ctocpp.h" 22742diff --git a/src/cef/libcef_dll/ctocpp/v8accessor_ctocpp.h b/src/cef/libcef_dll/ctocpp/v8accessor_ctocpp.h 22743index 6b552a781ea20..45c4de9f41133 22744--- a/src/cef/libcef_dll/ctocpp/v8accessor_ctocpp.h 22745+++ b/src/cef/libcef_dll/ctocpp/v8accessor_ctocpp.h 22746@@ -1,4 +1,4 @@ 22747-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22748+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22749 // reserved. Use of this source code is governed by a BSD-style license that 22750 // can be found in the LICENSE file. 22751 // 22752@@ -9,7 +9,7 @@ 22753 // implementations. See the translator.README.txt file in the tools directory 22754 // for more information. 22755 // 22756-// $hash=0c7b83fe013c87d35cf3c944e53ec7afef0ac11a$ 22757+// $hash=1d8a3afd0e6a0344a9c5f6e301b517e5f906c186$ 22758 // 22759 22760 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8ACCESSOR_CTOCPP_H_ 22761diff --git a/src/cef/libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc b/src/cef/libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc 22762index aa062aa4a61fc..c6f707eb815b2 22763--- a/src/cef/libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc 22764+++ b/src/cef/libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc 22765@@ -1,4 +1,4 @@ 22766-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22767+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22768 // reserved. Use of this source code is governed by a BSD-style license that 22769 // can be found in the LICENSE file. 22770 // 22771@@ -9,7 +9,7 @@ 22772 // implementations. See the translator.README.txt file in the tools directory 22773 // for more information. 22774 // 22775-// $hash=04697e01edeb16ce60053867fa2b11d03dec3427$ 22776+// $hash=517e771ec058ffae390f595c0d6d0ff96a24a061$ 22777 // 22778 22779 #include "libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h" 22780diff --git a/src/cef/libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h b/src/cef/libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h 22781index b1d10766a0916..4a5292531f63a 22782--- a/src/cef/libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h 22783+++ b/src/cef/libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h 22784@@ -1,4 +1,4 @@ 22785-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22786+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22787 // reserved. Use of this source code is governed by a BSD-style license that 22788 // can be found in the LICENSE file. 22789 // 22790@@ -9,7 +9,7 @@ 22791 // implementations. See the translator.README.txt file in the tools directory 22792 // for more information. 22793 // 22794-// $hash=e494919a69c37ed2aa5dcd0f8ddfcbbdafba2ebb$ 22795+// $hash=4f9c4bb702d2824ee94dd334244cd9ba14609025$ 22796 // 22797 22798 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8ARRAY_BUFFER_RELEASE_CALLBACK_CTOCPP_H_ 22799diff --git a/src/cef/libcef_dll/ctocpp/v8context_ctocpp.cc b/src/cef/libcef_dll/ctocpp/v8context_ctocpp.cc 22800index d6f4bdc054623..476dddcbe9239 22801--- a/src/cef/libcef_dll/ctocpp/v8context_ctocpp.cc 22802+++ b/src/cef/libcef_dll/ctocpp/v8context_ctocpp.cc 22803@@ -1,4 +1,4 @@ 22804-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22805+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22806 // reserved. Use of this source code is governed by a BSD-style license that 22807 // can be found in the LICENSE file. 22808 // 22809@@ -9,7 +9,7 @@ 22810 // implementations. See the translator.README.txt file in the tools directory 22811 // for more information. 22812 // 22813-// $hash=8d8c4cf20f877a5eb60b47fb55d938940bb10c82$ 22814+// $hash=ff70a3aece6add8f9947070688135e60258a1f9c$ 22815 // 22816 22817 #include "libcef_dll/ctocpp/v8context_ctocpp.h" 22818diff --git a/src/cef/libcef_dll/ctocpp/v8context_ctocpp.h b/src/cef/libcef_dll/ctocpp/v8context_ctocpp.h 22819index a261f66cd09c8..7ab4e0bc12a12 22820--- a/src/cef/libcef_dll/ctocpp/v8context_ctocpp.h 22821+++ b/src/cef/libcef_dll/ctocpp/v8context_ctocpp.h 22822@@ -1,4 +1,4 @@ 22823-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22824+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22825 // reserved. Use of this source code is governed by a BSD-style license that 22826 // can be found in the LICENSE file. 22827 // 22828@@ -9,7 +9,7 @@ 22829 // implementations. See the translator.README.txt file in the tools directory 22830 // for more information. 22831 // 22832-// $hash=b3339627f92d31a68d36574fdd7c85db0842ea63$ 22833+// $hash=c5159f67aa8d77aca23153cf6c35468af27dba14$ 22834 // 22835 22836 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ 22837diff --git a/src/cef/libcef_dll/ctocpp/v8exception_ctocpp.cc b/src/cef/libcef_dll/ctocpp/v8exception_ctocpp.cc 22838index 374d81edc7d04..6f5e2de514b56 22839--- a/src/cef/libcef_dll/ctocpp/v8exception_ctocpp.cc 22840+++ b/src/cef/libcef_dll/ctocpp/v8exception_ctocpp.cc 22841@@ -1,4 +1,4 @@ 22842-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22843+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22844 // reserved. Use of this source code is governed by a BSD-style license that 22845 // can be found in the LICENSE file. 22846 // 22847@@ -9,7 +9,7 @@ 22848 // implementations. See the translator.README.txt file in the tools directory 22849 // for more information. 22850 // 22851-// $hash=49589f2e4ad8e5598df9411f613dd717fe6a3852$ 22852+// $hash=d3a5834490a381e43d7e56469d850a0dd83b0876$ 22853 // 22854 22855 #include "libcef_dll/ctocpp/v8exception_ctocpp.h" 22856diff --git a/src/cef/libcef_dll/ctocpp/v8exception_ctocpp.h b/src/cef/libcef_dll/ctocpp/v8exception_ctocpp.h 22857index 3ef82d9064a1f..0256b62f9ec62 22858--- a/src/cef/libcef_dll/ctocpp/v8exception_ctocpp.h 22859+++ b/src/cef/libcef_dll/ctocpp/v8exception_ctocpp.h 22860@@ -1,4 +1,4 @@ 22861-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22862+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22863 // reserved. Use of this source code is governed by a BSD-style license that 22864 // can be found in the LICENSE file. 22865 // 22866@@ -9,7 +9,7 @@ 22867 // implementations. See the translator.README.txt file in the tools directory 22868 // for more information. 22869 // 22870-// $hash=4292e466b2740037ad1ce26147fef3138e8d34aa$ 22871+// $hash=ed15db160fa19964fe5c9902c279fa1b44bd0dbe$ 22872 // 22873 22874 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ 22875diff --git a/src/cef/libcef_dll/ctocpp/v8handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/v8handler_ctocpp.cc 22876index 47bc30d371f29..78c69c69396b6 22877--- a/src/cef/libcef_dll/ctocpp/v8handler_ctocpp.cc 22878+++ b/src/cef/libcef_dll/ctocpp/v8handler_ctocpp.cc 22879@@ -1,4 +1,4 @@ 22880-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22881+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22882 // reserved. Use of this source code is governed by a BSD-style license that 22883 // can be found in the LICENSE file. 22884 // 22885@@ -9,7 +9,7 @@ 22886 // implementations. See the translator.README.txt file in the tools directory 22887 // for more information. 22888 // 22889-// $hash=365e5e2b4e3ced4e615fa504a0cb68c66854fc37$ 22890+// $hash=da3489ef2967a060306d913e06e63759eb7e08d9$ 22891 // 22892 22893 #include "libcef_dll/ctocpp/v8handler_ctocpp.h" 22894diff --git a/src/cef/libcef_dll/ctocpp/v8handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/v8handler_ctocpp.h 22895index f4acf3ec35a26..cd5a0e42e0d35 22896--- a/src/cef/libcef_dll/ctocpp/v8handler_ctocpp.h 22897+++ b/src/cef/libcef_dll/ctocpp/v8handler_ctocpp.h 22898@@ -1,4 +1,4 @@ 22899-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22900+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22901 // reserved. Use of this source code is governed by a BSD-style license that 22902 // can be found in the LICENSE file. 22903 // 22904@@ -9,7 +9,7 @@ 22905 // implementations. See the translator.README.txt file in the tools directory 22906 // for more information. 22907 // 22908-// $hash=0207510d301deece41373f5693eaed1a8fd185b8$ 22909+// $hash=442444a8b361b3ce3f599181fe8057d175e1cc20$ 22910 // 22911 22912 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8HANDLER_CTOCPP_H_ 22913diff --git a/src/cef/libcef_dll/ctocpp/v8interceptor_ctocpp.cc b/src/cef/libcef_dll/ctocpp/v8interceptor_ctocpp.cc 22914index 32b52b1f71162..80a18f669acff 22915--- a/src/cef/libcef_dll/ctocpp/v8interceptor_ctocpp.cc 22916+++ b/src/cef/libcef_dll/ctocpp/v8interceptor_ctocpp.cc 22917@@ -1,4 +1,4 @@ 22918-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22919+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22920 // reserved. Use of this source code is governed by a BSD-style license that 22921 // can be found in the LICENSE file. 22922 // 22923@@ -9,7 +9,7 @@ 22924 // implementations. See the translator.README.txt file in the tools directory 22925 // for more information. 22926 // 22927-// $hash=d466cd3a17a35074eedcb222b9acd2063c297fe2$ 22928+// $hash=12c8d274bc607478d378c501c4c28d6bf61af93b$ 22929 // 22930 22931 #include "libcef_dll/ctocpp/v8interceptor_ctocpp.h" 22932diff --git a/src/cef/libcef_dll/ctocpp/v8interceptor_ctocpp.h b/src/cef/libcef_dll/ctocpp/v8interceptor_ctocpp.h 22933index f7e646274c0e7..de862c1d32d70 22934--- a/src/cef/libcef_dll/ctocpp/v8interceptor_ctocpp.h 22935+++ b/src/cef/libcef_dll/ctocpp/v8interceptor_ctocpp.h 22936@@ -1,4 +1,4 @@ 22937-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22938+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22939 // reserved. Use of this source code is governed by a BSD-style license that 22940 // can be found in the LICENSE file. 22941 // 22942@@ -9,7 +9,7 @@ 22943 // implementations. See the translator.README.txt file in the tools directory 22944 // for more information. 22945 // 22946-// $hash=301ccb6fb65513bc2e6197c7fa1712c5e33f2bcf$ 22947+// $hash=11fbbb5b1de3f96d332ec3653780826677ffcdf2$ 22948 // 22949 22950 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8INTERCEPTOR_CTOCPP_H_ 22951diff --git a/src/cef/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc b/src/cef/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc 22952index 009efe1a0814f..809f82da22f39 22953--- a/src/cef/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc 22954+++ b/src/cef/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc 22955@@ -1,4 +1,4 @@ 22956-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22957+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22958 // reserved. Use of this source code is governed by a BSD-style license that 22959 // can be found in the LICENSE file. 22960 // 22961@@ -9,7 +9,7 @@ 22962 // implementations. See the translator.README.txt file in the tools directory 22963 // for more information. 22964 // 22965-// $hash=5dad5940fbf85e63683112a937d47dbe52f1b64a$ 22966+// $hash=4b7b77ed27848ada4ef09c9a372d42972e179930$ 22967 // 22968 22969 #include "libcef_dll/ctocpp/v8stack_frame_ctocpp.h" 22970diff --git a/src/cef/libcef_dll/ctocpp/v8stack_frame_ctocpp.h b/src/cef/libcef_dll/ctocpp/v8stack_frame_ctocpp.h 22971index 0fb8ea2ca6658..474cd1ad6faee 22972--- a/src/cef/libcef_dll/ctocpp/v8stack_frame_ctocpp.h 22973+++ b/src/cef/libcef_dll/ctocpp/v8stack_frame_ctocpp.h 22974@@ -1,4 +1,4 @@ 22975-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22976+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22977 // reserved. Use of this source code is governed by a BSD-style license that 22978 // can be found in the LICENSE file. 22979 // 22980@@ -9,7 +9,7 @@ 22981 // implementations. See the translator.README.txt file in the tools directory 22982 // for more information. 22983 // 22984-// $hash=e088f626fec9b9848e532d704c34ceabb46df3be$ 22985+// $hash=366d110fdfaf3d241c26e9ec276f7c363ecd313f$ 22986 // 22987 22988 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8STACK_FRAME_CTOCPP_H_ 22989diff --git a/src/cef/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc b/src/cef/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc 22990index d51002ad6bef9..b7c32ace04fe9 22991--- a/src/cef/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc 22992+++ b/src/cef/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc 22993@@ -1,4 +1,4 @@ 22994-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 22995+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 22996 // reserved. Use of this source code is governed by a BSD-style license that 22997 // can be found in the LICENSE file. 22998 // 22999@@ -9,7 +9,7 @@ 23000 // implementations. See the translator.README.txt file in the tools directory 23001 // for more information. 23002 // 23003-// $hash=bf78c133604e1535633ac8c93ca153bcefe2718d$ 23004+// $hash=2bd6f8998f43d4212da6b28ac4863763087310ce$ 23005 // 23006 23007 #include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h" 23008diff --git a/src/cef/libcef_dll/ctocpp/v8stack_trace_ctocpp.h b/src/cef/libcef_dll/ctocpp/v8stack_trace_ctocpp.h 23009index c3b7269bf78ab..1e076ac1321fa 23010--- a/src/cef/libcef_dll/ctocpp/v8stack_trace_ctocpp.h 23011+++ b/src/cef/libcef_dll/ctocpp/v8stack_trace_ctocpp.h 23012@@ -1,4 +1,4 @@ 23013-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23014+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23015 // reserved. Use of this source code is governed by a BSD-style license that 23016 // can be found in the LICENSE file. 23017 // 23018@@ -9,7 +9,7 @@ 23019 // implementations. See the translator.README.txt file in the tools directory 23020 // for more information. 23021 // 23022-// $hash=f2f275b83841463cf102c60380e2b0561f3a749c$ 23023+// $hash=361eefa5a258faf92d09e28787293fa29bbed742$ 23024 // 23025 23026 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8STACK_TRACE_CTOCPP_H_ 23027diff --git a/src/cef/libcef_dll/ctocpp/v8value_ctocpp.cc b/src/cef/libcef_dll/ctocpp/v8value_ctocpp.cc 23028index 02607cd3c79ba..b314e53f8ec1a 23029--- a/src/cef/libcef_dll/ctocpp/v8value_ctocpp.cc 23030+++ b/src/cef/libcef_dll/ctocpp/v8value_ctocpp.cc 23031@@ -1,4 +1,4 @@ 23032-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23033+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23034 // reserved. Use of this source code is governed by a BSD-style license that 23035 // can be found in the LICENSE file. 23036 // 23037@@ -9,7 +9,7 @@ 23038 // implementations. See the translator.README.txt file in the tools directory 23039 // for more information. 23040 // 23041-// $hash=7863f5701d466f8d5a5c91962e14b14b500315a3$ 23042+// $hash=44cb0b037d9dab3bf00531c0bd6e88feb41c6416$ 23043 // 23044 23045 #include "libcef_dll/ctocpp/v8value_ctocpp.h" 23046@@ -847,8 +847,8 @@ NO_SANITIZE("cfi-icall") int CefV8ValueCToCpp::GetArrayLength() { 23047 } 23048 23049 NO_SANITIZE("cfi-icall") 23050-CefRefPtr<CefV8ArrayBufferReleaseCallback> 23051-CefV8ValueCToCpp::GetArrayBufferReleaseCallback() { 23052+CefRefPtr<CefV8ArrayBufferReleaseCallback> CefV8ValueCToCpp:: 23053+ GetArrayBufferReleaseCallback() { 23054 cef_v8value_t* _struct = GetStruct(); 23055 if (CEF_MEMBER_MISSING(_struct, get_array_buffer_release_callback)) 23056 return nullptr; 23057diff --git a/src/cef/libcef_dll/ctocpp/v8value_ctocpp.h b/src/cef/libcef_dll/ctocpp/v8value_ctocpp.h 23058index c8363ea2bb463..c53337a865930 23059--- a/src/cef/libcef_dll/ctocpp/v8value_ctocpp.h 23060+++ b/src/cef/libcef_dll/ctocpp/v8value_ctocpp.h 23061@@ -1,4 +1,4 @@ 23062-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23063+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23064 // reserved. Use of this source code is governed by a BSD-style license that 23065 // can be found in the LICENSE file. 23066 // 23067@@ -9,7 +9,7 @@ 23068 // implementations. See the translator.README.txt file in the tools directory 23069 // for more information. 23070 // 23071-// $hash=c9725eb41d50cd0bdbe6f84280e0ed7b62012136$ 23072+// $hash=c8329f6a0ffd01d3e0e3fcb3e07913ac355a508d$ 23073 // 23074 23075 #ifndef CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ 23076diff --git a/src/cef/libcef_dll/ctocpp/value_ctocpp.cc b/src/cef/libcef_dll/ctocpp/value_ctocpp.cc 23077index 192c9cfc2eab6..27ca05c2e6b91 23078--- a/src/cef/libcef_dll/ctocpp/value_ctocpp.cc 23079+++ b/src/cef/libcef_dll/ctocpp/value_ctocpp.cc 23080@@ -1,4 +1,4 @@ 23081-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23082+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23083 // reserved. Use of this source code is governed by a BSD-style license that 23084 // can be found in the LICENSE file. 23085 // 23086@@ -9,7 +9,7 @@ 23087 // implementations. See the translator.README.txt file in the tools directory 23088 // for more information. 23089 // 23090-// $hash=9f75af2c3d5e4411027b6f26bcc0d31728baed34$ 23091+// $hash=8ef5da831e8fef358361365f434a5719a0829c08$ 23092 // 23093 23094 #include "libcef_dll/ctocpp/value_ctocpp.h" 23095diff --git a/src/cef/libcef_dll/ctocpp/value_ctocpp.h b/src/cef/libcef_dll/ctocpp/value_ctocpp.h 23096index b03df117330a6..9b31150c63294 23097--- a/src/cef/libcef_dll/ctocpp/value_ctocpp.h 23098+++ b/src/cef/libcef_dll/ctocpp/value_ctocpp.h 23099@@ -1,4 +1,4 @@ 23100-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23101+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23102 // reserved. Use of this source code is governed by a BSD-style license that 23103 // can be found in the LICENSE file. 23104 // 23105@@ -9,7 +9,7 @@ 23106 // implementations. See the translator.README.txt file in the tools directory 23107 // for more information. 23108 // 23109-// $hash=4fbbd168e0d26ec54abf2e46808ab98da1900f5c$ 23110+// $hash=80621c9fcd1e112984ddb490da40034e9731d530$ 23111 // 23112 23113 #ifndef CEF_LIBCEF_DLL_CTOCPP_VALUE_CTOCPP_H_ 23114diff --git a/src/cef/libcef_dll/ctocpp/views/box_layout_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/box_layout_ctocpp.cc 23115index b8787d66c02c0..8bb6ef9bd83cf 23116--- a/src/cef/libcef_dll/ctocpp/views/box_layout_ctocpp.cc 23117+++ b/src/cef/libcef_dll/ctocpp/views/box_layout_ctocpp.cc 23118@@ -1,4 +1,4 @@ 23119-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23120+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23121 // reserved. Use of this source code is governed by a BSD-style license that 23122 // can be found in the LICENSE file. 23123 // 23124@@ -9,7 +9,7 @@ 23125 // implementations. See the translator.README.txt file in the tools directory 23126 // for more information. 23127 // 23128-// $hash=40ce0ebcedcd5995a5a3147049e5b34c016b8519$ 23129+// $hash=af4061bbf8813e143420ebc4a45b81e43acc6803$ 23130 // 23131 23132 #include "libcef_dll/ctocpp/views/box_layout_ctocpp.h" 23133diff --git a/src/cef/libcef_dll/ctocpp/views/box_layout_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/box_layout_ctocpp.h 23134index 82879c8cf1be4..6639e642f2cec 23135--- a/src/cef/libcef_dll/ctocpp/views/box_layout_ctocpp.h 23136+++ b/src/cef/libcef_dll/ctocpp/views/box_layout_ctocpp.h 23137@@ -1,4 +1,4 @@ 23138-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23139+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23140 // reserved. Use of this source code is governed by a BSD-style license that 23141 // can be found in the LICENSE file. 23142 // 23143@@ -9,7 +9,7 @@ 23144 // implementations. See the translator.README.txt file in the tools directory 23145 // for more information. 23146 // 23147-// $hash=0d208d785b4fa84ba2e9f8245911d1a47f5e206c$ 23148+// $hash=c14b6372ec4705cdcbcebc6d7367fe0c3c544001$ 23149 // 23150 23151 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BOX_LAYOUT_CTOCPP_H_ 23152diff --git a/src/cef/libcef_dll/ctocpp/views/browser_view_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/browser_view_ctocpp.cc 23153index 3657097b086a7..0df141ea86477 23154--- a/src/cef/libcef_dll/ctocpp/views/browser_view_ctocpp.cc 23155+++ b/src/cef/libcef_dll/ctocpp/views/browser_view_ctocpp.cc 23156@@ -1,4 +1,4 @@ 23157-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23158+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23159 // reserved. Use of this source code is governed by a BSD-style license that 23160 // can be found in the LICENSE file. 23161 // 23162@@ -9,7 +9,7 @@ 23163 // implementations. See the translator.README.txt file in the tools directory 23164 // for more information. 23165 // 23166-// $hash=d7787cf791b4b19620257f295112feb3d3c40f24$ 23167+// $hash=fcf1f54e5758c61ccbaea88fc133c88755915eaa$ 23168 // 23169 23170 #include "libcef_dll/ctocpp/views/browser_view_ctocpp.h" 23171diff --git a/src/cef/libcef_dll/ctocpp/views/browser_view_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/browser_view_ctocpp.h 23172index 88599fe62488b..526b63fdf3480 23173--- a/src/cef/libcef_dll/ctocpp/views/browser_view_ctocpp.h 23174+++ b/src/cef/libcef_dll/ctocpp/views/browser_view_ctocpp.h 23175@@ -1,4 +1,4 @@ 23176-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23177+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23178 // reserved. Use of this source code is governed by a BSD-style license that 23179 // can be found in the LICENSE file. 23180 // 23181@@ -9,7 +9,7 @@ 23182 // implementations. See the translator.README.txt file in the tools directory 23183 // for more information. 23184 // 23185-// $hash=8744854c12c6ea110a5a6eb4f15ccd5b5867c1d1$ 23186+// $hash=3369ae36dfebd0283661566cf91fa57dbfec29e4$ 23187 // 23188 23189 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_CTOCPP_H_ 23190diff --git a/src/cef/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc 23191index 6d3dae0eb3d25..6ba31f51a0278 23192--- a/src/cef/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc 23193+++ b/src/cef/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc 23194@@ -1,4 +1,4 @@ 23195-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23196+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23197 // reserved. Use of this source code is governed by a BSD-style license that 23198 // can be found in the LICENSE file. 23199 // 23200@@ -9,7 +9,7 @@ 23201 // implementations. See the translator.README.txt file in the tools directory 23202 // for more information. 23203 // 23204-// $hash=379974b466cf5b511906b6492c7fa594a26e4d33$ 23205+// $hash=cef68f9f361591f91495436c08d0f5e07738a594$ 23206 // 23207 23208 #include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h" 23209@@ -75,12 +75,11 @@ void CefBrowserViewDelegateCToCpp::OnBrowserDestroyed( 23210 } 23211 23212 NO_SANITIZE("cfi-icall") 23213-CefRefPtr<CefBrowserViewDelegate> 23214-CefBrowserViewDelegateCToCpp::GetDelegateForPopupBrowserView( 23215- CefRefPtr<CefBrowserView> browser_view, 23216- const CefBrowserSettings& settings, 23217- CefRefPtr<CefClient> client, 23218- bool is_devtools) { 23219+CefRefPtr<CefBrowserViewDelegate> CefBrowserViewDelegateCToCpp:: 23220+ GetDelegateForPopupBrowserView(CefRefPtr<CefBrowserView> browser_view, 23221+ const CefBrowserSettings& settings, 23222+ CefRefPtr<CefClient> client, 23223+ bool is_devtools) { 23224 shutdown_checker::AssertNotShutdown(); 23225 23226 cef_browser_view_delegate_t* _struct = GetStruct(); 23227@@ -141,7 +140,7 @@ bool CefBrowserViewDelegateCToCpp::OnPopupBrowserViewCreated( 23228 23229 NO_SANITIZE("cfi-icall") 23230 CefBrowserViewDelegate::ChromeToolbarType 23231-CefBrowserViewDelegateCToCpp::GetChromeToolbarType() { 23232+ CefBrowserViewDelegateCToCpp::GetChromeToolbarType() { 23233 shutdown_checker::AssertNotShutdown(); 23234 23235 cef_browser_view_delegate_t* _struct = GetStruct(); 23236@@ -158,8 +157,8 @@ CefBrowserViewDelegateCToCpp::GetChromeToolbarType() { 23237 } 23238 23239 NO_SANITIZE("cfi-icall") 23240-CefSize CefBrowserViewDelegateCToCpp::GetPreferredSize( 23241- CefRefPtr<CefView> view) { 23242+CefSize 23243+ CefBrowserViewDelegateCToCpp::GetPreferredSize(CefRefPtr<CefView> view) { 23244 shutdown_checker::AssertNotShutdown(); 23245 23246 cef_view_delegate_t* _struct = 23247diff --git a/src/cef/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h 23248index 50666b217f1e4..bc1abf588bf87 23249--- a/src/cef/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h 23250+++ b/src/cef/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h 23251@@ -1,4 +1,4 @@ 23252-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23253+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23254 // reserved. Use of this source code is governed by a BSD-style license that 23255 // can be found in the LICENSE file. 23256 // 23257@@ -9,7 +9,7 @@ 23258 // implementations. See the translator.README.txt file in the tools directory 23259 // for more information. 23260 // 23261-// $hash=5aabb450064c183478e8cbcd7b96a9d308bc5c59$ 23262+// $hash=ae219b09b69d7a49f48878a5d2f94b25c9b4150b$ 23263 // 23264 23265 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_ 23266diff --git a/src/cef/libcef_dll/ctocpp/views/button_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/button_ctocpp.cc 23267index c373691ccefb1..ca0607677ad0f 23268--- a/src/cef/libcef_dll/ctocpp/views/button_ctocpp.cc 23269+++ b/src/cef/libcef_dll/ctocpp/views/button_ctocpp.cc 23270@@ -1,4 +1,4 @@ 23271-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23272+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23273 // reserved. Use of this source code is governed by a BSD-style license that 23274 // can be found in the LICENSE file. 23275 // 23276@@ -9,7 +9,7 @@ 23277 // implementations. See the translator.README.txt file in the tools directory 23278 // for more information. 23279 // 23280-// $hash=9b1509d1105e3075a13563aa5e892833abcda54a$ 23281+// $hash=b36bf494f49f9a3e0af4388a2c9121c6647b847e$ 23282 // 23283 23284 #include "libcef_dll/ctocpp/views/button_ctocpp.h" 23285diff --git a/src/cef/libcef_dll/ctocpp/views/button_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/button_ctocpp.h 23286index 452a6d8d9ce76..4f4362ee59448 23287--- a/src/cef/libcef_dll/ctocpp/views/button_ctocpp.h 23288+++ b/src/cef/libcef_dll/ctocpp/views/button_ctocpp.h 23289@@ -1,4 +1,4 @@ 23290-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23291+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23292 // reserved. Use of this source code is governed by a BSD-style license that 23293 // can be found in the LICENSE file. 23294 // 23295@@ -9,7 +9,7 @@ 23296 // implementations. See the translator.README.txt file in the tools directory 23297 // for more information. 23298 // 23299-// $hash=b09c6865b321dbc52440a306dabdf0357bf41a12$ 23300+// $hash=d6be48f8326ec9e541ace36d0b467cf6b1fbc065$ 23301 // 23302 23303 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_CTOCPP_H_ 23304diff --git a/src/cef/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc 23305index 1e977ec2f6b96..97d9c545e553f 23306--- a/src/cef/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc 23307+++ b/src/cef/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc 23308@@ -1,4 +1,4 @@ 23309-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23310+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23311 // reserved. Use of this source code is governed by a BSD-style license that 23312 // can be found in the LICENSE file. 23313 // 23314@@ -9,7 +9,7 @@ 23315 // implementations. See the translator.README.txt file in the tools directory 23316 // for more information. 23317 // 23318-// $hash=e7844e97f29fe0bcda8380932ceaa7581539d0e3$ 23319+// $hash=5466f1b16dbdad0fc520275d84d73310bf31e963$ 23320 // 23321 23322 #include "libcef_dll/ctocpp/views/button_delegate_ctocpp.h" 23323diff --git a/src/cef/libcef_dll/ctocpp/views/button_delegate_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/button_delegate_ctocpp.h 23324index 386a3603d913b..a01a96bde6ba4 23325--- a/src/cef/libcef_dll/ctocpp/views/button_delegate_ctocpp.h 23326+++ b/src/cef/libcef_dll/ctocpp/views/button_delegate_ctocpp.h 23327@@ -1,4 +1,4 @@ 23328-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23329+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23330 // reserved. Use of this source code is governed by a BSD-style license that 23331 // can be found in the LICENSE file. 23332 // 23333@@ -9,7 +9,7 @@ 23334 // implementations. See the translator.README.txt file in the tools directory 23335 // for more information. 23336 // 23337-// $hash=3c5fbabd7adf7390101cc03058bdcac3077c26c8$ 23338+// $hash=13140a32b465eaf52f13693cd244a9b47eda5068$ 23339 // 23340 23341 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_DELEGATE_CTOCPP_H_ 23342diff --git a/src/cef/libcef_dll/ctocpp/views/display_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/display_ctocpp.cc 23343index 9a6477c2e217a..5c8b9ae115139 23344--- a/src/cef/libcef_dll/ctocpp/views/display_ctocpp.cc 23345+++ b/src/cef/libcef_dll/ctocpp/views/display_ctocpp.cc 23346@@ -1,4 +1,4 @@ 23347-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23348+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23349 // reserved. Use of this source code is governed by a BSD-style license that 23350 // can be found in the LICENSE file. 23351 // 23352@@ -9,7 +9,7 @@ 23353 // implementations. See the translator.README.txt file in the tools directory 23354 // for more information. 23355 // 23356-// $hash=ba41b36a0cdd335f2a964665576aaf50d8be9c55$ 23357+// $hash=accae5014ef5a4a426a88ae7bed580523b9f336c$ 23358 // 23359 23360 #include "libcef_dll/ctocpp/views/display_ctocpp.h" 23361diff --git a/src/cef/libcef_dll/ctocpp/views/display_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/display_ctocpp.h 23362index e3e5d5da67f09..5d12545d52d5f 23363--- a/src/cef/libcef_dll/ctocpp/views/display_ctocpp.h 23364+++ b/src/cef/libcef_dll/ctocpp/views/display_ctocpp.h 23365@@ -1,4 +1,4 @@ 23366-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23367+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23368 // reserved. Use of this source code is governed by a BSD-style license that 23369 // can be found in the LICENSE file. 23370 // 23371@@ -9,7 +9,7 @@ 23372 // implementations. See the translator.README.txt file in the tools directory 23373 // for more information. 23374 // 23375-// $hash=adc1770d93c4e52a56e98f105877cbad5c76194a$ 23376+// $hash=a05d5f989630c0c031cbe9cc04150a6e1e54c4d4$ 23377 // 23378 23379 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_DISPLAY_CTOCPP_H_ 23380diff --git a/src/cef/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc 23381index b8de0a3a702fd..eca2fb2aa320c 23382--- a/src/cef/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc 23383+++ b/src/cef/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc 23384@@ -1,4 +1,4 @@ 23385-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23386+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23387 // reserved. Use of this source code is governed by a BSD-style license that 23388 // can be found in the LICENSE file. 23389 // 23390@@ -9,7 +9,7 @@ 23391 // implementations. See the translator.README.txt file in the tools directory 23392 // for more information. 23393 // 23394-// $hash=dafea3abdc32cc7dd8552bbdf5bd2bb32e816c5f$ 23395+// $hash=ef008b233715e98fdf22b4bf4ca1017f010eff85$ 23396 // 23397 23398 #include "libcef_dll/ctocpp/views/fill_layout_ctocpp.h" 23399diff --git a/src/cef/libcef_dll/ctocpp/views/fill_layout_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/fill_layout_ctocpp.h 23400index f2c36d784ce86..06b0380cf5dd5 23401--- a/src/cef/libcef_dll/ctocpp/views/fill_layout_ctocpp.h 23402+++ b/src/cef/libcef_dll/ctocpp/views/fill_layout_ctocpp.h 23403@@ -1,4 +1,4 @@ 23404-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23405+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23406 // reserved. Use of this source code is governed by a BSD-style license that 23407 // can be found in the LICENSE file. 23408 // 23409@@ -9,7 +9,7 @@ 23410 // implementations. See the translator.README.txt file in the tools directory 23411 // for more information. 23412 // 23413-// $hash=effe4fbabbcfadf905b0161c564956213ee435e5$ 23414+// $hash=5d52b0af136f7ac008cb89a29ce65942932b9f64$ 23415 // 23416 23417 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_FILL_LAYOUT_CTOCPP_H_ 23418diff --git a/src/cef/libcef_dll/ctocpp/views/label_button_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/label_button_ctocpp.cc 23419index b379353b661e3..003451772fa8f 23420--- a/src/cef/libcef_dll/ctocpp/views/label_button_ctocpp.cc 23421+++ b/src/cef/libcef_dll/ctocpp/views/label_button_ctocpp.cc 23422@@ -1,4 +1,4 @@ 23423-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23424+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23425 // reserved. Use of this source code is governed by a BSD-style license that 23426 // can be found in the LICENSE file. 23427 // 23428@@ -9,7 +9,7 @@ 23429 // implementations. See the translator.README.txt file in the tools directory 23430 // for more information. 23431 // 23432-// $hash=f9884f731b221f0c84234fd775cd480ab9ae9869$ 23433+// $hash=64550f9a864524533748f687a69fc0511096fc3a$ 23434 // 23435 23436 #include "libcef_dll/ctocpp/views/label_button_ctocpp.h" 23437diff --git a/src/cef/libcef_dll/ctocpp/views/label_button_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/label_button_ctocpp.h 23438index 37078e9a31f8c..d7f20dcd4d445 23439--- a/src/cef/libcef_dll/ctocpp/views/label_button_ctocpp.h 23440+++ b/src/cef/libcef_dll/ctocpp/views/label_button_ctocpp.h 23441@@ -1,4 +1,4 @@ 23442-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23443+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23444 // reserved. Use of this source code is governed by a BSD-style license that 23445 // can be found in the LICENSE file. 23446 // 23447@@ -9,7 +9,7 @@ 23448 // implementations. See the translator.README.txt file in the tools directory 23449 // for more information. 23450 // 23451-// $hash=db354914ca0dfe61f4adcc196c25c38b2ad13239$ 23452+// $hash=e54619e16a7a8f21cdeeb4ddfcedf3504c258d35$ 23453 // 23454 23455 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_LABEL_BUTTON_CTOCPP_H_ 23456diff --git a/src/cef/libcef_dll/ctocpp/views/layout_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/layout_ctocpp.cc 23457index f33604442025e..50d2afb4cffe0 23458--- a/src/cef/libcef_dll/ctocpp/views/layout_ctocpp.cc 23459+++ b/src/cef/libcef_dll/ctocpp/views/layout_ctocpp.cc 23460@@ -1,4 +1,4 @@ 23461-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23462+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23463 // reserved. Use of this source code is governed by a BSD-style license that 23464 // can be found in the LICENSE file. 23465 // 23466@@ -9,7 +9,7 @@ 23467 // implementations. See the translator.README.txt file in the tools directory 23468 // for more information. 23469 // 23470-// $hash=6607a4c252dafd39ba695b5d4ecfb14286d70672$ 23471+// $hash=3d1194096844ca83c22e87918069ece5d50385ee$ 23472 // 23473 23474 #include "libcef_dll/ctocpp/views/layout_ctocpp.h" 23475diff --git a/src/cef/libcef_dll/ctocpp/views/layout_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/layout_ctocpp.h 23476index eeba37dfed67c..6ffa76d339831 23477--- a/src/cef/libcef_dll/ctocpp/views/layout_ctocpp.h 23478+++ b/src/cef/libcef_dll/ctocpp/views/layout_ctocpp.h 23479@@ -1,4 +1,4 @@ 23480-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23481+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23482 // reserved. Use of this source code is governed by a BSD-style license that 23483 // can be found in the LICENSE file. 23484 // 23485@@ -9,7 +9,7 @@ 23486 // implementations. See the translator.README.txt file in the tools directory 23487 // for more information. 23488 // 23489-// $hash=383da9e4acb10aa03e8e250505cae2738bbe7fec$ 23490+// $hash=f50cae9c7f44f282497cff43e8b89fc76f60e51b$ 23491 // 23492 23493 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_LAYOUT_CTOCPP_H_ 23494diff --git a/src/cef/libcef_dll/ctocpp/views/menu_button_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/menu_button_ctocpp.cc 23495index 6070861fd57ac..90700bac26b88 23496--- a/src/cef/libcef_dll/ctocpp/views/menu_button_ctocpp.cc 23497+++ b/src/cef/libcef_dll/ctocpp/views/menu_button_ctocpp.cc 23498@@ -1,4 +1,4 @@ 23499-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23500+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23501 // reserved. Use of this source code is governed by a BSD-style license that 23502 // can be found in the LICENSE file. 23503 // 23504@@ -9,7 +9,7 @@ 23505 // implementations. See the translator.README.txt file in the tools directory 23506 // for more information. 23507 // 23508-// $hash=6821e9d7130f828fba356cd7a7980f638c8ecf3e$ 23509+// $hash=69ea7e37a9c8d66f5347571ae8064ccc15c20d2d$ 23510 // 23511 23512 #include "libcef_dll/ctocpp/views/menu_button_ctocpp.h" 23513diff --git a/src/cef/libcef_dll/ctocpp/views/menu_button_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/menu_button_ctocpp.h 23514index 8e7a98425313b..77293750d9b62 23515--- a/src/cef/libcef_dll/ctocpp/views/menu_button_ctocpp.h 23516+++ b/src/cef/libcef_dll/ctocpp/views/menu_button_ctocpp.h 23517@@ -1,4 +1,4 @@ 23518-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23519+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23520 // reserved. Use of this source code is governed by a BSD-style license that 23521 // can be found in the LICENSE file. 23522 // 23523@@ -9,7 +9,7 @@ 23524 // implementations. See the translator.README.txt file in the tools directory 23525 // for more information. 23526 // 23527-// $hash=41f123659afc521684bb6b273ab831944efc4611$ 23528+// $hash=0323c84d6099ab582a71a40f8065013cecc126cd$ 23529 // 23530 23531 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_CTOCPP_H_ 23532diff --git a/src/cef/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc 23533index 96a1148784c8c..44bacb39825d2 23534--- a/src/cef/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc 23535+++ b/src/cef/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc 23536@@ -1,4 +1,4 @@ 23537-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23538+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23539 // reserved. Use of this source code is governed by a BSD-style license that 23540 // can be found in the LICENSE file. 23541 // 23542@@ -9,7 +9,7 @@ 23543 // implementations. See the translator.README.txt file in the tools directory 23544 // for more information. 23545 // 23546-// $hash=795437425153e56d1c82e30510922399fef0c673$ 23547+// $hash=0bf2d621b4aa5a6dbb14596ddded68005327afa7$ 23548 // 23549 23550 #include "libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h" 23551diff --git a/src/cef/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h 23552index c2d460af8e6fe..f89062917e7a2 23553--- a/src/cef/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h 23554+++ b/src/cef/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h 23555@@ -1,4 +1,4 @@ 23556-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23557+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23558 // reserved. Use of this source code is governed by a BSD-style license that 23559 // can be found in the LICENSE file. 23560 // 23561@@ -9,7 +9,7 @@ 23562 // implementations. See the translator.README.txt file in the tools directory 23563 // for more information. 23564 // 23565-// $hash=7f1b296579f263cdcb5ac00105e53c32e2d89f4c$ 23566+// $hash=962c2d2bc800670d19838fa2a34ab4faa8203531$ 23567 // 23568 23569 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_DELEGATE_CTOCPP_H_ 23570diff --git a/src/cef/libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.cc 23571index 3d9127cafb57c..313832fd141f6 23572--- a/src/cef/libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.cc 23573+++ b/src/cef/libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.cc 23574@@ -1,4 +1,4 @@ 23575-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23576+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23577 // reserved. Use of this source code is governed by a BSD-style license that 23578 // can be found in the LICENSE file. 23579 // 23580@@ -9,7 +9,7 @@ 23581 // implementations. See the translator.README.txt file in the tools directory 23582 // for more information. 23583 // 23584-// $hash=684914b489c5d322b41d61d46f5d387675da2c30$ 23585+// $hash=52df98f1359e9a8e231ec9e2555bc883e1fa84b5$ 23586 // 23587 23588 #include "libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.h" 23589diff --git a/src/cef/libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.h 23590index fed9e9be2f36f..3a2ce082be0a5 23591--- a/src/cef/libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.h 23592+++ b/src/cef/libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.h 23593@@ -1,4 +1,4 @@ 23594-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23595+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23596 // reserved. Use of this source code is governed by a BSD-style license that 23597 // can be found in the LICENSE file. 23598 // 23599@@ -9,7 +9,7 @@ 23600 // implementations. See the translator.README.txt file in the tools directory 23601 // for more information. 23602 // 23603-// $hash=ea81c8b651b803c0d78b06a850c409da3e632b44$ 23604+// $hash=8c0bc19bcd5b9f53b0ee556fb0117e9a6115eb7f$ 23605 // 23606 23607 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_PRESSED_LOCK_CTOCPP_H_ 23608diff --git a/src/cef/libcef_dll/ctocpp/views/overlay_controller_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/overlay_controller_ctocpp.cc 23609index 0ad5892d95db4..a95a482be57b0 23610--- a/src/cef/libcef_dll/ctocpp/views/overlay_controller_ctocpp.cc 23611+++ b/src/cef/libcef_dll/ctocpp/views/overlay_controller_ctocpp.cc 23612@@ -1,4 +1,4 @@ 23613-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23614+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23615 // reserved. Use of this source code is governed by a BSD-style license that 23616 // can be found in the LICENSE file. 23617 // 23618@@ -9,7 +9,7 @@ 23619 // implementations. See the translator.README.txt file in the tools directory 23620 // for more information. 23621 // 23622-// $hash=60978f71bb9089d32a89bed17af584bd83a4678d$ 23623+// $hash=2c07307d7ad63e5a1bc7a223f8135f01d2d967a8$ 23624 // 23625 23626 #include "libcef_dll/ctocpp/views/overlay_controller_ctocpp.h" 23627diff --git a/src/cef/libcef_dll/ctocpp/views/overlay_controller_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/overlay_controller_ctocpp.h 23628index 2d974bee15e4c..e8c47e0c085ab 23629--- a/src/cef/libcef_dll/ctocpp/views/overlay_controller_ctocpp.h 23630+++ b/src/cef/libcef_dll/ctocpp/views/overlay_controller_ctocpp.h 23631@@ -1,4 +1,4 @@ 23632-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23633+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23634 // reserved. Use of this source code is governed by a BSD-style license that 23635 // can be found in the LICENSE file. 23636 // 23637@@ -9,7 +9,7 @@ 23638 // implementations. See the translator.README.txt file in the tools directory 23639 // for more information. 23640 // 23641-// $hash=7e1c98d4417c831dc850f36bc6ac20d95cd03dab$ 23642+// $hash=a8dd9d8eb796f499231143866c2d8f45e9b25d0c$ 23643 // 23644 23645 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_OVERLAY_CONTROLLER_CTOCPP_H_ 23646diff --git a/src/cef/libcef_dll/ctocpp/views/panel_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/panel_ctocpp.cc 23647index b449a3ac83ba1..15191a6f097a6 23648--- a/src/cef/libcef_dll/ctocpp/views/panel_ctocpp.cc 23649+++ b/src/cef/libcef_dll/ctocpp/views/panel_ctocpp.cc 23650@@ -1,4 +1,4 @@ 23651-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23652+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23653 // reserved. Use of this source code is governed by a BSD-style license that 23654 // can be found in the LICENSE file. 23655 // 23656@@ -9,7 +9,7 @@ 23657 // implementations. See the translator.README.txt file in the tools directory 23658 // for more information. 23659 // 23660-// $hash=7989301b819a52e8c965774e5c073d5c480a599b$ 23661+// $hash=a96ee723ef03fc68ba5be2ca18eb9865ad7af01d$ 23662 // 23663 23664 #include "libcef_dll/ctocpp/views/panel_ctocpp.h" 23665diff --git a/src/cef/libcef_dll/ctocpp/views/panel_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/panel_ctocpp.h 23666index 399f001e8ddef..ee6410be3d7cf 23667--- a/src/cef/libcef_dll/ctocpp/views/panel_ctocpp.h 23668+++ b/src/cef/libcef_dll/ctocpp/views/panel_ctocpp.h 23669@@ -1,4 +1,4 @@ 23670-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23671+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23672 // reserved. Use of this source code is governed by a BSD-style license that 23673 // can be found in the LICENSE file. 23674 // 23675@@ -9,7 +9,7 @@ 23676 // implementations. See the translator.README.txt file in the tools directory 23677 // for more information. 23678 // 23679-// $hash=409d4b16fb5d1dcc66c8553ed2fdd8b6465c8664$ 23680+// $hash=c0c4823d1084bd1ea4f2065e93b51a56718bed87$ 23681 // 23682 23683 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_CTOCPP_H_ 23684diff --git a/src/cef/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc 23685index 4805de5ec1467..9a81e49b56ce7 23686--- a/src/cef/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc 23687+++ b/src/cef/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc 23688@@ -1,4 +1,4 @@ 23689-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23690+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23691 // reserved. Use of this source code is governed by a BSD-style license that 23692 // can be found in the LICENSE file. 23693 // 23694@@ -9,7 +9,7 @@ 23695 // implementations. See the translator.README.txt file in the tools directory 23696 // for more information. 23697 // 23698-// $hash=ed477592fb540c789eef4309e7af5f40319bc4b9$ 23699+// $hash=fd199dc9e98a7880b1f5c057bb0f16934809223d$ 23700 // 23701 23702 #include "libcef_dll/ctocpp/views/panel_delegate_ctocpp.h" 23703diff --git a/src/cef/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h 23704index b016340e0d2ff..62fd16d8a1c08 23705--- a/src/cef/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h 23706+++ b/src/cef/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h 23707@@ -1,4 +1,4 @@ 23708-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23709+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23710 // reserved. Use of this source code is governed by a BSD-style license that 23711 // can be found in the LICENSE file. 23712 // 23713@@ -9,7 +9,7 @@ 23714 // implementations. See the translator.README.txt file in the tools directory 23715 // for more information. 23716 // 23717-// $hash=0a0bf21c7be5169ab5ba891ba25b7b78b317e9aa$ 23718+// $hash=dcad633b9f91da4e5b08cfa8be122b6797211b46$ 23719 // 23720 23721 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_DELEGATE_CTOCPP_H_ 23722diff --git a/src/cef/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc 23723index 08c91970b92f4..ef75880e7ef59 23724--- a/src/cef/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc 23725+++ b/src/cef/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc 23726@@ -1,4 +1,4 @@ 23727-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23728+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23729 // reserved. Use of this source code is governed by a BSD-style license that 23730 // can be found in the LICENSE file. 23731 // 23732@@ -9,7 +9,7 @@ 23733 // implementations. See the translator.README.txt file in the tools directory 23734 // for more information. 23735 // 23736-// $hash=177ae72af2cb2658ab48041dfefde9f492e4a5d5$ 23737+// $hash=0d4d7202f3053150bfee7380d3dbc9ef596683f9$ 23738 // 23739 23740 #include "libcef_dll/ctocpp/views/scroll_view_ctocpp.h" 23741diff --git a/src/cef/libcef_dll/ctocpp/views/scroll_view_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/scroll_view_ctocpp.h 23742index 2182ae958c388..5ceb93da79d1d 23743--- a/src/cef/libcef_dll/ctocpp/views/scroll_view_ctocpp.h 23744+++ b/src/cef/libcef_dll/ctocpp/views/scroll_view_ctocpp.h 23745@@ -1,4 +1,4 @@ 23746-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23747+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23748 // reserved. Use of this source code is governed by a BSD-style license that 23749 // can be found in the LICENSE file. 23750 // 23751@@ -9,7 +9,7 @@ 23752 // implementations. See the translator.README.txt file in the tools directory 23753 // for more information. 23754 // 23755-// $hash=6160a050b665423f41dfea54b38fade96dc2031f$ 23756+// $hash=3a3c2eee1765f8a1d86044eadc75eca9c6fae25f$ 23757 // 23758 23759 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_SCROLL_VIEW_CTOCPP_H_ 23760diff --git a/src/cef/libcef_dll/ctocpp/views/textfield_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/textfield_ctocpp.cc 23761index 0d8df0d31f1f6..9d5f7749d74cf 23762--- a/src/cef/libcef_dll/ctocpp/views/textfield_ctocpp.cc 23763+++ b/src/cef/libcef_dll/ctocpp/views/textfield_ctocpp.cc 23764@@ -1,4 +1,4 @@ 23765-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23766+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23767 // reserved. Use of this source code is governed by a BSD-style license that 23768 // can be found in the LICENSE file. 23769 // 23770@@ -9,7 +9,7 @@ 23771 // implementations. See the translator.README.txt file in the tools directory 23772 // for more information. 23773 // 23774-// $hash=3268a6e6475c3fbddcf6c83016ca3aae1d4a7c4c$ 23775+// $hash=be5f51e38820266a08248e602443902b3e2e3d78$ 23776 // 23777 23778 #include "libcef_dll/ctocpp/views/textfield_ctocpp.h" 23779diff --git a/src/cef/libcef_dll/ctocpp/views/textfield_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/textfield_ctocpp.h 23780index 95445e66cf0d1..3325a22a06efe 23781--- a/src/cef/libcef_dll/ctocpp/views/textfield_ctocpp.h 23782+++ b/src/cef/libcef_dll/ctocpp/views/textfield_ctocpp.h 23783@@ -1,4 +1,4 @@ 23784-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23785+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23786 // reserved. Use of this source code is governed by a BSD-style license that 23787 // can be found in the LICENSE file. 23788 // 23789@@ -9,7 +9,7 @@ 23790 // implementations. See the translator.README.txt file in the tools directory 23791 // for more information. 23792 // 23793-// $hash=d96b3c829c698c7919bcaa4dd9b4f94d8800e6dc$ 23794+// $hash=cdc3237fbd889409f8e9aa2116689a3e1c1229c7$ 23795 // 23796 23797 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_CTOCPP_H_ 23798diff --git a/src/cef/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc 23799index 7e19121bf9d5e..58731eff3ecf4 23800--- a/src/cef/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc 23801+++ b/src/cef/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc 23802@@ -1,4 +1,4 @@ 23803-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23804+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23805 // reserved. Use of this source code is governed by a BSD-style license that 23806 // can be found in the LICENSE file. 23807 // 23808@@ -9,7 +9,7 @@ 23809 // implementations. See the translator.README.txt file in the tools directory 23810 // for more information. 23811 // 23812-// $hash=a7787d39e5f102f937542ace81de0277affab1a4$ 23813+// $hash=a449fb206fdd029cb72f6ad02b87b6285a5b8e1f$ 23814 // 23815 23816 #include "libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h" 23817diff --git a/src/cef/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h 23818index 84a0e4d537958..76d15eee7b299 23819--- a/src/cef/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h 23820+++ b/src/cef/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h 23821@@ -1,4 +1,4 @@ 23822-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23823+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23824 // reserved. Use of this source code is governed by a BSD-style license that 23825 // can be found in the LICENSE file. 23826 // 23827@@ -9,7 +9,7 @@ 23828 // implementations. See the translator.README.txt file in the tools directory 23829 // for more information. 23830 // 23831-// $hash=63cc6f84be6ad62ccba2b91cc6159275e1cd7dd8$ 23832+// $hash=65dedd950d154a0125b094bb1488e787726545cb$ 23833 // 23834 23835 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_DELEGATE_CTOCPP_H_ 23836diff --git a/src/cef/libcef_dll/ctocpp/views/view_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/view_ctocpp.cc 23837index 5a552c592b7b8..8bd16caba8be8 23838--- a/src/cef/libcef_dll/ctocpp/views/view_ctocpp.cc 23839+++ b/src/cef/libcef_dll/ctocpp/views/view_ctocpp.cc 23840@@ -1,4 +1,4 @@ 23841-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23842+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23843 // reserved. Use of this source code is governed by a BSD-style license that 23844 // can be found in the LICENSE file. 23845 // 23846@@ -9,7 +9,7 @@ 23847 // implementations. See the translator.README.txt file in the tools directory 23848 // for more information. 23849 // 23850-// $hash=61c3b208f3a1907b483198a0a62ae9b45d9e56a3$ 23851+// $hash=b4edd50d32a796ff0b2eb2a735e2ce2c9ff6e147$ 23852 // 23853 23854 #include "libcef_dll/ctocpp/views/view_ctocpp.h" 23855diff --git a/src/cef/libcef_dll/ctocpp/views/view_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/view_ctocpp.h 23856index 9e658f064e8ad..65b2cc07dcb64 23857--- a/src/cef/libcef_dll/ctocpp/views/view_ctocpp.h 23858+++ b/src/cef/libcef_dll/ctocpp/views/view_ctocpp.h 23859@@ -1,4 +1,4 @@ 23860-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23861+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23862 // reserved. Use of this source code is governed by a BSD-style license that 23863 // can be found in the LICENSE file. 23864 // 23865@@ -9,7 +9,7 @@ 23866 // implementations. See the translator.README.txt file in the tools directory 23867 // for more information. 23868 // 23869-// $hash=8f99bf38ab96b2ffa22f43891d01c61f73aafaf3$ 23870+// $hash=5af9a065bd30e46fad816250442dd6b3d31834fd$ 23871 // 23872 23873 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_CTOCPP_H_ 23874diff --git a/src/cef/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc 23875index 3ea7e06109ba4..b54e3db41ab73 23876--- a/src/cef/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc 23877+++ b/src/cef/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc 23878@@ -1,4 +1,4 @@ 23879-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23880+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23881 // reserved. Use of this source code is governed by a BSD-style license that 23882 // can be found in the LICENSE file. 23883 // 23884@@ -9,7 +9,7 @@ 23885 // implementations. See the translator.README.txt file in the tools directory 23886 // for more information. 23887 // 23888-// $hash=394bf2a5f6f5898787c498b91bcf8375099eae47$ 23889+// $hash=9a731e4edfb8ed9c3a03fa56597f02cae87c1972$ 23890 // 23891 23892 #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h" 23893diff --git a/src/cef/libcef_dll/ctocpp/views/view_delegate_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/view_delegate_ctocpp.h 23894index ee10966f6a77c..2a8024bf78e9f 23895--- a/src/cef/libcef_dll/ctocpp/views/view_delegate_ctocpp.h 23896+++ b/src/cef/libcef_dll/ctocpp/views/view_delegate_ctocpp.h 23897@@ -1,4 +1,4 @@ 23898-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23899+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23900 // reserved. Use of this source code is governed by a BSD-style license that 23901 // can be found in the LICENSE file. 23902 // 23903@@ -9,7 +9,7 @@ 23904 // implementations. See the translator.README.txt file in the tools directory 23905 // for more information. 23906 // 23907-// $hash=9202d1b2cd26906df4c5574f9f3a1c662ab2e82f$ 23908+// $hash=c433d8e9462e7a948338bfe9192f247fdc253614$ 23909 // 23910 23911 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_DELEGATE_CTOCPP_H_ 23912diff --git a/src/cef/libcef_dll/ctocpp/views/window_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/window_ctocpp.cc 23913index 145fa125d7709..6aa50b21161a8 23914--- a/src/cef/libcef_dll/ctocpp/views/window_ctocpp.cc 23915+++ b/src/cef/libcef_dll/ctocpp/views/window_ctocpp.cc 23916@@ -1,4 +1,4 @@ 23917-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23918+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23919 // reserved. Use of this source code is governed by a BSD-style license that 23920 // can be found in the LICENSE file. 23921 // 23922@@ -9,7 +9,7 @@ 23923 // implementations. See the translator.README.txt file in the tools directory 23924 // for more information. 23925 // 23926-// $hash=a71d84e671749331e5ad99c84ef790f09613b145$ 23927+// $hash=a4c6dd54b71d800640730d4bc5d643c4293d783d$ 23928 // 23929 23930 #include "libcef_dll/ctocpp/views/window_ctocpp.h" 23931diff --git a/src/cef/libcef_dll/ctocpp/views/window_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/window_ctocpp.h 23932index dfdc0c68677b5..58fd19e326d2e 23933--- a/src/cef/libcef_dll/ctocpp/views/window_ctocpp.h 23934+++ b/src/cef/libcef_dll/ctocpp/views/window_ctocpp.h 23935@@ -1,4 +1,4 @@ 23936-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23937+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23938 // reserved. Use of this source code is governed by a BSD-style license that 23939 // can be found in the LICENSE file. 23940 // 23941@@ -9,7 +9,7 @@ 23942 // implementations. See the translator.README.txt file in the tools directory 23943 // for more information. 23944 // 23945-// $hash=5afd032b23745d114bc95d45139cf5d92a82f89a$ 23946+// $hash=a16d73107ffbbcdb06153c0bfcc5e4ac43bbadb0$ 23947 // 23948 23949 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_CTOCPP_H_ 23950diff --git a/src/cef/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc 23951index 2e71f32ebad07..551ebe1abe203 23952--- a/src/cef/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc 23953+++ b/src/cef/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc 23954@@ -1,4 +1,4 @@ 23955-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23956+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23957 // reserved. Use of this source code is governed by a BSD-style license that 23958 // can be found in the LICENSE file. 23959 // 23960@@ -9,7 +9,7 @@ 23961 // implementations. See the translator.README.txt file in the tools directory 23962 // for more information. 23963 // 23964-// $hash=557b305c33b5975b197bf930cc223f76b3032288$ 23965+// $hash=675b3f340d14d93d1de6b340c862bdce4893a067$ 23966 // 23967 23968 #include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h" 23969@@ -128,8 +128,8 @@ CefRect CefWindowDelegateCToCpp::GetInitialBounds(CefRefPtr<CefWindow> window) { 23970 } 23971 23972 NO_SANITIZE("cfi-icall") 23973-cef_show_state_t CefWindowDelegateCToCpp::GetInitialShowState( 23974- CefRefPtr<CefWindow> window) { 23975+cef_show_state_t 23976+ CefWindowDelegateCToCpp::GetInitialShowState(CefRefPtr<CefWindow> window) { 23977 shutdown_checker::AssertNotShutdown(); 23978 23979 cef_window_delegate_t* _struct = GetStruct(); 23980diff --git a/src/cef/libcef_dll/ctocpp/views/window_delegate_ctocpp.h b/src/cef/libcef_dll/ctocpp/views/window_delegate_ctocpp.h 23981index 5071dea81ef78..a4ff6ff2f0fbc 23982--- a/src/cef/libcef_dll/ctocpp/views/window_delegate_ctocpp.h 23983+++ b/src/cef/libcef_dll/ctocpp/views/window_delegate_ctocpp.h 23984@@ -1,4 +1,4 @@ 23985-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 23986+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 23987 // reserved. Use of this source code is governed by a BSD-style license that 23988 // can be found in the LICENSE file. 23989 // 23990@@ -9,7 +9,7 @@ 23991 // implementations. See the translator.README.txt file in the tools directory 23992 // for more information. 23993 // 23994-// $hash=e61d67d8295c9fcc3e801bf61f4381434924940c$ 23995+// $hash=0cf526c263eb14e6cc17a0664ffe57ca476c4e81$ 23996 // 23997 23998 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_ 23999diff --git a/src/cef/libcef_dll/ctocpp/waitable_event_ctocpp.cc b/src/cef/libcef_dll/ctocpp/waitable_event_ctocpp.cc 24000index 175fe0601c11c..a447bf4318252 24001--- a/src/cef/libcef_dll/ctocpp/waitable_event_ctocpp.cc 24002+++ b/src/cef/libcef_dll/ctocpp/waitable_event_ctocpp.cc 24003@@ -1,4 +1,4 @@ 24004-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24005+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24006 // reserved. Use of this source code is governed by a BSD-style license that 24007 // can be found in the LICENSE file. 24008 // 24009@@ -9,7 +9,7 @@ 24010 // implementations. See the translator.README.txt file in the tools directory 24011 // for more information. 24012 // 24013-// $hash=4d16f6afcc06cee186ba3aa5752dc5933e6b57f4$ 24014+// $hash=f090fd5026cecf6e847f27909418f1dd76fec64f$ 24015 // 24016 24017 #include "libcef_dll/ctocpp/waitable_event_ctocpp.h" 24018diff --git a/src/cef/libcef_dll/ctocpp/waitable_event_ctocpp.h b/src/cef/libcef_dll/ctocpp/waitable_event_ctocpp.h 24019index 8b31f5406be6a..7cd6e03c78c0b 24020--- a/src/cef/libcef_dll/ctocpp/waitable_event_ctocpp.h 24021+++ b/src/cef/libcef_dll/ctocpp/waitable_event_ctocpp.h 24022@@ -1,4 +1,4 @@ 24023-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24024+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24025 // reserved. Use of this source code is governed by a BSD-style license that 24026 // can be found in the LICENSE file. 24027 // 24028@@ -9,7 +9,7 @@ 24029 // implementations. See the translator.README.txt file in the tools directory 24030 // for more information. 24031 // 24032-// $hash=519f7aab2913629ad5ac8ebcf228abd14b816ade$ 24033+// $hash=ea92b8c5871694e9c32c29a5d554774afe7aa3dd$ 24034 // 24035 24036 #ifndef CEF_LIBCEF_DLL_CTOCPP_WAITABLE_EVENT_CTOCPP_H_ 24037diff --git a/src/cef/libcef_dll/ctocpp/web_message_receiver_ctocpp.cc b/src/cef/libcef_dll/ctocpp/web_message_receiver_ctocpp.cc 24038new file mode 100644 24039index 0000000000000..79426527c8d80 24040--- /dev/null 24041+++ b/src/cef/libcef_dll/ctocpp/web_message_receiver_ctocpp.cc 24042@@ -0,0 +1,64 @@ 24043+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24044+// reserved. Use of this source code is governed by a BSD-style license that 24045+// can be found in the LICENSE file. 24046+// 24047+// --------------------------------------------------------------------------- 24048+// 24049+// This file was generated by the CEF translator tool. If making changes by 24050+// hand only do so within the body of existing method and function 24051+// implementations. See the translator.README.txt file in the tools directory 24052+// for more information. 24053+// 24054+// $hash=d9376a2376082b68ec98decd89eb8100fdf7093c$ 24055+// 24056+ 24057+#include "libcef_dll/ctocpp/web_message_receiver_ctocpp.h" 24058+#include "libcef_dll/cpptoc/value_cpptoc.h" 24059+#include "libcef_dll/shutdown_checker.h" 24060+ 24061+// VIRTUAL METHODS - Body may be edited by hand. 24062+ 24063+NO_SANITIZE("cfi-icall") 24064+void CefWebMessageReceiverCToCpp::OnMessage(CefRefPtr<CefValue> message) { 24065+ shutdown_checker::AssertNotShutdown(); 24066+ 24067+ cef_web_message_receiver_t* _struct = GetStruct(); 24068+ if (CEF_MEMBER_MISSING(_struct, on_message)) 24069+ return; 24070+ 24071+ // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24072+ 24073+ // Verify param: message; type: refptr_diff 24074+ DCHECK(message.get()); 24075+ if (!message.get()) 24076+ return; 24077+ 24078+ // Execute 24079+ _struct->on_message(_struct, CefValueCppToC::Wrap(message)); 24080+} 24081+ 24082+// CONSTRUCTOR - Do not edit by hand. 24083+ 24084+CefWebMessageReceiverCToCpp::CefWebMessageReceiverCToCpp() {} 24085+ 24086+// DESTRUCTOR - Do not edit by hand. 24087+ 24088+CefWebMessageReceiverCToCpp::~CefWebMessageReceiverCToCpp() { 24089+ shutdown_checker::AssertNotShutdown(); 24090+} 24091+ 24092+template <> 24093+cef_web_message_receiver_t* CefCToCppRefCounted< 24094+ CefWebMessageReceiverCToCpp, 24095+ CefWebMessageReceiver, 24096+ cef_web_message_receiver_t>::UnwrapDerived(CefWrapperType type, 24097+ CefWebMessageReceiver* c) { 24098+ NOTREACHED() << "Unexpected class type: " << type; 24099+ return nullptr; 24100+} 24101+ 24102+template <> 24103+CefWrapperType CefCToCppRefCounted<CefWebMessageReceiverCToCpp, 24104+ CefWebMessageReceiver, 24105+ cef_web_message_receiver_t>::kWrapperType = 24106+ WT_WEB_MESSAGE_RECEIVER; 24107diff --git a/src/cef/libcef_dll/ctocpp/web_message_receiver_ctocpp.h b/src/cef/libcef_dll/ctocpp/web_message_receiver_ctocpp.h 24108new file mode 100644 24109index 0000000000000..dc06b05f5f4a6 24110--- /dev/null 24111+++ b/src/cef/libcef_dll/ctocpp/web_message_receiver_ctocpp.h 24112@@ -0,0 +1,43 @@ 24113+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24114+// reserved. Use of this source code is governed by a BSD-style license that 24115+// can be found in the LICENSE file. 24116+// 24117+// --------------------------------------------------------------------------- 24118+// 24119+// This file was generated by the CEF translator tool. If making changes by 24120+// hand only do so within the body of existing method and function 24121+// implementations. See the translator.README.txt file in the tools directory 24122+// for more information. 24123+// 24124+// $hash=89209c202ff223f2f20cb3490518bfaceda224ca$ 24125+// 24126+ 24127+#ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_MESSAGE_RECEIVER_CTOCPP_H_ 24128+#define CEF_LIBCEF_DLL_CTOCPP_WEB_MESSAGE_RECEIVER_CTOCPP_H_ 24129+#pragma once 24130+ 24131+#if !defined(BUILDING_CEF_SHARED) 24132+#error This file can be included DLL-side only 24133+#endif 24134+ 24135+#include "include/capi/cef_browser_capi.h" 24136+#include "include/capi/cef_client_capi.h" 24137+#include "include/cef_browser.h" 24138+#include "include/cef_client.h" 24139+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h" 24140+ 24141+// Wrap a C structure with a C++ class. 24142+// This class may be instantiated and accessed DLL-side only. 24143+class CefWebMessageReceiverCToCpp 24144+ : public CefCToCppRefCounted<CefWebMessageReceiverCToCpp, 24145+ CefWebMessageReceiver, 24146+ cef_web_message_receiver_t> { 24147+ public: 24148+ CefWebMessageReceiverCToCpp(); 24149+ virtual ~CefWebMessageReceiverCToCpp(); 24150+ 24151+ // CefWebMessageReceiver methods. 24152+ void OnMessage(CefRefPtr<CefValue> message) override; 24153+}; 24154+ 24155+#endif // CEF_LIBCEF_DLL_CTOCPP_WEB_MESSAGE_RECEIVER_CTOCPP_H_ 24156diff --git a/src/cef/libcef_dll/ctocpp/web_storage_ctocpp.cc b/src/cef/libcef_dll/ctocpp/web_storage_ctocpp.cc 24157index e7bb033dc83dd..3ba293ae3961b 24158--- a/src/cef/libcef_dll/ctocpp/web_storage_ctocpp.cc 24159+++ b/src/cef/libcef_dll/ctocpp/web_storage_ctocpp.cc 24160@@ -1,4 +1,4 @@ 24161-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24162+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24163 // reserved. Use of this source code is governed by a BSD-style license that 24164 // can be found in the LICENSE file. 24165 // 24166@@ -9,7 +9,7 @@ 24167 // implementations. See the translator.README.txt file in the tools directory 24168 // for more information. 24169 // 24170-// $hash=4b81eb5261e185b3360dd7de90e5f97dcb6aef86$ 24171+// $hash=c0cf10fdd538681da58a94edcfce6bc4e093df52$ 24172 // 24173 24174 #include "libcef_dll/ctocpp/web_storage_ctocpp.h" 24175diff --git a/src/cef/libcef_dll/ctocpp/web_storage_ctocpp.h b/src/cef/libcef_dll/ctocpp/web_storage_ctocpp.h 24176index a929a3b8ec4cd..9d6a97a364811 24177--- a/src/cef/libcef_dll/ctocpp/web_storage_ctocpp.h 24178+++ b/src/cef/libcef_dll/ctocpp/web_storage_ctocpp.h 24179@@ -1,4 +1,4 @@ 24180-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24181+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24182 // reserved. Use of this source code is governed by a BSD-style license that 24183 // can be found in the LICENSE file. 24184 // 24185@@ -9,7 +9,7 @@ 24186 // implementations. See the translator.README.txt file in the tools directory 24187 // for more information. 24188 // 24189-// $hash=444c0aee423697f9d2747ae46d11d9f28ad01b3d$ 24190+// $hash=f01cdd91598d151bee833a80f50f550adda82d37$ 24191 // 24192 24193 #ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_STORAGE_CTOCPP_H_ 24194diff --git a/src/cef/libcef_dll/ctocpp/write_handler_ctocpp.cc b/src/cef/libcef_dll/ctocpp/write_handler_ctocpp.cc 24195index 4efb2d1a7ccba..c25c75393e306 24196--- a/src/cef/libcef_dll/ctocpp/write_handler_ctocpp.cc 24197+++ b/src/cef/libcef_dll/ctocpp/write_handler_ctocpp.cc 24198@@ -1,4 +1,4 @@ 24199-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24200+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24201 // reserved. Use of this source code is governed by a BSD-style license that 24202 // can be found in the LICENSE file. 24203 // 24204@@ -9,7 +9,7 @@ 24205 // implementations. See the translator.README.txt file in the tools directory 24206 // for more information. 24207 // 24208-// $hash=728e5a2aa03b7884d5001f784dcf6bc6fb79254a$ 24209+// $hash=511240eb698a1c0d5f0f75884aaad8658e5a4987$ 24210 // 24211 24212 #include "libcef_dll/ctocpp/write_handler_ctocpp.h" 24213diff --git a/src/cef/libcef_dll/ctocpp/write_handler_ctocpp.h b/src/cef/libcef_dll/ctocpp/write_handler_ctocpp.h 24214index b302f19cdadf2..8d95983159c0f 24215--- a/src/cef/libcef_dll/ctocpp/write_handler_ctocpp.h 24216+++ b/src/cef/libcef_dll/ctocpp/write_handler_ctocpp.h 24217@@ -1,4 +1,4 @@ 24218-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24219+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24220 // reserved. Use of this source code is governed by a BSD-style license that 24221 // can be found in the LICENSE file. 24222 // 24223@@ -9,7 +9,7 @@ 24224 // implementations. See the translator.README.txt file in the tools directory 24225 // for more information. 24226 // 24227-// $hash=f6c9ec7aa1916be4cc120149c9e174751fc3ea77$ 24228+// $hash=56728a12a3e14ab71d1dee991a7912d5d3c111f6$ 24229 // 24230 24231 #ifndef CEF_LIBCEF_DLL_CTOCPP_WRITE_HANDLER_CTOCPP_H_ 24232diff --git a/src/cef/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc b/src/cef/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc 24233index 23a7bb776bc2e..fd860fb5878c1 24234--- a/src/cef/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc 24235+++ b/src/cef/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc 24236@@ -1,4 +1,4 @@ 24237-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24238+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24239 // reserved. Use of this source code is governed by a BSD-style license that 24240 // can be found in the LICENSE file. 24241 // 24242@@ -9,7 +9,7 @@ 24243 // implementations. See the translator.README.txt file in the tools directory 24244 // for more information. 24245 // 24246-// $hash=1799aec02f9d2491056fbf3042b4ba89498adaf4$ 24247+// $hash=43754e6fc947d6f008c9471a7a86218fafa84c82$ 24248 // 24249 24250 #include "libcef_dll/ctocpp/x509cert_principal_ctocpp.h" 24251diff --git a/src/cef/libcef_dll/ctocpp/x509cert_principal_ctocpp.h b/src/cef/libcef_dll/ctocpp/x509cert_principal_ctocpp.h 24252index c0c47d7efd9bd..ff05ec5fdddf0 24253--- a/src/cef/libcef_dll/ctocpp/x509cert_principal_ctocpp.h 24254+++ b/src/cef/libcef_dll/ctocpp/x509cert_principal_ctocpp.h 24255@@ -1,4 +1,4 @@ 24256-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24257+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24258 // reserved. Use of this source code is governed by a BSD-style license that 24259 // can be found in the LICENSE file. 24260 // 24261@@ -9,7 +9,7 @@ 24262 // implementations. See the translator.README.txt file in the tools directory 24263 // for more information. 24264 // 24265-// $hash=5462ba22f05a8e8a05aac6cac9d23004767049db$ 24266+// $hash=26c06425ee3d75470177631cff1348e5dc26f946$ 24267 // 24268 24269 #ifndef CEF_LIBCEF_DLL_CTOCPP_X509CERT_PRINCIPAL_CTOCPP_H_ 24270diff --git a/src/cef/libcef_dll/ctocpp/x509certificate_ctocpp.cc b/src/cef/libcef_dll/ctocpp/x509certificate_ctocpp.cc 24271index 5dc3e32e1127f..94927a4cb634f 24272--- a/src/cef/libcef_dll/ctocpp/x509certificate_ctocpp.cc 24273+++ b/src/cef/libcef_dll/ctocpp/x509certificate_ctocpp.cc 24274@@ -1,4 +1,4 @@ 24275-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24276+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24277 // reserved. Use of this source code is governed by a BSD-style license that 24278 // can be found in the LICENSE file. 24279 // 24280@@ -9,7 +9,7 @@ 24281 // implementations. See the translator.README.txt file in the tools directory 24282 // for more information. 24283 // 24284-// $hash=b5ab278c54b7ed9046b43a7f362a18ebc8bde146$ 24285+// $hash=db3bb173e77431908f255b12791ced7ecf80bd14$ 24286 // 24287 24288 #include "libcef_dll/ctocpp/x509certificate_ctocpp.h" 24289diff --git a/src/cef/libcef_dll/ctocpp/x509certificate_ctocpp.h b/src/cef/libcef_dll/ctocpp/x509certificate_ctocpp.h 24290index fd09946157b33..32d8e40eedb73 24291--- a/src/cef/libcef_dll/ctocpp/x509certificate_ctocpp.h 24292+++ b/src/cef/libcef_dll/ctocpp/x509certificate_ctocpp.h 24293@@ -1,4 +1,4 @@ 24294-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24295+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24296 // reserved. Use of this source code is governed by a BSD-style license that 24297 // can be found in the LICENSE file. 24298 // 24299@@ -9,7 +9,7 @@ 24300 // implementations. See the translator.README.txt file in the tools directory 24301 // for more information. 24302 // 24303-// $hash=eb95efa4bb7e2ca0696f86390fa32f269eedf9f3$ 24304+// $hash=b4c1192c28884415b9f175cde389237b9c8d33da$ 24305 // 24306 24307 #ifndef CEF_LIBCEF_DLL_CTOCPP_X509CERTIFICATE_CTOCPP_H_ 24308diff --git a/src/cef/libcef_dll/ctocpp/xml_reader_ctocpp.cc b/src/cef/libcef_dll/ctocpp/xml_reader_ctocpp.cc 24309index 617f05151baba..ab738e26c20a6 24310--- a/src/cef/libcef_dll/ctocpp/xml_reader_ctocpp.cc 24311+++ b/src/cef/libcef_dll/ctocpp/xml_reader_ctocpp.cc 24312@@ -1,4 +1,4 @@ 24313-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24314+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24315 // reserved. Use of this source code is governed by a BSD-style license that 24316 // can be found in the LICENSE file. 24317 // 24318@@ -9,7 +9,7 @@ 24319 // implementations. See the translator.README.txt file in the tools directory 24320 // for more information. 24321 // 24322-// $hash=9fc59c7d9a9acbf92fde0cfceda151c4936c136b$ 24323+// $hash=e5e2325d96c340e29a99e622df97eb792a5dd776$ 24324 // 24325 24326 #include "libcef_dll/ctocpp/xml_reader_ctocpp.h" 24327diff --git a/src/cef/libcef_dll/ctocpp/xml_reader_ctocpp.h b/src/cef/libcef_dll/ctocpp/xml_reader_ctocpp.h 24328index 8d60d09b45524..281018604842f 24329--- a/src/cef/libcef_dll/ctocpp/xml_reader_ctocpp.h 24330+++ b/src/cef/libcef_dll/ctocpp/xml_reader_ctocpp.h 24331@@ -1,4 +1,4 @@ 24332-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24333+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24334 // reserved. Use of this source code is governed by a BSD-style license that 24335 // can be found in the LICENSE file. 24336 // 24337@@ -9,7 +9,7 @@ 24338 // implementations. See the translator.README.txt file in the tools directory 24339 // for more information. 24340 // 24341-// $hash=1f6c29938591312a257cfe1b77de830c90b4a6c3$ 24342+// $hash=5f87c82093a6a16e03df00673d2ff20a9f0490d5$ 24343 // 24344 24345 #ifndef CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ 24346diff --git a/src/cef/libcef_dll/ctocpp/zip_reader_ctocpp.cc b/src/cef/libcef_dll/ctocpp/zip_reader_ctocpp.cc 24347index 381241d341798..7f45c50d2b5a6 24348--- a/src/cef/libcef_dll/ctocpp/zip_reader_ctocpp.cc 24349+++ b/src/cef/libcef_dll/ctocpp/zip_reader_ctocpp.cc 24350@@ -1,4 +1,4 @@ 24351-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24352+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24353 // reserved. Use of this source code is governed by a BSD-style license that 24354 // can be found in the LICENSE file. 24355 // 24356@@ -9,7 +9,7 @@ 24357 // implementations. See the translator.README.txt file in the tools directory 24358 // for more information. 24359 // 24360-// $hash=f01ac0e38723b8786f115a14dbca8d4d3d1a57bf$ 24361+// $hash=221ec55fd792b8af2ce239763e909b9c61584a5a$ 24362 // 24363 24364 #include "libcef_dll/ctocpp/zip_reader_ctocpp.h" 24365diff --git a/src/cef/libcef_dll/ctocpp/zip_reader_ctocpp.h b/src/cef/libcef_dll/ctocpp/zip_reader_ctocpp.h 24366index 5ba83082448f3..ae16c72dce20a 24367--- a/src/cef/libcef_dll/ctocpp/zip_reader_ctocpp.h 24368+++ b/src/cef/libcef_dll/ctocpp/zip_reader_ctocpp.h 24369@@ -1,4 +1,4 @@ 24370-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24371+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24372 // reserved. Use of this source code is governed by a BSD-style license that 24373 // can be found in the LICENSE file. 24374 // 24375@@ -9,7 +9,7 @@ 24376 // implementations. See the translator.README.txt file in the tools directory 24377 // for more information. 24378 // 24379-// $hash=995930b1262a99fb14a57dc0af908d292434e00b$ 24380+// $hash=ac375946e782fc0665bfd75850bd1f3ce388f186$ 24381 // 24382 24383 #ifndef CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ 24384diff --git a/src/cef/libcef_dll/libcef_dll.cc b/src/cef/libcef_dll/libcef_dll.cc 24385index 10519d315ecd4..74f9e4cd89e2a 24386--- a/src/cef/libcef_dll/libcef_dll.cc 24387+++ b/src/cef/libcef_dll/libcef_dll.cc 24388@@ -1,4 +1,4 @@ 24389-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24390+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24391 // reserved. Use of this source code is governed by a BSD-style license that 24392 // can be found in the LICENSE file. 24393 // 24394@@ -9,7 +9,7 @@ 24395 // implementations. See the translator.README.txt file in the tools directory 24396 // for more information. 24397 // 24398-// $hash=fa04fba704658b02675380bd63d91005c6757d4e$ 24399+// $hash=b4f718eaa15556b762af4f0e6dbc1b55c8e2d83f$ 24400 // 24401 24402 #include "include/capi/cef_app_capi.h" 24403@@ -25,7 +25,6 @@ 24404 #include "include/capi/cef_task_capi.h" 24405 #include "include/capi/cef_trace_capi.h" 24406 #include "include/capi/cef_v8_capi.h" 24407-#include "include/capi/cef_web_plugin_capi.h" 24408 #include "include/capi/test/cef_test_helpers_capi.h" 24409 #include "include/cef_app.h" 24410 #include "include/cef_crash_util.h" 24411@@ -40,7 +39,6 @@ 24412 #include "include/cef_task.h" 24413 #include "include/cef_trace.h" 24414 #include "include/cef_v8.h" 24415-#include "include/cef_web_plugin.h" 24416 #include "include/test/cef_test_helpers.h" 24417 #include "libcef_dll/cpptoc/binary_value_cpptoc.h" 24418 #include "libcef_dll/cpptoc/command_line_cpptoc.h" 24419@@ -52,8 +50,6 @@ 24420 #include "libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h" 24421 #include "libcef_dll/ctocpp/task_ctocpp.h" 24422 #include "libcef_dll/ctocpp/v8handler_ctocpp.h" 24423-#include "libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h" 24424-#include "libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h" 24425 #include "libcef_dll/shutdown_checker.h" 24426 #include "libcef_dll/transfer_util.h" 24427 24428@@ -840,69 +836,6 @@ CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, 24429 return _retval; 24430 } 24431 24432-CEF_EXPORT void cef_visit_web_plugin_info( 24433- struct _cef_web_plugin_info_visitor_t* visitor) { 24434- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24435- 24436- // Verify param: visitor; type: refptr_diff 24437- DCHECK(visitor); 24438- if (!visitor) 24439- return; 24440- 24441- // Execute 24442- CefVisitWebPluginInfo(CefWebPluginInfoVisitorCToCpp::Wrap(visitor)); 24443-} 24444- 24445-CEF_EXPORT void cef_refresh_web_plugins() { 24446- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24447- 24448- // Execute 24449- CefRefreshWebPlugins(); 24450-} 24451- 24452-CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path) { 24453- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24454- 24455- // Verify param: path; type: string_byref_const 24456- DCHECK(path); 24457- if (!path) 24458- return; 24459- 24460- // Execute 24461- CefUnregisterInternalWebPlugin(CefString(path)); 24462-} 24463- 24464-CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path) { 24465- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24466- 24467- // Verify param: path; type: string_byref_const 24468- DCHECK(path); 24469- if (!path) 24470- return; 24471- 24472- // Execute 24473- CefRegisterWebPluginCrash(CefString(path)); 24474-} 24475- 24476-CEF_EXPORT void cef_is_web_plugin_unstable( 24477- const cef_string_t* path, 24478- struct _cef_web_plugin_unstable_callback_t* callback) { 24479- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24480- 24481- // Verify param: path; type: string_byref_const 24482- DCHECK(path); 24483- if (!path) 24484- return; 24485- // Verify param: callback; type: refptr_diff 24486- DCHECK(callback); 24487- if (!callback) 24488- return; 24489- 24490- // Execute 24491- CefIsWebPluginUnstable(CefString(path), 24492- CefWebPluginUnstableCallbackCToCpp::Wrap(callback)); 24493-} 24494- 24495 CEF_EXPORT void cef_execute_java_script_with_user_gesture_for_tests( 24496 struct _cef_frame_t* frame, 24497 const cef_string_t* javascript) { 24498diff --git a/src/cef/libcef_dll/views_stub.cc b/src/cef/libcef_dll/views_stub.cc 24499index 5ebce32154fd5..729624165566b 24500--- a/src/cef/libcef_dll/views_stub.cc 24501+++ b/src/cef/libcef_dll/views_stub.cc 24502@@ -1,4 +1,4 @@ 24503-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24504+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24505 // reserved. Use of this source code is governed by a BSD-style license that 24506 // can be found in the LICENSE file. 24507 // 24508@@ -9,7 +9,7 @@ 24509 // implementations. See the translator.README.txt file in the tools directory 24510 // for more information. 24511 // 24512-// $hash=892496158fbb51c0534dfbdfd4597daef6b21da7$ 24513+// $hash=4e28ddb86e7157c4f04b43c02080c12b0001c6e0$ 24514 // 24515 24516 #include "include/views/cef_browser_view.h" 24517diff --git a/src/cef/libcef_dll/wrapper/libcef_dll_dylib.cc b/src/cef/libcef_dll/wrapper/libcef_dll_dylib.cc 24518index e6da9f1dd223b..b7c094e621fe4 24519--- a/src/cef/libcef_dll/wrapper/libcef_dll_dylib.cc 24520+++ b/src/cef/libcef_dll/wrapper/libcef_dll_dylib.cc 24521@@ -1,4 +1,4 @@ 24522-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24523+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24524 // reserved. Use of this source code is governed by a BSD-style license that 24525 // can be found in the LICENSE file. 24526 // 24527@@ -9,7 +9,7 @@ 24528 // implementations. See the translator.README.txt file in the tools directory 24529 // for more information. 24530 // 24531-// $hash=7185f14aad39a002663816fe05a4990f76d8ad6f$ 24532+// $hash=577c6334f41f1be591969c7789081b002e86b91c$ 24533 // 24534 24535 #include <dlfcn.h> 24536@@ -26,7 +26,6 @@ 24537 #include "include/capi/cef_file_util_capi.h" 24538 #include "include/capi/cef_i18n_util_capi.h" 24539 #include "include/capi/cef_image_capi.h" 24540-#include "include/capi/cef_media_router_capi.h" 24541 #include "include/capi/cef_menu_model_capi.h" 24542 #include "include/capi/cef_origin_whitelist_capi.h" 24543 #include "include/capi/cef_parser_capi.h" 24544@@ -49,7 +48,6 @@ 24545 #include "include/capi/cef_v8_capi.h" 24546 #include "include/capi/cef_values_capi.h" 24547 #include "include/capi/cef_waitable_event_capi.h" 24548-#include "include/capi/cef_web_plugin_capi.h" 24549 #include "include/capi/cef_web_storage_capi.h" 24550 #include "include/capi/cef_xml_reader_capi.h" 24551 #include "include/capi/cef_zip_reader_capi.h" 24552@@ -173,14 +171,6 @@ typedef int64 (*cef_now_from_system_trace_time_ptr)(); 24553 typedef int (*cef_register_extension_ptr)(const cef_string_t*, 24554 const cef_string_t*, 24555 struct _cef_v8handler_t*); 24556-typedef void (*cef_visit_web_plugin_info_ptr)( 24557- struct _cef_web_plugin_info_visitor_t*); 24558-typedef void (*cef_refresh_web_plugins_ptr)(); 24559-typedef void (*cef_unregister_internal_web_plugin_ptr)(const cef_string_t*); 24560-typedef void (*cef_register_web_plugin_crash_ptr)(const cef_string_t*); 24561-typedef void (*cef_is_web_plugin_unstable_ptr)( 24562- const cef_string_t*, 24563- struct _cef_web_plugin_unstable_callback_t*); 24564 typedef void (*cef_execute_java_script_with_user_gesture_for_tests_ptr)( 24565 struct _cef_frame_t*, 24566 const cef_string_t*); 24567@@ -209,8 +199,6 @@ typedef int (*cef_cookie_manager_create_cef_cookie_ptr)(const cef_string_t*, 24568 typedef struct _cef_data_base_t* (*cef_data_base_get_global_ptr)(); 24569 typedef struct _cef_drag_data_t* (*cef_drag_data_create_ptr)(); 24570 typedef struct _cef_image_t* (*cef_image_create_ptr)(); 24571-typedef struct _cef_media_router_t* (*cef_media_router_get_global_ptr)( 24572- struct _cef_completion_callback_t*); 24573 typedef struct _cef_menu_model_t* (*cef_menu_model_create_ptr)( 24574 struct _cef_menu_model_delegate_t*); 24575 typedef struct _cef_print_settings_t* (*cef_print_settings_create_ptr)(); 24576@@ -573,11 +561,6 @@ struct libcef_pointers { 24577 cef_end_tracing_ptr cef_end_tracing; 24578 cef_now_from_system_trace_time_ptr cef_now_from_system_trace_time; 24579 cef_register_extension_ptr cef_register_extension; 24580- cef_visit_web_plugin_info_ptr cef_visit_web_plugin_info; 24581- cef_refresh_web_plugins_ptr cef_refresh_web_plugins; 24582- cef_unregister_internal_web_plugin_ptr cef_unregister_internal_web_plugin; 24583- cef_register_web_plugin_crash_ptr cef_register_web_plugin_crash; 24584- cef_is_web_plugin_unstable_ptr cef_is_web_plugin_unstable; 24585 cef_execute_java_script_with_user_gesture_for_tests_ptr 24586 cef_execute_java_script_with_user_gesture_for_tests; 24587 cef_browser_host_create_browser_ptr cef_browser_host_create_browser; 24588@@ -590,7 +573,6 @@ struct libcef_pointers { 24589 cef_data_base_get_global_ptr cef_data_base_get_global; 24590 cef_drag_data_create_ptr cef_drag_data_create; 24591 cef_image_create_ptr cef_image_create; 24592- cef_media_router_get_global_ptr cef_media_router_get_global; 24593 cef_menu_model_create_ptr cef_menu_model_create; 24594 cef_print_settings_create_ptr cef_print_settings_create; 24595 cef_process_message_create_ptr cef_process_message_create; 24596@@ -793,11 +775,6 @@ int libcef_init_pointers(const char* path) { 24597 INIT_ENTRY(cef_end_tracing); 24598 INIT_ENTRY(cef_now_from_system_trace_time); 24599 INIT_ENTRY(cef_register_extension); 24600- INIT_ENTRY(cef_visit_web_plugin_info); 24601- INIT_ENTRY(cef_refresh_web_plugins); 24602- INIT_ENTRY(cef_unregister_internal_web_plugin); 24603- INIT_ENTRY(cef_register_web_plugin_crash); 24604- INIT_ENTRY(cef_is_web_plugin_unstable); 24605 INIT_ENTRY(cef_execute_java_script_with_user_gesture_for_tests); 24606 INIT_ENTRY(cef_browser_host_create_browser); 24607 INIT_ENTRY(cef_browser_host_create_browser_sync); 24608@@ -808,7 +785,6 @@ int libcef_init_pointers(const char* path) { 24609 INIT_ENTRY(cef_data_base_get_global); 24610 INIT_ENTRY(cef_drag_data_create); 24611 INIT_ENTRY(cef_image_create); 24612- INIT_ENTRY(cef_media_router_get_global); 24613 INIT_ENTRY(cef_menu_model_create); 24614 INIT_ENTRY(cef_print_settings_create); 24615 INIT_ENTRY(cef_process_message_create); 24616@@ -1112,8 +1088,8 @@ int cef_create_url(const struct _cef_urlparts_t* parts, cef_string_t* url) { 24617 } 24618 24619 NO_SANITIZE("cfi-icall") 24620-cef_string_userfree_t cef_format_url_for_security_display( 24621- const cef_string_t* origin_url) { 24622+cef_string_userfree_t 24623+ cef_format_url_for_security_display(const cef_string_t* origin_url) { 24624 return g_libcef_pointers.cef_format_url_for_security_display(origin_url); 24625 } 24626 24627@@ -1246,32 +1222,6 @@ int cef_register_extension(const cef_string_t* extension_name, 24628 javascript_code, handler); 24629 } 24630 24631-NO_SANITIZE("cfi-icall") 24632-void cef_visit_web_plugin_info(struct _cef_web_plugin_info_visitor_t* visitor) { 24633- g_libcef_pointers.cef_visit_web_plugin_info(visitor); 24634-} 24635- 24636-NO_SANITIZE("cfi-icall") void cef_refresh_web_plugins() { 24637- g_libcef_pointers.cef_refresh_web_plugins(); 24638-} 24639- 24640-NO_SANITIZE("cfi-icall") 24641-void cef_unregister_internal_web_plugin(const cef_string_t* path) { 24642- g_libcef_pointers.cef_unregister_internal_web_plugin(path); 24643-} 24644- 24645-NO_SANITIZE("cfi-icall") 24646-void cef_register_web_plugin_crash(const cef_string_t* path) { 24647- g_libcef_pointers.cef_register_web_plugin_crash(path); 24648-} 24649- 24650-NO_SANITIZE("cfi-icall") 24651-void cef_is_web_plugin_unstable( 24652- const cef_string_t* path, 24653- struct _cef_web_plugin_unstable_callback_t* callback) { 24654- g_libcef_pointers.cef_is_web_plugin_unstable(path, callback); 24655-} 24656- 24657 NO_SANITIZE("cfi-icall") 24658 void cef_execute_java_script_with_user_gesture_for_tests( 24659 struct _cef_frame_t* frame, 24660@@ -1339,12 +1289,6 @@ NO_SANITIZE("cfi-icall") struct _cef_image_t* cef_image_create() { 24661 return g_libcef_pointers.cef_image_create(); 24662 } 24663 24664-NO_SANITIZE("cfi-icall") 24665-struct _cef_media_router_t* cef_media_router_get_global( 24666- struct _cef_completion_callback_t* callback) { 24667- return g_libcef_pointers.cef_media_router_get_global(callback); 24668-} 24669- 24670 NO_SANITIZE("cfi-icall") 24671 struct _cef_menu_model_t* cef_menu_model_create( 24672 struct _cef_menu_model_delegate_t* delegate) { 24673@@ -1611,46 +1555,54 @@ struct _cef_translator_test_t* cef_translator_test_create() { 24674 } 24675 24676 NO_SANITIZE("cfi-icall") 24677-struct _cef_translator_test_ref_ptr_library_t* 24678-cef_translator_test_ref_ptr_library_create(int value) { 24679+struct 24680+ _cef_translator_test_ref_ptr_library_t* cef_translator_test_ref_ptr_library_create( 24681+ int value) { 24682 return g_libcef_pointers.cef_translator_test_ref_ptr_library_create(value); 24683 } 24684 24685 NO_SANITIZE("cfi-icall") 24686-struct _cef_translator_test_ref_ptr_library_child_t* 24687-cef_translator_test_ref_ptr_library_child_create(int value, int other_value) { 24688+struct 24689+ _cef_translator_test_ref_ptr_library_child_t* cef_translator_test_ref_ptr_library_child_create( 24690+ int value, 24691+ int other_value) { 24692 return g_libcef_pointers.cef_translator_test_ref_ptr_library_child_create( 24693 value, other_value); 24694 } 24695 24696 NO_SANITIZE("cfi-icall") 24697-struct _cef_translator_test_ref_ptr_library_child_child_t* 24698-cef_translator_test_ref_ptr_library_child_child_create(int value, 24699- int other_value, 24700- int other_other_value) { 24701+struct 24702+ _cef_translator_test_ref_ptr_library_child_child_t* cef_translator_test_ref_ptr_library_child_child_create( 24703+ int value, 24704+ int other_value, 24705+ int other_other_value) { 24706 return g_libcef_pointers 24707 .cef_translator_test_ref_ptr_library_child_child_create( 24708 value, other_value, other_other_value); 24709 } 24710 24711 NO_SANITIZE("cfi-icall") 24712-struct _cef_translator_test_scoped_library_t* 24713-cef_translator_test_scoped_library_create(int value) { 24714+struct 24715+ _cef_translator_test_scoped_library_t* cef_translator_test_scoped_library_create( 24716+ int value) { 24717 return g_libcef_pointers.cef_translator_test_scoped_library_create(value); 24718 } 24719 24720 NO_SANITIZE("cfi-icall") 24721-struct _cef_translator_test_scoped_library_child_t* 24722-cef_translator_test_scoped_library_child_create(int value, int other_value) { 24723+struct 24724+ _cef_translator_test_scoped_library_child_t* cef_translator_test_scoped_library_child_create( 24725+ int value, 24726+ int other_value) { 24727 return g_libcef_pointers.cef_translator_test_scoped_library_child_create( 24728 value, other_value); 24729 } 24730 24731 NO_SANITIZE("cfi-icall") 24732-struct _cef_translator_test_scoped_library_child_child_t* 24733-cef_translator_test_scoped_library_child_child_create(int value, 24734- int other_value, 24735- int other_other_value) { 24736+struct 24737+ _cef_translator_test_scoped_library_child_child_t* cef_translator_test_scoped_library_child_child_create( 24738+ int value, 24739+ int other_value, 24740+ int other_other_value) { 24741 return g_libcef_pointers 24742 .cef_translator_test_scoped_library_child_child_create(value, other_value, 24743 other_other_value); 24744diff --git a/src/cef/libcef_dll/wrapper/libcef_dll_wrapper.cc b/src/cef/libcef_dll/wrapper/libcef_dll_wrapper.cc 24745index e406eb7608ae8..4d71c68db6f8c 24746--- a/src/cef/libcef_dll/wrapper/libcef_dll_wrapper.cc 24747+++ b/src/cef/libcef_dll/wrapper/libcef_dll_wrapper.cc 24748@@ -1,4 +1,4 @@ 24749-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24750+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24751 // reserved. Use of this source code is governed by a BSD-style license that 24752 // can be found in the LICENSE file. 24753 // 24754@@ -9,7 +9,7 @@ 24755 // implementations. See the translator.README.txt file in the tools directory 24756 // for more information. 24757 // 24758-// $hash=180ca5b8f789625a725e004aa6768fd5046a3753$ 24759+// $hash=45e769535f300e227783606b108546a49d9aa953$ 24760 // 24761 24762 #include "include/capi/cef_app_capi.h" 24763@@ -25,7 +25,6 @@ 24764 #include "include/capi/cef_task_capi.h" 24765 #include "include/capi/cef_trace_capi.h" 24766 #include "include/capi/cef_v8_capi.h" 24767-#include "include/capi/cef_web_plugin_capi.h" 24768 #include "include/capi/test/cef_test_helpers_capi.h" 24769 #include "include/cef_api_hash.h" 24770 #include "include/cef_app.h" 24771@@ -41,7 +40,6 @@ 24772 #include "include/cef_task.h" 24773 #include "include/cef_trace.h" 24774 #include "include/cef_v8.h" 24775-#include "include/cef_web_plugin.h" 24776 #include "include/test/cef_test_helpers.h" 24777 #include "libcef_dll/cpptoc/app_cpptoc.h" 24778 #include "libcef_dll/cpptoc/completion_callback_cpptoc.h" 24779@@ -49,8 +47,6 @@ 24780 #include "libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h" 24781 #include "libcef_dll/cpptoc/task_cpptoc.h" 24782 #include "libcef_dll/cpptoc/v8handler_cpptoc.h" 24783-#include "libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h" 24784-#include "libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h" 24785 #include "libcef_dll/ctocpp/binary_value_ctocpp.h" 24786 #include "libcef_dll/ctocpp/command_line_ctocpp.h" 24787 #include "libcef_dll/ctocpp/frame_ctocpp.h" 24788@@ -168,7 +164,7 @@ NO_SANITIZE("cfi-icall") CEF_GLOBAL bool CefCrashReportingEnabled() { 24789 24790 NO_SANITIZE("cfi-icall") 24791 CEF_GLOBAL 24792-void CefSetCrashKeyValue(const CefString& key, const CefString& value) { 24793+ void CefSetCrashKeyValue(const CefString& key, const CefString& value) { 24794 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24795 24796 // Verify param: key; type: string_byref_const 24797@@ -323,10 +319,10 @@ NO_SANITIZE("cfi-icall") CEF_GLOBAL bool CefIsRTL() { 24798 24799 NO_SANITIZE("cfi-icall") 24800 CEF_GLOBAL 24801-bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, 24802- const CefString& target_protocol, 24803- const CefString& target_domain, 24804- bool allow_target_subdomains) { 24805+ bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, 24806+ const CefString& target_protocol, 24807+ const CefString& target_domain, 24808+ bool allow_target_subdomains) { 24809 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24810 24811 // Verify param: source_origin; type: string_byref_const 24812@@ -350,10 +346,10 @@ bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, 24813 24814 NO_SANITIZE("cfi-icall") 24815 CEF_GLOBAL 24816-bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, 24817- const CefString& target_protocol, 24818- const CefString& target_domain, 24819- bool allow_target_subdomains) { 24820+ bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, 24821+ const CefString& target_protocol, 24822+ const CefString& target_domain, 24823+ bool allow_target_subdomains) { 24824 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24825 24826 // Verify param: source_origin; type: string_byref_const 24827@@ -414,7 +410,7 @@ CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) { 24828 24829 NO_SANITIZE("cfi-icall") 24830 CEF_GLOBAL CefString 24831-CefFormatUrlForSecurityDisplay(const CefString& origin_url) { 24832+ CefFormatUrlForSecurityDisplay(const CefString& origin_url) { 24833 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24834 24835 // Verify param: origin_url; type: string_byref_const 24836@@ -452,8 +448,8 @@ CEF_GLOBAL CefString CefGetMimeType(const CefString& extension) { 24837 24838 NO_SANITIZE("cfi-icall") 24839 CEF_GLOBAL 24840-void CefGetExtensionsForMimeType(const CefString& mime_type, 24841- std::vector<CefString>& extensions) { 24842+ void CefGetExtensionsForMimeType(const CefString& mime_type, 24843+ std::vector<CefString>& extensions) { 24844 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24845 24846 // Verify param: mime_type; type: string_byref_const 24847@@ -607,8 +603,8 @@ CEF_GLOBAL CefRefPtr<CefValue> CefParseJSONAndReturnError( 24848 } 24849 24850 NO_SANITIZE("cfi-icall") 24851-CEF_GLOBAL CefString CefWriteJSON(CefRefPtr<CefValue> node, 24852- cef_json_writer_options_t options) { 24853+CEF_GLOBAL CefString 24854+ CefWriteJSON(CefRefPtr<CefValue> node, cef_json_writer_options_t options) { 24855 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24856 24857 // Verify param: node; type: refptr_same 24858@@ -806,73 +802,6 @@ CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name, 24859 return _retval ? true : false; 24860 } 24861 24862-NO_SANITIZE("cfi-icall") 24863-CEF_GLOBAL 24864-void CefVisitWebPluginInfo(CefRefPtr<CefWebPluginInfoVisitor> visitor) { 24865- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24866- 24867- // Verify param: visitor; type: refptr_diff 24868- DCHECK(visitor.get()); 24869- if (!visitor.get()) 24870- return; 24871- 24872- // Execute 24873- cef_visit_web_plugin_info(CefWebPluginInfoVisitorCppToC::Wrap(visitor)); 24874-} 24875- 24876-NO_SANITIZE("cfi-icall") CEF_GLOBAL void CefRefreshWebPlugins() { 24877- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24878- 24879- // Execute 24880- cef_refresh_web_plugins(); 24881-} 24882- 24883-NO_SANITIZE("cfi-icall") 24884-CEF_GLOBAL void CefUnregisterInternalWebPlugin(const CefString& path) { 24885- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24886- 24887- // Verify param: path; type: string_byref_const 24888- DCHECK(!path.empty()); 24889- if (path.empty()) 24890- return; 24891- 24892- // Execute 24893- cef_unregister_internal_web_plugin(path.GetStruct()); 24894-} 24895- 24896-NO_SANITIZE("cfi-icall") 24897-CEF_GLOBAL void CefRegisterWebPluginCrash(const CefString& path) { 24898- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24899- 24900- // Verify param: path; type: string_byref_const 24901- DCHECK(!path.empty()); 24902- if (path.empty()) 24903- return; 24904- 24905- // Execute 24906- cef_register_web_plugin_crash(path.GetStruct()); 24907-} 24908- 24909-NO_SANITIZE("cfi-icall") 24910-CEF_GLOBAL void CefIsWebPluginUnstable( 24911- const CefString& path, 24912- CefRefPtr<CefWebPluginUnstableCallback> callback) { 24913- // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 24914- 24915- // Verify param: path; type: string_byref_const 24916- DCHECK(!path.empty()); 24917- if (path.empty()) 24918- return; 24919- // Verify param: callback; type: refptr_diff 24920- DCHECK(callback.get()); 24921- if (!callback.get()) 24922- return; 24923- 24924- // Execute 24925- cef_is_web_plugin_unstable( 24926- path.GetStruct(), CefWebPluginUnstableCallbackCppToC::Wrap(callback)); 24927-} 24928- 24929 NO_SANITIZE("cfi-icall") 24930 CEF_GLOBAL void CefExecuteJavaScriptWithUserGestureForTests( 24931 CefRefPtr<CefFrame> frame, 24932diff --git a/src/cef/libcef_dll/wrapper_types.h b/src/cef/libcef_dll/wrapper_types.h 24933index 739e3bf0fbc0a..1ed052157b775 24934--- a/src/cef/libcef_dll/wrapper_types.h 24935+++ b/src/cef/libcef_dll/wrapper_types.h 24936@@ -1,4 +1,4 @@ 24937-// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights 24938+// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights 24939 // reserved. Use of this source code is governed by a BSD-style license that 24940 // can be found in the LICENSE file. 24941 // 24942@@ -9,7 +9,7 @@ 24943 // implementations. See the translator.README.txt file in the tools directory 24944 // for more information. 24945 // 24946-// $hash=db6398c91f3b1993bea4332bdc8c7f286934962b$ 24947+// $hash=dfb6a82e093895922f6f06700eb74d9d64493c24$ 24948 // 24949 24950 #ifndef CEF_LIBCEF_DLL_WRAPPER_TYPES_H_ 24951@@ -71,6 +71,7 @@ enum CefWrapperType { 24952 WT_FRAME_HANDLER, 24953 WT_GEOLOCATION_ACESS, 24954 WT_GET_EXTENSION_RESOURCE_CALLBACK, 24955+ WT_GET_IMAGES_CALLBACK, 24956 WT_GET_ORIGIN_USAGE_OR_QUOTA_CALLBACK, 24957 WT_GET_ORIGINS_CALLBACK, 24958 WT_IMAGE, 24959@@ -83,13 +84,6 @@ enum CefWrapperType { 24960 WT_LIFE_SPAN_HANDLER, 24961 WT_LIST_VALUE, 24962 WT_LOAD_HANDLER, 24963- WT_MEDIA_OBSERVER, 24964- WT_MEDIA_ROUTE, 24965- WT_MEDIA_ROUTE_CREATE_CALLBACK, 24966- WT_MEDIA_ROUTER, 24967- WT_MEDIA_SINK, 24968- WT_MEDIA_SINK_DEVICE_INFO_CALLBACK, 24969- WT_MEDIA_SOURCE, 24970 WT_MENU_BUTTON, 24971 WT_MENU_BUTTON_DELEGATE, 24972 WT_MENU_BUTTON_PRESSED_LOCK, 24973@@ -135,6 +129,7 @@ enum CefWrapperType { 24974 WT_SCHEME_REGISTRAR, 24975 WT_SCROLL_VIEW, 24976 WT_SELECT_CLIENT_CERTIFICATE_CALLBACK, 24977+ WT_SELECT_POPUP_CALLBACK, 24978 WT_SERVER, 24979 WT_SERVER_HANDLER, 24980 WT_SET_COOKIE_CALLBACK, 24981@@ -173,9 +168,7 @@ enum CefWrapperType { 24982 WT_VIEW, 24983 WT_VIEW_DELEGATE, 24984 WT_WAITABLE_EVENT, 24985- WT_WEB_PLUGIN_INFO, 24986- WT_WEB_PLUGIN_INFO_VISITOR, 24987- WT_WEB_PLUGIN_UNSTABLE_CALLBACK, 24988+ WT_WEB_MESSAGE_RECEIVER, 24989 WT_WEB_STORAGE, 24990 WT_WINDOW, 24991 WT_WINDOW_DELEGATE, 24992@@ -188,4 +181,4 @@ enum CefWrapperType { 24993 WT_LAST 24994 }; 24995 24996-#endif // CEF_LIBCEF_DLL_WRAPPER_TYPES_H_ 24997+#endif // CEF_LIBCEF_DLL_WRAPPER_TYPES_H_ 24998diff --git a/src/cef/tools/cef_parser.py b/src/cef/tools/cef_parser.py 24999index d624358ad9ecb..743b663002dc1 25000--- a/src/cef/tools/cef_parser.py 25001+++ b/src/cef/tools/cef_parser.py 25002@@ -406,7 +406,8 @@ _simpletypes = { 25003 'CefDraggableRegion': ['cef_draggable_region_t', 'CefDraggableRegion()'], 25004 'CefThreadId': ['cef_thread_id_t', 'TID_UI'], 25005 'CefTime': ['cef_time_t', 'CefTime()'], 25006- 'CefAudioParameters': ['cef_audio_parameters_t', 'CefAudioParameters()'] 25007+ 'CefAudioParameters': ['cef_audio_parameters_t', 'CefAudioParameters()'], 25008+ 'CefSelectPopupItem': ['cef_select_popup_item_t', 'CefSelectPopupItem()'] 25009 } 25010 25011 25012diff --git a/src/chrome/app/chrome_command_ids.h b/src/chrome/app/chrome_command_ids.h 25013index a2c827a2bb86b..e0c20edd83d1f 25014--- a/src/chrome/app/chrome_command_ids.h 25015+++ b/src/chrome/app/chrome_command_ids.h 25016@@ -9,6 +9,10 @@ 25017 #include "build/build_config.h" 25018 #include "build/chromeos_buildflags.h" 25019 25020+#if BUILDFLAG(IS_OHOS) 25021+#include "media/media_buildflags.h" 25022+#endif 25023+ 25024 // This file lists all the command IDs understood by e.g. the browser. 25025 // It is used by Windows RC files, Mac NIB files, and other platforms too. 25026 25027@@ -105,7 +109,9 @@ 25028 #define IDC_SAVE_CREDIT_CARD_FOR_PAGE 35008 25029 #define IDC_TRANSLATE_PAGE 35009 25030 #define IDC_MANAGE_PASSWORDS_FOR_PAGE 35010 25031+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25032 #define IDC_ROUTE_MEDIA 35011 25033+#endif 25034 #define IDC_WINDOW_MUTE_SITE 35012 25035 #define IDC_WINDOW_PIN_TAB 35013 25036 #define IDC_WINDOW_GROUP_TAB 35014 25037diff --git a/src/chrome/app/generated_resources.grd b/src/chrome/app/generated_resources.grd 25038index e58abd99ec84d..6e9eda3525bf3 25039--- a/src/chrome/app/generated_resources.grd 25040+++ b/src/chrome/app/generated_resources.grd 25041@@ -11448,6 +11448,20 @@ Please help our engineers fix this problem. Tell us what happened right before y 25042 Choose a different file 25043 </message> 25044 25045+ <!-- File System Access dangerous file dialogs. --> 25046+ <message name="IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TITLE" desc="Title of dialog explaining that the user is attempting to save a file with a dangerous extension"> 25047+ Save <ph name="FILE">$1<ex>filename.exe</ex></ph>? 25048+ </message> 25049+ <message name="IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TEXT" desc="Text of dialog explaining that the user is attempting to save a file with a dangerous extension"> 25050+ This type of file can be dangerous. Only save this file if you trust <ph name="ORIGIN">$1<ex>example.com</ex></ph> 25051+ </message> 25052+ <message name="IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_DONT_SAVE" desc="Text of the button allowing the user to choose to not save a file with a dangerous extension"> 25053+ Don't save 25054+ </message> 25055+ <message name="IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_SAVE" desc="Text of the button allowing the user to choose to save a file with a dangerous extension"> 25056+ Save 25057+ </message> 25058+ 25059 <!-- Relaunch notification bubble and dialog. --> 25060 <if expr="not is_android"> 25061 <if expr="not chromeos"> 25062diff --git a/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_DONT_SAVE.png.sha1 b/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_DONT_SAVE.png.sha1 25063new file mode 100644 25064index 0000000000000..b4e4d3067f62d 25065--- /dev/null 25066+++ b/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_DONT_SAVE.png.sha1 25067@@ -0,0 +1 @@ 25068+cfb63088971bbdfd73d14a3e849d7e0f8aecd8d8 25069\ No newline at end of file 25070diff --git a/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_SAVE.png.sha1 b/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_SAVE.png.sha1 25071new file mode 100644 25072index 0000000000000..6cbe9a6dbd2ef 25073--- /dev/null 25074+++ b/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_SAVE.png.sha1 25075@@ -0,0 +1 @@ 25076+ac80c1d7d96ab4d6903c5bdff8ef44d9c1fc0010 25077\ No newline at end of file 25078diff --git a/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TEXT.png.sha1 b/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TEXT.png.sha1 25079new file mode 100644 25080index 0000000000000..c7761a677f4c2 25081--- /dev/null 25082+++ b/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TEXT.png.sha1 25083@@ -0,0 +1 @@ 25084+de13f0e25c8b14a883d4401271c67279be0a8efb 25085\ No newline at end of file 25086diff --git a/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TITLE.png.sha1 b/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TITLE.png.sha1 25087new file mode 100644 25088index 0000000000000..54a09ff5b11cc 25089--- /dev/null 25090+++ b/src/chrome/app/generated_resources_grd/IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TITLE.png.sha1 25091@@ -0,0 +1 @@ 25092+72867ef942c1b202c09c7f6e289cbd234485de7c 25093\ No newline at end of file 25094diff --git a/src/chrome/browser/BUILD.gn b/src/chrome/browser/BUILD.gn 25095index 641f9531a6409..2c25dcbca6062 25096--- a/src/chrome/browser/BUILD.gn 25097+++ b/src/chrome/browser/BUILD.gn 25098@@ -2430,6 +2430,15 @@ static_library("browser") { 25099 "//ui/webui/resources/js/browser_command:mojo_bindings", 25100 ] 25101 25102+ if (is_ohos && !ohos_enable_media_router) { 25103+ allow_circular_includes_from -= [ "//chrome/browser/media/router" ] 25104+ deps -= [ 25105+ "//chrome/browser/media/router", 25106+ "//chrome/browser/media/router:media_router_feature", 25107+ "//chrome/browser/media/router/discovery/access_code:access_code_cast_feature", 25108+ ] 25109+ } 25110+ 25111 if (is_ohos && safe_browsing_mode == 0) { 25112 deps -= [ 25113 "//chrome/browser/safe_browsing", 25114@@ -4571,6 +4580,12 @@ static_library("browser") { 25115 "//chrome/browser/web_applications/app_service", 25116 ] 25117 25118+ if (is_ohos && !ohos_enable_media_router) { 25119+ allow_circular_includes_from -= 25120+ [ "//chrome/browser/media/router/discovery:discovery" ] 25121+ deps -= [ "//chrome/browser/media/router/discovery:discovery" ] 25122+ } 25123+ 25124 if (!is_chromeos_ash) { 25125 sources += [ 25126 "accessibility/soda_installer_impl.cc", 25127@@ -6215,7 +6230,7 @@ static_library("browser") { 25128 ] 25129 } 25130 25131- if (is_win || is_mac || is_linux || is_chromeos || is_fuchsia || is_ohos) { 25132+ if (is_win || is_mac || is_linux || is_chromeos || is_fuchsia) { 25133 sources += [ 25134 "media/cast_mirroring_service_host.cc", 25135 "media/cast_mirroring_service_host.h", 25136@@ -7986,7 +8001,7 @@ static_library("test_support") { 25137 } 25138 } 25139 25140-if (!is_android) { 25141+if (!is_android && !is_ohos) { 25142 static_library("test_support_ui") { 25143 testonly = true 25144 configs += [ "//build/config:precompiled_headers" ] 25145diff --git a/src/chrome/browser/about_flags.cc b/src/chrome/browser/about_flags.cc 25146index 2825190b68c3c..b953aa57be4a3 25147--- a/src/chrome/browser/about_flags.cc 25148+++ b/src/chrome/browser/about_flags.cc 25149@@ -224,7 +224,9 @@ 25150 #include "components/power_scheduler/power_scheduler_features.h" 25151 #include "components/webapps/browser/android/features.h" 25152 #else // BUILDFLAG(IS_ANDROID) 25153+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25154 #include "chrome/browser/media/router/media_router_feature.h" 25155+#endif 25156 #include "chrome/browser/web_applications/preinstalled_app_install_features.h" 25157 #endif // BUILDFLAG(IS_ANDROID) 25158 25159@@ -3776,6 +3778,7 @@ const FeatureEntry kFeatureEntries[] = { 25160 switches::kSyncServiceURL, 25161 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")}, 25162 #if !BUILDFLAG(IS_ANDROID) 25163+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25164 {"media-router-cast-allow-all-ips", 25165 flag_descriptions::kMediaRouterCastAllowAllIPsName, 25166 flag_descriptions::kMediaRouterCastAllowAllIPsDescription, kOsDesktop, 25167@@ -3790,6 +3793,7 @@ const FeatureEntry kFeatureEntries[] = { 25168 flag_descriptions::kAllowAllSitesToInitiateMirroringDescription, 25169 kOsDesktop, 25170 FEATURE_VALUE_TYPE(media_router::kAllowAllSitesToInitiateMirroring)}, 25171+#endif 25172 {"enable-migrate-default-chrome-app-to-web-apps-gsuite", 25173 flag_descriptions::kEnableMigrateDefaultChromeAppToWebAppsGSuiteName, 25174 flag_descriptions:: 25175@@ -5111,11 +5115,13 @@ const FeatureEntry kFeatureEntries[] = { 25176 kEnableWebAuthenticationChromeOSAuthenticatorDescription, 25177 kOsCrOS, FEATURE_VALUE_TYPE(device::kWebAuthCrosPlatformAuthenticator)}, 25178 #endif 25179+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 25180 #if BUILDFLAG(ENABLE_PDF) 25181 {"accessible-pdf-form", flag_descriptions::kAccessiblePDFFormName, 25182 flag_descriptions::kAccessiblePDFFormDescription, kOsDesktop, 25183 FEATURE_VALUE_TYPE(chrome_pdf::features::kAccessiblePDFForm)}, 25184 #endif // BUILDFLAG(ENABLE_PDF) 25185+#endif 25186 25187 #if BUILDFLAG(ENABLE_PRINTING) 25188 #if BUILDFLAG(IS_MAC) 25189diff --git a/src/chrome/browser/apps/platform_apps/BUILD.gn b/src/chrome/browser/apps/platform_apps/BUILD.gn 25190index b3b61dc65cbb1..f16ba3217636b 25191--- a/src/chrome/browser/apps/platform_apps/BUILD.gn 25192+++ b/src/chrome/browser/apps/platform_apps/BUILD.gn 25193@@ -3,6 +3,9 @@ 25194 # found in the LICENSE file. 25195 25196 import("//extensions/buildflags/buildflags.gni") 25197+if (is_ohos) { 25198+ import("//media/media_options.gni") 25199+} 25200 25201 assert(enable_extensions) 25202 25203@@ -76,6 +79,10 @@ source_set("platform_apps") { 25204 "//ui/gfx", 25205 ] 25206 25207+ if (is_ohos && !ohos_enable_media_router) { 25208+ deps -= [ "//chrome/browser/media/router/discovery" ] 25209+ } 25210+ 25211 if (is_mac) { 25212 deps += [ "//chrome/browser/apps/app_shim" ] 25213 } 25214diff --git a/src/chrome/browser/cart/cart_handler.cc b/src/chrome/browser/cart/cart_handler.cc 25215index 0904477a5a2a2..d8cebbe267be8 25216--- a/src/chrome/browser/cart/cart_handler.cc 25217+++ b/src/chrome/browser/cart/cart_handler.cc 25218@@ -65,6 +65,11 @@ void CartHandler::RestoreRemovedCart(const GURL& cart_url, 25219 void CartHandler::GetCartDataCallback(GetMerchantCartsCallback callback, 25220 bool success, 25221 std::vector<CartDB::KeyAndValue> res) { 25222+ DCHECK(success); 25223+ if (!success) { 25224+ std::move(callback).Run({}); 25225+ return; 25226+ } 25227 std::vector<chrome_cart::mojom::MerchantCartPtr> carts; 25228 bool show_discount = cart_service_->IsCartDiscountEnabled(); 25229 for (CartDB::KeyAndValue proto_pair : res) { 25230diff --git a/src/chrome/browser/cart/cart_service.cc b/src/chrome/browser/cart/cart_service.cc 25231index 4c74929a3443a..c5d88aefcdf02 25232--- a/src/chrome/browser/cart/cart_service.cc 25233+++ b/src/chrome/browser/cart/cart_service.cc 25234@@ -679,6 +679,11 @@ bool CartService::ShouldSkip(const GURL& url) { 25235 void CartService::OnLoadCarts(CartDB::LoadCallback callback, 25236 bool success, 25237 std::vector<CartDB::KeyAndValue> proto_pairs) { 25238+ DCHECK(success); 25239+ if (!success) { 25240+ std::move(callback).Run(success, {}); 25241+ return; 25242+ } 25243 if (cart_features::IsFakeDataEnabled()) { 25244 std::sort(proto_pairs.begin(), proto_pairs.end(), 25245 CompareTimeStampForProtoPair); 25246diff --git a/src/chrome/browser/chrome_browser_interface_binders.cc b/src/chrome/browser/chrome_browser_interface_binders.cc 25247index 6f5c928372ba1..4a3a2cac19367 25248--- a/src/chrome/browser/chrome_browser_interface_binders.cc 25249+++ b/src/chrome/browser/chrome_browser_interface_binders.cc 25250@@ -128,8 +128,6 @@ 25251 #include "chrome/browser/speech/speech_recognition_client_browser_interface.h" 25252 #include "chrome/browser/speech/speech_recognition_client_browser_interface_factory.h" 25253 #include "chrome/browser/speech/speech_recognition_service.h" 25254-#include "chrome/browser/ui/webui/access_code_cast/access_code_cast.mojom.h" 25255-#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h" 25256 #include "chrome/browser/ui/webui/app_service_internals/app_service_internals.mojom.h" 25257 #include "chrome/browser/ui/webui/app_service_internals/app_service_internals_ui.h" 25258 #include "chrome/browser/ui/webui/downloads/downloads.mojom.h" 25259@@ -285,6 +283,11 @@ 25260 #include "chrome/browser/ui/webui/chromeos/chromebox_for_meetings/network_settings_dialog.h" 25261 #endif 25262 25263+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25264+#include "chrome/browser/ui/webui/access_code_cast/access_code_cast.mojom.h" 25265+#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h" 25266+#endif 25267+ 25268 namespace chrome { 25269 namespace internal { 25270 25271@@ -810,8 +813,10 @@ void PopulateChromeWebUIFrameBinders( 25272 ::mojom::app_service_internals::AppServiceInternalsPageHandler, 25273 AppServiceInternalsUI>(map); 25274 25275+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25276 RegisterWebUIControllerInterfaceBinder< 25277 access_code_cast::mojom::PageHandlerFactory, AccessCodeCastUI>(map); 25278+#endif 25279 #endif // BUILDFLAG(IS_ANDROID) 25280 25281 #if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) 25282diff --git a/src/chrome/browser/chrome_content_browser_client.cc b/src/chrome/browser/chrome_content_browser_client.cc 25283index 84df69449342c..01aaad5f9acf4 25284--- a/src/chrome/browser/chrome_content_browser_client.cc 25285+++ b/src/chrome/browser/chrome_content_browser_client.cc 25286@@ -65,7 +65,6 @@ 25287 #include "chrome/browser/lifetime/browser_shutdown.h" 25288 #include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h" 25289 #include "chrome/browser/media/audio_service_util.h" 25290-#include "chrome/browser/media/router/media_router_feature.h" 25291 #include "chrome/browser/media/webrtc/audio_debug_recordings_handler.h" 25292 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" 25293 #include "chrome/browser/media/webrtc/webrtc_logging_controller.h" 25294@@ -199,8 +198,6 @@ 25295 #include "components/keep_alive_registry/scoped_keep_alive.h" 25296 #include "components/language/core/browser/pref_names.h" 25297 #include "components/live_caption/caption_util.h" 25298-#include "components/media_router/browser/presentation/presentation_service_delegate_impl.h" 25299-#include "components/media_router/browser/presentation/receiver_presentation_service_delegate_impl.h" 25300 #include "components/metrics/client_info.h" 25301 #include "components/metrics_services_manager/metrics_services_manager.h" 25302 #include "components/net_log/chrome_net_log.h" 25303@@ -617,6 +614,12 @@ 25304 #include "base/win/windows_h_disallowed.h" 25305 #endif // defined(_WINDOWS_) 25306 25307+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25308+#include "chrome/browser/media/router/media_router_feature.h" 25309+#include "components/media_router/browser/presentation/presentation_service_delegate_impl.h" 25310+#include "components/media_router/browser/presentation/receiver_presentation_service_delegate_impl.h" 25311+#endif 25312+ 25313 using blink::mojom::EffectiveConnectionType; 25314 using blink::web_pref::WebPreferences; 25315 using content::BrowserThread; 25316@@ -4090,16 +4093,19 @@ void ChromeContentBrowserClient::OpenURL( 25317 content::ControllerPresentationServiceDelegate* 25318 ChromeContentBrowserClient::GetControllerPresentationServiceDelegate( 25319 content::WebContents* web_contents) { 25320+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25321 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { 25322 return media_router::PresentationServiceDelegateImpl:: 25323 GetOrCreateForWebContents(web_contents); 25324 } 25325+#endif 25326 return nullptr; 25327 } 25328 25329 content::ReceiverPresentationServiceDelegate* 25330 ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate( 25331 content::WebContents* web_contents) { 25332+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25333 if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { 25334 // ReceiverPresentationServiceDelegateImpl exists only for WebContents 25335 // created for offscreen presentations. The WebContents must belong to 25336@@ -4110,6 +4116,7 @@ ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate( 25337 return impl; 25338 } 25339 } 25340+#endif 25341 return nullptr; 25342 } 25343 25344diff --git a/src/chrome/browser/devtools/BUILD.gn b/src/chrome/browser/devtools/BUILD.gn 25345index c2f6d9d299627..d030eaffeee05 25346--- a/src/chrome/browser/devtools/BUILD.gn 25347+++ b/src/chrome/browser/devtools/BUILD.gn 25348@@ -227,6 +227,10 @@ static_library("devtools") { 25349 "device/cast_device_provider.h", 25350 ] 25351 } 25352+ 25353+ if (is_ohos && !ohos_enable_media_router) { 25354+ deps -= [ "//chrome/browser/media/router:media_router_feature" ] 25355+ } 25356 } 25357 25358 if (is_mac) { 25359@@ -269,6 +273,17 @@ static_library("devtools") { 25360 deps += [ "//components/printing/browser/print_to_pdf" ] 25361 } 25362 sources += rebase_path(_protocol_generated, ".", target_gen_dir) 25363+ 25364+ if (is_ohos && !ohos_enable_media_router) { 25365+ sources -= [ 25366+ "protocol/cast_handler.cc", 25367+ "protocol/cast_handler.h", 25368+ ] 25369+ deps -= [ 25370+ "//components/media_router/browser", 25371+ "//components/media_router/common/mojom:media_router", 25372+ ] 25373+ } 25374 } 25375 25376 if (enable_extensions) { 25377diff --git a/src/chrome/browser/devtools/chrome_devtools_session.cc b/src/chrome/browser/devtools/chrome_devtools_session.cc 25378index f75c4555a98c1..cd491e6c63d23 25379--- a/src/chrome/browser/devtools/chrome_devtools_session.cc 25380+++ b/src/chrome/browser/devtools/chrome_devtools_session.cc 25381@@ -10,7 +10,6 @@ 25382 #include "base/strings/string_number_conversions.h" 25383 #include "build/chromeos_buildflags.h" 25384 #include "chrome/browser/devtools/protocol/browser_handler.h" 25385-#include "chrome/browser/devtools/protocol/cast_handler.h" 25386 #include "chrome/browser/devtools/protocol/page_handler.h" 25387 #include "chrome/browser/devtools/protocol/security_handler.h" 25388 #include "chrome/browser/devtools/protocol/target_handler.h" 25389@@ -24,6 +23,10 @@ 25390 #include "chrome/browser/devtools/protocol/window_manager_handler.h" 25391 #endif 25392 25393+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25394+#include "chrome/browser/devtools/protocol/cast_handler.h" 25395+#endif 25396+ 25397 ChromeDevToolsSession::ChromeDevToolsSession( 25398 content::DevToolsAgentHostClientChannel* channel) 25399 : dispatcher_(this), client_channel_(channel) { 25400@@ -34,10 +37,12 @@ ChromeDevToolsSession::ChromeDevToolsSession( 25401 agent_host, agent_host->GetWebContents(), &dispatcher_); 25402 security_handler_ = std::make_unique<SecurityHandler>( 25403 agent_host->GetWebContents(), &dispatcher_); 25404+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25405 if (channel->GetClient()->MayAttachToBrowser()) { 25406 cast_handler_ = std::make_unique<CastHandler>( 25407 agent_host->GetWebContents(), &dispatcher_); 25408 } 25409+#endif 25410 } 25411 target_handler_ = std::make_unique<TargetHandler>(&dispatcher_); 25412 if (channel->GetClient()->MayAttachToBrowser()) { 25413diff --git a/src/chrome/browser/devtools/chrome_devtools_session.h b/src/chrome/browser/devtools/chrome_devtools_session.h 25414index 756d84ed0f7fd..9f8059402345c 25415--- a/src/chrome/browser/devtools/chrome_devtools_session.h 25416+++ b/src/chrome/browser/devtools/chrome_devtools_session.h 25417@@ -14,6 +14,10 @@ 25418 #include "chrome/browser/devtools/protocol/protocol.h" 25419 #include "content/public/browser/devtools_manager_delegate.h" 25420 25421+#if BUILDFLAG(IS_OHOS) 25422+#include "media/media_buildflags.h" 25423+#endif 25424+ 25425 namespace content { 25426 class DevToolsAgentHostClientChannel; 25427 } // namespace content 25428@@ -58,7 +62,9 @@ class ChromeDevToolsSession : public protocol::FrontendChannel { 25429 25430 protocol::UberDispatcher dispatcher_; 25431 std::unique_ptr<BrowserHandler> browser_handler_; 25432+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25433 std::unique_ptr<CastHandler> cast_handler_; 25434+#endif 25435 std::unique_ptr<PageHandler> page_handler_; 25436 std::unique_ptr<SecurityHandler> security_handler_; 25437 std::unique_ptr<TargetHandler> target_handler_; 25438diff --git a/src/chrome/browser/devtools/devtools_browser_context_manager.cc b/src/chrome/browser/devtools/devtools_browser_context_manager.cc 25439index 1981efe98478f..70b604f64524a 25440--- a/src/chrome/browser/devtools/devtools_browser_context_manager.cc 25441+++ b/src/chrome/browser/devtools/devtools_browser_context_manager.cc 25442@@ -13,6 +13,12 @@ 25443 #include "chrome/browser/ui/browser_list.h" 25444 #include "chrome/browser/ui/browser_window.h" 25445 25446+namespace { 25447+ 25448+const int64_t kDestroyProfileTimeoutSeconds = 60; 25449+ 25450+} // namespace 25451+ 25452 DevToolsBrowserContextManager::DevToolsBrowserContextManager() {} 25453 25454 DevToolsBrowserContextManager::~DevToolsBrowserContextManager() = default; 25455@@ -87,7 +93,8 @@ void DevToolsBrowserContextManager::DisposeBrowserContext( 25456 if (!has_opened_browser) { 25457 otr_profiles_.erase(it); 25458 profile->RemoveObserver(this); 25459- ProfileDestroyer::DestroyProfileWhenAppropriate(profile); 25460+ ProfileDestroyer::DestroyProfileWhenAppropriateWithTimeout( 25461+ profile, base::Seconds(kDestroyProfileTimeoutSeconds)); 25462 std::move(callback).Run(true, ""); 25463 return; 25464 } 25465@@ -133,8 +140,10 @@ void DevToolsBrowserContextManager::OnBrowserRemoved(Browser* browser) { 25466 // during the browser tear-down process. 25467 base::ThreadTaskRunnerHandle::Get()->PostTask( 25468 FROM_HERE, 25469- base::BindOnce(&ProfileDestroyer::DestroyProfileWhenAppropriate, 25470- base::Unretained(otr_profile))); 25471+ base::BindOnce( 25472+ &ProfileDestroyer::DestroyProfileWhenAppropriateWithTimeout, 25473+ base::Unretained(otr_profile), 25474+ base::Seconds(kDestroyProfileTimeoutSeconds))); 25475 25476 std::move(pending_disposal->second).Run(true, ""); 25477 pending_context_disposals_.erase(pending_disposal); 25478diff --git a/src/chrome/browser/devtools/devtools_targets_ui.cc b/src/chrome/browser/devtools/devtools_targets_ui.cc 25479index bc4bc3b0a04b8..3bcad847bc1b3 25480--- a/src/chrome/browser/devtools/devtools_targets_ui.cc 25481+++ b/src/chrome/browser/devtools/devtools_targets_ui.cc 25482@@ -19,12 +19,18 @@ 25483 #include "chrome/browser/devtools/device/devtools_android_bridge.h" 25484 #include "chrome/browser/devtools/devtools_window.h" 25485 #include "chrome/browser/devtools/serialize_host_descriptions.h" 25486-#include "components/media_router/browser/presentation/local_presentation_manager.h" 25487-#include "components/media_router/browser/presentation/local_presentation_manager_factory.h" 25488 #include "content/public/browser/browser_thread.h" 25489 #include "content/public/browser/devtools_agent_host.h" 25490 #include "content/public/browser/devtools_agent_host_observer.h" 25491 25492+#if BUILDFLAG(IS_OHOS) 25493+#include "media/media_buildflags.h" 25494+#if BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25495+#include "components/media_router/browser/presentation/local_presentation_manager.h" 25496+#include "components/media_router/browser/presentation/local_presentation_manager_factory.h" 25497+#endif 25498+#endif 25499+ 25500 using content::BrowserThread; 25501 using content::DevToolsAgentHost; 25502 25503@@ -85,7 +91,9 @@ private: 25504 bool AllowDevToolsFor(DevToolsAgentHost* host); 25505 25506 Profile* profile_; 25507+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25508 media_router::LocalPresentationManager* local_presentation_manager_; 25509+#endif 25510 std::unique_ptr<base::OneShotTimer> timer_; 25511 base::WeakPtrFactory<LocalTargetsUIHandler> weak_factory_{this}; 25512 }; 25513@@ -93,10 +101,15 @@ private: 25514 LocalTargetsUIHandler::LocalTargetsUIHandler(const Callback& callback, 25515 Profile* profile) 25516 : DevToolsTargetsUIHandler(kTargetSourceLocal, callback), 25517- profile_(profile), 25518+ profile_(profile) 25519+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25520+ , 25521 local_presentation_manager_( 25522 media_router::LocalPresentationManagerFactory:: 25523 GetOrCreateForBrowserContext(profile_)) { 25524+#else 25525+ { 25526+#endif 25527 DevToolsAgentHost::AddObserver(this); 25528 UpdateTargets(); 25529 } 25530@@ -150,8 +163,12 @@ void LocalTargetsUIHandler::UpdateTargets() { 25531 } 25532 25533 bool LocalTargetsUIHandler::AllowDevToolsFor(DevToolsAgentHost* host) { 25534+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 25535 return local_presentation_manager_->IsLocalPresentation( 25536 host->GetWebContents()) || 25537+#else 25538+ return 25539+#endif 25540 (Profile::FromBrowserContext(host->GetBrowserContext()) == profile_ && 25541 DevToolsWindow::AllowDevToolsFor(profile_, host->GetWebContents())); 25542 } 25543diff --git a/src/chrome/browser/downgrade/buildflags.gni b/src/chrome/browser/downgrade/buildflags.gni 25544index dfee39d9b02a4..1fc6d662d899e 25545--- a/src/chrome/browser/downgrade/buildflags.gni 25546+++ b/src/chrome/browser/downgrade/buildflags.gni 25547@@ -6,5 +6,5 @@ import("//build/config/chromeos/ui_mode.gni") 25548 import("//build/config/features.gni") 25549 25550 declare_args() { 25551- enable_downgrade_processing = !is_android && !is_chromeos_ash 25552+ enable_downgrade_processing = !is_android && !is_chromeos_ash && !is_ohos 25553 } 25554diff --git a/src/chrome/browser/download/download_target_determiner.cc b/src/chrome/browser/download/download_target_determiner.cc 25555index 17d5e00128633..d68922c9e5bdb 25556--- a/src/chrome/browser/download/download_target_determiner.cc 25557+++ b/src/chrome/browser/download/download_target_determiner.cc 25558@@ -11,6 +11,7 @@ 25559 #include "base/location.h" 25560 #include "base/rand_util.h" 25561 #include "base/strings/stringprintf.h" 25562+#include "base/strings/utf_string_conversions.h" 25563 #include "base/task/post_task.h" 25564 #include "base/task/single_thread_task_runner.h" 25565 #include "base/task/task_runner_util.h" 25566@@ -61,6 +62,7 @@ 25567 25568 #if BUILDFLAG(IS_WIN) 25569 #include "chrome/browser/ui/pdf/adobe_reader_info_win.h" 25570+#include "ui/shell_dialogs/select_file_utils_win.h" 25571 #endif 25572 25573 using content::BrowserThread; 25574@@ -89,6 +91,21 @@ void VisitCountsToVisitedBefore(base::OnceCallback<void(bool)> callback, 25575 bool g_is_adobe_reader_up_to_date_ = false; 25576 #endif 25577 25578+// For the `new_path`, generates a new safe file name if needed. Keep its 25579+// extension if it is empty or matches that of the `old_extension`. Otherwise, 25580+// suggest a new safe extension. 25581+void GenerateSafeFileName(base::FilePath* new_path, 25582+ const base::FilePath::StringType& old_extension, 25583+ const std::string& mime_type) { 25584+ DCHECK(new_path); 25585+ if (new_path->Extension().empty() || new_path->Extension() == old_extension) { 25586+ net::GenerateSafeFileName(std::string() /*mime_type*/, 25587+ false /*ignore_extension*/, new_path); 25588+ } else { 25589+ net::GenerateSafeFileName(mime_type, true /*ignore_extension*/, new_path); 25590+ } 25591+} 25592+ 25593 } // namespace 25594 25595 DownloadTargetDeterminerDelegate::~DownloadTargetDeterminerDelegate() { 25596@@ -404,25 +421,22 @@ void DownloadTargetDeterminer::NotifyExtensionsDone( 25597 suggested_path).NormalizePathSeparators()); 25598 25599 // If this is a local file, don't allow extensions to override its 25600- // extension. 25601+ // name. 25602 if (download_->GetURL().SchemeIsFile()) { 25603 base::FilePath file_path; 25604 net::FileURLToFilePath(download_->GetURL(), &file_path); 25605- new_path = new_path.ReplaceExtension(file_path.Extension()); 25606+ base::FilePath file_name = file_path.BaseName(); 25607+ // Check if file name is a dir. 25608+ if (file_name.BaseName() != file_name.DirName()) 25609+ new_path = new_path.DirName().Append(file_name); 25610 } else { 25611 // If the (Chrome) extension does not suggest an file extension, or if the 25612 // suggested extension matches that of the |virtual_path_|, do not 25613 // pass a mime type to GenerateSafeFileName so that it does not force the 25614 // filename to have an extension or generate a different one. Otherwise, 25615 // correct the file extension in case it is wrongly given. 25616- if (new_path.Extension().empty() || 25617- new_path.Extension() == virtual_path_.Extension()) { 25618- net::GenerateSafeFileName(std::string() /*mime_type*/, 25619- false /*ignore_extension*/, &new_path); 25620- } else { 25621- net::GenerateSafeFileName(download_->GetMimeType(), 25622- true /*ignore_extension*/, &new_path); 25623- } 25624+ GenerateSafeFileName(&new_path, virtual_path_.Extension(), 25625+ download_->GetMimeType()); 25626 } 25627 virtual_path_ = new_path; 25628 create_target_directory_ = true; 25629@@ -534,8 +548,24 @@ DownloadTargetDeterminer::DoRequestConfirmation() { 25630 25631 // If there is a non-neutral confirmation reason, prompt the user. 25632 if (confirmation_reason_ != DownloadConfirmationReason::NONE) { 25633+ base::FilePath sanitized_path = virtual_path_; 25634+#if BUILDFLAG(IS_WIN) 25635+ // Windows prompt dialog will resolve all env variables in the file name, 25636+ // which may generate unexpected results. Remove env variables from the 25637+ // file name first. 25638+ std::wstring sanitized_name = ui::RemoveEnvVarFromFileName<wchar_t>( 25639+ virtual_path_.BaseName().value(), L"%"); 25640+ if (sanitized_name.empty()) { 25641+ sanitized_name = base::UTF8ToWide( 25642+ l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME)); 25643+ } 25644+ sanitized_path = 25645+ virtual_path_.DirName().Append(base::FilePath(sanitized_name)); 25646+ GenerateSafeFileName(&sanitized_path, virtual_path_.Extension(), 25647+ download_->GetMimeType()); 25648+#endif // BUILDFLAG(IS_WIN) 25649 delegate_->RequestConfirmation( 25650- download_, virtual_path_, confirmation_reason_, 25651+ download_, sanitized_path, confirmation_reason_, 25652 base::BindRepeating( 25653 &DownloadTargetDeterminer::RequestConfirmationDone, 25654 weak_ptr_factory_.GetWeakPtr())); 25655diff --git a/src/chrome/browser/download/download_target_determiner_unittest.cc b/src/chrome/browser/download/download_target_determiner_unittest.cc 25656index 0e9fe15f421e7..46559bac29b9d 25657--- a/src/chrome/browser/download/download_target_determiner_unittest.cc 25658+++ b/src/chrome/browser/download/download_target_determiner_unittest.cc 25659@@ -1772,6 +1772,32 @@ TEST_F(DownloadTargetDeterminerTest, NotifyExtensionsDefaultPath) { 25660 RunTestCase(test_case, base::FilePath(), item.get()); 25661 } 25662 25663+// Test that relative paths returned by extensions are always relative to the 25664+// default downloads path. 25665+TEST_F(DownloadTargetDeterminerTest, NotifyExtensionsLocalFile) { 25666+ const DownloadTestCase kNotifyExtensionsTestCases[] = { 25667+ {AUTOMATIC, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, 25668+ DownloadFileType::NOT_DANGEROUS, 25669+#if BUILDFLAG(IS_WIN) 25670+ "file:///usr/local/xyz", 25671+#else 25672+ "file:///c:/usr/local/xyz", 25673+#endif // BUILDFLAG(IS_WIN) 25674+ "text/plain", FILE_PATH_LITERAL(""), 25675+ 25676+ FILE_PATH_LITERAL("overridden/xyz"), 25677+ DownloadItem::TARGET_DISPOSITION_OVERWRITE, 25678+ 25679+ EXPECT_CRDOWNLOAD}}; 25680+ 25681+ base::FilePath overridden_path(FILE_PATH_LITERAL("overridden/foo.txt")); 25682+ EXPECT_CALL(*delegate(), NotifyExtensions_(_, _, _)) 25683+ .WillRepeatedly(WithArg<2>(ScheduleCallback2( 25684+ overridden_path, DownloadPathReservationTracker::UNIQUIFY))); 25685+ RunTestCasesWithActiveItem(kNotifyExtensionsTestCases, 25686+ std::size(kNotifyExtensionsTestCases)); 25687+} 25688+ 25689 TEST_F(DownloadTargetDeterminerTest, InitialVirtualPathUnsafe) { 25690 const base::FilePath::CharType* kInitialPath = 25691 FILE_PATH_LITERAL("some_path/bar.html"); 25692@@ -2433,6 +2459,43 @@ TEST_F(DownloadTargetDeterminerTest, TransientDownloadResumption) { 25693 histogram_tester.ExpectTotalCount(kTransientPathValidationHistogram, 1); 25694 } 25695 25696+#if BUILDFLAG(IS_WIN) 25697+// Test that env variables will be removed from file name before prompting Save 25698+// As dialog. 25699+TEST_F(DownloadTargetDeterminerTest, TestSanitizeEnvVariable) { 25700+ const DownloadTestCase kSaveEnvPathTestCases[] = { 25701+ {// 0: File name contains env var delimits. 25702+ SAVE_AS, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, 25703+ DownloadFileType::NOT_DANGEROUS, "http://example.com/f%oo%.tx%xyz%t", 25704+ "text/plain", FILE_PATH_LITERAL(""), 25705+ 25706+ FILE_PATH_LITERAL("f.txt"), DownloadItem::TARGET_DISPOSITION_PROMPT, 25707+ 25708+ EXPECT_CRDOWNLOAD}, 25709+ 25710+ {// 1: File name contains dangerous extensions after removing env var. 25711+ SAVE_AS, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, 25712+ DownloadFileType::NOT_DANGEROUS, "http://example.com/foo.ln%xyz%k", 25713+ "application/octet-stream", FILE_PATH_LITERAL(""), 25714+ 25715+ FILE_PATH_LITERAL("foo.download"), 25716+ DownloadItem::TARGET_DISPOSITION_PROMPT, 25717+ 25718+ EXPECT_CRDOWNLOAD}, 25719+ {// 2: File name is an env var. 25720+ SAVE_AS, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, 25721+ DownloadFileType::NOT_DANGEROUS, "http://example.com/%foo.txt%", 25722+ "text/plain", FILE_PATH_LITERAL(""), 25723+ 25724+ FILE_PATH_LITERAL("download"), DownloadItem::TARGET_DISPOSITION_PROMPT, 25725+ 25726+ EXPECT_CRDOWNLOAD}}; 25727+ 25728+ RunTestCasesWithActiveItem(kSaveEnvPathTestCases, 25729+ std::size(kSaveEnvPathTestCases)); 25730+} 25731+#endif // BUILDFLAG(IS_WIN) 25732+ 25733 #if BUILDFLAG(ENABLE_PLUGINS) 25734 25735 void DummyGetPluginsCallback( 25736diff --git a/src/chrome/browser/extensions/BUILD.gn b/src/chrome/browser/extensions/BUILD.gn 25737index d6da4e22e14b0..743fa2c3d71ae 25738--- a/src/chrome/browser/extensions/BUILD.gn 25739+++ b/src/chrome/browser/extensions/BUILD.gn 25740@@ -938,6 +938,14 @@ static_library("extensions") { 25741 "//url", 25742 ] 25743 25744+ if (is_ohos && !ohos_enable_media_router) { 25745+ deps -= [ 25746+ "//chrome/browser/media/router", 25747+ "//chrome/browser/media/router:media_router_feature", 25748+ "//chrome/browser/media/router/discovery", 25749+ ] 25750+ } 25751+ 25752 if (is_linux || is_mac || is_win) { 25753 sources += [ 25754 "api/system_indicator/system_indicator_api.cc", 25755diff --git a/src/chrome/browser/extensions/api/downloads/downloads_api.cc b/src/chrome/browser/extensions/api/downloads/downloads_api.cc 25756index 827aeada1989e..471a9d3799bb7 25757--- a/src/chrome/browser/extensions/api/downloads/downloads_api.cc 25758+++ b/src/chrome/browser/extensions/api/downloads/downloads_api.cc 25759@@ -1029,19 +1029,19 @@ ExtensionFunction::ResponseAction DownloadsDownloadFunction::Run() { 25760 download_params->set_prompt(*options.save_as); 25761 25762 if (options.headers.get()) { 25763- for (const downloads::HeaderNameValuePair& name_value : *options.headers) { 25764- if (!net::HttpUtil::IsValidHeaderName(name_value.name)) { 25765+ for (const downloads::HeaderNameValuePair& header : *options.headers) { 25766+ if (!net::HttpUtil::IsValidHeaderName(header.name)) { 25767 return RespondNow(Error(download_extension_errors::kInvalidHeaderName)); 25768 } 25769- if (!net::HttpUtil::IsSafeHeader(name_value.name)) { 25770+ if (!net::HttpUtil::IsSafeHeader(header.name, header.value)) { 25771 return RespondNow( 25772 Error(download_extension_errors::kInvalidHeaderUnsafe)); 25773 } 25774- if (!net::HttpUtil::IsValidHeaderValue(name_value.value)) { 25775+ if (!net::HttpUtil::IsValidHeaderValue(header.value)) { 25776 return RespondNow( 25777 Error(download_extension_errors::kInvalidHeaderValue)); 25778 } 25779- download_params->add_request_header(name_value.name, name_value.value); 25780+ download_params->add_request_header(header.name, header.value); 25781 } 25782 } 25783 25784diff --git a/src/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc b/src/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc 25785index 9511f8f5788d8..1ae2b73e33dbb 25786--- a/src/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc 25787+++ b/src/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc 25788@@ -2337,7 +2337,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, 25789 " \"filename\": {" 25790 " \"previous\": \"\"," 25791 " \"current\": \"%s\"}}]", 25792- result_id, GetFilename("file").c_str()))); 25793+ result_id, GetFilename("file.txt").c_str()))); 25794 ASSERT_TRUE(WaitFor(downloads::OnChanged::kEventName, 25795 base::StringPrintf( 25796 "[{\"id\": %d," 25797diff --git a/src/chrome/browser/extensions/webstore_standalone_installer.cc b/src/chrome/browser/extensions/webstore_standalone_installer.cc 25798index 254faa39f3bf0..4bc6ed9011b36 25799--- a/src/chrome/browser/extensions/webstore_standalone_installer.cc 25800+++ b/src/chrome/browser/extensions/webstore_standalone_installer.cc 25801@@ -31,24 +31,24 @@ 25802 25803 using content::WebContents; 25804 25805+namespace { 25806+constexpr char kProfileShuttingDown[] = "The profile is shutting down."; 25807+} 25808+ 25809 namespace extensions { 25810 25811 WebstoreStandaloneInstaller::WebstoreStandaloneInstaller( 25812 const std::string& webstore_item_id, 25813 Profile* profile, 25814 Callback callback) 25815- : id_(webstore_item_id), 25816- callback_(std::move(callback)), 25817- profile_(profile), 25818- install_source_(WebstoreInstaller::INSTALL_SOURCE_INLINE), 25819- show_user_count_(true), 25820- average_rating_(0.0), 25821- rating_count_(0) {} 25822+ : id_(webstore_item_id), callback_(std::move(callback)), profile_(profile) { 25823+ observation_.Observe(profile); 25824+} 25825 25826 void WebstoreStandaloneInstaller::BeginInstall() { 25827 // Add a ref to keep this alive for WebstoreDataFetcher. 25828 // All code paths from here eventually lead to either CompleteInstall or 25829- // AbortInstall, which both release this ref. 25830+ // AbortInstall, which both call CleanUp to release this ref. 25831 AddRef(); 25832 25833 if (!crx_file::id_util::IdIsValid(id_)) { 25834@@ -95,8 +95,8 @@ void WebstoreStandaloneInstaller::AbortInstall() { 25835 if (webstore_data_fetcher_) { 25836 webstore_data_fetcher_.reset(); 25837 scoped_active_install_.reset(); 25838- Release(); // Matches the AddRef in BeginInstall. 25839 } 25840+ CleanUp(); 25841 } 25842 25843 bool WebstoreStandaloneInstaller::EnsureUniqueInstall( 25844@@ -125,7 +125,7 @@ void WebstoreStandaloneInstaller::CompleteInstall( 25845 scoped_active_install_.reset(); 25846 if (!callback_.is_null()) 25847 RunCallback(result == webstore_install::SUCCESS, error, result); 25848- Release(); // Matches the AddRef in BeginInstall. 25849+ CleanUp(); 25850 } 25851 25852 void WebstoreStandaloneInstaller::ProceedWithInstallPrompt() { 25853@@ -399,6 +399,15 @@ void WebstoreStandaloneInstaller::OnExtensionInstallFailure( 25854 CompleteInstall(install_result, error); 25855 } 25856 25857+void WebstoreStandaloneInstaller::OnProfileWillBeDestroyed(Profile* profile) { 25858+ DCHECK(profile == profile_); 25859+ 25860+ if (!callback_.is_null()) 25861+ RunCallback(false, kProfileShuttingDown, webstore_install::ABORTED); 25862+ 25863+ AbortInstall(); 25864+} 25865+ 25866 void WebstoreStandaloneInstaller::ShowInstallUI() { 25867 scoped_refptr<const Extension> localized_extension = 25868 GetLocalizedExtensionForDisplay(); 25869@@ -424,4 +433,12 @@ void WebstoreStandaloneInstaller::OnWebStoreDataFetcherDone() { 25870 webstore_data_fetcher_.reset(); 25871 } 25872 25873+void WebstoreStandaloneInstaller::CleanUp() { 25874+ // Once install has either completed or aborted, don't observe the 25875+ // Profile lifetime any longer. 25876+ observation_.Reset(); 25877+ // Matches the AddRef in BeginInstall. 25878+ Release(); 25879+} 25880+ 25881 } // namespace extensions 25882diff --git a/src/chrome/browser/extensions/webstore_standalone_installer.h b/src/chrome/browser/extensions/webstore_standalone_installer.h 25883index bc4cfe30a6a9c..f746e8873adce 25884--- a/src/chrome/browser/extensions/webstore_standalone_installer.h 25885+++ b/src/chrome/browser/extensions/webstore_standalone_installer.h 25886@@ -11,11 +11,14 @@ 25887 #include "base/callback.h" 25888 #include "base/memory/raw_ptr.h" 25889 #include "base/memory/ref_counted.h" 25890+#include "base/scoped_observation.h" 25891 #include "chrome/browser/extensions/active_install_data.h" 25892 #include "chrome/browser/extensions/extension_install_prompt.h" 25893 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h" 25894 #include "chrome/browser/extensions/webstore_install_helper.h" 25895 #include "chrome/browser/extensions/webstore_installer.h" 25896+#include "chrome/browser/profiles/profile.h" 25897+#include "chrome/browser/profiles/profile_observer.h" 25898 #include "chrome/common/extensions/webstore_install_result.h" 25899 #include "third_party/skia/include/core/SkBitmap.h" 25900 25901@@ -41,7 +44,8 @@ class WebstoreStandaloneInstaller 25902 : public base::RefCountedThreadSafe<WebstoreStandaloneInstaller>, 25903 public WebstoreDataFetcherDelegate, 25904 public WebstoreInstaller::Delegate, 25905- public WebstoreInstallHelper::Delegate { 25906+ public WebstoreInstallHelper::Delegate, 25907+ public ProfileObserver { 25908 public: 25909 // A callback for when the install process completes, successfully or not. If 25910 // there was a failure, |success| will be false and |error| may contain a 25911@@ -195,14 +199,23 @@ class WebstoreStandaloneInstaller 25912 const std::string& error, 25913 WebstoreInstaller::FailureReason reason) override; 25914 25915+ // ProfileObserver 25916+ void OnProfileWillBeDestroyed(Profile* profile) override; 25917+ 25918 void ShowInstallUI(); 25919 void OnWebStoreDataFetcherDone(); 25920 25921+ // Called when install either completes or aborts to clean up internal 25922+ // state and release the added reference from BeginInstall. 25923+ void CleanUp(); 25924+ 25925 // Input configuration. 25926 std::string id_; 25927 Callback callback_; 25928 raw_ptr<Profile> profile_; 25929- WebstoreInstaller::InstallSource install_source_; 25930+ base::ScopedObservation<Profile, ProfileObserver> observation_{this}; 25931+ WebstoreInstaller::InstallSource install_source_{ 25932+ WebstoreInstaller::INSTALL_SOURCE_INLINE}; 25933 25934 // Installation dialog and its underlying prompt. 25935 std::unique_ptr<ExtensionInstallPrompt> install_ui_; 25936@@ -214,10 +227,10 @@ class WebstoreStandaloneInstaller 25937 // Extracted from the webstore JSON data response. 25938 std::string localized_name_; 25939 std::string localized_description_; 25940- bool show_user_count_; 25941+ bool show_user_count_{true}; 25942 std::string localized_user_count_; 25943- double average_rating_; 25944- int rating_count_; 25945+ double average_rating_{0.0}; 25946+ int rating_count_{0}; 25947 std::unique_ptr<base::DictionaryValue> webstore_data_; 25948 std::unique_ptr<base::DictionaryValue> manifest_; 25949 SkBitmap icon_; 25950diff --git a/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc b/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc 25951index dbff2fc1991d6..8f35a99c8403e 25952--- a/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc 25953+++ b/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc 25954@@ -48,6 +48,7 @@ 25955 #include "components/content_settings/core/common/content_settings_utils.h" 25956 #include "components/permissions/permission_util.h" 25957 #include "components/safe_browsing/buildflags.h" 25958+#include "components/safe_browsing/content/common/file_type_policies.h" 25959 #include "content/public/browser/browser_task_traits.h" 25960 #include "content/public/browser/browser_thread.h" 25961 #include "content/public/browser/disallow_activation_reason.h" 25962@@ -61,6 +62,8 @@ 25963 #include "chrome/browser/ui/browser.h" 25964 #include "chrome/browser/ui/browser_list.h" 25965 #include "chrome/browser/ui/browser_window.h" 25966+#include "chrome/browser/web_applications/web_app_provider.h" 25967+#include "chrome/browser/web_applications/web_app_registrar.h" 25968 #endif 25969 25970 namespace features { 25971@@ -116,14 +119,14 @@ void ShowFileSystemAccessRestrictedDirectoryDialogOnUIThread( 25972 const base::FilePath& path, 25973 HandleType handle_type, 25974 base::OnceCallback< 25975- void(ChromeFileSystemAccessPermissionContext::SensitiveDirectoryResult)> 25976+ void(ChromeFileSystemAccessPermissionContext::SensitiveEntryResult)> 25977 callback) { 25978 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 25979 content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(frame_id); 25980 if (!rfh || !rfh->IsActive()) { 25981 // Requested from a no longer valid render frame host. 25982- std::move(callback).Run(ChromeFileSystemAccessPermissionContext:: 25983- SensitiveDirectoryResult::kAbort); 25984+ std::move(callback).Run( 25985+ ChromeFileSystemAccessPermissionContext::SensitiveEntryResult::kAbort); 25986 return; 25987 } 25988 25989@@ -131,8 +134,8 @@ void ShowFileSystemAccessRestrictedDirectoryDialogOnUIThread( 25990 content::WebContents::FromRenderFrameHost(rfh); 25991 if (!web_contents) { 25992 // Requested from a worker, or a no longer existing tab. 25993- std::move(callback).Run(ChromeFileSystemAccessPermissionContext:: 25994- SensitiveDirectoryResult::kAbort); 25995+ std::move(callback).Run( 25996+ ChromeFileSystemAccessPermissionContext::SensitiveEntryResult::kAbort); 25997 return; 25998 } 25999 26000@@ -140,6 +143,37 @@ void ShowFileSystemAccessRestrictedDirectoryDialogOnUIThread( 26001 origin, path, handle_type, std::move(callback), web_contents); 26002 } 26003 26004+#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) 26005+void ShowFileSystemAccessDangerousFileDialogOnUIThread( 26006+ content::GlobalRenderFrameHostId frame_id, 26007+ const url::Origin& origin, 26008+ const base::FilePath& path, 26009+ base::OnceCallback< 26010+ void(ChromeFileSystemAccessPermissionContext::SensitiveEntryResult)> 26011+ callback) { 26012+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 26013+ content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(frame_id); 26014+ if (!rfh || !rfh->IsActive()) { 26015+ // Requested from a no longer valid render frame host. 26016+ std::move(callback).Run( 26017+ ChromeFileSystemAccessPermissionContext::SensitiveEntryResult::kAbort); 26018+ return; 26019+ } 26020+ 26021+ content::WebContents* web_contents = 26022+ content::WebContents::FromRenderFrameHost(rfh); 26023+ if (!web_contents) { 26024+ // Requested from a worker, or a no longer existing tab. 26025+ std::move(callback).Run( 26026+ ChromeFileSystemAccessPermissionContext::SensitiveEntryResult::kAbort); 26027+ return; 26028+ } 26029+ 26030+ ShowFileSystemAccessDangerousFileDialog(origin, path, std::move(callback), 26031+ web_contents); 26032+} 26033+#endif 26034+ 26035 // Sentinel used to indicate that no PathService key is specified for a path in 26036 // the struct below. 26037 constexpr const int kNoBasePathKey = -1; 26038@@ -777,9 +811,9 @@ struct ChromeFileSystemAccessPermissionContext::OriginState { 26039 }; 26040 26041 constexpr base::TimeDelta ChromeFileSystemAccessPermissionContext:: 26042- kPersistentPermissionExpirationTimeoutNonPWA; 26043+ kPersistentPermissionExpirationTimeoutDefault; 26044 constexpr base::TimeDelta ChromeFileSystemAccessPermissionContext:: 26045- kPersistentPermissionExpirationTimeoutPWA; 26046+ kPersistentPermissionExpirationTimeoutExtended; 26047 constexpr base::TimeDelta 26048 ChromeFileSystemAccessPermissionContext::kPersistentPermissionGracePeriod; 26049 26050@@ -999,18 +1033,19 @@ ChromeFileSystemAccessPermissionContext::GetGrantedObjects( 26051 std::vector<std::unique_ptr<Object>> objects = 26052 ObjectPermissionContextBase::GetGrantedObjects(origin); 26053 26054- bool is_installed_pwa = OriginIsInstalledPWA(origin); 26055+ bool has_extended_permissions = OriginHasExtendedPermissions(origin); 26056 // Filter out expired permissions. 26057 objects.erase( 26058 base::ranges::remove_if( 26059 objects, 26060- [this, &is_installed_pwa](const std::unique_ptr<Object>& object) { 26061+ [this, 26062+ &has_extended_permissions](const std::unique_ptr<Object>& object) { 26063 auto last_activity_time = 26064 base::ValueToTime( 26065 object->value.FindKey(kPermissionLastUsedTimeKey)) 26066 .value_or(base::Time::Min()); 26067- return this->PersistentPermissionIsExpired(last_activity_time, 26068- is_installed_pwa); 26069+ return this->PersistentPermissionIsExpired( 26070+ last_activity_time, has_extended_permissions); 26071 }), 26072 objects.end()); 26073 return objects; 26074@@ -1027,26 +1062,27 @@ ChromeFileSystemAccessPermissionContext::GetAllGrantedObjects() { 26075 26076 url::Origin origin; 26077 GURL origin_as_url; 26078- bool is_installed_pwa = false; 26079+ bool has_extended_permissions = false; 26080 // Filter out expired permissions. 26081 // Checking whether an origin has an installed PWA may be expensive. 26082 // GetAllGrantedObjects() returns objects grouped by origin, so this should 26083 // only check once per origin. 26084 objects.erase(base::ranges::remove_if( 26085 objects, 26086- [this, &is_installed_pwa, &origin, 26087+ [this, &has_extended_permissions, &origin, 26088 &origin_as_url](const std::unique_ptr<Object>& object) { 26089 if (object->origin != origin_as_url) { 26090 origin_as_url = object->origin; 26091 origin = url::Origin::Create(object->origin); 26092- is_installed_pwa = OriginIsInstalledPWA(origin); 26093+ has_extended_permissions = 26094+ OriginHasExtendedPermissions(origin); 26095 } 26096 auto last_activity_time = 26097 base::ValueToTime( 26098 object->value.FindKey(kPermissionLastUsedTimeKey)) 26099 .value_or(base::Time::Min()); 26100 return this->PersistentPermissionIsExpired( 26101- last_activity_time, is_installed_pwa); 26102+ last_activity_time, has_extended_permissions); 26103 }), 26104 objects.end()); 26105 26106@@ -1111,13 +1147,14 @@ bool ChromeFileSystemAccessPermissionContext::CanObtainWritePermission( 26107 GetWriteGuardContentSetting(origin) == CONTENT_SETTING_ALLOW; 26108 } 26109 26110-void ChromeFileSystemAccessPermissionContext::ConfirmSensitiveDirectoryAccess( 26111+void ChromeFileSystemAccessPermissionContext::ConfirmSensitiveEntryAccess( 26112 const url::Origin& origin, 26113 PathType path_type, 26114 const base::FilePath& path, 26115 HandleType handle_type, 26116+ ui::SelectFileDialog::Type dialog_type, 26117 content::GlobalRenderFrameHostId frame_id, 26118- base::OnceCallback<void(SensitiveDirectoryResult)> callback) { 26119+ base::OnceCallback<void(SensitiveEntryResult)> callback) { 26120 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 26121 26122 // TODO(https://crbug.com/1009970): Figure out what external paths should be 26123@@ -1126,7 +1163,9 @@ void ChromeFileSystemAccessPermissionContext::ConfirmSensitiveDirectoryAccess( 26124 // should have a separate Chrome OS only code path to block for example the 26125 // root of certain external file systems. 26126 if (path_type == PathType::kExternal) { 26127- std::move(callback).Run(SensitiveDirectoryResult::kAllowed); 26128+ DidConfirmSensitiveDirectoryAccess(origin, path, handle_type, dialog_type, 26129+ frame_id, std::move(callback), 26130+ /*should_block=*/false); 26131 return; 26132 } 26133 26134@@ -1135,8 +1174,8 @@ void ChromeFileSystemAccessPermissionContext::ConfirmSensitiveDirectoryAccess( 26135 base::BindOnce(&ShouldBlockAccessToPath, path, handle_type), 26136 base::BindOnce(&ChromeFileSystemAccessPermissionContext:: 26137 DidConfirmSensitiveDirectoryAccess, 26138- GetWeakPtr(), origin, path, handle_type, frame_id, 26139- std::move(callback))); 26140+ GetWeakPtr(), origin, path, handle_type, dialog_type, 26141+ frame_id, std::move(callback))); 26142 } 26143 26144 #if BUILDFLAG(SAFE_BROWSING_AVAILABLE) 26145@@ -1168,12 +1207,35 @@ void ChromeFileSystemAccessPermissionContext:: 26146 const url::Origin& origin, 26147 const base::FilePath& path, 26148 HandleType handle_type, 26149+ ui::SelectFileDialog::Type dialog_type, 26150 content::GlobalRenderFrameHostId frame_id, 26151- base::OnceCallback<void(SensitiveDirectoryResult)> callback, 26152+ base::OnceCallback<void(SensitiveEntryResult)> callback, 26153 bool should_block) { 26154 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 26155 if (!should_block) { 26156- std::move(callback).Run(SensitiveDirectoryResult::kAllowed); 26157+#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) 26158+ // If attempting to save a file with a dangerous extension, prompt the user 26159+ // to make them confirm they actually want to save the file. 26160+ if (dialog_type == ui::SelectFileDialog::SELECT_SAVEAS_FILE) { 26161+ safe_browsing::DownloadFileType::DangerLevel danger_level = 26162+ safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel( 26163+ path); 26164+ // See https://crbug.com/1320877#c4 for justification for why we show the 26165+ // prompt if `danger_level` is ALLOW_ON_USER_GESTURE as well as DANGEROUS. 26166+ if (danger_level == safe_browsing::DownloadFileType::DANGEROUS || 26167+ danger_level == 26168+ safe_browsing::DownloadFileType::ALLOW_ON_USER_GESTURE) { 26169+ auto result_callback = 26170+ BindResultCallbackToCurrentSequence(std::move(callback)); 26171+ content::GetUIThreadTaskRunner({})->PostTask( 26172+ FROM_HERE, 26173+ base::BindOnce(&ShowFileSystemAccessDangerousFileDialogOnUIThread, 26174+ frame_id, origin, path, std::move(result_callback))); 26175+ return; 26176+ } 26177+ } 26178+#endif 26179+ std::move(callback).Run(SensitiveEntryResult::kAllowed); 26180 return; 26181 } 26182 26183@@ -1458,9 +1520,28 @@ bool ChromeFileSystemAccessPermissionContext::AncestorHasActivePermission( 26184 return false; 26185 } 26186 26187-bool ChromeFileSystemAccessPermissionContext::OriginIsInstalledPWA( 26188+// Origins with actively installed PWAs will have permissions persisted for 26189+// longer than sites without an installed PWA or with a passively installed 26190+// PWA. 26191+bool ChromeFileSystemAccessPermissionContext::OriginHasExtendedPermissions( 26192 const url::Origin& origin) { 26193- return DoesOriginContainAnyInstalledWebApp(profile_, origin.GetURL()); 26194+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 26195+#if BUILDFLAG(IS_ANDROID) 26196+ // The File System Access API is not supported on Android (see 26197+ // crbug.com/1011535). If this ever changes, we'll need to revist this. 26198+ return false; 26199+#else 26200+ DCHECK(profile()); 26201+ auto* web_app_provider = web_app::WebAppProvider::GetForWebApps( 26202+ Profile::FromBrowserContext(profile())); 26203+ if (!web_app_provider) 26204+ return false; 26205+ 26206+ auto app_id = 26207+ web_app_provider->registrar().FindAppWithUrlInScope(origin.GetURL()); 26208+ return app_id.has_value() && 26209+ web_app_provider->registrar().IsActivelyInstalled(app_id.value()); 26210+#endif // BUILDFLAG(IS_ANDROID) 26211 } 26212 26213 void ChromeFileSystemAccessPermissionContext:: 26214@@ -1474,7 +1555,7 @@ void ChromeFileSystemAccessPermissionContext::UpdatePersistedPermissions() { 26215 "Storage.FileSystemAccess.PersistedPermissions.SweepTime.All"); 26216 url::Origin origin; 26217 GURL origin_as_url; 26218- bool is_installed_pwa = false; 26219+ bool has_extended_permissions = false; 26220 auto objects = GetAllGrantedOrExpiredObjects(); 26221 for (const auto& object : objects) { 26222 // Checking whether an origin has an installed PWA may be expensive. 26223@@ -1483,10 +1564,10 @@ void ChromeFileSystemAccessPermissionContext::UpdatePersistedPermissions() { 26224 if (object->origin != origin_as_url) { 26225 origin_as_url = object->origin; 26226 origin = url::Origin::Create(object->origin); 26227- is_installed_pwa = OriginIsInstalledPWA(origin); 26228+ has_extended_permissions = OriginHasExtendedPermissions(origin); 26229 } 26230 MaybeRenewOrRevokePersistedPermission(origin, std::move(object->value), 26231- is_installed_pwa); 26232+ has_extended_permissions); 26233 } 26234 base::UmaHistogramCounts1000( 26235 "Storage.FileSystemAccess.PersistedPermissions.Count", objects.size()); 26236@@ -1497,20 +1578,20 @@ void ChromeFileSystemAccessPermissionContext:: 26237 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 26238 SCOPED_UMA_HISTOGRAM_TIMER( 26239 "Storage.FileSystemAccess.PersistedPermissions.SweepTime.Origin"); 26240- bool is_installed_pwa = OriginIsInstalledPWA(origin); 26241+ bool has_extended_permissions = OriginHasExtendedPermissions(origin); 26242 // Call the base class's version of this method, since this class overrides 26243 // this method to filter out expired grants. 26244 for (const auto& object : 26245 ObjectPermissionContextBase::GetGrantedObjects(origin)) { 26246 MaybeRenewOrRevokePersistedPermission(origin, std::move(object->value), 26247- is_installed_pwa); 26248+ has_extended_permissions); 26249 } 26250 } 26251 26252 void ChromeFileSystemAccessPermissionContext:: 26253 MaybeRenewOrRevokePersistedPermission(const url::Origin& origin, 26254 base::Value value, 26255- bool is_installed_pwa) { 26256+ bool has_extended_permissions) { 26257 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 26258 auto it = origins_.find(origin); 26259 // Look for active read or write grants. 26260@@ -1552,7 +1633,7 @@ void ChromeFileSystemAccessPermissionContext:: 26261 // metrics regarding permission timeouts. 26262 if (PersistentPermissionIsExpired( 26263 last_activity_time + kPersistentPermissionGracePeriod, 26264- is_installed_pwa)) { 26265+ has_extended_permissions)) { 26266 RevokeObjectPermission(origin, GetKeyForObject(value)); 26267 } 26268 } 26269@@ -1620,27 +1701,28 @@ bool ChromeFileSystemAccessPermissionContext::HasPersistedPermission( 26270 return false; 26271 } 26272 26273- auto is_installed_pwa = OriginIsInstalledPWA(origin); 26274+ auto has_extended_permissions = OriginHasExtendedPermissions(origin); 26275 auto last_activity_time = 26276 base::ValueToTime(grant->FindKey(kPermissionLastUsedTimeKey)).value(); 26277 26278 if (options == MetricsOptions::kRecord) { 26279 base::UmaHistogramCustomTimes( 26280 base::StrCat({"Storage.FileSystemAccess.PersistedPermissions.Age.", 26281- is_installed_pwa ? "PWA" : "NonPWA"}), 26282+ has_extended_permissions ? "PWA" : "NonPWA"}), 26283 clock_->Now() - last_activity_time, base::Seconds(1), base::Days(24), 26284 60); 26285 } 26286 26287- return !PersistentPermissionIsExpired(last_activity_time, is_installed_pwa); 26288+ return !PersistentPermissionIsExpired(last_activity_time, 26289+ has_extended_permissions); 26290 } 26291 26292 bool ChromeFileSystemAccessPermissionContext::PersistentPermissionIsExpired( 26293 const base::Time& last_used, 26294- bool is_installed_pwa) { 26295- base::TimeDelta duration = is_installed_pwa 26296- ? kPersistentPermissionExpirationTimeoutPWA 26297- : kPersistentPermissionExpirationTimeoutNonPWA; 26298+ bool has_extended_permissions) { 26299+ base::TimeDelta duration = 26300+ has_extended_permissions ? kPersistentPermissionExpirationTimeoutExtended 26301+ : kPersistentPermissionExpirationTimeoutDefault; 26302 26303 return (last_used + duration) < clock_->Now(); 26304 } 26305diff --git a/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h b/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h 26306index 50fead29f4b70..5a238f109cf48 26307--- a/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h 26308+++ b/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h 26309@@ -80,13 +80,14 @@ class ChromeFileSystemAccessPermissionContext 26310 const base::FilePath& path, 26311 HandleType handle_type, 26312 UserAction user_action) override; 26313- void ConfirmSensitiveDirectoryAccess( 26314+ void ConfirmSensitiveEntryAccess( 26315 const url::Origin& origin, 26316 PathType path_type, 26317 const base::FilePath& path, 26318 HandleType handle_type, 26319+ ui::SelectFileDialog::Type dialog_type, 26320 content::GlobalRenderFrameHostId frame_id, 26321- base::OnceCallback<void(SensitiveDirectoryResult)> callback) override; 26322+ base::OnceCallback<void(SensitiveEntryResult)> callback) override; 26323 #if BUILDFLAG(SAFE_BROWSING_AVAILABLE) 26324 void PerformAfterWriteChecks( 26325 std::unique_ptr<content::FileSystemAccessWriteItem> item, 26326@@ -163,9 +164,9 @@ class ChromeFileSystemAccessPermissionContext 26327 // This long after the handle has last been used, revoke the persisted 26328 // permission. 26329 static constexpr base::TimeDelta 26330- kPersistentPermissionExpirationTimeoutNonPWA = base::Hours(5); 26331- static constexpr base::TimeDelta kPersistentPermissionExpirationTimeoutPWA = 26332- base::Days(30); 26333+ kPersistentPermissionExpirationTimeoutDefault = base::Hours(5); 26334+ static constexpr base::TimeDelta 26335+ kPersistentPermissionExpirationTimeoutExtended = base::Days(30); 26336 // Amount of time a persisted permission will remain persisted after its 26337 // expiry. Used for metrics. 26338 static constexpr base::TimeDelta kPersistentPermissionGracePeriod = 26339@@ -179,8 +180,9 @@ class ChromeFileSystemAccessPermissionContext 26340 return periodic_sweep_persisted_permissions_timer_; 26341 } 26342 26343- // Overridden in tests. 26344- virtual bool OriginIsInstalledPWA(const url::Origin& origin); 26345+ // Returns whether persisted permission grants for the origin are subject to 26346+ // the extended permission duration policy. 26347+ bool OriginHasExtendedPermissions(const url::Origin& origin); 26348 26349 private: 26350 enum class MetricsOptions { kRecord, kDoNotRecord }; 26351@@ -192,8 +194,9 @@ class ChromeFileSystemAccessPermissionContext 26352 const url::Origin& origin, 26353 const base::FilePath& path, 26354 HandleType handle_type, 26355+ ui::SelectFileDialog::Type dialog_type, 26356 content::GlobalRenderFrameHostId frame_id, 26357- base::OnceCallback<void(SensitiveDirectoryResult)> callback, 26358+ base::OnceCallback<void(SensitiveEntryResult)> callback, 26359 bool should_block); 26360 26361 void MaybeMigrateOriginToNewSchema(const url::Origin& origin); 26362@@ -226,7 +229,7 @@ class ChromeFileSystemAccessPermissionContext 26363 // revoke the persisted permission if it has expired. 26364 void MaybeRenewOrRevokePersistedPermission(const url::Origin& origin, 26365 base::Value grant, 26366- bool is_installed_pwa); 26367+ bool has_extended_permissions); 26368 26369 bool AncestorHasActivePermission(const url::Origin& origin, 26370 const base::FilePath& path, 26371@@ -240,7 +243,7 @@ class ChromeFileSystemAccessPermissionContext 26372 GrantType grant_type, 26373 MetricsOptions options); 26374 bool PersistentPermissionIsExpired(const base::Time& last_used, 26375- bool is_installed_pwa); 26376+ bool has_extended_permissions); 26377 26378 base::WeakPtr<ChromeFileSystemAccessPermissionContext> GetWeakPtr(); 26379 26380diff --git a/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context_unittest.cc b/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context_unittest.cc 26381index 46c7a4c00f18c..03850ab7fc732 26382--- a/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context_unittest.cc 26383+++ b/src/chrome/browser/file_system_access/chrome_file_system_access_permission_context_unittest.cc 26384@@ -18,6 +18,7 @@ 26385 #include "base/test/metrics/histogram_tester.h" 26386 #include "base/test/scoped_path_override.h" 26387 #include "base/test/simple_test_clock.h" 26388+#include "base/test/test_future.h" 26389 #include "base/time/time.h" 26390 #include "build/build_config.h" 26391 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 26392@@ -34,6 +35,7 @@ 26393 #include "content/public/test/test_renderer_host.h" 26394 #include "content/public/test/web_contents_tester.h" 26395 #include "testing/gmock/include/gmock/gmock.h" 26396+#include "ui/shell_dialogs/select_file_dialog.h" 26397 #include "ui/webui/webui_allowlist.h" 26398 #include "url/gurl.h" 26399 #include "url/origin.h" 26400@@ -53,7 +55,7 @@ using PersistedPermissionOptions = 26401 using PermissionRequestOutcome = 26402 content::FileSystemAccessPermissionGrant::PermissionRequestOutcome; 26403 using SensitiveDirectoryResult = 26404- ChromeFileSystemAccessPermissionContext::SensitiveDirectoryResult; 26405+ ChromeFileSystemAccessPermissionContext::SensitiveEntryResult; 26406 using UserActivationState = 26407 content::FileSystemAccessPermissionGrant::UserActivationState; 26408 26409@@ -72,11 +74,6 @@ class TestFileSystemAccessPermissionContext 26410 } 26411 ~TestFileSystemAccessPermissionContext() override = default; 26412 26413- protected: 26414- bool OriginIsInstalledPWA(const url::Origin& origin) override { 26415- return false; 26416- } 26417- 26418 private: 26419 base::WeakPtrFactory<TestFileSystemAccessPermissionContext> weak_factory_{ 26420 this}; 26421@@ -110,22 +107,19 @@ class ChromeFileSystemAccessPermissionContextTest : public testing::Test { 26422 web_contents_.reset(); 26423 } 26424 26425- SensitiveDirectoryResult ConfirmSensitiveDirectoryAccessSync( 26426+ SensitiveDirectoryResult ConfirmSensitiveEntryAccessSync( 26427 ChromeFileSystemAccessPermissionContext* context, 26428 PathType path_type, 26429 const base::FilePath& path, 26430- HandleType handle_type) { 26431- base::RunLoop loop; 26432- SensitiveDirectoryResult out_result; 26433- permission_context_->ConfirmSensitiveDirectoryAccess( 26434- kTestOrigin, path_type, path, handle_type, 26435- content::GlobalRenderFrameHostId(), 26436- base::BindLambdaForTesting([&](SensitiveDirectoryResult result) { 26437- out_result = result; 26438- loop.Quit(); 26439- })); 26440- loop.Run(); 26441- return out_result; 26442+ HandleType handle_type, 26443+ ui::SelectFileDialog::Type dialog_type) { 26444+ base::test::TestFuture< 26445+ ChromeFileSystemAccessPermissionContext::SensitiveEntryResult> 26446+ future; 26447+ permission_context_->ConfirmSensitiveEntryAccess( 26448+ kTestOrigin, path_type, path, handle_type, dialog_type, 26449+ content::GlobalRenderFrameHostId(), future.GetCallback()); 26450+ return future.Get(); 26451 } 26452 26453 void SetDefaultContentSettingValue(ContentSettingsType type, 26454@@ -204,7 +198,7 @@ class ChromeFileSystemAccessPermissionContextNoPersistenceTest 26455 #if !BUILDFLAG(IS_ANDROID) 26456 26457 TEST_F(ChromeFileSystemAccessPermissionContextTest, 26458- ConfirmSensitiveDirectoryAccess_NoSpecialPath) { 26459+ ConfirmSensitiveEntryAccess_NoSpecialPath) { 26460 const base::FilePath kTestPath = 26461 #if defined(FILE_PATH_USES_DRIVE_LETTERS) 26462 base::FilePath(FILE_PATH_LITERAL("c:\\foo\\bar")); 26463@@ -213,77 +207,87 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26464 #endif 26465 26466 // Path outside any special directories should be allowed. 26467- EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26468- ConfirmSensitiveDirectoryAccessSync(permission_context(), 26469- PathType::kLocal, kTestPath, 26470- HandleType::kFile)); 26471- EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26472- ConfirmSensitiveDirectoryAccessSync(permission_context(), 26473- PathType::kLocal, kTestPath, 26474- HandleType::kDirectory)); 26475- 26476- // External (relative) paths should also be allowed. 26477 EXPECT_EQ( 26478 SensitiveDirectoryResult::kAllowed, 26479- ConfirmSensitiveDirectoryAccessSync( 26480- permission_context(), PathType::kExternal, 26481- base::FilePath(FILE_PATH_LITERAL("foo/bar")), HandleType::kFile)); 26482+ ConfirmSensitiveEntryAccessSync( 26483+ permission_context(), PathType::kLocal, kTestPath, HandleType::kFile, 26484+ ui::SelectFileDialog::Type::SELECT_OPEN_FILE)); 26485+ EXPECT_EQ( 26486+ SensitiveDirectoryResult::kAllowed, 26487+ ConfirmSensitiveEntryAccessSync( 26488+ permission_context(), PathType::kLocal, kTestPath, 26489+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26490+ 26491+ // External (relative) paths should also be allowed. 26492+ EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26493+ ConfirmSensitiveEntryAccessSync( 26494+ permission_context(), PathType::kExternal, 26495+ base::FilePath(FILE_PATH_LITERAL("foo/bar")), HandleType::kFile, 26496+ ui::SelectFileDialog::Type::SELECT_OPEN_FILE)); 26497 } 26498 26499 TEST_F(ChromeFileSystemAccessPermissionContextTest, 26500- ConfirmSensitiveDirectoryAccess_DontBlockAllChildren) { 26501+ ConfirmSensitiveEntryAccess_DontBlockAllChildren) { 26502 base::FilePath home_dir = temp_dir_.GetPath().AppendASCII("home"); 26503 base::ScopedPathOverride home_override(base::DIR_HOME, home_dir, true, true); 26504 26505 // Home directory itself should not be allowed. 26506- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26507- ConfirmSensitiveDirectoryAccessSync(permission_context(), 26508- PathType::kLocal, home_dir, 26509- HandleType::kDirectory)); 26510+ EXPECT_EQ( 26511+ SensitiveDirectoryResult::kAbort, 26512+ ConfirmSensitiveEntryAccessSync( 26513+ permission_context(), PathType::kLocal, home_dir, 26514+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26515 // Parent of home directory should also not be allowed. 26516- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26517- ConfirmSensitiveDirectoryAccessSync( 26518- permission_context(), PathType::kLocal, temp_dir_.GetPath(), 26519- HandleType::kDirectory)); 26520+ EXPECT_EQ( 26521+ SensitiveDirectoryResult::kAbort, 26522+ ConfirmSensitiveEntryAccessSync( 26523+ permission_context(), PathType::kLocal, temp_dir_.GetPath(), 26524+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26525 // Paths inside home directory should be allowed. 26526- EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26527- ConfirmSensitiveDirectoryAccessSync( 26528- permission_context(), PathType::kLocal, 26529- home_dir.AppendASCII("foo"), HandleType::kFile)); 26530- EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26531- ConfirmSensitiveDirectoryAccessSync( 26532- permission_context(), PathType::kLocal, 26533- home_dir.AppendASCII("foo"), HandleType::kDirectory)); 26534+ EXPECT_EQ( 26535+ SensitiveDirectoryResult::kAllowed, 26536+ ConfirmSensitiveEntryAccessSync( 26537+ permission_context(), PathType::kLocal, home_dir.AppendASCII("foo"), 26538+ HandleType::kFile, ui::SelectFileDialog::Type::SELECT_OPEN_FILE)); 26539+ EXPECT_EQ( 26540+ SensitiveDirectoryResult::kAllowed, 26541+ ConfirmSensitiveEntryAccessSync( 26542+ permission_context(), PathType::kLocal, home_dir.AppendASCII("foo"), 26543+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26544 } 26545 26546 TEST_F(ChromeFileSystemAccessPermissionContextTest, 26547- ConfirmSensitiveDirectoryAccess_BlockAllChildren) { 26548+ ConfirmSensitiveEntryAccess_BlockAllChildren) { 26549 base::FilePath app_dir = temp_dir_.GetPath().AppendASCII("app"); 26550 base::ScopedPathOverride app_override(base::DIR_EXE, app_dir, true, true); 26551 26552 // App directory itself should not be allowed. 26553- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26554- ConfirmSensitiveDirectoryAccessSync(permission_context(), 26555- PathType::kLocal, app_dir, 26556- HandleType::kDirectory)); 26557+ EXPECT_EQ( 26558+ SensitiveDirectoryResult::kAbort, 26559+ ConfirmSensitiveEntryAccessSync( 26560+ permission_context(), PathType::kLocal, app_dir, 26561+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26562 // Parent of App directory should also not be allowed. 26563- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26564- ConfirmSensitiveDirectoryAccessSync( 26565- permission_context(), PathType::kLocal, temp_dir_.GetPath(), 26566- HandleType::kDirectory)); 26567+ EXPECT_EQ( 26568+ SensitiveDirectoryResult::kAbort, 26569+ ConfirmSensitiveEntryAccessSync( 26570+ permission_context(), PathType::kLocal, temp_dir_.GetPath(), 26571+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26572 // Paths inside App directory should also not be allowed. 26573- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26574- ConfirmSensitiveDirectoryAccessSync( 26575- permission_context(), PathType::kLocal, 26576- app_dir.AppendASCII("foo"), HandleType::kFile)); 26577- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26578- ConfirmSensitiveDirectoryAccessSync( 26579- permission_context(), PathType::kLocal, 26580- app_dir.AppendASCII("foo"), HandleType::kDirectory)); 26581+ EXPECT_EQ( 26582+ SensitiveDirectoryResult::kAbort, 26583+ ConfirmSensitiveEntryAccessSync( 26584+ permission_context(), PathType::kLocal, app_dir.AppendASCII("foo"), 26585+ HandleType::kFile, ui::SelectFileDialog::Type::SELECT_OPEN_FILE)); 26586+ EXPECT_EQ( 26587+ SensitiveDirectoryResult::kAbort, 26588+ ConfirmSensitiveEntryAccessSync( 26589+ permission_context(), PathType::kLocal, app_dir.AppendASCII("foo"), 26590+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26591 } 26592 26593 TEST_F(ChromeFileSystemAccessPermissionContextTest, 26594- ConfirmSensitiveDirectoryAccess_BlockChildrenNested) { 26595+ ConfirmSensitiveEntryAccess_BlockChildrenNested) { 26596 base::FilePath user_data_dir = temp_dir_.GetPath().AppendASCII("user"); 26597 base::ScopedPathOverride user_data_override(chrome::DIR_USER_DATA, 26598 user_data_dir, true, true); 26599@@ -292,29 +296,34 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26600 download_dir, true, true); 26601 26602 // User Data directory itself should not be allowed. 26603- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26604- ConfirmSensitiveDirectoryAccessSync(permission_context(), 26605- PathType::kLocal, user_data_dir, 26606- HandleType::kDirectory)); 26607+ EXPECT_EQ( 26608+ SensitiveDirectoryResult::kAbort, 26609+ ConfirmSensitiveEntryAccessSync( 26610+ permission_context(), PathType::kLocal, user_data_dir, 26611+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26612 // Parent of User Data directory should also not be allowed. 26613- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26614- ConfirmSensitiveDirectoryAccessSync( 26615- permission_context(), PathType::kLocal, temp_dir_.GetPath(), 26616- HandleType::kDirectory)); 26617+ EXPECT_EQ( 26618+ SensitiveDirectoryResult::kAbort, 26619+ ConfirmSensitiveEntryAccessSync( 26620+ permission_context(), PathType::kLocal, temp_dir_.GetPath(), 26621+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26622 // The nested Download directory itself should not be allowed. 26623- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26624- ConfirmSensitiveDirectoryAccessSync(permission_context(), 26625- PathType::kLocal, download_dir, 26626- HandleType::kDirectory)); 26627+ EXPECT_EQ( 26628+ SensitiveDirectoryResult::kAbort, 26629+ ConfirmSensitiveEntryAccessSync( 26630+ permission_context(), PathType::kLocal, download_dir, 26631+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26632 // Paths inside the nested Download directory should be allowed. 26633 EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26634- ConfirmSensitiveDirectoryAccessSync( 26635+ ConfirmSensitiveEntryAccessSync( 26636 permission_context(), PathType::kLocal, 26637- download_dir.AppendASCII("foo"), HandleType::kFile)); 26638+ download_dir.AppendASCII("foo"), HandleType::kFile, 26639+ ui::SelectFileDialog::Type::SELECT_OPEN_FILE)); 26640 EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26641- ConfirmSensitiveDirectoryAccessSync( 26642+ ConfirmSensitiveEntryAccessSync( 26643 permission_context(), PathType::kLocal, 26644- download_dir.AppendASCII("foo"), HandleType::kDirectory)); 26645+ download_dir.AppendASCII("foo"), HandleType::kDirectory, 26646+ ui::SelectFileDialog::Type::SELECT_FOLDER)); 26647 26648 #if BUILDFLAG(IS_WIN) 26649 // DIR_IE_INTERNET_CACHE is an example of a directory where nested directories 26650@@ -324,65 +333,101 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26651 internet_cache, true, true); 26652 26653 // The nested INetCache directory itself should not be allowed. 26654- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26655- ConfirmSensitiveDirectoryAccessSync( 26656- permission_context(), PathType::kLocal, internet_cache, 26657- HandleType::kDirectory)); 26658+ EXPECT_EQ( 26659+ SensitiveDirectoryResult::kAbort, 26660+ ConfirmSensitiveEntryAccessSync( 26661+ permission_context(), PathType::kLocal, internet_cache, 26662+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26663 // Files inside the nested INetCache directory should be allowed. 26664 EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26665- ConfirmSensitiveDirectoryAccessSync( 26666+ ConfirmSensitiveEntryAccessSync( 26667 permission_context(), PathType::kLocal, 26668- internet_cache.AppendASCII("foo"), HandleType::kFile)); 26669+ internet_cache.AppendASCII("foo"), HandleType::kFile, 26670+ ui::SelectFileDialog::Type::SELECT_OPEN_FILE)); 26671 // But directories should be blocked. 26672 EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26673- ConfirmSensitiveDirectoryAccessSync( 26674+ ConfirmSensitiveEntryAccessSync( 26675 permission_context(), PathType::kLocal, 26676- internet_cache.AppendASCII("foo"), HandleType::kDirectory)); 26677+ internet_cache.AppendASCII("foo"), HandleType::kDirectory, 26678+ ui::SelectFileDialog::Type::SELECT_FOLDER)); 26679 #endif 26680 } 26681 26682 TEST_F(ChromeFileSystemAccessPermissionContextTest, 26683- ConfirmSensitiveDirectoryAccess_RelativePathBlock) { 26684+ ConfirmSensitiveEntryAccess_RelativePathBlock) { 26685 base::FilePath home_dir = temp_dir_.GetPath().AppendASCII("home"); 26686 base::ScopedPathOverride home_override(base::DIR_HOME, home_dir, true, true); 26687 26688 // ~/.ssh should be blocked 26689- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26690- ConfirmSensitiveDirectoryAccessSync( 26691- permission_context(), PathType::kLocal, 26692- home_dir.AppendASCII(".ssh"), HandleType::kDirectory)); 26693+ EXPECT_EQ( 26694+ SensitiveDirectoryResult::kAbort, 26695+ ConfirmSensitiveEntryAccessSync( 26696+ permission_context(), PathType::kLocal, home_dir.AppendASCII(".ssh"), 26697+ HandleType::kDirectory, ui::SelectFileDialog::Type::SELECT_FOLDER)); 26698 // And anything inside ~/.ssh should also be blocked 26699 EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26700- ConfirmSensitiveDirectoryAccessSync( 26701+ ConfirmSensitiveEntryAccessSync( 26702 permission_context(), PathType::kLocal, 26703- home_dir.AppendASCII(".ssh/id_rsa"), HandleType::kFile)); 26704+ home_dir.AppendASCII(".ssh/id_rsa"), HandleType::kFile, 26705+ ui::SelectFileDialog::Type::SELECT_OPEN_FILE)); 26706 } 26707 26708 TEST_F(ChromeFileSystemAccessPermissionContextTest, 26709- ConfirmSensitiveDirectoryAccess_ExplicitPathBlock) { 26710+ ConfirmSensitiveEntryAccess_ExplicitPathBlock) { 26711 // Linux is the only OS where we have some blocked directories with explicit 26712 // paths (as opposed to PathService provided paths). 26713 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) 26714 // /dev should be blocked. 26715 EXPECT_EQ( 26716 SensitiveDirectoryResult::kAbort, 26717- ConfirmSensitiveDirectoryAccessSync( 26718+ ConfirmSensitiveEntryAccessSync( 26719 permission_context(), PathType::kLocal, 26720- base::FilePath(FILE_PATH_LITERAL("/dev")), HandleType::kDirectory)); 26721+ base::FilePath(FILE_PATH_LITERAL("/dev")), HandleType::kDirectory, 26722+ ui::SelectFileDialog::Type::SELECT_FOLDER)); 26723 // As well as children of /dev. 26724- EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26725- ConfirmSensitiveDirectoryAccessSync( 26726- permission_context(), PathType::kLocal, 26727- base::FilePath(FILE_PATH_LITERAL("/dev/foo")), 26728- HandleType::kDirectory)); 26729 EXPECT_EQ( 26730 SensitiveDirectoryResult::kAbort, 26731- ConfirmSensitiveDirectoryAccessSync( 26732+ ConfirmSensitiveEntryAccessSync( 26733 permission_context(), PathType::kLocal, 26734- base::FilePath(FILE_PATH_LITERAL("/dev/foo")), HandleType::kFile)); 26735+ base::FilePath(FILE_PATH_LITERAL("/dev/foo")), HandleType::kDirectory, 26736+ ui::SelectFileDialog::Type::SELECT_FOLDER)); 26737+ EXPECT_EQ( 26738+ SensitiveDirectoryResult::kAbort, 26739+ ConfirmSensitiveEntryAccessSync( 26740+ permission_context(), PathType::kLocal, 26741+ base::FilePath(FILE_PATH_LITERAL("/dev/foo")), HandleType::kFile, 26742+ ui::SelectFileDialog::Type::SELECT_OPEN_FILE)); 26743 #endif 26744 } 26745 26746+TEST_F(ChromeFileSystemAccessPermissionContextTest, 26747+ ConfirmSensitiveEntryAccess_DangerousFile) { 26748+ // Saving files with a harmless extension should be allowed. 26749+ EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26750+ ConfirmSensitiveEntryAccessSync( 26751+ permission_context(), PathType::kLocal, 26752+ temp_dir_.GetPath().AppendASCII("test.txt"), HandleType::kFile, 26753+ ui::SelectFileDialog::SELECT_SAVEAS_FILE)); 26754+ // Saving files with a dangerous extension should show a prompt. 26755+ EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26756+ ConfirmSensitiveEntryAccessSync( 26757+ permission_context(), PathType::kLocal, 26758+ temp_dir_.GetPath().AppendASCII("test.swf"), HandleType::kFile, 26759+ ui::SelectFileDialog::SELECT_SAVEAS_FILE)); 26760+ // Opening files with a dangerous extension should be allowed. 26761+ EXPECT_EQ(SensitiveDirectoryResult::kAllowed, 26762+ ConfirmSensitiveEntryAccessSync( 26763+ permission_context(), PathType::kLocal, 26764+ temp_dir_.GetPath().AppendASCII("test.swf"), HandleType::kFile, 26765+ ui::SelectFileDialog::SELECT_OPEN_FILE)); 26766+ // Opening files with a dangerous compound extension should show a prompt. 26767+ EXPECT_EQ(SensitiveDirectoryResult::kAbort, 26768+ ConfirmSensitiveEntryAccessSync( 26769+ permission_context(), PathType::kLocal, 26770+ temp_dir_.GetPath().AppendASCII("test.txt.swf"), 26771+ HandleType::kFile, ui::SelectFileDialog::SELECT_SAVEAS_FILE)); 26772+} 26773+ 26774 TEST_F(ChromeFileSystemAccessPermissionContextTest, 26775 CanObtainWritePermission_ContentSettingAsk) { 26776 SetDefaultContentSettingValue(ContentSettingsType::FILE_SYSTEM_WRITE_GUARD, 26777@@ -1192,7 +1237,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26778 26779 // Advance the clock far enough that all permissions should be expired. 26780 Advance(ChromeFileSystemAccessPermissionContext:: 26781- kPersistentPermissionExpirationTimeoutNonPWA + 26782+ kPersistentPermissionExpirationTimeoutDefault + 26783 base::Minutes(1)); 26784 26785 // Permission should not be granted for |kOpen|. 26786@@ -1261,7 +1306,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26787 kTestOrigin, kTestPath, HandleType::kFile, GrantType::kWrite)); 26788 26789 Advance(ChromeFileSystemAccessPermissionContext:: 26790- kPersistentPermissionExpirationTimeoutNonPWA + 26791+ kPersistentPermissionExpirationTimeoutDefault + 26792 base::Seconds(1)); 26793 auto advance_once = Now(); 26794 // The active grant exists, so its timestamp should have been updated. 26795@@ -1276,7 +1321,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26796 // Do not advance far enough to expire the persisted permission. The timestamp 26797 // should NOT have been updated, since the active permission no longer exists. 26798 Advance(ChromeFileSystemAccessPermissionContext:: 26799- kPersistentPermissionExpirationTimeoutNonPWA - 26800+ kPersistentPermissionExpirationTimeoutDefault - 26801 base::Seconds(1)); 26802 permission_context()->UpdatePersistedPermissionsForTesting(); 26803 objects = permission_context()->GetAllGrantedOrExpiredObjects(); 26804@@ -1286,7 +1331,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26805 26806 // |grant| should now be expired, but not revokable until after grace period. 26807 Advance(ChromeFileSystemAccessPermissionContext:: 26808- kPersistentPermissionExpirationTimeoutNonPWA + 26809+ kPersistentPermissionExpirationTimeoutDefault + 26810 base::Seconds(1)); 26811 permission_context()->UpdatePersistedPermissionsForTesting(); 26812 objects = permission_context()->GetAllGrantedOrExpiredObjects(); 26813@@ -1316,7 +1361,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26814 kTestOrigin, kTestPath, HandleType::kFile, GrantType::kRead)); 26815 26816 Advance(ChromeFileSystemAccessPermissionContext:: 26817- kPersistentPermissionExpirationTimeoutNonPWA + 26818+ kPersistentPermissionExpirationTimeoutDefault + 26819 base::Seconds(1)); 26820 auto advance_once = Now(); 26821 // The active grant exists, so its timestamp should have been updated. 26822@@ -1331,7 +1376,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26823 // Do not advance far enough to expire the persisted permission. The timestamp 26824 // should NOT have been updated, since the active permission no longer exists. 26825 Advance(ChromeFileSystemAccessPermissionContext:: 26826- kPersistentPermissionExpirationTimeoutNonPWA - 26827+ kPersistentPermissionExpirationTimeoutDefault - 26828 base::Seconds(1)); 26829 permission_context()->UpdatePersistedPermissionsForTesting(); 26830 objects = permission_context()->GetAllGrantedOrExpiredObjects(); 26831@@ -1341,7 +1386,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26832 26833 // |grant| should now be expired, but not revokable until after grace period. 26834 Advance(ChromeFileSystemAccessPermissionContext:: 26835- kPersistentPermissionExpirationTimeoutNonPWA + 26836+ kPersistentPermissionExpirationTimeoutDefault + 26837 base::Seconds(1)); 26838 permission_context()->UpdatePersistedPermissionsForTesting(); 26839 objects = permission_context()->GetAllGrantedOrExpiredObjects(); 26840@@ -1382,7 +1427,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26841 grant2.reset(); 26842 26843 Advance(ChromeFileSystemAccessPermissionContext:: 26844- kPersistentPermissionExpirationTimeoutNonPWA - 26845+ kPersistentPermissionExpirationTimeoutDefault - 26846 base::Seconds(1)); 26847 26848 // Both grants are still valid. 26849@@ -1461,7 +1506,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26850 kTestOrigin2, kTestPath, HandleType::kFile, GrantType::kWrite)); 26851 26852 Advance(ChromeFileSystemAccessPermissionContext:: 26853- kPersistentPermissionExpirationTimeoutNonPWA - 26854+ kPersistentPermissionExpirationTimeoutDefault - 26855 base::Seconds(1)); 26856 26857 // Auto-grant because active permissions exist. This should update the 26858@@ -1498,7 +1543,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26859 26860 // Permissions should still be valid. 26861 Advance(ChromeFileSystemAccessPermissionContext:: 26862- kPersistentPermissionExpirationTimeoutNonPWA - 26863+ kPersistentPermissionExpirationTimeoutDefault - 26864 base::Minutes(1)); 26865 26866 // Resetting the permission context should kick off a sweep. 26867@@ -1514,7 +1559,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26868 26869 // Permissions should now be expired and can be revoked. 26870 Advance(ChromeFileSystemAccessPermissionContext:: 26871- kPersistentPermissionExpirationTimeoutNonPWA + 26872+ kPersistentPermissionExpirationTimeoutDefault + 26873 ChromeFileSystemAccessPermissionContext:: 26874 kPersistentPermissionGracePeriod + 26875 base::Minutes(1)); 26876@@ -1554,7 +1599,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26877 read_grant.reset(); 26878 26879 Advance(ChromeFileSystemAccessPermissionContext:: 26880- kPersistentPermissionExpirationTimeoutNonPWA - 26881+ kPersistentPermissionExpirationTimeoutDefault - 26882 base::Seconds(1)); 26883 26884 // Auto-grant because active permissions exist. This should update the 26885@@ -1570,7 +1615,7 @@ TEST_F(ChromeFileSystemAccessPermissionContextTest, 26886 26887 // Though only |write_grant| was accessed, we should not lose read access. 26888 Advance(ChromeFileSystemAccessPermissionContext:: 26889- kPersistentPermissionExpirationTimeoutNonPWA - 26890+ kPersistentPermissionExpirationTimeoutDefault - 26891 base::Seconds(1)); 26892 EXPECT_TRUE(permission_context()->HasPersistedPermissionForTesting( 26893 kTestOrigin, kTestPath, HandleType::kFile, GrantType::kRead)); 26894diff --git a/src/chrome/browser/media_galleries/media_file_system_registry.cc b/src/chrome/browser/media_galleries/media_file_system_registry.cc 26895index 7517709ed61a2..66606cc7b1848 26896--- a/src/chrome/browser/media_galleries/media_file_system_registry.cc 26897+++ b/src/chrome/browser/media_galleries/media_file_system_registry.cc 26898@@ -17,31 +17,24 @@ 26899 #include "base/containers/contains.h" 26900 #include "base/files/file_path.h" 26901 #include "base/memory/raw_ptr.h" 26902+#include "base/memory/weak_ptr.h" 26903 #include "base/notreached.h" 26904 #include "build/build_config.h" 26905 #include "build/chromeos_buildflags.h" 26906 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" 26907 #include "chrome/browser/media_galleries/gallery_watch_manager.h" 26908 #include "chrome/browser/media_galleries/media_file_system_context.h" 26909-#include "chrome/browser/media_galleries/media_galleries_dialog_controller.h" 26910 #include "chrome/browser/media_galleries/media_galleries_histograms.h" 26911 #include "chrome/browser/media_galleries/media_galleries_preferences_factory.h" 26912 #include "chrome/browser/profiles/profile.h" 26913-#include "chrome/common/chrome_paths.h" 26914-#include "chrome/common/extensions/extension_constants.h" 26915 #include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h" 26916-#include "components/prefs/pref_service.h" 26917 #include "components/storage_monitor/media_storage_util.h" 26918 #include "components/storage_monitor/storage_monitor.h" 26919 #include "content/public/browser/browser_task_traits.h" 26920 #include "content/public/browser/browser_thread.h" 26921-#include "content/public/browser/navigation_details.h" 26922-#include "content/public/browser/render_frame_host.h" 26923+#include "content/public/browser/page_user_data.h" 26924 #include "content/public/browser/render_process_host.h" 26925-#include "content/public/browser/render_process_host_observer.h" 26926-#include "content/public/browser/render_view_host.h" 26927 #include "content/public/browser/web_contents.h" 26928-#include "content/public/browser/web_contents_observer.h" 26929 #include "extensions/browser/extension_registry.h" 26930 #include "extensions/common/extension.h" 26931 #include "extensions/common/extension_set.h" 26932@@ -94,169 +87,27 @@ struct InvalidatedGalleriesInfo { 26933 std::set<MediaGalleryPrefId> pref_ids; 26934 }; 26935 26936-// Tracks the liveness of multiple RenderProcessHosts that the caller is 26937-// interested in. Once all of the RPHs have closed or been destroyed a call 26938-// back informs the caller. 26939-class RPHReferenceManager { 26940+// Just a convenience class to help scope ExtensionGalleriesHost to the lifetime 26941+// of a content::Page. 26942+class PageAlivenessReference 26943+ : public content::PageUserData<PageAlivenessReference> { 26944 public: 26945- // |no_references_callback| is called when the last WebContents reference 26946- // goes away. WebContents references are added through 26947- // ReferenceFromWebContents(). 26948- explicit RPHReferenceManager(base::OnceClosure no_references_callback); 26949- virtual ~RPHReferenceManager(); 26950- 26951- // Remove all references, but don't call |no_references_callback|. 26952- void Reset() { observer_map_.clear(); } 26953- 26954- // Returns true if there are no references. 26955- bool empty() const { return observer_map_.empty(); } 26956- 26957- // Adds a reference to the passed |contents|. Calling this multiple times with 26958- // the same |contents| is a no-op. 26959- void ReferenceFromWebContents(content::WebContents* contents); 26960+ // `page_dead_callback` is called when the page is destroyed. 26961+ PageAlivenessReference(content::Page& page, 26962+ base::OnceClosure page_dead_callback) 26963+ : content::PageUserData<PageAlivenessReference>(page), 26964+ page_dead_callback_(std::move(page_dead_callback)) {} 26965+ ~PageAlivenessReference() override { std::move(page_dead_callback_).Run(); } 26966 26967 private: 26968- class RPHWebContentsObserver : public content::WebContentsObserver { 26969- public: 26970- RPHWebContentsObserver(RPHReferenceManager* manager, 26971- WebContents* web_contents); 26972- 26973- private: 26974- // content::WebContentsObserver 26975- void WebContentsDestroyed() override; 26976- void NavigationEntryCommitted( 26977- const content::LoadCommittedDetails& load_details) override; 26978- 26979- raw_ptr<RPHReferenceManager> manager_; 26980- }; 26981- 26982- class RPHObserver : public content::RenderProcessHostObserver { 26983- public: 26984- RPHObserver(RPHReferenceManager* manager, RenderProcessHost* host); 26985- ~RPHObserver() override; 26986- 26987- void AddWebContentsObserver(WebContents* web_contents); 26988- void RemoveWebContentsObserver(WebContents* web_contents); 26989- bool HasWebContentsObservers() { return !observed_web_contentses_.empty(); } 26990- 26991- private: 26992- void RenderProcessHostDestroyed(RenderProcessHost* host) override; 26993- 26994- raw_ptr<RPHReferenceManager> manager_; 26995- raw_ptr<RenderProcessHost> host_; 26996- std::map<WebContents*, std::unique_ptr<RPHWebContentsObserver>> 26997- observed_web_contentses_; 26998- }; 26999- 27000- // Handlers for observed events. 27001- void OnRenderProcessHostDestroyed(RenderProcessHost* rph); 27002- void OnWebContentsDestroyedOrNavigated(WebContents* contents); 27003- 27004- // A callback to call when the last RVH reference goes away. 27005- base::OnceClosure no_references_callback_; 27006+ friend PageUserData; 27007+ PAGE_USER_DATA_KEY_DECL(); 27008 27009- // The set of render processes and web contents that may have references to 27010- // the file system ids this instance manages. 27011- std::map<const RenderProcessHost*, std::unique_ptr<RPHObserver>> 27012- observer_map_; 27013+ // Called once the page is dead. 27014+ base::OnceClosure page_dead_callback_; 27015 }; 27016 27017-RPHReferenceManager::RPHReferenceManager( 27018- base::OnceClosure no_references_callback) 27019- : no_references_callback_(std::move(no_references_callback)) {} 27020- 27021-RPHReferenceManager::~RPHReferenceManager() { 27022- Reset(); 27023-} 27024- 27025-void RPHReferenceManager::ReferenceFromWebContents( 27026- content::WebContents* contents) { 27027- RenderProcessHost* rph = contents->GetMainFrame()->GetProcess(); 27028- if (!base::Contains(observer_map_, rph)) { 27029- observer_map_[rph] = std::make_unique<RPHObserver>(this, rph); 27030- } 27031- observer_map_[rph]->AddWebContentsObserver(contents); 27032-} 27033- 27034-RPHReferenceManager::RPHWebContentsObserver::RPHWebContentsObserver( 27035- RPHReferenceManager* manager, 27036- WebContents* web_contents) 27037- : content::WebContentsObserver(web_contents), 27038- manager_(manager) { 27039-} 27040- 27041-void RPHReferenceManager::RPHWebContentsObserver::WebContentsDestroyed() { 27042- manager_->OnWebContentsDestroyedOrNavigated(web_contents()); 27043-} 27044- 27045-void RPHReferenceManager::RPHWebContentsObserver::NavigationEntryCommitted( 27046- const content::LoadCommittedDetails& load_details) { 27047- if (load_details.is_same_document) 27048- return; 27049- 27050- manager_->OnWebContentsDestroyedOrNavigated(web_contents()); 27051-} 27052- 27053-RPHReferenceManager::RPHObserver::RPHObserver( 27054- RPHReferenceManager* manager, RenderProcessHost* host) 27055- : manager_(manager), 27056- host_(host) { 27057- host->AddObserver(this); 27058-} 27059- 27060-RPHReferenceManager::RPHObserver::~RPHObserver() { 27061- observed_web_contentses_.clear(); 27062- if (host_) 27063- host_->RemoveObserver(this); 27064-} 27065- 27066-void RPHReferenceManager::RPHObserver::AddWebContentsObserver( 27067- WebContents* web_contents) { 27068- if (base::Contains(observed_web_contentses_, web_contents)) 27069- return; 27070- 27071- observed_web_contentses_[web_contents] = 27072- std::make_unique<RPHWebContentsObserver>(manager_, web_contents); 27073-} 27074- 27075-void RPHReferenceManager::RPHObserver::RemoveWebContentsObserver( 27076- WebContents* web_contents) { 27077- DCHECK(observed_web_contentses_.find(web_contents) != 27078- observed_web_contentses_.end()); 27079- observed_web_contentses_.erase(web_contents); 27080-} 27081- 27082-void RPHReferenceManager::RPHObserver::RenderProcessHostDestroyed( 27083- RenderProcessHost* host) { 27084- host_ = nullptr; 27085- manager_->OnRenderProcessHostDestroyed(host); 27086-} 27087- 27088-void RPHReferenceManager::OnRenderProcessHostDestroyed( 27089- RenderProcessHost* rph) { 27090- auto rph_info = observer_map_.find(rph); 27091- // This could be a potential problem if the RPH is navigated to a page on the 27092- // same renderer (triggering OnWebContentsDestroyedOrNavigated()) and then the 27093- // renderer crashes. 27094- if (rph_info == observer_map_.end()) { 27095- NOTREACHED(); 27096- return; 27097- } 27098- observer_map_.erase(rph_info); 27099- if (observer_map_.empty()) 27100- std::move(no_references_callback_).Run(); 27101-} 27102- 27103-void RPHReferenceManager::OnWebContentsDestroyedOrNavigated( 27104- WebContents* contents) { 27105- RenderProcessHost* rph = contents->GetMainFrame()->GetProcess(); 27106- auto rph_info = observer_map_.find(rph); 27107- DCHECK(rph_info != observer_map_.end()); 27108- 27109- rph_info->second->RemoveWebContentsObserver(contents); 27110- if (!rph_info->second->HasWebContentsObservers()) 27111- OnRenderProcessHostDestroyed(rph); 27112-} 27113+PAGE_USER_DATA_KEY_IMPL(PageAlivenessReference); 27114 27115 } // namespace 27116 27117@@ -283,8 +134,7 @@ MediaFileSystemInfo::~MediaFileSystemInfo() {} 27118 // The main owner of this class is 27119 // |MediaFileSystemRegistry::extension_hosts_map_|, but a callback may 27120 // temporarily hold a reference. 27121-class ExtensionGalleriesHost 27122- : public base::RefCountedThreadSafe<ExtensionGalleriesHost> { 27123+class ExtensionGalleriesHost { 27124 public: 27125 // |no_references_callback| is called when the last WebContents reference 27126 // goes away. WebContents references are added through 27127@@ -296,9 +146,13 @@ class ExtensionGalleriesHost 27128 : file_system_context_(file_system_context), 27129 profile_path_(profile_path), 27130 extension_id_(extension_id), 27131- no_references_callback_(std::move(no_references_callback)), 27132- rph_refs_(base::BindRepeating(&ExtensionGalleriesHost::CleanUp, 27133- base::Unretained(this))) {} 27134+ no_references_callback_(std::move(no_references_callback)) {} 27135+ 27136+ ~ExtensionGalleriesHost() { 27137+ for (auto& it : pref_id_map_) { 27138+ file_system_context_->RevokeFileSystem(it.second.fsid); 27139+ } 27140+ } 27141 27142 ExtensionGalleriesHost(const ExtensionGalleriesHost&) = delete; 27143 ExtensionGalleriesHost& operator=(const ExtensionGalleriesHost&) = delete; 27144@@ -322,8 +176,8 @@ class ExtensionGalleriesHost 27145 device_ids, 27146 base::BindOnce( 27147 &ExtensionGalleriesHost::GetMediaFileSystemsForAttachedDevices, 27148- this, base::Owned(device_ids), galleries, galleries_info, 27149- std::move(callback))); 27150+ weak_factory_.GetWeakPtr(), base::Owned(device_ids), galleries, 27151+ galleries_info, std::move(callback))); 27152 } 27153 27154 // Checks if |gallery| is attached and if so, registers the file system and 27155@@ -338,8 +192,8 @@ class ExtensionGalleriesHost 27156 MediaStorageUtil::FilterAttachedDevices( 27157 device_ids, 27158 base::BindOnce(&ExtensionGalleriesHost::RegisterAttachedMediaFileSystem, 27159- this, base::Owned(device_ids), gallery, 27160- std::move(callback))); 27161+ weak_factory_.GetWeakPtr(), base::Owned(device_ids), 27162+ gallery, std::move(callback))); 27163 } 27164 27165 // Revoke the file system for |id| if this extension has created one for |id|. 27166@@ -352,7 +206,6 @@ class ExtensionGalleriesHost 27167 pref_id_map_.erase(gallery); 27168 27169 if (pref_id_map_.empty()) { 27170- rph_refs_.Reset(); 27171 CleanUp(); 27172 } 27173 } 27174@@ -361,20 +214,24 @@ class ExtensionGalleriesHost 27175 // created 27176 // by this class. 27177 void ReferenceFromWebContents(content::WebContents* web_contents) { 27178- rph_refs_.ReferenceFromWebContents(web_contents); 27179+ referring_page_count_++; 27180+ // The count is decremented when the below Page is destroyed. 27181+ PageAlivenessReference::CreateForPage( 27182+ web_contents->GetPrimaryPage(), 27183+ base::BindOnce(&ExtensionGalleriesHost::DecrementReferringPageCount, 27184+ weak_factory_.GetWeakPtr())); 27185+ } 27186+ 27187+ void DecrementReferringPageCount() { 27188+ referring_page_count_--; 27189+ if (referring_page_count_ == 0) { 27190+ CleanUp(); 27191+ } 27192 } 27193 27194 private: 27195 typedef std::map<MediaGalleryPrefId, MediaFileSystemInfo> PrefIdFsInfoMap; 27196 27197- // Private destructor and friend declaration for ref counted implementation. 27198- friend class base::RefCountedThreadSafe<ExtensionGalleriesHost>; 27199- 27200- virtual ~ExtensionGalleriesHost() { 27201- DCHECK(rph_refs_.empty()); 27202- DCHECK(pref_id_map_.empty()); 27203- } 27204- 27205 void GetMediaFileSystemsForAttachedDevices( 27206 const MediaStorageUtil::DeviceIdSet* attached_devices, 27207 const MediaGalleryPrefIdSet& galleries, 27208@@ -382,14 +239,6 @@ class ExtensionGalleriesHost 27209 MediaFileSystemsCallback callback) { 27210 std::vector<MediaFileSystemInfo> result; 27211 27212- if (rph_refs_.empty()) { 27213- // We're actually in the middle of shutdown, and Filter...() lagging 27214- // which can invoke this method interleaved in the destruction callback 27215- // sequence and re-populate pref_id_map_. 27216- std::move(callback).Run(result); 27217- return; 27218- } 27219- 27220 for (auto pref_id_it = galleries.begin(); pref_id_it != galleries.end(); 27221 ++pref_id_it) { 27222 const MediaGalleryPrefId& pref_id = *pref_id_it; 27223@@ -428,7 +277,6 @@ class ExtensionGalleriesHost 27224 } 27225 27226 if (result.empty()) { 27227- rph_refs_.Reset(); 27228 CleanUp(); 27229 } 27230 27231@@ -442,10 +290,7 @@ class ExtensionGalleriesHost 27232 base::OnceCallback<void(base::File::Error result)> callback) { 27233 base::File::Error result = base::File::FILE_ERROR_NOT_FOUND; 27234 27235- // If rph_refs is empty then we're actually in the middle of shutdown, and 27236- // Filter...() lagging which can invoke this method interleaved in the 27237- // destruction callback sequence and re-populate pref_id_map_. 27238- if (!attached_device->empty() && !rph_refs_.empty()) { 27239+ if (!attached_device->empty()) { 27240 std::string fs_name = MediaFileSystemBackend::ConstructMountName( 27241 profile_path_, extension_id_, gallery.pref_id); 27242 base::FilePath path = gallery.AbsolutePath(); 27243@@ -469,7 +314,6 @@ class ExtensionGalleriesHost 27244 } 27245 27246 if (pref_id_map_.empty()) { 27247- rph_refs_.Reset(); 27248 CleanUp(); 27249 } 27250 content::GetIOThreadTaskRunner({})->PostTask( 27251@@ -484,14 +328,9 @@ class ExtensionGalleriesHost 27252 } 27253 27254 void CleanUp() { 27255- DCHECK(rph_refs_.empty()); 27256- for (PrefIdFsInfoMap::const_iterator it = pref_id_map_.begin(); 27257- it != pref_id_map_.end(); 27258- ++it) { 27259- file_system_context_->RevokeFileSystem(it->second.fsid); 27260- } 27261- pref_id_map_.clear(); 27262- 27263+ // This causes the owner of this class to destroy this object. The revoking 27264+ // of our filesystems occurs in the destructor. It's written that way 27265+ // because sometimes the Profile Shutdown can ALSO cause object destruction. 27266 std::move(no_references_callback_).Run(); 27267 } 27268 27269@@ -511,9 +350,12 @@ class ExtensionGalleriesHost 27270 // A map from the gallery preferences id to the file system information. 27271 PrefIdFsInfoMap pref_id_map_; 27272 27273- // The set of render processes and web contents that may have references to 27274- // the file system ids this instance manages. 27275- RPHReferenceManager rph_refs_; 27276+ // The number of living content::Page instances that are interested in this 27277+ // combination of Profile and `extension_id`. 27278+ size_t referring_page_count_ = 0U; 27279+ 27280+ // Don't let callbacks extend our lifetime, as that makes things complicated. 27281+ base::WeakPtrFactory<ExtensionGalleriesHost> weak_factory_{this}; 27282 }; 27283 27284 /****************** 27285@@ -524,8 +366,7 @@ void MediaFileSystemRegistry::GetMediaFileSystemsForExtension( 27286 content::WebContents* contents, 27287 const extensions::Extension* extension, 27288 MediaFileSystemsCallback callback) { 27289- // TODO(tommycli): Change to DCHECK after fixing http://crbug.com/374330. 27290- CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 27291+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 27292 27293 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 27294 MediaGalleriesPreferences* preferences = GetPreferences(profile); 27295@@ -811,14 +652,18 @@ ExtensionGalleriesHost* MediaFileSystemRegistry::GetExtensionGalleryHost( 27296 if (extension_hosts->second.empty()) 27297 preferences->AddGalleryChangeObserver(this); 27298 27299- ExtensionGalleriesHost* result = extension_hosts->second[extension_id].get(); 27300- if (!result) { 27301- result = new ExtensionGalleriesHost( 27302- file_system_context_.get(), profile->GetPath(), extension_id, 27303- base::BindOnce(&MediaFileSystemRegistry::OnExtensionGalleriesHostEmpty, 27304- base::Unretained(this), profile, extension_id)); 27305- extension_hosts_map_[profile][extension_id] = result; 27306+ auto it = extension_hosts->second.find(extension_id); 27307+ if (it != extension_hosts->second.end()) { 27308+ return it->second.get(); 27309 } 27310+ 27311+ auto new_host = std::make_unique<ExtensionGalleriesHost>( 27312+ file_system_context_.get(), profile->GetPath(), extension_id, 27313+ base::BindOnce(&MediaFileSystemRegistry::OnExtensionGalleriesHostEmpty, 27314+ base::Unretained(this), profile, extension_id)); 27315+ // Save a raw pointer to the newly created host so we can return it. 27316+ auto* result = new_host.get(); 27317+ extension_hosts->second[extension_id] = std::move(new_host); 27318 return result; 27319 } 27320 27321diff --git a/src/chrome/browser/media_galleries/media_file_system_registry.h b/src/chrome/browser/media_galleries/media_file_system_registry.h 27322index 9ed0135f2a7db..c311820f959a8 27323--- a/src/chrome/browser/media_galleries/media_file_system_registry.h 27324+++ b/src/chrome/browser/media_galleries/media_file_system_registry.h 27325@@ -16,7 +16,6 @@ 27326 27327 #include "base/files/file.h" 27328 #include "base/files/file_path.h" 27329-#include "base/memory/ref_counted.h" 27330 #include "chrome/browser/media_galleries/media_galleries_preferences.h" 27331 #include "components/keyed_service/core/keyed_service_shutdown_notifier.h" 27332 #include "components/storage_monitor/removable_storage_observer.h" 27333@@ -109,7 +108,8 @@ class MediaFileSystemRegistry 27334 27335 // Map an extension to the ExtensionGalleriesHost. 27336 typedef std::map<std::string /*extension_id*/, 27337- scoped_refptr<ExtensionGalleriesHost>> ExtensionHostMap; 27338+ std::unique_ptr<ExtensionGalleriesHost>> 27339+ ExtensionHostMap; 27340 // Map a profile and extension to the ExtensionGalleriesHost. 27341 typedef std::map<Profile*, ExtensionHostMap> ExtensionGalleriesHostMap; 27342 // Map a profile to a shutdown notification subscription. 27343diff --git a/src/chrome/browser/pdf/pdf_extension_util.cc b/src/chrome/browser/pdf/pdf_extension_util.cc 27344index f72431f5bc7ba..e307e2b349e65 27345--- a/src/chrome/browser/pdf/pdf_extension_util.cc 27346+++ b/src/chrome/browser/pdf/pdf_extension_util.cc 27347@@ -28,6 +28,7 @@ namespace pdf_extension_util { 27348 27349 namespace { 27350 27351+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 27352 // Tags in the manifest to be replaced. 27353 const char kNameTag[] = "<NAME>"; 27354 27355@@ -160,10 +161,12 @@ void AddPdfViewerStrings(base::Value* dict) { 27356 webui::SetLoadTimeDataDefaults(g_browser_process->GetApplicationLocale(), 27357 static_cast<base::DictionaryValue*>(dict)); 27358 } 27359+#endif // BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 27360 27361 } // namespace 27362 27363 std::string GetManifest() { 27364+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 27365 std::string manifest_contents( 27366 ui::ResourceBundle::GetSharedInstance().GetRawDataResource( 27367 IDR_PDF_MANIFEST)); 27368@@ -173,9 +176,13 @@ std::string GetManifest() { 27369 ChromeContentClient::kPDFExtensionPluginName); 27370 27371 return manifest_contents; 27372+#else 27373+ return ""; 27374+#endif 27375 } 27376 27377 void AddStrings(PdfViewerContext context, base::Value* dict) { 27378+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 27379 AddCommonStrings(dict); 27380 if (context == PdfViewerContext::kPdfViewer || 27381 context == PdfViewerContext::kAll) { 27382@@ -185,6 +192,7 @@ void AddStrings(PdfViewerContext context, base::Value* dict) { 27383 context == PdfViewerContext::kAll) { 27384 // Nothing to do yet, since there are no PrintPreview-only strings. 27385 } 27386+#endif 27387 } 27388 27389 void AddAdditionalData(bool enable_annotations, base::Value* dict) { 27390diff --git a/src/chrome/browser/prefs/browser_prefs.cc b/src/chrome/browser/prefs/browser_prefs.cc 27391index d66d193121be5..90f21d784f98f 27392--- a/src/chrome/browser/prefs/browser_prefs.cc 27393+++ b/src/chrome/browser/prefs/browser_prefs.cc 27394@@ -1038,7 +1038,9 @@ void RegisterLocalState(PrefRegistrySimple* registry) { 27395 #else // BUILDFLAG(IS_ANDROID) 27396 gcm::RegisterPrefs(registry); 27397 IntranetRedirectDetector::RegisterPrefs(registry); 27398+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27399 media_router::RegisterLocalStatePrefs(registry); 27400+#endif 27401 metrics::TabStatsTracker::RegisterPrefs(registry); 27402 RegisterBrowserPrefs(registry); 27403 speech::SodaInstaller::RegisterLocalStatePrefs(registry); 27404@@ -1352,8 +1354,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, 27405 gcm::RegisterProfilePrefs(registry); 27406 HatsService::RegisterProfilePrefs(registry); 27407 NtpCustomBackgroundService::RegisterProfilePrefs(registry); 27408+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27409 media_router::RegisterAccessCodeProfilePrefs(registry); 27410 media_router::RegisterProfilePrefs(registry); 27411+#endif 27412 NewTabPageHandler::RegisterProfilePrefs(registry); 27413 NewTabPageUI::RegisterProfilePrefs(registry); 27414 NewTabUI::RegisterProfilePrefs(registry); 27415diff --git a/src/chrome/browser/profiles/BUILD.gn b/src/chrome/browser/profiles/BUILD.gn 27416index 15f69bdb70c16..5d0e171e4e67b 27417--- a/src/chrome/browser/profiles/BUILD.gn 27418+++ b/src/chrome/browser/profiles/BUILD.gn 27419@@ -5,6 +5,10 @@ 27420 import("//build/config/chromeos/ui_mode.gni") 27421 import("//extensions/buildflags/buildflags.gni") 27422 27423+if (is_ohos) { 27424+ import("//media/media_options.gni") 27425+} 27426+ 27427 # This target should be the default place for adding public interface things 27428 # (ie, non-factory, non-impl). There will likely need to be a :factory or :impl 27429 # target (maybe both) for those eventually. 27430@@ -60,6 +64,10 @@ source_set("profile") { 27431 if (is_android) { 27432 deps += [ "//chrome/browser/profiles/android:jni_headers" ] 27433 } 27434+ 27435+ if (is_ohos && !ohos_enable_media_router) { 27436+ deps -= [ "//components/media_router/common" ] 27437+ } 27438 } 27439 27440 if (is_android) { 27441diff --git a/src/chrome/browser/profiles/profile.cc b/src/chrome/browser/profiles/profile.cc 27442index 032300a4c4a0b..1edb5bcfe39b9 27443--- a/src/chrome/browser/profiles/profile.cc 27444+++ b/src/chrome/browser/profiles/profile.cc 27445@@ -256,6 +256,10 @@ Profile* Profile::FromWebUI(content::WebUI* web_ui) { 27446 } 27447 27448 void Profile::AddObserver(ProfileObserver* observer) { 27449+ // Instrumentation for https://crbug.com/1359689. 27450+ CHECK(observer); 27451+ CHECK(!observers_.HasObserver(observer)); 27452+ 27453 observers_.AddObserver(observer); 27454 } 27455 27456@@ -364,7 +368,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 27457 std::string()); 27458 #endif 27459 27460-#if !BUILDFLAG(IS_ANDROID) 27461+#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27462 registry->RegisterBooleanPref( 27463 media_router::prefs::kMediaRouterCloudServicesPrefSet, false, 27464 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 27465@@ -461,13 +465,19 @@ void Profile::MaybeSendDestroyedNotification() { 27466 TRACE_EVENT1("shutdown", "Profile::MaybeSendDestroyedNotification", "profile", 27467 this); 27468 27469- if (!sent_destroyed_notification_) { 27470- sent_destroyed_notification_ = true; 27471+ if (sent_destroyed_notification_) 27472+ return; 27473+ sent_destroyed_notification_ = true; 27474+ 27475+ // Instrumentation for https://crbug.com/1359689, 27476+ auto weak_this = GetWeakPtr(); 27477 27478- NotifyWillBeDestroyed(); 27479+ NotifyWillBeDestroyed(); 27480+ CHECK(weak_this); 27481 27482- for (auto& observer : observers_) 27483- observer.OnProfileWillBeDestroyed(this); 27484+ for (auto& observer : observers_) { 27485+ observer.OnProfileWillBeDestroyed(this); 27486+ CHECK(weak_this); 27487 } 27488 } 27489 27490@@ -543,3 +553,7 @@ variations::VariationsClient* Profile::GetVariationsClient() { 27491 content::ResourceContext* Profile::GetResourceContext() { 27492 return resource_context_.get(); 27493 } 27494+ 27495+base::WeakPtr<Profile> Profile::GetWeakPtr() { 27496+ return weak_factory_.GetWeakPtr(); 27497+} 27498diff --git a/src/chrome/browser/profiles/profile.h b/src/chrome/browser/profiles/profile.h 27499index febd52df6c971..8053e9909922f 27500--- a/src/chrome/browser/profiles/profile.h 27501+++ b/src/chrome/browser/profiles/profile.h 27502@@ -12,6 +12,7 @@ 27503 #include <vector> 27504 27505 #include "base/memory/scoped_refptr.h" 27506+#include "base/memory/weak_ptr.h" 27507 #include "base/observer_list.h" 27508 #include "build/build_config.h" 27509 #include "build/chromeos_buildflags.h" 27510@@ -501,6 +502,10 @@ class Profile : public content::BrowserContext { 27511 virtual bool IsSignedIn() = 0; 27512 27513 private: 27514+ friend class ProfileDestroyer; 27515+ 27516+ base::WeakPtr<Profile> GetWeakPtr(); 27517+ 27518 // Created on the UI thread, and returned by GetResourceContext(), but 27519 // otherwise lives on and is destroyed on the IO thread. 27520 // 27521@@ -523,6 +528,8 @@ class Profile : public content::BrowserContext { 27522 27523 class ChromeVariationsClient; 27524 std::unique_ptr<variations::VariationsClient> chrome_variations_client_; 27525+ 27526+ base::WeakPtrFactory<Profile> weak_factory_{this}; 27527 }; 27528 27529 // The comparator for profile pointers as key in a map. 27530diff --git a/src/chrome/browser/profiles/profile_destroyer.cc b/src/chrome/browser/profiles/profile_destroyer.cc 27531index cf578009f2a50..70a70f952378a 27532--- a/src/chrome/browser/profiles/profile_destroyer.cc 27533+++ b/src/chrome/browser/profiles/profile_destroyer.cc 27534@@ -44,7 +44,15 @@ enum class ProfileDestructionType { 27535 ProfileDestroyer::DestroyerSet* ProfileDestroyer::pending_destroyers_ = nullptr; 27536 27537 // static 27538-void ProfileDestroyer::DestroyProfileWhenAppropriate(Profile* const profile) { 27539+void ProfileDestroyer::DestroyProfileWhenAppropriate(Profile* profile) { 27540+ DestroyProfileWhenAppropriateWithTimeout(profile, 27541+ base::Seconds(kTimerDelaySeconds)); 27542+} 27543+ 27544+// static 27545+void ProfileDestroyer::DestroyProfileWhenAppropriateWithTimeout( 27546+ Profile* profile, 27547+ base::TimeDelta timeout) { 27548 TRACE_EVENT("shutdown", "ProfileDestroyer::DestroyProfileWhenAppropriate", 27549 [&](perfetto::EventContext ctx) { 27550 auto* proto = 27551@@ -73,11 +81,11 @@ void ProfileDestroyer::DestroyProfileWhenAppropriate(Profile* const profile) { 27552 27553 // The instance will destroy itself once all (non-spare) render process 27554 // hosts referring to it are properly terminated. 27555- new ProfileDestroyer(profile, &profile_hosts); 27556+ new ProfileDestroyer(profile, &profile_hosts, timeout); 27557 } 27558 27559 // static 27560-void ProfileDestroyer::DestroyOffTheRecordProfileNow(Profile* const profile) { 27561+void ProfileDestroyer::DestroyOffTheRecordProfileNow(Profile* profile) { 27562 DCHECK(profile); 27563 DCHECK(profile->IsOffTheRecord()); 27564 TRACE_EVENT( 27565@@ -88,12 +96,6 @@ void ProfileDestroyer::DestroyOffTheRecordProfileNow(Profile* const profile) { 27566 proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile)); 27567 proto->set_otr_profile_id(profile->GetOTRProfileID().ToString()); 27568 }); 27569- if (ResetPendingDestroyers(profile)) { 27570- // We want to signal this in debug builds so that we don't lose sight of 27571- // these potential leaks, but we handle it in release so that we don't 27572- // crash or corrupt profile data on disk. 27573- NOTREACHED() << "A render process host wasn't destroyed early enough."; 27574- } 27575 DCHECK(profile->GetOriginalProfile()); 27576 profile->GetOriginalProfile()->DestroyOffTheRecordProfile(profile); 27577 UMA_HISTOGRAM_ENUMERATION("Profile.Destroyer.OffTheRecord", 27578@@ -101,7 +103,7 @@ void ProfileDestroyer::DestroyOffTheRecordProfileNow(Profile* const profile) { 27579 } 27580 27581 // static 27582-void ProfileDestroyer::DestroyOriginalProfileNow(Profile* const profile) { 27583+void ProfileDestroyer::DestroyOriginalProfileNow(Profile* profile) { 27584 DCHECK(profile); 27585 DCHECK(!profile->IsOffTheRecord()); 27586 TRACE_EVENT("shutdown", "ProfileDestroyer::DestroyOriginalProfileNow", 27587@@ -158,22 +160,11 @@ void ProfileDestroyer::DestroyOriginalProfileNow(Profile* const profile) { 27588 #endif // DCHECK_IS_ON() 27589 } 27590 27591-bool ProfileDestroyer::ResetPendingDestroyers(Profile* const profile) { 27592- DCHECK(profile); 27593- bool found = false; 27594- if (pending_destroyers_) { 27595- for (auto* i : *pending_destroyers_) { 27596- if (i->profile_ == profile) { 27597- i->profile_ = nullptr; 27598- found = true; 27599- } 27600- } 27601- } 27602- return found; 27603-} 27604- 27605-ProfileDestroyer::ProfileDestroyer(Profile* const profile, HostSet* hosts) 27606- : profile_(profile) { 27607+ProfileDestroyer::ProfileDestroyer(Profile* profile, 27608+ HostSet* hosts, 27609+ base::TimeDelta timeout) 27610+ : profile_(profile->GetWeakPtr()), 27611+ timeout_(timeout) { 27612 TRACE_EVENT("shutdown", "ProfileDestroyer::ProfileDestroyer", 27613 [&](perfetto::EventContext ctx) { 27614 auto* proto = 27615@@ -190,7 +181,7 @@ ProfileDestroyer::ProfileDestroyer(Profile* const profile, HostSet* hosts) 27616 // If we are going to wait for render process hosts, we don't want to do it 27617 // for longer than kTimerDelaySeconds. 27618 if (observations_.IsObservingAnySource()) { 27619- timer_.Start(FROM_HERE, base::Seconds(kTimerDelaySeconds), 27620+ timer_.Start(FROM_HERE, timeout, 27621 base::BindOnce(&ProfileDestroyer::DestroyProfile, 27622 weak_ptr_factory_.GetWeakPtr())); 27623 } 27624@@ -202,7 +193,7 @@ ProfileDestroyer::~ProfileDestroyer() { 27625 auto* proto = 27626 ctx.event<perfetto::protos::pbzero::ChromeTrackEvent>() 27627 ->set_chrome_profile_destroyer(); 27628- proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile_)); 27629+ proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile_.get())); 27630 proto->set_host_count_at_destruction( 27631 observations_.GetSourcesCount()); 27632 }); 27633@@ -210,7 +201,7 @@ ProfileDestroyer::~ProfileDestroyer() { 27634 // Check again, in case other render hosts were added while we were 27635 // waiting for the previous ones to go away... 27636 if (profile_) 27637- DestroyProfileWhenAppropriate(profile_); 27638+ DestroyProfileWhenAppropriateWithTimeout(profile_.get(), timeout_); 27639 27640 // Don't wait for pending registrations, if any, these hosts are buggy. 27641 // Note: this can happen, but if so, it's better to crash here than wait 27642@@ -240,7 +231,7 @@ void ProfileDestroyer::RenderProcessHostDestroyed( 27643 [&](perfetto::EventContext ctx) { 27644 auto* proto = ctx.event<perfetto::protos::pbzero::ChromeTrackEvent>() 27645 ->set_chrome_profile_destroyer(); 27646- proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile_)); 27647+ proto->set_profile_ptr(reinterpret_cast<uint64_t>(profile_.get())); 27648 proto->set_render_process_host_ptr(reinterpret_cast<uint64_t>(host)); 27649 }); 27650 observations_.RemoveObservation(host); 27651@@ -262,7 +253,7 @@ void ProfileDestroyer::DestroyProfile() { 27652 27653 DCHECK(profile_->IsOffTheRecord()); 27654 DCHECK(profile_->GetOriginalProfile()); 27655- profile_->GetOriginalProfile()->DestroyOffTheRecordProfile(profile_); 27656+ profile_->GetOriginalProfile()->DestroyOffTheRecordProfile(profile_.get()); 27657 27658 #if BUILDFLAG(IS_ANDROID) 27659 // It is possible on Android platform that more than one destroyer 27660@@ -281,7 +272,7 @@ void ProfileDestroyer::DestroyProfile() { 27661 27662 // static 27663 ProfileDestroyer::HostSet ProfileDestroyer::GetHostsForProfile( 27664- void* const profile_ptr, 27665+ void* profile_ptr, 27666 bool include_spare_rph) { 27667 HostSet hosts; 27668 for (content::RenderProcessHost::iterator iter( 27669diff --git a/src/chrome/browser/profiles/profile_destroyer.h b/src/chrome/browser/profiles/profile_destroyer.h 27670index 2492ccadf9bb3..444fcfe2b1d0d 27671--- a/src/chrome/browser/profiles/profile_destroyer.h 27672+++ b/src/chrome/browser/profiles/profile_destroyer.h 27673@@ -15,6 +15,7 @@ 27674 #include "content/public/browser/render_process_host.h" 27675 #include "content/public/browser/render_process_host_observer.h" 27676 27677+class DevToolsBrowserContextManager; 27678 class Profile; 27679 class ProfileImpl; 27680 27681@@ -26,7 +27,7 @@ class ProfileDestroyer : public content::RenderProcessHostObserver { 27682 // for dependent renderer process hosts to destroy. 27683 // Ownership of the profile is passed to profile destroyer and the profile 27684 // should not be used after this call. 27685- static void DestroyProfileWhenAppropriate(Profile* const profile); 27686+ static void DestroyProfileWhenAppropriate(Profile* profile); 27687 ProfileDestroyer(const ProfileDestroyer&) = delete; 27688 ProfileDestroyer& operator=(const ProfileDestroyer&) = delete; 27689 27690@@ -37,7 +38,18 @@ class ProfileDestroyer : public content::RenderProcessHostObserver { 27691 27692 friend class base::RefCounted<ProfileDestroyer>; 27693 27694- ProfileDestroyer(Profile* const profile, HostSet* hosts); 27695+ // For custom timeout, see DestroyProfileWhenAppropriateWithTimeout. 27696+ friend class DevToolsBrowserContextManager; 27697+ 27698+ // Same as DestroyProfileWhenAppropriate, but configures how long to wait 27699+ // for render process hosts to be destroyed. Intended for testing/automation 27700+ // scenarios, where default timeout is too short. 27701+ static void DestroyProfileWhenAppropriateWithTimeout(Profile* profile, 27702+ base::TimeDelta timeout); 27703+ 27704+ ProfileDestroyer(Profile* profile, 27705+ HostSet* hosts, 27706+ base::TimeDelta timeout); 27707 ~ProfileDestroyer() override; 27708 27709 // content::RenderProcessHostObserver override. 27710@@ -52,20 +64,15 @@ class ProfileDestroyer : public content::RenderProcessHostObserver { 27711 // 27712 // If |include_spare_rph| is true, include spare render process hosts in the 27713 // output. 27714- static HostSet GetHostsForProfile(void* const profile_ptr, 27715+ static HostSet GetHostsForProfile(void* profile_ptr, 27716 bool include_spare_rph = false); 27717 27718 // Destroys an Original (non-off-the-record) profile immediately. 27719- static void DestroyOriginalProfileNow(Profile* const profile); 27720+ static void DestroyOriginalProfileNow(Profile* profile); 27721 27722 // Destroys an OffTheRecord profile immediately and removes it from all 27723 // pending destroyers. 27724- static void DestroyOffTheRecordProfileNow(Profile* const profile); 27725- 27726- // Reset pending destroyers whose target profile matches the given one 27727- // to make it stop attempting to destroy it. Returns true if any object 27728- // object was found to match and get reset. 27729- static bool ResetPendingDestroyers(Profile* const profile); 27730+ static void DestroyOffTheRecordProfileNow(Profile* profile); 27731 27732 // We need access to all pending destroyers so we can cancel them. 27733 static DestroyerSet* pending_destroyers_; 27734@@ -77,9 +84,27 @@ class ProfileDestroyer : public content::RenderProcessHostObserver { 27735 content::RenderProcessHostObserver> 27736 observations_{this}; 27737 27738- // The profile being destroyed. If it is set to NULL, it is a signal from 27739- // another instance of ProfileDestroyer that this instance is canceled. 27740- Profile* profile_; 27741+ // The profile being destroyed. 27742+ // 27743+ // Note: Ownership model of the Profile is not consistent. As a result, this 27744+ // variable sometimes represent ownership over the Profile, but sometimes 27745+ // this is just a weak reference, and the Profile might be destroyed outside 27746+ // of the ProfileDestroyer. 27747+ // 27748+ // [Regular profile] 27749+ // Owned by the ProfileManager. Ownership is transferred. 27750+ // 27751+ // [OTR profile] 27752+ // Owned by the original profile. Owner is NOT transferred. This is a weak 27753+ // pointer. Deleting the original Profile will delete its OTR profile under 27754+ // the hood. 27755+ // 27756+ // [Independent profile] 27757+ // It depends on the component. Most likely, the ownership is transferred. 27758+ base::WeakPtr<Profile> profile_; 27759+ 27760+ // Force-destruction timeout. 27761+ const base::TimeDelta timeout_; 27762 27763 base::WeakPtrFactory<ProfileDestroyer> weak_ptr_factory_{this}; 27764 }; 27765diff --git a/src/chrome/browser/profiles/profile_destroyer_unittest.cc b/src/chrome/browser/profiles/profile_destroyer_unittest.cc 27766index 25885bcb42fde..5bee467a8cb68 27767--- a/src/chrome/browser/profiles/profile_destroyer_unittest.cc 27768+++ b/src/chrome/browser/profiles/profile_destroyer_unittest.cc 27769@@ -115,6 +115,33 @@ TEST_P(ProfileDestroyerTest, DelayedOTRProfileDestruction) { 27770 EXPECT_TRUE(IsOTRProfileDestroyed()); 27771 } 27772 27773+TEST_P(ProfileDestroyerTest, RenderProcessAddedAfterDestroyRequested) { 27774+ if (!IsScopedProfileKeepAliveSupported()) 27775+ return; 27776+ CreateOriginalProfile(); 27777+ 27778+ content::RenderProcessHost* render_process_host_1 = 27779+ CreatedRendererProcessHost(original_profile()); 27780+ StopKeepingAliveOriginalProfile(); 27781+ 27782+ ProfileDestroyer::DestroyProfileWhenAppropriate(original_profile()); 27783+ 27784+ EXPECT_TRUE(original_profile()); 27785+ content::RenderProcessHost* render_process_host_2 = 27786+ CreatedRendererProcessHost(original_profile()); 27787+ 27788+ base::RunLoop().RunUntilIdle(); 27789+ EXPECT_TRUE(original_profile()); // Waiting for 2 processes to be released 27790+ 27791+ render_process_host_1->Cleanup(); 27792+ base::RunLoop().RunUntilIdle(); 27793+ EXPECT_TRUE(original_profile()); // Waiting for 1 process to be released. 27794+ 27795+ render_process_host_2->Cleanup(); 27796+ base::RunLoop().RunUntilIdle(); 27797+ EXPECT_FALSE(original_profile()); // Destroyed. 27798+} 27799+ 27800 INSTANTIATE_TEST_SUITE_P(AllOTRProfileTypes, 27801 ProfileDestroyerTest, 27802 /*is_primary_otr=*/testing::Bool()); 27803diff --git a/src/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/src/chrome/browser/renderer_context_menu/render_view_context_menu.cc 27804index ca285d877f557..bf81be4f66fde 27805--- a/src/chrome/browser/renderer_context_menu/render_view_context_menu.cc 27806+++ b/src/chrome/browser/renderer_context_menu/render_view_context_menu.cc 27807@@ -118,8 +118,6 @@ 27808 #include "components/guest_view/browser/guest_view_base.h" 27809 #include "components/language/core/browser/language_model_manager.h" 27810 #include "components/lens/lens_features.h" 27811-#include "components/media_router/browser/media_router_dialog_controller.h" 27812-#include "components/media_router/browser/media_router_metrics.h" 27813 #include "components/omnibox/browser/autocomplete_classifier.h" 27814 #include "components/omnibox/browser/autocomplete_match.h" 27815 #include "components/password_manager/content/browser/content_password_manager_driver.h" 27816@@ -265,6 +263,11 @@ 27817 #include "ui/aura/window.h" 27818 #endif 27819 27820+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27821+#include "components/media_router/browser/media_router_dialog_controller.h" 27822+#include "components/media_router/browser/media_router_metrics.h" 27823+#endif 27824+ 27825 using base::UserMetricsAction; 27826 using blink::ContextMenuData; 27827 using blink::ContextMenuDataEditFlags; 27828@@ -377,7 +380,9 @@ const std::map<int, int>& GetIdcToUmaMap(UmaEnumIdLookupType type) { 27829 {IDC_WRITING_DIRECTION_LTR, 64}, 27830 {IDC_WRITING_DIRECTION_RTL, 65}, 27831 {IDC_CONTENT_CONTEXT_LOAD_IMAGE, 66}, 27832+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27833 {IDC_ROUTE_MEDIA, 68}, 27834+#endif 27835 {IDC_CONTENT_CONTEXT_COPYLINKTEXT, 69}, 27836 {IDC_CONTENT_CONTEXT_OPENLINKINPROFILE, 70}, 27837 {IDC_OPEN_LINK_IN_PROFILE_FIRST, 71}, 27838@@ -1820,10 +1825,12 @@ void RenderViewContextMenu::AppendPrintItem() { 27839 } 27840 27841 void RenderViewContextMenu::AppendMediaRouterItem() { 27842+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27843 if (media_router::MediaRouterEnabled(browser_context_)) { 27844 menu_model_.AddItemWithStringId(IDC_ROUTE_MEDIA, 27845 IDS_MEDIA_ROUTER_MENU_ITEM_TITLE); 27846 } 27847+#endif 27848 } 27849 27850 void RenderViewContextMenu::AppendRotationItems() { 27851@@ -2392,8 +2399,10 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { 27852 case IDC_CONTENT_CONTEXT_SHOWALLSAVEDPASSWORDS: 27853 return true; 27854 27855+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27856 case IDC_ROUTE_MEDIA: 27857 return IsRouteMediaEnabled(); 27858+#endif 27859 27860 case IDC_CONTENT_CONTEXT_EXIT_FULLSCREEN: 27861 return true; 27862@@ -2653,9 +2662,11 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) { 27863 ExecPrint(); 27864 break; 27865 27866+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27867 case IDC_ROUTE_MEDIA: 27868 ExecRouteMedia(); 27869 break; 27870+#endif 27871 27872 case IDC_CONTENT_CONTEXT_EXIT_FULLSCREEN: 27873 ExecExitFullscreen(); 27874@@ -3152,6 +3163,7 @@ RenderViewContextMenu::CreateDataEndpoint(bool notify_if_restricted) const { 27875 return nullptr; 27876 } 27877 27878+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27879 bool RenderViewContextMenu::IsRouteMediaEnabled() const { 27880 if (!media_router::MediaRouterEnabled(browser_context_)) 27881 return false; 27882@@ -3173,6 +3185,7 @@ bool RenderViewContextMenu::IsRouteMediaEnabled() const { 27883 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents); 27884 return !manager || !manager->IsDialogActive(); 27885 } 27886+#endif 27887 27888 bool RenderViewContextMenu::IsOpenLinkOTREnabled() const { 27889 if (browser_context_->IsOffTheRecord() || !params_.link_url.is_valid()) 27890@@ -3492,6 +3505,7 @@ void RenderViewContextMenu::ExecPrint() { 27891 #endif // BUILDFLAG(ENABLE_PRINTING) 27892 } 27893 27894+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27895 void RenderViewContextMenu::ExecRouteMedia() { 27896 media_router::MediaRouterDialogController* dialog_controller = 27897 media_router::MediaRouterDialogController::GetOrCreateForWebContents( 27898@@ -3504,6 +3518,7 @@ void RenderViewContextMenu::ExecRouteMedia() { 27899 media_router::MediaRouterMetrics::RecordMediaRouterDialogOrigin( 27900 media_router::MediaRouterDialogOpenOrigin::CONTEXTUAL_MENU); 27901 } 27902+#endif 27903 27904 void RenderViewContextMenu::ExecTranslate() { 27905 ChromeTranslateClient* chrome_translate_client = 27906diff --git a/src/chrome/browser/renderer_context_menu/render_view_context_menu.h b/src/chrome/browser/renderer_context_menu/render_view_context_menu.h 27907index c97a1ecb08579..ff70715bdfa69 27908--- a/src/chrome/browser/renderer_context_menu/render_view_context_menu.h 27909+++ b/src/chrome/browser/renderer_context_menu/render_view_context_menu.h 27910@@ -43,6 +43,10 @@ 27911 #include "chrome/browser/extensions/menu_manager.h" 27912 #endif 27913 27914+#if BUILDFLAG(IS_OHOS) 27915+#include "media/media_buildflags.h" 27916+#endif 27917+ 27918 class AccessibilityLabelsMenuObserver; 27919 class ClickToCallContextMenuObserver; 27920 class LinkToTextMenuObserver; 27921@@ -265,7 +269,9 @@ class RenderViewContextMenu 27922 bool IsPasteAndMatchStyleEnabled() const; 27923 bool IsPrintPreviewEnabled() const; 27924 bool IsQRCodeGeneratorEnabled() const; 27925+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27926 bool IsRouteMediaEnabled() const; 27927+#endif 27928 bool IsOpenLinkOTREnabled() const; 27929 bool IsSearchWebForEnabled() const; 27930 bool IsRegionSearchEnabled() const; 27931@@ -295,7 +301,9 @@ class RenderViewContextMenu 27932 void ExecReloadPackagedApp(); 27933 void ExecRestartPackagedApp(); 27934 void ExecPrint(); 27935+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 27936 void ExecRouteMedia(); 27937+#endif 27938 void ExecTranslate(); 27939 void ExecLanguageSettings(int event_flags); 27940 void ExecProtocolHandlerSettings(int event_flags); 27941diff --git a/src/chrome/browser/renderer_preferences_util.cc b/src/chrome/browser/renderer_preferences_util.cc 27942index 0162bd7c17b75..1443ff32fe341 27943--- a/src/chrome/browser/renderer_preferences_util.cc 27944+++ b/src/chrome/browser/renderer_preferences_util.cc 27945@@ -189,7 +189,7 @@ void UpdateFromSystemSettings(blink::RendererPreferences* prefs, 27946 #endif 27947 27948 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || \ 27949- BUILDFLAG(IS_WIN) 27950+ BUILDFLAG(IS_WIN) || BUILDFLAG(IS_OHOS) 27951 content::UpdateFontRendererPreferencesFromSystemSettings(prefs); 27952 #endif 27953 27954diff --git a/src/chrome/browser/resources_integrity.cc b/src/chrome/browser/resources_integrity.cc 27955index 8120999d71990..4d85649e98cd4 27956--- a/src/chrome/browser/resources_integrity.cc 27957+++ b/src/chrome/browser/resources_integrity.cc 27958@@ -28,6 +28,10 @@ 27959 #include "chrome/app/packed_resources_integrity.h" // nogncheck 27960 #endif 27961 27962+#if BUILDFLAG(IS_OHOS) 27963+#include "ui/base/buildflags.h" 27964+#endif 27965+ 27966 namespace { 27967 27968 bool CheckResourceIntegrityInternal( 27969@@ -109,8 +113,10 @@ void CheckPakFileIntegrity() { 27970 kSha256_resources_pak; 27971 base::span<const uint8_t, crypto::kSHA256Length> chrome_100_hash = 27972 kSha256_chrome_100_percent_pak; 27973+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_HIDPI) 27974 base::span<const uint8_t, crypto::kSHA256Length> chrome_200_hash = 27975 kSha256_chrome_200_percent_pak; 27976+#endif 27977 #endif // BUILDFLAG(IS_WIN) 27978 27979 scoped_refptr<base::SequencedTaskRunner> task_runner = 27980@@ -126,9 +132,11 @@ void CheckPakFileIntegrity() { 27981 chrome_100_hash, task_runner, 27982 base::BindOnce(&ReportPakIntegrity, 27983 "SafeBrowsing.PakIntegrity.Chrome100")); 27984+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_HIDPI) 27985 CheckResourceIntegrity( 27986 resources_pack_path.DirName().AppendASCII("chrome_200_percent.pak"), 27987 chrome_200_hash, task_runner, 27988 base::BindOnce(&ReportPakIntegrity, 27989 "SafeBrowsing.PakIntegrity.Chrome200")); 27990+#endif 27991 } 27992diff --git a/src/chrome/browser/sharing_hub/sharing_hub_model.cc b/src/chrome/browser/sharing_hub/sharing_hub_model.cc 27993index 3e116f24acc80..c3b3359d72874 27994--- a/src/chrome/browser/sharing_hub/sharing_hub_model.cc 27995+++ b/src/chrome/browser/sharing_hub/sharing_hub_model.cc 27996@@ -180,6 +180,7 @@ void SharingHubModel::PopulateFirstPartyActions() { 27997 &kQrcodeGeneratorIcon, true, gfx::ImageSkia(), 27998 "SharingHubDesktop.QRCodeSelected"}); 27999 28000+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 28001 if (media_router::MediaRouterEnabled(context_)) { 28002 first_party_action_list_.push_back( 28003 {IDC_ROUTE_MEDIA, 28004@@ -187,6 +188,7 @@ void SharingHubModel::PopulateFirstPartyActions() { 28005 &vector_icons::kMediaRouterIdleIcon, true, gfx::ImageSkia(), 28006 "SharingHubDesktop.CastSelected"}); 28007 } 28008+#endif 28009 28010 first_party_action_list_.push_back( 28011 {IDC_SAVE_PAGE, 28012diff --git a/src/chrome/browser/speech/speech_recognition_client_browser_interface.cc b/src/chrome/browser/speech/speech_recognition_client_browser_interface.cc 28013index ad3c36877ac38..5f038360aa0d5 28014--- a/src/chrome/browser/speech/speech_recognition_client_browser_interface.cc 28015+++ b/src/chrome/browser/speech/speech_recognition_client_browser_interface.cc 28016@@ -6,6 +6,7 @@ 28017 28018 #include <memory> 28019 28020+#include "base/feature_list.h" 28021 #include "chrome/browser/profiles/profile.h" 28022 #include "components/live_caption/pref_names.h" 28023 #include "components/prefs/pref_change_registrar.h" 28024@@ -60,6 +61,10 @@ void SpeechRecognitionClientBrowserInterface:: 28025 28026 void SpeechRecognitionClientBrowserInterface::OnSodaInstalled() { 28027 NotifyObservers(profile_prefs_->GetBoolean(prefs::kLiveCaptionEnabled)); 28028+ 28029+ if (base::FeatureList::IsEnabled(media::kLiveCaptionMultiLanguage)) { 28030+ OnSpeechRecognitionLanguageChanged(); 28031+ } 28032 } 28033 28034 void SpeechRecognitionClientBrowserInterface:: 28035diff --git a/src/chrome/browser/speech/speech_recognition_service_browsertest.cc b/src/chrome/browser/speech/speech_recognition_service_browsertest.cc 28036index 98e0bb8fa321f..b1b2c7bf2887c 28037--- a/src/chrome/browser/speech/speech_recognition_service_browsertest.cc 28038+++ b/src/chrome/browser/speech/speech_recognition_service_browsertest.cc 28039@@ -5,11 +5,13 @@ 28040 #include <algorithm> 28041 28042 #include "base/files/file_util.h" 28043+#include "base/files/scoped_temp_dir.h" 28044 #include "base/notreached.h" 28045 #include "base/path_service.h" 28046 #include "base/sync_socket.h" 28047 #include "base/test/metrics/histogram_tester.h" 28048 #include "base/test/scoped_feature_list.h" 28049+#include "base/threading/thread_restrictions.h" 28050 #include "base/timer/timer.h" 28051 #include "build/build_config.h" 28052 #include "chrome/browser/browser_process.h" 28053@@ -264,7 +266,7 @@ void SpeechRecognitionServiceTest::LaunchService() { 28054 speech_recognition_client_receiver_.BindNewPipeAndPassRemote(), 28055 media::mojom::SpeechRecognitionOptions::New( 28056 media::mojom::SpeechRecognitionMode::kCaption, 28057- /*enable_formatting=*/true, "en-US"), 28058+ /*enable_formatting=*/true, kUsEnglishLocale), 28059 base::BindOnce( 28060 [](bool* p_is_multichannel_supported, base::RunLoop* run_loop, 28061 bool is_multichannel_supported) { 28062@@ -296,7 +298,7 @@ void SpeechRecognitionServiceTest::LaunchServiceWithAudioSourceFetcher() { 28063 speech_recognition_client_receiver_.BindNewPipeAndPassRemote(), 28064 media::mojom::SpeechRecognitionOptions::New( 28065 media::mojom::SpeechRecognitionMode::kIme, 28066- /*enable_formatting=*/false, "en-US"), 28067+ /*enable_formatting=*/false, kUsEnglishLocale), 28068 base::BindOnce( 28069 [](bool* p_is_multichannel_supported, base::RunLoop* run_loop, 28070 bool is_multichannel_supported) { 28071@@ -502,4 +504,51 @@ IN_PROC_BROWSER_TEST_F(SpeechRecognitionServiceTest, CreateAudioSourceFetcher) { 28072 base::RunLoop().RunUntilIdle(); 28073 } 28074 28075+IN_PROC_BROWSER_TEST_F(SpeechRecognitionServiceTest, CompromisedRenderer) { 28076+ // Create temporary SODA files. 28077+ SetUpPrefs(); 28078+ base::ScopedAllowBlockingForTesting allow_blocking; 28079+ base::FilePath config_dir = 28080+ GetSodaLanguagePacksDirectory() 28081+ .AppendASCII(kUsEnglishLocale) 28082+ .Append("1.1.1") 28083+ .Append(kSodaLanguagePackDirectoryRelativePath); 28084+ base::CreateDirectory(config_dir); 28085+ ASSERT_TRUE(base::PathExists(config_dir)); 28086+ base::FilePath config_file_path = config_dir.Append("config_file"); 28087+ ASSERT_EQ(base::WriteFile(config_file_path, nullptr, 0), 0); 28088+ ASSERT_TRUE(base::PathExists(config_file_path)); 28089+ g_browser_process->local_state()->SetFilePath(prefs::kSodaEnUsConfigPath, 28090+ config_file_path); 28091+ 28092+ // Launch the Speech Recognition service. 28093+ auto* browser_context = 28094+ static_cast<content::BrowserContext*>(browser()->profile()); 28095+ auto* service = new ChromeSpeechRecognitionService(browser_context); 28096+ service->BindSpeechRecognitionContext( 28097+ speech_recognition_context_.BindNewPipeAndPassReceiver()); 28098+ 28099+ // Bind the recognizer pipes used to send audio and receive results. 28100+ auto run_loop = std::make_unique<base::RunLoop>(); 28101+ speech_recognition_context_->BindRecognizer( 28102+ speech_recognition_recognizer_.BindNewPipeAndPassReceiver(), 28103+ speech_recognition_client_receiver_.BindNewPipeAndPassRemote(), 28104+ media::mojom::SpeechRecognitionOptions::New( 28105+ media::mojom::SpeechRecognitionMode::kCaption, 28106+ /*enable_formatting=*/true, kUsEnglishLocale, 28107+ /*is_server_based=*/false, 28108+ media::mojom::RecognizerClientType::kLiveCaption), 28109+ base::BindOnce([](base::RunLoop* run_loop, 28110+ bool is_multichannel_supported) { run_loop->Quit(); }, 28111+ run_loop.get())); 28112+ run_loop->Run(); 28113+ 28114+ // Simulate a compromised renderer by changing the language and immediately 28115+ // resetting the recognizer and verify that the subsequent callbacks do not 28116+ // cause any crashes. 28117+ speech_recognition_recognizer_->OnLanguageChanged(kUsEnglishLocale); 28118+ speech_recognition_recognizer_.reset(); 28119+ base::RunLoop().RunUntilIdle(); 28120+} 28121+ 28122 } // namespace speech 28123diff --git a/src/chrome/browser/sync/test/integration/sync_integration_tests_sources.gni b/src/chrome/browser/sync/test/integration/sync_integration_tests_sources.gni 28124index 2133f32e032f0..87adf4f305c40 28125--- a/src/chrome/browser/sync/test/integration/sync_integration_tests_sources.gni 28126+++ b/src/chrome/browser/sync/test/integration/sync_integration_tests_sources.gni 28127@@ -14,7 +14,7 @@ sync_integration_tests_sources = [ 28128 "../browser/sync/test/integration/sync_exponential_backoff_test.cc", 28129 ] 28130 28131-if (!is_android) { 28132+if (!is_android && !is_ohos) { 28133 sync_integration_tests_sources += [ 28134 "../browser/sync/test/integration/enable_disable_test.cc", 28135 "../browser/sync/test/integration/local_sync_test.cc", 28136diff --git a/src/chrome/browser/ui/BUILD.gn b/src/chrome/browser/ui/BUILD.gn 28137index b16204919dd3e..ed82927f6ed13 28138--- a/src/chrome/browser/ui/BUILD.gn 28139+++ b/src/chrome/browser/ui/BUILD.gn 28140@@ -667,6 +667,14 @@ static_library("ui") { 28141 "//v8:v8_version", 28142 ] 28143 28144+ if (is_ohos && !ohos_enable_media_router) { 28145+ deps -= [ 28146+ "//chrome/browser/media/router:media_router_feature", 28147+ "//chrome/browser/media/router/discovery/access_code:access_code_cast_feature", 28148+ "//chrome/browser/media/router/discovery/access_code:discovery_resources_proto", 28149+ ] 28150+ } 28151+ 28152 if (is_ohos && safe_browsing_mode == 0) { 28153 deps -= 28154 [ "//components/safe_browsing/content/browser:client_side_detection" ] 28155@@ -1690,6 +1698,80 @@ static_library("ui") { 28156 ] 28157 } 28158 28159+ if (is_ohos && !ohos_enable_media_router) { 28160+ sources -= [ 28161+ "media_router/cast_dialog_controller.h", 28162+ "media_router/cast_dialog_model.cc", 28163+ "media_router/cast_dialog_model.h", 28164+ "media_router/cast_modes_with_media_sources.cc", 28165+ "media_router/cast_modes_with_media_sources.h", 28166+ "media_router/cloud_services_dialog.h", 28167+ "media_router/media_cast_mode.cc", 28168+ "media_router/media_cast_mode.h", 28169+ "media_router/media_router_ui.cc", 28170+ "media_router/media_router_ui.h", 28171+ "media_router/media_router_ui_helper.cc", 28172+ "media_router/media_router_ui_helper.h", 28173+ "media_router/media_router_ui_service.cc", 28174+ "media_router/media_router_ui_service.h", 28175+ "media_router/media_router_ui_service_factory.cc", 28176+ "media_router/media_router_ui_service_factory.h", 28177+ "media_router/media_sink_with_cast_modes.cc", 28178+ "media_router/media_sink_with_cast_modes.h", 28179+ "media_router/presentation_receiver_window.h", 28180+ "media_router/presentation_receiver_window_controller.cc", 28181+ "media_router/presentation_receiver_window_controller.h", 28182+ "media_router/presentation_receiver_window_delegate.h", 28183+ "media_router/query_result_manager.cc", 28184+ "media_router/query_result_manager.h", 28185+ "media_router/ui_media_sink.cc", 28186+ "media_router/ui_media_sink.h", 28187+ "toolbar/media_router_action_controller.cc", 28188+ "toolbar/media_router_action_controller.h", 28189+ "toolbar/media_router_contextual_menu.cc", 28190+ "toolbar/media_router_contextual_menu.h", 28191+ "webui/access_code_cast/access_code_cast_handler.cc", 28192+ "webui/access_code_cast/access_code_cast_handler.h", 28193+ "webui/access_code_cast/access_code_cast_ui.cc", 28194+ "webui/access_code_cast/access_code_cast_ui.h", 28195+ "webui/media_router/media_router_internals_ui.cc", 28196+ "webui/media_router/media_router_internals_ui.h", 28197+ "webui/media_router/media_router_internals_webui_message_handler.cc", 28198+ "webui/media_router/media_router_internals_webui_message_handler.h", 28199+ "webui/media_router/web_contents_display_observer.h", 28200+ ] 28201+ } 28202+ 28203+ if (is_ohos) { 28204+ sources -= [ 28205+ "global_media_controls/cast_media_notification_item.cc", 28206+ "global_media_controls/cast_media_notification_item.h", 28207+ "global_media_controls/cast_media_notification_producer.cc", 28208+ "global_media_controls/cast_media_notification_producer.h", 28209+ "global_media_controls/cast_media_session_controller.cc", 28210+ "global_media_controls/cast_media_session_controller.h", 28211+ "global_media_controls/media_item_ui_device_selector_delegate.h", 28212+ "global_media_controls/media_notification_device_monitor.cc", 28213+ "global_media_controls/media_notification_device_monitor.h", 28214+ "global_media_controls/media_notification_device_provider.h", 28215+ "global_media_controls/media_notification_device_provider_impl.cc", 28216+ "global_media_controls/media_notification_device_provider_impl.h", 28217+ "global_media_controls/media_notification_service.cc", 28218+ "global_media_controls/media_notification_service.h", 28219+ "global_media_controls/media_notification_service_factory.cc", 28220+ "global_media_controls/media_notification_service_factory.h", 28221+ "global_media_controls/media_toolbar_button_controller.cc", 28222+ "global_media_controls/media_toolbar_button_controller.h", 28223+ "global_media_controls/media_toolbar_button_controller_delegate.cc", 28224+ "global_media_controls/media_toolbar_button_controller_delegate.h", 28225+ "global_media_controls/media_toolbar_button_observer.h", 28226+ "global_media_controls/presentation_request_notification_item.cc", 28227+ "global_media_controls/presentation_request_notification_item.h", 28228+ "global_media_controls/presentation_request_notification_producer.cc", 28229+ "global_media_controls/presentation_request_notification_producer.h", 28230+ ] 28231+ } 28232+ 28233 deps += [ 28234 "//base", 28235 "//build:chromeos_buildflags", 28236@@ -1770,6 +1852,16 @@ static_library("ui") { 28237 28238 allow_circular_includes_from += [ "//chrome/browser/media/router" ] 28239 28240+ if (is_ohos && !ohos_enable_media_router) { 28241+ deps -= [ 28242+ "//chrome/browser/media/router", 28243+ "//chrome/browser/media/router/discovery:discovery", 28244+ "//chrome/browser/ui/webui/access_code_cast:mojo_bindings", 28245+ "//components/media_router/common/mojom:media_router", 28246+ ] 28247+ allow_circular_includes_from -= [ "//chrome/browser/media/router" ] 28248+ } 28249+ 28250 if (use_ozone && !is_chromeos_ash) { 28251 deps += [ 28252 "//ui/base:features", 28253@@ -4156,6 +4248,8 @@ static_library("ui") { 28254 "views/extensions/extensions_toolbar_container.h", 28255 "views/extensions/extensions_toolbar_controls.cc", 28256 "views/extensions/extensions_toolbar_controls.h", 28257+ "views/file_system_access/file_system_access_dangerous_file_dialog_view.cc", 28258+ "views/file_system_access/file_system_access_dangerous_file_dialog_view.h", 28259 "views/file_system_access/file_system_access_icon_view.cc", 28260 "views/file_system_access/file_system_access_icon_view.h", 28261 "views/file_system_access/file_system_access_permission_view.cc", 28262@@ -4860,6 +4954,58 @@ static_library("ui") { 28263 28264 allow_circular_includes_from += [ "//chrome/browser/ui/views" ] 28265 28266+ if (is_ohos && !ohos_enable_media_router) { 28267+ sources -= [ 28268+ "views/media_router/cast_dialog_access_code_cast_button.cc", 28269+ "views/media_router/cast_dialog_access_code_cast_button.h", 28270+ "views/media_router/cast_dialog_helper.cc", 28271+ "views/media_router/cast_dialog_helper.h", 28272+ "views/media_router/cast_dialog_metrics.cc", 28273+ "views/media_router/cast_dialog_metrics.h", 28274+ "views/media_router/cast_dialog_no_sinks_view.cc", 28275+ "views/media_router/cast_dialog_no_sinks_view.h", 28276+ "views/media_router/cast_dialog_sink_button.cc", 28277+ "views/media_router/cast_dialog_sink_button.h", 28278+ "views/media_router/cast_dialog_view.cc", 28279+ "views/media_router/cast_dialog_view.h", 28280+ "views/media_router/cast_toolbar_button.cc", 28281+ "views/media_router/cast_toolbar_button.h", 28282+ "views/media_router/media_remoting_dialog_view.cc", 28283+ "views/media_router/media_remoting_dialog_view.h", 28284+ "views/media_router/media_router_dialog_controller_views.cc", 28285+ "views/media_router/media_router_dialog_controller_views.h", 28286+ "views/media_router/presentation_receiver_window_factory.cc", 28287+ "views/media_router/presentation_receiver_window_frame.cc", 28288+ "views/media_router/presentation_receiver_window_frame.h", 28289+ "views/media_router/presentation_receiver_window_view.cc", 28290+ "views/media_router/presentation_receiver_window_view.h", 28291+ "views/media_router/web_contents_display_observer_view.cc", 28292+ "views/media_router/web_contents_display_observer_view.h", 28293+ ] 28294+ } 28295+ 28296+ if (is_ohos) { 28297+ sources -= [ 28298+ "views/global_media_controls/media_dialog_view.cc", 28299+ "views/global_media_controls/media_dialog_view.h", 28300+ "views/global_media_controls/media_dialog_view_observer.h", 28301+ "views/global_media_controls/media_item_ui_device_selector_observer.h", 28302+ "views/global_media_controls/media_item_ui_device_selector_view.cc", 28303+ "views/global_media_controls/media_item_ui_device_selector_view.h", 28304+ "views/global_media_controls/media_item_ui_footer_view.cc", 28305+ "views/global_media_controls/media_item_ui_footer_view.h", 28306+ "views/global_media_controls/media_item_ui_legacy_cast_footer_view.cc", 28307+ "views/global_media_controls/media_item_ui_legacy_cast_footer_view.h", 28308+ "views/global_media_controls/media_notification_device_entry_ui.cc", 28309+ "views/global_media_controls/media_notification_device_entry_ui.h", 28310+ "views/global_media_controls/media_toolbar_button_contextual_menu.cc", 28311+ "views/global_media_controls/media_toolbar_button_contextual_menu.h", 28312+ "views/global_media_controls/media_toolbar_button_view.cc", 28313+ "views/global_media_controls/media_toolbar_button_view.h", 28314+ ] 28315+ deps -= [ "//components/global_media_controls" ] 28316+ } 28317+ 28318 if (is_linux || is_chromeos_lacros || is_ohos) { 28319 sources += [ 28320 "views/chrome_views_delegate_linux.cc", 28321@@ -5116,8 +5262,6 @@ static_library("ui") { 28322 "extensions/extension_message_bubble_bridge.h", 28323 "extensions/extension_message_bubble_factory.cc", 28324 "extensions/extension_message_bubble_factory.h", 28325- "extensions/extension_removal_watcher.cc", 28326- "extensions/extension_removal_watcher.h", 28327 "extensions/extension_settings_overridden_dialog.cc", 28328 "extensions/extension_settings_overridden_dialog.h", 28329 "extensions/extensions_container.h", 28330@@ -5479,7 +5623,7 @@ static_library("test_support") { 28331 } 28332 } 28333 28334- if (!is_android) { 28335+ if (!is_android && !is_ohos) { 28336 sources += [ 28337 "exclusive_access/exclusive_access_test.cc", 28338 "exclusive_access/exclusive_access_test.h", 28339diff --git a/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc b/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc 28340index 1beca9af2ca1f..049a85ab09a53 28341--- a/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc 28342+++ b/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.cc 28343@@ -19,6 +19,7 @@ 28344 #include "chrome/browser/ssl/security_state_tab_helper.h" 28345 #include "chrome/browser/vr/vr_tab_helper.h" 28346 #include "chrome/common/url_constants.h" 28347+#include "components/permissions/permission_util.h" 28348 #include "components/security_state/core/security_state.h" 28349 #include "components/url_formatter/elide_url.h" 28350 #include "content/public/browser/render_frame_host.h" 28351@@ -27,11 +28,44 @@ 28352 #include "ui/android/window_android.h" 28353 #include "url/gurl.h" 28354 28355+namespace { 28356+ 28357+UsbChooserDialogAndroid::CreateJavaDialogCallback 28358+GetCreateJavaUsbChooserDialogCallback() { 28359+ return base::BindOnce(&Java_UsbChooserDialog_create); 28360+} 28361+ 28362+} // namespace 28363+ 28364 // static 28365 std::unique_ptr<UsbChooserDialogAndroid> UsbChooserDialogAndroid::Create( 28366 content::RenderFrameHost* render_frame_host, 28367 std::unique_ptr<permissions::ChooserController> controller, 28368 base::OnceClosure on_close) { 28369+ return CreateInternal(render_frame_host, std::move(controller), 28370+ std::move(on_close), 28371+ GetCreateJavaUsbChooserDialogCallback()); 28372+} 28373+ 28374+// static 28375+std::unique_ptr<UsbChooserDialogAndroid> 28376+UsbChooserDialogAndroid::CreateForTesting( 28377+ content::RenderFrameHost* render_frame_host, 28378+ std::unique_ptr<permissions::ChooserController> controller, 28379+ base::OnceClosure on_close, 28380+ CreateJavaDialogCallback create_java_dialog_callback) { 28381+ return CreateInternal(render_frame_host, std::move(controller), 28382+ std::move(on_close), 28383+ std::move(create_java_dialog_callback)); 28384+} 28385+ 28386+// static 28387+std::unique_ptr<UsbChooserDialogAndroid> 28388+UsbChooserDialogAndroid::CreateInternal( 28389+ content::RenderFrameHost* render_frame_host, 28390+ std::unique_ptr<permissions::ChooserController> controller, 28391+ base::OnceClosure on_close, 28392+ CreateJavaDialogCallback create_java_dialog_callback) { 28393 content::WebContents* web_contents = 28394 content::WebContents::FromRenderFrameHost(render_frame_host); 28395 28396@@ -46,10 +80,14 @@ std::unique_ptr<UsbChooserDialogAndroid> UsbChooserDialogAndroid::Create( 28397 base::android::ScopedJavaLocalRef<jobject> window_android = 28398 web_contents->GetNativeView()->GetWindowAndroid()->GetJavaObject(); 28399 JNIEnv* env = base::android::AttachCurrentThread(); 28400+ // Permission delegation means the permission request should be 28401+ // attributed to the main frame. 28402+ const auto origin = url::Origin::Create( 28403+ permissions::PermissionUtil::GetLastCommittedOriginAsURL( 28404+ render_frame_host->GetMainFrame())); 28405 base::android::ScopedJavaLocalRef<jstring> origin_string = 28406 base::android::ConvertUTF16ToJavaString( 28407- env, url_formatter::FormatOriginForSecurityDisplay( 28408- render_frame_host->GetLastCommittedOrigin())); 28409+ env, url_formatter::FormatOriginForSecurityDisplay(origin)); 28410 SecurityStateTabHelper* helper = 28411 SecurityStateTabHelper::FromWebContents(web_contents); 28412 DCHECK(helper); 28413@@ -64,9 +102,11 @@ std::unique_ptr<UsbChooserDialogAndroid> UsbChooserDialogAndroid::Create( 28414 28415 auto dialog = std::make_unique<UsbChooserDialogAndroid>(std::move(controller), 28416 std::move(on_close)); 28417- dialog->java_dialog_.Reset(Java_UsbChooserDialog_create( 28418- env, window_android, origin_string, helper->GetSecurityLevel(), 28419- j_profile_android, reinterpret_cast<intptr_t>(dialog.get()))); 28420+ 28421+ dialog->java_dialog_.Reset( 28422+ std::move(create_java_dialog_callback) 28423+ .Run(env, window_android, origin_string, helper->GetSecurityLevel(), 28424+ j_profile_android, reinterpret_cast<intptr_t>(dialog.get()))); 28425 if (dialog->java_dialog_.is_null()) 28426 return nullptr; 28427 28428diff --git a/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h b/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h 28429index a76c71f651c19..d2aa1f641f7be 28430--- a/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h 28431+++ b/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h 28432@@ -9,6 +9,9 @@ 28433 #include <string> 28434 #include <vector> 28435 28436+#include "base/android/jni_android.h" 28437+#include "base/android/jni_int_wrapper.h" 28438+#include "base/android/jni_string.h" 28439 #include "base/android/scoped_java_ref.h" 28440 #include "base/callback.h" 28441 #include "components/permissions/chooser_controller.h" 28442@@ -21,6 +24,16 @@ class RenderFrameHost; 28443 // options. 28444 class UsbChooserDialogAndroid : public permissions::ChooserController::View { 28445 public: 28446+ // The callback type for creating the java dialog object. 28447+ using CreateJavaDialogCallback = 28448+ base::OnceCallback<base::android::ScopedJavaLocalRef<jobject>( 28449+ JNIEnv*, 28450+ const base::android::JavaRef<jobject>&, 28451+ const base::android::JavaRef<jstring>&, 28452+ JniIntWrapper, 28453+ const base::android::JavaRef<jobject>&, 28454+ jlong)>; 28455+ 28456 // Creates and shows the dialog. Will return nullptr if the dialog was not 28457 // displayed. Otherwise |on_close| will be called when the user closes the 28458 // dialog. 28459@@ -29,6 +42,13 @@ class UsbChooserDialogAndroid : public permissions::ChooserController::View { 28460 std::unique_ptr<permissions::ChooserController> controller, 28461 base::OnceClosure on_close); 28462 28463+ static std::unique_ptr<UsbChooserDialogAndroid> CreateForTesting( 28464+ content::RenderFrameHost* render_frame_host, 28465+ std::unique_ptr<permissions::ChooserController> controller, 28466+ base::OnceClosure on_close, 28467+ UsbChooserDialogAndroid::CreateJavaDialogCallback 28468+ create_java_dialog_callback); 28469+ 28470 explicit UsbChooserDialogAndroid( 28471 std::unique_ptr<permissions::ChooserController> controller, 28472 base::OnceClosure on_close); 28473@@ -56,6 +76,13 @@ class UsbChooserDialogAndroid : public permissions::ChooserController::View { 28474 // Called when the chooser dialog is closed. 28475 void Cancel(); 28476 28477+ static std::unique_ptr<UsbChooserDialogAndroid> CreateInternal( 28478+ content::RenderFrameHost* render_frame_host, 28479+ std::unique_ptr<permissions::ChooserController> controller, 28480+ base::OnceClosure on_close, 28481+ UsbChooserDialogAndroid::CreateJavaDialogCallback 28482+ create_java_dialog_callback); 28483+ 28484 std::unique_ptr<permissions::ChooserController> controller_; 28485 base::OnceClosure on_close_; 28486 28487diff --git a/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc b/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc 28488new file mode 100644 28489index 0000000000000..c7aed7a2b370a 28490--- /dev/null 28491+++ b/src/chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc 28492@@ -0,0 +1,63 @@ 28493+// Copyright 2022 The Chromium Authors 28494+// Use of this source code is governed by a BSD-style license that can be 28495+// found in the LICENSE file. 28496+ 28497+#include "chrome/browser/ui/android/device_dialog/usb_chooser_dialog_android.h" 28498+ 28499+#include <string> 28500+ 28501+#include "base/test/bind.h" 28502+#include "base/test/mock_callback.h" 28503+#include "chrome/browser/ssl/security_state_tab_helper.h" 28504+#include "chrome/browser/usb/usb_chooser_controller.h" 28505+#include "chrome/test/base/chrome_render_view_host_test_harness.h" 28506+#include "content/public/browser/web_contents.h" 28507+#include "content/public/test/navigation_simulator.h" 28508+#include "services/device/public/mojom/usb_enumeration_options.mojom.h" 28509+#include "testing/gmock/include/gmock/gmock.h" 28510+#include "testing/gtest/include/gtest/gtest.h" 28511+#include "ui/android/window_android.h" 28512+ 28513+namespace { 28514+ 28515+using UsbChooserDialogAndroidTest = ChromeRenderViewHostTestHarness; 28516+using testing::_; 28517+ 28518+TEST_F(UsbChooserDialogAndroidTest, FrameTree) { 28519+ NavigateAndCommit(GURL("https://main-frame.com")); 28520+ content::RenderFrameHost* subframe = 28521+ content::NavigationSimulator::NavigateAndCommitFromDocument( 28522+ GURL("https://sub-frame.com"), 28523+ content::RenderFrameHostTester::For(main_rfh()) 28524+ ->AppendChild("subframe")); 28525+ 28526+ auto controller = std::make_unique<UsbChooserController>( 28527+ main_rfh(), std::vector<device::mojom::UsbDeviceFilterPtr>(), 28528+ base::BindLambdaForTesting( 28529+ [](device::mojom::UsbDeviceInfoPtr usb_device_info) {})); 28530+ 28531+ content::WebContents* web_contents = 28532+ content::WebContents::FromRenderFrameHost(main_rfh()); 28533+ std::unique_ptr<ui::WindowAndroid::ScopedWindowAndroidForTesting> window = 28534+ ui::WindowAndroid::CreateForTesting(); 28535+ window.get()->get()->AddChild(web_contents->GetNativeView()); 28536+ SecurityStateTabHelper::CreateForWebContents(web_contents); 28537+ 28538+ base::MockCallback<UsbChooserDialogAndroid::CreateJavaDialogCallback> 28539+ mock_callback; 28540+ auto origin_predicate = 28541+ [&](const base::android::JavaRef<jstring>& java_string) { 28542+ return base::android::ConvertJavaStringToUTF16( 28543+ base::android::AttachCurrentThread(), java_string) == 28544+ u"https://main-frame.com"; 28545+ }; 28546+ EXPECT_CALL(mock_callback, Run(/*env=*/_, /*window_android=*/_, 28547+ testing::Truly(origin_predicate), 28548+ /*security_level=*/_, /*profile=*/_, 28549+ /*native_usb_chooser_dialog_ptr=*/_)); 28550+ UsbChooserDialogAndroid::CreateForTesting(subframe, std::move(controller), 28551+ base::BindLambdaForTesting([]() {}), 28552+ mock_callback.Get()); 28553+} 28554+ 28555+} // namespace 28556diff --git a/src/chrome/browser/ui/browser.cc b/src/chrome/browser/ui/browser.cc 28557index f2d36a884b278..c0bfaead30043 28558--- a/src/chrome/browser/ui/browser.cc 28559+++ b/src/chrome/browser/ui/browser.cc 28560@@ -512,12 +512,14 @@ Browser::Browser(const CreateParams& params) 28561 28562 tab_strip_model_->AddObserver(this); 28563 28564+#if defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 28565 #if BUILDFLAG(ENABLE_CEF) 28566 if (cef::IsChromeRuntimeEnabled()) { 28567 cef_browser_delegate_ = 28568 cef::BrowserDelegate::Create(this, params.cef_params); 28569 } 28570 #endif 28571+#endif // defined(OHOS_ENABLE_CEF_CHROME_RUNTIME) 28572 28573 location_bar_model_ = std::make_unique<LocationBarModelImpl>( 28574 location_bar_model_delegate_.get(), content::kMaxURLDisplayChars); 28575@@ -3044,6 +3046,7 @@ bool Browser::ShouldCreateBackgroundContents( 28576 content::SiteInstance* source_site_instance, 28577 const GURL& opener_url, 28578 const std::string& frame_name) { 28579+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_BACKGROUND_CONTENTS) 28580 extensions::ExtensionSystem* extension_system = 28581 extensions::ExtensionSystem::Get(profile_); 28582 28583@@ -3076,6 +3079,9 @@ bool Browser::ShouldCreateBackgroundContents( 28584 } 28585 28586 return true; 28587+#else 28588+ return false; 28589+#endif 28590 } 28591 28592 BackgroundContents* Browser::CreateBackgroundContents( 28593@@ -3087,6 +3093,7 @@ BackgroundContents* Browser::CreateBackgroundContents( 28594 const GURL& target_url, 28595 const content::StoragePartitionId& partition_id, 28596 content::SessionStorageNamespace* session_storage_namespace) { 28597+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_BACKGROUND_CONTENTS) 28598 BackgroundContentsService* service = 28599 BackgroundContentsServiceFactory::GetForProfile(profile_); 28600 const Extension* extension = extensions::ExtensionRegistry::Get(profile_) 28601@@ -3130,4 +3137,7 @@ BackgroundContents* Browser::CreateBackgroundContents( 28602 std::string()); // No extra headers. 28603 28604 return contents; 28605+#else 28606+ return nullptr; 28607+#endif 28608 } 28609diff --git a/src/chrome/browser/ui/browser_command_controller.cc b/src/chrome/browser/ui/browser_command_controller.cc 28610index cc53da3a0b32e..914b3d8092382 28611--- a/src/chrome/browser/ui/browser_command_controller.cc 28612+++ b/src/chrome/browser/ui/browser_command_controller.cc 28613@@ -815,9 +815,11 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( 28614 case IDC_DISTILL_PAGE: 28615 ToggleDistilledView(browser_); 28616 break; 28617+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 28618 case IDC_ROUTE_MEDIA: 28619 RouteMediaInvokedFromAppMenu(browser_); 28620 break; 28621+#endif 28622 case IDC_WINDOW_MUTE_SITE: 28623 MuteSite(browser_); 28624 break; 28625@@ -1595,8 +1597,10 @@ void BrowserCommandController::UpdateCommandsForMediaRouter() { 28626 if (is_locked_fullscreen_) 28627 return; 28628 28629+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 28630 command_updater_.UpdateCommandEnabled(IDC_ROUTE_MEDIA, 28631 CanRouteMedia(browser_)); 28632+#endif 28633 } 28634 28635 void BrowserCommandController::UpdateCommandsForTabKeyboardFocus( 28636diff --git a/src/chrome/browser/ui/browser_commands.cc b/src/chrome/browser/ui/browser_commands.cc 28637index 6a314d34c2c90..4c7158dd052ec 28638--- a/src/chrome/browser/ui/browser_commands.cc 28639+++ b/src/chrome/browser/ui/browser_commands.cc 28640@@ -31,7 +31,6 @@ 28641 #include "chrome/browser/download/download_prefs.h" 28642 #include "chrome/browser/favicon/favicon_utils.h" 28643 #include "chrome/browser/lifetime/application_lifetime.h" 28644-#include "chrome/browser/media/router/media_router_feature.h" 28645 #include "chrome/browser/prefs/incognito_mode_prefs.h" 28646 #include "chrome/browser/profiles/profile.h" 28647 #include "chrome/browser/sessions/session_service.h" 28648@@ -105,8 +104,6 @@ 28649 #include "components/find_in_page/find_tab_helper.h" 28650 #include "components/find_in_page/find_types.h" 28651 #include "components/google/core/common/google_util.h" 28652-#include "components/media_router/browser/media_router_dialog_controller.h" // nogncheck 28653-#include "components/media_router/browser/media_router_metrics.h" 28654 #include "components/omnibox/browser/omnibox_prefs.h" 28655 #include "components/prefs/pref_service.h" 28656 #include "components/reading_list/core/reading_list_entry.h" 28657@@ -175,6 +172,12 @@ 28658 #include "chromeos/lacros/lacros_service.h" 28659 #endif 28660 28661+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 28662+#include "chrome/browser/media/router/media_router_feature.h" 28663+#include "components/media_router/browser/media_router_dialog_controller.h" // nogncheck 28664+#include "components/media_router/browser/media_router_metrics.h" 28665+#endif 28666+ 28667 namespace { 28668 28669 const char kOsOverrideForTabletSite[] = "Linux; Android 9; Chrome tablet"; 28670@@ -1402,13 +1405,18 @@ bool CanBasicPrint(Browser* browser) { 28671 #endif // BUILDFLAG(ENABLE_PRINTING) 28672 28673 bool CanRouteMedia(Browser* browser) { 28674+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 28675 // Do not allow user to open Media Router dialog when there is already an 28676 // active modal dialog. This avoids overlapping dialogs. 28677 return media_router::MediaRouterEnabled(browser->profile()) && 28678 !IsShowingWebContentsModalDialog(browser); 28679+#else 28680+ return false; 28681+#endif 28682 } 28683 28684 void RouteMediaInvokedFromAppMenu(Browser* browser) { 28685+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 28686 DCHECK(CanRouteMedia(browser)); 28687 28688 media_router::MediaRouterDialogController* dialog_controller = 28689@@ -1419,6 +1427,7 @@ void RouteMediaInvokedFromAppMenu(Browser* browser) { 28690 28691 dialog_controller->ShowMediaRouterDialog( 28692 media_router::MediaRouterDialogOpenOrigin::APP_MENU); 28693+#endif 28694 } 28695 28696 void CutCopyPaste(Browser* browser, int command_id) { 28697diff --git a/src/chrome/browser/ui/browser_dialogs.h b/src/chrome/browser/ui/browser_dialogs.h 28698index 4ffe538bc96f2..0811352da29f7 28699--- a/src/chrome/browser/ui/browser_dialogs.h 28700+++ b/src/chrome/browser/ui/browser_dialogs.h 28701@@ -496,7 +496,7 @@ void ShowExtensionInstallFrictionDialog( 28702 // Returns a OnceClosure that client code can call to close the device chooser. 28703 // This OnceClosure references the actual dialog as a WeakPtr, so it's safe to 28704 // call at any point. 28705-#if defined(TOOLKIT_VIEWS) 28706+#if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_OHOS) 28707 base::OnceClosure ShowDeviceChooserDialog( 28708 content::RenderFrameHost* owner, 28709 std::unique_ptr<permissions::ChooserController> controller); 28710diff --git a/src/chrome/browser/ui/extensions/extension_installed_waiter.cc b/src/chrome/browser/ui/extensions/extension_installed_waiter.cc 28711index 6e11b9036b1d8..8d70116a9b0ed 28712--- a/src/chrome/browser/ui/extensions/extension_installed_waiter.cc 28713+++ b/src/chrome/browser/ui/extensions/extension_installed_waiter.cc 28714@@ -40,15 +40,13 @@ ExtensionInstalledWaiter::ExtensionInstalledWaiter( 28715 done_callback_(std::move(done_callback)) { 28716 extension_registry_observation_.Observe( 28717 extensions::ExtensionRegistry::Get(browser->profile())); 28718- removal_watcher_ = std::make_unique<ExtensionRemovalWatcher>( 28719- browser, extension, 28720- base::BindOnce(&ExtensionInstalledWaiter::OnExtensionRemoved, 28721- weak_factory_.GetWeakPtr())); 28722+ BrowserList::AddObserver(this); 28723 } 28724 28725 ExtensionInstalledWaiter::~ExtensionInstalledWaiter() { 28726 if (done_callback_ && g_giving_up_callback) 28727 g_giving_up_callback->Run(); 28728+ BrowserList::RemoveObserver(this); 28729 } 28730 28731 void ExtensionInstalledWaiter::RunCallbackIfExtensionInstalled() { 28732@@ -79,6 +77,15 @@ void ExtensionInstalledWaiter::OnExtensionLoaded( 28733 weak_factory_.GetWeakPtr())); 28734 } 28735 28736-void ExtensionInstalledWaiter::OnExtensionRemoved() { 28737- delete this; 28738+void ExtensionInstalledWaiter::OnExtensionUnloaded( 28739+ content::BrowserContext* browser_context, 28740+ const extensions::Extension* extension, 28741+ extensions::UnloadedExtensionReason reason) { 28742+ if (extension == extension_.get()) 28743+ delete this; 28744+} 28745+ 28746+void ExtensionInstalledWaiter::OnBrowserClosing(Browser* browser) { 28747+ if (browser == browser_) 28748+ delete this; 28749 } 28750diff --git a/src/chrome/browser/ui/extensions/extension_installed_waiter.h b/src/chrome/browser/ui/extensions/extension_installed_waiter.h 28751index 880c832c18451..9dbb2c88c839b 28752--- a/src/chrome/browser/ui/extensions/extension_installed_waiter.h 28753+++ b/src/chrome/browser/ui/extensions/extension_installed_waiter.h 28754@@ -9,7 +9,7 @@ 28755 #include "base/memory/raw_ptr.h" 28756 #include "base/memory/weak_ptr.h" 28757 #include "base/scoped_observation.h" 28758-#include "chrome/browser/ui/extensions/extension_removal_watcher.h" 28759+#include "chrome/browser/ui/browser_list_observer.h" 28760 #include "extensions/browser/extension_registry.h" 28761 #include "extensions/browser/extension_registry_observer.h" 28762 28763@@ -17,7 +17,8 @@ class Browser; 28764 28765 // ExtensionInstalledWaiter is used to wait for a given extension to be 28766 // installed in a given browser's profile. 28767-class ExtensionInstalledWaiter : public extensions::ExtensionRegistryObserver { 28768+class ExtensionInstalledWaiter : public extensions::ExtensionRegistryObserver, 28769+ public BrowserListObserver { 28770 public: 28771 // Wait until both: 28772 // 1. |extension| is installed into |browser| 28773@@ -57,8 +58,12 @@ class ExtensionInstalledWaiter : public extensions::ExtensionRegistryObserver { 28774 // ExtensionRegistryObserver: 28775 void OnExtensionLoaded(content::BrowserContext* browser_context, 28776 const extensions::Extension* extension) override; 28777+ void OnExtensionUnloaded(content::BrowserContext* browser_context, 28778+ const extensions::Extension* extension, 28779+ extensions::UnloadedExtensionReason reason) override; 28780 28781- void OnExtensionRemoved(); 28782+ // BrowserListObserver: 28783+ void OnBrowserClosing(Browser* browser) override; 28784 28785 const scoped_refptr<const extensions::Extension> extension_; 28786 const raw_ptr<const Browser> browser_; 28787@@ -68,8 +73,6 @@ class ExtensionInstalledWaiter : public extensions::ExtensionRegistryObserver { 28788 extensions::ExtensionRegistryObserver> 28789 extension_registry_observation_{this}; 28790 28791- std::unique_ptr<ExtensionRemovalWatcher> removal_watcher_; 28792- 28793 base::WeakPtrFactory<ExtensionInstalledWaiter> weak_factory_{this}; 28794 }; 28795 28796diff --git a/src/chrome/browser/ui/extensions/extension_removal_watcher.cc b/src/chrome/browser/ui/extensions/extension_removal_watcher.cc 28797deleted file mode 100644 28798index 4ef1045c2dce7..0000000000000 28799--- a/src/chrome/browser/ui/extensions/extension_removal_watcher.cc 28800+++ /dev/null 28801@@ -1,36 +0,0 @@ 28802-// Copyright 2019 The Chromium Authors. All rights reserved. 28803-// Use of this source code is governed by a BSD-style license that can be 28804-// found in the LICENSE file. 28805- 28806-#include "chrome/browser/ui/extensions/extension_removal_watcher.h" 28807- 28808-#include "chrome/browser/profiles/profile.h" 28809-#include "chrome/browser/ui/browser.h" 28810-#include "chrome/browser/ui/browser_list.h" 28811- 28812-ExtensionRemovalWatcher::ExtensionRemovalWatcher( 28813- Browser* browser, 28814- scoped_refptr<const extensions::Extension> extension, 28815- base::OnceClosure callback) 28816- : browser_(browser), extension_(extension), callback_(std::move(callback)) { 28817- extension_registry_observation_.Observe( 28818- extensions::ExtensionRegistry::Get(browser->profile())); 28819- BrowserList::AddObserver(this); 28820-} 28821- 28822-ExtensionRemovalWatcher::~ExtensionRemovalWatcher() { 28823- BrowserList::RemoveObserver(this); 28824-} 28825- 28826-void ExtensionRemovalWatcher::OnBrowserClosing(Browser* browser) { 28827- if (browser == browser_ && callback_) 28828- std::move(callback_).Run(); 28829-} 28830- 28831-void ExtensionRemovalWatcher::OnExtensionUnloaded( 28832- content::BrowserContext* browser_context, 28833- const extensions::Extension* extension, 28834- extensions::UnloadedExtensionReason reason) { 28835- if (extension == extension_.get() && callback_) 28836- std::move(callback_).Run(); 28837-} 28838diff --git a/src/chrome/browser/ui/extensions/extension_removal_watcher.h b/src/chrome/browser/ui/extensions/extension_removal_watcher.h 28839deleted file mode 100644 28840index 5e75053387f49..0000000000000 28841--- a/src/chrome/browser/ui/extensions/extension_removal_watcher.h 28842+++ /dev/null 28843@@ -1,46 +0,0 @@ 28844-// Copyright 2019 The Chromium Authors. All rights reserved. 28845-// Use of this source code is governed by a BSD-style license that can be 28846-// found in the LICENSE file. 28847- 28848-#ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_REMOVAL_WATCHER_H_ 28849-#define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_REMOVAL_WATCHER_H_ 28850- 28851-#include "base/callback.h" 28852-#include "base/memory/raw_ptr.h" 28853-#include "base/memory/weak_ptr.h" 28854-#include "base/scoped_observation.h" 28855-#include "chrome/browser/ui/browser_list_observer.h" 28856-#include "extensions/browser/extension_registry.h" 28857-#include "extensions/browser/extension_registry_observer.h" 28858- 28859-// ExtensionRemovalWatcher watches a browser and an extension for either: 28860-// 1) The browser being closed, or 28861-// 2) The extension being uninstalled from the browser's profile 28862-// and in either case, invokes the provided callback. 28863-class ExtensionRemovalWatcher : public BrowserListObserver, 28864- public extensions::ExtensionRegistryObserver { 28865- public: 28866- ExtensionRemovalWatcher(Browser* browser, 28867- scoped_refptr<const extensions::Extension> extension, 28868- base::OnceClosure callback); 28869- ~ExtensionRemovalWatcher() override; 28870- 28871- private: 28872- // ExtensionRegistryObserver: 28873- void OnExtensionUnloaded(content::BrowserContext* browser_context, 28874- const extensions::Extension* extension, 28875- extensions::UnloadedExtensionReason reason) override; 28876- 28877- // BrowserListObserver: 28878- void OnBrowserClosing(Browser* browser) override; 28879- 28880- raw_ptr<const Browser> browser_; 28881- const scoped_refptr<const extensions::Extension> extension_; 28882- base::OnceClosure callback_; 28883- 28884- base::ScopedObservation<extensions::ExtensionRegistry, 28885- extensions::ExtensionRegistryObserver> 28886- extension_registry_observation_{this}; 28887-}; 28888- 28889-#endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_REMOVAL_WATCHER_H_ 28890diff --git a/src/chrome/browser/ui/file_system_access_dialogs.cc b/src/chrome/browser/ui/file_system_access_dialogs.cc 28891index 195b2ba4f627f..5c42ab6e8a0fa 28892--- a/src/chrome/browser/ui/file_system_access_dialogs.cc 28893+++ b/src/chrome/browser/ui/file_system_access_dialogs.cc 28894@@ -20,14 +20,27 @@ void ShowFileSystemAccessRestrictedDirectoryDialog( 28895 const url::Origin& origin, 28896 const base::FilePath& path, 28897 content::FileSystemAccessPermissionContext::HandleType handle_type, 28898- base::OnceCallback<void( 28899- content::FileSystemAccessPermissionContext::SensitiveDirectoryResult)> 28900+ base::OnceCallback< 28901+ void(content::FileSystemAccessPermissionContext::SensitiveEntryResult)> 28902 callback, 28903 content::WebContents* web_contents) { 28904 // There's no dialog version of this available outside views, run callback as 28905 // if the dialog was instantly dismissed. 28906- std::move(callback).Run(content::FileSystemAccessPermissionContext:: 28907- SensitiveDirectoryResult::kAbort); 28908+ std::move(callback).Run( 28909+ content::FileSystemAccessPermissionContext::SensitiveEntryResult::kAbort); 28910+} 28911+ 28912+void ShowFileSystemAccessDangerousFileDialog( 28913+ const url::Origin& origin, 28914+ const base::FilePath& path, 28915+ base::OnceCallback< 28916+ void(content::FileSystemAccessPermissionContext::SensitiveEntryResult)> 28917+ callback, 28918+ content::WebContents* web_contents) { 28919+ // There's no dialog version of this available outside views, run callback as 28920+ // if the dialog was instantly dismissed. 28921+ std::move(callback).Run( 28922+ content::FileSystemAccessPermissionContext::SensitiveEntryResult::kAbort); 28923 } 28924 28925 #endif // !defined(TOOLKIT_VIEWS) 28926diff --git a/src/chrome/browser/ui/file_system_access_dialogs.h b/src/chrome/browser/ui/file_system_access_dialogs.h 28927index f7a4c7e156665..58c1cdbc8df49 28928--- a/src/chrome/browser/ui/file_system_access_dialogs.h 28929+++ b/src/chrome/browser/ui/file_system_access_dialogs.h 28930@@ -42,8 +42,19 @@ void ShowFileSystemAccessRestrictedDirectoryDialog( 28931 const url::Origin& origin, 28932 const base::FilePath& path, 28933 content::FileSystemAccessPermissionContext::HandleType handle_type, 28934- base::OnceCallback<void( 28935- content::FileSystemAccessPermissionContext::SensitiveDirectoryResult)> 28936+ base::OnceCallback< 28937+ void(content::FileSystemAccessPermissionContext::SensitiveEntryResult)> 28938+ callback, 28939+ content::WebContents* web_contents); 28940+ 28941+// Displays a dialog to explain to the user that the file at `path` has a 28942+// dangerous extension and ask whether they still want to save the file. 28943+// `callback` is called when the user has accepted or rejected the dialog. 28944+void ShowFileSystemAccessDangerousFileDialog( 28945+ const url::Origin& origin, 28946+ const base::FilePath& path, 28947+ base::OnceCallback< 28948+ void(content::FileSystemAccessPermissionContext::SensitiveEntryResult)> 28949 callback, 28950 content::WebContents* web_contents); 28951 28952diff --git a/src/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.cc b/src/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.cc 28953index ffca56c51d2d9..f8a525304e2ca 28954--- a/src/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.cc 28955+++ b/src/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.cc 28956@@ -135,13 +135,11 @@ WellKnownChangePasswordNavigationThrottle::WillProcessResponse() { 28957 // PostTask because the Throttle needs to be deferred before the status code 28958 // is set. After setting the status code Resume() can be called synchronous 28959 // and thereby before the throttle is deferred. This would result in a crash. 28960- // Unretained is safe because the NavigationThrottle is deferred and can only 28961- // be continued after the callback finished. 28962 base::SequencedTaskRunnerHandle::Get()->PostTask( 28963 FROM_HERE, 28964 base::BindOnce( 28965 &WellKnownChangePasswordState::SetChangePasswordResponseCode, 28966- base::Unretained(&well_known_change_password_state_), 28967+ weak_ptr_factory_.GetWeakPtr(), 28968 navigation_handle()->GetResponseHeaders()->response_code())); 28969 return NavigationThrottle::DEFER; 28970 } 28971diff --git a/src/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.h b/src/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.h 28972index 10817f7efee69..d5727c6c442c1 28973--- a/src/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.h 28974+++ b/src/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.h 28975@@ -66,6 +66,8 @@ class WellKnownChangePasswordNavigationThrottle 28976 well_known_change_password_state_{this}; 28977 ukm::SourceId source_id_ = ukm::kInvalidSourceId; 28978 raw_ptr<password_manager::AffiliationService> affiliation_service_ = nullptr; 28979+ base::WeakPtrFactory<password_manager::WellKnownChangePasswordState> 28980+ weak_ptr_factory_{&well_known_change_password_state_}; 28981 }; 28982 28983 #endif // CHROME_BROWSER_UI_PASSWORDS_WELL_KNOWN_CHANGE_PASSWORD_NAVIGATION_THROTTLE_H_ 28984diff --git a/src/chrome/browser/ui/toolbar/app_menu_model.cc b/src/chrome/browser/ui/toolbar/app_menu_model.cc 28985index 1ce8183547bb2..a54f7f372e53a 28986--- a/src/chrome/browser/ui/toolbar/app_menu_model.cc 28987+++ b/src/chrome/browser/ui/toolbar/app_menu_model.cc 28988@@ -60,7 +60,6 @@ 28989 #include "components/dom_distiller/content/browser/uma_helper.h" 28990 #include "components/dom_distiller/core/dom_distiller_features.h" 28991 #include "components/dom_distiller/core/url_utils.h" 28992-#include "components/media_router/browser/media_router_metrics.h" 28993 #include "components/prefs/pref_service.h" 28994 #include "components/profile_metrics/browser_profile_type.h" 28995 #include "components/signin/public/base/signin_metrics.h" 28996@@ -104,6 +103,10 @@ 28997 #include "content/public/browser/gpu_data_manager.h" 28998 #endif 28999 29000+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29001+#include "components/media_router/browser/media_router_metrics.h" 29002+#endif 29003+ 29004 using base::UserMetricsAction; 29005 using content::WebContents; 29006 29007@@ -483,6 +486,7 @@ void AppMenuModel::LogMenuMetrics(int command_id) { 29008 LogMenuAction(MENU_ACTION_PRINT); 29009 break; 29010 29011+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29012 case IDC_ROUTE_MEDIA: 29013 if (!uma_action_recorded_) 29014 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Cast", delta); 29015@@ -492,6 +496,7 @@ void AppMenuModel::LogMenuMetrics(int command_id) { 29016 media_router::MediaRouterMetrics::RecordMediaRouterDialogOrigin( 29017 media_router::MediaRouterDialogOpenOrigin::APP_MENU); 29018 break; 29019+#endif 29020 29021 // Edit menu. 29022 case IDC_CUT: 29023@@ -826,8 +831,10 @@ void AppMenuModel::Build() { 29024 29025 AddItemWithStringId(IDC_PRINT, IDS_PRINT); 29026 29027+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29028 if (media_router::MediaRouterEnabled(browser()->profile())) 29029 AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE); 29030+#endif 29031 29032 AddItemWithStringId(IDC_FIND, IDS_FIND); 29033 29034diff --git a/src/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/src/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc 29035index dab357db218ba..366c1d7373c6f 29036--- a/src/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc 29037+++ b/src/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc 29038@@ -16,11 +16,9 @@ 29039 #include "chrome/browser/ui/views/chrome_layout_provider.h" 29040 #include "chrome/browser/ui/views/chrome_views_delegate.h" 29041 #include "chrome/browser/ui/views/devtools_process_observer.h" 29042-#include "chrome/browser/ui/views/media_router/media_router_dialog_controller_views.h" 29043 #include "chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller.h" 29044 #include "chrome/common/chrome_paths.h" 29045 #include "components/constrained_window/constrained_window_views.h" 29046-#include "components/media_router/browser/media_router_dialog_controller.h" 29047 #include "components/ui_devtools/connector_delegate.h" 29048 #include "components/ui_devtools/switches.h" 29049 #include "components/ui_devtools/views/devtools_server_util.h" 29050@@ -53,6 +51,11 @@ 29051 #include "ui/base/l10n/l10n_util.h" 29052 #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) 29053 29054+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29055+#include "chrome/browser/ui/views/media_router/media_router_dialog_controller_views.h" 29056+#include "components/media_router/browser/media_router_dialog_controller.h" 29057+#endif 29058+ 29059 namespace { 29060 29061 // Owned by ChromeBrowserMainParts. 29062@@ -121,6 +124,7 @@ void ChromeBrowserMainExtraPartsViews::PreProfileInit() { 29063 CreateUiDevTools(); 29064 } 29065 29066+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29067 media_router::MediaRouterDialogController::SetGetOrCreate( 29068 base::BindRepeating([](content::WebContents* web_contents) { 29069 DCHECK(web_contents); 29070@@ -133,6 +137,7 @@ void ChromeBrowserMainExtraPartsViews::PreProfileInit() { 29071 web_contents); 29072 return controller; 29073 })); 29074+#endif 29075 29076 // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch 29077 // of lacros-chrome is complete. 29078diff --git a/src/chrome/browser/ui/views/file_system_access/file_system_access_browsertest.cc b/src/chrome/browser/ui/views/file_system_access/file_system_access_browsertest.cc 29079index a090429d24dc9..29b130143eda0 29080--- a/src/chrome/browser/ui/views/file_system_access/file_system_access_browsertest.cc 29081+++ b/src/chrome/browser/ui/views/file_system_access/file_system_access_browsertest.cc 29082@@ -413,7 +413,8 @@ IN_PROC_BROWSER_TEST_F(FileSystemAccessBrowserSlowLoadTest, WaitUntilLoaded) { 29083 29084 #if BUILDFLAG(FULL_SAFE_BROWSING) 29085 IN_PROC_BROWSER_TEST_F(FileSystemAccessBrowserTest, SafeBrowsing) { 29086- const base::FilePath test_file = temp_dir_.GetPath().AppendASCII("test.exe"); 29087+ const std::string file_name("test.pdf"); 29088+ const base::FilePath test_file = temp_dir_.GetPath().AppendASCII(file_name); 29089 29090 std::string expected_hash; 29091 ASSERT_TRUE(base::HexStringToString( 29092@@ -444,9 +445,9 @@ IN_PROC_BROWSER_TEST_F(FileSystemAccessBrowserTest, SafeBrowsing) { 29093 EXPECT_EQ(request->url(), expected_url); 29094 EXPECT_EQ(request->digests().sha256(), expected_hash); 29095 EXPECT_EQ(request->length(), 3); 29096- EXPECT_EQ(request->file_basename(), "test.exe"); 29097+ EXPECT_EQ(request->file_basename(), file_name); 29098 EXPECT_EQ(request->download_type(), 29099- ClientDownloadRequest::WIN_EXECUTABLE); 29100+ ClientDownloadRequest::DOCUMENT); 29101 29102 ASSERT_GE(request->resources_size(), 2); 29103 29104diff --git a/src/chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view.cc b/src/chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view.cc 29105new file mode 100644 29106index 0000000000000..e41c46f7d84a9 29107--- /dev/null 29108+++ b/src/chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view.cc 29109@@ -0,0 +1,94 @@ 29110+// Copyright 2022 The Chromium Authors. All rights reserved. 29111+// Use of this source code is governed by a BSD-style license that can be 29112+// found in the LICENSE file. 29113+ 29114+#include "chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view.h" 29115+ 29116+#include "base/memory/ptr_util.h" 29117+#include "chrome/browser/ui/views/chrome_layout_provider.h" 29118+#include "chrome/browser/ui/views/file_system_access/file_system_access_ui_helpers.h" 29119+#include "chrome/grit/generated_resources.h" 29120+#include "components/constrained_window/constrained_window_views.h" 29121+#include "ui/base/l10n/l10n_util.h" 29122+#include "ui/base/metadata/metadata_impl_macros.h" 29123+#include "ui/base/ui_base_types.h" 29124+#include "ui/strings/grit/ui_strings.h" 29125+#include "ui/views/controls/label.h" 29126+#include "ui/views/layout/fill_layout.h" 29127+ 29128+FileSystemAccessDangerousFileDialogView:: 29129+ ~FileSystemAccessDangerousFileDialogView() { 29130+ // Make sure the dialog ends up calling the callback no matter what. 29131+ if (callback_) 29132+ Close(); 29133+ DCHECK(!callback_); 29134+} 29135+ 29136+// static 29137+views::Widget* FileSystemAccessDangerousFileDialogView::ShowDialog( 29138+ const url::Origin& origin, 29139+ const base::FilePath& path, 29140+ base::OnceCallback<void(DangerousFileResult)> callback, 29141+ content::WebContents* web_contents) { 29142+ auto delegate = base::WrapUnique(new FileSystemAccessDangerousFileDialogView( 29143+ origin, path, std::move(callback))); 29144+ return constrained_window::ShowWebModalDialogViews(delegate.release(), 29145+ web_contents); 29146+} 29147+ 29148+FileSystemAccessDangerousFileDialogView:: 29149+ FileSystemAccessDangerousFileDialogView( 29150+ const url::Origin& origin, 29151+ const base::FilePath& path, 29152+ base::OnceCallback<void(DangerousFileResult)> callback) 29153+ : callback_(std::move(callback)) { 29154+ SetTitle(l10n_util::GetStringFUTF16( 29155+ IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TITLE, 29156+ file_system_access_ui_helper::GetPathForDisplay(path))); 29157+ SetButtonLabel( 29158+ ui::DIALOG_BUTTON_OK, 29159+ l10n_util::GetStringUTF16(IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_SAVE)); 29160+ SetButtonLabel(ui::DIALOG_BUTTON_CANCEL, 29161+ l10n_util::GetStringUTF16( 29162+ IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_DONT_SAVE)); 29163+ // Ensure the default is to not save the dangerous file. 29164+ SetDefaultButton(ui::DIALOG_BUTTON_CANCEL); 29165+ 29166+ auto run_callback = [](FileSystemAccessDangerousFileDialogView* dialog, 29167+ DangerousFileResult result) { 29168+ std::move(dialog->callback_).Run(result); 29169+ }; 29170+ SetAcceptCallback(base::BindOnce(run_callback, base::Unretained(this), 29171+ DangerousFileResult::kAllowed)); 29172+ SetCancelCallback(base::BindOnce(run_callback, base::Unretained(this), 29173+ DangerousFileResult::kAbort)); 29174+ SetCloseCallback(base::BindOnce(run_callback, base::Unretained(this), 29175+ DangerousFileResult::kAbort)); 29176+ 29177+ SetLayoutManager(std::make_unique<views::FillLayout>()); 29178+ set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType( 29179+ views::DialogContentType::kText, views::DialogContentType::kText)); 29180+ 29181+ SetModalType(ui::MODAL_TYPE_CHILD); 29182+ SetShowCloseButton(false); 29183+ set_fixed_width(views::LayoutProvider::Get()->GetDistanceMetric( 29184+ views::DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH)); 29185+ 29186+ AddChildView(file_system_access_ui_helper::CreateOriginLabel( 29187+ IDS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_TEXT, origin, 29188+ views::style::CONTEXT_DIALOG_BODY_TEXT, /*show_emphasis=*/true)); 29189+} 29190+ 29191+BEGIN_METADATA(FileSystemAccessDangerousFileDialogView, 29192+ views::DialogDelegateView) 29193+END_METADATA 29194+ 29195+void ShowFileSystemAccessDangerousFileDialog( 29196+ const url::Origin& origin, 29197+ const base::FilePath& path, 29198+ base::OnceCallback<void( 29199+ FileSystemAccessDangerousFileDialogView::DangerousFileResult)> callback, 29200+ content::WebContents* web_contents) { 29201+ FileSystemAccessDangerousFileDialogView::ShowDialog( 29202+ origin, path, std::move(callback), web_contents); 29203+} 29204\ No newline at end of file 29205diff --git a/src/chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view.h b/src/chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view.h 29206new file mode 100644 29207index 0000000000000..1465c864bd982 29208--- /dev/null 29209+++ b/src/chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view.h 29210@@ -0,0 +1,61 @@ 29211+// Copyright 2022 The Chromium Authors. All rights reserved. 29212+// Use of this source code is governed by a BSD-style license that can be 29213+// found in the LICENSE file. 29214+ 29215+#ifndef CHROME_BROWSER_UI_VIEWS_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_DIALOG_VIEW_H_ 29216+#define CHROME_BROWSER_UI_VIEWS_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_DIALOG_VIEW_H_ 29217+ 29218+#include "content/public/browser/file_system_access_permission_context.h" 29219+#include "ui/base/metadata/metadata_header_macros.h" 29220+#include "ui/views/window/dialog_delegate.h" 29221+ 29222+namespace base { 29223+class FilePath; 29224+} 29225+ 29226+namespace content { 29227+class WebContents; 29228+} // namespace content 29229+ 29230+namespace url { 29231+class Origin; 29232+} // namespace url 29233+ 29234+namespace views { 29235+class Widget; 29236+} // namespace views 29237+ 29238+// A dialog that asks the user whether they want to save a file with a dangerous 29239+// extension. 29240+class FileSystemAccessDangerousFileDialogView 29241+ : public views::DialogDelegateView { 29242+ public: 29243+ METADATA_HEADER(FileSystemAccessDangerousFileDialogView); 29244+ 29245+ using DangerousFileResult = 29246+ content::FileSystemAccessPermissionContext::SensitiveEntryResult; 29247+ 29248+ FileSystemAccessDangerousFileDialogView( 29249+ const FileSystemAccessDangerousFileDialogView&) = delete; 29250+ FileSystemAccessDangerousFileDialogView& operator=( 29251+ const FileSystemAccessDangerousFileDialogView&) = delete; 29252+ ~FileSystemAccessDangerousFileDialogView() override; 29253+ 29254+ // Creates and shows the dialog. `callback` is called when the dialog is 29255+ // dismissed. 29256+ static views::Widget* ShowDialog( 29257+ const url::Origin& origin, 29258+ const base::FilePath& path, 29259+ base::OnceCallback<void(DangerousFileResult)> callback, 29260+ content::WebContents* web_contents); 29261+ 29262+ private: 29263+ FileSystemAccessDangerousFileDialogView( 29264+ const url::Origin& origin, 29265+ const base::FilePath& path, 29266+ base::OnceCallback<void(DangerousFileResult)> callback); 29267+ 29268+ base::OnceCallback<void(DangerousFileResult)> callback_; 29269+}; 29270+ 29271+#endif // CHROME_BROWSER_UI_VIEWS_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_DANGEROUS_FILE_DIALOG_VIEW_H_ 29272\ No newline at end of file 29273diff --git a/src/chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view_browsertest.cc b/src/chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view_browsertest.cc 29274new file mode 100644 29275index 0000000000000..558f347081390 29276--- /dev/null 29277+++ b/src/chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view_browsertest.cc 29278@@ -0,0 +1,63 @@ 29279+// Copyright 2022 The Chromium Authors. All rights reserved. 29280+// Use of this source code is governed by a BSD-style license that can be 29281+// found in the LICENSE file. 29282+ 29283+#include "chrome/browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view.h" 29284+ 29285+#include "base/files/file_path.h" 29286+#include "base/memory/raw_ptr.h" 29287+#include "base/test/bind.h" 29288+#include "chrome/browser/ui/browser.h" 29289+#include "chrome/browser/ui/test/test_browser_dialog.h" 29290+#include "chrome/grit/generated_resources.h" 29291+#include "content/public/test/browser_test.h" 29292+#include "ui/base/resource/resource_bundle.h" 29293+ 29294+using SensitiveEntryResult = 29295+ content::FileSystemAccessPermissionContext::SensitiveEntryResult; 29296+ 29297+class FileSystemAccessDangerousFileDialogViewTest : public DialogBrowserTest { 29298+ public: 29299+ // DialogBrowserTest: 29300+ void ShowUi(const std::string& name) override { 29301+ widget_ = FileSystemAccessDangerousFileDialogView::ShowDialog( 29302+ kTestOrigin, base::FilePath(FILE_PATH_LITERAL("bar.swf")), 29303+ base::BindLambdaForTesting([&](SensitiveEntryResult result) { 29304+ callback_called_ = true; 29305+ callback_result_ = result; 29306+ }), 29307+ browser()->tab_strip_model()->GetActiveWebContents()); 29308+ } 29309+ 29310+ protected: 29311+ const url::Origin kTestOrigin = 29312+ url::Origin::Create(GURL("https://example.com")); 29313+ 29314+ raw_ptr<views::Widget> widget_ = nullptr; 29315+ 29316+ bool callback_called_ = false; 29317+ SensitiveEntryResult callback_result_ = SensitiveEntryResult::kAllowed; 29318+}; 29319+ 29320+IN_PROC_BROWSER_TEST_F(FileSystemAccessDangerousFileDialogViewTest, 29321+ AcceptRunsCallback) { 29322+ ShowUi(std::string()); 29323+ widget_->widget_delegate()->AsDialogDelegate()->AcceptDialog(); 29324+ EXPECT_TRUE(callback_called_); 29325+ EXPECT_EQ(SensitiveEntryResult::kAllowed, callback_result_); 29326+ base::RunLoop().RunUntilIdle(); 29327+} 29328+ 29329+IN_PROC_BROWSER_TEST_F(FileSystemAccessDangerousFileDialogViewTest, 29330+ CancelRunsCallback) { 29331+ ShowUi(std::string()); 29332+ widget_->widget_delegate()->AsDialogDelegate()->CancelDialog(); 29333+ EXPECT_TRUE(callback_called_); 29334+ EXPECT_EQ(SensitiveEntryResult::kAbort, callback_result_); 29335+ base::RunLoop().RunUntilIdle(); 29336+} 29337+ 29338+IN_PROC_BROWSER_TEST_F(FileSystemAccessDangerousFileDialogViewTest, 29339+ InvokeUi_default) { 29340+ ShowAndVerifyUi(); 29341+} 29342\ No newline at end of file 29343diff --git a/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.cc b/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.cc 29344index eb37b6b6cfdbd..39d10e7d49ccb 29345--- a/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.cc 29346+++ b/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.cc 29347@@ -89,8 +89,8 @@ void ShowFileSystemAccessRestrictedDirectoryDialog( 29348 const url::Origin& origin, 29349 const base::FilePath& path, 29350 content::FileSystemAccessPermissionContext::HandleType handle_type, 29351- base::OnceCallback<void( 29352- content::FileSystemAccessPermissionContext::SensitiveDirectoryResult)> 29353+ base::OnceCallback< 29354+ void(content::FileSystemAccessPermissionContext::SensitiveEntryResult)> 29355 callback, 29356 content::WebContents* web_contents) { 29357 FileSystemAccessRestrictedDirectoryDialogView::ShowDialog( 29358diff --git a/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.h b/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.h 29359index 00e4fbd9b7bf7..5ec95d04e8019 29360--- a/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.h 29361+++ b/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.h 29362@@ -33,7 +33,7 @@ class FileSystemAccessRestrictedDirectoryDialogView 29363 METADATA_HEADER(FileSystemAccessRestrictedDirectoryDialogView); 29364 29365 using SensitiveDirectoryResult = 29366- content::FileSystemAccessPermissionContext::SensitiveDirectoryResult; 29367+ content::FileSystemAccessPermissionContext::SensitiveEntryResult; 29368 29369 FileSystemAccessRestrictedDirectoryDialogView( 29370 const FileSystemAccessRestrictedDirectoryDialogView&) = delete; 29371@@ -41,7 +41,7 @@ class FileSystemAccessRestrictedDirectoryDialogView 29372 const FileSystemAccessRestrictedDirectoryDialogView&) = delete; 29373 ~FileSystemAccessRestrictedDirectoryDialogView() override; 29374 29375- // Creates and shows the dialog. The |callback| is called when the dialog is 29376+ // Creates and shows the dialog. `callback` is called when the dialog is 29377 // dismissed. 29378 static views::Widget* ShowDialog( 29379 const url::Origin& origin, 29380diff --git a/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view_browsertest.cc b/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view_browsertest.cc 29381index d756cce7ab88f..b370d490faefa 29382--- a/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view_browsertest.cc 29383+++ b/src/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view_browsertest.cc 29384@@ -13,8 +13,8 @@ 29385 #include "content/public/test/browser_test.h" 29386 #include "ui/base/resource/resource_bundle.h" 29387 29388-using SensitiveDirectoryResult = 29389- content::FileSystemAccessPermissionContext::SensitiveDirectoryResult; 29390+using SensitiveEntryResult = 29391+ content::FileSystemAccessPermissionContext::SensitiveEntryResult; 29392 29393 class FileSystemAccessRestrictedDirectoryDialogViewTest 29394 : public DialogBrowserTest { 29395@@ -24,7 +24,7 @@ class FileSystemAccessRestrictedDirectoryDialogViewTest 29396 widget_ = FileSystemAccessRestrictedDirectoryDialogView::ShowDialog( 29397 kTestOrigin, base::FilePath(FILE_PATH_LITERAL("/foo/bar")), 29398 content::FileSystemAccessPermissionContext::HandleType::kDirectory, 29399- base::BindLambdaForTesting([&](SensitiveDirectoryResult result) { 29400+ base::BindLambdaForTesting([&](SensitiveEntryResult result) { 29401 callback_called_ = true; 29402 callback_result_ = result; 29403 }), 29404@@ -38,8 +38,7 @@ class FileSystemAccessRestrictedDirectoryDialogViewTest 29405 raw_ptr<views::Widget> widget_ = nullptr; 29406 29407 bool callback_called_ = false; 29408- SensitiveDirectoryResult callback_result_ = 29409- SensitiveDirectoryResult::kAllowed; 29410+ SensitiveEntryResult callback_result_ = SensitiveEntryResult::kAllowed; 29411 }; 29412 29413 IN_PROC_BROWSER_TEST_F(FileSystemAccessRestrictedDirectoryDialogViewTest, 29414@@ -47,7 +46,7 @@ IN_PROC_BROWSER_TEST_F(FileSystemAccessRestrictedDirectoryDialogViewTest, 29415 ShowUi(std::string()); 29416 widget_->widget_delegate()->AsDialogDelegate()->AcceptDialog(); 29417 EXPECT_TRUE(callback_called_); 29418- EXPECT_EQ(SensitiveDirectoryResult::kTryAgain, callback_result_); 29419+ EXPECT_EQ(SensitiveEntryResult::kTryAgain, callback_result_); 29420 base::RunLoop().RunUntilIdle(); 29421 } 29422 29423@@ -56,7 +55,7 @@ IN_PROC_BROWSER_TEST_F(FileSystemAccessRestrictedDirectoryDialogViewTest, 29424 ShowUi(std::string()); 29425 widget_->widget_delegate()->AsDialogDelegate()->CancelDialog(); 29426 EXPECT_TRUE(callback_called_); 29427- EXPECT_EQ(SensitiveDirectoryResult::kAbort, callback_result_); 29428+ EXPECT_EQ(SensitiveEntryResult::kAbort, callback_result_); 29429 base::RunLoop().RunUntilIdle(); 29430 } 29431 29432diff --git a/src/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_view_impl.h b/src/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_view_impl.h 29433index ad96a6657884c..0766b94173ce6 29434--- a/src/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_view_impl.h 29435+++ b/src/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_view_impl.h 29436@@ -11,10 +11,16 @@ 29437 #include <vector> 29438 29439 #include "base/memory/raw_ptr.h" 29440-#include "chrome/browser/ui/media_router/cast_dialog_controller.h" 29441 #include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_bubble_view.h" 29442 #include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h" 29443 29444+#if BUILDFLAG(IS_OHOS) 29445+#include "media/media_buildflags.h" 29446+#if BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29447+#include "chrome/browser/ui/media_router/cast_dialog_controller.h" 29448+#endif 29449+#endif 29450+ 29451 namespace content { 29452 class WebContents; 29453 } // namespace content 29454diff --git a/src/chrome/browser/ui/views/toolbar/toolbar_view.cc b/src/chrome/browser/ui/views/toolbar/toolbar_view.cc 29455index 4a3121cedf083..41b6d132fdcc9 29456--- a/src/chrome/browser/ui/views/toolbar/toolbar_view.cc 29457+++ b/src/chrome/browser/ui/views/toolbar/toolbar_view.cc 29458@@ -47,10 +47,7 @@ 29459 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" 29460 #include "chrome/browser/ui/views/frame/browser_view.h" 29461 #include "chrome/browser/ui/views/frame/top_container_background.h" 29462-#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_contextual_menu.h" 29463-#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h" 29464 #include "chrome/browser/ui/views/location_bar/star_view.h" 29465-#include "chrome/browser/ui/views/media_router/cast_toolbar_button.h" 29466 #include "chrome/browser/ui/views/page_action/page_action_icon_container.h" 29467 #include "chrome/browser/ui/views/page_action/page_action_icon_controller.h" 29468 #include "chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_toolbar_icon_view.h" 29469@@ -130,6 +127,12 @@ 29470 #include "chrome/browser/ui/views/side_search/side_search_browser_controller.h" 29471 #endif // BUILDFLAG(ENABLE_SIDE_SEARCH) 29472 29473+#if !BUILDFLAG(IS_OHOS) 29474+#include "chrome/browser/ui/views/media_router/cast_toolbar_button.h" 29475+#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_contextual_menu.h" 29476+#include "chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h" 29477+#endif 29478+ 29479 using base::UserMetricsAction; 29480 using content::WebContents; 29481 29482@@ -255,6 +258,7 @@ void ToolbarView::Init() { 29483 extensions_container = 29484 std::make_unique<ExtensionsToolbarContainer>(browser_); 29485 } 29486+#if !BUILDFLAG(IS_OHOS) 29487 std::unique_ptr<media_router::CastToolbarButton> cast; 29488 if (media_router::MediaRouterEnabled(browser_->profile())) 29489 cast = media_router::CastToolbarButton::Create(browser_); 29490@@ -264,6 +268,7 @@ void ToolbarView::Init() { 29491 media_button = std::make_unique<MediaToolbarButtonView>( 29492 browser_view_, MediaToolbarButtonContextualMenu::Create(browser_)); 29493 } 29494+#endif 29495 29496 std::unique_ptr<DownloadToolbarButtonView> download_button; 29497 if (base::FeatureList::IsEnabled(features::kDownloadBubble)) { 29498@@ -345,11 +350,13 @@ void ToolbarView::Init() { 29499 } 29500 } 29501 29502+#if !BUILDFLAG(IS_OHOS) 29503 if (cast) 29504 cast_ = AddChildView(std::move(cast)); 29505 29506 if (media_button) 29507 media_button_ = AddChildView(std::move(media_button)); 29508+#endif 29509 29510 if (download_button) 29511 download_button_ = AddChildView(std::move(download_button)); 29512diff --git a/src/chrome/browser/ui/web_applications/web_app_menu_model.cc b/src/chrome/browser/ui/web_applications/web_app_menu_model.cc 29513index 29e159f5d7fba..9818769d99528 29514--- a/src/chrome/browser/ui/web_applications/web_app_menu_model.cc 29515+++ b/src/chrome/browser/ui/web_applications/web_app_menu_model.cc 29516@@ -144,8 +144,10 @@ void WebAppMenuModel::Build() { 29517 AddSeparator(ui::UPPER_SEPARATOR); 29518 AddItemWithStringId(IDC_PRINT, IDS_PRINT); 29519 AddItemWithStringId(IDC_FIND, IDS_FIND); 29520+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29521 if (media_router::MediaRouterEnabled(browser()->profile())) 29522 AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE); 29523+#endif 29524 AddSeparator(ui::LOWER_SEPARATOR); 29525 CreateCutCopyPasteMenu(); 29526 } 29527diff --git a/src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc 29528index 63b3cd6439765..33e2a3c8cc7bc 29529--- a/src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc 29530+++ b/src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc 29531@@ -120,9 +120,7 @@ 29532 #include "components/feed/buildflags.h" 29533 #include "components/feed/feed_feature_list.h" 29534 #else // BUILDFLAG(IS_ANDROID) 29535-#include "chrome/browser/media/router/media_router_feature.h" 29536 #include "chrome/browser/ui/ui_features.h" 29537-#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h" 29538 #include "chrome/browser/ui/webui/app_service_internals/app_service_internals_ui.h" 29539 #include "chrome/browser/ui/webui/bookmarks/bookmarks_ui.h" 29540 #include "chrome/browser/ui/webui/commander/commander_ui.h" 29541@@ -135,7 +133,6 @@ 29542 #include "chrome/browser/ui/webui/image_editor/image_editor_ui.h" 29543 #include "chrome/browser/ui/webui/inspect_ui.h" 29544 #include "chrome/browser/ui/webui/management/management_ui.h" 29545-#include "chrome/browser/ui/webui/media_router/media_router_internals_ui.h" 29546 #include "chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.h" 29547 #include "chrome/browser/ui/webui/new_tab_page_third_party/new_tab_page_third_party_ui.h" 29548 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 29549@@ -368,6 +365,12 @@ 29550 #include "chrome/browser/ui/webui/chromeos/chromebox_for_meetings/network_settings_dialog.h" 29551 #endif // BUILDFLAG(PLATFORM_CFM) 29552 29553+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29554+#include "chrome/browser/media/router/media_router_feature.h" 29555+#include "chrome/browser/ui/webui/access_code_cast/access_code_cast_ui.h" 29556+#include "chrome/browser/ui/webui/media_router/media_router_internals_ui.h" 29557+#endif 29558+ 29559 using content::WebUI; 29560 using content::WebUIController; 29561 using ui::WebDialogUI; 29562@@ -791,10 +794,12 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, 29563 return &NewWebUI<SyncFileSystemInternalsUI>; 29564 if (url.host_piece() == chrome::kChromeUISystemInfoHost) 29565 return &NewWebUI<SystemInfoUI>; 29566+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29567 if (base::FeatureList::IsEnabled(features::kAccessCodeCastUI)) { 29568 if (url.host_piece() == chrome::kChromeUIAccessCodeCastHost) 29569 return &NewWebUI<AccessCodeCastUI>; 29570 } 29571+#endif 29572 if (base::FeatureList::IsEnabled(features::kSupportTool) && 29573 url.host_piece() == chrome::kChromeUISupportToolHost) 29574 return &NewWebUI<SupportToolUI>; 29575@@ -1126,11 +1131,13 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, 29576 base::FeatureList::IsEnabled(features::kChromeWhatsNewUI)) { 29577 return &NewWebUI<WhatsNewUI>; 29578 } 29579+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(OHOS_ENABLE_MEDIA_ROUTER) 29580 if (url.host_piece() == chrome::kChromeUIMediaRouterInternalsHost && 29581 media_router::MediaRouterEnabled(profile)) { 29582 return &NewWebUI<media_router::MediaRouterInternalsUI>; 29583 } 29584 #endif 29585+#endif 29586 #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ 29587 BUILDFLAG(IS_ANDROID) 29588 if (url.host_piece() == chrome::kChromeUISandboxHost) { 29589diff --git a/src/chrome/browser/ui/webui/settings/import_data_handler.cc b/src/chrome/browser/ui/webui/settings/import_data_handler.cc 29590index 1189cac8efe92..cb4f58546c82a 29591--- a/src/chrome/browser/ui/webui/settings/import_data_handler.cc 29592+++ b/src/chrome/browser/ui/webui/settings/import_data_handler.cc 29593@@ -72,9 +72,14 @@ void ImportDataHandler::OnJavascriptDisallowed() { 29594 // Cancels outstanding profile list detections. 29595 importer_list_.reset(); 29596 29597- // Stops listening to updates from any ongoing imports. 29598- if (importer_host_) 29599+ // When the WebUI is unloading, we ignore all further updates from the host. 29600+ // Because we're no longer listening to the `ImportEnded` callback, we must 29601+ // also clear our pointer, as otherwise this can lead to a use-after-free 29602+ // in the destructor. https://crbug.com/1302813. 29603+ if (importer_host_) { 29604 importer_host_->set_observer(nullptr); 29605+ importer_host_ = nullptr; 29606+ } 29607 } 29608 29609 void ImportDataHandler::StartImport( 29610diff --git a/src/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc b/src/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc 29611index 6da1ddc58bbeb..862b04e73138e 29612--- a/src/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc 29613+++ b/src/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc 29614@@ -421,11 +421,13 @@ void InlineSigninHelper::OnClientOAuthSuccessAndBrowserOpened( 29615 // Display a confirmation dialog to the user. 29616 base::RecordAction( 29617 base::UserMetricsAction("Signin_Show_UntrustedSigninPrompt")); 29618+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) 29619 Browser* browser = chrome::FindLastActiveWithProfile(profile_); 29620 browser->window()->ShowOneClickSigninConfirmation( 29621 base::UTF8ToUTF16(email_), 29622 base::BindOnce(&InlineSigninHelper::UntrustedSigninConfirmed, 29623 base::Unretained(this), result.refresh_token)); 29624+#endif 29625 return; 29626 } 29627 CreateSyncStarter(result.refresh_token); 29628diff --git a/src/chrome/browser/ui/webui/webui_util.cc b/src/chrome/browser/ui/webui/webui_util.cc 29629index 3298b3d3c809f..90f3088dca459 29630--- a/src/chrome/browser/ui/webui/webui_util.cc 29631+++ b/src/chrome/browser/ui/webui/webui_util.cc 29632@@ -21,7 +21,7 @@ 29633 #include "base/enterprise_util.h" 29634 #endif 29635 29636-#if defined(TOOLKIT_VIEWS) 29637+#if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_OHOS) 29638 #include "chrome/browser/ui/browser.h" 29639 #include "chrome/browser/ui/browser_finder.h" 29640 #include "chrome/browser/ui/browser_window.h" 29641@@ -66,7 +66,7 @@ bool IsEnterpriseManaged() { 29642 #endif 29643 } 29644 29645-#if defined(TOOLKIT_VIEWS) 29646+#if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_OHOS) 29647 ui::NativeTheme* GetNativeTheme(content::WebContents* web_contents) { 29648 ui::NativeTheme* native_theme = nullptr; 29649 29650diff --git a/src/chrome/browser/ui/webui/webui_util.h b/src/chrome/browser/ui/webui/webui_util.h 29651index afa3e78ed2834..c0778ec6cd453 29652--- a/src/chrome/browser/ui/webui/webui_util.h 29653+++ b/src/chrome/browser/ui/webui/webui_util.h 29654@@ -39,7 +39,7 @@ void SetupWebUIDataSource(content::WebUIDataSource* source, 29655 // false. 29656 bool IsEnterpriseManaged(); 29657 29658-#if defined(TOOLKIT_VIEWS) 29659+#if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_OHOS) 29660 // Returns whether WebContents should use dark mode colors depending on the 29661 // theme. 29662 ui::NativeTheme* GetNativeTheme(content::WebContents* web_contents); 29663diff --git a/src/chrome/browser/web_applications/web_app_install_manager_unittest.cc b/src/chrome/browser/web_applications/web_app_install_manager_unittest.cc 29664index 483490b108813..94bcb60137659 29665--- a/src/chrome/browser/web_applications/web_app_install_manager_unittest.cc 29666+++ b/src/chrome/browser/web_applications/web_app_install_manager_unittest.cc 29667@@ -947,6 +947,7 @@ TEST_P(WebAppInstallManagerTest_SyncOnly, DefaultAndUser_UninstallWebApp) { 29668 29669 EXPECT_TRUE(finalizer().CanUserUninstallWebApp(app_id)); 29670 EXPECT_FALSE(finalizer().WasPreinstalledWebAppUninstalled(app_id)); 29671+ EXPECT_TRUE(registrar().IsActivelyInstalled(app_id)); 29672 29673 WebAppTestRegistryObserverAdapter observer(®istrar()); 29674 29675@@ -966,6 +967,7 @@ TEST_P(WebAppInstallManagerTest_SyncOnly, DefaultAndUser_UninstallWebApp) { 29676 EXPECT_TRUE(observer_uninstalled_called); 29677 EXPECT_FALSE(finalizer().CanUserUninstallWebApp(app_id)); 29678 EXPECT_TRUE(finalizer().WasPreinstalledWebAppUninstalled(app_id)); 29679+ EXPECT_FALSE(registrar().IsActivelyInstalled(app_id)); 29680 } 29681 29682 TEST_P(WebAppInstallManagerTest, InstallWebAppFromInfo) { 29683@@ -985,12 +987,16 @@ TEST_P(WebAppInstallManagerTest, InstallWebAppFromInfo) { 29684 ? webapps::WebappInstallSource::SYSTEM_DEFAULT 29685 : webapps::WebappInstallSource::OMNIBOX_INSTALL_ICON; 29686 29687+ EXPECT_FALSE(registrar().IsActivelyInstalled(expected_app_id)); 29688+ 29689 InstallResult result = InstallWebAppFromInfo( 29690 std::move(server_web_app_info), 29691 /*overwrite_existing_manifest_fields=*/false, install_source); 29692 EXPECT_EQ(InstallResultCode::kSuccessNewInstall, result.code); 29693 EXPECT_EQ(expected_app_id, result.app_id); 29694 29695+ EXPECT_TRUE(registrar().IsActivelyInstalled(expected_app_id)); 29696+ 29697 const WebApp* web_app = registrar().GetAppById(expected_app_id); 29698 ASSERT_TRUE(web_app); 29699 29700@@ -1044,6 +1050,22 @@ TEST_P(WebAppInstallManagerTest, TaskQueueWebContentsReadyRace) { 29701 EXPECT_FALSE(task_c_started); 29702 } 29703 29704+TEST_P(WebAppInstallManagerTest, DefaultNotActivelyInstalled) { 29705+ std::unique_ptr<WebApp> default_app = test::CreateWebApp( 29706+ GURL("https://example.com/path"), Source::kDefault); 29707+ default_app->SetDisplayMode(DisplayMode::kStandalone); 29708+ default_app->SetUserDisplayMode(DisplayMode::kBrowser); 29709+ 29710+ const AppId app_id = default_app->app_id(); 29711+ const GURL external_app_url("https://example.com/path/default"); 29712+ 29713+ externally_installed_app_prefs().Insert( 29714+ external_app_url, app_id, ExternalInstallSource::kExternalDefault); 29715+ InitRegistrarWithApp(std::move(default_app)); 29716+ 29717+ EXPECT_FALSE(registrar().IsActivelyInstalled(app_id)); 29718+} 29719+ 29720 TEST_P(WebAppInstallManagerTest_SyncOnly, 29721 InstallWebAppFromManifestWithFallback_OverwriteIsLocallyInstalled) { 29722 const GURL start_url{"https://example.com/path"}; 29723@@ -1061,6 +1083,7 @@ TEST_P(WebAppInstallManagerTest_SyncOnly, 29724 } 29725 29726 EXPECT_FALSE(registrar().IsLocallyInstalled(app_id)); 29727+ EXPECT_FALSE(registrar().IsActivelyInstalled(app_id)); 29728 EXPECT_EQ(DisplayMode::kBrowser, 29729 registrar().GetAppEffectiveDisplayMode(app_id)); 29730 29731@@ -1073,6 +1096,7 @@ TEST_P(WebAppInstallManagerTest_SyncOnly, 29732 29733 EXPECT_TRUE(registrar().IsInstalled(app_id)); 29734 EXPECT_TRUE(registrar().IsLocallyInstalled(app_id)); 29735+ EXPECT_TRUE(registrar().IsActivelyInstalled(app_id)); 29736 // InstallWebAppFromManifestWithFallback sets user_display_mode to kBrowser 29737 // because TestAcceptDialogCallback doesn't set open_as_window to true. 29738 EXPECT_EQ(DisplayMode::kBrowser, 29739@@ -1173,6 +1197,7 @@ TEST_P(WebAppInstallManagerTest_SyncOnly, 29740 29741 EXPECT_EQ(DisplayMode::kStandalone, web_app->display_mode()); 29742 EXPECT_EQ(DisplayMode::kBrowser, web_app->user_display_mode()); 29743+ EXPECT_TRUE(registrar().IsActivelyInstalled(app_id)); 29744 29745 ASSERT_TRUE(web_app->theme_color().has_value()); 29746 EXPECT_EQ(SK_ColorWHITE, web_app->theme_color().value()); 29747@@ -1221,6 +1246,7 @@ TEST_P(WebAppInstallManagerTest_SyncOnly, InstallSubApp) { 29748 EXPECT_TRUE(registrar().IsLocallyInstalled(app_id)); 29749 EXPECT_EQ(DisplayMode::kStandalone, 29750 registrar().GetAppEffectiveDisplayMode(app_id)); 29751+ EXPECT_TRUE(registrar().IsActivelyInstalled(app_id)); 29752 29753 const WebApp* app = registrar().GetAppById(app_id); 29754 EXPECT_EQ(parent_app_id, app->parent_app_id()); 29755diff --git a/src/chrome/browser/web_applications/web_app_registrar.cc b/src/chrome/browser/web_applications/web_app_registrar.cc 29756index 340be63519563..2b4f7df1e5280 29757--- a/src/chrome/browser/web_applications/web_app_registrar.cc 29758+++ b/src/chrome/browser/web_applications/web_app_registrar.cc 29759@@ -466,6 +466,16 @@ bool WebAppRegistrar::IsLocallyInstalled(const AppId& app_id) const { 29760 : false; 29761 } 29762 29763+bool WebAppRegistrar::IsActivelyInstalled(const AppId& app_id) const { 29764+ if (!IsInstalled(app_id) || !IsLocallyInstalled(app_id)) 29765+ return false; 29766+ 29767+ auto* web_app = GetAppById(app_id); 29768+ DCHECK(web_app); 29769+ return !web_app->HasOnlySource(web_app::Source::kDefault) || 29770+ GetAppEffectiveDisplayMode(app_id) != web_app::DisplayMode::kBrowser; 29771+} 29772+ 29773 bool WebAppRegistrar::WasInstalledByDefaultOnly(const AppId& app_id) const { 29774 const WebApp* web_app = GetAppById(app_id); 29775 return web_app && web_app->HasOnlySource(Source::Type::kDefault); 29776diff --git a/src/chrome/browser/web_applications/web_app_registrar.h b/src/chrome/browser/web_applications/web_app_registrar.h 29777index 098710f734d95..3dc298f34bcab 29778--- a/src/chrome/browser/web_applications/web_app_registrar.h 29779+++ b/src/chrome/browser/web_applications/web_app_registrar.h 29780@@ -72,6 +72,11 @@ class WebAppRegistrar : public ProfileManagerObserver { 29781 // apps. On Chrome OS all apps are always locally installed. 29782 bool IsLocallyInstalled(const AppId& app_id) const; 29783 29784+ // Returns true if the app was actively installed, meaning the app has 29785+ // involved some form of user or administrator action to either install it or 29786+ // configure it to behave like an app. 29787+ bool IsActivelyInstalled(const AppId& app_id) const; 29788+ 29789 // Returns true if the app was preinstalled and NOT installed via any other 29790 // mechanism. 29791 bool WasInstalledByDefaultOnly(const AppId& app_id) const; 29792diff --git a/src/chrome/browser/web_applications/web_app_registrar_unittest.cc b/src/chrome/browser/web_applications/web_app_registrar_unittest.cc 29793index 1fc9cb12e1741..558e2ba970417 29794--- a/src/chrome/browser/web_applications/web_app_registrar_unittest.cc 29795+++ b/src/chrome/browser/web_applications/web_app_registrar_unittest.cc 29796@@ -415,10 +415,12 @@ TEST_F(WebAppRegistrarTest, GetAppDataFields) { 29797 29798 { 29799 EXPECT_FALSE(registrar().IsLocallyInstalled(app_id)); 29800+ EXPECT_FALSE(registrar().IsActivelyInstalled(app_id)); 29801 29802 EXPECT_FALSE(registrar().IsLocallyInstalled("unknown")); 29803 web_app_ptr->SetIsLocallyInstalled(/*is_locally_installed*/ true); 29804 EXPECT_TRUE(registrar().IsLocallyInstalled(app_id)); 29805+ EXPECT_TRUE(registrar().IsActivelyInstalled(app_id)); 29806 } 29807 29808 { 29809diff --git a/src/chrome/chrome_paks.gni b/src/chrome/chrome_paks.gni 29810index 8a56f21945249..38e26e4a14994 29811--- a/src/chrome/chrome_paks.gni 29812+++ b/src/chrome/chrome_paks.gni 29813@@ -58,7 +58,7 @@ template("chrome_repack_percent") { 29814 deps += invoker.deps 29815 } 29816 29817- if (toolkit_views || is_ohos) { 29818+ if (toolkit_views) { 29819 sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ] 29820 deps += [ "//ui/views/resources" ] 29821 } 29822@@ -143,7 +143,7 @@ template("chrome_extra_paks") { 29823 deps += [ "//ohos_nweb_ex/overrides/ui/resources" ] 29824 } 29825 29826- if (!is_android) { 29827+ if (!is_android && !is_ohos) { 29828 # New paks should be added here by default. 29829 sources += [ 29830 "$root_gen_dir/chrome/access_code_cast_resources.pak", 29831@@ -326,7 +326,7 @@ template("chrome_extra_paks") { 29832 sources += [ "$root_gen_dir/chrome/webui_js_error_resources.pak" ] 29833 deps += [ "//chrome/browser/resources/webui_js_error:resources" ] 29834 } 29835- if (!is_android && !is_chromeos_ash) { 29836+ if (!is_android && !is_chromeos_ash && !is_ohos) { 29837 sources += [ 29838 "$root_gen_dir/chrome/apps_resources.pak", 29839 "$root_gen_dir/chrome/profile_picker_resources.pak", 29840diff --git a/src/chrome/common/BUILD.gn b/src/chrome/common/BUILD.gn 29841index 140e1b3256b95..78e10e95bdae8 29842--- a/src/chrome/common/BUILD.gn 29843+++ b/src/chrome/common/BUILD.gn 29844@@ -249,6 +249,10 @@ static_library("common") { 29845 "//components/page_load_metrics/common:common", 29846 ] 29847 29848+ if (is_ohos && !ohos_enable_media_router) { 29849+ public_deps -= [ "//components/cast_certificate" ] 29850+ } 29851+ 29852 if (enable_pdf) { 29853 deps += [ "//components/pdf/common" ] 29854 } 29855diff --git a/src/chrome/common/features.gni b/src/chrome/common/features.gni 29856index c453fe0c0d203..9d69a1f9b2ccb 29857--- a/src/chrome/common/features.gni 29858+++ b/src/chrome/common/features.gni 29859@@ -33,8 +33,9 @@ declare_args() { 29860 builtin_cert_verifier_policy_supported = is_mac 29861 29862 # Enables support for background apps. 29863- enable_background_contents = !is_android && !is_chromecast 29864- enable_background_mode = !is_android && !is_chromecast && !is_chromeos 29865+ enable_background_contents = !is_android && !is_chromecast && !is_ohos 29866+ enable_background_mode = 29867+ !is_android && !is_chromecast && !is_chromeos && !is_ohos 29868 29869 # Enable the printing system dialog for platforms that support printing 29870 # and have a system dialog. 29871@@ -53,7 +54,7 @@ declare_args() { 29872 enable_one_click_signin = is_win || is_mac || is_fuchsia || 29873 ((is_linux || is_chromeos_lacros) && !is_chromecast) 29874 29875- enable_service_discovery = (enable_mdns && !is_android) || is_mac 29876+ enable_service_discovery = (enable_mdns && !is_android && !is_ohos) || is_mac 29877 29878 # Enables use of the session service, which is enabled by default. 29879 # Android stores them separately on the Java side. 29880diff --git a/src/chrome/services/speech/speech_recognition_recognizer_impl.cc b/src/chrome/services/speech/speech_recognition_recognizer_impl.cc 29881index db205242046fb..14026f5c8f820 29882--- a/src/chrome/services/speech/speech_recognition_recognizer_impl.cc 29883+++ b/src/chrome/services/speech/speech_recognition_recognizer_impl.cc 29884@@ -12,6 +12,9 @@ 29885 #include "base/files/file_path.h" 29886 #include "base/files/file_util.h" 29887 #include "base/metrics/histogram_functions.h" 29888+#include "base/task/task_runner.h" 29889+#include "base/task/task_traits.h" 29890+#include "base/task/thread_pool.h" 29891 #include "build/build_config.h" 29892 #include "build/chromeos_buildflags.h" 29893 #include "chrome/services/speech/soda/proto/soda_api.pb.h" 29894@@ -190,7 +193,6 @@ SpeechRecognitionRecognizerImpl::SpeechRecognitionRecognizerImpl( 29895 &SpeechRecognitionRecognizerImpl::OnRecognitionStoppedCallback, 29896 weak_factory_.GetWeakPtr())); 29897 29898- // Unretained is safe because |this| owns the mojo::Remote. 29899 client_remote_.set_disconnect_handler( 29900 base::BindOnce(&SpeechRecognitionRecognizerImpl::OnClientHostDisconnected, 29901 weak_factory_.GetWeakPtr())); 29902@@ -300,13 +302,40 @@ void SpeechRecognitionRecognizerImpl::OnLanguageChanged( 29903 if (language_code == language_ || language_code == LanguageCode::kNone) 29904 return; 29905 29906- language_ = language_component_config.value().language_code; 29907- base::FilePath config_path = GetLatestSodaLanguagePackDirectory(language); 29908- if (base::PathExists(config_path)) { 29909+ if (!task_runner_) { 29910+ task_runner_ = base::ThreadPool::CreateSequencedTaskRunner( 29911+ {base::MayBlock(), base::TaskPriority::BEST_EFFORT, 29912+ base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); 29913+ } 29914+ 29915+ // Changing the language requires a blocking call to check if the language 29916+ // pack exists on the device. 29917+ scoped_refptr<base::SequencedTaskRunner> current_task_runner = 29918+ base::SequencedTaskRunnerHandle::Get(); 29919+ 29920+ base::FilePath config_file_path = 29921+ GetLatestSodaLanguagePackDirectory(language); 29922+ 29923+ task_runner_->PostTaskAndReplyWithResult( 29924+ FROM_HERE, 29925+ base::BindOnce( 29926+ [](base::FilePath config_path) { 29927+ return base::PathExists(config_path); 29928+ }, 29929+ config_file_path), 29930+ base::BindOnce(&SpeechRecognitionRecognizerImpl::ResetSodaWithNewLanguage, 29931+ weak_factory_.GetWeakPtr(), config_file_path, 29932+ language_code)); 29933+} 29934+ 29935+void SpeechRecognitionRecognizerImpl::ResetSodaWithNewLanguage( 29936+ base::FilePath config_path, 29937+ speech::LanguageCode language_code, 29938+ bool config_exists) { 29939+ if (config_exists) { 29940 config_path_ = config_path; 29941+ language_ = language_code; 29942 ResetSoda(); 29943- } else { 29944- NOTREACHED(); 29945 } 29946 } 29947 29948diff --git a/src/chrome/services/speech/speech_recognition_recognizer_impl.h b/src/chrome/services/speech/speech_recognition_recognizer_impl.h 29949index c3eea81ba6765..8855af66632ba 29950--- a/src/chrome/services/speech/speech_recognition_recognizer_impl.h 29951+++ b/src/chrome/services/speech/speech_recognition_recognizer_impl.h 29952@@ -106,6 +106,9 @@ class SpeechRecognitionRecognizerImpl 29953 private: 29954 void OnLanguageChanged(const std::string& language) final; 29955 29956+ void ResetSodaWithNewLanguage(base::FilePath config_path, 29957+ speech::LanguageCode language_code, 29958+ bool config_exists); 29959 void RecordDuration(); 29960 29961 // Called as a response to sending a SpeechRecognitionEvent to the client 29962@@ -145,6 +148,8 @@ class SpeechRecognitionRecognizerImpl 29963 // Whether the client is still requesting speech recognition. 29964 bool is_client_requesting_speech_recognition_ = true; 29965 29966+ scoped_refptr<base::SequencedTaskRunner> task_runner_; 29967+ 29968 base::WeakPtrFactory<SpeechRecognitionRecognizerImpl> weak_factory_{this}; 29969 }; 29970 29971diff --git a/src/chrome/test/BUILD.gn b/src/chrome/test/BUILD.gn 29972index 94b2c92ae4a53..52e28622b8f98 29973--- a/src/chrome/test/BUILD.gn 29974+++ b/src/chrome/test/BUILD.gn 29975@@ -2958,6 +2958,7 @@ if (!is_android && !is_fuchsia) { 29976 "../browser/ui/views/extensions/settings_overridden_dialog_view_browsertest.cc", 29977 "../browser/ui/views/external_protocol_dialog_browsertest.cc", 29978 "../browser/ui/views/file_system_access/file_system_access_browsertest.cc", 29979+ "../browser/ui/views/file_system_access/file_system_access_dangerous_file_dialog_view_browsertest.cc", 29980 "../browser/ui/views/file_system_access/file_system_access_permission_view_browsertest.cc", 29981 "../browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view_browsertest.cc", 29982 "../browser/ui/views/file_system_access/file_system_access_usage_bubble_view_browsertest.cc", 29983@@ -4957,6 +4958,7 @@ test("unit_tests") { 29984 "../browser/search/contextual_search_policy_handler_android_unittest.cc", 29985 "../browser/translate/android/translate_bridge_unittest.cc", 29986 "../browser/ui/android/autofill/save_card_message_controller_android_unittest.cc", 29987+ "../browser/ui/android/device_dialog/usb_chooser_dialog_android_unittest.cc", 29988 "../browser/ui/android/tab_model/tab_model_list_unittest.cc", 29989 "../browser/ui/android/toolbar/location_bar_model_android_unittest.cc", 29990 ] 29991@@ -5874,6 +5876,7 @@ test("unit_tests") { 29992 "//components/webapk:proto", 29993 "//components/webapps/browser", 29994 "//content/public/android:content_java", 29995+ "//ui/android", 29996 "//ui/events/devices:test_support", 29997 ] 29998 if (use_v8_context_snapshot) { 29999@@ -8006,7 +8009,11 @@ static_library("test_support_unit") { 30000 } 30001 } 30002 30003-if (!is_android) { 30004+if (is_ohos) { 30005+ group("test_support_ui") {} 30006+} 30007+ 30008+if (!is_android && !is_ohos) { 30009 static_library("test_support_ui") { 30010 defines = [] 30011 testonly = true 30012diff --git a/src/chrome/test/data/extensions/api_test/socket/api/multicast.js b/src/chrome/test/data/extensions/api_test/socket/api/multicast.js 30013index 2447a82ebf4eb..3e86952e5b2b0 30014--- a/src/chrome/test/data/extensions/api_test/socket/api/multicast.js 30015+++ b/src/chrome/test/data/extensions/api_test/socket/api/multicast.js 30016@@ -163,8 +163,7 @@ function testMulticast() { 30017 var canceller = waitForMessage(serverSocketId, function (cancelled) { 30018 clearTimeout(recvTimeout); 30019 if (cancelled) { 30020- socket.destroy(serverSocketId); 30021- chrome.test.succeed(); 30022+ leaveGroupAndDisconnect(serverSocketId); 30023 } else { 30024 chrome.test.fail("Received message after leaving the group"); 30025 socket.destroy(serverSocketId); 30026@@ -173,9 +172,20 @@ function testMulticast() { 30027 testSendMessage(request); 30028 recvTimeout = setTimeout(function () { 30029 canceller(); 30030+ }, 2000); 30031+ }); 30032+ } 30033+ 30034+ function leaveGroupAndDisconnect(serverSocketId) { 30035+ socket.joinGroup(serverSocketId, kMulticastAddress, function (result) { 30036+ chrome.test.assertNoLastError(); 30037+ chrome.test.assertEq(0, result, "Join group failed."); 30038+ socket.leaveGroup(serverSocketId, kMulticastAddress, () => { 30039+ chrome.test.assertEq(0, result, "Leave group failed."); 30040 socket.destroy(serverSocketId); 30041 chrome.test.succeed(); 30042- }, 2000); 30043+ }); 30044+ socket.disconnect(serverSocketId); 30045 }); 30046 } 30047 30048@@ -195,4 +205,4 @@ function testMulticast() { 30049 } 30050 30051 testMulticastSettings(); 30052-} 30053\ No newline at end of file 30054+} 30055diff --git a/src/components/feedback/feedback_data.cc b/src/components/feedback/feedback_data.cc 30056index 89e262835f095..5c14825e15a71 30057--- a/src/components/feedback/feedback_data.cc 30058+++ b/src/components/feedback/feedback_data.cc 30059@@ -34,7 +34,14 @@ const char kHistogramsAttachmentName[] = "histograms.zip"; 30060 30061 FeedbackData::FeedbackData(base::WeakPtr<feedback::FeedbackUploader> uploader, 30062 TracingManager* tracing_manager) 30063- : uploader_(std::move(uploader)), tracing_manager_(tracing_manager) {} 30064+ : uploader_(std::move(uploader)) { 30065+ // If tracing is enabled, the tracing manager should have been created before 30066+ // sending the report. If it is created after this point, then the tracing is 30067+ // not relevant to this report. 30068+ if (tracing_manager) { 30069+ tracing_manager_ = base::AsWeakPtr(tracing_manager); 30070+ } 30071+} 30072 30073 FeedbackData::~FeedbackData() = default; 30074 30075diff --git a/src/components/feedback/feedback_data.h b/src/components/feedback/feedback_data.h 30076index 72e0ba52a1b0a..5332def682812 30077--- a/src/components/feedback/feedback_data.h 30078+++ b/src/components/feedback/feedback_data.h 30079@@ -124,7 +124,7 @@ class FeedbackData : public FeedbackCommon { 30080 std::string attached_file_uuid_ GUARDED_BY_CONTEXT(sequence_checker_); 30081 std::string screenshot_uuid_ GUARDED_BY_CONTEXT(sequence_checker_); 30082 30083- const raw_ptr<TracingManager> tracing_manager_ = nullptr; // Not owned. 30084+ base::WeakPtr<TracingManager> tracing_manager_; 30085 int trace_id_ GUARDED_BY_CONTEXT(sequence_checker_) = 0; 30086 30087 int pending_op_count_ GUARDED_BY_CONTEXT(sequence_checker_) = 1; 30088diff --git a/src/components/feedback/tracing_manager.h b/src/components/feedback/tracing_manager.h 30089index 8cfce38f088b0..548ff25b307bf 30090--- a/src/components/feedback/tracing_manager.h 30091+++ b/src/components/feedback/tracing_manager.h 30092@@ -7,6 +7,7 @@ 30093 30094 #include "base/callback.h" 30095 #include "base/memory/scoped_refptr.h" 30096+#include "base/memory/weak_ptr.h" 30097 30098 namespace base { 30099 class RefCountedString; 30100@@ -24,7 +25,7 @@ using TraceDataCallback = 30101 // of the performance data. That data can then be requested via GetTraceData(). 30102 // When the data is no longer needed, it should be discarded via 30103 // DiscardTraceData(). 30104-class TracingManager { 30105+class TracingManager : public base::SupportsWeakPtr<TracingManager> { 30106 public: 30107 virtual ~TracingManager(); 30108 30109diff --git a/src/components/nacl/features.gni b/src/components/nacl/features.gni 30110index a2547a2cd6d70..8e3a1c6cd99f0 30111--- a/src/components/nacl/features.gni 30112+++ b/src/components/nacl/features.gni 30113@@ -14,7 +14,7 @@ declare_args() { 30114 checkout_nacl && target_os != "ios" && !is_android && !is_fuchsia && 30115 !is_chromecast && current_cpu != "mipsel" && current_cpu != "mips64el" && 30116 target_cpu != "arm64" && !(is_win && host_os != "win") && 30117- !(is_mac && (host_os != "mac" || target_cpu != "x64")) 30118+ !(is_mac && (host_os != "mac" || target_cpu != "x64")) && !is_ohos 30119 } 30120 30121 assert(!(is_win && host_os != "win") || !enable_nacl, 30122diff --git a/src/components/offline_pages/buildflags/features.gni b/src/components/offline_pages/buildflags/features.gni 30123index 09b6a0e609e98..2c8c75b1f4f50 30124--- a/src/components/offline_pages/buildflags/features.gni 30125+++ b/src/components/offline_pages/buildflags/features.gni 30126@@ -5,7 +5,7 @@ 30127 declare_args() { 30128 # Whether to enable OfflinePages support. Currently user-visible features 30129 # are Android-only. 30130- enable_offline_pages = is_android || is_ohos 30131+ enable_offline_pages = is_android 30132 30133 # This enables test API for locally-built harness which is used for quality 30134 # evaluations. Requires setting this variable manually at local environment. 30135diff --git a/src/components/optimization_guide/features.gni b/src/components/optimization_guide/features.gni 30136index e8b4ffc271710..01821481f82b6 30137--- a/src/components/optimization_guide/features.gni 30138+++ b/src/components/optimization_guide/features.gni 30139@@ -8,7 +8,7 @@ declare_args() { 30140 # This enables build with TFLite library. 30141 # Currently only available for Desktop and Android. 30142 build_with_tflite_lib = is_android || (is_win && target_cpu != "arm64") || 30143- is_linux || is_mac || is_chromeos || is_fuchsia || is_ohos 30144+ is_linux || is_mac || is_chromeos || is_fuchsia 30145 30146 # You can set the variable 'build_with_internal_optimization_guide' to true 30147 # even in a developer build in args.gn. Setting this variable explicitly to true will 30148@@ -25,5 +25,5 @@ declare_args() { 30149 # Android and iOS should just work but are not included in the set we release for, so we do 30150 # not needlessly increase the binary. 30151 build_with_internal_optimization_guide = 30152- is_chrome_branded && !is_android && !is_ios && !is_fuchsia 30153+ is_chrome_branded && !is_android && !is_ios && !is_fuchsia && !is_ohos 30154 } 30155diff --git a/src/components/pdf/renderer/pdf_accessibility_tree.cc b/src/components/pdf/renderer/pdf_accessibility_tree.cc 30156index da26cbc03503a..a1acc80c53ea6 30157--- a/src/components/pdf/renderer/pdf_accessibility_tree.cc 30158+++ b/src/components/pdf/renderer/pdf_accessibility_tree.cc 30159@@ -665,9 +665,11 @@ class PdfAccessibilityTreeBuilder { 30160 ax::mojom::Role::kPdfActionableHighlight, 30161 ax::mojom::Restriction::kReadOnly, render_accessibility_, nodes_); 30162 30163+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 30164 highlight_node->AddStringAttribute( 30165 ax::mojom::StringAttribute::kRoleDescription, 30166 l10n_util::GetStringUTF8(IDS_AX_ROLE_DESCRIPTION_PDF_HIGHLIGHT)); 30167+#endif 30168 highlight_node->AddStringAttribute(ax::mojom::StringAttribute::kName, 30169 std::string()); 30170 highlight_node->relative_bounds.bounds = highlight.bounds; 30171@@ -683,9 +685,11 @@ class PdfAccessibilityTreeBuilder { 30172 CreateNode(ax::mojom::Role::kNote, ax::mojom::Restriction::kReadOnly, 30173 render_accessibility_, nodes_); 30174 30175+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 30176 popup_note_node->AddStringAttribute( 30177 ax::mojom::StringAttribute::kRoleDescription, 30178 l10n_util::GetStringUTF8(IDS_AX_ROLE_DESCRIPTION_PDF_POPUP_NOTE)); 30179+#endif 30180 popup_note_node->relative_bounds.bounds = highlight.bounds; 30181 30182 ui::AXNodeData* static_popup_note_text_node = CreateNode( 30183@@ -1330,9 +1334,11 @@ void PdfAccessibilityTree::SetAccessibilityDocInfo( 30184 doc_node_ = 30185 CreateNode(ax::mojom::Role::kPdfRoot, ax::mojom::Restriction::kReadOnly, 30186 render_accessibility, &nodes_); 30187+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 30188 doc_node_->AddStringAttribute(ax::mojom::StringAttribute::kName, 30189 l10n_util::GetPluralStringFUTF8( 30190 IDS_PDF_DOCUMENT_PAGE_COUNT, page_count_)); 30191+#endif 30192 30193 // Because all of the coordinates are expressed relative to the 30194 // doc's coordinates, the origin of the doc must be (0, 0). Its 30195@@ -1371,9 +1377,11 @@ void PdfAccessibilityTree::SetAccessibilityPageInfo( 30196 ui::AXNodeData* page_node = 30197 CreateNode(ax::mojom::Role::kRegion, ax::mojom::Restriction::kReadOnly, 30198 render_accessibility, &nodes_); 30199+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 30200 page_node->AddStringAttribute( 30201 ax::mojom::StringAttribute::kName, 30202 l10n_util::GetPluralStringFUTF8(IDS_PDF_PAGE_INDEX, page_index + 1)); 30203+#endif 30204 page_node->AddBoolAttribute(ax::mojom::BoolAttribute::kIsPageBreakingObject, 30205 true); 30206 30207diff --git a/src/components/pdf/renderer/pepper_pdf_host.cc b/src/components/pdf/renderer/pepper_pdf_host.cc 30208index c76d903481aca..32582622ef95a 30209--- a/src/components/pdf/renderer/pepper_pdf_host.cc 30210+++ b/src/components/pdf/renderer/pepper_pdf_host.cc 30211@@ -123,7 +123,9 @@ int32_t PepperPDFHost::OnHostMsgDidStartLoading( 30212 if (!render_frame) 30213 return PP_ERROR_FAILED; 30214 30215+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 30216 render_frame->PluginDidStartLoading(); 30217+#endif 30218 return PP_OK; 30219 } 30220 30221@@ -133,7 +135,9 @@ int32_t PepperPDFHost::OnHostMsgDidStopLoading( 30222 if (!render_frame) 30223 return PP_ERROR_FAILED; 30224 30225+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 30226 render_frame->PluginDidStopLoading(); 30227+#endif 30228 return PP_OK; 30229 } 30230 30231diff --git a/src/components/permissions/BUILD.gn b/src/components/permissions/BUILD.gn 30232index 8cbc3d9fbf84e..6f78734a9f607 30233--- a/src/components/permissions/BUILD.gn 30234+++ b/src/components/permissions/BUILD.gn 30235@@ -258,7 +258,11 @@ source_set("unit_tests") { 30236 ] 30237 } 30238 if (is_android) { 30239- sources += [ "android/permission_dialog_delegate_unittest.cc" ] 30240+ sources += [ 30241+ "android/bluetooth_chooser_android_unittest.cc", 30242+ "android/bluetooth_scanning_prompt_android_unittest.cc", 30243+ "android/permission_dialog_delegate_unittest.cc" 30244+ ] 30245 } 30246 deps = [ 30247 ":permissions", 30248@@ -271,6 +275,7 @@ source_set("unit_tests") { 30249 "//components/content_settings/core/browser", 30250 "//components/keyed_service/content", 30251 "//components/prefs:test_support", 30252+ "//components/security_state/core", 30253 "//components/strings:components_strings_grit", 30254 "//components/ukm:test_support", 30255 "//components/ukm/content", 30256@@ -289,6 +294,7 @@ source_set("unit_tests") { 30257 "//components/location/android:location_settings_dialog_enums_java", 30258 "//components/location/android:test_support", 30259 "//components/permissions/android:test_support", 30260+ "//ui/android", 30261 ] 30262 } 30263 } 30264diff --git a/src/components/permissions/android/bluetooth_chooser_android.cc b/src/components/permissions/android/bluetooth_chooser_android.cc 30265index 3ed0cbeccca6d..95d2580846d51 30266--- a/src/components/permissions/android/bluetooth_chooser_android.cc 30267+++ b/src/components/permissions/android/bluetooth_chooser_android.cc 30268@@ -6,10 +6,12 @@ 30269 30270 #include "base/android/jni_android.h" 30271 #include "base/android/jni_string.h" 30272+#include "base/functional/bind.h" 30273 #include "base/strings/utf_string_conversions.h" 30274 #include "components/permissions/android/bluetooth_chooser_android_delegate.h" 30275 #include "components/permissions/android/jni_headers/BluetoothChooserDialog_jni.h" 30276 #include "components/permissions/constants.h" 30277+#include "components/permissions/permission_util.h" 30278 #include "components/url_formatter/elide_url.h" 30279 #include "content/public/browser/render_frame_host.h" 30280 #include "ui/android/window_android.h" 30281@@ -22,14 +24,28 @@ using base::android::ScopedJavaLocalRef; 30282 30283 namespace permissions { 30284 30285+namespace { 30286+ 30287+BluetoothChooserAndroid::CreateJavaDialogCallback 30288+GetCreateJavaBluetoothChooserDialogCallback() { 30289+ return base::BindOnce(&Java_BluetoothChooserDialog_create); 30290+} 30291+ 30292+} // namespace 30293+ 30294 BluetoothChooserAndroid::BluetoothChooserAndroid( 30295 content::RenderFrameHost* frame, 30296 const EventHandler& event_handler, 30297- std::unique_ptr<BluetoothChooserAndroidDelegate> delegate) 30298+ std::unique_ptr<BluetoothChooserAndroidDelegate> delegate, 30299+ CreateJavaDialogCallback create_java_dialog_callback) 30300 : web_contents_(content::WebContents::FromRenderFrameHost(frame)), 30301 event_handler_(event_handler), 30302 delegate_(std::move(delegate)) { 30303- const url::Origin origin = frame->GetLastCommittedOrigin(); 30304+ // Permission delegation means the permission request should be attributed to 30305+ // the main frame. 30306+ const url::Origin origin = url::Origin::Create( 30307+ permissions::PermissionUtil::GetLastCommittedOriginAsURL( 30308+ frame->GetMainFrame())); 30309 DCHECK(!origin.opaque()); 30310 30311 ScopedJavaLocalRef<jobject> window_android = 30312@@ -40,12 +56,22 @@ BluetoothChooserAndroid::BluetoothChooserAndroid( 30313 ScopedJavaLocalRef<jstring> origin_string = 30314 base::android::ConvertUTF16ToJavaString( 30315 env, url_formatter::FormatOriginForSecurityDisplay(origin)); 30316- java_dialog_.Reset(Java_BluetoothChooserDialog_create( 30317- env, window_android, origin_string, 30318- delegate_->GetSecurityLevel(web_contents_), delegate_->GetJavaObject(), 30319- reinterpret_cast<intptr_t>(this))); 30320+ java_dialog_.Reset(std::move(create_java_dialog_callback) 30321+ .Run(env, window_android, origin_string, 30322+ delegate_->GetSecurityLevel(web_contents_), 30323+ delegate_->GetJavaObject(), 30324+ reinterpret_cast<intptr_t>(this))); 30325 } 30326 30327+BluetoothChooserAndroid::BluetoothChooserAndroid( 30328+ content::RenderFrameHost* frame, 30329+ const EventHandler& event_handler, 30330+ std::unique_ptr<BluetoothChooserAndroidDelegate> delegate) 30331+ : BluetoothChooserAndroid(frame, 30332+ event_handler, 30333+ std::move(delegate), 30334+ GetCreateJavaBluetoothChooserDialogCallback()) {} 30335+ 30336 BluetoothChooserAndroid::~BluetoothChooserAndroid() { 30337 if (!java_dialog_.is_null()) { 30338 Java_BluetoothChooserDialog_closeDialog(AttachCurrentThread(), 30339diff --git a/src/components/permissions/android/bluetooth_chooser_android.h b/src/components/permissions/android/bluetooth_chooser_android.h 30340index 687c9501fd78d..1c3250d673275 30341--- a/src/components/permissions/android/bluetooth_chooser_android.h 30342+++ b/src/components/permissions/android/bluetooth_chooser_android.h 30343@@ -7,7 +7,11 @@ 30344 30345 #include <memory> 30346 30347+#include "base/android/jni_android.h" 30348+#include "base/android/jni_int_wrapper.h" 30349+#include "base/android/jni_string.h" 30350 #include "base/android/scoped_java_ref.h" 30351+#include "base/memory/ptr_util.h" 30352 #include "base/memory/raw_ptr.h" 30353 #include "content/public/browser/bluetooth_chooser.h" 30354 #include "content/public/browser/web_contents.h" 30355@@ -20,6 +24,16 @@ class BluetoothChooserAndroidDelegate; 30356 // options. 30357 class BluetoothChooserAndroid : public content::BluetoothChooser { 30358 public: 30359+ // The callback type for creating the java dialog object. 30360+ using CreateJavaDialogCallback = 30361+ base::OnceCallback<base::android::ScopedJavaLocalRef<jobject>( 30362+ JNIEnv*, 30363+ const base::android::JavaRef<jobject>&, 30364+ const base::android::JavaRef<jstring>&, 30365+ JniIntWrapper, 30366+ const base::android::JavaRef<jobject>&, 30367+ jlong)>; 30368+ 30369 // Both frame and event_handler must outlive the BluetoothChooserAndroid. 30370 BluetoothChooserAndroid( 30371 content::RenderFrameHost* frame, 30372@@ -52,8 +66,26 @@ class BluetoothChooserAndroid : public content::BluetoothChooser { 30373 void ShowBluetoothAdapterOffLink(JNIEnv* env); 30374 void ShowNeedLocationPermissionLink(JNIEnv* env); 30375 30376+ static std::unique_ptr<BluetoothChooserAndroid> CreateForTesting( 30377+ content::RenderFrameHost* frame, 30378+ const EventHandler& event_handler, 30379+ std::unique_ptr<BluetoothChooserAndroidDelegate> delegate, 30380+ CreateJavaDialogCallback create_java_dialog_callback) { 30381+ // Using `new` to access a non-public constructor. 30382+ return base::WrapUnique( 30383+ new BluetoothChooserAndroid(frame, event_handler, std::move(delegate), 30384+ std::move(create_java_dialog_callback))); 30385+ } 30386+ 30387 private: 30388+ BluetoothChooserAndroid( 30389+ content::RenderFrameHost* frame, 30390+ const EventHandler& event_handler, 30391+ std::unique_ptr<BluetoothChooserAndroidDelegate> delegate, 30392+ CreateJavaDialogCallback create_java_dialog_callback); 30393+ 30394 void OpenURL(const char* url); 30395+ 30396 base::android::ScopedJavaGlobalRef<jobject> java_dialog_; 30397 30398 raw_ptr<content::WebContents> web_contents_; 30399diff --git a/src/components/permissions/android/bluetooth_chooser_android_unittest.cc b/src/components/permissions/android/bluetooth_chooser_android_unittest.cc 30400new file mode 100644 30401index 0000000000000..4eb6b6fe92048 30402--- /dev/null 30403+++ b/src/components/permissions/android/bluetooth_chooser_android_unittest.cc 30404@@ -0,0 +1,75 @@ 30405+// Copyright 2022 The Chromium Authors 30406+// Use of this source code is governed by a BSD-style license that can be 30407+// found in the LICENSE file. 30408+ 30409+#include "components/permissions/android/bluetooth_chooser_android.h" 30410+ 30411+#include <string> 30412+ 30413+#include "base/test/bind.h" 30414+#include "base/test/mock_callback.h" 30415+#include "components/permissions/android/bluetooth_chooser_android_delegate.h" 30416+#include "components/security_state/core/security_state.h" 30417+#include "content/public/browser/web_contents.h" 30418+#include "content/public/test/navigation_simulator.h" 30419+#include "content/public/test/test_renderer_host.h" 30420+#include "testing/gmock/include/gmock/gmock.h" 30421+#include "testing/gtest/include/gtest/gtest.h" 30422+#include "ui/android/window_android.h" 30423+ 30424+namespace permissions { 30425+ 30426+namespace { 30427+ 30428+using BluetoothChooserAndroidTest = content::RenderViewHostTestHarness; 30429+using testing::_; 30430+ 30431+class FakeBluetoothChooserAndroidDelegate 30432+ : public BluetoothChooserAndroidDelegate { 30433+ base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override { 30434+ return base::android::ScopedJavaLocalRef<jobject>(); 30435+ } 30436+ security_state::SecurityLevel GetSecurityLevel( 30437+ content::WebContents* web_contents) override { 30438+ return security_state::NONE; 30439+ } 30440+}; 30441+ 30442+TEST_F(BluetoothChooserAndroidTest, FrameTree) { 30443+ NavigateAndCommit(GURL("https://main-frame.com")); 30444+ content::RenderFrameHost* subframe = 30445+ content::NavigationSimulator::NavigateAndCommitFromDocument( 30446+ GURL("https://sub-frame.com"), 30447+ content::RenderFrameHostTester::For(main_rfh()) 30448+ ->AppendChild("subframe")); 30449+ 30450+ content::WebContents* web_contents = 30451+ content::WebContents::FromRenderFrameHost(main_rfh()); 30452+ std::unique_ptr<ui::WindowAndroid::ScopedWindowAndroidForTesting> window = 30453+ ui::WindowAndroid::CreateForTesting(); 30454+ window.get()->get()->AddChild(web_contents->GetNativeView()); 30455+ 30456+ base::MockCallback<BluetoothChooserAndroid::CreateJavaDialogCallback> 30457+ mock_callback; 30458+ auto origin_predicate = 30459+ [&](const base::android::JavaRef<jstring>& java_string) { 30460+ return base::android::ConvertJavaStringToUTF16( 30461+ base::android::AttachCurrentThread(), java_string) == 30462+ u"https://main-frame.com"; 30463+ }; 30464+ EXPECT_CALL(mock_callback, Run(/*env=*/_, /*window_android=*/_, 30465+ testing::Truly(origin_predicate), 30466+ /*security_level=*/_, /*delegate=*/_, 30467+ /*native_bluetooth_chooser_dialog_ptr=*/_)); 30468+ 30469+ BluetoothChooserAndroid::CreateForTesting( 30470+ subframe, 30471+ base::BindLambdaForTesting([](content::BluetoothChooserEvent evt, 30472+ const std::string& opt_device_id) {}), 30473+ std::make_unique<FakeBluetoothChooserAndroidDelegate>(), 30474+ mock_callback.Get()); 30475+} 30476+ 30477+} // namespace 30478+ 30479+} // namespace permissions 30480diff --git a/src/components/permissions/android/bluetooth_scanning_prompt_android.cc b/src/components/permissions/android/bluetooth_scanning_prompt_android.cc 30481index 2a40064829da5..66d1ba0505c58 30482--- a/src/components/permissions/android/bluetooth_scanning_prompt_android.cc 30483+++ b/src/components/permissions/android/bluetooth_scanning_prompt_android.cc 30484@@ -9,6 +9,7 @@ 30485 #include "base/strings/utf_string_conversions.h" 30486 #include "components/permissions/android/bluetooth_scanning_prompt_android_delegate.h" 30487 #include "components/permissions/android/jni_headers/BluetoothScanningPermissionDialog_jni.h" 30488+#include "components/permissions/permission_util.h" 30489 #include "components/url_formatter/elide_url.h" 30490 #include "content/public/browser/render_frame_host.h" 30491 #include "ui/android/window_android.h" 30492@@ -22,14 +23,28 @@ using base::android::ScopedJavaLocalRef; 30493 30494 namespace permissions { 30495 30496+namespace { 30497+ 30498+BluetoothScanningPromptAndroid::CreateJavaDialogCallback 30499+GetCreateJavaBluetoothScanningPromptCallback() { 30500+ return base::BindOnce(&Java_BluetoothScanningPermissionDialog_create); 30501+} 30502+ 30503+} // namespace 30504+ 30505 BluetoothScanningPromptAndroid::BluetoothScanningPromptAndroid( 30506 content::RenderFrameHost* frame, 30507 const content::BluetoothScanningPrompt::EventHandler& event_handler, 30508- std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate) 30509+ std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate, 30510+ CreateJavaDialogCallback create_java_dialog_callback) 30511 : web_contents_(content::WebContents::FromRenderFrameHost(frame)), 30512 event_handler_(event_handler), 30513 delegate_(std::move(delegate)) { 30514- const url::Origin origin = frame->GetLastCommittedOrigin(); 30515+ // Permission delegation means the permission request should be attributed to 30516+ // the main frame. 30517+ const url::Origin origin = url::Origin::Create( 30518+ permissions::PermissionUtil::GetLastCommittedOriginAsURL( 30519+ frame->GetMainFrame())); 30520 DCHECK(!origin.opaque()); 30521 30522 ScopedJavaLocalRef<jobject> window_android = 30523@@ -39,12 +54,23 @@ BluetoothScanningPromptAndroid::BluetoothScanningPromptAndroid( 30524 JNIEnv* env = AttachCurrentThread(); 30525 ScopedJavaLocalRef<jstring> origin_string = ConvertUTF16ToJavaString( 30526 env, url_formatter::FormatUrlForSecurityDisplay(origin.GetURL())); 30527- java_dialog_.Reset(Java_BluetoothScanningPermissionDialog_create( 30528- env, window_android, origin_string, 30529- delegate_->GetSecurityLevel(web_contents_), delegate_->GetJavaObject(), 30530- reinterpret_cast<intptr_t>(this))); 30531+ java_dialog_.Reset(std::move(create_java_dialog_callback) 30532+ .Run(env, window_android, origin_string, 30533+ delegate_->GetSecurityLevel(web_contents_), 30534+ delegate_->GetJavaObject(), 30535+ reinterpret_cast<intptr_t>(this))); 30536 } 30537 30538+BluetoothScanningPromptAndroid::BluetoothScanningPromptAndroid( 30539+ content::RenderFrameHost* frame, 30540+ const content::BluetoothScanningPrompt::EventHandler& event_handler, 30541+ std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate) 30542+ : BluetoothScanningPromptAndroid( 30543+ frame, 30544+ event_handler, 30545+ std::move(delegate), 30546+ GetCreateJavaBluetoothScanningPromptCallback()) {} 30547+ 30548 BluetoothScanningPromptAndroid::~BluetoothScanningPromptAndroid() { 30549 if (!java_dialog_.is_null()) { 30550 Java_BluetoothScanningPermissionDialog_closeDialog(AttachCurrentThread(), 30551diff --git a/src/components/permissions/android/bluetooth_scanning_prompt_android.h b/src/components/permissions/android/bluetooth_scanning_prompt_android.h 30552index 0e3ff03a8239f..1c5ba073da63c 30553--- a/src/components/permissions/android/bluetooth_scanning_prompt_android.h 30554+++ b/src/components/permissions/android/bluetooth_scanning_prompt_android.h 30555@@ -5,6 +5,9 @@ 30556 #ifndef COMPONENTS_PERMISSIONS_ANDROID_BLUETOOTH_SCANNING_PROMPT_ANDROID_H_ 30557 #define COMPONENTS_PERMISSIONS_ANDROID_BLUETOOTH_SCANNING_PROMPT_ANDROID_H_ 30558 30559+#include "base/android/jni_android.h" 30560+#include "base/android/jni_int_wrapper.h" 30561+#include "base/android/jni_string.h" 30562 #include "base/android/scoped_java_ref.h" 30563 #include "base/memory/raw_ptr.h" 30564 #include "content/public/browser/bluetooth_scanning_prompt.h" 30565@@ -19,6 +22,16 @@ class BluetoothScanningPromptAndroidDelegate; 30566 // devices. This implementation is for Android. 30567 class BluetoothScanningPromptAndroid : public content::BluetoothScanningPrompt { 30568 public: 30569+ // The callback type for creating the java dialog object. 30570+ using CreateJavaDialogCallback = 30571+ base::OnceCallback<base::android::ScopedJavaLocalRef<jobject>( 30572+ JNIEnv*, 30573+ const base::android::JavaRef<jobject>&, 30574+ const base::android::JavaRef<jstring>&, 30575+ JniIntWrapper, 30576+ const base::android::JavaRef<jobject>&, 30577+ jlong)>; 30578+ 30579 BluetoothScanningPromptAndroid( 30580 content::RenderFrameHost* frame, 30581 const content::BluetoothScanningPrompt::EventHandler& event_handler, 30582@@ -39,7 +52,24 @@ class BluetoothScanningPromptAndroid : public content::BluetoothScanningPrompt { 30583 // Report the dialog's result. 30584 void OnDialogFinished(JNIEnv* env, jint event_type); 30585 30586+ static std::unique_ptr<BluetoothScanningPromptAndroid> CreateForTesting( 30587+ content::RenderFrameHost* frame, 30588+ const EventHandler& event_handler, 30589+ std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate, 30590+ CreateJavaDialogCallback create_java_dialog_callback) { 30591+ // Using `new` to access a non-public constructor. 30592+ return base::WrapUnique(new BluetoothScanningPromptAndroid( 30593+ frame, event_handler, std::move(delegate), 30594+ std::move(create_java_dialog_callback))); 30595+ } 30596+ 30597 private: 30598+ BluetoothScanningPromptAndroid( 30599+ content::RenderFrameHost* frame, 30600+ const content::BluetoothScanningPrompt::EventHandler& event_handler, 30601+ std::unique_ptr<BluetoothScanningPromptAndroidDelegate> delegate, 30602+ CreateJavaDialogCallback create_java_dialog_callback); 30603+ 30604 base::android::ScopedJavaGlobalRef<jobject> java_dialog_; 30605 30606 raw_ptr<content::WebContents> web_contents_; 30607diff --git a/src/components/permissions/android/bluetooth_scanning_prompt_android_unittest.cc b/src/components/permissions/android/bluetooth_scanning_prompt_android_unittest.cc 30608new file mode 100644 30609index 0000000000000..9e2c645b890d8 30610--- /dev/null 30611+++ b/src/components/permissions/android/bluetooth_scanning_prompt_android_unittest.cc 30612@@ -0,0 +1,77 @@ 30613+// Copyright 2022 The Chromium Authors 30614+// Use of this source code is governed by a BSD-style license that can be 30615+// found in the LICENSE file. 30616+ 30617+#include "components/permissions/android/bluetooth_scanning_prompt_android.h" 30618+ 30619+#include <string> 30620+ 30621+#include "base/test/bind.h" 30622+#include "base/test/mock_callback.h" 30623+#include "components/permissions/android/bluetooth_scanning_prompt_android_delegate.h" 30624+#include "components/security_state/core/security_state.h" 30625+#include "content/public/browser/bluetooth_scanning_prompt.h" 30626+#include "content/public/browser/web_contents.h" 30627+#include "content/public/test/navigation_simulator.h" 30628+#include "content/public/test/test_renderer_host.h" 30629+#include "testing/gmock/include/gmock/gmock.h" 30630+#include "testing/gtest/include/gtest/gtest.h" 30631+#include "ui/android/window_android.h" 30632+ 30633+namespace permissions { 30634+ 30635+namespace { 30636+ 30637+using BluetoothScanningPromptAndroidTest = content::RenderViewHostTestHarness; 30638+using testing::_; 30639+ 30640+class FakeBluetoothChooserAndroidDelegate 30641+ : public BluetoothScanningPromptAndroidDelegate { 30642+ base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override { 30643+ return base::android::ScopedJavaLocalRef<jobject>(); 30644+ } 30645+ security_state::SecurityLevel GetSecurityLevel( 30646+ content::WebContents* web_contents) override { 30647+ return security_state::NONE; 30648+ } 30649+}; 30650+ 30651+TEST_F(BluetoothScanningPromptAndroidTest, FrameTree) { 30652+ NavigateAndCommit(GURL("https://main-frame.com")); 30653+ content::RenderFrameHost* subframe = 30654+ content::NavigationSimulator::NavigateAndCommitFromDocument( 30655+ GURL("https://sub-frame.com"), 30656+ content::RenderFrameHostTester::For(main_rfh()) 30657+ ->AppendChild("subframe")); 30658+ 30659+ content::WebContents* web_contents = 30660+ content::WebContents::FromRenderFrameHost(main_rfh()); 30661+ std::unique_ptr<ui::WindowAndroid::ScopedWindowAndroidForTesting> window = 30662+ ui::WindowAndroid::CreateForTesting(); 30663+ window.get()->get()->AddChild(web_contents->GetNativeView()); 30664+ 30665+ base::MockCallback<BluetoothScanningPromptAndroid::CreateJavaDialogCallback> 30666+ mock_callback; 30667+ auto origin_predicate = 30668+ [&](const base::android::JavaRef<jstring>& java_string) { 30669+ return base::android::ConvertJavaStringToUTF16( 30670+ base::android::AttachCurrentThread(), java_string) == 30671+ u"https://main-frame.com"; 30672+ }; 30673+ EXPECT_CALL( 30674+ mock_callback, 30675+ Run(/*env=*/_, /*window_android=*/_, testing::Truly(origin_predicate), 30676+ /*security_level=*/_, /*delegate=*/_, 30677+ /*native_bluetooth_scanning_prompt_dialog_ptr=*/_)); 30678+ 30679+ BluetoothScanningPromptAndroid::CreateForTesting( 30680+ subframe, 30681+ base::BindLambdaForTesting( 30682+ [](content::BluetoothScanningPrompt::Event evt) {}), 30683+ std::make_unique<FakeBluetoothChooserAndroidDelegate>(), 30684+ mock_callback.Get()); 30685+} 30686+ 30687+} // namespace 30688+ 30689+} // namespace permissions 30690diff --git a/src/content/BUILD.gn b/src/content/BUILD.gn 30691index 4f6391ff54b4f..893f267fa0c5f 30692--- a/src/content/BUILD.gn 30693+++ b/src/content/BUILD.gn 30694@@ -10,6 +10,12 @@ import("//tools/grit/grit_rule.gni") 30695 config("content_implementation") { 30696 defines = [ "CONTENT_IMPLEMENTATION" ] 30697 configs = [ "//build/config/compiler:wexit_time_destructors" ] 30698+ 30699+ # TODO(huawei): To disable PNA feature. (temporary solution) 30700+ if (is_ohos && use_musl && defined(build_with_disable_pna_mode) && 30701+ build_with_disable_pna_mode) { 30702+ defines += [ "IS_DISABLE_PNA_MODE" ] 30703+ } 30704 } 30705 30706 assert(!is_ios, "Chromium/iOS shouldn't use anything in //content") 30707diff --git a/src/content/app/content_main.cc b/src/content/app/content_main.cc 30708index e494fff1fa5d5..51ba17c117bb4 30709--- a/src/content/app/content_main.cc 30710+++ b/src/content/app/content_main.cc 30711@@ -85,7 +85,7 @@ namespace { 30712 constexpr size_t kMaximumMojoMessageSize = 128 * 1024 * 1024; 30713 30714 #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) 30715- 30716+#if !BUILDFLAG(IS_OHOS) 30717 // Setup signal-handling state: resanitize most signals, ignore SIGPIPE. 30718 void SetupSignalHandlers() { 30719 // Always ignore SIGPIPE. We check the return value of write(). 30720@@ -112,6 +112,7 @@ void SetupSignalHandlers() { 30721 for (int signal_to_reset : signals_to_reset) 30722 CHECK_EQ(0, sigaction(signal_to_reset, &sigact, nullptr)); 30723 } 30724+#endif // !BUILDFLAG(IS_OHOS) 30725 30726 void PopulateFDsFromCommandLine() { 30727 const std::string& shared_file_param = 30728@@ -304,8 +305,11 @@ int ContentMainInitialize(ContentMainParams params, 30729 // default, "C", locale. 30730 setlocale(LC_NUMERIC, "C"); 30731 30732+#if !BUILDFLAG(IS_OHOS) 30733 SetupSignalHandlers(); 30734-#endif 30735+#endif // !BUILDFLAG(IS_OHOS) 30736+ 30737+#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) 30738 30739 #if BUILDFLAG(IS_WIN) 30740 base::win::SetupCRT(*base::CommandLine::ForCurrentProcess()); 30741diff --git a/src/content/app/content_main_runner_impl.cc b/src/content/app/content_main_runner_impl.cc 30742index 7cd3565f08e99..4c81b8037ef2a 30743--- a/src/content/app/content_main_runner_impl.cc 30744+++ b/src/content/app/content_main_runner_impl.cc 30745@@ -95,6 +95,7 @@ 30746 #include "media/media_buildflags.h" 30747 #include "mojo/core/embedder/embedder.h" 30748 #include "mojo/public/cpp/bindings/self_owned_receiver.h" 30749+#include "mojo/public/cpp/bindings/sync_call_restrictions.h" 30750 #include "mojo/public/cpp/platform/platform_channel.h" 30751 #include "mojo/public/cpp/system/dynamic_library_support.h" 30752 #include "mojo/public/cpp/system/invitation.h" 30753@@ -1043,6 +1044,11 @@ int ContentMainRunnerImpl::RunBrowser(MainFunctionParams main_params, 30754 if (is_browser_main_loop_started_) 30755 return -1; 30756 30757+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 30758+ switches::kSingleProcess)) { 30759+ mojo::SyncCallRestrictions::DisableSyncCallInterrupts(); 30760+ } 30761+ 30762 bool should_start_minimal_browser = start_minimal_browser; 30763 if (!mojo_ipc_support_) { 30764 if (delegate_->ShouldCreateFeatureList()) { 30765diff --git a/src/content/browser/BUILD.gn b/src/content/browser/BUILD.gn 30766index 01159a5247e86..81479f4fb3688 30767--- a/src/content/browser/BUILD.gn 30768+++ b/src/content/browser/BUILD.gn 30769@@ -1573,6 +1573,8 @@ source_set("browser") { 30770 "renderer_host/navigation_entry_impl.h", 30771 "renderer_host/navigation_entry_restore_context_impl.cc", 30772 "renderer_host/navigation_entry_restore_context_impl.h", 30773+ "renderer_host/navigation_policy_container_builder.cc", 30774+ "renderer_host/navigation_policy_container_builder.h", 30775 "renderer_host/navigation_request.cc", 30776 "renderer_host/navigation_request.h", 30777 "renderer_host/navigation_request_info.cc", 30778@@ -1598,8 +1600,6 @@ source_set("browser") { 30779 "renderer_host/page_lifecycle_state_manager.h", 30780 "renderer_host/policy_container_host.cc", 30781 "renderer_host/policy_container_host.h", 30782- "renderer_host/policy_container_navigation_bundle.cc", 30783- "renderer_host/policy_container_navigation_bundle.h", 30784 "renderer_host/private_network_access_util.cc", 30785 "renderer_host/private_network_access_util.h", 30786 "renderer_host/recently_destroyed_hosts.cc", 30787@@ -2928,6 +2928,17 @@ source_set("browser") { 30788 30789 if (is_ohos) { 30790 sources -= [ "media/session/audio_focus_delegate_default.cc" ] 30791+ sources += [ 30792+ "font_unique_name_lookup/font_unique_name_lookup.cc", 30793+ "font_unique_name_lookup/font_unique_name_lookup.h", 30794+ "font_unique_name_lookup/font_unique_name_lookup_service.cc", 30795+ "font_unique_name_lookup/font_unique_name_lookup_service.h", 30796+ ] 30797+ 30798+ deps += [ 30799+ "//build/config/freetype", 30800+ "//third_party/blink/public/common:font_unique_name_table_proto", 30801+ ] 30802 } 30803 30804 deps += [ 30805diff --git a/src/content/browser/browser_main_loop.cc b/src/content/browser/browser_main_loop.cc 30806index 6e779e2475886..a522662120ec9 30807--- a/src/content/browser/browser_main_loop.cc 30808+++ b/src/content/browser/browser_main_loop.cc 30809@@ -172,6 +172,10 @@ 30810 #include "ui/gl/gl_surface.h" 30811 #endif 30812 30813+#if BUILDFLAG(IS_OHOS) 30814+#include "content/browser/font_unique_name_lookup/font_unique_name_lookup.h" 30815+#endif 30816+ 30817 #if BUILDFLAG(IS_MAC) 30818 #include "base/mac/scoped_nsautorelease_pool.h" 30819 #include "content/browser/renderer_host/browser_compositor_view_mac.h" 30820@@ -1409,6 +1413,12 @@ void BrowserMainLoop::PostCreateThreadsImpl() { 30821 } 30822 #endif 30823 30824+#if BUILDFLAG(IS_OHOS) 30825+ if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) { 30826+ FontUniqueNameLookup::GetInstance(); 30827+ } 30828+#endif 30829+ 30830 #if defined(ENABLE_IPC_FUZZER) 30831 SetFileUrlPathAliasForIpcFuzzer(); 30832 #endif 30833diff --git a/src/content/browser/file_system_access/fake_file_system_access_permission_context.cc b/src/content/browser/file_system_access/fake_file_system_access_permission_context.cc 30834index 52bc25f89488e..5a2133a3b6ed2 30835--- a/src/content/browser/file_system_access/fake_file_system_access_permission_context.cc 30836+++ b/src/content/browser/file_system_access/fake_file_system_access_permission_context.cc 30837@@ -35,14 +35,15 @@ FakeFileSystemAccessPermissionContext::GetWritePermissionGrant( 30838 FileSystemAccessPermissionGrant::PermissionStatus::GRANTED, path); 30839 } 30840 30841-void FakeFileSystemAccessPermissionContext::ConfirmSensitiveDirectoryAccess( 30842+void FakeFileSystemAccessPermissionContext::ConfirmSensitiveEntryAccess( 30843 const url::Origin& origin, 30844 PathType path_type, 30845 const base::FilePath& path, 30846 HandleType handle_type, 30847+ ui::SelectFileDialog::Type dialog_type, 30848 GlobalRenderFrameHostId frame_id, 30849- base::OnceCallback<void(SensitiveDirectoryResult)> callback) { 30850- std::move(callback).Run(SensitiveDirectoryResult::kAllowed); 30851+ base::OnceCallback<void(SensitiveEntryResult)> callback) { 30852+ std::move(callback).Run(SensitiveEntryResult::kAllowed); 30853 } 30854 #if BUILDFLAG(SAFE_BROWSING_AVAILABLE) 30855 void FakeFileSystemAccessPermissionContext::PerformAfterWriteChecks( 30856diff --git a/src/content/browser/file_system_access/fake_file_system_access_permission_context.h b/src/content/browser/file_system_access/fake_file_system_access_permission_context.h 30857index d6d546cbba6eb..a780d27c02399 30858--- a/src/content/browser/file_system_access/fake_file_system_access_permission_context.h 30859+++ b/src/content/browser/file_system_access/fake_file_system_access_permission_context.h 30860@@ -4,6 +4,7 @@ 30861 30862 #include "base/files/file_path.h" 30863 #include "content/public/browser/file_system_access_permission_context.h" 30864+#include "ui/shell_dialogs/select_file_dialog.h" 30865 30866 #ifndef CONTENT_BROWSER_FILE_SYSTEM_ACCESS_FAKE_FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_H_ 30867 #define CONTENT_BROWSER_FILE_SYSTEM_ACCESS_FAKE_FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_H_ 30868@@ -32,13 +33,14 @@ class FakeFileSystemAccessPermissionContext 30869 HandleType handle_type, 30870 UserAction user_action) override; 30871 30872- void ConfirmSensitiveDirectoryAccess( 30873+ void ConfirmSensitiveEntryAccess( 30874 const url::Origin& origin, 30875 PathType path_type, 30876 const base::FilePath& path, 30877 HandleType handle_type, 30878+ ui::SelectFileDialog::Type dialog_type, 30879 GlobalRenderFrameHostId frame_id, 30880- base::OnceCallback<void(SensitiveDirectoryResult)> callback) override; 30881+ base::OnceCallback<void(SensitiveEntryResult)> callback) override; 30882 #if BUILDFLAG(SAFE_BROWSING_AVAILABLE) 30883 void PerformAfterWriteChecks( 30884 std::unique_ptr<FileSystemAccessWriteItem> item, 30885diff --git a/src/content/browser/file_system_access/file_system_access_directory_handle_impl.cc b/src/content/browser/file_system_access/file_system_access_directory_handle_impl.cc 30886index 1775dc49414ca..a7503d4b64c53 30887--- a/src/content/browser/file_system_access/file_system_access_directory_handle_impl.cc 30888+++ b/src/content/browser/file_system_access/file_system_access_directory_handle_impl.cc 30889@@ -438,10 +438,16 @@ namespace { 30890 bool IsShellIntegratedExtension(const base::FilePath::StringType& extension) { 30891 base::FilePath::StringType extension_lower = base::ToLowerASCII(extension); 30892 30893- // .lnk files may be used to execute arbitrary code (see 30894- // https://nvd.nist.gov/vuln/detail/CVE-2010-2568). 30895- if (extension_lower == FILE_PATH_LITERAL("lnk")) 30896+ // .lnk and .scf files may be used to execute arbitrary code (see 30897+ // https://nvd.nist.gov/vuln/detail/CVE-2010-2568 and 30898+ // https://crbug.com/1227995, respectively). '.url' files can be used to read 30899+ // arbitrary files (see https://crbug.com/1307930 and 30900+ // https://crbug.com/1354518). 30901+ if (extension_lower == FILE_PATH_LITERAL("lnk") || 30902+ extension_lower == FILE_PATH_LITERAL("scf") || 30903+ extension_lower == FILE_PATH_LITERAL("url")) { 30904 return true; 30905+ } 30906 30907 // Setting a file's extension to a CLSID may conceal its actual file type on 30908 // some Windows versions (see https://nvd.nist.gov/vuln/detail/CVE-2004-0420). 30909diff --git a/src/content/browser/file_system_access/file_system_access_directory_handle_impl_unittest.cc b/src/content/browser/file_system_access/file_system_access_directory_handle_impl_unittest.cc 30910index aeeb3d84b0b78..0804886d4140d 30911--- a/src/content/browser/file_system_access/file_system_access_directory_handle_impl_unittest.cc 30912+++ b/src/content/browser/file_system_access/file_system_access_directory_handle_impl_unittest.cc 30913@@ -140,6 +140,7 @@ TEST_F(FileSystemAccessDirectoryHandleImplTest, IsSafePathComponent) { 30914 "My Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 30915 "a\\a", 30916 "a.lnk", 30917+ "a.url", 30918 "a/a", 30919 "C:\\", 30920 "C:/", 30921@@ -195,8 +196,8 @@ TEST_F(FileSystemAccessDirectoryHandleImplTest, GetEntries) { 30922 constexpr const char* kSafeNames[] = {"a", "a.txt", "My Computer", "lnk.txt", 30923 "a.local"}; 30924 constexpr const char* kUnsafeNames[] = { 30925- "con", "con.zip", "NUL", "a.", 30926- "a\"a", "a . .", "a.lnk", "My Computer.{a}", 30927+ "con", "con.zip", "NUL", "a.", "a\"a", "a . .", 30928+ "a.lnk", "My Computer.{a}", "a.url", 30929 }; 30930 for (const char* name : kSafeNames) { 30931 ASSERT_TRUE(base::WriteFile(dir_.GetPath().AppendASCII(name), "data")) 30932diff --git a/src/content/browser/file_system_access/file_system_access_manager_impl.cc b/src/content/browser/file_system_access/file_system_access_manager_impl.cc 30933index 565759710073e..d32baf6794e10 30934--- a/src/content/browser/file_system_access/file_system_access_manager_impl.cc 30935+++ b/src/content/browser/file_system_access/file_system_access_manager_impl.cc 30936@@ -63,8 +63,8 @@ namespace content { 30937 30938 using blink::mojom::FileSystemAccessStatus; 30939 using PermissionStatus = FileSystemAccessPermissionGrant::PermissionStatus; 30940-using SensitiveDirectoryResult = 30941- FileSystemAccessPermissionContext::SensitiveDirectoryResult; 30942+using SensitiveEntryResult = 30943+ FileSystemAccessPermissionContext::SensitiveEntryResult; 30944 using storage::FileSystemContext; 30945 using HandleType = FileSystemAccessPermissionContext::HandleType; 30946 using PathInfo = FileSystemAccessPermissionContext::PathInfo; 30947@@ -1130,7 +1130,7 @@ void FileSystemAccessManagerImpl::DidChooseEntries( 30948 DidVerifySensitiveDirectoryAccess( 30949 binding_context, options, starting_directory_id, 30950 request_directory_write_access, std::move(callback), std::move(entries), 30951- SensitiveDirectoryResult::kAllowed); 30952+ SensitiveEntryResult::kAllowed); 30953 return; 30954 } 30955 30956@@ -1140,9 +1140,9 @@ void FileSystemAccessManagerImpl::DidChooseEntries( 30957 FileSystemChooser::ResultEntry first_entry = entries.front(); 30958 const bool is_directory = 30959 options.type() == ui::SelectFileDialog::SELECT_FOLDER; 30960- permission_context_->ConfirmSensitiveDirectoryAccess( 30961+ permission_context_->ConfirmSensitiveEntryAccess( 30962 binding_context.storage_key.origin(), first_entry.type, first_entry.path, 30963- is_directory ? HandleType::kDirectory : HandleType::kFile, 30964+ is_directory ? HandleType::kDirectory : HandleType::kFile, options.type(), 30965 binding_context.frame_id, 30966 base::BindOnce( 30967 &FileSystemAccessManagerImpl::DidVerifySensitiveDirectoryAccess, 30968@@ -1158,19 +1158,19 @@ void FileSystemAccessManagerImpl::DidVerifySensitiveDirectoryAccess( 30969 const bool request_directory_write_access, 30970 ChooseEntriesCallback callback, 30971 std::vector<FileSystemChooser::ResultEntry> entries, 30972- SensitiveDirectoryResult result) { 30973+ SensitiveEntryResult result) { 30974 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 30975 base::UmaHistogramEnumeration( 30976 "NativeFileSystemAPI.SensitiveDirectoryAccessResult", result); 30977 30978- if (result == SensitiveDirectoryResult::kAbort) { 30979+ if (result == SensitiveEntryResult::kAbort) { 30980 std::move(callback).Run( 30981 file_system_access_error::FromStatus( 30982 FileSystemAccessStatus::kOperationAborted), 30983 std::vector<blink::mojom::FileSystemAccessEntryPtr>()); 30984 return; 30985 } 30986- if (result == SensitiveDirectoryResult::kTryAgain) { 30987+ if (result == SensitiveEntryResult::kTryAgain) { 30988 ShowFilePickerOnUIThread( 30989 binding_context.storage_key.origin(), binding_context.frame_id, options, 30990 base::BindOnce(&FileSystemAccessManagerImpl::DidChooseEntries, 30991diff --git a/src/content/browser/file_system_access/file_system_access_manager_impl.h b/src/content/browser/file_system_access/file_system_access_manager_impl.h 30992index 0eb9f30199951..ac5929c5d6ac8 30993--- a/src/content/browser/file_system_access/file_system_access_manager_impl.h 30994+++ b/src/content/browser/file_system_access/file_system_access_manager_impl.h 30995@@ -399,7 +399,7 @@ class CONTENT_EXPORT FileSystemAccessManagerImpl 30996 bool request_directory_write_access, 30997 ChooseEntriesCallback callback, 30998 std::vector<FileSystemChooser::ResultEntry> entries, 30999- FileSystemAccessPermissionContext::SensitiveDirectoryResult result); 31000+ FileSystemAccessPermissionContext::SensitiveEntryResult result); 31001 void DidCreateAndTruncateSaveFile(const BindingContext& binding_context, 31002 const FileSystemChooser::ResultEntry& entry, 31003 const storage::FileSystemURL& url, 31004diff --git a/src/content/browser/file_system_access/file_system_access_manager_impl_unittest.cc b/src/content/browser/file_system_access/file_system_access_manager_impl_unittest.cc 31005index c2a4e1ef54f10..3647391f31879 31006--- a/src/content/browser/file_system_access/file_system_access_manager_impl_unittest.cc 31007+++ b/src/content/browser/file_system_access/file_system_access_manager_impl_unittest.cc 31008@@ -48,6 +48,7 @@ 31009 #include "third_party/blink/public/mojom/file_system_access/file_system_access_data_transfer_token.mojom.h" 31010 #include "third_party/blink/public/mojom/file_system_access/file_system_access_manager.mojom-forward.h" 31011 #include "third_party/blink/public/mojom/file_system_access/file_system_access_manager.mojom-shared.h" 31012+#include "ui/shell_dialogs/select_file_dialog.h" 31013 #include "url/gurl.h" 31014 31015 namespace content { 31016@@ -1209,13 +1210,14 @@ TEST_F(FileSystemAccessManagerImplTest, ChooseEntries_OpenFile) { 31017 31018 EXPECT_CALL( 31019 permission_context_, 31020- ConfirmSensitiveDirectoryAccess_( 31021+ ConfirmSensitiveEntryAccess_( 31022 kTestStorageKey.origin(), 31023 FileSystemAccessPermissionContext::PathType::kLocal, test_file, 31024 FileSystemAccessPermissionContext::HandleType::kFile, 31025+ ui::SelectFileDialog::Type::SELECT_OPEN_FILE, 31026 web_contents_->GetMainFrame()->GetGlobalId(), testing::_)) 31027- .WillOnce(RunOnceCallback<5>(FileSystemAccessPermissionContext:: 31028- SensitiveDirectoryResult::kAllowed)); 31029+ .WillOnce(RunOnceCallback<6>( 31030+ FileSystemAccessPermissionContext::SensitiveEntryResult::kAllowed)); 31031 31032 EXPECT_CALL(permission_context_, 31033 GetReadPermissionGrant( 31034@@ -1291,13 +1293,14 @@ TEST_F(FileSystemAccessManagerImplTest, ChooseEntries_SaveFile) { 31035 31036 EXPECT_CALL( 31037 permission_context_, 31038- ConfirmSensitiveDirectoryAccess_( 31039+ ConfirmSensitiveEntryAccess_( 31040 kTestStorageKey.origin(), 31041 FileSystemAccessPermissionContext::PathType::kLocal, test_file, 31042 FileSystemAccessPermissionContext::HandleType::kFile, 31043+ ui::SelectFileDialog::Type::SELECT_SAVEAS_FILE, 31044 web_contents_->GetMainFrame()->GetGlobalId(), testing::_)) 31045- .WillOnce(RunOnceCallback<5>(FileSystemAccessPermissionContext:: 31046- SensitiveDirectoryResult::kAllowed)); 31047+ .WillOnce(RunOnceCallback<6>( 31048+ FileSystemAccessPermissionContext::SensitiveEntryResult::kAllowed)); 31049 31050 EXPECT_CALL(permission_context_, 31051 GetReadPermissionGrant( 31052@@ -1368,13 +1371,14 @@ TEST_F(FileSystemAccessManagerImplTest, ChooseEntries_OpenDirectory) { 31053 test_dir, PathType::kLocal)); 31054 31055 EXPECT_CALL(permission_context_, 31056- ConfirmSensitiveDirectoryAccess_( 31057+ ConfirmSensitiveEntryAccess_( 31058 kTestStorageKey.origin(), 31059 FileSystemAccessPermissionContext::PathType::kLocal, test_dir, 31060 FileSystemAccessPermissionContext::HandleType::kDirectory, 31061+ ui::SelectFileDialog::Type::SELECT_FOLDER, 31062 web_contents_->GetMainFrame()->GetGlobalId(), testing::_)) 31063- .WillOnce(RunOnceCallback<5>(FileSystemAccessPermissionContext:: 31064- SensitiveDirectoryResult::kAllowed)); 31065+ .WillOnce(RunOnceCallback<6>( 31066+ FileSystemAccessPermissionContext::SensitiveEntryResult::kAllowed)); 31067 31068 EXPECT_CALL(permission_context_, 31069 GetReadPermissionGrant( 31070diff --git a/src/content/browser/file_system_access/file_system_chooser_browsertest.cc b/src/content/browser/file_system_access/file_system_chooser_browsertest.cc 31071index e8923771ffabf..60ae57da546b1 31072--- a/src/content/browser/file_system_access/file_system_chooser_browsertest.cc 31073+++ b/src/content/browser/file_system_access/file_system_chooser_browsertest.cc 31074@@ -44,8 +44,8 @@ namespace content { 31075 31076 using base::test::RunOnceCallback; 31077 using blink::mojom::PermissionStatus; 31078-using SensitiveDirectoryResult = 31079- FileSystemAccessPermissionContext::SensitiveDirectoryResult; 31080+using SensitiveEntryResult = 31081+ FileSystemAccessPermissionContext::SensitiveEntryResult; 31082 using PathInfo = FileSystemAccessPermissionContext::PathInfo; 31083 using PathType = FileSystemAccessPermissionContext::PathType; 31084 31085@@ -507,12 +507,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, OpenDirectory_DenyAccess) { 31086 SetLastPickedDirectory(origin, std::string(), test_dir, 31087 PathType::kLocal)); 31088 31089- EXPECT_CALL(permission_context, 31090- ConfirmSensitiveDirectoryAccess_( 31091- origin, PathType::kLocal, test_dir, 31092- FileSystemAccessPermissionContext::HandleType::kDirectory, 31093- frame_id, testing::_)) 31094- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAllowed)); 31095+ EXPECT_CALL( 31096+ permission_context, 31097+ ConfirmSensitiveEntryAccess_( 31098+ origin, PathType::kLocal, test_dir, 31099+ FileSystemAccessPermissionContext::HandleType::kDirectory, 31100+ ui::SelectFileDialog::Type::SELECT_FOLDER, frame_id, testing::_)) 31101+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAllowed)); 31102 31103 EXPECT_CALL(permission_context, 31104 GetReadPermissionGrant( 31105@@ -585,12 +586,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, 31106 SetLastPickedDirectory(origin, std::string(), test_dir, 31107 PathType::kLocal)); 31108 31109- EXPECT_CALL(permission_context, 31110- ConfirmSensitiveDirectoryAccess_( 31111- origin, PathType::kLocal, test_dir, 31112- FileSystemAccessPermissionContext::HandleType::kDirectory, 31113- frame_id, testing::_)) 31114- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAllowed)); 31115+ EXPECT_CALL( 31116+ permission_context, 31117+ ConfirmSensitiveEntryAccess_( 31118+ origin, PathType::kLocal, test_dir, 31119+ FileSystemAccessPermissionContext::HandleType::kDirectory, 31120+ ui::SelectFileDialog::Type::SELECT_FOLDER, frame_id, testing::_)) 31121+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAllowed)); 31122 31123 EXPECT_CALL(permission_context, 31124 GetReadPermissionGrant( 31125@@ -670,12 +672,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, 31126 SetLastPickedDirectory(origin, std::string(), test_dir, 31127 PathType::kLocal)); 31128 31129- EXPECT_CALL(permission_context, 31130- ConfirmSensitiveDirectoryAccess_( 31131- origin, PathType::kLocal, test_dir, 31132- FileSystemAccessPermissionContext::HandleType::kDirectory, 31133- frame_id, testing::_)) 31134- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAllowed)); 31135+ EXPECT_CALL( 31136+ permission_context, 31137+ ConfirmSensitiveEntryAccess_( 31138+ origin, PathType::kLocal, test_dir, 31139+ FileSystemAccessPermissionContext::HandleType::kDirectory, 31140+ ui::SelectFileDialog::Type::SELECT_FOLDER, frame_id, testing::_)) 31141+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAllowed)); 31142 31143 EXPECT_CALL(permission_context, 31144 GetReadPermissionGrant( 31145@@ -760,12 +763,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, 31146 EXPECT_CALL(permission_context, GetLastPickedDirectory(origin, std::string())) 31147 .WillOnce(testing::Return(PathInfo())); 31148 31149- EXPECT_CALL(permission_context, 31150- ConfirmSensitiveDirectoryAccess_( 31151- origin, PathType::kLocal, test_file, 31152- FileSystemAccessPermissionContext::HandleType::kFile, 31153- frame_id, testing::_)) 31154- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAbort)); 31155+ EXPECT_CALL( 31156+ permission_context, 31157+ ConfirmSensitiveEntryAccess_( 31158+ origin, PathType::kLocal, test_file, 31159+ FileSystemAccessPermissionContext::HandleType::kFile, 31160+ ui::SelectFileDialog::Type::SELECT_SAVEAS_FILE, frame_id, testing::_)) 31161+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAbort)); 31162 31163 ASSERT_TRUE( 31164 NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html"))); 31165@@ -823,12 +827,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, 31166 EXPECT_CALL(permission_context, GetLastPickedDirectory(origin, std::string())) 31167 .WillOnce(testing::Return(PathInfo())); 31168 31169- EXPECT_CALL(permission_context, 31170- ConfirmSensitiveDirectoryAccess_( 31171- origin, PathType::kLocal, test_file, 31172- FileSystemAccessPermissionContext::HandleType::kFile, 31173- frame_id, testing::_)) 31174- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAbort)); 31175+ EXPECT_CALL( 31176+ permission_context, 31177+ ConfirmSensitiveEntryAccess_( 31178+ origin, PathType::kLocal, test_file, 31179+ FileSystemAccessPermissionContext::HandleType::kFile, 31180+ ui::SelectFileDialog::Type::SELECT_SAVEAS_FILE, frame_id, testing::_)) 31181+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAbort)); 31182 31183 ASSERT_TRUE( 31184 NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html"))); 31185@@ -960,12 +965,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, 31186 SetLastPickedDirectory(origin, std::string(), test_dir, 31187 PathType::kLocal)); 31188 31189- EXPECT_CALL(permission_context, 31190- ConfirmSensitiveDirectoryAccess_( 31191- origin, PathType::kLocal, test_dir, 31192- FileSystemAccessPermissionContext::HandleType::kDirectory, 31193- frame_id, testing::_)) 31194- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAllowed)); 31195+ EXPECT_CALL( 31196+ permission_context, 31197+ ConfirmSensitiveEntryAccess_( 31198+ origin, PathType::kLocal, test_dir, 31199+ FileSystemAccessPermissionContext::HandleType::kDirectory, 31200+ ui::SelectFileDialog::Type::SELECT_FOLDER, frame_id, testing::_)) 31201+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAllowed)); 31202 31203 EXPECT_CALL(permission_context, 31204 GetReadPermissionGrant( 31205@@ -1050,12 +1056,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, 31206 SetLastPickedDirectory(origin, std::string(), test_dir, 31207 PathType::kLocal)); 31208 31209- EXPECT_CALL(permission_context, 31210- ConfirmSensitiveDirectoryAccess_( 31211- origin, PathType::kLocal, test_dir, 31212- FileSystemAccessPermissionContext::HandleType::kDirectory, 31213- frame_id, testing::_)) 31214- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAllowed)); 31215+ EXPECT_CALL( 31216+ permission_context, 31217+ ConfirmSensitiveEntryAccess_( 31218+ origin, PathType::kLocal, test_dir, 31219+ FileSystemAccessPermissionContext::HandleType::kDirectory, 31220+ ui::SelectFileDialog::Type::SELECT_FOLDER, frame_id, testing::_)) 31221+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAllowed)); 31222 31223 EXPECT_CALL(permission_context, 31224 GetReadPermissionGrant( 31225@@ -1134,12 +1141,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, 31226 SetLastPickedDirectory(origin, std::string(), test_dir, 31227 PathType::kLocal)); 31228 31229- EXPECT_CALL(permission_context, 31230- ConfirmSensitiveDirectoryAccess_( 31231- origin, PathType::kLocal, test_dir, 31232- FileSystemAccessPermissionContext::HandleType::kDirectory, 31233- frame_id, testing::_)) 31234- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAllowed)); 31235+ EXPECT_CALL( 31236+ permission_context, 31237+ ConfirmSensitiveEntryAccess_( 31238+ origin, PathType::kLocal, test_dir, 31239+ FileSystemAccessPermissionContext::HandleType::kDirectory, 31240+ ui::SelectFileDialog::Type::SELECT_FOLDER, frame_id, testing::_)) 31241+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAllowed)); 31242 31243 EXPECT_CALL(permission_context, 31244 GetReadPermissionGrant( 31245@@ -1226,12 +1234,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, 31246 SetLastPickedDirectory(origin, std::string(), test_dir, 31247 PathType::kLocal)); 31248 31249- EXPECT_CALL(permission_context, 31250- ConfirmSensitiveDirectoryAccess_( 31251- origin, PathType::kLocal, test_dir, 31252- FileSystemAccessPermissionContext::HandleType::kDirectory, 31253- frame_id, testing::_)) 31254- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAllowed)); 31255+ EXPECT_CALL( 31256+ permission_context, 31257+ ConfirmSensitiveEntryAccess_( 31258+ origin, PathType::kLocal, test_dir, 31259+ FileSystemAccessPermissionContext::HandleType::kDirectory, 31260+ ui::SelectFileDialog::Type::SELECT_FOLDER, frame_id, testing::_)) 31261+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAllowed)); 31262 31263 EXPECT_CALL(permission_context, 31264 GetReadPermissionGrant( 31265@@ -1317,12 +1326,13 @@ IN_PROC_BROWSER_TEST_F(FileSystemChooserBrowserTest, 31266 SetLastPickedDirectory(origin, std::string(), test_dir, 31267 PathType::kLocal)); 31268 31269- EXPECT_CALL(permission_context, 31270- ConfirmSensitiveDirectoryAccess_( 31271- origin, PathType::kLocal, test_dir, 31272- FileSystemAccessPermissionContext::HandleType::kDirectory, 31273- frame_id, testing::_)) 31274- .WillOnce(RunOnceCallback<5>(SensitiveDirectoryResult::kAllowed)); 31275+ EXPECT_CALL( 31276+ permission_context, 31277+ ConfirmSensitiveEntryAccess_( 31278+ origin, PathType::kLocal, test_dir, 31279+ FileSystemAccessPermissionContext::HandleType::kDirectory, 31280+ ui::SelectFileDialog::Type::SELECT_FOLDER, frame_id, testing::_)) 31281+ .WillOnce(RunOnceCallback<6>(SensitiveEntryResult::kAllowed)); 31282 31283 EXPECT_CALL(permission_context, 31284 GetReadPermissionGrant( 31285diff --git a/src/content/browser/file_system_access/mock_file_system_access_permission_context.cc b/src/content/browser/file_system_access/mock_file_system_access_permission_context.cc 31286index a2393cf6cf676..8935683bc449e 31287--- a/src/content/browser/file_system_access/mock_file_system_access_permission_context.cc 31288+++ b/src/content/browser/file_system_access/mock_file_system_access_permission_context.cc 31289@@ -11,15 +11,16 @@ MockFileSystemAccessPermissionContext::MockFileSystemAccessPermissionContext() = 31290 MockFileSystemAccessPermissionContext:: 31291 ~MockFileSystemAccessPermissionContext() = default; 31292 31293-void MockFileSystemAccessPermissionContext::ConfirmSensitiveDirectoryAccess( 31294+void MockFileSystemAccessPermissionContext::ConfirmSensitiveEntryAccess( 31295 const url::Origin& origin, 31296 PathType path_type, 31297 const base::FilePath& path, 31298 HandleType handle_type, 31299+ ui::SelectFileDialog::Type dialog_type, 31300 GlobalRenderFrameHostId frame_id, 31301- base::OnceCallback<void(SensitiveDirectoryResult)> callback) { 31302- ConfirmSensitiveDirectoryAccess_(origin, path_type, path, handle_type, 31303- frame_id, callback); 31304+ base::OnceCallback<void(SensitiveEntryResult)> callback) { 31305+ ConfirmSensitiveEntryAccess_(origin, path_type, path, handle_type, 31306+ dialog_type, frame_id, callback); 31307 } 31308 #if BUILDFLAG(SAFE_BROWSING_AVAILABLE) 31309 void MockFileSystemAccessPermissionContext::PerformAfterWriteChecks( 31310diff --git a/src/content/browser/file_system_access/mock_file_system_access_permission_context.h b/src/content/browser/file_system_access/mock_file_system_access_permission_context.h 31311index 4413df8a03df3..4dc25d0913484 31312--- a/src/content/browser/file_system_access/mock_file_system_access_permission_context.h 31313+++ b/src/content/browser/file_system_access/mock_file_system_access_permission_context.h 31314@@ -33,21 +33,23 @@ class MockFileSystemAccessPermissionContext 31315 FileSystemAccessPermissionContext::UserAction user_action), 31316 (override)); 31317 31318- void ConfirmSensitiveDirectoryAccess( 31319+ void ConfirmSensitiveEntryAccess( 31320 const url::Origin& origin, 31321 PathType path_type, 31322 const base::FilePath& path, 31323 HandleType handle_type, 31324+ ui::SelectFileDialog::Type dialog_type, 31325 GlobalRenderFrameHostId frame_id, 31326- base::OnceCallback<void(SensitiveDirectoryResult)> callback) override; 31327+ base::OnceCallback<void(SensitiveEntryResult)> callback) override; 31328 MOCK_METHOD(void, 31329- ConfirmSensitiveDirectoryAccess_, 31330+ ConfirmSensitiveEntryAccess_, 31331 (const url::Origin& origin, 31332 PathType path_type, 31333 const base::FilePath& path, 31334 HandleType handle_type, 31335+ ui::SelectFileDialog::Type dialog_type, 31336 GlobalRenderFrameHostId frame_id, 31337- base::OnceCallback<void(SensitiveDirectoryResult)>& callback)); 31338+ base::OnceCallback<void(SensitiveEntryResult)>& callback)); 31339 #if BUILDFLAG(SAFE_BROWSING_AVAILABLE) 31340 void PerformAfterWriteChecks( 31341 std::unique_ptr<FileSystemAccessWriteItem> item, 31342diff --git a/src/content/browser/font_unique_name_lookup/font_unique_name_lookup.cc b/src/content/browser/font_unique_name_lookup/font_unique_name_lookup.cc 31343index 078ab88405614..c1914e9d800e5 31344--- a/src/content/browser/font_unique_name_lookup/font_unique_name_lookup.cc 31345+++ b/src/content/browser/font_unique_name_lookup/font_unique_name_lookup.cc 31346@@ -34,8 +34,14 @@ namespace { 31347 // counting up after the dash "-1", "-2", etc. 31348 const char kFingerprintSuffixForceUpdateCache[] = "-1"; 31349 const char kProtobufFilename[] = "font_unique_name_table.pb"; 31350+#if BUILDFLAG(IS_OHOS) 31351+// This may be add continue. 31352+static const char* const kOhosFontPaths[] = { 31353+ "/system/fonts"}; 31354+#else 31355 static const char* const kAndroidFontPaths[] = { 31356 "/system/fonts", "/vendor/fonts", "/product/fonts"}; 31357+#endif 31358 31359 bool IsRelevantNameRecord(const FT_SfntName& sfnt_name) { 31360 if (sfnt_name.name_id != TT_NAME_ID_FULL_NAME && 31361@@ -316,18 +322,27 @@ base::FilePath FontUniqueNameLookup::TableCacheFilePath() { 31362 } 31363 31364 std::string FontUniqueNameLookup::GetAndroidBuildFingerprint() const { 31365+#if BUILDFLAG(IS_OHOS) 31366+ // Here temporary return kFingerprintSuffixForceUpdateCache. 31367+ return std::string(kFingerprintSuffixForceUpdateCache); 31368+#else 31369 return android_build_fingerprint_for_testing_.size() 31370 ? android_build_fingerprint_for_testing_ 31371 : std::string(base::android::BuildInfo::GetInstance() 31372 ->android_build_fp()) + 31373 std::string(kFingerprintSuffixForceUpdateCache); 31374+#endif 31375 } 31376 31377 std::vector<std::string> FontUniqueNameLookup::GetFontFilePaths() const { 31378 if (font_file_paths_for_testing_.size()) 31379 return font_file_paths_for_testing_; 31380 std::vector<std::string> font_files; 31381+#if BUILDFLAG(IS_OHOS) 31382+ for (const char* font_dir_path : kOhosFontPaths) { 31383+#else 31384 for (const char* font_dir_path : kAndroidFontPaths) { 31385+#endif 31386 base::FileEnumerator files_enumerator( 31387 base::MakeAbsoluteFilePath(base::FilePath(font_dir_path)), true, 31388 base::FileEnumerator::FILES); 31389diff --git a/src/content/browser/log_console_message.cc b/src/content/browser/log_console_message.cc 31390index 8b9c6c2b48357..ebb548c9f74b5 31391--- a/src/content/browser/log_console_message.cc 31392+++ b/src/content/browser/log_console_message.cc 31393@@ -35,9 +35,11 @@ void LogConsoleMessage(blink::mojom::ConsoleMessageLevel log_level, 31394 if (!base::FeatureList::IsEnabled(features::kLogJsConsoleMessages)) 31395 return; 31396 31397+#if !BUILDFLAG(IS_OHOS) 31398 logging::LogMessage("CONSOLE", line_number, resolved_level).stream() 31399 << "\"" << message << "\", source: " << source_id << " (" << line_number 31400 << ")"; 31401+#endif 31402 } 31403 31404 } // namespace content 31405diff --git a/src/content/browser/media/session/audio_focus_delegate_ohos.cc b/src/content/browser/media/session/audio_focus_delegate_ohos.cc 31406index fefdd09118293..e490242c76b98 31407--- a/src/content/browser/media/session/audio_focus_delegate_ohos.cc 31408+++ b/src/content/browser/media/session/audio_focus_delegate_ohos.cc 31409@@ -7,6 +7,7 @@ 31410 #include "audio_renderer_adapter.h" 31411 #include "audio_system_manager_adapter.h" 31412 #include "content/browser/media/session/media_session_impl.h" 31413+#include "content/public/common/content_switches.h" 31414 #include "media/base/media_switches.h" 31415 #include "ohos_adapter_helper.h" 31416 31417@@ -43,6 +44,12 @@ AudioFocusDelegateOHOS::~AudioFocusDelegateOHOS() {} 31418 31419 AudioFocusDelegate::AudioFocusResult AudioFocusDelegateOHOS::RequestAudioFocus( 31420 media_session::mojom::AudioFocusType audio_focus_type) { 31421+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 31422+ bool hasEnhanceFlag = command_line->HasSwitch(::switches::kOhosHanceSurface); 31423+ if (hasEnhanceFlag) { 31424+ LOG(ERROR) << "audio focus is not support in enhance"; 31425+ return AudioFocusDelegate::AudioFocusResult::kSuccess; 31426+ } 31427 int32_t ret = OhosAdapterHelper::GetInstance() 31428 .GetAudioSystemManager() 31429 .RequestAudioFocus(kAudioInterrupt); 31430diff --git a/src/content/browser/renderer_host/input/input_router_impl.cc b/src/content/browser/renderer_host/input/input_router_impl.cc 31431index 610c8e7c92f15..5edac43d07f0d 31432--- a/src/content/browser/renderer_host/input/input_router_impl.cc 31433+++ b/src/content/browser/renderer_host/input/input_router_impl.cc 31434@@ -143,7 +143,12 @@ void InputRouterImpl::SendGestureEvent( 31435 #if BUILDFLAG(IS_OHOS) 31436 if (gesture_event.event.GetType() == 31437 WebInputEvent::Type::kGestureFlingStart) { 31438- client_->GetWidgetInputHandler()->StartFling(); 31439+ LOG(INFO) << "InputRouterImpl::SendGestureEvent type=kGestureFlingStart"; 31440+ client_->GetWidgetInputHandler()->TryStartFling(); 31441+ } else if (gesture_event.event.GetType() == 31442+ WebInputEvent::Type::kGestureScrollEnd) { 31443+ LOG(INFO) << "InputRouterImpl::SendGestureEvent type=kGestureScrollEnd"; 31444+ client_->GetWidgetInputHandler()->TryFinishFling(); 31445 } 31446 #endif 31447 if (gesture_event_queue_.PassToFlingController(gesture_event)) { 31448diff --git a/src/content/browser/renderer_host/navigation_controller_impl.cc b/src/content/browser/renderer_host/navigation_controller_impl.cc 31449index acdfd7ca2d8a9..a8a1897bb3fbd 31450--- a/src/content/browser/renderer_host/navigation_controller_impl.cc 31451+++ b/src/content/browser/renderer_host/navigation_controller_impl.cc 31452@@ -4504,4 +4504,17 @@ bool NavigationControllerImpl::ShouldMaintainTrivialSessionHistory( 31453 frame_tree_node->IsInFencedFrameTree(); 31454 } 31455 31456+#if BUILDFLAG(IS_OHOS) 31457+const std::string& NavigationControllerImpl::GetOriginalUrl() { 31458+ int cur_index = GetCurrentEntryIndex(); 31459+ int count = GetEntryCount(); 31460+ if (cur_index >= 0 && cur_index < count) { 31461+ NavigationEntryImpl* entry = GetEntryAtIndex(cur_index); 31462+ if (entry) { 31463+ return entry->GetOriginalRequestURL().spec(); 31464+ } 31465+ } 31466+ return base::EmptyString(); 31467+} 31468+#endif 31469 } // namespace content 31470diff --git a/src/content/browser/renderer_host/navigation_controller_impl.h b/src/content/browser/renderer_host/navigation_controller_impl.h 31471index ba66086facc2e..5fe2de91ef401 31472--- a/src/content/browser/renderer_host/navigation_controller_impl.h 31473+++ b/src/content/browser/renderer_host/navigation_controller_impl.h 31474@@ -124,6 +124,9 @@ class CONTENT_EXPORT NavigationControllerImpl : public NavigationController { 31475 const GURL& url, 31476 const std::string& error_page_html, 31477 net::Error error) override; 31478+#if BUILDFLAG(IS_OHOS) 31479+ const std::string& GetOriginalUrl() override; 31480+#endif 31481 bool CanGoBack() override; 31482 bool CanGoForward() override; 31483 bool CanGoToOffset(int offset) override; 31484diff --git a/src/content/browser/renderer_host/policy_container_navigation_bundle.cc b/src/content/browser/renderer_host/navigation_policy_container_builder.cc 31485similarity index 69% 31486rename from src/content/browser/renderer_host/policy_container_navigation_bundle.cc 31487rename to src/content/browser/renderer_host/navigation_policy_container_builder.cc 31488index ec600e3f2ccfe..dca936c7c4baa 31489--- a/src/content/browser/renderer_host/policy_container_navigation_bundle.cc 31490+++ b/src/content/browser/renderer_host/navigation_policy_container_builder.cc 31491@@ -2,7 +2,7 @@ 31492 // Use of this source code is governed by a BSD-style license that can be 31493 // found in the LICENSE file. 31494 31495-#include "content/browser/renderer_host/policy_container_navigation_bundle.h" 31496+#include "content/browser/renderer_host/navigation_policy_container_builder.h" 31497 31498 #include <utility> 31499 31500@@ -75,7 +75,7 @@ std::unique_ptr<PolicyContainerPolicies> GetHistoryPolicies( 31501 31502 } // namespace 31503 31504-PolicyContainerNavigationBundle::PolicyContainerNavigationBundle( 31505+NavigationPolicyContainerBuilder::NavigationPolicyContainerBuilder( 31506 RenderFrameHostImpl* parent, 31507 const blink::LocalFrameToken* initiator_frame_token, 31508 const FrameNavigationEntry* history_entry) 31509@@ -84,36 +84,36 @@ PolicyContainerNavigationBundle::PolicyContainerNavigationBundle( 31510 history_policies_(GetHistoryPolicies(history_entry)), 31511 delivered_policies_(std::make_unique<PolicyContainerPolicies>()) {} 31512 31513-PolicyContainerNavigationBundle::~PolicyContainerNavigationBundle() = default; 31514+NavigationPolicyContainerBuilder::~NavigationPolicyContainerBuilder() = default; 31515 31516 const PolicyContainerPolicies* 31517-PolicyContainerNavigationBundle::InitiatorPolicies() const { 31518+NavigationPolicyContainerBuilder::InitiatorPolicies() const { 31519 return initiator_policies_.get(); 31520 } 31521 31522-const PolicyContainerPolicies* PolicyContainerNavigationBundle::ParentPolicies() 31523+const PolicyContainerPolicies* NavigationPolicyContainerBuilder::ParentPolicies() 31524 const { 31525 return parent_policies_.get(); 31526 } 31527 31528 const PolicyContainerPolicies* 31529-PolicyContainerNavigationBundle::HistoryPolicies() const { 31530+NavigationPolicyContainerBuilder::HistoryPolicies() const { 31531 return history_policies_.get(); 31532 } 31533 31534-void PolicyContainerNavigationBundle::SetIPAddressSpace( 31535+void NavigationPolicyContainerBuilder::SetIPAddressSpace( 31536 network::mojom::IPAddressSpace address_space) { 31537 DCHECK(!HasComputedPolicies()); 31538 delivered_policies_->ip_address_space = address_space; 31539 } 31540 31541-void PolicyContainerNavigationBundle::SetIsOriginPotentiallyTrustworthy( 31542+void NavigationPolicyContainerBuilder::SetIsOriginPotentiallyTrustworthy( 31543 bool value) { 31544 DCHECK(!HasComputedPolicies()); 31545 delivered_policies_->is_web_secure_context = value; 31546 } 31547 31548-void PolicyContainerNavigationBundle::AddContentSecurityPolicy( 31549+void NavigationPolicyContainerBuilder::AddContentSecurityPolicy( 31550 network::mojom::ContentSecurityPolicyPtr policy) { 31551 DCHECK(!HasComputedPolicies()); 31552 DCHECK(policy); 31553@@ -121,21 +121,21 @@ void PolicyContainerNavigationBundle::AddContentSecurityPolicy( 31554 delivered_policies_->content_security_policies.push_back(std::move(policy)); 31555 } 31556 31557-void PolicyContainerNavigationBundle::AddContentSecurityPolicies( 31558+void NavigationPolicyContainerBuilder::AddContentSecurityPolicies( 31559 std::vector<network::mojom::ContentSecurityPolicyPtr> policies) { 31560 DCHECK(!HasComputedPolicies()); 31561 31562 delivered_policies_->AddContentSecurityPolicies(std::move(policies)); 31563 } 31564 31565-void PolicyContainerNavigationBundle::SetCrossOriginOpenerPolicy( 31566+void NavigationPolicyContainerBuilder::SetCrossOriginOpenerPolicy( 31567 network::CrossOriginOpenerPolicy coop) { 31568 DCHECK(!HasComputedPolicies()); 31569 31570 delivered_policies_->cross_origin_opener_policy = coop; 31571 } 31572 31573-void PolicyContainerNavigationBundle::SetCrossOriginEmbedderPolicy( 31574+void NavigationPolicyContainerBuilder::SetCrossOriginEmbedderPolicy( 31575 network::CrossOriginEmbedderPolicy coep) { 31576 DCHECK(!HasComputedPolicies()); 31577 31578@@ -143,13 +143,13 @@ void PolicyContainerNavigationBundle::SetCrossOriginEmbedderPolicy( 31579 } 31580 31581 const PolicyContainerPolicies& 31582-PolicyContainerNavigationBundle::DeliveredPoliciesForTesting() const { 31583+NavigationPolicyContainerBuilder::DeliveredPoliciesForTesting() const { 31584 DCHECK(!HasComputedPolicies()); 31585 31586 return *delivered_policies_; 31587 } 31588 31589-void PolicyContainerNavigationBundle::ComputePoliciesForError() { 31590+void NavigationPolicyContainerBuilder::ComputePoliciesForError() { 31591 // The decision to commit an error page can happen after receiving the 31592 // response for a regular document. It overrides any previous attempt to 31593 // |ComputePolicies()|. 31594@@ -172,7 +172,7 @@ void PolicyContainerNavigationBundle::ComputePoliciesForError() { 31595 DCHECK(HasComputedPolicies()); 31596 } 31597 31598-void PolicyContainerNavigationBundle::ComputeIsWebSecureContext() { 31599+void NavigationPolicyContainerBuilder::ComputeIsWebSecureContext() { 31600 DCHECK(!HasComputedPolicies()); 31601 31602 if (!parent_policies_) { 31603@@ -186,7 +186,7 @@ void PolicyContainerNavigationBundle::ComputeIsWebSecureContext() { 31604 } 31605 31606 std::unique_ptr<PolicyContainerPolicies> 31607-PolicyContainerNavigationBundle::IncorporateDeliveredPolicies( 31608+NavigationPolicyContainerBuilder::IncorporateDeliveredPolicies( 31609 const GURL& url, 31610 std::unique_ptr<PolicyContainerPolicies> policies) { 31611 // Delivered content security policies must be appended. 31612@@ -203,7 +203,7 @@ PolicyContainerNavigationBundle::IncorporateDeliveredPolicies( 31613 } 31614 31615 std::unique_ptr<PolicyContainerPolicies> 31616-PolicyContainerNavigationBundle::ComputeInheritedPolicies(const GURL& url) { 31617+NavigationPolicyContainerBuilder::ComputeInheritedPolicies(const GURL& url) { 31618 DCHECK(HasLocalScheme(url)) << "No inheritance allowed for non-local schemes"; 31619 31620 if (url.IsAboutSrcdoc()) { 31621@@ -220,42 +220,59 @@ PolicyContainerNavigationBundle::ComputeInheritedPolicies(const GURL& url) { 31622 } 31623 31624 std::unique_ptr<PolicyContainerPolicies> 31625-PolicyContainerNavigationBundle::ComputeFinalPolicies(const GURL& url) { 31626+NavigationPolicyContainerBuilder::ComputeFinalPolicies(const GURL& url) { 31627+ std::unique_ptr<PolicyContainerPolicies> policies; 31628 // Policies are either inherited from another document for local scheme, or 31629 // directly set from the delivered response. 31630- if (!HasLocalScheme(url)) 31631- return delivered_policies_->Clone(); 31632- 31633- // For a local scheme, history policies should not incorporate delivered ones 31634- // as this may lead to duplication of some policies already stored in history. 31635- // For example, consider the following HTML: 31636- // <iframe src="about:blank" csp="something"> 31637- // This will store CSP: something in history. The next time we have a history 31638- // navigation we will have CSP: something twice. 31639- if (history_policies_) 31640- return history_policies_->Clone(); 31641- 31642- return IncorporateDeliveredPolicies(url, ComputeInheritedPolicies(url)); 31643+ if (!HasLocalScheme(url)) { 31644+ policies = delivered_policies_->Clone(); 31645+ } else if (history_policies_) { 31646+ // For a local scheme, history policies should not incorporate delivered 31647+ // ones as this may lead to duplication of some policies already stored in 31648+ // history. For example, consider the following HTML: 31649+ // <iframe src="about:blank" csp="something"> 31650+ // This will store CSP: something in history. The next time we have a 31651+ // history navigation we will have CSP: something twice. 31652+ policies = history_policies_->Clone(); 31653+ } else { 31654+ policies = IncorporateDeliveredPolicies(url, ComputeInheritedPolicies(url)); 31655+ } 31656+ 31657+ // `can_navigate_top_without_user_gesture` is inherited from the parent. 31658+ // Later in `NavigationRequest::CommitNavigation()` it will either be made 31659+ // less strict for same-origin navigations, or stricter for cross-origin 31660+ // navigations that do not explicitly allow top-level navigation without user 31661+ // gesture. 31662+ policies->can_navigate_top_without_user_gesture = 31663+ parent_policies_ ? parent_policies_->can_navigate_top_without_user_gesture 31664+ : true; 31665+ 31666+ return policies; 31667 } 31668 31669-void PolicyContainerNavigationBundle::ComputePolicies(const GURL& url) { 31670+void NavigationPolicyContainerBuilder::ComputePolicies(const GURL& url) { 31671 DCHECK(!HasComputedPolicies()); 31672 ComputeIsWebSecureContext(); 31673 SetFinalPolicies(ComputeFinalPolicies(url)); 31674 } 31675 31676-bool PolicyContainerNavigationBundle::HasComputedPolicies() const { 31677+bool NavigationPolicyContainerBuilder::HasComputedPolicies() const { 31678 return host_ != nullptr; 31679 } 31680 31681-void PolicyContainerNavigationBundle::SetFinalPolicies( 31682+void NavigationPolicyContainerBuilder::SetAllowTopNavigationWithoutUserGesture( 31683+ bool allow_top) { 31684+ host_->SetCanNavigateTopWithoutUserGesture(allow_top); 31685+} 31686+ 31687+void NavigationPolicyContainerBuilder::SetFinalPolicies( 31688 std::unique_ptr<PolicyContainerPolicies> policies) { 31689 DCHECK(!HasComputedPolicies()); 31690 31691 host_ = base::MakeRefCounted<PolicyContainerHost>(std::move(policies)); 31692 } 31693 31694-const PolicyContainerPolicies& PolicyContainerNavigationBundle::FinalPolicies() 31695+const PolicyContainerPolicies& NavigationPolicyContainerBuilder::FinalPolicies() 31696 const { 31697 DCHECK(HasComputedPolicies()); 31698 31699@@ -263,20 +280,20 @@ const PolicyContainerPolicies& PolicyContainerNavigationBundle::FinalPolicies() 31700 } 31701 31702 blink::mojom::PolicyContainerPtr 31703-PolicyContainerNavigationBundle::CreatePolicyContainerForBlink() { 31704+NavigationPolicyContainerBuilder::CreatePolicyContainerForBlink() { 31705 DCHECK(HasComputedPolicies()); 31706 31707 return host_->CreatePolicyContainerForBlink(); 31708 } 31709 31710 scoped_refptr<PolicyContainerHost> 31711-PolicyContainerNavigationBundle::TakePolicyContainerHost() && { 31712+NavigationPolicyContainerBuilder::TakePolicyContainerHost() && { 31713 DCHECK(HasComputedPolicies()); 31714 31715 return std::move(host_); 31716 } 31717 31718-void PolicyContainerNavigationBundle::ResetForCrossDocumentRestart() { 31719+void NavigationPolicyContainerBuilder::ResetForCrossDocumentRestart() { 31720 host_ = nullptr; 31721 delivered_policies_ = std::make_unique<PolicyContainerPolicies>(); 31722 } 31723diff --git a/src/content/browser/renderer_host/policy_container_navigation_bundle.h b/src/content/browser/renderer_host/navigation_policy_container_builder.h 31724similarity index 52% 31725rename from src/content/browser/renderer_host/policy_container_navigation_bundle.h 31726rename to src/content/browser/renderer_host/navigation_policy_container_builder.h 31727index adc2e28f5eed3..014e9e3d1d7d7 31728--- a/src/content/browser/renderer_host/policy_container_navigation_bundle.h 31729+++ b/src/content/browser/renderer_host/navigation_policy_container_builder.h 31730@@ -2,8 +2,8 @@ 31731 // Use of this source code is governed by a BSD-style license that can be 31732 // found in the LICENSE file. 31733 31734-#ifndef CONTENT_BROWSER_RENDERER_HOST_POLICY_CONTAINER_NAVIGATION_BUNDLE_H_ 31735-#define CONTENT_BROWSER_RENDERER_HOST_POLICY_CONTAINER_NAVIGATION_BUNDLE_H_ 31736+#ifndef CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_POLICY_CONTAINER_BUILDER_H_ 31737+#define CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_POLICY_CONTAINER_BUILDER_H_ 31738 31739 #include <memory> 31740 31741@@ -21,50 +21,51 @@ namespace content { 31742 class FrameNavigationEntry; 31743 class RenderFrameHostImpl; 31744 31745-// Helper for NavigationRequest. Keeps track of a few important sets of policies 31746-// (that of the parent document, of the navigation initiator, etc.) and computes 31747-// the policies of the new document being navigated to. 31748+// Keeps track of a few important sets of policies during a navigation: those of 31749+// the parent document, of the navigation initiator, etc. Computes the policies 31750+// of the new document being navigated to, and creates the new document's 31751+// `PolicyContainerHost`. 31752 // 31753-// Instances of this class live in NavigationRequest. They are instantiated when 31754-// the NavigationRequest is constructed, and destroyed at commit time. 31755+// Instances of this class live in `NavigationRequest`. They are instantiated 31756+// when the `NavigationRequest` is constructed and destroyed at commit time. 31757 // 31758 // Setters can be called as the navigation progresses to record interesting 31759 // properties for later. 31760 // 31761-// When the potential response to commit is known, |ComputePolicies()| can be 31762+// When the potential response to commit is known, `ComputePolicies()` can be 31763 // called to set the final polices of the new document and create a new policy 31764 // container host. 31765-// For error documents, |ComputePoliciesForError()| should be used instead. It 31766-// can also be called after |ComputePolicies()| in some cases when the error is 31767-// only detected after receiving a response 31768+// For error documents, `ComputePoliciesForError()` should be used instead. It 31769+// can also be called after `ComputePolicies()` in some cases when the error is 31770+// only detected after receiving a response. 31771 // 31772-// At commit time, |TakePolicyContainerHost()| can be called to transfer 31773-// ownership of the policy container host to the target RenderFrameHostImpl. 31774-class CONTENT_EXPORT PolicyContainerNavigationBundle { 31775+// At commit time, `TakePolicyContainerHost()` can be called to transfer 31776+// ownership of the policy container host to the target `RenderFrameHostImpl`. 31777+class CONTENT_EXPORT NavigationPolicyContainerBuilder { 31778 public: 31779 // All arguments may be nullptr and need only outlive this call. 31780 // 31781- // If |parent| is not nullptr, its policies are copied. 31782- // If |initiator_frame_token| is not nullptr and maps to a 31783- // PolicyContainerHost, then its policies are copied. 31784- // If |history_entry| is not nullptr and contains policies, those are copied. 31785+ // If `parent` is not nullptr, its policies are copied. 31786+ // If `initiator_frame_token` is not nullptr and maps to a 31787+ // `PolicyContainerHost`, then its policies are copied. 31788+ // If `history_entry` is not nullptr and contains policies, those are copied. 31789 // 31790 // This must only be called on the browser's UI thread. 31791- PolicyContainerNavigationBundle( 31792+ NavigationPolicyContainerBuilder( 31793 RenderFrameHostImpl* parent, 31794 const blink::LocalFrameToken* initiator_frame_token, 31795 const FrameNavigationEntry* history_entry); 31796 31797- ~PolicyContainerNavigationBundle(); 31798+ ~NavigationPolicyContainerBuilder(); 31799 31800 // Instances of this class are neither copyable nor movable. 31801- PolicyContainerNavigationBundle(const PolicyContainerNavigationBundle&) = 31802+ NavigationPolicyContainerBuilder(const NavigationPolicyContainerBuilder&) = 31803 delete; 31804- PolicyContainerNavigationBundle& operator=( 31805- const PolicyContainerNavigationBundle&) = delete; 31806- PolicyContainerNavigationBundle(PolicyContainerNavigationBundle&&) = delete; 31807- PolicyContainerNavigationBundle& operator=( 31808- PolicyContainerNavigationBundle&&) = delete; 31809+ NavigationPolicyContainerBuilder& operator=( 31810+ const NavigationPolicyContainerBuilder&) = delete; 31811+ NavigationPolicyContainerBuilder(NavigationPolicyContainerBuilder&&) = delete; 31812+ NavigationPolicyContainerBuilder& operator=( 31813+ NavigationPolicyContainerBuilder&&) = delete; 31814 31815 // Returns a pointer to a snapshot of the parent's policies captured at 31816 // construction time. Returns nullptr if there was no parent. 31817@@ -81,99 +82,127 @@ class CONTENT_EXPORT PolicyContainerNavigationBundle { 31818 31819 // Sets the cross origin opener policy of the new document. 31820 // 31821- // This must be called before |ComputePolicies()|. 31822+ // This must be called before `ComputePolicies()`. 31823 void SetCrossOriginOpenerPolicy(network::CrossOriginOpenerPolicy coop); 31824 31825 // Sets the cross origin embedder policy of the new document. 31826 // 31827- // This must be called before |ComputePolicies()|. 31828+ // This must be called before `ComputePolicies()`. 31829 void SetCrossOriginEmbedderPolicy(network::CrossOriginEmbedderPolicy coep); 31830 31831 // Sets the IP address space of the delivered policies of the new document. 31832 // 31833- // This must be called before |ComputePolicies()|. 31834+ // This must be called before `ComputePolicies()`. 31835 void SetIPAddressSpace(network::mojom::IPAddressSpace address_space); 31836 31837 // Sets whether the origin of the document being navigated to is 31838 // potentially-trustworthy, as defined in: 31839 // https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy. 31840 // 31841- // This must be called before |ComputePolicies()|. 31842+ // This must be called before `ComputePolicies()`. 31843 void SetIsOriginPotentiallyTrustworthy(bool value); 31844 31845 // Records an additional Content Security Policy that will apply to the new 31846- // document. |policy| must not be null. Policies added this way are ignored 31847+ // document. `policy` must not be null. Policies added this way are ignored 31848 // for failed navigations and history navigations. 31849 void AddContentSecurityPolicy( 31850 network::mojom::ContentSecurityPolicyPtr policy); 31851 31852- // Same as `AddContentSecurityPolicy` above, but takes a vector of policies. 31853+ // Same as calling `AddContentSecurityPolicy()` on each item in `policies`. 31854 void AddContentSecurityPolicies( 31855 std::vector<network::mojom::ContentSecurityPolicyPtr> policies); 31856 31857 // Returns the delivered policies, as set so far by: 31858 // 31859- // - |SetIPAddressSpace()| for |ip_address_space| 31860- // - |SetIsOriginPotentiallyTrustworthy()| and |ComputePolicies()| for 31861- // |is_web_secure_context| 31862+ // - `SetIPAddressSpace()` for `ip_address_space` 31863+ // - `SetIsOriginPotentiallyTrustworthy()` and `ComputePolicies()` for 31864+ // `is_web_secure_context` 31865 const PolicyContainerPolicies& DeliveredPoliciesForTesting() const; 31866 31867 // Sets final policies to defaults suitable for error pages, and builds a 31868 // policy container host. 31869 // 31870+ // `is_inside_mhtml` specifies whether the navigation loads an MHTML document 31871+ // or a subframe of an MHTML document. This influences computed sandbox flags. 31872+ // `frame_sandbox_flags` represents the frame's sandbox flags. 31873+ // 31874 // This method must only be called once. However it can be called after 31875- // |ComputePolicies()|. 31876+ // `ComputePolicies()`. 31877 void ComputePoliciesForError(); 31878 31879 // Sets final policies to their correct values and builds a policy container 31880 // host. 31881 // 31882- // |url| should designate the URL of the document after all redirects have 31883+ // `url` should designate the URL of the document after all redirects have 31884 // been followed. 31885+ // `is_inside_mhtml` specifies whether the navigation loads an MHTML document 31886+ // or a subframe of an MHTML document. This influences computed sandbox flags. 31887+ // `frame_sandbox_flags` represents the frame's sandbox flags. 31888 // 31889- // Also sets |DeliveredPolicies().is_web_secure_context| to its final value. 31890+ // Also sets `DeliveredPoliciesForTesting().is_web_secure_context` to its 31891+ // final value. 31892 // 31893- // This method must only be called once. |ComputePoliciesForError()| may be 31894- // called later and this override the final policies. 31895+ // This method must only be called once. `ComputePoliciesForError()` may be 31896+ // called later, in which case it overrides the final policies. 31897 void ComputePolicies(const GURL& url); 31898 31899 // Returns a reference to the policies of the new document, i.e. the policies 31900 // in the policy container host to be committed. 31901 // 31902- // |ComputePolicies()| or |ComputePoliciesForError()| must have been called 31903+ // `ComputePolicies()` or `ComputePoliciesForError()` must have been called 31904 // previously. 31905 const PolicyContainerPolicies& FinalPolicies() const; 31906 31907- // Creates a PolicyContainer connected to this bundle's PolicyContainerHost. 31908+ // Creates a PolicyContainer linked to this builder's `PolicyContainerHost`. 31909 // 31910- // Should only be called once. |ComputePolicies()| or 31911- // |ComputePoliciesForError()| must have been called previously. 31912+ // Should only be called once. `ComputePolicies()` or 31913+ // `ComputePoliciesForError()` must have been called previously. 31914 blink::mojom::PolicyContainerPtr CreatePolicyContainerForBlink(); 31915 31916- // Moves the PolicyContainerHost out of this bundle. The returned host 31917- // contains the same policies as |FinalPolicies()|. 31918+ // Moves the `PolicyContainerHost` out of this builder. The returned host 31919+ // contains the same policies as `FinalPolicies()`. 31920 // 31921- // |ComputePolicies()| or |ComputePoliciesForError()| must have been called 31922+ // `ComputePolicies()` or `ComputePoliciesForError()` must have been called 31923 // previously. 31924 scoped_refptr<PolicyContainerHost> TakePolicyContainerHost() &&; 31925 31926+ // Resets this instance to its freshly-constructed state. 31927+ // 31928 // Called by same-document navigation requests that need to be restarted as 31929 // cross-document navigations. This happens when a same-document commit fails 31930- // due to another navigation committing in the meantime. This resets the 31931- // PolicyContainerNavigationBundle to the state when it was first created. 31932+ // due to another navigation committing in the meantime. 31933 void ResetForCrossDocumentRestart(); 31934 31935+ // Modifies the bit that would allow top-level navigation without sticky 31936+ // user activation. 31937+ void SetAllowTopNavigationWithoutUserGesture(bool allow_top); 31938+ 31939 private: 31940- // Whether either of |ComputePolicies()| or |ComputePoliciesForError()| has 31941+ // Whether either of `ComputePolicies()` or `ComputePoliciesForError()` has 31942 // been called yet. 31943 bool HasComputedPolicies() const; 31944 31945- // Sets |delivered_policies_.is_web_secure_context| to its final value. 31946+ // Sets `delivered_policies_.is_web_secure_context` to its final value. 31947 // 31948- // Helper for |ComputePolicies()|. 31949+ // Helper for `ComputePolicies()`. 31950 void ComputeIsWebSecureContext(); 31951 31952- // Sets |host_|. 31953+ // Sets `policies.sandbox_flags` to its final value. This merges the CSP 31954+ // sandbox flags with the frame's sandbox flag. 31955+ // 31956+ // `is_inside_mhtml` Whether the navigation loads an MHTML document or a 31957+ // subframe of an MHTML document. When true, this forces all sandbox flags on 31958+ // the document except popups and popups-to-escape-sandbox. 31959+ // `frame_sandbox_flags` The frame's sandbox flags. 31960+ // `policies` The policies computed for the document except for the sandbox 31961+ // flags. 31962+ // 31963+ // Helper for `ComputePolicies()` and `ComputePoliciesForError()`. 31964+ void ComputeSandboxFlags(bool is_inside_mhtml, 31965+ network::mojom::WebSandboxFlags frame_sandbox_flags, 31966+ PolicyContainerPolicies* policies); 31967+ 31968+ // Sets `host_`. 31969 void SetFinalPolicies(std::unique_ptr<PolicyContainerPolicies> policies); 31970 31971 // Helper for `FinalizePolicies()`. Appends the delivered Content Security 31972@@ -189,8 +218,7 @@ class CONTENT_EXPORT PolicyContainerNavigationBundle { 31973 31974 // Helper for `FinalizePolicies()`. Returns, depending on `url`, the final 31975 // policies for the document that is going to be committed. 31976- std::unique_ptr<PolicyContainerPolicies> ComputeFinalPolicies( 31977- const GURL& url); 31978+ std::unique_ptr<PolicyContainerPolicies> ComputeFinalPolicies(const GURL& url); 31979 31980 // The policies of the parent document, if any. 31981 const std::unique_ptr<PolicyContainerPolicies> parent_policies_; 31982@@ -203,15 +231,15 @@ class CONTENT_EXPORT PolicyContainerNavigationBundle { 31983 31984 // The policies extracted from the response as it is loaded. 31985 // 31986- // See the comment on |SetIsOriginPotentiallyTrustworthy()| regarding this 31987- // member's |is_web_secure_context| field. 31988+ // See the comment on `SetIsOriginPotentiallyTrustworthy()` regarding this 31989+ // member's `is_web_secure_context` field. 31990 std::unique_ptr<PolicyContainerPolicies> delivered_policies_; 31991 31992- // Nullptr until |ComputePolicies()| or |ComputePoliciesForError()| is 31993- // called, then moved from by |TakePolicyContainerHost()|. 31994+ // Nullptr until `ComputePolicies()` or `ComputePoliciesForError()` is 31995+ // called, then moved from by `TakePolicyContainerHost()`. 31996 scoped_refptr<PolicyContainerHost> host_; 31997 }; 31998 31999 } // namespace content 32000 32001-#endif // CONTENT_BROWSER_RENDERER_HOST_POLICY_CONTAINER_NAVIGATION_BUNDLE_H_ 32002+#endif // CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_POLICY_CONTAINER_BUILDER_H_ 32003diff --git a/src/content/browser/renderer_host/policy_container_navigation_bundle_browsertest.cc b/src/content/browser/renderer_host/navigation_policy_container_builder_browsertest.cc 32004similarity index 80% 32005rename from src/content/browser/renderer_host/policy_container_navigation_bundle_browsertest.cc 32006rename to src/content/browser/renderer_host/navigation_policy_container_builder_browsertest.cc 32007index 47f6f31d8d845..4030227fbb057 32008--- a/src/content/browser/renderer_host/policy_container_navigation_bundle_browsertest.cc 32009+++ b/src/content/browser/renderer_host/navigation_policy_container_builder_browsertest.cc 32010@@ -2,11 +2,11 @@ 32011 // Use of this source code is governed by a BSD-style license that can be 32012 // found in the LICENSE file. 32013 32014-#include "content/browser/renderer_host/policy_container_host.h" 32015-#include "content/browser/renderer_host/policy_container_navigation_bundle.h" 32016+#include "content/browser/renderer_host/navigation_policy_container_builder.h" 32017 32018 #include "content/browser/renderer_host/frame_tree_node.h" 32019 #include "content/browser/renderer_host/navigation_entry_impl.h" 32020+#include "content/browser/renderer_host/policy_container_host.h" 32021 #include "content/browser/renderer_host/render_frame_host_impl.h" 32022 #include "content/public/test/back_forward_cache_util.h" 32023 #include "content/public/test/browser_test.h" 32024@@ -53,12 +53,12 @@ network::mojom::ContentSecurityPolicyPtr MakeTestCSP() { 32025 return csp; 32026 } 32027 32028-// See also the unit tests for PolicyContainerNavigationBundle, which exercise 32029+// See also the unit tests for NavigationPolicyContainerBuilder, which exercise 32030 // simpler parts of the API. We use browser tests to exercise behavior in the 32031 // presence of navigation history in particular. 32032-class PolicyContainerNavigationBundleBrowserTest : public ContentBrowserTest { 32033+class NavigationPolicyContainerBuilderBrowserTest: public ContentBrowserTest { 32034 protected: 32035- explicit PolicyContainerNavigationBundleBrowserTest() { StartServer(); } 32036+ explicit NavigationPolicyContainerBuilderBrowserTest() { StartServer(); } 32037 32038 // Returns a pointer to the current root RenderFrameHostImpl. 32039 RenderFrameHostImpl* root_frame_host() { 32040@@ -98,15 +98,15 @@ class PolicyContainerNavigationBundleBrowserTest : public ContentBrowserTest { 32041 // 32042 // Even though this could be a unit test, we define this here so as to keep all 32043 // tests of HistoryPolicies() in the same place. 32044-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32045+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32046 HistoryPoliciesWithoutEntry) { 32047- EXPECT_THAT(PolicyContainerNavigationBundle(nullptr, nullptr, nullptr) 32048+ EXPECT_THAT(NavigationPolicyContainerBuilder(nullptr, nullptr, nullptr) 32049 .HistoryPolicies(), 32050 IsNull()); 32051 } 32052 32053 // Verifies that HistoryPolicies() returns non-null during history navigation. 32054-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32055+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32056 HistoryPoliciesForNetworkScheme) { 32057 // Navigate to a document with a network scheme. Its history entry should have 32058 // its policies initialized from the network response. 32059@@ -116,15 +116,15 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32060 EXPECT_EQ(root_policies.ip_address_space, 32061 network::mojom::IPAddressSpace::kLocal); 32062 32063- PolicyContainerNavigationBundle bundle( 32064+ NavigationPolicyContainerBuilder builder( 32065 nullptr, nullptr, GetLastCommittedFrameNavigationEntry()); 32066 32067- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(root_policies)))); 32068+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(root_policies)))); 32069 } 32070 32071 // Verifies that SetFrameNavigationEntry() copies the policies during history 32072 // navigation, if any, or resets those policies when given nullptr. 32073-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32074+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32075 HistoryPoliciesForBlankUrl) { 32076 RenderFrameHostImpl* root = root_frame_host(); 32077 32078@@ -142,15 +142,15 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32079 32080 // Now that we have set up a navigation entry with non-default policies, we 32081 // can run the test itself. 32082- PolicyContainerNavigationBundle bundle( 32083+ NavigationPolicyContainerBuilder builder( 32084 nullptr, nullptr, GetLastCommittedFrameNavigationEntry()); 32085 32086- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(root_policies)))); 32087+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(root_policies)))); 32088 } 32089 32090 // Verifies that HistoryPolicies() returns non-null even when associated with 32091 // a non-current FrameNavigationEntry. 32092-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32093+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32094 HistoryPoliciesForNonCurentEntry) { 32095 // Navigate to a document with a network scheme. Its history entry should have 32096 // its policies initialized from the network response. 32097@@ -161,45 +161,45 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32098 network::mojom::IPAddressSpace::kLocal); 32099 32100 FrameNavigationEntry* entry = GetLastCommittedFrameNavigationEntry(); 32101- PolicyContainerNavigationBundle bundle(nullptr, nullptr, entry); 32102+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, entry); 32103 32104 // Verify the state is correct before navigating away. 32105- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(root_policies)))); 32106+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(root_policies)))); 32107 32108 EXPECT_TRUE(NavigateToURL(shell()->web_contents(), PublicUrl())); 32109 32110 // Now that the FrameNavigationEntry is non-current, verify that it still has 32111- // the bundle. 32112+ // the builder. 32113 EXPECT_NE(entry, GetLastCommittedFrameNavigationEntry()); 32114- PolicyContainerNavigationBundle bundle2(nullptr, nullptr, entry); 32115- EXPECT_THAT(bundle2.HistoryPolicies(), Pointee(Eq(ByRef(root_policies)))); 32116+ NavigationPolicyContainerBuilder builder2(nullptr, nullptr, entry); 32117+ EXPECT_THAT(builder2.HistoryPolicies(), Pointee(Eq(ByRef(root_policies)))); 32118 } 32119 32120 // Verifies that CreatePolicyContainerForBlink() returns a policy container 32121-// containing a copy of the bundle's final policies. 32122-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32123+// containing a copy of the builder's final policies. 32124+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32125 CreatePolicyContainerForBlink) { 32126- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32127- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32128+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32129+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32130 32131- bundle.ComputePolicies(GURL()); 32132+ builder.ComputePolicies(GURL()); 32133 32134 // This must be called on a task runner, hence the need for this test to be 32135 // a browser test and not a simple unit test. 32136 blink::mojom::PolicyContainerPtr container = 32137- bundle.CreatePolicyContainerForBlink(); 32138+ builder.CreatePolicyContainerForBlink(); 32139 ASSERT_FALSE(container.is_null()); 32140 ASSERT_FALSE(container->policies.is_null()); 32141 32142 const blink::mojom::PolicyContainerPolicies& policies = *container->policies; 32143- EXPECT_EQ(policies.referrer_policy, bundle.FinalPolicies().referrer_policy); 32144- EXPECT_EQ(policies.ip_address_space, bundle.FinalPolicies().ip_address_space); 32145+ EXPECT_EQ(policies.referrer_policy, builder.FinalPolicies().referrer_policy); 32146+ EXPECT_EQ(policies.ip_address_space, builder.FinalPolicies().ip_address_space); 32147 } 32148 32149 // Verifies that when the URL of the document to commit is `about:blank`, and 32150 // when a navigation entry with policies is given, then the navigation 32151 // initiator's policies are ignored in favor of the policies from the entry. 32152-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32153+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32154 FinalPoliciesAboutBlankWithInitiatorAndHistory) { 32155 RenderFrameHostImpl* root = root_frame_host(); 32156 32157@@ -219,28 +219,28 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32158 base::MakeRefCounted<PolicyContainerHost>(std::move(initiator_policies)); 32159 initiator_host->AssociateWithFrameToken(token); 32160 32161- PolicyContainerNavigationBundle bundle( 32162+ NavigationPolicyContainerBuilder builder( 32163 nullptr, &token, GetLastCommittedFrameNavigationEntry()); 32164 32165- EXPECT_NE(*bundle.HistoryPolicies(), *bundle.InitiatorPolicies()); 32166+ EXPECT_NE(*builder.HistoryPolicies(), *builder.InitiatorPolicies()); 32167 32168 std::unique_ptr<PolicyContainerPolicies> history_policies = 32169- bundle.HistoryPolicies()->Clone(); 32170+ builder.HistoryPolicies()->Clone(); 32171 32172 // Deliver a Content Security Policy via `AddContentSecurityPolicy`. This 32173- // policy should not be incorporated in the final policies, since the bundle 32174+ // policy should not be incorporated in the final policies, since the builder 32175 // is using the history policies. 32176- bundle.AddContentSecurityPolicy(MakeTestCSP()); 32177+ builder.AddContentSecurityPolicy(MakeTestCSP()); 32178 32179- bundle.ComputePolicies(AboutBlankUrl()); 32180+ builder.ComputePolicies(AboutBlankUrl()); 32181 32182- EXPECT_EQ(bundle.FinalPolicies(), *history_policies); 32183+ EXPECT_EQ(builder.FinalPolicies(), *history_policies); 32184 } 32185 32186 // Verifies that when the URL of the document to commit is `about:srcdoc`, and 32187 // when a navigation entry with policies is given, then the parent's policies 32188 // are ignored in favor of the policies from the entry. 32189-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32190+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32191 FinalPoliciesAboutSrcDocWithParentAndHistory) { 32192 // First navigate to a local scheme with non-default policies. To do that, we 32193 // first navigate to a document with a public address space, then have that 32194@@ -263,26 +263,26 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32195 EXPECT_EQ(true, EvalJs(root, JsReplace(script_template, LocalUrl()))); 32196 32197 RenderFrameHostImpl* parent = root->child_at(0)->current_frame_host(); 32198- PolicyContainerNavigationBundle bundle( 32199+ NavigationPolicyContainerBuilder builder( 32200 parent, nullptr, GetLastCommittedFrameNavigationEntry()); 32201 32202- EXPECT_NE(*bundle.HistoryPolicies(), *bundle.ParentPolicies()); 32203+ EXPECT_NE(*builder.HistoryPolicies(), *builder.ParentPolicies()); 32204 32205 std::unique_ptr<PolicyContainerPolicies> history_policies = 32206- bundle.HistoryPolicies()->Clone(); 32207+ builder.HistoryPolicies()->Clone(); 32208 32209 // Deliver a Content Security Policy via `AddContentSecurityPolicy`. This 32210- // policy should not be incorporated in the final policies, since the bundle 32211+ // policy should not be incorporated in the final policies, since the builder 32212 // is using the history policies. 32213- bundle.AddContentSecurityPolicy(MakeTestCSP()); 32214+ builder.AddContentSecurityPolicy(MakeTestCSP()); 32215 32216- bundle.ComputePolicies(AboutSrcdocUrl()); 32217+ builder.ComputePolicies(AboutSrcdocUrl()); 32218 32219- EXPECT_EQ(bundle.FinalPolicies(), *history_policies); 32220+ EXPECT_EQ(builder.FinalPolicies(), *history_policies); 32221 } 32222 32223 // Verifies that history policies are ignored in the case of error pages. 32224-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32225+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32226 FinalPoliciesErrorPageWithHistory) { 32227 // First navigate to a local scheme with non-default policies. To do that, we 32228 // first navigate to a document with a public address space, then have that 32229@@ -292,18 +292,18 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32230 EXPECT_TRUE(NavigateToURL(shell()->web_contents(), PublicUrl())); 32231 EXPECT_TRUE(NavigateToURLFromRenderer(root_frame_host(), AboutBlankUrl())); 32232 32233- PolicyContainerNavigationBundle bundle( 32234+ NavigationPolicyContainerBuilder builder( 32235 nullptr, nullptr, GetLastCommittedFrameNavigationEntry()); 32236 32237- bundle.ComputePoliciesForError(); 32238+ builder.ComputePoliciesForError(); 32239 32240 // Error pages commit with default policies, ignoring the history policies. 32241- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies()); 32242+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies()); 32243 } 32244 32245 // After |ComputePolicies()| or |ComputePoliciesForError()|, the history 32246 // policies are still accessible. 32247-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32248+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32249 AccessHistoryAfterComputingPolicies) { 32250 // First navigate to a local scheme with non-default policies. To do that, we 32251 // first navigate to a document with a public address space, then have that 32252@@ -313,22 +313,22 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32253 EXPECT_TRUE(NavigateToURL(shell()->web_contents(), PublicUrl())); 32254 EXPECT_TRUE(NavigateToURLFromRenderer(root_frame_host(), AboutBlankUrl())); 32255 32256- PolicyContainerNavigationBundle bundle( 32257+ NavigationPolicyContainerBuilder builder( 32258 nullptr, nullptr, GetLastCommittedFrameNavigationEntry()); 32259 32260 std::unique_ptr<PolicyContainerPolicies> history_policies = 32261- bundle.HistoryPolicies()->Clone(); 32262+ builder.HistoryPolicies()->Clone(); 32263 32264- bundle.ComputePolicies(AboutBlankUrl()); 32265- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies)))); 32266+ builder.ComputePolicies(AboutBlankUrl()); 32267+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies)))); 32268 32269- bundle.ComputePoliciesForError(); 32270- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies)))); 32271+ builder.ComputePoliciesForError(); 32272+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies)))); 32273 } 32274 32275 // Verifies that history policies from a reused navigation entry aren't used for 32276 // non-local navigations. 32277-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32278+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32279 NoHistoryPoliciesInheritedForNonLocalUrlsOnReload) { 32280 // Navigate to some non-local url first. 32281 WebContents* tab = shell()->web_contents(); 32282@@ -353,7 +353,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32283 32284 // Verifies that history policies from a restored navigation entry are 32285 // overwritten if the policies have changed. 32286-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32287+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32288 NoHistoryPoliciesInheritedForNetworkUrlsOnBack) { 32289 DisableBackForwardCacheForTesting(shell()->web_contents(), 32290 BackForwardCache::TEST_REQUIRES_NO_CACHING); 32291@@ -396,7 +396,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32292 32293 // Verifies that the history policies are preserved on 32294 // ResetForCrossDocumentRestart. 32295-IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32296+IN_PROC_BROWSER_TEST_F(NavigationPolicyContainerBuilderBrowserTest, 32297 ResetForCrossDocumentRestartHistoryPolicies) { 32298 RenderFrameHostImpl* root = root_frame_host(); 32299 32300@@ -408,22 +408,22 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerNavigationBundleBrowserTest, 32301 EXPECT_TRUE(NavigateToURL(shell()->web_contents(), PublicUrl())); 32302 EXPECT_TRUE(NavigateToURLFromRenderer(root, AboutBlankUrl())); 32303 32304- PolicyContainerNavigationBundle bundle( 32305+ NavigationPolicyContainerBuilder builder( 32306 nullptr, nullptr, GetLastCommittedFrameNavigationEntry()); 32307 32308 std::unique_ptr<PolicyContainerPolicies> history_policies = 32309- bundle.HistoryPolicies()->Clone(); 32310+ builder.HistoryPolicies()->Clone(); 32311 32312- bundle.ComputePolicies(GURL("http://foo.test")); 32313+ builder.ComputePolicies(GURL("http://foo.test")); 32314 32315- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies()); 32316+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies()); 32317 32318- bundle.ResetForCrossDocumentRestart(); 32319- EXPECT_THAT(bundle.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies)))); 32320+ builder.ResetForCrossDocumentRestart(); 32321+ EXPECT_THAT(builder.HistoryPolicies(), Pointee(Eq(ByRef(*history_policies)))); 32322 32323- bundle.ComputePolicies(AboutBlankUrl()); 32324+ builder.ComputePolicies(AboutBlankUrl()); 32325 32326- EXPECT_EQ(bundle.FinalPolicies(), *history_policies); 32327+ EXPECT_EQ(builder.FinalPolicies(), *history_policies); 32328 } 32329 32330 } // namespace 32331diff --git a/src/content/browser/renderer_host/policy_container_navigation_bundle_unittest.cc b/src/content/browser/renderer_host/navigation_policy_container_builder_unittest.cc 32332similarity index 57% 32333rename from src/content/browser/renderer_host/policy_container_navigation_bundle_unittest.cc 32334rename to src/content/browser/renderer_host/navigation_policy_container_builder_unittest.cc 32335index cef83381b4c67..479b769fc78cd 32336--- a/src/content/browser/renderer_host/policy_container_navigation_bundle_unittest.cc 32337+++ b/src/content/browser/renderer_host/navigation_policy_container_builder_unittest.cc 32338@@ -2,7 +2,7 @@ 32339 // Use of this source code is governed by a BSD-style license that can be 32340 // found in the LICENSE file. 32341 32342-#include "content/browser/renderer_host/policy_container_navigation_bundle.h" 32343+#include "content/browser/renderer_host/navigation_policy_container_builder.h" 32344 32345 #include <iosfwd> 32346 #include <utility> 32347@@ -46,7 +46,8 @@ std::unique_ptr<PolicyContainerPolicies> MakeTestPolicies() { 32348 network::mojom::ReferrerPolicy::kAlways, 32349 network::mojom::IPAddressSpace::kPublic, 32350 /*is_web_secure_context=*/true, std::move(csp_list), 32351- network::CrossOriginOpenerPolicy(), network::CrossOriginEmbedderPolicy()); 32352+ network::CrossOriginOpenerPolicy(), network::CrossOriginEmbedderPolicy(), 32353+ /*can_navigate_top_without_user_gesture=*/true); 32354 } 32355 32356 // Shorthand. 32357@@ -70,7 +71,7 @@ GURL AboutSrcdocUrl() { 32358 // 32359 // This test fixture is moderately expensive to set up (~100ms overhead per 32360 // test), but still an order of magnitude faster than browser tests. 32361-class PolicyContainerNavigationBundleTest 32362+class NavigationPolicyContainerBuilderTest 32363 : public RenderViewHostImplTestHarness { 32364 protected: 32365 void SetUp() override { 32366@@ -80,45 +81,46 @@ class PolicyContainerNavigationBundleTest 32367 }; 32368 32369 // Verifies that the initial delivered policies are default-constructed. 32370-TEST_F(PolicyContainerNavigationBundleTest, DefaultDeliveredPolicies) { 32371- EXPECT_EQ(PolicyContainerNavigationBundle(nullptr, nullptr, nullptr) 32372+TEST_F(NavigationPolicyContainerBuilderTest, DefaultDeliveredPolicies) { 32373+ EXPECT_EQ(NavigationPolicyContainerBuilder(nullptr, nullptr, nullptr) 32374 .DeliveredPoliciesForTesting(), 32375 PolicyContainerPolicies()); 32376 } 32377 32378-// Verifies that SetIPAddressSpace sets the address space in the bundle's 32379+// Verifies that SetIPAddressSpace sets the address space in the builder's 32380 // delivered policies. 32381-TEST_F(PolicyContainerNavigationBundleTest, SetIPAddressSpace) { 32382- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32383- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32384+TEST_F(NavigationPolicyContainerBuilderTest, SetIPAddressSpace) { 32385+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32386+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32387 32388 PolicyContainerPolicies expected_policies; 32389 expected_policies.ip_address_space = network::mojom::IPAddressSpace::kPublic; 32390 32391- EXPECT_EQ(bundle.DeliveredPoliciesForTesting(), expected_policies); 32392+ EXPECT_EQ(builder.DeliveredPoliciesForTesting(), expected_policies); 32393 } 32394 32395 // Verifies that SetIsOriginPotentiallyTrustworthy sets the secure context bit 32396-// in the bundle's delivered policies. 32397-TEST_F(PolicyContainerNavigationBundleTest, SetIsOriginPotentiallyTrustworthy) { 32398- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32399- bundle.SetIsOriginPotentiallyTrustworthy(true); 32400+// in the builder's delivered policies. 32401+TEST_F(NavigationPolicyContainerBuilderTest, 32402+ SetIsOriginPotentiallyTrustworthy) { 32403+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32404+ builder.SetIsOriginPotentiallyTrustworthy(true); 32405 32406 PolicyContainerPolicies expected_policies; 32407 expected_policies.is_web_secure_context = true; 32408 32409- EXPECT_EQ(bundle.DeliveredPoliciesForTesting(), expected_policies); 32410+ EXPECT_EQ(builder.DeliveredPoliciesForTesting(), expected_policies); 32411 32412- bundle.SetIsOriginPotentiallyTrustworthy(false); 32413+ builder.SetIsOriginPotentiallyTrustworthy(false); 32414 32415 expected_policies.is_web_secure_context = false; 32416- EXPECT_EQ(bundle.DeliveredPoliciesForTesting(), expected_policies); 32417+ EXPECT_EQ(builder.DeliveredPoliciesForTesting(), expected_policies); 32418 } 32419 32420 // Verifies that SetCrossOriginOpenerPolicy sets the cross-origin-opener-policy 32421-// in the bundle's delivered policies. 32422-TEST_F(PolicyContainerNavigationBundleTest, SetCrossOriginOpenerPolicy) { 32423- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32424+// in the builder's delivered policies. 32425+TEST_F(NavigationPolicyContainerBuilderTest, SetCrossOriginOpenerPolicy) { 32426+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32427 32428 network::CrossOriginOpenerPolicy coop; 32429 coop.value = network::mojom::CrossOriginOpenerPolicyValue::kSameOrigin; 32430@@ -127,140 +129,143 @@ TEST_F(PolicyContainerNavigationBundleTest, SetCrossOriginOpenerPolicy) { 32431 coop.reporting_endpoint = "A"; 32432 coop.report_only_reporting_endpoint = "B"; 32433 32434- bundle.SetCrossOriginOpenerPolicy(coop); 32435+ builder.SetCrossOriginOpenerPolicy(coop); 32436 32437 PolicyContainerPolicies expected_policies; 32438 expected_policies.cross_origin_opener_policy = coop; 32439 32440- EXPECT_EQ(bundle.DeliveredPoliciesForTesting(), expected_policies); 32441+ EXPECT_EQ(builder.DeliveredPoliciesForTesting(), expected_policies); 32442 } 32443 32444-// Verifies that the default final policies of a bundle are default-constructed, 32445-// and are equal to the policies of the bundle's policy container host. 32446-TEST_F(PolicyContainerNavigationBundleTest, DefaultFinalPolicies) { 32447- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32448- bundle.ComputePolicies(GURL()); 32449+// Verifies that the default final policies of a builder are 32450+// default-constructed, and are equal to the policies of the builder's policy 32451+// container host. 32452+TEST_F(NavigationPolicyContainerBuilderTest, DefaultFinalPolicies) { 32453+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32454+ builder.ComputePolicies(GURL()); 32455 32456 PolicyContainerPolicies expected_policies; 32457- EXPECT_EQ(bundle.FinalPolicies(), expected_policies); 32458+ EXPECT_EQ(builder.FinalPolicies(), expected_policies); 32459 32460 scoped_refptr<PolicyContainerHost> host = 32461- std::move(bundle).TakePolicyContainerHost(); 32462+ std::move(builder).TakePolicyContainerHost(); 32463 ASSERT_THAT(host, NotNull()); 32464 EXPECT_EQ(host->policies(), expected_policies); 32465 } 32466 32467 // Verifies that when the URL of the document to commit does not have a local 32468 // scheme, then the final policies are copied from the delivered policies. 32469-TEST_F(PolicyContainerNavigationBundleTest, FinalPoliciesNormalUrl) { 32470- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32471+TEST_F(NavigationPolicyContainerBuilderTest, FinalPoliciesNormalUrl) { 32472+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32473 32474- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32475- bundle.AddContentSecurityPolicy(MakeTestCSP()); 32476+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32477+ builder.AddContentSecurityPolicy(MakeTestCSP()); 32478 std::unique_ptr<PolicyContainerPolicies> delivered_policies = 32479- bundle.DeliveredPoliciesForTesting().Clone(); 32480- bundle.ComputePolicies(GURL("https://foo.test")); 32481+ builder.DeliveredPoliciesForTesting().Clone(); 32482+ builder.ComputePolicies(GURL("https://foo.test")); 32483 32484- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies); 32485+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies); 32486 } 32487 32488 // Verifies the final policies when the URL of the document to commit is 32489 // `about:blank` but there is no initiator. 32490-TEST_F(PolicyContainerNavigationBundleTest, 32491+TEST_F(NavigationPolicyContainerBuilderTest, 32492 FinalPoliciesAboutBlankWithoutInitiator) { 32493- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32494- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32495+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32496+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32497 std::unique_ptr<PolicyContainerPolicies> delivered_policies = 32498- bundle.DeliveredPoliciesForTesting().Clone(); 32499- bundle.ComputePolicies(AboutBlankUrl()); 32500+ builder.DeliveredPoliciesForTesting().Clone(); 32501+ builder.ComputePolicies(AboutBlankUrl()); 32502 32503- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies); 32504+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies); 32505 } 32506 32507 // Verifies the final policies when the URL of the document to commit is 32508 // `about:blank` but there is no initiator, and we have some additional CSPs. 32509-TEST_F(PolicyContainerNavigationBundleTest, 32510+TEST_F(NavigationPolicyContainerBuilderTest, 32511 FinalPoliciesAboutBlankWithoutInitiatorAdditionalCSP) { 32512- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32513- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32514- bundle.AddContentSecurityPolicy(MakeTestCSP()); 32515+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32516+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32517+ builder.AddContentSecurityPolicy(MakeTestCSP()); 32518 std::unique_ptr<PolicyContainerPolicies> delivered_policies = 32519- bundle.DeliveredPoliciesForTesting().Clone(); 32520- bundle.ComputePolicies(AboutBlankUrl()); 32521+ builder.DeliveredPoliciesForTesting().Clone(); 32522+ builder.ComputePolicies(AboutBlankUrl()); 32523 32524- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies); 32525+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies); 32526 } 32527 32528 // This test verifies the default final policies on error pages. 32529-TEST_F(PolicyContainerNavigationBundleTest, DefaultFinalPoliciesForErrorPage) { 32530- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32531+TEST_F(NavigationPolicyContainerBuilderTest, DefaultFinalPoliciesForErrorPage) { 32532+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32533 32534- bundle.ComputePoliciesForError(); 32535+ builder.ComputePoliciesForError(); 32536 32537 // Error pages commit with default policies, mostly ignoring the delivered 32538 // policies and the document's URL. 32539- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies()); 32540+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies()); 32541 } 32542 32543 // This test verifies that error pages commit in the same IP address space as 32544 // the underlying page would have, had it not failed to load. 32545-TEST_F(PolicyContainerNavigationBundleTest, ErrorPageIPAddressSpace) { 32546- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32547+TEST_F(NavigationPolicyContainerBuilderTest, ErrorPageIPAddressSpace) { 32548+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32549 32550- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32551- bundle.ComputePoliciesForError(); 32552+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPublic); 32553+ builder.ComputePoliciesForError(); 32554 32555 PolicyContainerPolicies expected_policies; 32556 expected_policies.ip_address_space = network::mojom::IPAddressSpace::kPublic; 32557- EXPECT_EQ(bundle.FinalPolicies(), expected_policies); 32558+ EXPECT_EQ(builder.FinalPolicies(), expected_policies); 32559 } 32560 32561-// Variation of: PolicyContainerNavigationBundleTest.ErrorPageIPAddressSpace 32562+// Variation of: NavigationPolicyContainerBuilderTest.ErrorPageIPAddressSpace 32563 // The decision to commit an error happens after receiving the response. 32564-TEST_F(PolicyContainerNavigationBundleTest, 32565+TEST_F(NavigationPolicyContainerBuilderTest, 32566 ErrorPageIPAddressSpaceAfterResponse) { 32567- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32568+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32569 32570- bundle.SetIPAddressSpace(network::mojom::IPAddressSpace::kPrivate); 32571+ builder.SetIPAddressSpace(network::mojom::IPAddressSpace::kPrivate); 32572 PolicyContainerPolicies expected_policies; 32573 expected_policies.ip_address_space = network::mojom::IPAddressSpace::kPrivate; 32574 32575- bundle.ComputePolicies(GURL("https://foo.test")); 32576- EXPECT_EQ(bundle.FinalPolicies(), expected_policies); 32577+ builder.ComputePolicies(GURL("https://foo.test")); 32578+ EXPECT_EQ(builder.FinalPolicies(), expected_policies); 32579 32580- bundle.ComputePoliciesForError(); 32581- EXPECT_EQ(bundle.FinalPolicies(), expected_policies); 32582+ builder.ComputePoliciesForError(); 32583+ EXPECT_EQ(builder.FinalPolicies(), expected_policies); 32584 } 32585 32586 // CSP delivered by the HTTP response are ignored for error document. 32587-TEST_F(PolicyContainerNavigationBundleTest, 32588+TEST_F(NavigationPolicyContainerBuilderTest, 32589 DeliveredCSPIgnoredForErrorDocument) { 32590- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32591- bundle.AddContentSecurityPolicy(network::mojom::ContentSecurityPolicy::New()); 32592+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32593+ builder.AddContentSecurityPolicy( 32594+ network::mojom::ContentSecurityPolicy::New()); 32595 32596- bundle.ComputePolicies(GURL("https://foo.test")); 32597- EXPECT_THAT(bundle.FinalPolicies().content_security_policies, SizeIs(1)); 32598+ builder.ComputePolicies(GURL("https://foo.test")); 32599+ EXPECT_THAT(builder.FinalPolicies().content_security_policies, SizeIs(1)); 32600 32601- bundle.ComputePoliciesForError(); 32602- EXPECT_THAT(bundle.FinalPolicies().content_security_policies, SizeIs(0)); 32603+ builder.ComputePoliciesForError(); 32604+ EXPECT_THAT(builder.FinalPolicies().content_security_policies, SizeIs(0)); 32605 } 32606 32607 // Verifies that InitiatorPolicies() returns nullptr in the absence of an 32608 // initiator frame token. 32609-TEST_F(PolicyContainerNavigationBundleTest, InitiatorPoliciesWithoutInitiator) { 32610- EXPECT_THAT(PolicyContainerNavigationBundle(nullptr, nullptr, nullptr) 32611+TEST_F(NavigationPolicyContainerBuilderTest, 32612+ InitiatorPoliciesWithoutInitiator) { 32613+ EXPECT_THAT(NavigationPolicyContainerBuilder(nullptr, nullptr, nullptr) 32614 .InitiatorPolicies(), 32615 IsNull()); 32616 } 32617 32618-// It would be nice to verify that when given a wrong token, the bundle just 32619+// It would be nice to verify that when given a wrong token, the builder just 32620 // ignores it and InitiatorPolicies() returns nullptr. However that path is 32621 // guarded by a DCHECK() so we cannot test it. 32622 32623 // Verifies that SetInitiator() copies the policies of the policy container host 32624 // associated to the given frame token, or resets those policies when given 32625 // nullptr. 32626-TEST_F(PolicyContainerNavigationBundleTest, InitiatorPoliciesWithInitiator) { 32627+TEST_F(NavigationPolicyContainerBuilderTest, InitiatorPoliciesWithInitiator) { 32628 std::unique_ptr<PolicyContainerPolicies> initiator_policies = 32629 MakeTestPolicies(); 32630 32631@@ -269,15 +274,15 @@ TEST_F(PolicyContainerNavigationBundleTest, InitiatorPoliciesWithInitiator) { 32632 32633 // Force implicit conversion from LocalFrameToken to UnguessableToken. 32634 const blink::LocalFrameToken& token = initiator->GetFrameToken(); 32635- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr); 32636+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr); 32637 32638- EXPECT_THAT(bundle.InitiatorPolicies(), 32639+ EXPECT_THAT(builder.InitiatorPolicies(), 32640 Pointee(Eq(ByRef(*initiator_policies)))); 32641 } 32642 32643 // Verifies that when the URL of the document to commit is `about:blank`, the 32644-// bundle's final policies are copied from the initiator. 32645-TEST_F(PolicyContainerNavigationBundleTest, 32646+// builder's final policies are copied from the initiator. 32647+TEST_F(NavigationPolicyContainerBuilderTest, 32648 FinalPoliciesAboutBlankWithInitiator) { 32649 std::unique_ptr<PolicyContainerPolicies> initiator_policies = 32650 MakeTestPolicies(); 32651@@ -287,15 +292,15 @@ TEST_F(PolicyContainerNavigationBundleTest, 32652 32653 // Force implicit conversion from LocalFrameToken to UnguessableToken. 32654 const blink::LocalFrameToken& token = initiator->GetFrameToken(); 32655- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr); 32656- bundle.ComputePolicies(AboutBlankUrl()); 32657+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr); 32658+ builder.ComputePolicies(AboutBlankUrl()); 32659 32660- EXPECT_EQ(bundle.FinalPolicies(), *initiator_policies); 32661+ EXPECT_EQ(builder.FinalPolicies(), *initiator_policies); 32662 } 32663 32664 // Verifies that when the URL of the document to commit is `blob:.*`, the 32665-// bundle's final policies are copied from the initiator. 32666-TEST_F(PolicyContainerNavigationBundleTest, FinalPoliciesBlobWithInitiator) { 32667+// builder's final policies are copied from the initiator. 32668+TEST_F(NavigationPolicyContainerBuilderTest, FinalPoliciesBlobWithInitiator) { 32669 std::unique_ptr<PolicyContainerPolicies> initiator_policies = 32670 MakeTestPolicies(); 32671 TestRenderFrameHost* initiator = contents()->GetMainFrame(); 32672@@ -303,18 +308,18 @@ TEST_F(PolicyContainerNavigationBundleTest, FinalPoliciesBlobWithInitiator) { 32673 32674 // Force implicit conversion from LocalFrameToken to UnguessableToken. 32675 const blink::LocalFrameToken& token = initiator->GetFrameToken(); 32676- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr); 32677+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr); 32678 32679- bundle.ComputePolicies( 32680+ builder.ComputePolicies( 32681 GURL("blob:https://example.com/016ece86-b7f9-4b07-88c2-a0e36b7f1dd6")); 32682 32683- EXPECT_EQ(bundle.FinalPolicies(), *initiator_policies); 32684+ EXPECT_EQ(builder.FinalPolicies(), *initiator_policies); 32685 } 32686 32687 // Verifies that when the URL of the document to commit is `about:blank`, the 32688-// bundle's final policies are copied from the initiator, and additional 32689+// builder's final policies are copied from the initiator, and additional 32690 // delivered policies are merged. 32691-TEST_F(PolicyContainerNavigationBundleTest, 32692+TEST_F(NavigationPolicyContainerBuilderTest, 32693 FinalPoliciesAboutBlankWithInitiatorAndAdditionalCSP) { 32694 std::unique_ptr<PolicyContainerPolicies> initiator_policies = 32695 MakeTestPolicies(); 32696@@ -324,91 +329,91 @@ TEST_F(PolicyContainerNavigationBundleTest, 32697 32698 // Force implicit conversion from LocalFrameToken to UnguessableToken. 32699 const blink::LocalFrameToken& token = initiator->GetFrameToken(); 32700- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr); 32701+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr); 32702 32703 // Add some CSP. 32704 network::mojom::ContentSecurityPolicyPtr test_csp = MakeTestCSP(); 32705- bundle.AddContentSecurityPolicy(test_csp.Clone()); 32706- bundle.ComputePolicies(AboutBlankUrl()); 32707+ builder.AddContentSecurityPolicy(test_csp.Clone()); 32708+ builder.ComputePolicies(AboutBlankUrl()); 32709 32710 // Append the CPS to the `initiator_policies` just for testing equality 32711 // later. 32712 initiator_policies->content_security_policies.push_back(std::move(test_csp)); 32713- EXPECT_EQ(bundle.FinalPolicies(), *initiator_policies); 32714+ EXPECT_EQ(builder.FinalPolicies(), *initiator_policies); 32715 } 32716 32717 // Verifies that ParentPolicies returns nullptr in the absence of a parent. 32718-TEST_F(PolicyContainerNavigationBundleTest, ParentPoliciesWithoutParent) { 32719- EXPECT_THAT(PolicyContainerNavigationBundle(nullptr, nullptr, nullptr) 32720+TEST_F(NavigationPolicyContainerBuilderTest, ParentPoliciesWithoutParent) { 32721+ EXPECT_THAT(NavigationPolicyContainerBuilder(nullptr, nullptr, nullptr) 32722 .ParentPolicies(), 32723 IsNull()); 32724 } 32725 32726 // Verifies that ParentPolicies returns a pointer to a copy of the parent's 32727 // policies. 32728-TEST_F(PolicyContainerNavigationBundleTest, ParentPoliciesWithParent) { 32729+TEST_F(NavigationPolicyContainerBuilderTest, ParentPoliciesWithParent) { 32730 std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies(); 32731 32732 TestRenderFrameHost* parent = contents()->GetMainFrame(); 32733 parent->SetPolicyContainerHost(NewHost(parent_policies->Clone())); 32734 32735- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr); 32736+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr); 32737 32738- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 32739+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 32740 } 32741 32742 // Verifies that when the the URL of the document to commit is `about:srcdoc`, 32743-// the bundle's final policies are copied from the parent. 32744-TEST_F(PolicyContainerNavigationBundleTest, 32745+// the builder's final policies are copied from the parent. 32746+TEST_F(NavigationPolicyContainerBuilderTest, 32747 FinalPoliciesAboutSrcdocWithParent) { 32748 std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies(); 32749 32750 TestRenderFrameHost* parent = contents()->GetMainFrame(); 32751 parent->SetPolicyContainerHost(NewHost(parent_policies->Clone())); 32752 32753- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr); 32754- bundle.ComputePolicies(AboutSrcdocUrl()); 32755+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr); 32756+ builder.ComputePolicies(AboutSrcdocUrl()); 32757 32758- EXPECT_EQ(bundle.FinalPolicies(), *parent_policies); 32759+ EXPECT_EQ(builder.FinalPolicies(), *parent_policies); 32760 } 32761 32762 // Verifies that when a document has a potentially-trustworthy origin and no 32763 // parent, then it is a secure context. 32764-TEST_F(PolicyContainerNavigationBundleTest, 32765+TEST_F(NavigationPolicyContainerBuilderTest, 32766 IsWebSecureContextTrustworthyOriginNoParent) { 32767- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32768+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32769 32770- bundle.SetIsOriginPotentiallyTrustworthy(true); 32771+ builder.SetIsOriginPotentiallyTrustworthy(true); 32772 32773 std::unique_ptr<PolicyContainerPolicies> delivered_policies = 32774- bundle.DeliveredPoliciesForTesting().Clone(); 32775+ builder.DeliveredPoliciesForTesting().Clone(); 32776 EXPECT_TRUE(delivered_policies->is_web_secure_context); 32777 32778- bundle.ComputePolicies(GURL()); 32779+ builder.ComputePolicies(GURL()); 32780 32781- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies); 32782+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies); 32783 } 32784 32785 // Verifies that when a document has a non-potentially-trustworthy origin and no 32786 // parent, then it is not a secure context. 32787-TEST_F(PolicyContainerNavigationBundleTest, 32788+TEST_F(NavigationPolicyContainerBuilderTest, 32789 IsWebSecureContextNonTrustworthyOriginNoParent) { 32790- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32791+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32792 32793- bundle.SetIsOriginPotentiallyTrustworthy(false); 32794+ builder.SetIsOriginPotentiallyTrustworthy(false); 32795 32796 std::unique_ptr<PolicyContainerPolicies> delivered_policies = 32797- bundle.DeliveredPoliciesForTesting().Clone(); 32798+ builder.DeliveredPoliciesForTesting().Clone(); 32799 EXPECT_FALSE(delivered_policies->is_web_secure_context); 32800 32801- bundle.ComputePolicies(GURL()); 32802+ builder.ComputePolicies(GURL()); 32803 32804- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies); 32805+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies); 32806 } 32807 32808 // Verifies that when a document has a potentially-trustworthy origin and a 32809 // parent that is not a secure context, then it is not a secure context. 32810-TEST_F(PolicyContainerNavigationBundleTest, 32811+TEST_F(NavigationPolicyContainerBuilderTest, 32812 IsWebSecureContextTrustworthyOriginNonSecureParent) { 32813 std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies(); 32814 parent_policies->is_web_secure_context = false; 32815@@ -416,18 +421,18 @@ TEST_F(PolicyContainerNavigationBundleTest, 32816 TestRenderFrameHost* parent = contents()->GetMainFrame(); 32817 parent->SetPolicyContainerHost(NewHost(std::move(parent_policies))); 32818 32819- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr); 32820+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr); 32821 32822- bundle.SetIsOriginPotentiallyTrustworthy(true); 32823+ builder.SetIsOriginPotentiallyTrustworthy(true); 32824 32825- bundle.ComputePolicies(GURL("https://foo.test")); 32826+ builder.ComputePolicies(GURL("https://foo.test")); 32827 32828- EXPECT_FALSE(bundle.FinalPolicies().is_web_secure_context); 32829+ EXPECT_FALSE(builder.FinalPolicies().is_web_secure_context); 32830 } 32831 32832 // Verifies that when a document has a non-potentially-trustworthy origin and a 32833 // parent that is a secure context, then it is not a secure context. 32834-TEST_F(PolicyContainerNavigationBundleTest, 32835+TEST_F(NavigationPolicyContainerBuilderTest, 32836 IsWebSecureContextNonTrustworthyOriginSecureParent) { 32837 std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies(); 32838 parent_policies->is_web_secure_context = true; 32839@@ -435,22 +440,22 @@ TEST_F(PolicyContainerNavigationBundleTest, 32840 TestRenderFrameHost* parent = contents()->GetMainFrame(); 32841 parent->SetPolicyContainerHost(NewHost(std::move(parent_policies))); 32842 32843- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr); 32844+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr); 32845 32846- bundle.SetIsOriginPotentiallyTrustworthy(false); 32847+ builder.SetIsOriginPotentiallyTrustworthy(false); 32848 32849 std::unique_ptr<PolicyContainerPolicies> delivered_policies = 32850- bundle.DeliveredPoliciesForTesting().Clone(); 32851+ builder.DeliveredPoliciesForTesting().Clone(); 32852 EXPECT_FALSE(delivered_policies->is_web_secure_context); 32853 32854- bundle.ComputePolicies(GURL("http://foo.test")); 32855+ builder.ComputePolicies(GURL("http://foo.test")); 32856 32857- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies); 32858+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies); 32859 } 32860 32861 // Verifies that when a document has a potentially-trustworthy origin and a 32862 // parent that is a secure context, then it is a secure context. 32863-TEST_F(PolicyContainerNavigationBundleTest, 32864+TEST_F(NavigationPolicyContainerBuilderTest, 32865 IsWebSecureContextTrustworthyOriginSecureParent) { 32866 std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies(); 32867 parent_policies->is_web_secure_context = true; 32868@@ -458,61 +463,60 @@ TEST_F(PolicyContainerNavigationBundleTest, 32869 TestRenderFrameHost* parent = contents()->GetMainFrame(); 32870 parent->SetPolicyContainerHost(NewHost(std::move(parent_policies))); 32871 32872- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr); 32873+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr); 32874 32875- bundle.SetIsOriginPotentiallyTrustworthy(true); 32876+ builder.SetIsOriginPotentiallyTrustworthy(true); 32877 32878 std::unique_ptr<PolicyContainerPolicies> delivered_policies = 32879- bundle.DeliveredPoliciesForTesting().Clone(); 32880+ builder.DeliveredPoliciesForTesting().Clone(); 32881 EXPECT_TRUE(delivered_policies->is_web_secure_context); 32882 32883- bundle.ComputePolicies(GURL("https://foo.test")); 32884+ builder.ComputePolicies(GURL("https://foo.test")); 32885 32886- EXPECT_EQ(bundle.FinalPolicies(), *delivered_policies); 32887+ EXPECT_EQ(builder.FinalPolicies(), *delivered_policies); 32888 } 32889 32890 // Verifies that when the the URL of the document to commit is `about:srcdoc`, 32891-// the bundle's final policies are copied from the parent, and additional 32892+// the builder's final policies are copied from the parent, and additional 32893 // delivered policies are merged. 32894-TEST_F(PolicyContainerNavigationBundleTest, 32895+TEST_F(NavigationPolicyContainerBuilderTest, 32896 FinalPoliciesAboutSrcdocWithParentAndAdditionalCSP) { 32897 std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies(); 32898 32899 TestRenderFrameHost* parent = contents()->GetMainFrame(); 32900 parent->SetPolicyContainerHost(NewHost(parent_policies->Clone())); 32901 32902- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr); 32903+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr); 32904 32905 // Add some CSP. 32906 network::mojom::ContentSecurityPolicyPtr test_csp = MakeTestCSP(); 32907- bundle.AddContentSecurityPolicy(test_csp.Clone()); 32908- bundle.ComputePolicies(AboutSrcdocUrl()); 32909+ builder.AddContentSecurityPolicy(test_csp.Clone()); 32910+ builder.ComputePolicies(AboutSrcdocUrl()); 32911 32912 // Append the CPS to the `parent_policies` just for testing equality 32913 // later. 32914 parent_policies->content_security_policies.push_back(std::move(test_csp)); 32915- EXPECT_EQ(bundle.FinalPolicies(), *parent_policies); 32916+ EXPECT_EQ(builder.FinalPolicies(), *parent_policies); 32917 } 32918 32919 // Calling ComputePolicies() twice triggers a DCHECK. 32920-TEST_F(PolicyContainerNavigationBundleTest, ComputePoliciesTwiceDCHECK) { 32921- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32922+TEST_F(NavigationPolicyContainerBuilderTest, ComputePoliciesTwiceDCHECK) { 32923+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32924 GURL url("https://foo.test"); 32925- bundle.ComputePolicies(url); 32926- EXPECT_DCHECK_DEATH(bundle.ComputePolicies(url)); 32927+ builder.ComputePolicies(url); 32928+ EXPECT_DCHECK_DEATH(builder.ComputePolicies(url)); 32929 } 32930 32931-// Calling ComputePolicies() followed by ComputePoliciesForError() is 32932-// supported. 32933-TEST_F(PolicyContainerNavigationBundleTest, ComputePoliciesThenError) { 32934- PolicyContainerNavigationBundle bundle(nullptr, nullptr, nullptr); 32935- bundle.ComputePolicies(GURL("https://foo.test")); 32936- bundle.ComputePoliciesForError(); 32937+// Calling ComputePolicies() followed by ComputePoliciesForError() is supported. 32938+TEST_F(NavigationPolicyContainerBuilderTest, ComputePoliciesThenError) { 32939+ NavigationPolicyContainerBuilder builder(nullptr, nullptr, nullptr); 32940+ builder.ComputePolicies(GURL("https://foo.test")); 32941+ builder.ComputePoliciesForError(); 32942 } 32943 32944-// After ComputePolicies() or ComputePoliciesForError(), the initiator 32945-// policies are still accessible. 32946-TEST_F(PolicyContainerNavigationBundleTest, 32947+// After ComputePolicies() or ComputePoliciesForError(), the initiator policies 32948+// are still accessible. 32949+TEST_F(NavigationPolicyContainerBuilderTest, 32950 AccessInitiatorAfterComputingPolicies) { 32951 std::unique_ptr<PolicyContainerPolicies> initiator_policies = 32952 MakeTestPolicies(); 32953@@ -520,60 +524,60 @@ TEST_F(PolicyContainerNavigationBundleTest, 32954 initiator->SetPolicyContainerHost(NewHost(initiator_policies->Clone())); 32955 const blink::LocalFrameToken& token = initiator->GetFrameToken(); 32956 32957- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr); 32958- EXPECT_THAT(bundle.InitiatorPolicies(), 32959+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr); 32960+ EXPECT_THAT(builder.InitiatorPolicies(), 32961 Pointee(Eq(ByRef(*initiator_policies)))); 32962 32963- bundle.ComputePolicies(GURL("https://foo.test")); 32964- EXPECT_THAT(bundle.InitiatorPolicies(), 32965+ builder.ComputePolicies(GURL("https://foo.test")); 32966+ EXPECT_THAT(builder.InitiatorPolicies(), 32967 Pointee(Eq(ByRef(*initiator_policies)))); 32968 32969- bundle.ComputePoliciesForError(); 32970- EXPECT_THAT(bundle.InitiatorPolicies(), 32971+ builder.ComputePoliciesForError(); 32972+ EXPECT_THAT(builder.InitiatorPolicies(), 32973 Pointee(Eq(ByRef(*initiator_policies)))); 32974 } 32975 32976 // After ComputePolicies() or ComputePoliciesForError(), the parent 32977 // policies are still accessible. 32978-TEST_F(PolicyContainerNavigationBundleTest, 32979+TEST_F(NavigationPolicyContainerBuilderTest, 32980 AccessParentAfterComputingPolicies) { 32981 std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies(); 32982 TestRenderFrameHost* parent = contents()->GetMainFrame(); 32983 parent->SetPolicyContainerHost(NewHost(parent_policies->Clone())); 32984 32985- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr); 32986- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 32987+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr); 32988+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 32989 32990- bundle.ComputePolicies(GURL("https://foo.test")); 32991- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 32992+ builder.ComputePolicies(GURL("https://foo.test")); 32993+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 32994 32995- bundle.ComputePoliciesForError(); 32996- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 32997+ builder.ComputePoliciesForError(); 32998+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 32999 } 33000 33001 // Verifies that the parent policies are preserved on 33002 // ResetForCrossDocumentRestart. 33003-TEST_F(PolicyContainerNavigationBundleTest, 33004+TEST_F(NavigationPolicyContainerBuilderTest, 33005 ResetForCrossDocumentRestartParentPolicies) { 33006 std::unique_ptr<PolicyContainerPolicies> parent_policies = MakeTestPolicies(); 33007 33008 TestRenderFrameHost* parent = contents()->GetMainFrame(); 33009 parent->SetPolicyContainerHost(NewHost(parent_policies->Clone())); 33010 33011- PolicyContainerNavigationBundle bundle(parent, nullptr, nullptr); 33012- bundle.ComputePolicies(GURL("https://foo.test")); 33013- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies()); 33014+ NavigationPolicyContainerBuilder builder(parent, nullptr, nullptr); 33015+ builder.ComputePolicies(GURL("https://foo.test")); 33016+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies()); 33017 33018- bundle.ResetForCrossDocumentRestart(); 33019- EXPECT_THAT(bundle.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 33020- bundle.ComputePolicies(AboutSrcdocUrl()); 33021+ builder.ResetForCrossDocumentRestart(); 33022+ EXPECT_THAT(builder.ParentPolicies(), Pointee(Eq(ByRef(*parent_policies)))); 33023+ builder.ComputePolicies(AboutSrcdocUrl()); 33024 33025- EXPECT_EQ(bundle.FinalPolicies(), *parent_policies); 33026+ EXPECT_EQ(builder.FinalPolicies(), *parent_policies); 33027 } 33028 33029 // Verifies that the initiator policies are preserved on 33030 // ResetForCrossDocumentRestart. 33031-TEST_F(PolicyContainerNavigationBundleTest, 33032+TEST_F(NavigationPolicyContainerBuilderTest, 33033 ResetForCrossDocumentRestartInitiatorPolicies) { 33034 std::unique_ptr<PolicyContainerPolicies> initiator_policies = 33035 MakeTestPolicies(); 33036@@ -583,17 +587,17 @@ TEST_F(PolicyContainerNavigationBundleTest, 33037 33038 // Force implicit conversion from LocalFrameToken to UnguessableToken. 33039 const blink::LocalFrameToken& token = initiator->GetFrameToken(); 33040- PolicyContainerNavigationBundle bundle(nullptr, &token, nullptr); 33041+ NavigationPolicyContainerBuilder builder(nullptr, &token, nullptr); 33042 33043- bundle.ComputePolicies(GURL("https://foo.test")); 33044- EXPECT_EQ(bundle.FinalPolicies(), PolicyContainerPolicies()); 33045+ builder.ComputePolicies(GURL("https://foo.test")); 33046+ EXPECT_EQ(builder.FinalPolicies(), PolicyContainerPolicies()); 33047 33048- bundle.ResetForCrossDocumentRestart(); 33049- EXPECT_THAT(bundle.InitiatorPolicies(), 33050+ builder.ResetForCrossDocumentRestart(); 33051+ EXPECT_THAT(builder.InitiatorPolicies(), 33052 Pointee(Eq(ByRef(*initiator_policies)))); 33053- bundle.ComputePolicies(AboutBlankUrl()); 33054+ builder.ComputePolicies(AboutBlankUrl()); 33055 33056- EXPECT_EQ(bundle.FinalPolicies(), *initiator_policies); 33057+ EXPECT_EQ(builder.FinalPolicies(), *initiator_policies); 33058 } 33059 33060 } // namespace 33061diff --git a/src/content/browser/renderer_host/navigation_request.cc b/src/content/browser/renderer_host/navigation_request.cc 33062index 32c7890a69379..0585e895ef8b7 33063--- a/src/content/browser/renderer_host/navigation_request.cc 33064+++ b/src/content/browser/renderer_host/navigation_request.cc 33065@@ -1440,7 +1440,7 @@ NavigationRequest::NavigationRequest( 33066 initiator_document_ = initiator_rfh->GetWeakDocumentPtr(); 33067 } 33068 33069- policy_container_navigation_bundle_.emplace( 33070+ policy_container_builder_.emplace( 33071 GetParentFrame(), 33072 initiator_frame_token_.has_value() ? &*initiator_frame_token_ : nullptr, 33073 frame_entry); 33074@@ -2066,7 +2066,7 @@ void NavigationRequest::BeginNavigationImpl() { 33075 // MHTML iframe, before selecting the RenderFrameHost. 33076 const url::Origin origin = GetOriginForURLLoaderFactoryUnchecked(this); 33077 coop_status_.EnforceCOOP( 33078- policy_container_navigation_bundle_->FinalPolicies() 33079+ policy_container_builder_->FinalPolicies() 33080 .cross_origin_opener_policy, 33081 origin, net::NetworkIsolationKey(origin, origin)); 33082 33083@@ -2309,7 +2309,7 @@ void NavigationRequest::ResetForCrossDocumentRestart() { 33084 // Reset navigation handle timings. 33085 navigation_handle_timing_ = NavigationHandleTiming(); 33086 33087- policy_container_navigation_bundle_->ResetForCrossDocumentRestart(); 33088+ policy_container_builder_->ResetForCrossDocumentRestart(); 33089 } 33090 33091 void NavigationRequest::ResetStateForSiteInstanceChange() { 33092@@ -2380,21 +2380,21 @@ network::mojom::ContentSecurityPolicyPtr NavigationRequest::TakeRequiredCSP() { 33093 33094 const PolicyContainerPolicies* 33095 NavigationRequest::GetInitiatorPolicyContainerPolicies() const { 33096- return policy_container_navigation_bundle_->InitiatorPolicies(); 33097+ return policy_container_builder_->InitiatorPolicies(); 33098 } 33099 33100 const PolicyContainerPolicies& NavigationRequest::GetPolicyContainerPolicies() 33101 const { 33102 DCHECK_GE(state_, READY_TO_COMMIT); 33103 33104- return policy_container_navigation_bundle_->FinalPolicies(); 33105+ return policy_container_builder_->FinalPolicies(); 33106 } 33107 33108 blink::mojom::PolicyContainerPtr 33109 NavigationRequest::CreatePolicyContainerForBlink() { 33110 DCHECK_GE(state_, READY_TO_COMMIT); 33111 33112- return policy_container_navigation_bundle_->CreatePolicyContainerForBlink(); 33113+ return policy_container_builder_->CreatePolicyContainerForBlink(); 33114 } 33115 33116 scoped_refptr<PolicyContainerHost> 33117@@ -2402,10 +2402,10 @@ NavigationRequest::TakePolicyContainerHost() { 33118 DCHECK_GE(state_, READY_TO_COMMIT); 33119 33120 // Move the host out of the data member, then reset the member. This ensures 33121- // we do not use the bundle after we moved its contents. 33122+ // we do not use the helper after we moved its contents. 33123 scoped_refptr<PolicyContainerHost> host = 33124- std::move(*policy_container_navigation_bundle_).TakePolicyContainerHost(); 33125- policy_container_navigation_bundle_ = absl::nullopt; 33126+ std::move(*policy_container_builder_).TakePolicyContainerHost(); 33127+ policy_container_builder_ = absl::nullopt; 33128 33129 return host; 33130 } 33131@@ -2415,7 +2415,7 @@ void NavigationRequest::CreateCoepReporter( 33132 DCHECK(!isolation_info_for_subresources_.IsEmpty()); 33133 33134 const PolicyContainerPolicies& policies = 33135- policy_container_navigation_bundle_->FinalPolicies(); 33136+ policy_container_builder_->FinalPolicies(); 33137 coep_reporter_ = std::make_unique<CrossOriginEmbedderPolicyReporter>( 33138 static_cast<StoragePartitionImpl*>(storage_partition)->GetWeakPtr(), 33139 common_params_->url, 33140@@ -3086,7 +3086,7 @@ void NavigationRequest::OnResponseStarted( 33141 // OnRequestFailedInternal has destroyed the NavigationRequest. 33142 return; 33143 } 33144- policy_container_navigation_bundle_->SetCrossOriginOpenerPolicy( 33145+ policy_container_builder_->SetCrossOriginOpenerPolicy( 33146 response_head_->parsed_headers->cross_origin_opener_policy); 33147 } 33148 33149@@ -3099,7 +3099,7 @@ void NavigationRequest::OnResponseStarted( 33150 GetOriginForURLLoaderFactoryWithoutFinalFrameHost( 33151 sandbox_flags_to_commit_.value()); 33152 const PolicyContainerPolicies& policies = 33153- policy_container_navigation_bundle_->FinalPolicies(); 33154+ policy_container_builder_->FinalPolicies(); 33155 coop_status_.EnforceCOOP(policies.cross_origin_opener_policy, origin, 33156 network_isolation_key); 33157 } 33158@@ -3582,7 +3582,7 @@ void NavigationRequest::OnRequestFailedInternal( 33159 // define our own flags, preferably the strictest ones instead. 33160 ComputePoliciesToCommitForError(); 33161 33162- coop_status_.EnforceCOOP(policy_container_navigation_bundle_->FinalPolicies() 33163+ coop_status_.EnforceCOOP(policy_container_builder_->FinalPolicies() 33164 .cross_origin_opener_policy, 33165 url::Origin(), 33166 net::NetworkIsolationKey::CreateTransient()); 33167@@ -4471,7 +4471,7 @@ void NavigationRequest::CommitNavigation() { 33168 // about to go. 33169 service_worker_handle_->OnBeginNavigationCommit( 33170 render_frame_host_->GetGlobalId(), 33171- policy_container_navigation_bundle_->FinalPolicies() 33172+ policy_container_builder_->FinalPolicies() 33173 .cross_origin_embedder_policy, 33174 std::move(reporter_remote), &service_worker_container_info, 33175 commit_params_->document_ukm_source_id); 33176@@ -4493,6 +4493,27 @@ void NavigationRequest::CommitNavigation() { 33177 } 33178 } 33179 33180+ // Determine if top-level navigation is allowed without sticky user 33181+ // activation. This is used to fix the exploit in https://crbug.com/1251790. 33182+ // If a child document is cross-origin with its parent, it loses its ability 33183+ // to navigate top without user gesture. One notable exception is made if its 33184+ // parent embeds it using sandbox="allow-top-navigation". Please note this is 33185+ // quite unusual, because it means using sandbox brings new capabilities, as 33186+ // opposed to new restrictions. 33187+ using WebSandboxFlags = network::mojom::WebSandboxFlags; 33188+ const bool embedder_allows_top_navigation_explicitly = 33189+ ((commit_params_->frame_policy.sandbox_flags != WebSandboxFlags::kNone) && 33190+ (commit_params_->frame_policy.sandbox_flags & 33191+ WebSandboxFlags::kTopNavigation) == WebSandboxFlags::kNone); 33192+ const bool is_same_origin_to_top = 33193+ GetOriginToCommit() == 33194+ GetRenderFrameHost()->GetMainFrame()->GetLastCommittedOrigin(); 33195+ if (is_same_origin_to_top) { 33196+ policy_container_builder_->SetAllowTopNavigationWithoutUserGesture(true); 33197+ } else if (!IsInMainFrame() && !embedder_allows_top_navigation_explicitly) { 33198+ policy_container_builder_->SetAllowTopNavigationWithoutUserGesture(false); 33199+ } 33200+ 33201 // If this is a result of an ad auction, need to pass its ad component URLs to 33202 // the renderer. 33203 if (pending_ad_components_map_) { 33204@@ -4875,7 +4896,7 @@ net::Error NavigationRequest::CheckContentSecurityPolicy( 33205 bool has_followed_redirect, 33206 bool url_upgraded_after_redirect, 33207 bool is_response_check) { 33208- DCHECK(policy_container_navigation_bundle_.has_value()); 33209+ DCHECK(policy_container_builder_.has_value()); 33210 if (common_params_->url.SchemeIs(url::kAboutScheme)) 33211 return net::OK; 33212 33213@@ -4889,7 +4910,7 @@ net::Error NavigationRequest::CheckContentSecurityPolicy( 33214 33215 RenderFrameHostImpl* parent = frame_tree_node()->parent(); 33216 const PolicyContainerPolicies* parent_policies = 33217- policy_container_navigation_bundle_->ParentPolicies(); 33218+ policy_container_builder_->ParentPolicies(); 33219 DCHECK(!parent == !parent_policies); 33220 if (!parent && frame_tree_node()->current_frame_host()->InsidePortal() && 33221 frame_tree_node()->render_manager()->GetOuterDelegateNode()) { 33222@@ -4900,12 +4921,12 @@ net::Error NavigationRequest::CheckContentSecurityPolicy( 33223 ->GetParent(); 33224 // TODO(antoniosartori): If we want to keep checking frame-src for portals, 33225 // consider storing a snapshot of the parent policies in the 33226- // `policy_container_navigation_bundle_` at the beginning of the navigation. 33227+ // `policy_container_builder_` at the beginning of the navigation. 33228 parent_policies = &parent->policy_container_host()->policies(); 33229 } 33230 33231 const PolicyContainerPolicies* initiator_policies = 33232- policy_container_navigation_bundle_->InitiatorPolicies(); 33233+ policy_container_builder_->InitiatorPolicies(); 33234 33235 // CSP checking happens in three phases, per steps 3-5 of 33236 // https://fetch.spec.whatwg.org/#main-fetch: 33237@@ -5086,7 +5107,7 @@ NavigationRequest::CheckCSPEmbeddedEnforcement() { 33238 GetParentFrame()->GetLastCommittedOrigin(), GetURL(), allow_csp_from, 33239 required_csp_)) { 33240 // Enforce the required CSPs on the frame by passing them down to blink. 33241- policy_container_navigation_bundle_->AddContentSecurityPolicy( 33242+ policy_container_builder_->AddContentSecurityPolicy( 33243 required_csp_->Clone()); 33244 return CSPEmbeddedEnforcementResult::ALLOW_RESPONSE; 33245 } 33246@@ -5738,7 +5759,7 @@ void NavigationRequest::UpdatePrivateNetworkRequestPolicy() { 33247 } 33248 33249 const PolicyContainerPolicies& policies = 33250- policy_container_navigation_bundle_->FinalPolicies(); 33251+ policy_container_builder_->FinalPolicies(); 33252 33253 if (!policies.is_web_secure_context && 33254 base::FeatureList::IsEnabled( 33255@@ -6748,7 +6769,7 @@ NavigationRequest::ComputeCrossOriginEmbedderPolicy() { 33256 // Return whether the child's |coep| is compatible with its parent's COEP. It 33257 // also sends COEP reports if needed. 33258 bool NavigationRequest::CheckResponseAdherenceToCoep(const GURL& url) { 33259- const auto& coep = policy_container_navigation_bundle_->FinalPolicies() 33260+ const auto& coep = policy_container_builder_->FinalPolicies() 33261 .cross_origin_embedder_policy; 33262 33263 // Fenced Frames should respect the outer frame's COEP. 33264@@ -6824,7 +6845,7 @@ NavigationRequest::EnforceCOEP() { 33265 33266 bool NavigationRequest::CoopCoepSanityCheck() { 33267 const PolicyContainerPolicies& policies = 33268- policy_container_navigation_bundle_->FinalPolicies(); 33269+ policy_container_builder_->FinalPolicies(); 33270 network::mojom::CrossOriginOpenerPolicyValue coop_value = 33271 IsInMainFrame() ? policies.cross_origin_opener_policy.value 33272 : render_frame_host_->GetMainFrame() 33273@@ -6856,7 +6877,7 @@ NavigationRequest::BuildClientSecurityState() { 33274 auto client_security_state = network::mojom::ClientSecurityState::New(); 33275 33276 const PolicyContainerPolicies& policies = 33277- policy_container_navigation_bundle_->FinalPolicies(); 33278+ policy_container_builder_->FinalPolicies(); 33279 client_security_state->is_web_secure_context = policies.is_web_secure_context; 33280 client_security_state->ip_address_space = policies.ip_address_space; 33281 33282@@ -6927,7 +6948,7 @@ RenderFrameHostImpl* NavigationRequest::GetInitiatorDocumentRenderFrameHost() { 33283 33284 void NavigationRequest::RecordAddressSpaceFeature() { 33285 DCHECK(response_head_); 33286- DCHECK(policy_container_navigation_bundle_); 33287+ DCHECK(policy_container_builder_); 33288 33289 RenderFrameHostImpl* initiator_render_frame_host = 33290 GetInitiatorDocumentRenderFrameHost(); 33291@@ -6942,7 +6963,7 @@ void NavigationRequest::RecordAddressSpaceFeature() { 33292 // If there is an initiator document, then `initiator_frame_token_` should 33293 // have a value, and thus there should be initiator policies. 33294 const PolicyContainerPolicies* initiator_policies = 33295- policy_container_navigation_bundle_->InitiatorPolicies(); 33296+ policy_container_builder_->InitiatorPolicies(); 33297 DCHECK(initiator_policies); 33298 if (!initiator_policies) { 33299 base::debug::DumpWithoutCrashing(); // Just in case. 33300@@ -6982,31 +7003,31 @@ void NavigationRequest::ComputePoliciesToCommit() { 33301 33302 network::mojom::IPAddressSpace response_address_space = 33303 CalculateIPAddressSpace(url, response_head_.get()); 33304- policy_container_navigation_bundle_->SetIPAddressSpace( 33305+ policy_container_builder_->SetIPAddressSpace( 33306 response_address_space); 33307 33308 if (response_head_ && !devtools_instrumentation::ShouldBypassCSP(*this)) { 33309- policy_container_navigation_bundle_->AddContentSecurityPolicies( 33310+ policy_container_builder_->AddContentSecurityPolicies( 33311 mojo::Clone(response_head_->parsed_headers->content_security_policy)); 33312 } 33313 33314 // Use the unchecked / non-sandboxed origin to calculate potential 33315 // trustworthiness. Indeed, the potential trustworthiness check should apply 33316 // to the origin of the creation URL, prior to opaquification. 33317- policy_container_navigation_bundle_->SetIsOriginPotentiallyTrustworthy( 33318+ policy_container_builder_->SetIsOriginPotentiallyTrustworthy( 33319 network::IsOriginPotentiallyTrustworthy( 33320 GetOriginForURLLoaderFactoryUnchecked(this))); 33321 33322- policy_container_navigation_bundle_->SetCrossOriginEmbedderPolicy( 33323+ policy_container_builder_->SetCrossOriginEmbedderPolicy( 33324 ComputeCrossOriginEmbedderPolicy()); 33325 33326- policy_container_navigation_bundle_->ComputePolicies(url); 33327+ policy_container_builder_->ComputePolicies(url); 33328 33329 ComputeSandboxFlagsToCommit(); 33330 } 33331 33332 void NavigationRequest::ComputePoliciesToCommitForError() { 33333- policy_container_navigation_bundle_->ComputePoliciesForError(); 33334+ policy_container_builder_->ComputePoliciesForError(); 33335 ComputeSandboxFlagsToCommit(); 33336 } 33337 33338@@ -7021,7 +7042,7 @@ void NavigationRequest::ComputeSandboxFlagsToCommit() { 33339 33340 // The document can also restrict sandbox further, via its CSP. 33341 const PolicyContainerPolicies& policies_to_commit = 33342- policy_container_navigation_bundle_->FinalPolicies(); 33343+ policy_container_builder_->FinalPolicies(); 33344 for (const auto& csp : policies_to_commit.content_security_policies) 33345 *sandbox_flags_to_commit_ |= csp->sandbox; 33346 33347diff --git a/src/content/browser/renderer_host/navigation_request.h b/src/content/browser/renderer_host/navigation_request.h 33348index 6d3c43e17901d..2d985bc9f493a 33349--- a/src/content/browser/renderer_host/navigation_request.h 33350+++ b/src/content/browser/renderer_host/navigation_request.h 33351@@ -27,9 +27,9 @@ 33352 #include "content/browser/renderer_host/cross_origin_opener_policy_status.h" 33353 #include "content/browser/renderer_host/navigation_controller_impl.h" 33354 #include "content/browser/renderer_host/navigation_entry_impl.h" 33355+#include "content/browser/renderer_host/navigation_policy_container_builder.h" 33356 #include "content/browser/renderer_host/navigation_throttle_runner.h" 33357 #include "content/browser/renderer_host/policy_container_host.h" 33358-#include "content/browser/renderer_host/policy_container_navigation_bundle.h" 33359 #include "content/browser/renderer_host/render_frame_host_csp_context.h" 33360 #include "content/browser/renderer_host/render_frame_host_impl.h" 33361 #include "content/browser/site_instance_impl.h" 33362@@ -1851,8 +1851,7 @@ class CONTENT_EXPORT NavigationRequest 33363 const bool anonymous_; 33364 33365 // Non-nullopt from construction until |TakePolicyContainerHost()| is called. 33366- absl::optional<PolicyContainerNavigationBundle> 33367- policy_container_navigation_bundle_; 33368+ absl::optional<NavigationPolicyContainerBuilder> policy_container_builder_; 33369 33370 std::unique_ptr<CrossOriginEmbedderPolicyReporter> coep_reporter_; 33371 33372diff --git a/src/content/browser/renderer_host/policy_container_host.cc b/src/content/browser/renderer_host/policy_container_host.cc 33373index 8ff13d8531e66..82221b3a68b1c 33374--- a/src/content/browser/renderer_host/policy_container_host.cc 33375+++ b/src/content/browser/renderer_host/policy_container_host.cc 33376@@ -48,7 +48,8 @@ bool operator==(const PolicyContainerPolicies& lhs, 33377 rhs.content_security_policies.begin(), 33378 rhs.content_security_policies.end()) && 33379 lhs.cross_origin_opener_policy == rhs.cross_origin_opener_policy && 33380- lhs.cross_origin_embedder_policy == rhs.cross_origin_embedder_policy; 33381+ lhs.cross_origin_embedder_policy == rhs.cross_origin_embedder_policy && 33382+ lhs.can_navigate_top_without_user_gesture == rhs.can_navigate_top_without_user_gesture; 33383 } 33384 33385 bool operator!=(const PolicyContainerPolicies& lhs, 33386@@ -99,6 +100,9 @@ std::ostream& operator<<(std::ostream& out, 33387 .value_or("<null>") 33388 << " }"; 33389 33390+ out << ", can_navigate_top_without_user_gesture: " 33391+ << policies.can_navigate_top_without_user_gesture; 33392+ 33393 return out << " }"; 33394 } 33395 33396@@ -111,13 +115,16 @@ PolicyContainerPolicies::PolicyContainerPolicies( 33397 std::vector<network::mojom::ContentSecurityPolicyPtr> 33398 content_security_policies, 33399 const network::CrossOriginOpenerPolicy& cross_origin_opener_policy, 33400- const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy) 33401+ const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy, 33402+ bool can_navigate_top_without_user_gesture) 33403 : referrer_policy(referrer_policy), 33404 ip_address_space(ip_address_space), 33405 is_web_secure_context(is_web_secure_context), 33406 content_security_policies(std::move(content_security_policies)), 33407 cross_origin_opener_policy(cross_origin_opener_policy), 33408- cross_origin_embedder_policy(cross_origin_embedder_policy) {} 33409+ cross_origin_embedder_policy(cross_origin_embedder_policy), 33410+ can_navigate_top_without_user_gesture( 33411+ can_navigate_top_without_user_gesture) {} 33412 33413 PolicyContainerPolicies::~PolicyContainerPolicies() = default; 33414 33415@@ -126,7 +133,7 @@ std::unique_ptr<PolicyContainerPolicies> PolicyContainerPolicies::Clone() 33416 return std::make_unique<PolicyContainerPolicies>( 33417 referrer_policy, ip_address_space, is_web_secure_context, 33418 mojo::Clone(content_security_policies), cross_origin_opener_policy, 33419- cross_origin_embedder_policy); 33420+ cross_origin_embedder_policy, can_navigate_top_without_user_gesture); 33421 } 33422 33423 void PolicyContainerPolicies::AddContentSecurityPolicies( 33424@@ -206,7 +213,7 @@ PolicyContainerHost::CreatePolicyContainerForBlink() { 33425 return blink::mojom::PolicyContainer::New( 33426 blink::mojom::PolicyContainerPolicies::New( 33427 policies_->referrer_policy, policies_->ip_address_space, 33428- mojo::Clone(policies_->content_security_policies)), 33429+ mojo::Clone(policies_->content_security_policies), policies_->can_navigate_top_without_user_gesture), 33430 std::move(remote)); 33431 } 33432 33433diff --git a/src/content/browser/renderer_host/policy_container_host.h b/src/content/browser/renderer_host/policy_container_host.h 33434index c01b337b09dc4..fcd1c10e53be9 33435--- a/src/content/browser/renderer_host/policy_container_host.h 33436+++ b/src/content/browser/renderer_host/policy_container_host.h 33437@@ -32,7 +32,8 @@ struct CONTENT_EXPORT PolicyContainerPolicies { 33438 std::vector<network::mojom::ContentSecurityPolicyPtr> 33439 content_security_policies, 33440 const network::CrossOriginOpenerPolicy& cross_origin_opener_policy, 33441- const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy); 33442+ const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy, 33443+ bool can_navigate_top_without_user_gesture); 33444 PolicyContainerPolicies(const PolicyContainerPolicies&) = delete; 33445 PolicyContainerPolicies operator=(const PolicyContainerPolicies&) = delete; 33446 ~PolicyContainerPolicies(); 33447@@ -80,6 +81,14 @@ struct CONTENT_EXPORT PolicyContainerPolicies { 33448 // See: 33449 // https://html.spec.whatwg.org/multipage/origin.html#coep 33450 network::CrossOriginEmbedderPolicy cross_origin_embedder_policy; 33451+ 33452+ // Tracks if a document is allowed to navigate the top-level frame without 33453+ // sticky user activation. A document loses this ability when it is 33454+ // cross-origin with the top-level frame. An exception is made if the parent 33455+ // embeds the child with sandbox="allow-top-navigation", as opposed to not 33456+ // using sandboxing. A document that is same-origin to the top-level frame 33457+ // will always have this value set to true. 33458+ bool can_navigate_top_without_user_gesture = true; 33459 }; 33460 33461 // PolicyContainerPolicies structs are comparable for equality. 33462@@ -173,6 +182,10 @@ class CONTENT_EXPORT PolicyContainerHost 33463 policies_->cross_origin_opener_policy = policy; 33464 } 33465 33466+ void SetCanNavigateTopWithoutUserGesture(bool value) { 33467+ policies_->can_navigate_top_without_user_gesture = value; 33468+ } 33469+ 33470 // Return a PolicyContainer containing copies of the policies and a pending 33471 // mojo remote that can be used to update policies in this object. If called a 33472 // second time, it resets the receiver and creates a new PolicyContainer, 33473diff --git a/src/content/browser/renderer_host/policy_container_host_browsertest.cc b/src/content/browser/renderer_host/policy_container_host_browsertest.cc 33474index 3be044cf68b9e..387e2df8a52e1 33475--- a/src/content/browser/renderer_host/policy_container_host_browsertest.cc 33476+++ b/src/content/browser/renderer_host/policy_container_host_browsertest.cc 33477@@ -427,10 +427,13 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForMainFrame) { 33478 33479 namespace { 33480 33481-bool EqualsExceptCOOP(const PolicyContainerPolicies& lhs, 33482- const PolicyContainerPolicies& rhs) { 33483+bool EqualsExceptCOOPAndTopNavigation(const PolicyContainerPolicies& lhs, 33484+ const PolicyContainerPolicies& rhs) { 33485 std::unique_ptr<PolicyContainerPolicies> rhs_modulo_coop = rhs.Clone(); 33486 rhs_modulo_coop->cross_origin_opener_policy = lhs.cross_origin_opener_policy; 33487+ rhs_modulo_coop->can_navigate_top_without_user_gesture = 33488+ lhs.can_navigate_top_without_user_gesture; 33489+ 33490 return lhs == *rhs_modulo_coop; 33491 } 33492 33493@@ -494,7 +497,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) { 33494 EXPECT_TRUE(WaitForLoadStop(web_contents())); 33495 33496 // The new document inherits from the navigation initiator, except for COOP. 33497- EXPECT_TRUE(EqualsExceptCOOP( 33498+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation( 33499 *main_frame_new_policies, 33500 child->current_frame_host()->policy_container_host()->policies())); 33501 33502@@ -516,7 +519,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) { 33503 ASSERT_TRUE(WaitForLoadStop(web_contents())); 33504 33505 // The policies have not changed. 33506- EXPECT_TRUE(EqualsExceptCOOP( 33507+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation( 33508 *main_frame_new_policies, 33509 child->current_frame_host()->policy_container_host()->policies())); 33510 ASSERT_EQ(2, controller.GetEntryCount()); 33511@@ -542,7 +545,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) { 33512 EXPECT_TRUE(WaitForLoadStop(web_contents())); 33513 33514 // The new document inherits from the navigation initiator. 33515- EXPECT_TRUE(EqualsExceptCOOP( 33516+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation( 33517 *policies_a, 33518 child->current_frame_host()->policy_container_host()->policies())); 33519 33520@@ -585,7 +588,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) { 33521 ASSERT_NE(nullptr, child); 33522 33523 // The correct referrer policy should be restored from history. 33524- EXPECT_TRUE(EqualsExceptCOOP( 33525+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation( 33526 *policies_a, 33527 child->current_frame_host()->policy_container_host()->policies())); 33528 33529@@ -602,7 +605,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) { 33530 EXPECT_TRUE(WaitForLoadStop(web_contents())); 33531 33532 // The correct referrer policy should be restored from history. 33533- EXPECT_TRUE(EqualsExceptCOOP( 33534+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation( 33535 *main_frame_new_policies, 33536 child->current_frame_host()->policy_container_host()->policies())); 33537 33538@@ -616,7 +619,7 @@ IN_PROC_BROWSER_TEST_F(PolicyContainerHostBrowserTest, HistoryForChildFrame) { 33539 EXPECT_TRUE(WaitForLoadStop(web_contents())); 33540 33541 // The correct referrer policy should be restored from history. 33542- EXPECT_TRUE(EqualsExceptCOOP( 33543+ EXPECT_TRUE(EqualsExceptCOOPAndTopNavigation( 33544 *main_frame_new_policies, 33545 child->current_frame_host()->policy_container_host()->policies())); 33546 33547diff --git a/src/content/browser/renderer_host/policy_container_host_unittest.cc b/src/content/browser/renderer_host/policy_container_host_unittest.cc 33548index 125973653a0fd..55ab34798ddcd 33549--- a/src/content/browser/renderer_host/policy_container_host_unittest.cc 33550+++ b/src/content/browser/renderer_host/policy_container_host_unittest.cc 33551@@ -28,6 +28,7 @@ struct SameSizeAsPolicyContainerPolicies { 33552 content_security_policies; 33553 network::CrossOriginOpenerPolicy cross_origin_opener_policy; 33554 network::CrossOriginEmbedderPolicy cross_origin_embedder_policy; 33555+ bool can_navigate_top_without_user_gesture; 33556 }; 33557 33558 } // namespace 33559@@ -65,7 +66,8 @@ TEST(PolicyContainerPoliciesTest, CloneIsEqual) { 33560 auto policies = std::make_unique<PolicyContainerPolicies>( 33561 network::mojom::ReferrerPolicy::kAlways, 33562 network::mojom::IPAddressSpace::kUnknown, 33563- /*is_web_secure_context=*/true, std::move(csps), coop, coep); 33564+ /*is_web_secure_context=*/true, std::move(csps), coop, coep, 33565+ /*can_navigate_top_without_user_gesture=*/true); 33566 33567 EXPECT_THAT(policies->Clone(), Pointee(Eq(ByRef(*policies)))); 33568 } 33569diff --git a/src/content/browser/renderer_host/render_frame_metadata_provider_impl.cc b/src/content/browser/renderer_host/render_frame_metadata_provider_impl.cc 33570index 61540a6eb35ad..202e3b1e0c73a 33571--- a/src/content/browser/renderer_host/render_frame_metadata_provider_impl.cc 33572+++ b/src/content/browser/renderer_host/render_frame_metadata_provider_impl.cc 33573@@ -105,11 +105,16 @@ void RenderFrameMetadataProviderImpl::OnRenderFrameMetadataChanged( 33574 for (Observer& observer : observers_) 33575 observer.OnRenderFrameMetadataChangedBeforeActivation(metadata); 33576 33577+// ohos: fix white screen when web instance over 5. 33578+#if !BUILDFLAG(IS_OHOS) 33579 if (metadata.local_surface_id != last_local_surface_id_) { 33580+#endif 33581 last_local_surface_id_ = metadata.local_surface_id; 33582 for (Observer& observer : observers_) 33583 observer.OnLocalSurfaceIdChanged(metadata); 33584+#if !BUILDFLAG(IS_OHOS) 33585 } 33586+#endif 33587 33588 if (!frame_token) 33589 return; 33590diff --git a/src/content/browser/renderer_host/render_process_host_impl.cc b/src/content/browser/renderer_host/render_process_host_impl.cc 33591index 43eaf0012cd37..ea9842d0a9c7b 33592--- a/src/content/browser/renderer_host/render_process_host_impl.cc 33593+++ b/src/content/browser/renderer_host/render_process_host_impl.cc 33594@@ -206,6 +206,11 @@ 33595 #include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h" 33596 #endif 33597 33598+#if BUILDFLAG(IS_OHOS) 33599+#include "content/browser/font_unique_name_lookup/font_unique_name_lookup_service.h" 33600+#include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h" 33601+#endif 33602+ 33603 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) 33604 #include <sys/resource.h> 33605 33606@@ -2390,7 +2395,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() { 33607 base::BindRepeating(&hyphenation::HyphenationImpl::Create), 33608 hyphenation::HyphenationImpl::GetTaskRunner()); 33609 #endif 33610-#if BUILDFLAG(IS_ANDROID) 33611+#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_OHOS) 33612 if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) { 33613 registry->AddInterface( 33614 base::BindRepeating(&FontUniqueNameLookupService::Create), 33615diff --git a/src/content/browser/renderer_host/render_widget_host_impl.cc b/src/content/browser/renderer_host/render_widget_host_impl.cc 33616index 70efd8a0690b4..d2c6d4c57a626 33617--- a/src/content/browser/renderer_host/render_widget_host_impl.cc 33618+++ b/src/content/browser/renderer_host/render_widget_host_impl.cc 33619@@ -322,7 +322,11 @@ class UnboundWidgetInputHandler : public blink::mojom::WidgetInputHandler { 33620 DLOG(WARNING) << "Input request on unbound interface"; 33621 } 33622 #if BUILDFLAG(IS_OHOS) 33623- void StartFling() override { 33624+ void TryStartFling() override { 33625+ DLOG(WARNING) << "Input request on unbound interface"; 33626+ } 33627+ 33628+ void TryFinishFling() override { 33629 DLOG(WARNING) << "Input request on unbound interface"; 33630 } 33631 #endif 33632diff --git a/src/content/browser/web_contents/file_chooser_impl.cc b/src/content/browser/web_contents/file_chooser_impl.cc 33633index 991f9466ff564..5b5799c285ecf 33634--- a/src/content/browser/web_contents/file_chooser_impl.cc 33635+++ b/src/content/browser/web_contents/file_chooser_impl.cc 33636@@ -4,7 +4,10 @@ 33637 33638 #include "content/browser/web_contents/file_chooser_impl.h" 33639 33640+#include "base/files/file_util.h" 33641 #include "base/memory/ptr_util.h" 33642+#include "base/ranges/algorithm.h" 33643+#include "base/task/thread_pool.h" 33644 #include "content/browser/child_process_security_policy_impl.h" 33645 #include "content/browser/renderer_host/back_forward_cache_disable.h" 33646 #include "content/browser/renderer_host/render_frame_host_delegate.h" 33647@@ -17,6 +20,33 @@ 33648 33649 namespace content { 33650 33651+namespace { 33652+ 33653+// Removes any file that is a symlink or is inside a directory symlink. 33654+// For |kUploadFolder| mode only. |base_dir| is the folder being uploaded. 33655+std::vector<blink::mojom::FileChooserFileInfoPtr> RemoveSymlinks( 33656+ std::vector<blink::mojom::FileChooserFileInfoPtr> files, 33657+ base::FilePath base_dir) { 33658+ DCHECK(!base_dir.empty()); 33659+ auto new_end = base::ranges::remove_if( 33660+ files, 33661+ [&base_dir](const base::FilePath& file_path) { 33662+ if (base::IsLink(file_path)) 33663+ return true; 33664+ for (base::FilePath path = file_path.DirName(); base_dir.IsParent(path); 33665+ path = path.DirName()) { 33666+ if (base::IsLink(path)) 33667+ return true; 33668+ } 33669+ return false; 33670+ }, 33671+ [](const auto& file) { return file->get_native_file()->file_path; }); 33672+ files.erase(new_end, files.end()); 33673+ return files; 33674+} 33675+ 33676+} // namespace 33677+ 33678 FileChooserImpl::FileSelectListenerImpl::~FileSelectListenerImpl() { 33679 #if DCHECK_IS_ON() 33680 DCHECK(was_file_select_listener_function_called_) 33681@@ -49,8 +79,20 @@ void FileChooserImpl::FileSelectListenerImpl::FileSelected( 33682 "FileSelectListener::FileSelectionCanceled()"; 33683 was_file_select_listener_function_called_ = true; 33684 #endif 33685- if (owner_) 33686- owner_->FileSelected(std::move(files), base_dir, mode); 33687+ if (!owner_) 33688+ return; 33689+ 33690+ if (mode != blink::mojom::FileChooserParams::Mode::kUploadFolder) { 33691+ owner_->FileSelected(base_dir, mode, std::move(files)); 33692+ return; 33693+ } 33694+ 33695+ base::ThreadPool::PostTaskAndReplyWithResult( 33696+ FROM_HERE, 33697+ {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, 33698+ base::BindOnce(&RemoveSymlinks, std::move(files), base_dir), 33699+ base::BindOnce(&FileChooserImpl::FileSelected, owner_->GetWeakPtr(), 33700+ base_dir, mode)); 33701 } 33702 33703 void FileChooserImpl::FileSelectListenerImpl::FileSelectionCanceled() { 33704@@ -160,9 +202,9 @@ void FileChooserImpl::EnumerateChosenDirectory( 33705 } 33706 33707 void FileChooserImpl::FileSelected( 33708- std::vector<blink::mojom::FileChooserFileInfoPtr> files, 33709 const base::FilePath& base_dir, 33710- blink::mojom::FileChooserParams::Mode mode) { 33711+ blink::mojom::FileChooserParams::Mode mode, 33712+ std::vector<blink::mojom::FileChooserFileInfoPtr> files) { 33713 listener_impl_ = nullptr; 33714 if (!render_frame_host_) { 33715 std::move(callback_).Run(nullptr); 33716diff --git a/src/content/browser/web_contents/file_chooser_impl.h b/src/content/browser/web_contents/file_chooser_impl.h 33717index b9f11f9e6a0b5..b628b29a5f842 33718--- a/src/content/browser/web_contents/file_chooser_impl.h 33719+++ b/src/content/browser/web_contents/file_chooser_impl.h 33720@@ -37,6 +37,8 @@ class CONTENT_EXPORT FileChooserImpl : public blink::mojom::FileChooser, 33721 33722 // FileSelectListener overrides: 33723 33724+ // TODO(xiaochengh): Move |file| to the end of the argument list to match 33725+ // the argument ordering of FileChooserImpl::FileSelected(). 33726 void FileSelected(std::vector<blink::mojom::FileChooserFileInfoPtr> files, 33727 const base::FilePath& base_dir, 33728 blink::mojom::FileChooserParams::Mode mode) override; 33729@@ -68,9 +70,9 @@ class CONTENT_EXPORT FileChooserImpl : public blink::mojom::FileChooser, 33730 33731 ~FileChooserImpl() override; 33732 33733- void FileSelected(std::vector<blink::mojom::FileChooserFileInfoPtr> files, 33734- const base::FilePath& base_dir, 33735- blink::mojom::FileChooserParams::Mode mode); 33736+ void FileSelected(const base::FilePath& base_dir, 33737+ blink::mojom::FileChooserParams::Mode mode, 33738+ std::vector<blink::mojom::FileChooserFileInfoPtr> files); 33739 33740 void FileSelectionCanceled(); 33741 33742@@ -82,6 +84,10 @@ class CONTENT_EXPORT FileChooserImpl : public blink::mojom::FileChooser, 33743 const base::FilePath& directory_path, 33744 EnumerateChosenDirectoryCallback callback) override; 33745 33746+ base::WeakPtr<FileChooserImpl> GetWeakPtr() { 33747+ return weak_factory_.GetWeakPtr(); 33748+ } 33749+ 33750 private: 33751 explicit FileChooserImpl(RenderFrameHostImpl* render_frame_host); 33752 33753@@ -95,6 +101,8 @@ class CONTENT_EXPORT FileChooserImpl : public blink::mojom::FileChooser, 33754 raw_ptr<RenderFrameHostImpl> render_frame_host_; 33755 scoped_refptr<FileSelectListenerImpl> listener_impl_; 33756 base::OnceCallback<void(blink::mojom::FileChooserResultPtr)> callback_; 33757+ 33758+ base::WeakPtrFactory<FileChooserImpl> weak_factory_{this}; 33759 }; 33760 33761 } // namespace content 33762diff --git a/src/content/browser/web_contents/file_chooser_impl_browsertest.cc b/src/content/browser/web_contents/file_chooser_impl_browsertest.cc 33763index ced9bfd8fe905..7753f01681c21 33764--- a/src/content/browser/web_contents/file_chooser_impl_browsertest.cc 33765+++ b/src/content/browser/web_contents/file_chooser_impl_browsertest.cc 33766@@ -5,14 +5,18 @@ 33767 #include "content/browser/web_contents/file_chooser_impl.h" 33768 33769 #include "base/bind.h" 33770+#include "base/files/file_util.h" 33771+#include "base/path_service.h" 33772 #include "base/run_loop.h" 33773 #include "content/browser/renderer_host/render_frame_host_impl.h" 33774 #include "content/public/browser/web_contents_delegate.h" 33775+#include "content/public/common/content_paths.h" 33776 #include "content/public/test/browser_test.h" 33777 #include "content/public/test/browser_test_utils.h" 33778 #include "content/public/test/content_browser_test.h" 33779 #include "content/public/test/content_browser_test_utils.h" 33780 #include "content/shell/browser/shell.h" 33781+#include "content/test/content_browser_test_utils_internal.h" 33782 #include "url/gurl.h" 33783 #include "url/url_constants.h" 33784 33785@@ -143,11 +147,93 @@ IN_PROC_BROWSER_TEST_F(FileChooserImplBrowserTest, 33786 ->SetListenerFunctionCalledTrueForTesting(); 33787 std::vector<blink::mojom::FileChooserFileInfoPtr> files; 33788 files.emplace_back(blink::mojom::FileChooserFileInfoPtr(nullptr)); 33789- chooser->FileSelected(std::move(files), base::FilePath(), 33790- blink::mojom::FileChooserParams::Mode::kOpen); 33791+ chooser->FileSelected(base::FilePath(), 33792+ blink::mojom::FileChooserParams::Mode::kOpen, 33793+ std::move(files)); 33794 33795 // Test passes if this run_loop.Run() returns instead of timing out. 33796 run_loop.Run(); 33797 } 33798 33799+// https://crbug.com/1345275 33800+IN_PROC_BROWSER_TEST_F(FileChooserImplBrowserTest, UploadFolderWithSymlink) { 33801+ EXPECT_TRUE(NavigateToURL( 33802+ shell(), GetTestUrl(".", "file_input_webkitdirectory.html"))); 33803+ 33804+ // The folder contains a regular file and a symbolic link. 33805+ // When uploading the folder, the symbolic link should be excluded. 33806+ base::FilePath dir_test_data; 33807+ ASSERT_TRUE(base::PathService::Get(DIR_TEST_DATA, &dir_test_data)); 33808+ base::FilePath folder_to_upload = 33809+ dir_test_data.AppendASCII("file_chooser").AppendASCII("dir_with_symlink"); 33810+ 33811+ base::FilePath text_file = folder_to_upload.AppendASCII("text_file.txt"); 33812+ base::FilePath symlink_file = folder_to_upload.AppendASCII("symlink"); 33813+ 33814+ // Skip the test if symbolic links are not supported. 33815+ { 33816+ base::ScopedAllowBlockingForTesting allow_blocking; 33817+ if (!base::IsLink(symlink_file)) 33818+ return; 33819+ } 33820+ 33821+ std::unique_ptr<FileChooserDelegate> delegate(new FileChooserDelegate( 33822+ {text_file, symlink_file}, folder_to_upload, base::OnceClosure())); 33823+ shell()->web_contents()->SetDelegate(delegate.get()); 33824+ EXPECT_TRUE(ExecJs(shell(), 33825+ "(async () => {" 33826+ " let listener = new Promise(" 33827+ " resolve => fileinput.onchange = resolve);" 33828+ " fileinput.click();" 33829+ " await listener;" 33830+ "})()")); 33831+ 33832+ EXPECT_EQ( 33833+ 1, EvalJs(shell(), "document.getElementById('fileinput').files.length;")); 33834+ EXPECT_EQ( 33835+ "text_file.txt", 33836+ EvalJs(shell(), "document.getElementById('fileinput').files[0].name;")); 33837+} 33838+ 33839+// https://crbug.com/1378997 33840+IN_PROC_BROWSER_TEST_F(FileChooserImplBrowserTest, UploadFolderWithDirSymlink) { 33841+ EXPECT_TRUE(NavigateToURL( 33842+ shell(), GetTestUrl(".", "file_input_webkitdirectory.html"))); 33843+ 33844+ // The folder contains a regular file and a directory symbolic link. 33845+ // When uploading the folder, the symbolic link should not be followed. 33846+ base::FilePath dir_test_data; 33847+ ASSERT_TRUE(base::PathService::Get(DIR_TEST_DATA, &dir_test_data)); 33848+ base::FilePath folder_to_upload = dir_test_data.AppendASCII("file_chooser") 33849+ .AppendASCII("dir_with_dir_symlink"); 33850+ 33851+ base::FilePath foo_file = folder_to_upload.AppendASCII("foo.txt"); 33852+ base::FilePath dir_symlink = folder_to_upload.AppendASCII("symlink"); 33853+ base::FilePath bar_file = dir_symlink.AppendASCII("bar.txt"); 33854+ 33855+ // Skip the test if symbolic links are not supported. 33856+ { 33857+ base::ScopedAllowBlockingForTesting allow_blocking; 33858+ if (!base::IsLink(dir_symlink)) 33859+ return; 33860+ } 33861+ 33862+ std::unique_ptr<FileChooserDelegate> delegate(new FileChooserDelegate( 33863+ {foo_file, bar_file}, folder_to_upload, base::OnceClosure())); 33864+ shell()->web_contents()->SetDelegate(delegate.get()); 33865+ EXPECT_TRUE(ExecJs(shell(), 33866+ "(async () => {" 33867+ " let listener = new Promise(" 33868+ " resolve => fileinput.onchange = resolve);" 33869+ " fileinput.click();" 33870+ " await listener;" 33871+ "})()")); 33872+ 33873+ EXPECT_EQ( 33874+ 1, EvalJs(shell(), "document.getElementById('fileinput').files.length;")); 33875+ EXPECT_EQ( 33876+ "foo.txt", 33877+ EvalJs(shell(), "document.getElementById('fileinput').files[0].name;")); 33878+} 33879+ 33880 } // namespace content 33881diff --git a/src/content/browser/web_contents/web_contents_impl.cc b/src/content/browser/web_contents/web_contents_impl.cc 33882index 19aa1a8ec22bf..5a153a55f3844 33883--- a/src/content/browser/web_contents/web_contents_impl.cc 33884+++ b/src/content/browser/web_contents/web_contents_impl.cc 33885@@ -3475,6 +3475,8 @@ void WebContentsImpl::FullscreenStateChanged( 33886 "render_frame_host", rfh, "is_fullscreen", 33887 is_fullscreen); 33888 33889+ GetView()->FullscreenStateChanged(is_fullscreen); 33890+ 33891 if (is_fullscreen) { 33892 if (options.is_null()) { 33893 ReceivedBadMessage(rfh->GetProcess(), 33894@@ -6736,6 +6738,7 @@ void WebContentsImpl::ShowContextMenu( 33895 "render_frame_host", render_frame_host); 33896 // If a renderer fires off a second command to show a context menu before the 33897 // first context menu is closed, just ignore it. https://crbug.com/707534 33898+ touch_insert_handle_menu_show_ = true; 33899 if (showing_context_menu_) 33900 return; 33901 33902diff --git a/src/content/browser/web_contents/web_contents_impl.h b/src/content/browser/web_contents/web_contents_impl.h 33903index a983e6f78fdc4..21e4278efe264 33904--- a/src/content/browser/web_contents/web_contents_impl.h 33905+++ b/src/content/browser/web_contents/web_contents_impl.h 33906@@ -379,6 +379,12 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, 33907 void PostWebMessage(std::string& message, 33908 std::vector<blink::WebMessagePort>& ports, 33909 std::string& targetUri) override; 33910+ void SetTouchInsertHandleMenuShow(bool show) override { 33911+ touch_insert_handle_menu_show_ = show; 33912+ } 33913+ bool GetTouchInsertHandleMenuShow() override { 33914+ return touch_insert_handle_menu_show_; 33915+ } 33916 #endif 33917 void UpdateTitleForEntry(NavigationEntry* entry, 33918 const std::u16string& title) override; 33919@@ -604,6 +610,8 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, 33920 mojo::PendingAssociatedRemote<blink::mojom::ContextMenuClient> 33921 context_menu_client, 33922 const ContextMenuParams& params) override; 33923+#if BUILDFLAG(IS_OHOS) 33924+#endif 33925 void RunJavaScriptDialog(RenderFrameHostImpl* render_frame_host, 33926 const std::u16string& message, 33927 const std::u16string& default_prompt, 33928@@ -1900,6 +1908,10 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, 33929 std::unique_ptr<WebContentsAndroid> web_contents_android_; 33930 #endif 33931 33932+#if BUILDFLAG(IS_OHOS) 33933+ bool touch_insert_handle_menu_show_ = false; 33934+#endif 33935+ 33936 // Helper classes ------------------------------------------------------------ 33937 33938 // Primary FrameTree of this WebContents instance. This WebContents might have 33939diff --git a/src/content/browser/web_contents/web_contents_view.h b/src/content/browser/web_contents/web_contents_view.h 33940index 9ba3aaa327478..f94c80329ff9c 33941--- a/src/content/browser/web_contents/web_contents_view.h 33942+++ b/src/content/browser/web_contents/web_contents_view.h 33943@@ -107,6 +107,8 @@ class CONTENT_EXPORT WebContentsView { 33944 // loop has ended. 33945 virtual bool CloseTabAfterEventTrackingIfNeeded() = 0; 33946 #endif 33947+ 33948+ virtual void FullscreenStateChanged(bool is_fullscreen) = 0; 33949 }; 33950 33951 } // namespace content 33952diff --git a/src/content/browser/web_contents/web_contents_view_android.cc b/src/content/browser/web_contents/web_contents_view_android.cc 33953index 1315f8f1430dc..a99f45761ac29 33954--- a/src/content/browser/web_contents/web_contents_view_android.cc 33955+++ b/src/content/browser/web_contents/web_contents_view_android.cc 33956@@ -262,6 +262,11 @@ void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) { 33957 33958 void WebContentsViewAndroid::OnCapturerCountChanged() {} 33959 33960+void WebContentsViewAndroid::FullscreenStateChanged(bool is_fullscreen) { 33961+ if (select_popup_) 33962+ select_popup_->HideMenu(); 33963+} 33964+ 33965 void WebContentsViewAndroid::ShowContextMenu(RenderFrameHost& render_frame_host, 33966 const ContextMenuParams& params) { 33967 auto* rwhv = static_cast<RenderWidgetHostViewAndroid*>( 33968diff --git a/src/content/browser/web_contents/web_contents_view_android.h b/src/content/browser/web_contents/web_contents_view_android.h 33969index 5c50516cbd841..b9c9cf89b30f2 33970--- a/src/content/browser/web_contents/web_contents_view_android.h 33971+++ b/src/content/browser/web_contents/web_contents_view_android.h 33972@@ -83,6 +83,7 @@ class WebContentsViewAndroid : public WebContentsView, 33973 RenderViewHost* new_host) override; 33974 void SetOverscrollControllerEnabled(bool enabled) override; 33975 void OnCapturerCountChanged() override; 33976+ void FullscreenStateChanged(bool is_fullscreen) override; 33977 33978 // Backend implementation of RenderViewHostDelegateView. 33979 void ShowContextMenu(RenderFrameHost& render_frame_host, 33980diff --git a/src/content/browser/web_contents/web_contents_view_aura.cc b/src/content/browser/web_contents/web_contents_view_aura.cc 33981index fc6622cfd56a4..01a2898c7d7c2 33982--- a/src/content/browser/web_contents/web_contents_view_aura.cc 33983+++ b/src/content/browser/web_contents/web_contents_view_aura.cc 33984@@ -345,15 +345,23 @@ aura::Window* GetHostWindow(aura::Window* window) { 33985 33986 } // namespace 33987 33988+WebContentsViewAura::DropMetadata::DropMetadata( 33989+ const ui::DropTargetEvent& event) { 33990+ localized_location = event.location_f(); 33991+ root_location = event.root_location_f(); 33992+ source_operations = event.source_operations(); 33993+ flags = event.flags(); 33994+} 33995+ 33996 WebContentsViewAura::OnPerformDropContext::OnPerformDropContext( 33997 RenderWidgetHostImpl* target_rwh, 33998- const ui::DropTargetEvent& event, 33999+ DropMetadata drop_metadata, 34000 std::unique_ptr<ui::OSExchangeData> data, 34001 base::ScopedClosureRunner end_drag_runner, 34002 absl::optional<gfx::PointF> transformed_pt, 34003 gfx::PointF screen_pt) 34004 : target_rwh(target_rwh->GetWeakPtr()), 34005- event(event), 34006+ drop_metadata(drop_metadata), 34007 data(std::move(data)), 34008 end_drag_runner(std::move(end_drag_runner)), 34009 transformed_pt(std::move(transformed_pt)), 34010@@ -1089,6 +1097,8 @@ void WebContentsViewAura::OnCapturerCountChanged() { 34011 } 34012 } 34013 34014+void WebContentsViewAura::FullscreenStateChanged(bool is_fullscreen) {} 34015+ 34016 //////////////////////////////////////////////////////////////////////////////// 34017 // WebContentsViewAura, RenderViewHostDelegateView implementation: 34018 34019@@ -1331,7 +1341,7 @@ void WebContentsViewAura::OnMouseEvent(ui::MouseEvent* event) { 34020 // WebContentsViewAura, aura::client::DragDropDelegate implementation: 34021 34022 void WebContentsViewAura::DragEnteredCallback( 34023- ui::DropTargetEvent event, 34024+ DropMetadata drop_metadata, 34025 std::unique_ptr<DropData> drop_data, 34026 base::WeakPtr<RenderWidgetHostViewBase> target, 34027 absl::optional<gfx::PointF> transformed_pt) { 34028@@ -1350,7 +1360,7 @@ void WebContentsViewAura::DragEnteredCallback( 34029 current_rwh_for_drag_->FilterDropData(current_drop_data_.get()); 34030 34031 blink::DragOperationsMask op_mask = 34032- ConvertToDragOperationsMask(event.source_operations()); 34033+ ConvertToDragOperationsMask(drop_metadata.source_operations); 34034 34035 WebContentsDelegate* delegate = web_contents_->GetDelegate(); 34036 34037@@ -1380,7 +1390,8 @@ void WebContentsViewAura::DragEnteredCallback( 34038 gfx::PointF screen_pt(display::Screen::GetScreen()->GetCursorScreenPoint()); 34039 current_rwh_for_drag_->DragTargetDragEnter( 34040 *current_drop_data_, transformed_pt.value(), screen_pt, op_mask, 34041- ui::EventFlagsToWebEventModifiers(event.flags()), base::DoNothing()); 34042+ ui::EventFlagsToWebEventModifiers(drop_metadata.flags), 34043+ base::DoNothing()); 34044 34045 if (drag_dest_delegate_) { 34046 drag_dest_delegate_->OnDragEnter(); 34047@@ -1404,17 +1415,18 @@ void WebContentsViewAura::OnDragEntered(const ui::DropTargetEvent& event) { 34048 drag_dest_delegate_->OnReceiveDragData(event.data()); 34049 } 34050 34051+ DropMetadata drop_metadata(event); 34052 web_contents_->GetInputEventRouter() 34053 ->GetRenderWidgetHostAtPointAsynchronously( 34054 web_contents_->GetRenderViewHost()->GetWidget()->GetView(), 34055 event.location_f(), 34056 base::BindOnce(&WebContentsViewAura::DragEnteredCallback, 34057- weak_ptr_factory_.GetWeakPtr(), event, 34058+ weak_ptr_factory_.GetWeakPtr(), drop_metadata, 34059 std::move(drop_data))); 34060 } 34061 34062 void WebContentsViewAura::DragUpdatedCallback( 34063- ui::DropTargetEvent event, 34064+ DropMetadata drop_metadata, 34065 std::unique_ptr<DropData> drop_data, 34066 base::WeakPtr<RenderWidgetHostViewBase> target, 34067 absl::optional<gfx::PointF> transformed_pt) { 34068@@ -1435,24 +1447,25 @@ void WebContentsViewAura::DragUpdatedCallback( 34069 aura::Window* root_window = GetNativeView()->GetRootWindow(); 34070 aura::client::ScreenPositionClient* screen_position_client = 34071 aura::client::GetScreenPositionClient(root_window); 34072- gfx::PointF screen_pt = event.root_location_f(); 34073+ gfx::PointF screen_pt = drop_metadata.root_location; 34074 if (screen_position_client) 34075 screen_position_client->ConvertPointToScreen(root_window, &screen_pt); 34076 34077 if (target_rwh != current_rwh_for_drag_.get()) { 34078 if (current_rwh_for_drag_) { 34079- gfx::PointF transformed_leave_point = event.location_f(); 34080+ gfx::PointF transformed_leave_point = drop_metadata.localized_location; 34081 static_cast<RenderWidgetHostViewBase*>( 34082 web_contents_->GetRenderWidgetHostView()) 34083 ->TransformPointToCoordSpaceForView( 34084- event.location_f(), 34085+ drop_metadata.localized_location, 34086 static_cast<RenderWidgetHostViewBase*>( 34087 current_rwh_for_drag_->GetView()), 34088 &transformed_leave_point); 34089 current_rwh_for_drag_->DragTargetDragLeave(transformed_leave_point, 34090 screen_pt); 34091 } 34092- DragEnteredCallback(event, std::move(drop_data), target, transformed_pt); 34093+ DragEnteredCallback(drop_metadata, std::move(drop_data), target, 34094+ transformed_pt); 34095 } 34096 34097 if (!current_drop_data_) { 34098@@ -1461,10 +1474,11 @@ void WebContentsViewAura::DragUpdatedCallback( 34099 34100 DCHECK(transformed_pt.has_value()); 34101 blink::DragOperationsMask op_mask = 34102- ConvertToDragOperationsMask(event.source_operations()); 34103+ ConvertToDragOperationsMask(drop_metadata.source_operations); 34104 target_rwh->DragTargetDragOver( 34105 transformed_pt.value(), screen_pt, op_mask, 34106- ui::EventFlagsToWebEventModifiers(event.flags()), base::DoNothing()); 34107+ ui::EventFlagsToWebEventModifiers(drop_metadata.flags), 34108+ base::DoNothing()); 34109 34110 if (drag_dest_delegate_) 34111 drag_dest_delegate_->OnDragOver(); 34112@@ -1474,7 +1488,6 @@ aura::client::DragUpdateInfo WebContentsViewAura::OnDragUpdated( 34113 const ui::DropTargetEvent& event) { 34114 if (web_contents_->ShouldIgnoreInputEvents()) 34115 return aura::client::DragUpdateInfo(); 34116- 34117 aura::client::DragUpdateInfo drag_info; 34118 auto* focused_frame = web_contents_->GetFocusedFrame(); 34119 if (focused_frame && !web_contents_->GetBrowserContext()->IsOffTheRecord()) { 34120@@ -1485,13 +1498,13 @@ aura::client::DragUpdateInfo WebContentsViewAura::OnDragUpdated( 34121 std::unique_ptr<DropData> drop_data = std::make_unique<DropData>(); 34122 // Calling this here as event.data might become invalid inside the callback. 34123 PrepareDropData(drop_data.get(), event.data()); 34124- 34125+ DropMetadata drop_metadata(event); 34126 web_contents_->GetInputEventRouter() 34127 ->GetRenderWidgetHostAtPointAsynchronously( 34128 web_contents_->GetRenderViewHost()->GetWidget()->GetView(), 34129 event.location_f(), 34130 base::BindOnce(&WebContentsViewAura::DragUpdatedCallback, 34131- weak_ptr_factory_.GetWeakPtr(), event, 34132+ weak_ptr_factory_.GetWeakPtr(), drop_metadata, 34133 std::move(drop_data))); 34134 34135 drag_info.drag_operation = static_cast<int>(current_drag_op_); 34136@@ -1526,7 +1539,7 @@ void WebContentsViewAura::CompleteDragExit() { 34137 } 34138 34139 void WebContentsViewAura::PerformDropCallback( 34140- ui::DropTargetEvent event, 34141+ DropMetadata drop_metadata, 34142 std::unique_ptr<ui::OSExchangeData> data, 34143 base::WeakPtr<RenderWidgetHostViewBase> target, 34144 absl::optional<gfx::PointF> transformed_pt) { 34145@@ -1550,13 +1563,14 @@ void WebContentsViewAura::PerformDropCallback( 34146 34147 std::unique_ptr<DropData> drop_data = std::make_unique<DropData>(); 34148 PrepareDropData(drop_data.get(), *data.get()); 34149- DragEnteredCallback(event, std::move(drop_data), target, transformed_pt); 34150+ DragEnteredCallback(drop_metadata, std::move(drop_data), target, 34151+ transformed_pt); 34152 } 34153 34154 if (!current_drop_data_) 34155 return; 34156 34157- OnPerformDropContext context(target_rwh, event, std::move(data), 34158+ OnPerformDropContext context(target_rwh, drop_metadata, std::move(data), 34159 std::move(end_drag_runner), transformed_pt, 34160 screen_pt); 34161 // |delegate_| may be null in unit tests. 34162@@ -1576,7 +1590,7 @@ void WebContentsViewAura::FinishOnPerformDropCallback( 34163 OnPerformDropContext context, 34164 WebContentsViewDelegate::DropCompletionResult result) { 34165 const int key_modifiers = 34166- ui::EventFlagsToWebEventModifiers(context.event.flags()); 34167+ ui::EventFlagsToWebEventModifiers(context.drop_metadata.flags); 34168 // This is possibly an async callback. Make sure the RWH is still valid. 34169 if (!context.target_rwh || !IsValidDragTarget(context.target_rwh.get())) 34170 return; 34171@@ -1637,8 +1651,20 @@ WebContentsViewAura::GetDropCallback(const ui::DropTargetEvent& event) { 34172 return base::DoNothing(); 34173 base::ScopedClosureRunner drag_exit(base::BindOnce( 34174 &WebContentsViewAura::CompleteDragExit, weak_ptr_factory_.GetWeakPtr())); 34175- return base::BindOnce(&WebContentsViewAura::PerformDropOrExitDrag, 34176- weak_ptr_factory_.GetWeakPtr(), std::move(drag_exit)); 34177+ DropMetadata drop_metadata(event); 34178+ // TODO(crbug.com/1293449): Remove this when DropTargetEvent is removed from 34179+ // DropCallback. 34180+ return base::BindOnce( 34181+ [](base::WeakPtr<WebContentsViewAura> web_contents, 34182+ base::ScopedClosureRunner exit_drag, DropMetadata drop_metadata, 34183+ const ui::DropTargetEvent&, std::unique_ptr<ui::OSExchangeData> data, 34184+ ui::mojom::DragOperation& output_drag_op) { 34185+ if (!web_contents) 34186+ return; 34187+ web_contents->PerformDropOrExitDrag(std::move(exit_drag), drop_metadata, 34188+ std::move(data), output_drag_op); 34189+ }, 34190+ weak_ptr_factory_.GetWeakPtr(), std::move(drag_exit), drop_metadata); 34191 } 34192 34193 void WebContentsViewAura::CompleteDrop(RenderWidgetHostImpl* target_rwh, 34194@@ -1662,15 +1688,15 @@ void WebContentsViewAura::CompleteDrop(RenderWidgetHostImpl* target_rwh, 34195 34196 void WebContentsViewAura::PerformDropOrExitDrag( 34197 base::ScopedClosureRunner exit_drag, 34198- const ui::DropTargetEvent& event, 34199+ DropMetadata drop_metadata, 34200 std::unique_ptr<ui::OSExchangeData> data, 34201 ui::mojom::DragOperation& output_drag_op) { 34202 web_contents_->GetInputEventRouter() 34203 ->GetRenderWidgetHostAtPointAsynchronously( 34204 web_contents_->GetRenderViewHost()->GetWidget()->GetView(), 34205- event.location_f(), 34206+ drop_metadata.localized_location, 34207 base::BindOnce(&WebContentsViewAura::PerformDropCallback, 34208- weak_ptr_factory_.GetWeakPtr(), event, 34209+ weak_ptr_factory_.GetWeakPtr(), drop_metadata, 34210 std::move(data))); 34211 output_drag_op = current_drag_op_; 34212 exit_drag.ReplaceClosure(base::DoNothing()); 34213diff --git a/src/content/browser/web_contents/web_contents_view_aura.h b/src/content/browser/web_contents/web_contents_view_aura.h 34214index 56b44055eff92..8567c63f49815 34215--- a/src/content/browser/web_contents/web_contents_view_aura.h 34216+++ b/src/content/browser/web_contents/web_contents_view_aura.h 34217@@ -75,12 +75,30 @@ class CONTENT_EXPORT WebContentsViewAura 34218 RenderWidgetHostViewCreateFunction create_render_widget_host_view); 34219 34220 private: 34221+ // Just the metadata from DropTargetEvent that's safe and cheap to copy to 34222+ // help locate drop events in the callback. 34223+ struct DropMetadata { 34224+ explicit DropMetadata(const ui::DropTargetEvent& event); 34225+ 34226+ // Location local to WebContentsViewAura. 34227+ gfx::PointF localized_location; 34228+ 34229+ // Root location of the drop target event. 34230+ gfx::PointF root_location; 34231+ 34232+ // The supported DnD operation of the source. A bitmask of 34233+ // ui::mojom::DragOperations. 34234+ int source_operations; 34235+ // Flags from ui::Event. Usually represents modifier keys used at drop time. 34236+ int flags; 34237+ }; 34238+ 34239 // A structure used to keep drop context for asynchronously finishing a 34240 // drop operation. This is required because some drop event data gets 34241 // cleared out once PerformDropCallback() returns. 34242 struct CONTENT_EXPORT OnPerformDropContext { 34243 OnPerformDropContext(RenderWidgetHostImpl* target_rwh, 34244- const ui::DropTargetEvent& event, 34245+ DropMetadata drop_metadata, 34246 std::unique_ptr<ui::OSExchangeData> data, 34247 base::ScopedClosureRunner end_drag_runner, 34248 absl::optional<gfx::PointF> transformed_pt, 34249@@ -89,7 +107,7 @@ class CONTENT_EXPORT WebContentsViewAura 34250 ~OnPerformDropContext(); 34251 34252 base::WeakPtr<RenderWidgetHostImpl> target_rwh; 34253- ui::DropTargetEvent event; 34254+ DropMetadata drop_metadata; 34255 std::unique_ptr<ui::OSExchangeData> data; 34256 base::ScopedClosureRunner end_drag_runner; 34257 absl::optional<gfx::PointF> transformed_pt; 34258@@ -180,6 +198,7 @@ class CONTENT_EXPORT WebContentsViewAura 34259 RenderViewHost* new_host) override; 34260 void SetOverscrollControllerEnabled(bool enabled) override; 34261 void OnCapturerCountChanged() override; 34262+ void FullscreenStateChanged(bool is_fullscreen) override; 34263 34264 // Overridden from RenderViewHostDelegateView: 34265 void ShowContextMenu(RenderFrameHost& render_frame_host, 34266@@ -245,15 +264,15 @@ class CONTENT_EXPORT WebContentsViewAura 34267 aura::client::DragDropDelegate::DropCallback GetDropCallback( 34268 const ui::DropTargetEvent& event) override; 34269 34270- void DragEnteredCallback(ui::DropTargetEvent event, 34271+ void DragEnteredCallback(DropMetadata flags, 34272 std::unique_ptr<DropData> drop_data, 34273 base::WeakPtr<RenderWidgetHostViewBase> target, 34274 absl::optional<gfx::PointF> transformed_pt); 34275- void DragUpdatedCallback(ui::DropTargetEvent event, 34276+ void DragUpdatedCallback(DropMetadata drop_metadata, 34277 std::unique_ptr<DropData> drop_data, 34278 base::WeakPtr<RenderWidgetHostViewBase> target, 34279 absl::optional<gfx::PointF> transformed_pt); 34280- void PerformDropCallback(ui::DropTargetEvent event, 34281+ void PerformDropCallback(DropMetadata drop_metadata, 34282 std::unique_ptr<ui::OSExchangeData> data, 34283 base::WeakPtr<RenderWidgetHostViewBase> target, 34284 absl::optional<gfx::PointF> transformed_pt); 34285@@ -277,7 +296,7 @@ class CONTENT_EXPORT WebContentsViewAura 34286 // Performs drop if it's run. Otherwise, it exits the drag. Returned by 34287 // GetDropCallback. 34288 void PerformDropOrExitDrag(base::ScopedClosureRunner exit_drag, 34289- const ui::DropTargetEvent& event, 34290+ DropMetadata drop_metadata, 34291 std::unique_ptr<ui::OSExchangeData> data, 34292 ui::mojom::DragOperation& output_drag_op); 34293 34294diff --git a/src/content/browser/web_contents/web_contents_view_child_frame.cc b/src/content/browser/web_contents/web_contents_view_child_frame.cc 34295index 398cf2bc3c7e7..213a9b46168a9 34296--- a/src/content/browser/web_contents/web_contents_view_child_frame.cc 34297+++ b/src/content/browser/web_contents/web_contents_view_child_frame.cc 34298@@ -110,6 +110,8 @@ bool WebContentsViewChildFrame::CloseTabAfterEventTrackingIfNeeded() { 34299 34300 void WebContentsViewChildFrame::OnCapturerCountChanged() {} 34301 34302+void WebContentsViewChildFrame::FullscreenStateChanged(bool is_fullscreen) {} 34303+ 34304 void WebContentsViewChildFrame::RestoreFocus() { 34305 NOTREACHED(); 34306 } 34307diff --git a/src/content/browser/web_contents/web_contents_view_child_frame.h b/src/content/browser/web_contents/web_contents_view_child_frame.h 34308index c9409f457f993..9e72bfe110176 34309--- a/src/content/browser/web_contents/web_contents_view_child_frame.h 34310+++ b/src/content/browser/web_contents/web_contents_view_child_frame.h 34311@@ -56,6 +56,7 @@ class WebContentsViewChildFrame : public WebContentsView, 34312 bool CloseTabAfterEventTrackingIfNeeded() override; 34313 #endif 34314 void OnCapturerCountChanged() override; 34315+ void FullscreenStateChanged(bool is_fullscreen) override; 34316 34317 // Backend implementation of RenderViewHostDelegateView. 34318 void ShowContextMenu(RenderFrameHost& render_frame_host, 34319diff --git a/src/content/browser/web_contents/web_contents_view_mac.h b/src/content/browser/web_contents/web_contents_view_mac.h 34320index 660632b0bab94..755bc41fd5c53 34321--- a/src/content/browser/web_contents/web_contents_view_mac.h 34322+++ b/src/content/browser/web_contents/web_contents_view_mac.h 34323@@ -88,6 +88,7 @@ class WebContentsViewMac : public WebContentsView, 34324 void SetOverscrollControllerEnabled(bool enabled) override; 34325 bool CloseTabAfterEventTrackingIfNeeded() override; 34326 void OnCapturerCountChanged() override; 34327+ void FullscreenStateChanged(bool is_fullscreen) override; 34328 34329 // RenderViewHostDelegateView: 34330 void StartDragging(const DropData& drop_data, 34331diff --git a/src/content/browser/web_contents/web_contents_view_mac.mm b/src/content/browser/web_contents/web_contents_view_mac.mm 34332index 333032b082f09..8a66cb8773113 34333--- a/src/content/browser/web_contents/web_contents_view_mac.mm 34334+++ b/src/content/browser/web_contents/web_contents_view_mac.mm 34335@@ -140,6 +140,8 @@ gfx::Rect WebContentsViewMac::GetContainerBounds() const { 34336 34337 void WebContentsViewMac::OnCapturerCountChanged() {} 34338 34339+void WebContentsViewMac::FullscreenStateChanged(bool is_fullscreen) {} 34340+ 34341 void WebContentsViewMac::StartDragging( 34342 const DropData& drop_data, 34343 DragOperationsMask allowed_operations, 34344diff --git a/src/content/public/browser/file_system_access_permission_context.h b/src/content/public/browser/file_system_access_permission_context.h 34345index d6a7830294c64..7ed2407e6bf91 34346--- a/src/content/public/browser/file_system_access_permission_context.h 34347+++ b/src/content/public/browser/file_system_access_permission_context.h 34348@@ -11,6 +11,7 @@ 34349 #include "content/public/browser/file_system_access_write_item.h" 34350 #include "content/public/browser/global_routing_id.h" 34351 #include "third_party/blink/public/mojom/file_system_access/file_system_access_manager.mojom-shared.h" 34352+#include "ui/shell_dialogs/select_file_dialog.h" 34353 #include "url/origin.h" 34354 34355 namespace content { 34356@@ -88,24 +89,26 @@ class FileSystemAccessPermissionContext { 34357 34358 // These values are persisted to logs. Entries should not be renumbered and 34359 // numeric values should never be reused. 34360- enum class SensitiveDirectoryResult { 34361- kAllowed = 0, // Access to directory is okay. 34362- kTryAgain = 1, // User should pick a different directory. 34363+ enum class SensitiveEntryResult { 34364+ kAllowed = 0, // Access to entry is okay. 34365+ kTryAgain = 1, // User should pick a different entry. 34366 kAbort = 2, // Abandon entirely, as if picking was cancelled. 34367 kMaxValue = kAbort 34368 }; 34369- // Checks if access to the given |path| should be allowed or blocked. This is 34370+ // Checks if access to the given `path` should be allowed or blocked. This is 34371 // used to implement blocks for certain sensitive directories such as the 34372 // "Windows" system directory, as well as the root of the "home" directory. 34373- // Calls |callback| with the result of the check, after potentially showing 34374- // some UI to the user if the path should not be accessed. 34375- virtual void ConfirmSensitiveDirectoryAccess( 34376+ // For downloads ("Save as") it also checks the file extension. Calls 34377+ // `callback` with the result of the check, after potentially showing some UI 34378+ // to the user if the path is dangerous or should not be accessed. 34379+ virtual void ConfirmSensitiveEntryAccess( 34380 const url::Origin& origin, 34381 PathType path_type, 34382 const base::FilePath& path, 34383 HandleType handle_type, 34384+ ui::SelectFileDialog::Type dialog_type, 34385 GlobalRenderFrameHostId frame_id, 34386- base::OnceCallback<void(SensitiveDirectoryResult)> callback) = 0; 34387+ base::OnceCallback<void(SensitiveEntryResult)> callback) = 0; 34388 34389 enum class AfterWriteCheckResult { kAllow, kBlock }; 34390 34391diff --git a/src/content/public/browser/navigation_controller.h b/src/content/public/browser/navigation_controller.h 34392index c2a9711fe661c..992ee4deef715 34393--- a/src/content/public/browser/navigation_controller.h 34394+++ b/src/content/public/browser/navigation_controller.h 34395@@ -439,6 +439,9 @@ class NavigationController { 34396 virtual bool CanGoToOffset(int offset) = 0; 34397 virtual void GoBack() = 0; 34398 virtual void GoForward() = 0; 34399+#if BUILDFLAG(IS_OHOS) 34400+ virtual const std::string& GetOriginalUrl() = 0; 34401+#endif 34402 34403 // Navigates to the specified absolute index. Should only be used for 34404 // browser-initiated navigations. 34405diff --git a/src/content/public/browser/web_contents.h b/src/content/public/browser/web_contents.h 34406index 0bbac07fad970..2ac5c5b0f7a80 34407--- a/src/content/public/browser/web_contents.h 34408+++ b/src/content/public/browser/web_contents.h 34409@@ -595,6 +595,11 @@ class WebContents : public PageNavigator, 34410 std::string& targetUri) = 0; 34411 #endif 34412 34413+#if BUILDFLAG(IS_OHOS) 34414+ virtual void SetTouchInsertHandleMenuShow(bool show) = 0; 34415+ virtual bool GetTouchInsertHandleMenuShow() = 0; 34416+#endif 34417+ 34418 // Saves the given title to the navigation entry and does associated work. It 34419 // will update history and the view with the new title, and also synthesize 34420 // titles for file URLs that have none. Thus |entry| must have a URL set. 34421diff --git a/src/content/public/common/content_features.cc b/src/content/public/common/content_features.cc 34422index 45e215cd0892b..709c83b4677b5 34423--- a/src/content/public/common/content_features.cc 34424+++ b/src/content/public/common/content_features.cc 34425@@ -122,7 +122,14 @@ const base::Feature kBackForwardCacheMemoryControls { 34426 // - kBlockInsecurePrivateNetworkRequestsFromUnknown 34427 // - kBlockInsecurePrivateNetworkRequestsForNavigations 34428 const base::Feature kBlockInsecurePrivateNetworkRequests{ 34429- "BlockInsecurePrivateNetworkRequests", base::FEATURE_ENABLED_BY_DEFAULT}; 34430+ "BlockInsecurePrivateNetworkRequests", 34431+ 34432+#if defined(IS_DISABLE_PNA_MODE) 34433+ base::FEATURE_DISABLED_BY_DEFAULT 34434+#else 34435+ base::FEATURE_ENABLED_BY_DEFAULT 34436+#endif 34437+}; 34438 34439 // When this feature is enabled, requests to localhost initiated from non-secure 34440 // contexts in the `private` IP address space are blocked. 34441diff --git a/src/content/public/common/content_switches.cc b/src/content/public/common/content_switches.cc 34442index 2a7cb39a4cfbc..e3106ef88dbe7 34443--- a/src/content/public/common/content_switches.cc 34444+++ b/src/content/public/common/content_switches.cc 34445@@ -1001,6 +1001,8 @@ const char kEnableSpeechDispatcher[] = "enable-speech-dispatcher"; 34446 #if BUILDFLAG(IS_OHOS) 34447 const char kEnableMultiRendererProcess[] = "enable-multi-renderer-process"; 34448 const char kForBrowser[] = "for-browser"; 34449+const char kOhosCustomScheme[] = "ohos-custom-scheme"; 34450+const char kOhosHanceSurface[] = "ohos-enhance-surface"; 34451 #endif 34452 34453 #if BUILDFLAG(IS_WIN) 34454diff --git a/src/content/public/common/content_switches.h b/src/content/public/common/content_switches.h 34455index 8539d17b3bd13..91a5527c0da20 34456--- a/src/content/public/common/content_switches.h 34457+++ b/src/content/public/common/content_switches.h 34458@@ -279,6 +279,8 @@ CONTENT_EXPORT extern const char kEnableSpeechDispatcher[]; 34459 #if BUILDFLAG(IS_OHOS) 34460 CONTENT_EXPORT extern const char kEnableMultiRendererProcess[]; 34461 CONTENT_EXPORT extern const char kForBrowser[]; 34462+CONTENT_EXPORT extern const char kOhosCustomScheme[]; 34463+CONTENT_EXPORT extern const char kOhosHanceSurface[]; 34464 #endif 34465 34466 #if BUILDFLAG(IS_WIN) 34467diff --git a/src/content/test/BUILD.gn b/src/content/test/BUILD.gn 34468index 690b5f2ff8b9b..1775205b66f9d 34469--- a/src/content/test/BUILD.gn 34470+++ b/src/content/test/BUILD.gn 34471@@ -1251,13 +1251,13 @@ test("content_browsertests") { 34472 "../browser/renderer_host/media/video_capture_browsertest.cc", 34473 "../browser/renderer_host/navigation_controller_impl_browsertest.cc", 34474 "../browser/renderer_host/navigation_handle_user_data_browsertest.cc", 34475+ "../browser/renderer_host/navigation_policy_container_builder_browsertest.cc", 34476 "../browser/renderer_host/navigation_request_browsertest.cc", 34477 "../browser/renderer_host/origin_agent_cluster_browsertest.cc", 34478 "../browser/renderer_host/page_impl_browsertest.cc", 34479 "../browser/renderer_host/page_lifecycle_state_manager_browsertest.cc", 34480 "../browser/renderer_host/panel_rotation_browsertest.cc", 34481 "../browser/renderer_host/policy_container_host_browsertest.cc", 34482- "../browser/renderer_host/policy_container_navigation_bundle_browsertest.cc", 34483 "../browser/renderer_host/private_network_access_browsertest.cc", 34484 "../browser/renderer_host/render_document_host_browsertest.cc", 34485 "../browser/renderer_host/render_frame_host_impl_browsertest.cc", 34486@@ -2181,13 +2181,13 @@ test("content_unittests") { 34487 "../browser/renderer_host/mixed_content_navigation_throttle_unittest.cc", 34488 "../browser/renderer_host/navigation_controller_impl_unittest.cc", 34489 "../browser/renderer_host/navigation_entry_impl_unittest.cc", 34490+ "../browser/renderer_host/navigation_policy_container_builder_unittest.cc", 34491 "../browser/renderer_host/navigation_request_unittest.cc", 34492 "../browser/renderer_host/navigation_throttle_runner_unittest.cc", 34493 "../browser/renderer_host/navigator_unittest.cc", 34494 "../browser/renderer_host/origin_policy_throttle_unittest.cc", 34495 "../browser/renderer_host/overscroll_controller_unittest.cc", 34496 "../browser/renderer_host/policy_container_host_unittest.cc", 34497- "../browser/renderer_host/policy_container_navigation_bundle_unittest.cc", 34498 "../browser/renderer_host/recently_destroyed_hosts_unittest.cc", 34499 "../browser/renderer_host/render_frame_host_impl_unittest.cc", 34500 "../browser/renderer_host/render_frame_host_manager_unittest.cc", 34501diff --git a/src/content/test/content_browser_test_utils_internal.cc b/src/content/test/content_browser_test_utils_internal.cc 34502index 0051e21d4a4ff..2b7a97fd3c006 34503--- a/src/content/test/content_browser_test_utils_internal.cc 34504+++ b/src/content/test/content_browser_test_utils_internal.cc 34505@@ -447,9 +447,18 @@ Shell* OpenPopup(const ToRenderFrameHost& opener, 34506 return new_shell_observer.GetShell(); 34507 } 34508 34509+FileChooserDelegate::FileChooserDelegate(std::vector<base::FilePath> files, 34510+ const base::FilePath& base_dir, 34511+ base::OnceClosure callback) 34512+ : files_(std::move(files)), 34513+ base_dir_(base_dir), 34514+ callback_(std::move(callback)) {} 34515+ 34516 FileChooserDelegate::FileChooserDelegate(const base::FilePath& file, 34517 base::OnceClosure callback) 34518- : file_(file), callback_(std::move(callback)) {} 34519+ : FileChooserDelegate(std::vector<base::FilePath>(1, file), 34520+ base::FilePath(), 34521+ std::move(callback)) {} 34522 34523 FileChooserDelegate::~FileChooserDelegate() = default; 34524 34525@@ -457,16 +466,21 @@ void FileChooserDelegate::RunFileChooser( 34526 RenderFrameHost* render_frame_host, 34527 scoped_refptr<content::FileSelectListener> listener, 34528 const blink::mojom::FileChooserParams& params) { 34529- // Send the selected file to the renderer process. 34530- auto file_info = blink::mojom::FileChooserFileInfo::NewNativeFile( 34531- blink::mojom::NativeFileInfo::New(file_, std::u16string())); 34532+ // |base_dir_| should be set for and only for |kUploadFolder| mode. 34533+ DCHECK(base_dir_.empty() == 34534+ (params.mode != blink::mojom::FileChooserParams::Mode::kUploadFolder)); 34535+ // Send the selected files to the renderer process. 34536 std::vector<blink::mojom::FileChooserFileInfoPtr> files; 34537- files.push_back(std::move(file_info)); 34538- listener->FileSelected(std::move(files), base::FilePath(), 34539- blink::mojom::FileChooserParams::Mode::kOpen); 34540+ for (const auto& file : files_) { 34541+ auto file_info = blink::mojom::FileChooserFileInfo::NewNativeFile( 34542+ blink::mojom::NativeFileInfo::New(file, std::u16string())); 34543+ files.push_back(std::move(file_info)); 34544+ } 34545+ listener->FileSelected(std::move(files), base_dir_, params.mode); 34546 34547 params_ = params.Clone(); 34548- std::move(callback_).Run(); 34549+ if (callback_) 34550+ std::move(callback_).Run(); 34551 } 34552 34553 FrameTestNavigationManager::FrameTestNavigationManager( 34554diff --git a/src/content/test/content_browser_test_utils_internal.h b/src/content/test/content_browser_test_utils_internal.h 34555index 73be6e8a2f458..bff69b028af40 34556--- a/src/content/test/content_browser_test_utils_internal.h 34557+++ b/src/content/test/content_browser_test_utils_internal.h 34558@@ -176,9 +176,14 @@ Shell* OpenPopup(const ToRenderFrameHost& opener, 34559 class FileChooserDelegate : public WebContentsDelegate { 34560 public: 34561 // Constructs a WebContentsDelegate that mocks a file dialog. 34562- // The mocked file dialog will always reply that the user selected |file|. 34563- // |callback| is invoked when RunFileChooser() is called. 34564+ // The mocked file dialog will always reply that the user selected |file| or 34565+ // |files|. |callback| is invoked when RunFileChooser() is called. 34566 FileChooserDelegate(const base::FilePath& file, base::OnceClosure callback); 34567+ // |base_dir| must be set to the folder being uploaded in |kUploadFolder| 34568+ // mode, and must be empty in all other modes. 34569+ FileChooserDelegate(std::vector<base::FilePath> files, 34570+ const base::FilePath& base_dir, 34571+ base::OnceClosure callback); 34572 ~FileChooserDelegate() override; 34573 34574 // Implementation of WebContentsDelegate::RunFileChooser. 34575@@ -190,7 +195,8 @@ class FileChooserDelegate : public WebContentsDelegate { 34576 const blink::mojom::FileChooserParams& params() const { return *params_; } 34577 34578 private: 34579- base::FilePath file_; 34580+ std::vector<base::FilePath> files_; 34581+ const base::FilePath base_dir_; 34582 base::OnceClosure callback_; 34583 blink::mojom::FileChooserParamsPtr params_; 34584 }; 34585diff --git a/src/content/test/data/file_chooser/dir_with_dir_symlink/foo.txt b/src/content/test/data/file_chooser/dir_with_dir_symlink/foo.txt 34586new file mode 100644 34587index 0000000000000..257cc5642cb1a 34588--- /dev/null 34589+++ b/src/content/test/data/file_chooser/dir_with_dir_symlink/foo.txt 34590@@ -0,0 +1 @@ 34591+foo 34592diff --git a/src/content/test/data/file_chooser/dir_with_dir_symlink/symlink b/src/content/test/data/file_chooser/dir_with_dir_symlink/symlink 34593new file mode 100644 34594index 0000000000000..10f6d1ab9ba9e 34595--- /dev/null 34596+++ b/src/content/test/data/file_chooser/dir_with_dir_symlink/symlink 34597@@ -0,0 +1 @@ 34598+../linked_dir/ 34599\ No newline at end of file 34600diff --git a/src/content/test/data/file_chooser/dir_with_symlink/symlink b/src/content/test/data/file_chooser/dir_with_symlink/symlink 34601new file mode 120000 34602index 0000000000000..7857c689f7043 34603--- /dev/null 34604+++ b/src/content/test/data/file_chooser/dir_with_symlink/symlink 34605@@ -0,0 +1 @@ 34606+../linked_text_file.txt 34607\ No newline at end of file 34608diff --git a/src/content/test/data/file_chooser/dir_with_symlink/text_file.txt b/src/content/test/data/file_chooser/dir_with_symlink/text_file.txt 34609new file mode 100644 34610index 0000000000000..8e27be7d6154a 34611--- /dev/null 34612+++ b/src/content/test/data/file_chooser/dir_with_symlink/text_file.txt 34613@@ -0,0 +1 @@ 34614+text 34615diff --git a/src/content/test/data/file_chooser/linked_dir/bar.txt b/src/content/test/data/file_chooser/linked_dir/bar.txt 34616new file mode 100644 34617index 0000000000000..5716ca5987cbf 34618--- /dev/null 34619+++ b/src/content/test/data/file_chooser/linked_dir/bar.txt 34620@@ -0,0 +1 @@ 34621+bar 34622diff --git a/src/content/test/data/file_chooser/linked_text_file.txt b/src/content/test/data/file_chooser/linked_text_file.txt 34623new file mode 100644 34624index 0000000000000..9a1f4bc60917c 34625--- /dev/null 34626+++ b/src/content/test/data/file_chooser/linked_text_file.txt 34627@@ -0,0 +1 @@ 34628+linked text file 34629diff --git a/src/content/test/data/file_input_webkitdirectory.html b/src/content/test/data/file_input_webkitdirectory.html 34630new file mode 100644 34631index 0000000000000..5b7bb501f7eb5 34632--- /dev/null 34633+++ b/src/content/test/data/file_input_webkitdirectory.html 34634@@ -0,0 +1 @@ 34635+<input type="file" id="fileinput" webkitdirectory /> 34636diff --git a/src/extensions/browser/api/messaging/messaging_api_message_filter.cc b/src/extensions/browser/api/messaging/messaging_api_message_filter.cc 34637index 0f7adeb290ea3..2ae367ca3bdf8 34638--- a/src/extensions/browser/api/messaging/messaging_api_message_filter.cc 34639+++ b/src/extensions/browser/api/messaging/messaging_api_message_filter.cc 34640@@ -209,6 +209,18 @@ void MessagingAPIMessageFilter::Shutdown() { 34641 shutdown_notifier_subscription_ = {}; 34642 } 34643 34644+content::RenderProcessHost* MessagingAPIMessageFilter::GetRenderProcessHost() { 34645+ DCHECK_CURRENTLY_ON(BrowserThread::UI); 34646+ if (!browser_context_) 34647+ return nullptr; 34648+ 34649+ // The IPC might race with RenderProcessHost destruction. This may only 34650+ // happen in scenarios that are already inherently racey, so returning nullptr 34651+ // (and dropping the IPC) is okay and won't lead to any additional risk of 34652+ // data loss. 34653+ return content::RenderProcessHost::FromID(render_process_id_); 34654+} 34655+ 34656 void MessagingAPIMessageFilter::OverrideThreadForMessage( 34657 const IPC::Message& message, 34658 BrowserThread::ID* thread) { 34659@@ -299,8 +311,17 @@ void MessagingAPIMessageFilter::OnOpenChannelToTab( 34660 const std::string& channel_name, 34661 const PortId& port_id) { 34662 DCHECK_CURRENTLY_ON(BrowserThread::UI); 34663- if (!browser_context_) 34664+ auto* process = GetRenderProcessHost(); 34665+ if (!process) 34666+ return; 34667+ TRACE_EVENT("extensions", "MessageFilter::OnOpenChannelToTab", 34668+ ChromeTrackEvent::kRenderProcessHost, *process); 34669+ 34670+ if (!CanRendererHostExtensionOrigin(render_process_id_, extension_id)) { 34671+ bad_message::ReceivedBadMessage( 34672+ process, bad_message::EMF_INVALID_EXTENSION_ID_FOR_TAB_MSG); 34673 return; 34674+ } 34675 34676 ChannelEndpoint source_endpoint(browser_context_, render_process_id_, 34677 source_context); 34678diff --git a/src/extensions/browser/api/messaging/messaging_api_message_filter.h b/src/extensions/browser/api/messaging/messaging_api_message_filter.h 34679index 59c796801e28d..d4a952b5a495a 34680--- a/src/extensions/browser/api/messaging/messaging_api_message_filter.h 34681+++ b/src/extensions/browser/api/messaging/messaging_api_message_filter.h 34682@@ -13,6 +13,7 @@ struct ExtensionMsg_TabTargetConnectionInfo; 34683 34684 namespace content { 34685 class BrowserContext; 34686+class RenderProcessHost; 34687 } 34688 34689 namespace extensions { 34690@@ -39,6 +40,11 @@ class MessagingAPIMessageFilter : public content::BrowserMessageFilter { 34691 34692 void Shutdown(); 34693 34694+ // Returns the process that the IPC came from, or `nullptr` if the IPC should 34695+ // be dropped (in case the IPC arrived racily after the process or its 34696+ // BrowserContext already got destructed). 34697+ content::RenderProcessHost* GetRenderProcessHost(); 34698+ 34699 // content::BrowserMessageFilter implementation: 34700 void OverrideThreadForMessage(const IPC::Message& message, 34701 content::BrowserThread::ID* thread) override; 34702diff --git a/src/extensions/browser/api/socket/udp_socket.cc b/src/extensions/browser/api/socket/udp_socket.cc 34703index 859caa5205c27..1f1e8309731aa 34704--- a/src/extensions/browser/api/socket/udp_socket.cc 34705+++ b/src/extensions/browser/api/socket/udp_socket.cc 34706@@ -9,6 +9,7 @@ 34707 34708 #include "base/bind.h" 34709 #include "base/containers/contains.h" 34710+#include "base/containers/cxx20_erase.h" 34711 #include "base/lazy_instance.h" 34712 #include "extensions/browser/api/api_resource.h" 34713 #include "net/base/ip_address.h" 34714@@ -306,9 +307,7 @@ void UDPSocket::OnLeaveGroupCompleted(net::CompletionOnceCallback callback, 34715 const std::string& normalized_address, 34716 int result) { 34717 if (result == net::OK) { 34718- auto find_result = std::find(multicast_groups_.begin(), 34719- multicast_groups_.end(), normalized_address); 34720- multicast_groups_.erase(find_result); 34721+ base::Erase(multicast_groups_, normalized_address); 34722 } 34723 34724 std::move(callback).Run(result); 34725diff --git a/src/extensions/browser/bad_message.h b/src/extensions/browser/bad_message.h 34726index e56bf2ca33c34..c6d858faca0c7 34727--- a/src/extensions/browser/bad_message.h 34728+++ b/src/extensions/browser/bad_message.h 34729@@ -42,6 +42,7 @@ enum BadMessageReason { 34730 EMF_INVALID_EXTENSION_ID_FOR_CONTENT_SCRIPT = 16, 34731 EMF_INVALID_EXTENSION_ID_FOR_WORKER_CONTEXT = 17, 34732 EMF_INVALID_PORT_CONTEXT = 18, 34733+ EMF_INVALID_EXTENSION_ID_FOR_TAB_MSG = 21, 34734 // Please add new elements here. The naming convention is abbreviated class 34735 // name (e.g. ExtensionHost becomes EH) plus a unique description of the 34736 // reason. After making changes, you MUST update histograms.xml by running: 34737diff --git a/src/gpu/command_buffer/service/gles2_cmd_decoder.cc b/src/gpu/command_buffer/service/gles2_cmd_decoder.cc 34738index c269e5c9a8449..1df046c759da2 34739--- a/src/gpu/command_buffer/service/gles2_cmd_decoder.cc 34740+++ b/src/gpu/command_buffer/service/gles2_cmd_decoder.cc 34741@@ -8644,10 +8644,18 @@ void GLES2DecoderImpl::DoFramebufferTexture2DCommon( 34742 service_id = texture_ref->service_id(); 34743 } 34744 34745+ bool valid_target = false; 34746+ if (texture_ref) { 34747+ valid_target = texture_manager()->ValidForTextureTarget( 34748+ texture_ref->texture(), level, 0, 0, 1); 34749+ } else { 34750+ valid_target = texture_manager()->ValidForTarget(textarget, level, 0, 0, 1); 34751+ } 34752+ 34753 if ((level > 0 && !feature_info_->IsWebGL2OrES3Context() && 34754 !(fbo_render_mipmap_explicitly_enabled_ && 34755 feature_info_->feature_flags().oes_fbo_render_mipmap)) || 34756- !texture_manager()->ValidForTarget(textarget, level, 0, 0, 1)) { 34757+ !valid_target) { 34758 LOCAL_SET_GL_ERROR( 34759 GL_INVALID_VALUE, 34760 name, "level out of range"); 34761@@ -8719,8 +8727,8 @@ void GLES2DecoderImpl::DoFramebufferTextureLayer( 34762 "texture is neither TEXTURE_3D nor TEXTURE_2D_ARRAY"); 34763 return; 34764 } 34765- if (!texture_manager()->ValidForTarget(texture_target, level, 34766- 0, 0, layer)) { 34767+ if (!texture_manager()->ValidForTextureTarget(texture_ref->texture(), level, 34768+ 0, 0, layer)) { 34769 LOCAL_SET_GL_ERROR( 34770 GL_INVALID_VALUE, function_name, "invalid level or layer"); 34771 return; 34772@@ -15101,11 +15109,6 @@ error::Error GLES2DecoderImpl::DoCompressedTexImage( 34773 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "imageSize < 0"); 34774 return error::kNoError; 34775 } 34776- if (!texture_manager()->ValidForTarget(target, level, width, height, depth) || 34777- border != 0) { 34778- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range"); 34779- return error::kNoError; 34780- } 34781 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( 34782 &state_, target); 34783 if (!texture_ref) { 34784@@ -15114,6 +15117,12 @@ error::Error GLES2DecoderImpl::DoCompressedTexImage( 34785 return error::kNoError; 34786 } 34787 Texture* texture = texture_ref->texture(); 34788+ if (!texture_manager()->ValidForTextureTarget(texture, level, width, height, 34789+ depth) || 34790+ border != 0) { 34791+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range"); 34792+ return error::kNoError; 34793+ } 34794 if (texture->IsImmutable()) { 34795 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, "texture is immutable"); 34796 return error::kNoError; 34797@@ -15483,10 +15492,6 @@ error::Error GLES2DecoderImpl::DoCompressedTexSubImage( 34798 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "imageSize < 0"); 34799 return error::kNoError; 34800 } 34801- if (!texture_manager()->ValidForTarget(target, level, width, height, depth)) { 34802- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range"); 34803- return error::kNoError; 34804- } 34805 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( 34806 &state_, target); 34807 if (!texture_ref) { 34808@@ -15494,7 +15499,14 @@ error::Error GLES2DecoderImpl::DoCompressedTexSubImage( 34809 GL_INVALID_OPERATION, func_name, "no texture bound at target"); 34810 return error::kNoError; 34811 } 34812+ 34813 Texture* texture = texture_ref->texture(); 34814+ if (!texture_manager()->ValidForTextureTarget(texture, level, width, height, 34815+ depth)) { 34816+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range"); 34817+ return error::kNoError; 34818+ } 34819+ 34820 GLenum type = 0; 34821 GLenum internal_format = 0; 34822 if (!texture->GetLevelType(target, level, &type, &internal_format)) { 34823@@ -15619,7 +15631,8 @@ void GLES2DecoderImpl::DoCopyTexImage2D( 34824 GL_INVALID_OPERATION, func_name, "texture is immutable"); 34825 return; 34826 } 34827- if (!texture_manager()->ValidForTarget(target, level, width, height, 1) || 34828+ if (!texture_manager()->ValidForTextureTarget(texture, level, width, height, 34829+ 1) || 34830 border != 0) { 34831 LOCAL_SET_GL_ERROR( 34832 GL_INVALID_VALUE, func_name, "dimensions out of range"); 34833@@ -18216,8 +18229,8 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( 34834 } 34835 34836 // Check that this type of texture is allowed. 34837- if (!texture_manager()->ValidForTarget(source_target, source_level, 34838- source_width, source_height, 1)) { 34839+ if (!texture_manager()->ValidForTextureTarget( 34840+ source_texture, source_level, source_width, source_height, 1)) { 34841 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName, "Bad dimensions"); 34842 return; 34843 } 34844@@ -18384,8 +18397,8 @@ void GLES2DecoderImpl::CopySubTextureHelper(const char* function_name, 34845 } 34846 34847 // Check that this type of texture is allowed. 34848- if (!texture_manager()->ValidForTarget(source_target, source_level, 34849- source_width, source_height, 1)) { 34850+ if (!texture_manager()->ValidForTextureTarget( 34851+ source_texture, source_level, source_width, source_height, 1)) { 34852 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, 34853 "source texture bad dimensions"); 34854 return; 34855@@ -18625,11 +18638,20 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target, 34856 return; 34857 } 34858 } 34859+ TextureRef* texture_ref = 34860+ texture_manager()->GetTextureInfoForTarget(&state_, target); 34861+ if (!texture_ref) { 34862+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, 34863+ "unknown texture for target"); 34864+ return; 34865+ } 34866+ Texture* texture = texture_ref->texture(); 34867 // The glTexStorage entry points require width, height, and depth to be 34868 // at least 1, but the other texture entry points (those which use 34869- // ValidForTarget) do not. So we have to add an extra check here. 34870+ // ValidForTextureTarget) do not. So we have to add an extra check here. 34871 bool is_invalid_texstorage_size = width < 1 || height < 1 || depth < 1; 34872- if (!texture_manager()->ValidForTarget(target, 0, width, height, depth) || 34873+ if (!texture_manager()->ValidForTextureTarget(texture, 0, width, height, 34874+ depth) || 34875 is_invalid_texstorage_size) { 34876 LOCAL_SET_GL_ERROR( 34877 GL_INVALID_VALUE, function_name, "dimensions out of range"); 34878@@ -18642,14 +18664,6 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target, 34879 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, "too many levels"); 34880 return; 34881 } 34882- TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( 34883- &state_, target); 34884- if (!texture_ref) { 34885- LOCAL_SET_GL_ERROR( 34886- GL_INVALID_OPERATION, function_name, "unknown texture for target"); 34887- return; 34888- } 34889- Texture* texture = texture_ref->texture(); 34890 if (texture->IsAttachedToFramebuffer()) { 34891 framebuffer_state_.clear_state_dirty = true; 34892 } 34893diff --git a/src/gpu/command_buffer/service/texture_manager.cc b/src/gpu/command_buffer/service/texture_manager.cc 34894index 44162d9361750..5d641d9203611 34895--- a/src/gpu/command_buffer/service/texture_manager.cc 34896+++ b/src/gpu/command_buffer/service/texture_manager.cc 34897@@ -1642,7 +1642,7 @@ void Texture::Update() { 34898 return; 34899 34900 if (face_infos_.empty() || 34901- static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size()) { 34902+ static_cast<size_t>(base_level_) >= MaxValidMipLevel()) { 34903 texture_complete_ = false; 34904 cube_complete_ = false; 34905 return; 34906@@ -2029,8 +2029,7 @@ bool Texture::CanRenderTo(const FeatureInfo* feature_info, GLint level) const { 34907 // the time. 34908 if (face_infos_.size() == 6 && !cube_complete()) 34909 return false; 34910- DCHECK(level >= 0 && 34911- level < static_cast<GLint>(face_infos_[0].level_infos.size())); 34912+ DCHECK(level >= 0 && level < static_cast<GLint>(MaxValidMipLevel())); 34913 if (level > base_level_ && !texture_complete()) { 34914 return false; 34915 } 34916@@ -2065,7 +2064,7 @@ void Texture::SetCompatibilitySwizzle(const CompatibilitySwizzle* swizzle) { 34917 34918 void Texture::ApplyFormatWorkarounds(const FeatureInfo* feature_info) { 34919 if (feature_info->gl_version_info().NeedsLuminanceAlphaEmulation()) { 34920- if (static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size()) 34921+ if (static_cast<size_t>(base_level_) >= MaxValidMipLevel()) 34922 return; 34923 const Texture::LevelInfo& info = face_infos_[0].level_infos[base_level_]; 34924 SetCompatibilitySwizzle(GetCompatibilitySwizzleInternal(info.format)); 34925@@ -2299,8 +2298,11 @@ scoped_refptr<TextureRef> 34926 return default_texture; 34927 } 34928 34929-bool TextureManager::ValidForTarget( 34930- GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth) { 34931+bool TextureManager::ValidForTarget(GLenum target, 34932+ GLint level, 34933+ GLsizei width, 34934+ GLsizei height, 34935+ GLsizei depth) { 34936 if (level < 0 || level >= MaxLevelsForTarget(target)) 34937 return false; 34938 GLsizei max_size = MaxSizeForTarget(target) >> level; 34939@@ -2320,6 +2322,18 @@ bool TextureManager::ValidForTarget( 34940 (target != GL_TEXTURE_2D || (depth == 1)); 34941 } 34942 34943+bool TextureManager::ValidForTextureTarget(const Texture* texture, 34944+ GLint level, 34945+ GLsizei width, 34946+ GLsizei height, 34947+ GLsizei depth) { 34948+ if (texture->target() == 0) 34949+ return false; 34950+ if (level < 0 || static_cast<size_t>(level) >= texture->MaxValidMipLevel()) 34951+ return false; 34952+ return ValidForTarget(texture->target(), level, width, height, depth); 34953+} 34954+ 34955 void TextureManager::SetTarget(TextureRef* ref, GLenum target) { 34956 DCHECK(ref); 34957 ref->texture()->SetTarget(target, MaxLevelsForTarget(target)); 34958@@ -2803,14 +2817,6 @@ bool TextureManager::ValidateTexImage(ContextState* state, 34959 args.internal_format, args.level)) { 34960 return false; 34961 } 34962- if (!ValidForTarget(args.target, args.level, 34963- args.width, args.height, args.depth) || 34964- args.border != 0) { 34965- ERRORSTATE_SET_GL_ERROR( 34966- error_state, GL_INVALID_VALUE, function_name, 34967- "dimensions out of range"); 34968- return false; 34969- } 34970 if ((GLES2Util::GetChannelsForFormat(args.format) & 34971 (GLES2Util::kDepth | GLES2Util::kStencil)) != 0 && args.pixels 34972 && !feature_info_->IsWebGL2OrES3Context()) { 34973@@ -2833,7 +2839,13 @@ bool TextureManager::ValidateTexImage(ContextState* state, 34974 "texture is immutable"); 34975 return false; 34976 } 34977- 34978+ if (!ValidForTextureTarget(local_texture_ref->texture(), args.level, 34979+ args.width, args.height, args.depth) || 34980+ args.border != 0) { 34981+ ERRORSTATE_SET_GL_ERROR(error_state, GL_INVALID_VALUE, function_name, 34982+ "dimensions out of range"); 34983+ return false; 34984+ } 34985 Buffer* buffer = state->bound_pixel_unpack_buffer.get(); 34986 if (buffer) { 34987 if (buffer->GetMappedRange()) { 34988diff --git a/src/gpu/command_buffer/service/texture_manager.h b/src/gpu/command_buffer/service/texture_manager.h 34989index e4b2dbf47b595..15d3c0c6579ff 34990--- a/src/gpu/command_buffer/service/texture_manager.h 34991+++ b/src/gpu/command_buffer/service/texture_manager.h 34992@@ -469,6 +469,11 @@ class GPU_GLES2_EXPORT Texture final : public TextureBase { 34993 sampler_state_.min_filter != GL_LINEAR; 34994 } 34995 34996+ size_t MaxValidMipLevel() const { 34997+ DCHECK(!face_infos_.empty()); 34998+ return face_infos_[0].level_infos.size(); 34999+ } 35000+ 35001 private: 35002 friend class MailboxManagerTest; 35003 friend class TextureManager; 35004@@ -931,6 +936,11 @@ class GPU_GLES2_EXPORT TextureManager 35005 bool ValidForTarget( 35006 GLenum target, GLint level, 35007 GLsizei width, GLsizei height, GLsizei depth); 35008+ bool ValidForTextureTarget(const Texture* texture, 35009+ GLint level, 35010+ GLsizei width, 35011+ GLsizei height, 35012+ GLsizei depth); 35013 35014 // True if this texture meets all the GLES2 criteria for rendering. 35015 // See section 3.8.2 of the GLES2 spec. 35016diff --git a/src/ipc/ipc_mojo_bootstrap.cc b/src/ipc/ipc_mojo_bootstrap.cc 35017index a017111a64715..5f5e8ca50acf4 35018--- a/src/ipc/ipc_mojo_bootstrap.cc 35019+++ b/src/ipc/ipc_mojo_bootstrap.cc 35020@@ -16,13 +16,15 @@ 35021 #include "base/bind.h" 35022 #include "base/callback.h" 35023 #include "base/check_op.h" 35024+#include "base/containers/circular_deque.h" 35025 #include "base/containers/contains.h" 35026-#include "base/containers/queue.h" 35027 #include "base/memory/ptr_util.h" 35028 #include "base/memory/raw_ptr.h" 35029 #include "base/no_destructor.h" 35030+#include "base/ranges/algorithm.h" 35031 #include "base/strings/stringprintf.h" 35032 #include "base/synchronization/lock.h" 35033+#include "base/synchronization/waitable_event.h" 35034 #include "base/task/common/task_annotator.h" 35035 #include "base/task/sequenced_task_runner.h" 35036 #include "base/task/single_thread_task_runner.h" 35037@@ -48,6 +50,7 @@ 35038 #include "mojo/public/cpp/bindings/pipe_control_message_proxy.h" 35039 #include "mojo/public/cpp/bindings/sequence_local_sync_event_watcher.h" 35040 #include "mojo/public/cpp/bindings/tracing_helpers.h" 35041+#include "third_party/abseil-cpp/absl/types/optional.h" 35042 35043 namespace IPC { 35044 35045@@ -466,6 +469,11 @@ class ChannelAssociatedGroupController 35046 return *this; 35047 } 35048 35049+ bool HasRequestId(uint64_t request_id) { 35050+ return !value_.IsNull() && value_.version() >= 1 && 35051+ value_.header_v1()->request_id == request_id; 35052+ } 35053+ 35054 mojo::Message& value() { return value_; } 35055 35056 private: 35057@@ -557,10 +565,15 @@ class ChannelAssociatedGroupController 35058 sync_watcher_.reset(); 35059 } 35060 35061- uint32_t EnqueueSyncMessage(MessageWrapper message) { 35062+ absl::optional<uint32_t> EnqueueSyncMessage(MessageWrapper message) { 35063 controller_->lock_.AssertAcquired(); 35064+ if (exclusive_wait_ && exclusive_wait_->TryFulfillingWith(message)) { 35065+ exclusive_wait_ = nullptr; 35066+ return absl::nullopt; 35067+ } 35068+ 35069 uint32_t id = GenerateSyncMessageId(); 35070- sync_messages_.emplace(id, std::move(message)); 35071+ sync_messages_.emplace_back(id, std::move(message)); 35072 SignalSyncMessageEvent(); 35073 return id; 35074 } 35075@@ -577,7 +590,7 @@ class ChannelAssociatedGroupController 35076 if (sync_messages_.empty() || sync_messages_.front().first != id) 35077 return MessageWrapper(); 35078 MessageWrapper message = std::move(sync_messages_.front().second); 35079- sync_messages_.pop(); 35080+ sync_messages_.pop_front(); 35081 return message; 35082 } 35083 35084@@ -607,10 +620,38 @@ class ChannelAssociatedGroupController 35085 return sync_watcher_->SyncWatch(&should_stop); 35086 } 35087 35088+ MessageWrapper WaitForIncomingSyncReply(uint64_t request_id) { 35089+ absl::optional<ExclusiveSyncWait> wait; 35090+ { 35091+ base::AutoLock lock(controller_->lock_); 35092+ for (auto& [id, message] : sync_messages_) { 35093+ if (message.HasRequestId(request_id)) { 35094+ return std::move(message); 35095+ } 35096+ } 35097+ 35098+ DCHECK(!exclusive_wait_); 35099+ wait.emplace(request_id); 35100+ exclusive_wait_ = &wait.value(); 35101+ } 35102+ 35103+ wait->event.Wait(); 35104+ return std::move(wait->message); 35105+ } 35106+ 35107 bool SyncWatchExclusive(uint64_t request_id) override { 35108- // We don't support exclusive waits on Channel-associated interfaces. 35109- NOTREACHED(); 35110- return false; 35111+ MessageWrapper message = WaitForIncomingSyncReply(request_id); 35112+ if (message.value().IsNull() || !client_) { 35113+ return false; 35114+ } 35115+ 35116+ if (!client_->HandleIncomingMessage(&message.value())) { 35117+ base::AutoLock locker(controller_->lock_); 35118+ controller_->RaiseError(); 35119+ return false; 35120+ } 35121+ 35122+ return true; 35123 } 35124 35125 void RegisterExternalSyncWaiter(uint64_t request_id) override {} 35126@@ -624,20 +665,26 @@ class ChannelAssociatedGroupController 35127 DCHECK(closed_); 35128 DCHECK(peer_closed_); 35129 DCHECK(!sync_watcher_); 35130+ if (exclusive_wait_) { 35131+ exclusive_wait_->event.Signal(); 35132+ } 35133 } 35134 35135 void OnSyncMessageEventReady() { 35136 DCHECK(task_runner_->RunsTasksInCurrentSequence()); 35137 35138- scoped_refptr<Endpoint> keepalive(this); 35139+ // SUBTLE: The order of these scoped_refptrs matters. 35140+ // `controller_keepalive` MUST outlive `keepalive` because the Endpoint 35141+ // holds raw pointer to the AssociatedGroupController. 35142 scoped_refptr<AssociatedGroupController> controller_keepalive( 35143 controller_.get()); 35144+ scoped_refptr<Endpoint> keepalive(this); 35145 base::AutoLock locker(controller_->lock_); 35146 bool more_to_process = false; 35147 if (!sync_messages_.empty()) { 35148 MessageWrapper message_wrapper = 35149 std::move(sync_messages_.front().second); 35150- sync_messages_.pop(); 35151+ sync_messages_.pop_front(); 35152 35153 bool dispatch_succeeded; 35154 mojo::InterfaceEndpointClient* client = client_; 35155@@ -685,6 +732,28 @@ class ChannelAssociatedGroupController 35156 return id; 35157 } 35158 35159+ // Tracks the state of a pending sync wait which excludes all other incoming 35160+ // IPC on the waiting thread. 35161+ struct ExclusiveSyncWait { 35162+ explicit ExclusiveSyncWait(uint64_t request_id) 35163+ : request_id(request_id) {} 35164+ ~ExclusiveSyncWait() = default; 35165+ 35166+ bool TryFulfillingWith(MessageWrapper& wrapper) { 35167+ if (!wrapper.HasRequestId(request_id)) { 35168+ return false; 35169+ } 35170+ 35171+ message = std::move(wrapper); 35172+ event.Signal(); 35173+ return true; 35174+ } 35175+ 35176+ uint64_t request_id; 35177+ base::WaitableEvent event; 35178+ MessageWrapper message; 35179+ }; 35180+ 35181 const raw_ptr<ChannelAssociatedGroupController> controller_; 35182 const mojo::InterfaceId id_; 35183 35184@@ -696,7 +765,8 @@ class ChannelAssociatedGroupController 35185 raw_ptr<mojo::InterfaceEndpointClient> client_ = nullptr; 35186 scoped_refptr<base::SequencedTaskRunner> task_runner_; 35187 std::unique_ptr<mojo::SequenceLocalSyncEventWatcher> sync_watcher_; 35188- base::queue<std::pair<uint32_t, MessageWrapper>> sync_messages_; 35189+ base::circular_deque<std::pair<uint32_t, MessageWrapper>> sync_messages_; 35190+ ExclusiveSyncWait* exclusive_wait_ = nullptr; 35191 uint32_t next_sync_message_id_ = 0; 35192 }; 35193 35194@@ -929,12 +999,15 @@ class ChannelAssociatedGroupController 35195 // sync message queue. If the endpoint was blocking, it will dequeue the 35196 // message and dispatch it. Otherwise the posted |AcceptSyncMessage()| 35197 // call will dequeue the message and dispatch it. 35198- uint32_t message_id = 35199+ absl::optional<uint32_t> message_id = 35200 endpoint->EnqueueSyncMessage(std::move(message_wrapper)); 35201- task_runner->PostTask( 35202- FROM_HERE, 35203- base::BindOnce(&ChannelAssociatedGroupController::AcceptSyncMessage, 35204- this, id, message_id)); 35205+ if (message_id) { 35206+ task_runner->PostTask( 35207+ FROM_HERE, 35208+ base::BindOnce( 35209+ &ChannelAssociatedGroupController::AcceptSyncMessage, this, 35210+ id, *message_id)); 35211+ } 35212 return true; 35213 } 35214 35215diff --git a/src/media/BUILD.gn b/src/media/BUILD.gn 35216index 732da9826667f..0c917f40d568f 35217--- a/src/media/BUILD.gn 35218+++ b/src/media/BUILD.gn 35219@@ -54,6 +54,10 @@ buildflag_header("media_buildflags") { 35220 "USE_PROPRIETARY_CODECS=$proprietary_codecs", 35221 "ENABLE_PLATFORM_DTS_AUDIO=$enable_platform_dts_audio", 35222 ] 35223+ 35224+ if (is_ohos) { 35225+ flags += [ "OHOS_ENABLE_MEDIA_ROUTER=$ohos_enable_media_router" ] 35226+ } 35227 } 35228 35229 if (proprietary_codecs && media_use_ffmpeg) { 35230diff --git a/src/media/base/media_switches.h b/src/media/base/media_switches.h 35231index 5a719685e73fd..05700ba70d596 35232--- a/src/media/base/media_switches.h 35233+++ b/src/media/base/media_switches.h 35234@@ -11,15 +11,12 @@ 35235 35236 #include "base/feature_list.h" 35237 #include "base/metrics/field_trial_params.h" 35238+#include "base/command_line.h" 35239 #include "build/build_config.h" 35240 #include "build/chromeos_buildflags.h" 35241 #include "media/base/media_export.h" 35242 #include "media/media_buildflags.h" 35243 35244-namespace base { 35245-class CommandLine; 35246-} 35247- 35248 namespace switches { 35249 35250 MEDIA_EXPORT extern const char kAudioBufferSize[]; 35251diff --git a/src/media/media_options.gni b/src/media/media_options.gni 35252index 307e79ad5490f..7395734870aeb 35253--- a/src/media/media_options.gni 35254+++ b/src/media/media_options.gni 35255@@ -253,7 +253,7 @@ declare_args() { 35256 # This switch defines whether the Media Remoting implementation will be built. 35257 # When enabled, media is allowed to be renderer and played back on remote 35258 # devices when the tab is being casted and other conditions are met. 35259- enable_media_remoting = !is_chromecast && !is_ios 35260+ enable_media_remoting = !is_chromecast && !is_ios && !is_ohos 35261 } 35262 35263 declare_args() { 35264@@ -299,6 +299,10 @@ if (is_fuchsia) { 35265 } 35266 35267 if (is_ohos) { 35268+ declare_args() { 35269+ ohos_enable_media_router = false 35270+ } 35271+ 35272 media_subcomponent_deps += [ 35273 "//media/base/ohos", 35274 ] 35275diff --git a/src/mojo/core/ports/port_locker.cc b/src/mojo/core/ports/port_locker.cc 35276index 880492332ddde..1dbfca0a7709f 35277--- a/src/mojo/core/ports/port_locker.cc 35278+++ b/src/mojo/core/ports/port_locker.cc 35279@@ -42,8 +42,10 @@ PortLocker::PortLocker(const PortRef** port_refs, size_t num_ports) 35280 [](const PortRef* a, const PortRef* b) { return a->port() < b->port(); }); 35281 for (size_t i = 0; i < num_ports_; ++i) { 35282 // TODO(crbug.com/725605): Remove this CHECK. 35283- CHECK(port_refs_[i]->port()); 35284- port_refs_[i]->port()->lock_.Acquire(); 35285+ // CHECK(port_refs_[i]->port()); 35286+ if (port_refs_[i]->port()) { 35287+ port_refs_[i]->port()->lock_.Acquire(); 35288+ } 35289 } 35290 } 35291 35292diff --git a/src/mojo/public/cpp/bindings/BUILD.gn b/src/mojo/public/cpp/bindings/BUILD.gn 35293index 9361ca9f1ba11..e8e9898453f5c 35294--- a/src/mojo/public/cpp/bindings/BUILD.gn 35295+++ b/src/mojo/public/cpp/bindings/BUILD.gn 35296@@ -187,6 +187,7 @@ component("bindings") { 35297 "lib/sync_event_watcher.cc", 35298 "lib/sync_handle_registry.cc", 35299 "lib/sync_handle_watcher.cc", 35300+ "lib/sync_method_traits.h", 35301 "lib/task_runner_helper.cc", 35302 "lib/task_runner_helper.h", 35303 "lib/thread_safe_forwarder_base.cc", 35304diff --git a/src/mojo/public/cpp/bindings/associated_receiver.h b/src/mojo/public/cpp/bindings/associated_receiver.h 35305index 6143940518efe..2a18b52bb0567 35306--- a/src/mojo/public/cpp/bindings/associated_receiver.h 35307+++ b/src/mojo/public/cpp/bindings/associated_receiver.h 35308@@ -5,13 +5,17 @@ 35309 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_RECEIVER_H_ 35310 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_RECEIVER_H_ 35311 35312+#include <stdint.h> 35313+ 35314 #include <memory> 35315 #include <utility> 35316 35317 #include "base/check.h" 35318+#include "base/containers/span.h" 35319 #include "base/memory/scoped_refptr.h" 35320 #include "base/memory/weak_ptr.h" 35321 #include "base/task/sequenced_task_runner.h" 35322+#include "mojo/public/cpp/bindings/lib/sync_method_traits.h" 35323 #include "mojo/public/cpp/bindings/pending_associated_receiver.h" 35324 #include "mojo/public/cpp/bindings/pending_associated_remote.h" 35325 #include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h" 35326@@ -58,7 +62,7 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) AssociatedReceiverBase { 35327 void BindImpl(ScopedInterfaceEndpointHandle handle, 35328 MessageReceiverWithResponderStatus* receiver, 35329 std::unique_ptr<MessageReceiver> payload_validator, 35330- bool expect_sync_requests, 35331+ base::span<const uint32_t> sync_method_ordinals, 35332 scoped_refptr<base::SequencedTaskRunner> runner, 35333 uint32_t interface_version, 35334 const char* interface_name); 35335@@ -197,8 +201,8 @@ class AssociatedReceiver : public internal::AssociatedReceiverBase { 35336 if (pending_receiver) { 35337 BindImpl(pending_receiver.PassHandle(), &stub_, 35338 base::WrapUnique(new typename Interface::RequestValidator_()), 35339- Interface::HasSyncMethods_, std::move(task_runner), 35340- Interface::Version_, Interface::Name_); 35341+ internal::SyncMethodTraits<Interface>::GetOrdinals(), 35342+ std::move(task_runner), Interface::Version_, Interface::Name_); 35343 } else { 35344 reset(); 35345 } 35346diff --git a/src/mojo/public/cpp/bindings/interface_endpoint_client.h b/src/mojo/public/cpp/bindings/interface_endpoint_client.h 35347index ef8f61c4de81a..cbe3fd730d742 35348--- a/src/mojo/public/cpp/bindings/interface_endpoint_client.h 35349+++ b/src/mojo/public/cpp/bindings/interface_endpoint_client.h 35350@@ -15,6 +15,7 @@ 35351 #include "base/check_op.h" 35352 #include "base/compiler_specific.h" 35353 #include "base/component_export.h" 35354+#include "base/containers/span.h" 35355 #include "base/location.h" 35356 #include "base/memory/raw_ptr.h" 35357 #include "base/memory/ref_counted.h" 35358@@ -56,7 +57,7 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) InterfaceEndpointClient 35359 InterfaceEndpointClient(ScopedInterfaceEndpointHandle handle, 35360 MessageReceiverWithResponderStatus* receiver, 35361 std::unique_ptr<MessageReceiver> payload_validator, 35362- bool expect_sync_requests, 35363+ base::span<const uint32_t> sync_method_ordinals, 35364 scoped_refptr<base::SequencedTaskRunner> task_runner, 35365 uint32_t interface_version, 35366 const char* interface_name); 35367@@ -212,6 +213,10 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) InterfaceEndpointClient 35368 // The router lock must be held when calling this. 35369 void ForgetAsyncRequest(uint64_t request_id); 35370 35371+ base::span<const uint32_t> sync_method_ordinals() const { 35372+ return sync_method_ordinals_; 35373+ } 35374+ 35375 private: 35376 struct PendingAsyncResponse { 35377 public: 35378@@ -273,7 +278,7 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) InterfaceEndpointClient 35379 35380 bool HandleValidatedMessage(Message* message); 35381 35382- const bool expect_sync_requests_ = false; 35383+ const base::span<const uint32_t> sync_method_ordinals_; 35384 35385 // The callback to invoke when our peer endpoint sends us NotifyIdle and we 35386 // have no outstanding unacked messages. If null, no callback has been set and 35387diff --git a/src/mojo/public/cpp/bindings/interface_endpoint_controller.h b/src/mojo/public/cpp/bindings/interface_endpoint_controller.h 35388index 89dbe39994620..8649abe1ac9c4 35389--- a/src/mojo/public/cpp/bindings/interface_endpoint_controller.h 35390+++ b/src/mojo/public/cpp/bindings/interface_endpoint_controller.h 35391@@ -36,6 +36,10 @@ class InterfaceEndpointController { 35392 // Watches the endpoint for a specific incoming sync reply. This method only 35393 // returns true once the reply is received, or false if the endpoint is 35394 // detached or destroyed beforehand. 35395+ // 35396+ // Unlike with SyncWatch(), no other IPCs (not even other sync IPCs) can be 35397+ // dispatched to the calling thread while SyncWatchExclusive() is waiting on 35398+ // the reply for `request_id`. 35399 virtual bool SyncWatchExclusive(uint64_t request_id) = 0; 35400 35401 // Notifies the controller that a specific in-flight sync message identified 35402diff --git a/src/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.cc b/src/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.cc 35403index 6f6d4abc787da..bf4da352e9100 35404--- a/src/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.cc 35405+++ b/src/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.cc 35406@@ -4,6 +4,11 @@ 35407 35408 #include "mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h" 35409 35410+#include <stdint.h> 35411+ 35412+#include <utility> 35413+ 35414+#include "base/containers/span.h" 35415 #include "mojo/public/cpp/bindings/lib/task_runner_helper.h" 35416 35417 namespace mojo { 35418@@ -68,7 +73,8 @@ void AssociatedInterfacePtrStateBase::Bind( 35419 // The version is only queried from the client so the value passed here 35420 // will not be used. 35421 endpoint_client_ = std::make_unique<InterfaceEndpointClient>( 35422- std::move(handle), nullptr, std::move(validator), false, 35423+ std::move(handle), nullptr, std::move(validator), 35424+ /*sync_method_ordinals=*/base::span<const uint32_t>(), 35425 GetTaskRunnerToUseFromUserProvidedTaskRunner(std::move(runner)), 0u, 35426 interface_name); 35427 } 35428diff --git a/src/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h b/src/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h 35429index 85b53a762786a..637a1e2ab8d0a 35430--- a/src/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h 35431+++ b/src/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h 35432@@ -138,6 +138,10 @@ class AssociatedInterfacePtrState : public AssociatedInterfacePtrStateBase { 35433 return info; 35434 } 35435 35436+ InterfaceEndpointClient* endpoint_client_for_test() { 35437+ return endpoint_client(); 35438+ } 35439+ 35440 private: 35441 std::unique_ptr<Proxy> proxy_; 35442 }; 35443diff --git a/src/mojo/public/cpp/bindings/lib/associated_receiver.cc b/src/mojo/public/cpp/bindings/lib/associated_receiver.cc 35444index 8a7fe542218f9..2e2bc26141e54 35445--- a/src/mojo/public/cpp/bindings/lib/associated_receiver.cc 35446+++ b/src/mojo/public/cpp/bindings/lib/associated_receiver.cc 35447@@ -62,7 +62,7 @@ void AssociatedReceiverBase::BindImpl( 35448 ScopedInterfaceEndpointHandle handle, 35449 MessageReceiverWithResponderStatus* receiver, 35450 std::unique_ptr<MessageReceiver> payload_validator, 35451- bool expect_sync_requests, 35452+ base::span<const uint32_t> sync_method_ordinals, 35453 scoped_refptr<base::SequencedTaskRunner> runner, 35454 uint32_t interface_version, 35455 const char* interface_name) { 35456@@ -70,7 +70,7 @@ void AssociatedReceiverBase::BindImpl( 35457 35458 endpoint_client_ = std::make_unique<InterfaceEndpointClient>( 35459 std::move(handle), receiver, std::move(payload_validator), 35460- expect_sync_requests, 35461+ sync_method_ordinals, 35462 internal::GetTaskRunnerToUseFromUserProvidedTaskRunner(std::move(runner)), 35463 interface_version, interface_name); 35464 } 35465diff --git a/src/mojo/public/cpp/bindings/lib/binding_state.cc b/src/mojo/public/cpp/bindings/lib/binding_state.cc 35466index 1efeb0791c301..4708b460573ca 35467--- a/src/mojo/public/cpp/bindings/lib/binding_state.cc 35468+++ b/src/mojo/public/cpp/bindings/lib/binding_state.cc 35469@@ -107,7 +107,7 @@ void BindingStateBase::BindInternal( 35470 const char* interface_name, 35471 std::unique_ptr<MessageReceiver> request_validator, 35472 bool passes_associated_kinds, 35473- bool has_sync_methods, 35474+ base::span<const uint32_t> sync_method_ordinals, 35475 MessageReceiverWithResponderStatus* stub, 35476 uint32_t interface_version) { 35477 DCHECK(!is_bound()) << "Attempting to bind interface that is already bound: " 35478@@ -119,7 +119,7 @@ void BindingStateBase::BindInternal( 35479 MultiplexRouter::Config config = 35480 passes_associated_kinds 35481 ? MultiplexRouter::MULTI_INTERFACE 35482- : (has_sync_methods 35483+ : (!sync_method_ordinals.empty() 35484 ? MultiplexRouter::SINGLE_INTERFACE_WITH_SYNC_METHODS 35485 : MultiplexRouter::SINGLE_INTERFACE); 35486 router_ = MultiplexRouter::CreateAndStartReceiving( 35487@@ -129,7 +129,7 @@ void BindingStateBase::BindInternal( 35488 35489 endpoint_client_ = std::make_unique<InterfaceEndpointClient>( 35490 router_->CreateLocalEndpointHandle(kPrimaryInterfaceId), stub, 35491- std::move(request_validator), has_sync_methods, 35492+ std::move(request_validator), sync_method_ordinals, 35493 std::move(sequenced_runner), interface_version, interface_name); 35494 endpoint_client_->SetIdleTrackingEnabledCallback( 35495 base::BindOnce(&MultiplexRouter::SetConnectionGroup, router_)); 35496diff --git a/src/mojo/public/cpp/bindings/lib/binding_state.h b/src/mojo/public/cpp/bindings/lib/binding_state.h 35497index dfe255abc95f0..9b409ff611706 35498--- a/src/mojo/public/cpp/bindings/lib/binding_state.h 35499+++ b/src/mojo/public/cpp/bindings/lib/binding_state.h 35500@@ -5,6 +5,8 @@ 35501 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ 35502 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ 35503 35504+#include <stdint.h> 35505+ 35506 #include <memory> 35507 #include <string> 35508 #include <utility> 35509@@ -13,6 +15,7 @@ 35510 #include "base/callback.h" 35511 #include "base/check.h" 35512 #include "base/component_export.h" 35513+#include "base/containers/span.h" 35514 #include "base/memory/ptr_util.h" 35515 #include "base/memory/ref_counted.h" 35516 #include "base/task/sequenced_task_runner.h" 35517@@ -25,6 +28,7 @@ 35518 #include "mojo/public/cpp/bindings/interface_request.h" 35519 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" 35520 #include "mojo/public/cpp/bindings/lib/pending_receiver_state.h" 35521+#include "mojo/public/cpp/bindings/lib/sync_method_traits.h" 35522 #include "mojo/public/cpp/bindings/message_header_validator.h" 35523 #include "mojo/public/cpp/bindings/pending_flush.h" 35524 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" 35525@@ -91,7 +95,7 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) BindingStateBase { 35526 const char* interface_name, 35527 std::unique_ptr<MessageReceiver> request_validator, 35528 bool passes_associated_kinds, 35529- bool has_sync_methods, 35530+ base::span<const uint32_t> sync_method_ordinals, 35531 MessageReceiverWithResponderStatus* stub, 35532 uint32_t interface_version); 35533 35534@@ -120,8 +124,8 @@ class BindingState : public BindingStateBase { 35535 BindingStateBase::BindInternal( 35536 std::move(receiver_state), runner, Interface::Name_, 35537 std::make_unique<typename Interface::RequestValidator_>(), 35538- Interface::PassesAssociatedKinds_, Interface::HasSyncMethods_, &stub_, 35539- Interface::Version_); 35540+ Interface::PassesAssociatedKinds_, 35541+ SyncMethodTraits<Interface>::GetOrdinals(), &stub_, Interface::Version_); 35542 } 35543 35544 InterfaceRequest<Interface> Unbind() { 35545diff --git a/src/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc b/src/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc 35546index 3ccc876ebc045..00ca42371026a 35547--- a/src/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc 35548+++ b/src/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc 35549@@ -385,7 +385,9 @@ void ThreadSafeInterfaceEndpointClientProxy::SendMessageWithResponder( 35550 } 35551 35552 // If the Remote is bound on another sequence, post the call. 35553- const bool allow_interrupt = !message.has_flag(Message::kFlagNoInterrupt); 35554+ const bool allow_interrupt = 35555+ SyncCallRestrictions::AreSyncCallInterruptsEnabled() && 35556+ !message.has_flag(Message::kFlagNoInterrupt); 35557 auto response = base::MakeRefCounted<SyncResponseInfo>(); 35558 auto response_signaler = std::make_unique<SyncResponseSignaler>(response); 35559 task_runner_->PostTask( 35560@@ -435,11 +437,11 @@ InterfaceEndpointClient::InterfaceEndpointClient( 35561 ScopedInterfaceEndpointHandle handle, 35562 MessageReceiverWithResponderStatus* receiver, 35563 std::unique_ptr<MessageReceiver> payload_validator, 35564- bool expect_sync_requests, 35565+ base::span<const uint32_t> sync_method_ordinals, 35566 scoped_refptr<base::SequencedTaskRunner> task_runner, 35567 uint32_t interface_version, 35568 const char* interface_name) 35569- : expect_sync_requests_(expect_sync_requests), 35570+ : sync_method_ordinals_(sync_method_ordinals), 35571 handle_(std::move(handle)), 35572 incoming_receiver_(receiver), 35573 dispatcher_(&thunk_), 35574@@ -619,7 +621,9 @@ bool InterfaceEndpointClient::SendMessageWithResponder( 35575 35576 const uint32_t message_name = message->name(); 35577 const bool is_sync = message->has_flag(Message::kFlagIsSync); 35578- const bool exclusive_wait = message->has_flag(Message::kFlagNoInterrupt); 35579+ const bool exclusive_wait = 35580+ message->has_flag(Message::kFlagNoInterrupt) || 35581+ !SyncCallRestrictions::AreSyncCallInterruptsEnabled(); 35582 if (!controller_->SendMessage(message)) 35583 return false; 35584 35585@@ -839,7 +843,8 @@ void InterfaceEndpointClient::InitControllerIfNecessary() { 35586 35587 controller_ = handle_.group_controller()->AttachEndpointClient(handle_, this, 35588 task_runner_); 35589- if (expect_sync_requests_ && task_runner_->RunsTasksInCurrentSequence()) 35590+ if (!sync_method_ordinals_.empty() && 35591+ task_runner_->RunsTasksInCurrentSequence()) 35592 controller_->AllowWokenUpBySyncWatchOnSameThread(); 35593 } 35594 35595diff --git a/src/mojo/public/cpp/bindings/lib/interface_ptr_state.cc b/src/mojo/public/cpp/bindings/lib/interface_ptr_state.cc 35596index ea1c937f80c98..76f6c362b3b7a 35597--- a/src/mojo/public/cpp/bindings/lib/interface_ptr_state.cc 35598+++ b/src/mojo/public/cpp/bindings/lib/interface_ptr_state.cc 35599@@ -4,6 +4,11 @@ 35600 35601 #include "mojo/public/cpp/bindings/lib/interface_ptr_state.h" 35602 35603+#include <stdint.h> 35604+ 35605+#include <utility> 35606+ 35607+#include "base/containers/span.h" 35608 #include "mojo/public/cpp/bindings/lib/task_runner_helper.h" 35609 35610 namespace mojo { 35611@@ -94,7 +99,9 @@ bool InterfacePtrStateBase::InitializeEndpointClient( 35612 interface_name); 35613 endpoint_client_ = std::make_unique<InterfaceEndpointClient>( 35614 router_->CreateLocalEndpointHandle(kPrimaryInterfaceId), nullptr, 35615- std::move(payload_validator), false, std::move(runner_), 35616+ std::move(payload_validator), 35617+ /* sync_method_ordinals= */ base::span<const uint32_t>(), 35618+ std::move(runner_), 35619 // The version is only queried from the client so the value passed here 35620 // will not be used. 35621 0u, interface_name); 35622diff --git a/src/mojo/public/cpp/bindings/lib/interface_ptr_state.h b/src/mojo/public/cpp/bindings/lib/interface_ptr_state.h 35623index 142a35bc95e6e..45ec397195893 35624--- a/src/mojo/public/cpp/bindings/lib/interface_ptr_state.h 35625+++ b/src/mojo/public/cpp/bindings/lib/interface_ptr_state.h 35626@@ -29,6 +29,7 @@ 35627 #include "mojo/public/cpp/bindings/interface_ptr_info.h" 35628 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" 35629 #include "mojo/public/cpp/bindings/lib/pending_remote_state.h" 35630+#include "mojo/public/cpp/bindings/lib/sync_method_traits.h" 35631 #include "mojo/public/cpp/bindings/message_header_validator.h" 35632 #include "mojo/public/cpp/bindings/pending_flush.h" 35633 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" 35634@@ -242,6 +243,10 @@ class InterfacePtrState : public InterfacePtrStateBase { 35635 endpoint_client()->RaiseError(); 35636 } 35637 35638+ InterfaceEndpointClient* endpoint_client_for_test() { 35639+ return endpoint_client(); 35640+ } 35641+ 35642 private: 35643 void ConfigureProxyIfNecessary() { 35644 // The proxy has been configured. 35645@@ -252,7 +257,8 @@ class InterfacePtrState : public InterfacePtrStateBase { 35646 } 35647 35648 if (InitializeEndpointClient( 35649- Interface::PassesAssociatedKinds_, Interface::HasSyncMethods_, 35650+ Interface::PassesAssociatedKinds_, 35651+ !SyncMethodTraits<Interface>::GetOrdinals().empty(), 35652 Interface::HasUninterruptableMethods_, 35653 std::make_unique<typename Interface::ResponseValidator_>(), 35654 Interface::Name_)) { 35655diff --git a/src/mojo/public/cpp/bindings/lib/multiplex_router.cc b/src/mojo/public/cpp/bindings/lib/multiplex_router.cc 35656index 1b21719333bb1..462e8476b8227 35657--- a/src/mojo/public/cpp/bindings/lib/multiplex_router.cc 35658+++ b/src/mojo/public/cpp/bindings/lib/multiplex_router.cc 35659@@ -1067,6 +1067,12 @@ bool MultiplexRouter::ProcessIncomingMessage( 35660 35661 bool can_direct_call; 35662 if (message->has_flag(Message::kFlagIsSync)) { 35663+ if (!message->has_flag(Message::kFlagIsResponse) && 35664+ !base::Contains(endpoint->client()->sync_method_ordinals(), 35665+ message->name())) { 35666+ RaiseErrorInNonTestingMode(); 35667+ return true; 35668+ } 35669 can_direct_call = client_call_behavior != NO_DIRECT_CLIENT_CALLS && 35670 endpoint->task_runner()->RunsTasksInCurrentSequence(); 35671 } else { 35672diff --git a/src/mojo/public/cpp/bindings/lib/sync_call_restrictions.cc b/src/mojo/public/cpp/bindings/lib/sync_call_restrictions.cc 35673index fa7934bdb3404..166b9bdc5052f 35674--- a/src/mojo/public/cpp/bindings/lib/sync_call_restrictions.cc 35675+++ b/src/mojo/public/cpp/bindings/lib/sync_call_restrictions.cc 35676@@ -4,8 +4,6 @@ 35677 35678 #include "mojo/public/cpp/bindings/sync_call_restrictions.h" 35679 35680-#if ENABLE_SYNC_CALL_RESTRICTIONS 35681- 35682 #include "base/debug/leak_annotations.h" 35683 #include "base/logging.h" 35684 #include "base/no_destructor.h" 35685@@ -18,6 +16,11 @@ namespace mojo { 35686 35687 namespace { 35688 35689+// Sync call interrupts are enabled by default. 35690+bool g_enable_sync_call_interrupts = true; 35691+ 35692+#if ENABLE_SYNC_CALL_RESTRICTIONS 35693+ 35694 class GlobalSyncCallSettings { 35695 public: 35696 GlobalSyncCallSettings() = default; 35697@@ -60,8 +63,12 @@ bool SyncCallRestrictionsEnforceable() { 35698 return base::internal::SequenceLocalStorageMap::IsSetForCurrentThread(); 35699 } 35700 35701+#endif // ENABLE_SYNC_CALL_RESTRICTIONS 35702+ 35703 } // namespace 35704 35705+#if ENABLE_SYNC_CALL_RESTRICTIONS 35706+ 35707 // static 35708 void SyncCallRestrictions::AssertSyncCallAllowed() { 35709 if (GetGlobalSettings().sync_call_allowed_by_default() || 35710@@ -101,6 +108,21 @@ void SyncCallRestrictions::DecreaseScopedAllowCount() { 35711 --GetSequenceLocalScopedAllowCount(); 35712 } 35713 35714-} // namespace mojo 35715- 35716 #endif // ENABLE_SYNC_CALL_RESTRICTIONS 35717+ 35718+// static 35719+void SyncCallRestrictions::DisableSyncCallInterrupts() { 35720+ g_enable_sync_call_interrupts = false; 35721+} 35722+ 35723+// static 35724+void SyncCallRestrictions::EnableSyncCallInterruptsForTesting() { 35725+ g_enable_sync_call_interrupts = true; 35726+} 35727+ 35728+// static 35729+bool SyncCallRestrictions::AreSyncCallInterruptsEnabled() { 35730+ return g_enable_sync_call_interrupts; 35731+} 35732+ 35733+} // namespace mojo 35734diff --git a/src/mojo/public/cpp/bindings/lib/sync_method_traits.h b/src/mojo/public/cpp/bindings/lib/sync_method_traits.h 35735new file mode 100644 35736index 0000000000000..2b334f8d01c2e 35737--- /dev/null 35738+++ b/src/mojo/public/cpp/bindings/lib/sync_method_traits.h 35739@@ -0,0 +1,31 @@ 35740+// Copyright 2022 The Chromium Authors 35741+// Use of this source code is governed by a BSD-style license that can be 35742+// found in the LICENSE file. 35743+ 35744+#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNC_METHOD_TRAITS_H_ 35745+#define MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNC_METHOD_TRAITS_H_ 35746+ 35747+#include <stdint.h> 35748+ 35749+#include <type_traits> 35750+ 35751+#include "base/containers/span.h" 35752+ 35753+namespace mojo::internal { 35754+ 35755+template <typename Interface, typename SFINAE = void> 35756+struct SyncMethodTraits { 35757+ static constexpr base::span<const uint32_t> GetOrdinals() { return {}; } 35758+}; 35759+ 35760+template <typename Interface> 35761+struct SyncMethodTraits<Interface, 35762+ std::void_t<decltype(Interface::kSyncMethodOrdinals)>> { 35763+ static constexpr base::span<const uint32_t> GetOrdinals() { 35764+ return Interface::kSyncMethodOrdinals; 35765+ } 35766+}; 35767+ 35768+} // namespace mojo::internal 35769+ 35770+#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_SYNC_METHOD_TRAITS_H_ 35771diff --git a/src/mojo/public/cpp/bindings/sync_call_restrictions.h b/src/mojo/public/cpp/bindings/sync_call_restrictions.h 35772index bb044cff83f58..f3bfd33a53e5e 35773--- a/src/mojo/public/cpp/bindings/sync_call_restrictions.h 35774+++ b/src/mojo/public/cpp/bindings/sync_call_restrictions.h 35775@@ -87,6 +87,20 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions { 35776 static void DisallowSyncCall() {} 35777 #endif 35778 35779+ // Globally disables sync call interrupts. This means that all sync calls in 35780+ // the current process will be strictly blocking until a reply is received, 35781+ // and no incoming sync calls can dispatch on the blocking thread in interim. 35782+ static void DisableSyncCallInterrupts(); 35783+ 35784+ // Used only in tests to re-enable sync call interrupts after disabling them. 35785+ static void EnableSyncCallInterruptsForTesting(); 35786+ 35787+ // Indicates whether sync call interrupts are enabled in the calling process. 35788+ // They're enabled by default, so any sync message that isn't marked [Sync] 35789+ // may have its blocking call interrupted to dispatch other incoming sync 35790+ // IPCs which target the blocking thread. 35791+ static bool AreSyncCallInterruptsEnabled(); 35792+ 35793 private: 35794 // DO NOT ADD ANY OTHER FRIEND STATEMENTS, talk to mojo/OWNERS first. 35795 // BEGIN ALLOWED USAGE. 35796diff --git a/src/mojo/public/cpp/bindings/tests/BUILD.gn b/src/mojo/public/cpp/bindings/tests/BUILD.gn 35797index f164dc9e3e4b3..c7e0f37683434 35798--- a/src/mojo/public/cpp/bindings/tests/BUILD.gn 35799+++ b/src/mojo/public/cpp/bindings/tests/BUILD.gn 35800@@ -67,6 +67,7 @@ source_set("tests") { 35801 ":mojo_public_bindings_test_utils", 35802 ":test_extra_cpp_template_mojom", 35803 ":test_mojom", 35804+ ":test_mojom__generate_message_ids", 35805 "//base/test:test_support", 35806 "//mojo/core/test:test_support", 35807 "//mojo/public/cpp/bindings", 35808diff --git a/src/mojo/public/cpp/bindings/tests/bindings_perftest.cc b/src/mojo/public/cpp/bindings/tests/bindings_perftest.cc 35809index 233d024fd0d03..01ff318a1afc1 35810--- a/src/mojo/public/cpp/bindings/tests/bindings_perftest.cc 35811+++ b/src/mojo/public/cpp/bindings/tests/bindings_perftest.cc 35812@@ -205,12 +205,10 @@ TEST_F(MojoBindingsPerftest, MultiplexRouterPingPong) { 35813 35814 InterfaceEndpointClient client0( 35815 router0->CreateLocalEndpointHandle(kPrimaryInterfaceId), &paddle0, 35816- nullptr, false, base::ThreadTaskRunnerHandle::Get(), 0u, 35817- kTestInterfaceName); 35818+ nullptr, {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35819 InterfaceEndpointClient client1( 35820 router1->CreateLocalEndpointHandle(kPrimaryInterfaceId), &paddle1, 35821- nullptr, false, base::ThreadTaskRunnerHandle::Get(), 0u, 35822- kTestInterfaceName); 35823+ nullptr, {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35824 35825 paddle0.set_sender(&client0); 35826 paddle1.set_sender(&client1); 35827@@ -257,8 +255,7 @@ TEST_F(MojoBindingsPerftest, MultiplexRouterDispatchCost) { 35828 CounterReceiver receiver; 35829 InterfaceEndpointClient client( 35830 router->CreateLocalEndpointHandle(kPrimaryInterfaceId), &receiver, 35831- nullptr, false, base::ThreadTaskRunnerHandle::Get(), 0u, 35832- kTestInterfaceName); 35833+ nullptr, {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35834 35835 static const uint32_t kIterations[] = {1000, 3000000}; 35836 35837diff --git a/src/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc b/src/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc 35838index af60dfd66e251..6f746101534c3 35839--- a/src/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc 35840+++ b/src/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc 35841@@ -66,12 +66,12 @@ class MultiplexRouterTest : public testing::Test { 35842 35843 TEST_F(MultiplexRouterTest, BasicRequestResponse) { 35844 InterfaceEndpointClient client0( 35845- std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(), 35846- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35847+ std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(), {}, 35848+ base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35849 ResponseGenerator generator; 35850 InterfaceEndpointClient client1( 35851 std::move(endpoint1_), &generator, std::make_unique<PassThroughFilter>(), 35852- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35853+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35854 35855 Message request; 35856 AllocRequestMessage(1, "hello", &request); 35857@@ -113,12 +113,12 @@ TEST_F(MultiplexRouterTest, BasicRequestResponse) { 35858 35859 TEST_F(MultiplexRouterTest, BasicRequestResponse_Synchronous) { 35860 InterfaceEndpointClient client0( 35861- std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(), 35862- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35863+ std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(), {}, 35864+ base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35865 ResponseGenerator generator; 35866 InterfaceEndpointClient client1( 35867 std::move(endpoint1_), &generator, std::make_unique<PassThroughFilter>(), 35868- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35869+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35870 35871 Message request; 35872 AllocRequestMessage(1, "hello", &request); 35873@@ -161,13 +161,13 @@ TEST_F(MultiplexRouterTest, BasicRequestResponse_Synchronous) { 35874 TEST_F(MultiplexRouterTest, LazyResponses) { 35875 InterfaceEndpointClient client0( 35876 std::move(endpoint0_), nullptr, base::WrapUnique(new PassThroughFilter()), 35877- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35878+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35879 base::RunLoop run_loop; 35880 LazyResponseGenerator generator(run_loop.QuitClosure()); 35881 InterfaceEndpointClient client1(std::move(endpoint1_), &generator, 35882- base::WrapUnique(new PassThroughFilter()), 35883- false, base::ThreadTaskRunnerHandle::Get(), 35884- 0u, kTestInterfaceName); 35885+ base::WrapUnique(new PassThroughFilter()), {}, 35886+ base::ThreadTaskRunnerHandle::Get(), 0u, 35887+ kTestInterfaceName); 35888 35889 Message request; 35890 AllocRequestMessage(1, "hello", &request); 35891@@ -233,7 +233,7 @@ TEST_F(MultiplexRouterTest, MissingResponses) { 35892 base::RunLoop run_loop0, run_loop1; 35893 InterfaceEndpointClient client0( 35894 std::move(endpoint0_), nullptr, base::WrapUnique(new PassThroughFilter()), 35895- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35896+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35897 bool error_handler_called0 = false; 35898 client0.set_connection_error_handler(base::BindOnce( 35899 &ForwardErrorHandler, &error_handler_called0, run_loop0.QuitClosure())); 35900@@ -241,9 +241,9 @@ TEST_F(MultiplexRouterTest, MissingResponses) { 35901 base::RunLoop run_loop3; 35902 LazyResponseGenerator generator(run_loop3.QuitClosure()); 35903 InterfaceEndpointClient client1(std::move(endpoint1_), &generator, 35904- base::WrapUnique(new PassThroughFilter()), 35905- false, base::ThreadTaskRunnerHandle::Get(), 35906- 0u, kTestInterfaceName); 35907+ base::WrapUnique(new PassThroughFilter()), {}, 35908+ base::ThreadTaskRunnerHandle::Get(), 0u, 35909+ kTestInterfaceName); 35910 bool error_handler_called1 = false; 35911 client1.set_connection_error_handler(base::BindOnce( 35912 &ForwardErrorHandler, &error_handler_called1, run_loop1.QuitClosure())); 35913@@ -290,11 +290,11 @@ TEST_F(MultiplexRouterTest, LateResponse) { 35914 { 35915 InterfaceEndpointClient client0( 35916 std::move(endpoint0_), nullptr, std::make_unique<PassThroughFilter>(), 35917- false, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35918+ {}, base::ThreadTaskRunnerHandle::Get(), 0u, kTestInterfaceName); 35919 InterfaceEndpointClient client1(std::move(endpoint1_), &generator, 35920- std::make_unique<PassThroughFilter>(), 35921- false, base::ThreadTaskRunnerHandle::Get(), 35922- 0u, kTestInterfaceName); 35923+ std::make_unique<PassThroughFilter>(), {}, 35924+ base::ThreadTaskRunnerHandle::Get(), 0u, 35925+ kTestInterfaceName); 35926 35927 Message request; 35928 AllocRequestMessage(1, "hello", &request); 35929diff --git a/src/mojo/public/cpp/bindings/tests/sync_method_unittest.cc b/src/mojo/public/cpp/bindings/tests/sync_method_unittest.cc 35930index 1c37b87a65db4..3a48d1d2c93fa 35931--- a/src/mojo/public/cpp/bindings/tests/sync_method_unittest.cc 35932+++ b/src/mojo/public/cpp/bindings/tests/sync_method_unittest.cc 35933@@ -2,6 +2,7 @@ 35934 // Use of this source code is governed by a BSD-style license that can be 35935 // found in the LICENSE file. 35936 35937+#include <tuple> 35938 #include <utility> 35939 35940 #include "base/barrier_closure.h" 35941@@ -9,16 +10,22 @@ 35942 #include "base/check.h" 35943 #include "base/run_loop.h" 35944 #include "base/sequence_token.h" 35945+#include "base/task/sequenced_task_runner.h" 35946 #include "base/task/post_task.h" 35947 #include "base/task/thread_pool.h" 35948 #include "base/test/bind.h" 35949 #include "base/test/task_environment.h" 35950 #include "base/threading/sequence_bound.h" 35951+#include "base/threading/sequenced_task_runner_handle.h" 35952 #include "base/threading/thread.h" 35953 #include "base/time/time.h" 35954 #include "mojo/public/cpp/bindings/associated_receiver.h" 35955 #include "mojo/public/cpp/bindings/associated_receiver_set.h" 35956 #include "mojo/public/cpp/bindings/associated_remote.h" 35957+#include "mojo/public/cpp/bindings/lib/message_fragment.h" 35958+#include "mojo/public/cpp/bindings/lib/send_message_helper.h" 35959+#include "mojo/public/cpp/bindings/lib/serialization_util.h" 35960+#include "mojo/public/cpp/bindings/message.h" 35961 #include "mojo/public/cpp/bindings/receiver.h" 35962 #include "mojo/public/cpp/bindings/receiver_set.h" 35963 #include "mojo/public/cpp/bindings/remote.h" 35964@@ -26,11 +33,18 @@ 35965 #include "mojo/public/cpp/bindings/self_owned_receiver.h" 35966 #include "mojo/public/cpp/bindings/shared_associated_remote.h" 35967 #include "mojo/public/cpp/bindings/shared_remote.h" 35968+#include "mojo/public/cpp/bindings/sync_call_restrictions.h" 35969 #include "mojo/public/cpp/bindings/tests/bindings_test_base.h" 35970+#include "mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom-shared-message-ids.h" 35971 #include "mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom.h" 35972 #include "mojo/public/interfaces/bindings/tests/test_sync_methods.mojom.h" 35973 #include "testing/gtest/include/gtest/gtest.h" 35974 35975+// This needs to be included last, since it forward declares a bunch of classes 35976+// but depends on those definitions to be included by headers that sort 35977+// lexicographically after. 35978+#include "mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom-params-data.h" 35979+ 35980 namespace mojo { 35981 namespace test { 35982 namespace sync_method_unittest { 35983@@ -1564,7 +1578,375 @@ TEST_P(SyncInterruptTest, SharedAssociatedRemoteNoInterrupt) { 35984 EXPECT_EQ(0, same_pipe_ponger().num_sync_pongs()); 35985 } 35986 35987+class SyncService : public mojom::SyncService { 35988+ public: 35989+ explicit SyncService(PendingReceiver<mojom::SyncService> receiver) 35990+ : receiver_(this, std::move(receiver)) {} 35991+ 35992+ void SetCallHandler(base::OnceClosure call_handler) { 35993+ call_handler_ = std::move(call_handler); 35994+ } 35995+ 35996+ // mojom::SyncService: 35997+ void SyncCall(SyncCallCallback callback) override { 35998+ std::move(callback).Run(); 35999+ if (call_handler_) { 36000+ std::move(call_handler_).Run(); 36001+ } 36002+ } 36003+ 36004+ private: 36005+ Receiver<mojom::SyncService> receiver_; 36006+ base::OnceClosure call_handler_; 36007+}; 36008+ 36009+class DisableSyncInterruptTest : public BindingsTestBase { 36010+ public: 36011+ void SetUp() override { 36012+ mojo::SyncCallRestrictions::DisableSyncCallInterrupts(); 36013+ } 36014+ 36015+ void TearDown() override { 36016+ mojo::SyncCallRestrictions::EnableSyncCallInterruptsForTesting(); 36017+ } 36018+}; 36019+ 36020+TEST_P(DisableSyncInterruptTest, NoInterruptWhenDisabled) { 36021+ PendingRemote<mojom::SyncService> interrupter; 36022+ SyncService service(interrupter.InitWithNewPipeAndPassReceiver()); 36023+ 36024+ base::RunLoop wait_for_main_thread_service_call; 36025+ bool main_thread_service_called = false; 36026+ service.SetCallHandler(base::BindLambdaForTesting([&] { 36027+ main_thread_service_called = true; 36028+ wait_for_main_thread_service_call.Quit(); 36029+ })); 36030+ 36031+ Remote<mojom::SyncService> caller; 36032+ base::Thread background_service_thread("SyncService"); 36033+ background_service_thread.Start(); 36034+ base::SequenceBound<SyncService> background_service{ 36035+ background_service_thread.task_runner(), 36036+ caller.BindNewPipeAndPassReceiver()}; 36037+ 36038+ base::Thread interrupter_thread("Interrupter"); 36039+ interrupter_thread.Start(); 36040+ interrupter_thread.task_runner()->PostTask( 36041+ FROM_HERE, base::BindLambdaForTesting([&interrupter] { 36042+ // Issue a sync call to the SyncService on the main thread. This should 36043+ // never be dispatched until *after* the sync call *from* the main 36044+ // thread completes below. 36045+ Remote<mojom::SyncService>(std::move(interrupter))->SyncCall(); 36046+ })); 36047+ 36048+ // The key test expectation here is that `main_thread_service_called` cannot 36049+ // be set to true until after SyncCall() returns and we can pump the thread's 36050+ // message loop. If sync interrupts are not properly disabled, this 36051+ // expectation can fail flakily (and often.) 36052+ caller->SyncCall(); 36053+ EXPECT_FALSE(main_thread_service_called); 36054+ 36055+ // Now the incoming sync call can be dispatched. 36056+ wait_for_main_thread_service_call.Run(); 36057+ EXPECT_TRUE(main_thread_service_called); 36058+ 36059+ background_service.SynchronouslyResetForTest(); 36060+ interrupter_thread.Stop(); 36061+ background_service_thread.Stop(); 36062+} 36063+ 36064+TEST_P(DisableSyncInterruptTest, SharedRemoteNoInterruptWhenDisabled) { 36065+ PendingRemote<mojom::SyncService> interrupter; 36066+ SyncService service(interrupter.InitWithNewPipeAndPassReceiver()); 36067+ 36068+ base::RunLoop wait_for_main_thread_service_call; 36069+ bool main_thread_service_called = false; 36070+ service.SetCallHandler(base::BindLambdaForTesting([&] { 36071+ main_thread_service_called = true; 36072+ wait_for_main_thread_service_call.Quit(); 36073+ })); 36074+ 36075+ // Bind a SharedRemote to another background thread so that we exercise 36076+ // SharedRemote's own sync wait codepath when called into from the main 36077+ // thread. 36078+ base::Thread background_client_thread("Client"); 36079+ background_client_thread.Start(); 36080+ 36081+ base::Thread background_service_thread("Service"); 36082+ background_service_thread.Start(); 36083+ 36084+ SharedRemote<mojom::SyncService> caller; 36085+ base::SequenceBound<SyncService> background_service{ 36086+ background_service_thread.task_runner(), 36087+ caller.BindNewPipeAndPassReceiver( 36088+ background_client_thread.task_runner())}; 36089+ 36090+ base::Thread interrupter_thread("Interrupter"); 36091+ interrupter_thread.Start(); 36092+ interrupter_thread.task_runner()->PostTask( 36093+ FROM_HERE, base::BindLambdaForTesting([&interrupter] { 36094+ // Issue a sync call to the SyncService on the main thread. This should 36095+ // never be dispatched until *after* the sync call *from* the main 36096+ // thread completes below. 36097+ Remote<mojom::SyncService>(std::move(interrupter))->SyncCall(); 36098+ })); 36099+ 36100+ // The key test expectation here is that `main_thread_service_called` cannot 36101+ // be set to true until after SyncCall() returns and we can pump the thread's 36102+ // message loop. If sync interrupts are not properly disabled, this 36103+ // expectation can fail flakily (and often.) 36104+ caller->SyncCall(); 36105+ EXPECT_FALSE(main_thread_service_called); 36106+ 36107+ // Now the incoming sync call can be dispatched. 36108+ wait_for_main_thread_service_call.Run(); 36109+ EXPECT_TRUE(main_thread_service_called); 36110+ 36111+ background_service.SynchronouslyResetForTest(); 36112+ 36113+ // We need to reset the SharedRemote before the client thread is stopped, to 36114+ // ensure the necessary teardown work is executed on that thread. Otherwise 36115+ // the underlying pipe and related state will leak, and ASan will complain. 36116+ caller.reset(); 36117+ 36118+ interrupter_thread.Stop(); 36119+ background_service_thread.Stop(); 36120+ background_client_thread.Stop(); 36121+} 36122+ 36123 INSTANTIATE_MOJO_BINDINGS_TEST_SUITE_P(SyncInterruptTest); 36124+INSTANTIATE_MOJO_BINDINGS_TEST_SUITE_P(DisableSyncInterruptTest); 36125+ 36126+class OneSyncImpl; 36127+ 36128+class NoSyncImpl : public mojom::NoSync { 36129+ public: 36130+ explicit NoSyncImpl(PendingReceiver<mojom::NoSync> receiver) 36131+ : receiver_(this, std::move(receiver)) {} 36132+ 36133+ explicit NoSyncImpl( 36134+ PendingAssociatedReceiver<mojom::NoSync> associated_receiver) 36135+ : associated_receiver_(this, std::move(associated_receiver)) {} 36136+ 36137+ // mojom::NoSync implementation: 36138+ void Method(MethodCallback callback) override; 36139+ void BindNoSync(PendingAssociatedReceiver<mojom::NoSync> receiver) override; 36140+ void BindOneSync(PendingAssociatedReceiver<mojom::OneSync> receiver) override; 36141+ 36142+ private: 36143+ Receiver<mojom::NoSync> receiver_{this}; 36144+ AssociatedReceiver<mojom::NoSync> associated_receiver_{this}; 36145+ 36146+ std::unique_ptr<NoSyncImpl> associated_no_sync_; 36147+ std::unique_ptr<OneSyncImpl> associated_one_sync_; 36148+}; 36149+ 36150+class OneSyncImpl : public mojom::OneSync { 36151+ public: 36152+ explicit OneSyncImpl(PendingReceiver<mojom::OneSync> receiver) 36153+ : receiver_(this, std::move(receiver)) {} 36154+ 36155+ explicit OneSyncImpl( 36156+ PendingAssociatedReceiver<mojom::OneSync> associated_receiver) 36157+ : associated_receiver_(this, std::move(associated_receiver)) {} 36158+ 36159+ // mojom::OneSync implementation: 36160+ void Method(MethodCallback callback) override; 36161+ void SyncMethod(SyncMethodCallback callback) override; 36162+ void BindNoSync(PendingAssociatedReceiver<mojom::NoSync> receiver) override; 36163+ void BindOneSync(PendingAssociatedReceiver<mojom::OneSync> receiver) override; 36164+ 36165+ private: 36166+ Receiver<mojom::OneSync> receiver_{this}; 36167+ AssociatedReceiver<mojom::OneSync> associated_receiver_{this}; 36168+ 36169+ std::unique_ptr<NoSyncImpl> associated_no_sync_; 36170+ std::unique_ptr<OneSyncImpl> associated_one_sync_; 36171+}; 36172+ 36173+void NoSyncImpl::Method(MethodCallback callback) { 36174+ EXPECT_TRUE(false); 36175+ std::move(callback).Run(); 36176+} 36177+ 36178+void NoSyncImpl::BindNoSync(PendingAssociatedReceiver<mojom::NoSync> receiver) { 36179+ associated_no_sync_ = std::make_unique<NoSyncImpl>(std::move(receiver)); 36180+} 36181+ 36182+void NoSyncImpl::BindOneSync( 36183+ PendingAssociatedReceiver<mojom::OneSync> receiver) { 36184+ associated_one_sync_ = std::make_unique<OneSyncImpl>(std::move(receiver)); 36185+} 36186+ 36187+void OneSyncImpl::Method(MethodCallback callback) { 36188+ EXPECT_TRUE(false); 36189+ std::move(callback).Run(); 36190+} 36191+ 36192+void OneSyncImpl::SyncMethod(MethodCallback callback) { 36193+ std::move(callback).Run(); 36194+} 36195+ 36196+void OneSyncImpl::BindNoSync( 36197+ PendingAssociatedReceiver<mojom::NoSync> receiver) { 36198+ associated_no_sync_ = std::make_unique<NoSyncImpl>(std::move(receiver)); 36199+} 36200+ 36201+void OneSyncImpl::BindOneSync( 36202+ PendingAssociatedReceiver<mojom::OneSync> receiver) { 36203+ associated_one_sync_ = std::make_unique<OneSyncImpl>(std::move(receiver)); 36204+} 36205+ 36206+class NoResponseExpectedResponder : public MessageReceiver { 36207+ public: 36208+ explicit NoResponseExpectedResponder() = default; 36209+ 36210+ // MessageReceiver implementation: 36211+ bool Accept(Message* message) override { 36212+ EXPECT_TRUE(false); 36213+ return true; 36214+ } 36215+}; 36216+ 36217+class SyncFlagValidationTest : public ::testing::TestWithParam<uint32_t> { 36218+ protected: 36219+ Message MakeNoSyncMethodMessage() { 36220+ const uint32_t flags = 36221+ // Always set the sync flag, as that's the primary point of the test. 36222+ Message::kFlagIsSync | 36223+ // InterfaceEndpointClient requires this flag if sending a message with 36224+ // a responder. 36225+ Message::kFlagExpectsResponse | GetParam(); 36226+ Message message(mojom::internal::kNoSync_Method_Name, flags, 0, 0, nullptr); 36227+ ::mojo::internal::MessageFragment< 36228+ mojom::internal::NoSync_Method_Params_Data> 36229+ params(message); 36230+ params.Allocate(); 36231+ return message; 36232+ } 36233+ 36234+ Message MakeOneSyncMethodMessage() { 36235+ const uint32_t flags = 36236+ // Always set the sync flag, as that's the primary point of the test. 36237+ Message::kFlagIsSync | 36238+ // InterfaceEndpointClient requires this flag if sending a message with 36239+ // a responder. 36240+ Message::kFlagExpectsResponse | GetParam(); 36241+ Message message(mojom::internal::kOneSync_Method_Name, flags, 0, 0, 36242+ nullptr); 36243+ ::mojo::internal::MessageFragment< 36244+ mojom::internal::NoSync_Method_Params_Data> 36245+ params(message); 36246+ params.Allocate(); 36247+ return message; 36248+ } 36249+ 36250+ void FlushPostedTasks() { 36251+ base::RunLoop run_loop; 36252+ base::SequencedTaskRunnerHandle::Get()->PostTask(FROM_HERE, 36253+ run_loop.QuitClosure()); 36254+ run_loop.Run(); 36255+ } 36256+ 36257+ private: 36258+ base::test::SingleThreadTaskEnvironment task_environment; 36259+}; 36260+ 36261+TEST_P(SyncFlagValidationTest, NonSync) { 36262+ Remote<mojom::NoSync> remote; 36263+ NoSyncImpl impl(remote.BindNewPipeAndPassReceiver()); 36264+ 36265+ Message message = MakeNoSyncMethodMessage(); 36266+ auto responder = std::make_unique<NoResponseExpectedResponder>(); 36267+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test()); 36268+ ::mojo::internal::SendMessage( 36269+ *remote.internal_state()->endpoint_client_for_test(), message, 36270+ std::move(responder)); 36271+} 36272+ 36273+TEST_P(SyncFlagValidationTest, OneSync) { 36274+ Remote<mojom::OneSync> remote; 36275+ OneSyncImpl impl(remote.BindNewPipeAndPassReceiver()); 36276+ 36277+ Message message = MakeOneSyncMethodMessage(); 36278+ auto responder = std::make_unique<NoResponseExpectedResponder>(); 36279+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test()); 36280+ ::mojo::internal::SendMessage( 36281+ *remote.internal_state()->endpoint_client_for_test(), message, 36282+ std::move(responder)); 36283+} 36284+ 36285+TEST_P(SyncFlagValidationTest, NoSyncAssociatedWithNoSync) { 36286+ Remote<mojom::NoSync> remote; 36287+ NoSyncImpl impl(remote.BindNewPipeAndPassReceiver()); 36288+ 36289+ AssociatedRemote<mojom::NoSync> associated_remote; 36290+ remote->BindNoSync(associated_remote.BindNewEndpointAndPassReceiver()); 36291+ 36292+ FlushPostedTasks(); 36293+ 36294+ Message message = MakeNoSyncMethodMessage(); 36295+ auto responder = std::make_unique<NoResponseExpectedResponder>(); 36296+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test()); 36297+ ::mojo::internal::SendMessage( 36298+ *associated_remote.internal_state()->endpoint_client_for_test(), message, 36299+ std::move(responder)); 36300+} 36301+ 36302+TEST_P(SyncFlagValidationTest, OneSyncAssociatedWithNoSync) { 36303+ Remote<mojom::NoSync> remote; 36304+ NoSyncImpl impl(remote.BindNewPipeAndPassReceiver()); 36305+ 36306+ AssociatedRemote<mojom::OneSync> associated_remote; 36307+ remote->BindOneSync(associated_remote.BindNewEndpointAndPassReceiver()); 36308+ 36309+ FlushPostedTasks(); 36310+ 36311+ Message message = MakeOneSyncMethodMessage(); 36312+ auto responder = std::make_unique<NoResponseExpectedResponder>(); 36313+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test()); 36314+ ::mojo::internal::SendMessage( 36315+ *associated_remote.internal_state()->endpoint_client_for_test(), message, 36316+ std::move(responder)); 36317+} 36318+ 36319+TEST_P(SyncFlagValidationTest, NoSyncAssociatedWithOneSync) { 36320+ Remote<mojom::OneSync> remote; 36321+ OneSyncImpl impl(remote.BindNewPipeAndPassReceiver()); 36322+ 36323+ AssociatedRemote<mojom::NoSync> associated_remote; 36324+ remote->BindNoSync(associated_remote.BindNewEndpointAndPassReceiver()); 36325+ 36326+ FlushPostedTasks(); 36327+ 36328+ Message message = MakeNoSyncMethodMessage(); 36329+ auto responder = std::make_unique<NoResponseExpectedResponder>(); 36330+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test()); 36331+ ::mojo::internal::SendMessage( 36332+ *associated_remote.internal_state()->endpoint_client_for_test(), message, 36333+ std::move(responder)); 36334+} 36335+ 36336+TEST_P(SyncFlagValidationTest, OneSyncAssociatedWithOneSync) { 36337+ Remote<mojom::OneSync> remote; 36338+ OneSyncImpl impl(remote.BindNewPipeAndPassReceiver()); 36339+ 36340+ AssociatedRemote<mojom::OneSync> associated_remote; 36341+ remote->BindOneSync(associated_remote.BindNewEndpointAndPassReceiver()); 36342+ 36343+ FlushPostedTasks(); 36344+ 36345+ Message message = MakeOneSyncMethodMessage(); 36346+ auto responder = std::make_unique<NoResponseExpectedResponder>(); 36347+ ASSERT_TRUE(remote.internal_state()->endpoint_client_for_test()); 36348+ ::mojo::internal::SendMessage( 36349+ *associated_remote.internal_state()->endpoint_client_for_test(), message, 36350+ std::move(responder)); 36351+} 36352+ 36353+INSTANTIATE_TEST_SUITE_P(, 36354+ SyncFlagValidationTest, 36355+ ::testing::Values(0, Message::kFlagIsResponse)); 36356 36357 } // namespace 36358 } // namespace sync_method_unittest 36359diff --git a/src/mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom b/src/mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom 36360index 383b54f3ab654..0cc5f7c6d288f 36361--- a/src/mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom 36362+++ b/src/mojo/public/cpp/bindings/tests/sync_method_unittest.test-mojom 36363@@ -45,3 +45,24 @@ interface Ponger { 36364 [Sync] Pong() => (); 36365 PongAsync(); 36366 }; 36367+ 36368+interface SyncService { 36369+ [Sync] SyncCall() => (); 36370+}; 36371+ 36372+interface NoSync { 36373+ Method() => (); 36374+ 36375+ BindNoSync(pending_associated_receiver<NoSync> no_sync); 36376+ BindOneSync(pending_associated_receiver<OneSync> one_sync); 36377+}; 36378+ 36379+interface OneSync { 36380+ Method() => (); 36381+ 36382+ [Sync] 36383+ SyncMethod() => (); 36384+ 36385+ BindNoSync(pending_associated_receiver<NoSync> no_sync); 36386+ BindOneSync(pending_associated_receiver<OneSync> one_sync); 36387+}; 36388diff --git a/src/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl b/src/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl 36389index c4dd04adb433b..7220a25990516 36390--- a/src/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl 36391+++ b/src/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl 36392@@ -26,7 +26,12 @@ class {{export_attribute}} {{interface.name}} 36393 {%- endif %} 36394 static constexpr uint32_t Version_ = {{interface.version}}; 36395 static constexpr bool PassesAssociatedKinds_ = {% if interface|passes_associated_kinds %}true{% else %}false{% endif %}; 36396- static constexpr bool HasSyncMethods_ = {% if interface|has_sync_methods %}true{% else %}false{% endif %}; 36397+ {%- set sync_method_ordinals = interface|get_sync_method_ordinals -%} 36398+{%- if sync_method_ordinals %} 36399+ static inline constexpr uint32_t kSyncMethodOrdinals[] = { 36400+ {{sync_method_ordinals|sort|join(', \n')|indent(4)}} 36401+ }; 36402+{%- endif %} 36403 static constexpr bool HasUninterruptableMethods_ = 36404 {%- if interface|has_uninterruptable_methods %} true 36405 {%- else %} false{% endif %}; 36406diff --git a/src/mojo/public/tools/bindings/generators/cpp_templates/module-params-data.h.tmpl b/src/mojo/public/tools/bindings/generators/cpp_templates/module-params-data.h.tmpl 36407index af3bc5168beb5..ab71e91dab403 36408--- a/src/mojo/public/tools/bindings/generators/cpp_templates/module-params-data.h.tmpl 36409+++ b/src/mojo/public/tools/bindings/generators/cpp_templates/module-params-data.h.tmpl 36410@@ -17,13 +17,15 @@ 36411 #pragma clang diagnostic ignored "-Wunused-private-field" 36412 #endif 36413 36414+namespace mojo::internal { 36415+class ValidationContext; 36416+} 36417+ 36418 {%- for namespace in namespaces_as_array %} 36419 namespace {{namespace}} { 36420 {%- endfor %} 36421 namespace internal { 36422 36423-class ValidationContext; 36424- 36425 {#--- Interface parameter definitions #} 36426 {%- for interface in interfaces %} 36427 {%- for method in interface.methods %} 36428diff --git a/src/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/src/mojo/public/tools/bindings/generators/mojom_cpp_generator.py 36429index 014f2bf04da4f..add5a877cb7e3 36430--- a/src/mojo/public/tools/bindings/generators/mojom_cpp_generator.py 36431+++ b/src/mojo/public/tools/bindings/generators/mojom_cpp_generator.py 36432@@ -403,7 +403,7 @@ class Generator(generator.Generator): 36433 "get_qualified_name_for_kind": self._GetQualifiedNameForKind, 36434 "has_callbacks": mojom.HasCallbacks, 36435 "has_packed_method_ordinals": HasPackedMethodOrdinals, 36436- "has_sync_methods": mojom.HasSyncMethods, 36437+ "get_sync_method_ordinals": mojom.GetSyncMethodOrdinals, 36438 "has_uninterruptable_methods": mojom.HasUninterruptableMethods, 36439 "method_supports_lazy_serialization": 36440 self._MethodSupportsLazySerialization, 36441diff --git a/src/mojo/public/tools/mojom/mojom/generate/module.py b/src/mojo/public/tools/mojom/mojom/generate/module.py 36442index 3bba7dd285812..6f4c64645cfe2 36443--- a/src/mojo/public/tools/mojom/mojom/generate/module.py 36444+++ b/src/mojo/public/tools/mojom/mojom/generate/module.py 36445@@ -1703,11 +1703,8 @@ def MethodPassesInterfaces(method): 36446 return _AnyMethodParameterRecursive(method, IsInterfaceKind) 36447 36448 36449-def HasSyncMethods(interface): 36450- for method in interface.methods: 36451- if method.sync: 36452- return True 36453- return False 36454+def GetSyncMethodOrdinals(interface): 36455+ return [method.ordinal for method in interface.methods if method.sync] 36456 36457 36458 def HasUninterruptableMethods(interface): 36459diff --git a/src/net/android/android_http_util.cc b/src/net/android/android_http_util.cc 36460index 83f8831548faf..0a632c4ddb264 36461--- a/src/net/android/android_http_util.cc 36462+++ b/src/net/android/android_http_util.cc 36463@@ -20,9 +20,9 @@ jboolean JNI_HttpUtil_IsAllowedHeader( 36464 std::string header_name(ConvertJavaStringToUTF8(env, j_header_name)); 36465 std::string header_value(ConvertJavaStringToUTF8(env, j_header_value)); 36466 36467- return HttpUtil::IsValidHeaderName(header_name) 36468- && HttpUtil::IsSafeHeader(header_name) 36469- && HttpUtil::IsValidHeaderValue(header_value); 36470+ return HttpUtil::IsValidHeaderName(header_name) && 36471+ HttpUtil::IsSafeHeader(header_name, header_value) && 36472+ HttpUtil::IsValidHeaderValue(header_value); 36473 } 36474 36475 } // namespace net 36476diff --git a/src/net/base/features.cc b/src/net/base/features.cc 36477index f6b1c6faecdf7..ce6dd7e8b2da8 36478--- a/src/net/base/features.cc 36479+++ b/src/net/base/features.cc 36480@@ -266,5 +266,9 @@ const base::Feature kSwitchWebSocketThroughputWindow{ 36481 const base::FeatureParam<int> kRollingAverageWindow{ 36482 &kSwitchWebSocketThroughputWindow, "RollingAverageWindow", 100}; 36483 36484+const base::Feature kBlockNewForbiddenHeaders{ 36485+ "BlockNewForbiddenHeaders", 36486+ base::FEATURE_ENABLED_BY_DEFAULT}; 36487+ 36488 } // namespace features 36489 } // namespace net 36490diff --git a/src/net/base/features.h b/src/net/base/features.h 36491index 5e95b2e97ea94..251b287ebe30c 36492--- a/src/net/base/features.h 36493+++ b/src/net/base/features.h 36494@@ -393,6 +393,9 @@ NET_EXPORT extern const base::FeatureParam<int> kSmallReadBufferSize; 36495 NET_EXPORT extern const base::Feature kSwitchWebSocketThroughputWindow; 36496 NET_EXPORT extern const base::FeatureParam<int> kRollingAverageWindow; 36497 36498+// Whether to block newly added forbidden headers (https://crbug.com/1362331). 36499+NET_EXPORT extern const base::Feature kBlockNewForbiddenHeaders; 36500+ 36501 } // namespace features 36502 } // namespace net 36503 36504diff --git a/src/net/cert/cert_verify_proc.cc b/src/net/cert/cert_verify_proc.cc 36505index 34116b5814523..73eed11ec4471 36506--- a/src/net/cert/cert_verify_proc.cc 36507+++ b/src/net/cert/cert_verify_proc.cc 36508@@ -672,11 +672,6 @@ int CertVerifyProc::Verify(X509Certificate* cert, 36509 net_log.EndEvent(NetLogEventType::CERT_VERIFY_PROC, 36510 [&] { return verify_result->NetLogParams(rv); }); 36511 36512- if ((verify_result->cert_status & CERT_STATUS_COMMON_NAME_INVALID) && 36513- (verify_result->cert_status & CERT_STATUS_DEPTH_ZERO_SELF_SIGNED_CERT)) { 36514- return OK; 36515- } 36516- 36517 return rv; 36518 } 36519 36520diff --git a/src/net/cert/cert_verify_proc_ohos.cc b/src/net/cert/cert_verify_proc_ohos.cc 36521index 848203637a37a..1ef0335a1169d 36522--- a/src/net/cert/cert_verify_proc_ohos.cc 36523+++ b/src/net/cert/cert_verify_proc_ohos.cc 36524@@ -246,12 +246,9 @@ void X509CertChainVerify(const std::vector<std::string>& cert_chain, 36525 int* status, 36526 bool* is_issued_by_known_root, 36527 std::vector<std::string>* verified_chain) { 36528- *is_issued_by_known_root = true; 36529+ *is_issued_by_known_root = false; 36530 36531 *status = CertVerify(cert_chain); 36532- if (*status == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY) { 36533- *is_issued_by_known_root = false; 36534- } 36535 36536 verified_chain->assign(cert_chain.begin(), cert_chain.end()); 36537 } 36538diff --git a/src/net/http/http_util.cc b/src/net/http/http_util.cc 36539index 32948a3b46976..8a3ccab2221c2 36540--- a/src/net/http/http_util.cc 36541+++ b/src/net/http/http_util.cc 36542@@ -311,6 +311,23 @@ const char* const kForbiddenHeaderFields[] = { 36543 "via", 36544 }; 36545 36546+// A header string containing any of the following fields with a forbidden 36547+// method name in the value will cause an error. The list comes from the fetch 36548+// standard. 36549+const char* const kForbiddenHeaderFieldsWithForbiddenMethod[] = { 36550+ "x-http-method", 36551+ "x-http-method-override", 36552+ "x-method-override", 36553+}; 36554+ 36555+// The forbidden method names that is defined in the fetch standard, and used 36556+// to check the kForbiddenHeaderFileWithForbiddenMethod above. 36557+const char* const kForbiddenMethods[] = { 36558+ "connect", 36559+ "trace", 36560+ "track", 36561+}; 36562+ 36563 } // namespace 36564 36565 // static 36566@@ -325,7 +342,7 @@ bool HttpUtil::IsMethodIdempotent(base::StringPiece method) { 36567 } 36568 36569 // static 36570-bool HttpUtil::IsSafeHeader(base::StringPiece name) { 36571+bool HttpUtil::IsSafeHeader(base::StringPiece name, base::StringPiece value) { 36572 if (base::StartsWith(name, "proxy-", base::CompareCase::INSENSITIVE_ASCII) || 36573 base::StartsWith(name, "sec-", base::CompareCase::INSENSITIVE_ASCII)) 36574 return false; 36575@@ -334,6 +351,28 @@ bool HttpUtil::IsSafeHeader(base::StringPiece name) { 36576 if (base::LowerCaseEqualsASCII(name, field)) 36577 return false; 36578 } 36579+ 36580+ if (base::FeatureList::IsEnabled(features::kBlockNewForbiddenHeaders)) { 36581+ bool is_forbidden_header_fields_with_forbidden_method = false; 36582+ for (const char* field : kForbiddenHeaderFieldsWithForbiddenMethod) { 36583+ if (base::EqualsCaseInsensitiveASCII(name, field)) { 36584+ is_forbidden_header_fields_with_forbidden_method = true; 36585+ break; 36586+ } 36587+ } 36588+ if (is_forbidden_header_fields_with_forbidden_method) { 36589+ std::string value_string(value); 36590+ ValuesIterator method_iterator(value_string.begin(), value_string.end(), 36591+ ','); 36592+ while (method_iterator.GetNext()) { 36593+ base::StringPiece method = method_iterator.value_piece(); 36594+ for (const char* forbidden_method : kForbiddenMethods) { 36595+ if (base::EqualsCaseInsensitiveASCII(method, forbidden_method)) 36596+ return false; 36597+ } 36598+ } 36599+ } 36600+ } 36601 return true; 36602 } 36603 36604diff --git a/src/net/http/http_util.h b/src/net/http/http_util.h 36605index 7494ae8a8b877..f2dfd9513f25a 36606--- a/src/net/http/http_util.h 36607+++ b/src/net/http/http_util.h 36608@@ -94,11 +94,11 @@ class NET_EXPORT HttpUtil { 36609 // RFC 7231). 36610 static bool IsMethodIdempotent(base::StringPiece method); 36611 36612- // Returns true if it is safe to allow users and scripts to specify the header 36613- // named |name|. Returns true for headers not in the list at 36614- // https://fetch.spec.whatwg.org/#forbidden-header-name. Does not check header 36615- // validity. 36616- static bool IsSafeHeader(base::StringPiece name); 36617+ // Returns true if it is safe to allow users and scripts to specify a header 36618+ // with a given |name| and |value|. 36619+ // See https://fetch.spec.whatwg.org/#forbidden-request-header. 36620+ // Does not check header validity. 36621+ static bool IsSafeHeader(base::StringPiece name, base::StringPiece value); 36622 36623 // Returns true if |name| is a valid HTTP header name. 36624 static bool IsValidHeaderName(base::StringPiece name); 36625diff --git a/src/net/http/http_util_unittest.cc b/src/net/http/http_util_unittest.cc 36626index 7ba495f988cd2..fd782a65864ab 36627--- a/src/net/http/http_util_unittest.cc 36628+++ b/src/net/http/http_util_unittest.cc 36629@@ -45,9 +45,9 @@ TEST(HttpUtilTest, IsSafeHeader) { 36630 "via", 36631 }; 36632 for (size_t i = 0; i < base::size(unsafe_headers); ++i) { 36633- EXPECT_FALSE(HttpUtil::IsSafeHeader(unsafe_headers[i])) 36634+ EXPECT_FALSE(HttpUtil::IsSafeHeader(unsafe_headers[i], "")) 36635 << unsafe_headers[i]; 36636- EXPECT_FALSE(HttpUtil::IsSafeHeader(base::ToUpperASCII(unsafe_headers[i]))) 36637+ EXPECT_FALSE(HttpUtil::IsSafeHeader(base::ToUpperASCII(unsafe_headers[i]), "")) 36638 << unsafe_headers[i]; 36639 } 36640 static const char* const safe_headers[] = { 36641@@ -90,12 +90,45 @@ TEST(HttpUtilTest, IsSafeHeader) { 36642 "user-agenta", 36643 "user_agent", 36644 "viaa", 36645+ // Following 3 headers are safe if there is no forbidden method in values. 36646+ "x-http-method", 36647+ "x-http-method-override", 36648+ "x-method-override", 36649 }; 36650 for (size_t i = 0; i < base::size(safe_headers); ++i) { 36651- EXPECT_TRUE(HttpUtil::IsSafeHeader(safe_headers[i])) << safe_headers[i]; 36652- EXPECT_TRUE(HttpUtil::IsSafeHeader(base::ToUpperASCII(safe_headers[i]))) 36653+ EXPECT_TRUE(HttpUtil::IsSafeHeader(safe_headers[i], "")) << safe_headers[i]; 36654+ EXPECT_TRUE(HttpUtil::IsSafeHeader(base::ToUpperASCII(safe_headers[i]), "")) 36655 << safe_headers[i]; 36656 } 36657+ 36658+ static const char* const disallowed_with_forbidden_methods_headers[] = { 36659+ "x-http-method", 36660+ "x-http-method-override", 36661+ "x-method-override", 36662+ }; 36663+ static const struct { 36664+ const char* value; 36665+ bool is_safe; 36666+ } disallowed_values[] = {{"connect", false}, 36667+ {"trace", false}, 36668+ {"track", false}, 36669+ {"CONNECT", false}, 36670+ {"cOnnEcT", false}, 36671+ {"get", true}, 36672+ {"get,post", true}, 36673+ {"get,connect", false}, 36674+ {"get, connect", false}, 36675+ {"get,connect ", false}, 36676+ {"get,connect ,post", false}, 36677+ {"get,,,,connect", false}, 36678+ {"trace,get,PUT", false}}; 36679+ for (const auto* header : disallowed_with_forbidden_methods_headers) { 36680+ for (const auto& test_case : disallowed_values) { 36681+ EXPECT_EQ(test_case.is_safe, 36682+ HttpUtil::IsSafeHeader(header, test_case.value)) 36683+ << header << ": " << test_case.value; 36684+ } 36685+ } 36686 } 36687 36688 TEST(HttpUtilTest, HeadersIterator) { 36689diff --git a/src/ohos_nweb/BUILD.gn b/src/ohos_nweb/BUILD.gn 36690index 8570e4e3ccbc7..52efcdbabb781 36691--- a/src/ohos_nweb/BUILD.gn 36692+++ b/src/ohos_nweb/BUILD.gn 36693@@ -38,6 +38,7 @@ config("cef_nweb_config") { 36694 "//cef", 36695 "//cef/include", 36696 "//cef/libcef/browser/net_service", 36697+ "//third_party/skia" 36698 ] 36699 include_dirs += ohos_src_includes 36700 36701@@ -55,7 +56,6 @@ config("cef_nweb_config") { 36702 36703 if (product_name == "rk3568") { 36704 defines += [ 36705- "DEFAULT_PORTRAIT", 36706 "RK3568", 36707 ] 36708 } 36709@@ -102,6 +102,8 @@ component("cef_nweb") { 36710 "src/cef_delegate/nweb_geolocation_callback.h", 36711 "src/cef_delegate/nweb_handler_delegate.cc", 36712 "src/cef_delegate/nweb_handler_delegate.h", 36713+ "src/cef_delegate/nweb_history_list_impl.cc", 36714+ "src/cef_delegate/nweb_history_list_impl.h", 36715 "src/cef_delegate/nweb_input_delegate.cc", 36716 "src/cef_delegate/nweb_input_delegate.h", 36717 "src/cef_delegate/nweb_inputevent_handler.h", 36718@@ -120,6 +122,8 @@ component("cef_nweb") { 36719 "src/cef_delegate/nweb_render_handler.h", 36720 "src/cef_delegate/nweb_resource_handler.cc", 36721 "src/cef_delegate/nweb_resource_handler.h", 36722+ "src/cef_delegate/nweb_select_popup_menu_callback.cc", 36723+ "src/cef_delegate/nweb_select_popup_menu_callback.h", 36724 "src/cef_delegate/nweb_touch_handle_state_impl.cc", 36725 "src/cef_delegate/nweb_touch_handle_state_impl.h", 36726 "src/cef_delegate/nweb_web_storage_delegate.cc", 36727@@ -130,9 +134,7 @@ component("cef_nweb") { 36728 36729 deps = [ 36730 "//base:base", 36731- "//cef:libcef_dll_wrapper", 36732- "//cef:libweb_engine", 36733- "//content/public/common:static_switches", 36734+ "//content/public/common", 36735 "//ui/events/keycodes:x11", 36736 "//url", 36737 ] 36738@@ -223,19 +225,6 @@ component("nweb_sources") { 36739 libs = [ "surface.z" ] 36740 } 36741 36742-shared_library("libnweb_adapter") { 36743- configs += [ "//build/config/sanitizers:cfi_config" ] 36744- deps = [ ":nweb_sources" ] 36745- 36746- if (defined(ohos_nweb_ex) && ohos_nweb_ex) { 36747- deps += [ "//ohos_nweb_ex:nweb_ex" ] 36748- } 36749-} 36750- 36751-static_library("libohosnweb_static") { 36752- deps = [ ":nweb_sources" ] 36753-} 36754- 36755 ################################################# 36756 36757 config("ohosnweb_core_config") { 36758diff --git a/src/ohos_nweb/include/nweb.h b/src/ohos_nweb/include/nweb.h 36759index c9c3e89a90b05..586b6bd65dbfb 36760--- a/src/ohos_nweb/include/nweb.h 36761+++ b/src/ohos_nweb/include/nweb.h 36762@@ -24,21 +24,54 @@ 36763 36764 #include "nweb_download_callback.h" 36765 #include "nweb_find_callback.h" 36766- 36767+#include "nweb_history_list.h" 36768 #include "nweb_javascript_result_callback.h" 36769 #include "nweb_preference.h" 36770+#include "nweb_release_surface_callback.h" 36771 #include "nweb_value_callback.h" 36772 #include "nweb_hit_testresult.h" 36773+#include "nweb_web_message.h" 36774 36775 namespace OHOS::NWeb { 36776 class NWebHandler; 36777 36778+/** 36779+ * @brief Describes how pixel bits encoder color data. 36780+ */ 36781+enum class ImageColorType { 36782+ // Unknown color type. 36783+ COLOR_TYPE_UNKNOWN = -1, 36784+ 36785+ // RGBA with 8 bits per pixel (32bits total). 36786+ COLOR_TYPE_RGBA_8888 = 0, 36787+ 36788+ // BGRA with 8 bits per pixel (32bits total). 36789+ COLOR_TYPE_BGRA_8888 = 1, 36790+}; 36791+ 36792+/** 36793+ * @brief Describes how to interpret the alpha value of a pixel. 36794+ */ 36795+enum class ImageAlphaType { 36796+ // Unknown alpha type. 36797+ ALPHA_TYPE_UNKNOWN = -1, 36798+ 36799+ // No transparency. The alpha component is ignored. 36800+ ALPHA_TYPE_OPAQUE = 0, 36801+ 36802+ // Transparency with pre-multiplied alpha component. 36803+ ALPHA_TYPE_PREMULTIPLIED = 1, 36804+ 36805+ // Transparency with post-multiplied alpha component. 36806+ ALPHA_TYPE_POSTMULTIPLIED = 2, 36807+}; 36808 struct OHOS_NWEB_EXPORT NWebInitArgs { 36809 std::string dump_path = ""; 36810 bool frame_info_dump = false; 36811 std::list<std::string> web_engine_args_to_add; 36812 std::list<std::string> web_engine_args_to_delete; 36813 bool multi_renderer_process = false; 36814+ bool is_enhance_surface = false; 36815 }; 36816 36817 struct OHOS_NWEB_EXPORT NWebCreateInfo { 36818@@ -55,6 +88,8 @@ struct OHOS_NWEB_EXPORT NWebCreateInfo { 36819 36820 /* rs producer surface, for acquiring elgsurface from ohos */ 36821 void *producer_surface = nullptr; 36822+ 36823+ void* enhance_surface_info = nullptr; 36824 }; 36825 36826 enum class OHOS_NWEB_EXPORT DragAction { 36827@@ -73,6 +108,8 @@ struct OHOS_NWEB_EXPORT DragEvent { 36828 DragAction action; 36829 }; 36830 36831+using WebState = std::shared_ptr<std::vector<uint8_t>>; 36832+ 36833 class OHOS_NWEB_EXPORT NWeb : public std::enable_shared_from_this<NWeb> { 36834 public: 36835 NWeb() = default; 36836@@ -443,7 +480,7 @@ class OHOS_NWEB_EXPORT NWeb : public std::enable_shared_from_this<NWeb> { 36837 * @param portHandle the port to send message. 36838 * @param data the message to send. 36839 */ 36840- virtual void PostPortMessage(std::string& portHandle, std::string& data) = 0; 36841+ virtual void PostPortMessage(std::string& portHandle, std::shared_ptr<NWebMessage> data) = 0; 36842 36843 /** 36844 * set the callback of the message port. 36845@@ -452,7 +489,7 @@ class OHOS_NWEB_EXPORT NWeb : public std::enable_shared_from_this<NWeb> { 36846 * @param callback to reveive the result when the other port post message. 36847 */ 36848 virtual void SetPortMessageCallback(std::string& portHandle, 36849- std::shared_ptr<NWebValueCallback<std::string>> callback) = 0; 36850+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) = 0; 36851 36852 virtual void SendDragEvent(const DragEvent& dragEvent) const = 0; 36853 36854@@ -480,6 +517,115 @@ class OHOS_NWEB_EXPORT NWeb : public std::enable_shared_from_this<NWeb> { 36855 * @param locale the locale name of current system setting. 36856 */ 36857 virtual void UpdateLocale(const std::string& language, const std::string& region) = 0; 36858+ 36859+ /** 36860+ * Set the NWebReleaseSurfaceCallback that will receive release surface event. 36861+ * This will replace the current handler. 36862+ * 36863+ * @param releaseSurfaceListener NWebReleaseSurfaceCallback. 36864+ */ 36865+ virtual void PutReleaseSurfaceCallback( 36866+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) = 0; 36867+ 36868+ /** 36869+ * get original url of the request. 36870+ * 36871+ * @return original url. 36872+ */ 36873+ virtual const std::string GetOriginalUrl() const = 0; 36874+ 36875+ /** 36876+ * get original url of the request. 36877+ * 36878+ * @param data raw image data of the icon. 36879+ * @param width width of the icon. 36880+ * @param height height of the icon. 36881+ * @param colorType the color type of the icon. 36882+ * @param alphaType the alpha type of the icon. 36883+ * @return the result of get favicon. 36884+ */ 36885+ virtual bool GetFavicon(const void** data, size_t& width, size_t& height, 36886+ ImageColorType& c, ImageAlphaType& alphaType) = 0; 36887+ 36888+ /** 36889+ * set the network status, just notify the webview to change the JS navigatoer.online. 36890+ * 36891+ * @param available width of the icon. 36892+ */ 36893+ virtual void PutNetworkAvailable(bool available) = 0; 36894+ 36895+ /** 36896+ * web has image or not. 36897+ * 36898+ * @param callback has image or not 36899+ */ 36900+ virtual void HasImages(std::shared_ptr<NWebValueCallback<bool>> callback) = 0; 36901+ 36902+ /** 36903+ * web remove cache. 36904+ * 36905+ * @param include_disk_files bool: if false, only the RAM cache is removed 36906+ */ 36907+ virtual void RemoveCache(bool include_disk_files) = 0; 36908+ 36909+ /** 36910+ * web has image or not. 36911+ * 36912+ * @param web has image or not 36913+ */ 36914+ virtual std::shared_ptr<NWebHistoryList> GetHistoryList() = 0; 36915+ 36916+ /** 36917+ * Get web back forward state. 36918+ * 36919+ * @return web back forward state. 36920+ */ 36921+ virtual WebState SerializeWebState() = 0; 36922+ 36923+ /** 36924+ * Restore web back forward state. 36925+ * 36926+ * @param web back forward state. 36927+ */ 36928+ virtual bool RestoreWebState(WebState state) = 0; 36929+ 36930+ /** 36931+ * Move page up. 36932+ * 36933+ * @param top whether move to the top. 36934+ */ 36935+ virtual void PageUp(bool top) = 0; 36936+ 36937+ /** 36938+ * Move page down. 36939+ * 36940+ * @param bottom whether move to the bottom. 36941+ */ 36942+ virtual void PageDown(bool bottom) = 0; 36943+ 36944+ /** 36945+ * Scroll to the position. 36946+ * 36947+ * @param x horizontal coordinate. 36948+ * @param y vertical coordinate. 36949+ */ 36950+ virtual void ScrollTo(float x, float y) = 0; 36951+ 36952+ /** 36953+ * Scroll by the delta distance. 36954+ * 36955+ * @param delta_x horizontal offset. 36956+ * @param delta_y vertical offset. 36957+ */ 36958+ virtual void ScrollBy(float delta_x, float delta_y) = 0; 36959+ 36960+ /** 36961+ * Slide scroll by the speed. 36962+ * 36963+ * @param vx horizontal slide speed. 36964+ * @param vy vertical slide speed. 36965+ */ 36966+ virtual void SlideScroll(float vx, float vy) = 0; 36967 }; 36968 } // namespace OHOS::NWeb 36969 36970diff --git a/src/ohos_nweb/include/nweb_context_menu_params.h b/src/ohos_nweb/include/nweb_context_menu_params.h 36971index 197f4050d6b6f..1889d386cabf1 36972--- a/src/ohos_nweb/include/nweb_context_menu_params.h 36973+++ b/src/ohos_nweb/include/nweb_context_menu_params.h 36974@@ -38,22 +38,29 @@ public: 36975 enum ContextMenuMediaType { 36976 CM_MT_NONE, 36977 CM_MT_IMAGE, 36978- CM_MT_VIDEO, 36979- CM_MT_AUDIO, 36980- CM_MT_FILE, 36981- CM_MT_PLUGIN, 36982 }; 36983 36984 enum ContextMenuEditStateFlags { 36985 CM_ES_NONE = 0, 36986- CM_ES_CAN_UNDO = 1 << 0, 36987- CM_ES_CAN_REDO = 1 << 1, 36988- CM_ES_CAN_CUT = 1 << 2, 36989- CM_ES_CAN_COPY = 1 << 3, 36990- CM_ES_CAN_PASTE = 1 << 4, 36991- CM_ES_CAN_DELETE = 1 << 5, 36992- CM_ES_CAN_SELECT_ALL = 1 << 6, 36993- CM_ES_CAN_TRANSLATE = 1 << 7, 36994+ CM_ES_CAN_CUT = 1 << 0, 36995+ CM_ES_CAN_COPY = 1 << 1, 36996+ CM_ES_CAN_PASTE = 1 << 2, 36997+ CM_ES_CAN_SELECT_ALL = 1 << 3, 36998+ }; 36999+ 37000+ enum ContextMenuInputFieldType { 37001+ CM_IT_NONE = 0, 37002+ CM_IT_PLAINTEXT = 1, 37003+ CM_IT_PASSWORD = 2, 37004+ CM_IT_NUMBER = 3, 37005+ CM_IT_TELEPHONE = 4, 37006+ CM_IT_OTHER = 5, 37007+ }; 37008+ 37009+ enum ContextMenuSourceType { 37010+ CM_ST_NONE = 0, 37011+ CM_ST_MOUSE = 1, 37012+ CM_ST_LONG_PRESS = 2, 37013 }; 37014 37015 virtual ~NWebContextMenuParams() = default; 37016@@ -65,9 +72,9 @@ public: 37017 virtual int32_t GetContextMenuTypeFlags() = 0; 37018 37019 virtual std::string GetLinkUrl() = 0; 37020- 37021+ 37022 virtual std::string GetUnfilteredLinkUrl() = 0; 37023- 37024+ 37025 virtual std::string GetSourceUrl() = 0; 37026 37027 virtual bool HasImageContents() = 0; 37028@@ -81,6 +88,12 @@ public: 37029 virtual bool IsEditable() = 0; 37030 37031 virtual int32_t GetEditStateFlags() = 0; 37032+ 37033+ virtual ContextMenuSourceType GetSourceType() = 0; 37034+ 37035+ virtual ContextMenuInputFieldType GetInputFieldType() = 0; 37036+ 37037+ virtual std::string GetSelectionText() = 0; 37038 }; 37039 37040 class OHOS_NWEB_EXPORT NWebQuickMenuParams { 37041@@ -123,6 +136,11 @@ enum MenuEventFlags { 37042 37043 enum MenuCommandId { 37044 CI_IMAGE_COPY = 0, 37045+ CI_COPY = 1, 37046+ CI_PASTE = 2, 37047+ CI_CUT = 3, 37048+ CI_SELECT_ALL = 4, 37049+ CI_DELETE = 5, 37050 }; 37051 37052 class OHOS_NWEB_EXPORT NWebContextMenuCallback { 37053@@ -137,9 +155,9 @@ public: 37054 class OHOS_NWEB_EXPORT NWebQuickMenuCallback { 37055 public: 37056 virtual ~NWebQuickMenuCallback() = default; 37057- 37058+ 37059 virtual void Continue(int32_t commandId, MenuEventFlags flag) = 0; 37060- 37061+ 37062 virtual void Cancel() = 0; 37063 }; 37064 } 37065diff --git a/src/ohos_nweb/include/nweb_data_base.h b/src/ohos_nweb/include/nweb_data_base.h 37066index 104b7145b8f27..bbf35d382f7bc 37067--- a/src/ohos_nweb/include/nweb_data_base.h 37068+++ b/src/ohos_nweb/include/nweb_data_base.h 37069@@ -60,10 +60,12 @@ public: 37070 * 37071 * @param host the host to which the credentials apply. 37072 * @param realm the realm to which the credentials apply. 37073- * @return return an array containing username and password. 37074+ * @param username the username. 37075+ * @param password the password. 37076+ * @param passwordSize the password array size. 37077 */ 37078- virtual std::vector<std::string> GetHttpAuthCredentials(const std::string& host, 37079- const std::string& realm) const = 0; 37080+ virtual void GetHttpAuthCredentials(const std::string& host, const std::string& realm, 37081+ std::string& username, char* password, uint32_t passwordSize) const = 0; 37082 37083 /** 37084 * @brief gets whether the instance holds the specified permissions for the specified source. 37085diff --git a/src/ohos_nweb/include/nweb_handler.h b/src/ohos_nweb/include/nweb_handler.h 37086index 5685f1e717b8a..7ad6389051497 37087--- a/src/ohos_nweb/include/nweb_handler.h 37088+++ b/src/ohos_nweb/include/nweb_handler.h 37089@@ -34,43 +34,13 @@ 37090 #include "nweb_js_http_auth_result.h" 37091 #include "nweb_js_ssl_error_result.h" 37092 #include "nweb_js_ssl_select_cert_result.h" 37093+#include "nweb_select_popup_menu.h" 37094 #include "nweb_touch_handle_state.h" 37095 #include "nweb_url_resource_error.h" 37096 #include "nweb_url_resource_request.h" 37097 #include "nweb_url_resource_response.h" 37098 37099 namespace OHOS::NWeb { 37100-/** 37101- * @brief Describes how pixel bits encoder color data. 37102- */ 37103-enum class ImageColorType { 37104- // Unknown color type. 37105- COLOR_TYPE_UNKNOWN = -1, 37106- 37107- // RGBA with 8 bits per pixel (32bits total). 37108- COLOR_TYPE_RGBA_8888 = 0, 37109- 37110- // BGRA with 8 bits per pixel (32bits total). 37111- COLOR_TYPE_BGRA_8888 = 1, 37112-}; 37113- 37114-/** 37115- * @brief Describes how to interpret the alpha value of a pixel. 37116- */ 37117-enum class ImageAlphaType { 37118- // Unknown alpha type. 37119- ALPHA_TYPE_UNKNOWN = -1, 37120- 37121- // No transparency. The alpha component is ignored. 37122- ALPHA_TYPE_OPAQUE = 0, 37123- 37124- // Transparency with pre-multiplied alpha component. 37125- ALPHA_TYPE_PREMULTIPLIED = 1, 37126- 37127- // Transparency with post-multiplied alpha component. 37128- ALPHA_TYPE_POSTMULTIPLIED = 2, 37129-}; 37130- 37131 enum class RenderExitReason { 37132 // Render process non-zero exit status 37133 PROCESS_ABNORMAL_TERMINATION, 37134@@ -109,6 +79,71 @@ enum class SslError { 37135 UNTRUSTED, 37136 }; 37137 37138+// Cursor type values. 37139+enum class CursorType: int32_t { 37140+ CT_POINTER = 0, 37141+ CT_CROSS, 37142+ CT_HAND, 37143+ CT_IBEAM, 37144+ CT_WAIT, 37145+ CT_HELP, 37146+ CT_EASTRESIZE, 37147+ CT_NORTHRESIZE, 37148+ CT_NORTHEASTRESIZE, 37149+ CT_NORTHWESTRESIZE, 37150+ CT_SOUTHRESIZE, 37151+ CT_SOUTHEASTRESIZE, 37152+ CT_SOUTHWESTRESIZE, 37153+ CT_WESTRESIZE, 37154+ CT_NORTHSOUTHRESIZE, 37155+ CT_EASTWESTRESIZE, 37156+ CT_NORTHEASTSOUTHWESTRESIZE, 37157+ CT_NORTHWESTSOUTHEASTRESIZE, 37158+ CT_COLUMNRESIZE, 37159+ CT_ROWRESIZE, 37160+ CT_MIDDLEPANNING, 37161+ CT_EASTPANNING, 37162+ CT_NORTHPANNING, 37163+ CT_NORTHEASTPANNING, 37164+ CT_NORTHWESTPANNING, 37165+ CT_SOUTHPANNING, 37166+ CT_SOUTHEASTPANNING, 37167+ CT_SOUTHWESTPANNING, 37168+ CT_WESTPANNING, 37169+ CT_MOVE, 37170+ CT_VERTICALTEXT, 37171+ CT_CELL, 37172+ CT_CONTEXTMENU, 37173+ CT_ALIAS, 37174+ CT_PROGRESS, 37175+ CT_NODROP, 37176+ CT_COPY, 37177+ CT_NONE, 37178+ CT_NOTALLOWED, 37179+ CT_ZOOMIN, 37180+ CT_ZOOMOUT, 37181+ CT_GRAB, 37182+ CT_GRABBING, 37183+ CT_MIDDLE_PANNING_VERTICAL, 37184+ CT_MIDDLE_PANNING_HORIZONTAL, 37185+ CT_CUSTOM, 37186+ CT_DND_NONE, 37187+ CT_DND_MOVE, 37188+ CT_DND_COPY, 37189+ CT_DND_LINK, 37190+ CT_MAX_VALUE, 37191+}; 37192+ 37193+struct NWebCursorInfo { 37194+ int32_t width = 0; 37195+ int32_t height = 0; 37196+ int32_t x = 0; 37197+ int32_t y = 0; 37198+ float scale = 1.0; 37199+ // buff will be width*height*4 bytes in size and represents a BGRA image with an upper-left origin. 37200+ std::unique_ptr<uint8_t[]> buff = nullptr; 37201+}; 37202+ 37203 using FileSelectorCallback = NWebValueCallback<std::vector<std::string>&>; 37204 37205 class OHOS_NWEB_EXPORT NWebHandler { 37206@@ -477,6 +512,19 @@ public: 37207 * @param handler sets whether to resend data. 37208 */ 37209 virtual void OnDataResubmission(std::shared_ptr<NWebDataResubmissionCallback> handler) {} 37210+ 37211+ /** 37212+ * @brief Called when the browser's cursor has changed. 37213+ * @param type Cursor type. 37214+ * @param info If |type| is CT_CUSTOM then |info| will be populated with the custom cursor information. 37215+ * @return True if the cursor change was handled or false for default handling. 37216+ */ 37217+ virtual bool OnCursorChange(const CursorType& type, const NWebCursorInfo& info) { 37218+ return false; 37219+ } 37220+ 37221+ virtual void OnSelectPopupMenu(std::shared_ptr<NWebSelectPopupMenuParam> params, 37222+ std::shared_ptr<NWebSelectPopupMenuCallback> callback) {} 37223 }; 37224 } // namespace OHOS::NWeb 37225 37226diff --git a/src/ohos_nweb/include/nweb_history_list.h b/src/ohos_nweb/include/nweb_history_list.h 37227new file mode 100755 37228index 0000000000000..6e1df7c562bb1 37229--- /dev/null 37230+++ b/src/ohos_nweb/include/nweb_history_list.h 37231@@ -0,0 +1,51 @@ 37232+/* 37233+ * Copyright (c) 2022 Huawei Device Co., Ltd. 37234+ * Licensed under the Apache License, Version 2.0 (the "License"); 37235+ * you may not use this file except in compliance with the License. 37236+ * You may obtain a copy of the License at 37237+ * 37238+ * http://www.apache.org/licenses/LICENSE-2.0 37239+ * 37240+ * Unless required by applicable law or agreed to in writing, software 37241+ * distributed under the License is distributed on an "AS IS" BASIS, 37242+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 37243+ * See the License for the specific language governing permissions and 37244+ * limitations under the License. 37245+ */ 37246+ 37247+#ifndef NWEB_HISTORY_LIST_H 37248+#define NWEB_HISTORY_LIST_H 37249+ 37250+#include <memory> 37251+#include <string> 37252+#include "nweb_export.h" 37253+ 37254+namespace OHOS::NWeb { 37255+enum class ImageColorType; 37256+enum class ImageAlphaType; 37257+class OHOS_NWEB_EXPORT NWebHistoryItem { 37258+public: 37259+ virtual ~NWebHistoryItem() = default; 37260+ 37261+ virtual std::string GetHistoryRawUrl() = 0; 37262+ 37263+ virtual std::string GetHistoryTitle() = 0; 37264+ 37265+ virtual std::string GetHistoryUrl() = 0; 37266+ 37267+ virtual bool GetFavicon(void** data, int& width, int& height, 37268+ ImageColorType& colorType, ImageAlphaType& alphaType) = 0; 37269+}; 37270+ 37271+class OHOS_NWEB_EXPORT NWebHistoryList { 37272+public: 37273+ virtual ~NWebHistoryList() = default; 37274+ 37275+ virtual int32_t GetCurrentIndex() = 0; 37276+ 37277+ virtual std::shared_ptr<NWebHistoryItem> GetItem(int32_t index) = 0; 37278+ 37279+ virtual int32_t GetListSize() = 0; 37280+}; 37281+} 37282+#endif 37283\ No newline at end of file 37284diff --git a/src/ohos_nweb/include/nweb_preference.h b/src/ohos_nweb/include/nweb_preference.h 37285index 11cf96bb8db23..36b1ecac418f4 37286--- a/src/ohos_nweb/include/nweb_preference.h 37287+++ b/src/ohos_nweb/include/nweb_preference.h 37288@@ -118,11 +118,11 @@ public: 37289 virtual void PutFixedFontFamilyName(std::string font) = 0; 37290 37291 /** 37292- * Enables or disables the force dark mode for this WebView. 37293+ * Enables or disables the force dark mode for this NWeb. 37294 * 37295- * @param forceDark true if set the force dark mode for this WebView. 37296+ * @param forceDark True if set the force dark mode enabled for this NWeb. 37297 */ 37298- virtual void PutDarkModeEnabled(int forceDark) = 0; 37299+ virtual void PutForceDarkModeEnabled(int forceDark) = 0; 37300 37301 /** 37302 * Put whether JavaScript can open windows by JavaScript. This applies to the 37303@@ -372,11 +372,11 @@ public: 37304 virtual std::string FixedFontFamilyName() = 0; 37305 37306 /** 37307- * Get if the dark mode for this WebView is supported. 37308+ * Get whether the force dark mode is enabled for this NWeb. 37309 * 37310- * @see PutDarkModeEnabled 37311+ * @see PutForceDarkModeEnabled 37312 */ 37313- virtual int DarkModeEnabled() = 0; 37314+ virtual int ForceDarkModeEnabled() = 0; 37315 37316 /** 37317 * Get if JavaScript can open windows. 37318@@ -516,6 +516,44 @@ public: 37319 * @see PutMultiWindowAccess 37320 */ 37321 virtual bool IsMultiWindowAccess() = 0; 37322+ 37323+ /** 37324+ * Enables or disables the dark mode prefer-color-scheme for this NWeb. 37325+ * 37326+ * @param darkScheme True if set the dark mode prefer-color-scheme enabled for this NWeb. 37327+ */ 37328+ virtual void PutDarkSchemeEnabled(int darkScheme) = 0; 37329+ 37330+ /** 37331+ * Get whether the dark mode prefer-color-scheme is enabled for this NWeb. 37332+ * 37333+ * @see PutDarkSchemeEnabled 37334+ */ 37335+ virtual int DarkSchemeEnabled() = 0; 37336+ 37337+ /** 37338+ * Get whether enable horizontal scroll bar. 37339+ * 37340+ * @see PutHorizontalScrollBarAccess 37341+ */ 37342+ virtual bool IsHorizontalScrollBarAccess() = 0; 37343+ 37344+ /** 37345+ * Get whether enable vertical scroll bar. 37346+ * 37347+ * @see PutVerticalScrollBarAccess 37348+ */ 37349+ virtual bool IsVerticalScrollBarAccess() = 0; 37350+ 37351+ /** 37352+ * Put whether enable horizontal scroll bar, default value is false. 37353+ */ 37354+ virtual void PutHorizontalScrollBarAccess(bool flag) = 0; 37355+ 37356+ /** 37357+ * Put whether enable vertical scroll bar, default value is false. 37358+ */ 37359+ virtual void PutVerticalScrollBarAccess(bool flag) = 0; 37360 }; 37361 } // namespace OHOS::NWeb 37362 #endif // NWEB_PREFERENCE_H 37363diff --git a/src/ohos_nweb/include/nweb_release_surface_callback.h b/src/ohos_nweb/include/nweb_release_surface_callback.h 37364new file mode 100644 37365index 0000000000000..90e01cb375c42 37366--- /dev/null 37367+++ b/src/ohos_nweb/include/nweb_release_surface_callback.h 37368@@ -0,0 +1,34 @@ 37369+/* 37370+ * Copyright (c) 2022 Huawei Device Co., Ltd. 37371+ * Licensed under the Apache License, Version 2.0 (the "License"); 37372+ * you may not use this file except in compliance with the License. 37373+ * You may obtain a copy of the License at 37374+ * 37375+ * http://www.apache.org/licenses/LICENSE-2.0 37376+ * 37377+ * Unless required by applicable law or agreed to in writing, software 37378+ * distributed under the License is distributed on an "AS IS" BASIS, 37379+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 37380+ * See the License for the specific language governing permissions and 37381+ * limitations under the License. 37382+ */ 37383+ 37384+#ifndef NWEB_RELEASE_SURFACE_CALLBACK_H 37385+#define NWEB_RELEASE_SURFACE_CALLBACK_H 37386+ 37387+#include <string> 37388+ 37389+#include "nweb_export.h" 37390+ 37391+namespace OHOS::NWeb { 37392+class OHOS_NWEB_EXPORT NWebReleaseSurfaceCallback { 37393+public: 37394+ NWebReleaseSurfaceCallback() = default; 37395+ 37396+ virtual ~NWebReleaseSurfaceCallback() = default; 37397+ 37398+ virtual void ReleaseSurface() = 0; 37399+}; 37400+} // namespace OHOS::NWeb 37401+ 37402+#endif // NWEB_RELEASE_SURFACE_CALLBACK_H 37403\ No newline at end of file 37404diff --git a/src/ohos_nweb/include/nweb_select_popup_menu.h b/src/ohos_nweb/include/nweb_select_popup_menu.h 37405new file mode 100644 37406index 0000000000000..5ec65542e7ba0 37407--- /dev/null 37408+++ b/src/ohos_nweb/include/nweb_select_popup_menu.h 37409@@ -0,0 +1,76 @@ 37410+/* 37411+ * Copyright (c) 2023 Huawei Device Co., Ltd. 37412+ * Licensed under the Apache License, Version 2.0 (the "License"); 37413+ * you may not use this file except in compliance with the License. 37414+ * You may obtain a copy of the License at 37415+ * 37416+ * http://www.apache.org/licenses/LICENSE-2.0 37417+ * 37418+ * Unless required by applicable law or agreed to in writing, software 37419+ * distributed under the License is distributed on an "AS IS" BASIS, 37420+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 37421+ * See the License for the specific language governing permissions and 37422+ * limitations under the License. 37423+ */ 37424+ 37425+#ifndef NWEB_SELECT_POPUP_MENU_H 37426+#define NWEB_SELECT_POPUP_MENU_H 37427+ 37428+#include <memory> 37429+#include <string> 37430+#include <vector> 37431+ 37432+namespace OHOS::NWeb { 37433+ 37434+struct SelectMenuBound { 37435+ int x = -1; 37436+ int y = -1; 37437+ int width = -1; 37438+ int height = -1; 37439+}; 37440+ 37441+enum SelectPopupMenuItemType { 37442+ SP_OPTION, 37443+ SP_CHECKABLE_OPTION, 37444+ SP_GROUP, 37445+ SP_SEPARATOR, 37446+ SP_SUBMENU, 37447+}; 37448+ 37449+enum TextDirection { 37450+ SP_UNKNOWN, 37451+ SP_RTL, 37452+ SP_LTR, 37453+}; 37454+ 37455+struct SelectPopupMenuItem { 37456+ std::string label = ""; 37457+ std::string toolTip = ""; 37458+ SelectPopupMenuItemType type = SP_OPTION; 37459+ uint32_t action = 0; 37460+ TextDirection textDirection = SP_UNKNOWN; 37461+ bool enabled = false; 37462+ bool hasTextDirectionOverride = false; 37463+ bool checked = false; 37464+}; 37465+ 37466+struct NWebSelectPopupMenuParam { 37467+ SelectMenuBound bounds; 37468+ int itemHeight = -1; 37469+ double itemFontSize = -1; 37470+ int selectedItem = -1; 37471+ std::vector<SelectPopupMenuItem> menuItems; 37472+ bool rightAligned = false; 37473+ bool allowMultipleSelection = false; 37474+}; 37475+ 37476+class NWebSelectPopupMenuCallback { 37477+public: 37478+ virtual ~NWebSelectPopupMenuCallback() = default; 37479+ 37480+ virtual void Continue(const std::vector<int32_t>& indices) = 0; 37481+ 37482+ virtual void Cancel() = 0; 37483+}; 37484+} 37485+#endif 37486\ No newline at end of file 37487diff --git a/src/ohos_nweb/include/nweb_web_message.h b/src/ohos_nweb/include/nweb_web_message.h 37488new file mode 100755 37489index 0000000000000..1d5abfea195c0 37490--- /dev/null 37491+++ b/src/ohos_nweb/include/nweb_web_message.h 37492@@ -0,0 +1,45 @@ 37493+/* 37494+ * Copyright (c) 2022 Huawei Device Co., Ltd. 37495+ * Licensed under the Apache License, Version 2.0 (the "License"); 37496+ * you may not use this file except in compliance with the License. 37497+ * You may obtain a copy of the License at 37498+ * 37499+ * http://www.apache.org/licenses/LICENSE-2.0 37500+ * 37501+ * Unless required by applicable law or agreed to in writing, software 37502+ * distributed under the License is distributed on an "AS IS" BASIS, 37503+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 37504+ * See the License for the specific language governing permissions and 37505+ * limitations under the License. 37506+ */ 37507+ 37508+#ifndef NWEB_WEB_MESSAGE_H_ 37509+#define NWEB_WEB_MESSAGE_H_ 37510+ 37511+#include <vector> 37512+ 37513+#include "nweb_value.h" 37514+#include "nweb_export.h" 37515+ 37516+namespace OHOS::NWeb { 37517+class OHOS_NWEB_EXPORT NWebMessage : public NWebValue { 37518+public: 37519+ explicit NWebMessage(NWebValue::Type type) : NWebValue(type){} 37520+ 37521+ ~NWebMessage() = default; 37522+ 37523+ void SetBinary(std::vector<uint8_t>& binary_data) { 37524+ binary_data_.reserve(binary_data.size()); 37525+ binary_data_ = binary_data; 37526+ } 37527+ 37528+ std::vector<uint8_t> GetBinary() { 37529+ return binary_data_; 37530+ } 37531+ 37532+private: 37533+ std::vector<uint8_t> binary_data_; 37534+}; 37535+} 37536+ 37537+#endif // NWEB_WEB_MESSAGE_H_ 37538diff --git a/src/ohos_nweb/src/capi/nweb_app_client_extension_callback.h b/src/ohos_nweb/src/capi/nweb_app_client_extension_callback.h 37539index cbd38e98a8012..35b01bd6fdda0 37540--- a/src/ohos_nweb/src/capi/nweb_app_client_extension_callback.h 37541+++ b/src/ohos_nweb/src/capi/nweb_app_client_extension_callback.h 37542@@ -18,20 +18,16 @@ 37543 37544 #include <stddef.h> 37545 37546-#include "nweb_capi_export.h" 37547- 37548-struct NWEB_CAPI_EXPORT NWebReceivedIconInfo { 37549- const char* image_url; 37550- size_t width; 37551- size_t height; 37552- int color_type{0}; 37553- int alpha_type{0}; 37554-}; 37555- 37556-struct NWEB_CAPI_EXPORT NWebAppClientExtensionCallback { 37557- int NWebID{0}; 37558- void (*OnReceivedFaviconUrl)(const NWebReceivedIconInfo&, int); 37559- void (*OnLoadStarted)(bool toDifferentDocument, int); 37560+struct NWebAppClientExtensionCallback { 37561+ size_t struct_size = sizeof(NWebAppClientExtensionCallback); 37562+ int nweb_id{0}; 37563+ void (*OnReceivedFaviconUrl)(const char* image_url, 37564+ size_t width, 37565+ size_t height, 37566+ int color_type, 37567+ int alpha_type, 37568+ int nweb_id); 37569+ void (*OnLoadStarted)(bool toDifferentDocument, int nweb_id); 37570 }; 37571 37572 #endif // OHOS_NWEB_SRC_NWEB_APP_CLIENT_EXTENSION_CALLBACK_H_ 37573diff --git a/src/ohos_nweb/src/cef_delegate/nweb_application.cc b/src/ohos_nweb/src/cef_delegate/nweb_application.cc 37574index fd5fe3764e34e..7ccdf5c0fbdd1 37575--- a/src/ohos_nweb/src/cef_delegate/nweb_application.cc 37576+++ b/src/ohos_nweb/src/cef_delegate/nweb_application.cc 37577@@ -17,8 +17,12 @@ 37578 37579 #include <cstdlib> 37580 #include <thread> 37581-#include "base/base_switches.h" 37582+ 37583+#include "cef/include/wrapper/cef_closure_task.h" 37584 #include "cef/include/wrapper/cef_helpers.h" 37585+#include "content/public/browser/browser_task_traits.h" 37586+#include "content/public/browser/browser_thread.h" 37587+#include "content/public/common/content_switches.h" 37588 #include "nweb_handler_delegate.h" 37589 37590 namespace OHOS::NWeb { 37591@@ -47,6 +51,47 @@ NWebApplication::GetBrowserProcessHandler() { 37592 CefRefPtr<CefRenderProcessHandler> NWebApplication::GetRenderProcessHandler() { 37593 return this; 37594 } 37595+ 37596+std::vector<std::string> NWebApplication::CustomSchemeCmdLineSplit(std::string str, const char split) 37597+{ 37598+ std::istringstream inStream(str); 37599+ std::vector<std::string> ret; 37600+ std::string token; 37601+ while (getline(inStream, token, split)) { 37602+ if (!token.empty()) { 37603+ ret.push_back(token); 37604+ token.clear(); 37605+ } 37606+ } 37607+ return ret; 37608+} 37609+ 37610+void NWebApplication::OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar) 37611+{ 37612+ LOG(INFO) << "OnRegisterCustomSchemes"; 37613+ CefRefPtr<CefCommandLine> command_line = CefCommandLine::GetGlobalCommandLine(); 37614+ if (command_line->HasSwitch(::switches::kOhosCustomScheme)) { 37615+ std::string cmdline_scheme = command_line->GetSwitchValue(::switches::kOhosCustomScheme).ToString(); 37616+ LOG(INFO) << "cmdline scheme:" << cmdline_scheme; 37617+ std::vector<std::string> schemesInfo = CustomSchemeCmdLineSplit(cmdline_scheme, ';'); 37618+ for (auto it = schemesInfo.begin(); it != schemesInfo.end(); ++it) { 37619+ int options = 0; 37620+ std::vector<std::string> scheme = CustomSchemeCmdLineSplit(*it, ','); 37621+ if (scheme.size() != 3) { 37622+ break; 37623+ } 37624+ if (scheme[1] == std::string("1")) { 37625+ options = (options | CEF_SCHEME_OPTION_CORS_ENABLED); 37626+ } 37627+ 37628+ if (scheme[2] == std::string("1")) { 37629+ options = (options | CEF_SCHEME_OPTION_FETCH_ENABLED); 37630+ } 37631+ LOG(INFO) << "scheme name:" << *it << " scheme options:" << options; 37632+ registrar->AddCustomScheme(scheme[0], options); 37633+ } 37634+ } 37635+} 37636 /* CefApp methods end */ 37637 37638 /* CefBrowserProcessHandler methods begin */ 37639@@ -54,9 +99,32 @@ void NWebApplication::OnContextInitialized() { 37640 LOG(INFO) << "NWebApplication::OnContextInitialized"; 37641 CEF_REQUIRE_UI_THREAD(); 37642 CreateBrowser(); 37643+ auto runWebInitedCallback = OhosAdapterHelper::GetInstance().GetInitWebAdapter()->GetRunWebInitedCallback(); 37644+ content::GetUIThreadTaskRunner({})->PostTask( 37645+ FROM_HERE, base::BindOnce(&NWebApplication::RunWebInitedCallback, this, 37646+ runWebInitedCallback)); 37647 37648 OnContextInitializedInternal(); 37649 } 37650+ 37651+void NWebApplication::RunWebInitedCallback(WebRunInitedCallback* callback) 37652+{ 37653+ if (callback != nullptr) { 37654+ callback->RunInitedCallback(); 37655+ delete callback; 37656+ callback = nullptr; 37657+ } else { 37658+ LOG(ERROR) << "There is no web inited callback to run."; 37659+ } 37660+} 37661+ 37662+void NWebApplication::OnBeforeChildProcessLaunch(CefRefPtr<CefCommandLine> command_line) 37663+{ 37664+ LOG(INFO) << "NWebApplication::OnBeforeChildProcessLaunch"; 37665+ if (CefCommandLine::GetGlobalCommandLine()->HasSwitch(::switches::kOhosCustomScheme)) { 37666+ command_line->AppendSwitchWithValue(::switches::kOhosCustomScheme, CefCommandLine::GetGlobalCommandLine()->GetSwitchValue(::switches::kOhosCustomScheme).ToString()); 37667+ } 37668+} 37669 /* CefBrowserProcessHandler methods end */ 37670 37671 /* CefRenderProcessHandler methods begin */ 37672diff --git a/src/ohos_nweb/src/cef_delegate/nweb_application.h b/src/ohos_nweb/src/cef_delegate/nweb_application.h 37673index ec4f9c7de34ae..efea770609cba 37674--- a/src/ohos_nweb/src/cef_delegate/nweb_application.h 37675+++ b/src/ohos_nweb/src/cef_delegate/nweb_application.h 37676@@ -20,6 +20,7 @@ 37677 #include "cef/include/cef_app.h" 37678 #include "nweb_handler_delegate.h" 37679 #include "nweb_preference_delegate.h" 37680+#include "ohos_adapter_helper.h" 37681 37682 namespace OHOS::NWeb { 37683 namespace switches { 37684@@ -41,11 +42,13 @@ class NWebApplication : public CefApp, 37685 /* CefApp methods begine */ 37686 CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override; 37687 CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override; 37688+ void OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar) override; 37689 /* CefApp methods end */ 37690 37691 /* CefBrowserProcessHandler methods begin */ 37692 void OnContextInitialized() override; 37693 CefRefPtr<CefClient> GetDefaultClient() override; 37694+ void OnBeforeChildProcessLaunch(CefRefPtr<CefCommandLine> command_line) override; 37695 std::string GetURL(); 37696 /* CefBrowserProcessHandler methods end */ 37697 37698@@ -60,6 +63,9 @@ class NWebApplication : public CefApp, 37699 CefBrowserSettings& browser_settings); 37700 37701 void OnContextInitializedInternal(); 37702+ std::vector<std::string> CustomSchemeCmdLineSplit(std::string str, const char split); 37703+ 37704+ void RunWebInitedCallback(WebRunInitedCallback* callback); 37705 37706 std::shared_ptr<NWebPreferenceDelegate> preference_delegate_ = nullptr; 37707 std::string url_; 37708diff --git a/src/ohos_nweb/src/cef_delegate/nweb_context_menu_params_impl.cc b/src/ohos_nweb/src/cef_delegate/nweb_context_menu_params_impl.cc 37709index 803a2571a8968..1c017e25a5af8 37710--- a/src/ohos_nweb/src/cef_delegate/nweb_context_menu_params_impl.cc 37711+++ b/src/ohos_nweb/src/cef_delegate/nweb_context_menu_params_impl.cc 37712@@ -23,7 +23,10 @@ namespace { 37713 using CmTf = NWebContextMenuParams::ContextMenuTypeFlags; 37714 using CmMt = NWebContextMenuParams::ContextMenuMediaType; 37715 using CmEf = NWebContextMenuParams::ContextMenuEditStateFlags; 37716+using CmIt = NWebContextMenuParams::ContextMenuInputFieldType; 37717+using CmSt = NWebContextMenuParams::ContextMenuSourceType; 37718 using QmEf = NWebQuickMenuParams::QuickMenuEditStateFlags; 37719+ 37720 const std::unordered_map<int, int> kCmTypeFlagMap = { 37721 {CM_TYPEFLAG_NONE, CmTf::CM_TF_NONE}, 37722 {CM_TYPEFLAG_PAGE, CmTf::CM_TF_PAGE}, 37723@@ -37,22 +40,18 @@ const std::unordered_map<int, int> kCmTypeFlagMap = { 37724 const std::unordered_map<int, int> kCmMediaTypeMap = { 37725 {CM_MEDIATYPE_NONE, CmMt::CM_MT_NONE}, 37726 {CM_MEDIATYPE_IMAGE, CmMt::CM_MT_IMAGE}, 37727- {CM_MEDIATYPE_VIDEO, CmMt::CM_MT_VIDEO}, 37728- {CM_MEDIATYPE_AUDIO, CmMt::CM_MT_AUDIO}, 37729- {CM_MEDIATYPE_FILE, CmMt::CM_MT_FILE}, 37730- {CM_MEDIATYPE_PLUGIN, CmMt::CM_MT_PLUGIN}, 37731+ {CM_MEDIATYPE_VIDEO, CmMt::CM_MT_NONE}, 37732+ {CM_MEDIATYPE_AUDIO, CmMt::CM_MT_NONE}, 37733+ {CM_MEDIATYPE_FILE, CmMt::CM_MT_NONE}, 37734+ {CM_MEDIATYPE_PLUGIN, CmMt::CM_MT_NONE}, 37735 }; 37736 37737 const std::unordered_map<int, int> kCmEditStateFlagsMap = { 37738 {CM_EDITFLAG_NONE, CmEf::CM_ES_NONE}, 37739- {CM_EDITFLAG_CAN_UNDO, CmEf::CM_ES_CAN_UNDO}, 37740- {CM_EDITFLAG_CAN_REDO, CmEf::CM_ES_CAN_REDO}, 37741 {CM_EDITFLAG_CAN_CUT, CmEf::CM_ES_CAN_CUT}, 37742 {CM_EDITFLAG_CAN_COPY, CmEf::CM_ES_CAN_COPY}, 37743 {CM_EDITFLAG_CAN_PASTE, CmEf::CM_ES_CAN_PASTE}, 37744- {CM_EDITFLAG_CAN_DELETE, CmEf::CM_ES_CAN_DELETE}, 37745 {CM_EDITFLAG_CAN_SELECT_ALL, CmEf::CM_ES_CAN_SELECT_ALL}, 37746- {CM_EDITFLAG_CAN_TRANSLATE, CmEf::CM_ES_CAN_TRANSLATE}, 37747 }; 37748 37749 const std::unordered_map<int, int> kQmEditStateFlagsMap = { 37750@@ -77,6 +76,34 @@ const std::unordered_map<int, int> KMenuEventFlagsMap = { 37751 37752 const std::unordered_map<int32_t, cef_menu_id_t> KMenuCommandIdMap = { 37753 {CI_IMAGE_COPY, MENU_ID_IMAGE_COPY}, 37754+ {CI_CUT, MENU_ID_CUT}, 37755+ {CI_COPY, MENU_ID_COPY}, 37756+ {CI_PASTE, MENU_ID_PASTE}, 37757+ {CI_DELETE, MENU_ID_DELETE}, 37758+ {CI_SELECT_ALL, MENU_ID_SELECT_ALL}, 37759+}; 37760+ 37761+const std::unordered_map<int, int> kCmInputFieldTypeMap = { 37762+ {CM_INPUTFIELDTYPE_NONE, CmIt::CM_IT_NONE}, 37763+ {CM_INPUTFIELDTYPE_PLAINTEXT, CmIt::CM_IT_PLAINTEXT}, 37764+ {CM_INPUTFIELDTYPE_PASSWORD, CmIt::CM_IT_PASSWORD}, 37765+ {CM_INPUTFIELDTYPE_NUMBER, CmIt::CM_IT_NUMBER}, 37766+ {CM_INPUTFIELDTYPE_TELEPHONE, CmIt::CM_IT_TELEPHONE}, 37767+ {CM_INPUTFIELDTYPE_OTHER, CmIt::CM_IT_OTHER}, 37768+}; 37769+ 37770+const std::unordered_map<int, int> kCmSourceTypeMap = { 37771+ {CM_SOURCETYPE_NONE, CmSt::CM_ST_NONE}, 37772+ {CM_SOURCETYPE_MOUSE, CmSt::CM_ST_MOUSE}, 37773+ {CM_SOURCETYPE_KEYBOARD, CmSt::CM_ST_NONE}, 37774+ {CM_SOURCETYPE_TOUCH, CmSt::CM_ST_NONE}, 37775+ {CM_SOURCETYPE_TOUCH_EDIT_MENU, CmSt::CM_ST_NONE}, 37776+ {CM_SOURCETYPE_LONG_PRESS, CmSt::CM_ST_LONG_PRESS}, 37777+ {CM_SOURCETYPE_LONG_TAP, CmSt::CM_ST_NONE}, 37778+ {CM_SOURCETYPE_TOUCH_HANDLE, CmSt::CM_ST_NONE}, 37779+ {CM_SOURCETYPE_STYLUS, CmSt::CM_ST_NONE}, 37780+ {CM_SOURCETYPE_ADJUST_SELECTION, CmSt::CM_ST_NONE}, 37781+ {CM_SOURCETYPE_SELECTION_RESET, CmSt::CM_ST_NONE}, 37782 }; 37783 37784 cef_menu_id_t ConvertCommandId(int32_t id) { 37785@@ -101,14 +128,32 @@ int32_t ConvertMenuFlags(int32_t value, 37786 37787 CmMt ConvertContextMenuMediaType( 37788 CefContextMenuParams::MediaType value) { 37789- std::unordered_map<int, int>::const_iterator iter = 37790+ std::unordered_map<int, int>::const_iterator iter = 37791 kCmMediaTypeMap.find(static_cast<int32_t>(value)); 37792 if (iter != kCmMediaTypeMap.end()) { 37793 return static_cast<CmMt>(iter->second); 37794 } 37795 return CmMt::CM_MT_NONE; 37796 } 37797+ 37798+CmIt ConvertContextMenuInputFieldType(CefContextMenuParams::InputFieldType value) { 37799+ std::unordered_map<int, int>::const_iterator iter = 37800+ kCmInputFieldTypeMap.find(static_cast<int32_t>(value)); 37801+ if (iter != kCmInputFieldTypeMap.end()) { 37802+ return static_cast<CmIt>(iter->second); 37803+ } 37804+ return CmIt::CM_IT_NONE; 37805+} 37806+ 37807+CmSt ConvertContextMenuSourceType(CefContextMenuParams::SourceType value) { 37808+ std::unordered_map<int, int>::const_iterator iter = 37809+ kCmSourceTypeMap.find(static_cast<int32_t>(value)); 37810+ if (iter != kCmSourceTypeMap.end()) { 37811+ return static_cast<CmSt>(iter->second); 37812+ } 37813+ return CmSt::CM_ST_NONE; 37814 } 37815+} // namespace end 37816 37817 namespace OHOS::NWeb { 37818 NWebContextMenuParamsImpl::NWebContextMenuParamsImpl( 37819@@ -141,14 +186,14 @@ std::string NWebContextMenuParamsImpl::GetLinkUrl() { 37820 } 37821 return std::string(); 37822 } 37823- 37824+ 37825 std::string NWebContextMenuParamsImpl::GetUnfilteredLinkUrl() { 37826 if (params_ != nullptr) { 37827 return params_->GetUnfilteredLinkUrl().ToString(); 37828 } 37829 return std::string(); 37830 } 37831- 37832+ 37833 std::string NWebContextMenuParamsImpl::GetSourceUrl() { 37834 if (params_ != nullptr) { 37835 return params_->GetSourceUrl().ToString(); 37836@@ -165,14 +210,14 @@ bool NWebContextMenuParamsImpl::HasImageContents() { 37837 37838 std::string NWebContextMenuParamsImpl::GetTitleText() { 37839 if (params_ != nullptr) { 37840- return params_->GetTitleText(); 37841+ return params_->GetTitleText().ToString(); 37842 } 37843 return std::string(); 37844 } 37845 37846 std::string NWebContextMenuParamsImpl::GetPageUrl() { 37847 if (params_ != nullptr) { 37848- return params_->GetPageUrl(); 37849+ return params_->GetPageUrl().ToString(); 37850 } 37851 return std::string(); 37852 } 37853@@ -186,9 +231,10 @@ CmMt NWebContextMenuParamsImpl::GetMediaType() { 37854 37855 bool NWebContextMenuParamsImpl::IsEditable() { 37856 if (params_ != nullptr) { 37857- return params_->HasImageContents(); 37858+ return params_->IsEditable(); 37859 } 37860- return params_->IsEditable(); 37861+ 37862+ return false; 37863 } 37864 37865 int32_t NWebContextMenuParamsImpl::GetEditStateFlags() { 37866@@ -198,6 +244,27 @@ int32_t NWebContextMenuParamsImpl::GetEditStateFlags() { 37867 return 0; 37868 } 37869 37870+CmIt NWebContextMenuParamsImpl::GetInputFieldType() { 37871+ if (params_ != nullptr) { 37872+ return ConvertContextMenuInputFieldType(params_->GetInputFieldType()); 37873+ } 37874+ return CmIt::CM_IT_NONE; 37875+} 37876+ 37877+CmSt NWebContextMenuParamsImpl::GetSourceType() { 37878+ if (params_ != nullptr) { 37879+ return ConvertContextMenuSourceType(params_->GetSourceType()); 37880+ } 37881+ return CmSt::CM_ST_NONE; 37882+} 37883+ 37884+std::string NWebContextMenuParamsImpl::GetSelectionText() 37885+{ 37886+ if (params_ != nullptr) { 37887+ return params_->GetSelectionText().ToString(); 37888+ } 37889+ return std::string(); 37890+} 37891 NWebQuickMenuParamsImpl::NWebQuickMenuParamsImpl( 37892 int32_t x, int32_t y, int32_t width, int32_t height, int32_t flags) 37893 : x_(x), y_(y), width_(width), height_(height), 37894@@ -262,7 +329,7 @@ NWebContextMenuCallbackImpl::NWebContextMenuCallbackImpl( 37895 void NWebContextMenuCallbackImpl::Continue( 37896 int32_t commandId, MenuEventFlags flag) { 37897 if (callback_ != nullptr) { 37898- int32_t event_flag = 37899+ int32_t event_flag = 37900 ConvertMenuFlags(static_cast<int32_t>(flag), KMenuEventFlagsMap); 37901 callback_->Continue(ConvertCommandId(commandId), 37902 static_cast<cef_event_flags_t>(event_flag)); 37903@@ -281,7 +348,7 @@ NWebQuickMenuCallbackImpl::NWebQuickMenuCallbackImpl( 37904 void NWebQuickMenuCallbackImpl::Continue( 37905 int32_t commandId, MenuEventFlags flag) { 37906 if (callback_ != nullptr) { 37907- int32_t event_flag = 37908+ int32_t event_flag = 37909 ConvertMenuFlags(static_cast<int32_t>(flag), KMenuEventFlagsMap); 37910 callback_->Continue(commandId, 37911 static_cast<cef_event_flags_t>(event_flag)); 37912diff --git a/src/ohos_nweb/src/cef_delegate/nweb_context_menu_params_impl.h b/src/ohos_nweb/src/cef_delegate/nweb_context_menu_params_impl.h 37913index 0ea7e5d7d0b08..5855f7176a537 37914--- a/src/ohos_nweb/src/cef_delegate/nweb_context_menu_params_impl.h 37915+++ b/src/ohos_nweb/src/cef_delegate/nweb_context_menu_params_impl.h 37916@@ -37,7 +37,9 @@ class NWebContextMenuParamsImpl : public NWebContextMenuParams { 37917 ContextMenuMediaType GetMediaType() override; 37918 bool IsEditable() override; 37919 int32_t GetEditStateFlags() override; 37920- 37921+ ContextMenuInputFieldType GetInputFieldType() override; 37922+ ContextMenuSourceType GetSourceType() override; 37923+ std::string GetSelectionText() override; 37924 private: 37925 CefRefPtr<CefContextMenuParams> params_; 37926 }; 37927diff --git a/src/ohos_nweb/src/cef_delegate/nweb_data_base_delegate.cc b/src/ohos_nweb/src/cef_delegate/nweb_data_base_delegate.cc 37928index 08c3c2cfe3e76..48bf4d81b4377 37929--- a/src/ohos_nweb/src/cef_delegate/nweb_data_base_delegate.cc 37930+++ b/src/ohos_nweb/src/cef_delegate/nweb_data_base_delegate.cc 37931@@ -54,20 +54,16 @@ void NWebDataBaseDelegate::SaveHttpAuthCredentials(const std::string& host, 37932 data_base->SaveHttpAuthCredentials(host, realm,username, password); 37933 } 37934 37935-std::vector<std::string> NWebDataBaseDelegate::GetHttpAuthCredentials(const std::string& host, const std::string& realm) { 37936+void NWebDataBaseDelegate::GetHttpAuthCredentials(const std::string& host, const std::string& realm, 37937+ std::string& username, char* password, uint32_t passwordSize) { 37938 CefRefPtr<CefDataBase> data_base = GetGlobalCefDataBase(); 37939 if (data_base == nullptr) { 37940- return {}; 37941+ return; 37942 } 37943 37944- std::vector<CefString> method_vector; 37945- data_base->GetHttpAuthCredentials(host, realm, method_vector); 37946- 37947- std::vector<std::string> username_password; 37948- for (std::string value : method_vector) { 37949- username_password.push_back(value); 37950- } 37951- return username_password; 37952+ CefString usernameCef; 37953+ data_base->GetHttpAuthCredentials(host, realm, usernameCef, password, passwordSize); 37954+ username = usernameCef; 37955 } 37956 37957 bool NWebDataBaseDelegate::ExistPermissionByOrigin(const std::string& origin, int type) 37958diff --git a/src/ohos_nweb/src/cef_delegate/nweb_data_base_delegate.h b/src/ohos_nweb/src/cef_delegate/nweb_data_base_delegate.h 37959index d7f322230a281..999b359ae38c0 37960--- a/src/ohos_nweb/src/cef_delegate/nweb_data_base_delegate.h 37961+++ b/src/ohos_nweb/src/cef_delegate/nweb_data_base_delegate.h 37962@@ -36,7 +36,8 @@ class NWebDataBaseDelegate { 37963 void SaveHttpAuthCredentials(const std::string& host, const std::string& realm, 37964 const std::string& username, const char* password); 37965 37966- std::vector<std::string> GetHttpAuthCredentials(const std::string& host, const std::string& realm); 37967+ void GetHttpAuthCredentials(const std::string& host, const std::string& realm, 37968+ std::string& username, char* password, uint32_t passwordSize); 37969 37970 bool ExistPermissionByOrigin(const std::string& origin, int type); 37971 37972diff --git a/src/ohos_nweb/src/cef_delegate/nweb_delegate.cc b/src/ohos_nweb/src/cef_delegate/nweb_delegate.cc 37973index 529e0a1eb61c0..02eb9a8a21e6f 37974--- a/src/ohos_nweb/src/cef_delegate/nweb_delegate.cc 37975+++ b/src/ohos_nweb/src/cef_delegate/nweb_delegate.cc 37976@@ -18,16 +18,21 @@ 37977 #include <thread> 37978 #include "nweb_application.h" 37979 #include "nweb_handler_delegate.h" 37980+#include "nweb_history_list_impl.h" 37981 #include "nweb_render_handler.h" 37982 37983 #include "base/strings/utf_string_conversions.h" 37984 #include "cef/include/base/cef_logging.h" 37985 #include "cef/include/cef_app.h" 37986+#include "cef/include/cef_base.h" 37987 #include "cef/include/cef_request_context.h" 37988+#include "content/public/common/content_switches.h" 37989 #include "nweb_find_delegate.h" 37990 #include "nweb_preference_delegate.h" 37991 #include "url/gurl.h" 37992 37993+#include "cef/libcef/browser/navigation_state_serializer.h" 37994+ 37995 namespace OHOS::NWeb { 37996 37997 static const float maxZoomFactor = 10.0; 37998@@ -49,6 +54,38 @@ class JavaScriptResultCallbackImpl : public CefJavaScriptResultCallback { 37999 IMPLEMENT_REFCOUNTING(JavaScriptResultCallbackImpl); 38000 }; 38001 38002+class CefWebMessageReceiverImpl : public CefWebMessageReceiver { 38003+ public: 38004+ CefWebMessageReceiverImpl( 38005+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) 38006+ : callback_(callback){}; 38007+ void OnMessage(CefRefPtr<CefValue> message) override { 38008+ if (callback_ != nullptr) { 38009+ auto data = std::make_shared<OHOS::NWeb::NWebMessage>(NWebValue::Type::NONE); 38010+ if (message->GetType() == VTYPE_STRING) { 38011+ data->SetType(NWebValue::Type::STRING); 38012+ data->SetString(message->GetString()); 38013+ } else if (message->GetType() == VTYPE_BINARY) { 38014+ CefRefPtr<CefBinaryValue> binValue = message->GetBinary(); 38015+ size_t len = binValue->GetSize(); 38016+ std::vector<uint8_t> arr(len); 38017+ binValue->GetData(&arr[0], len, 0); 38018+ data->SetType(NWebValue::Type::BINARY); 38019+ data->SetBinary(arr); 38020+ } else { 38021+ LOG(ERROR) << "OnMessage not support type"; 38022+ return; 38023+ } 38024+ callback_->OnReceiveValue(data); 38025+ } 38026+ } 38027+ 38028+ private: 38029+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback_; 38030+ 38031+ IMPLEMENT_REFCOUNTING(CefWebMessageReceiverImpl); 38032+}; 38033+ 38034 class StoreWebArchiveResultCallbackImpl 38035 : public CefStoreWebArchiveResultCallback { 38036 public: 38037@@ -67,6 +104,52 @@ class StoreWebArchiveResultCallbackImpl 38038 IMPLEMENT_REFCOUNTING(StoreWebArchiveResultCallbackImpl); 38039 }; 38040 38041+class GetImagesCallbackImpl : public CefGetImagesCallback { 38042+ public: 38043+ explicit GetImagesCallbackImpl( 38044+ std::shared_ptr<NWebValueCallback<bool>> callback) 38045+ : callback_(callback){}; 38046+ 38047+ void GetImages(bool response) override { 38048+ if (callback_ != nullptr) { 38049+ callback_->OnReceiveValue(response); 38050+ } 38051+ } 38052+ 38053+ private: 38054+ std::shared_ptr<NWebValueCallback<bool>> callback_; 38055+ 38056+ IMPLEMENT_REFCOUNTING(GetImagesCallbackImpl); 38057+}; 38058+ 38059+class NavigationEntryVisitorImpl : public CefNavigationEntryVisitor { 38060+ public: 38061+ NavigationEntryVisitorImpl() 38062+ : history_list_(std::make_shared<NWebHistoryListImpl>()){}; 38063+ 38064+ bool Visit(CefRefPtr<CefNavigationEntry> entry, 38065+ bool current, 38066+ int index, 38067+ int total) override { 38068+ if (!history_list_) { 38069+ return false; 38070+ } 38071+ if (current) { 38072+ history_list_->SetCurrentIndex(index); 38073+ } 38074+ history_list_->AddHistoryItem(entry); 38075+ return true; 38076+ } 38077+ 38078+ std::shared_ptr<NWebHistoryListImpl> GetHistoryList() const { 38079+ return history_list_; 38080+ } 38081+ 38082+ private: 38083+ std::shared_ptr<NWebHistoryListImpl> history_list_; 38084+ IMPLEMENT_REFCOUNTING(NavigationEntryVisitorImpl); 38085+}; 38086+ 38087 NWebDelegate::NWebDelegate(int argc, const char* argv[]) 38088 : argc_(argc), argv_(argv) {} 38089 38090@@ -77,10 +160,10 @@ NWebDelegate::~NWebDelegate() { 38091 } 38092 } 38093 38094-bool NWebDelegate::Init(void* window) { 38095+bool NWebDelegate::Init(bool is_enhance_surface, void* window) { 38096 preference_delegate_ = std::make_shared<NWebPreferenceDelegate>(); 38097 find_delegate_ = std::make_shared<NWebFindDelegate>(); 38098- 38099+ is_enhance_surface_ = is_enhance_surface; 38100 display_manager_adapter_ = 38101 OhosAdapterHelper::GetInstance().CreateDisplayMgrAdapter(); 38102 if (display_manager_adapter_ == nullptr) { 38103@@ -110,7 +193,7 @@ bool NWebDelegate::Init(void* window) { 38104 } 38105 38106 std::string url_for_init = ""; 38107- InitializeCef(url_for_init, window); 38108+ InitializeCef(url_for_init, is_enhance_surface_, window); 38109 38110 std::shared_ptr<DisplayAdapter> display = 38111 display_manager_adapter_->GetDefaultDisplay(); 38112@@ -122,6 +205,15 @@ bool NWebDelegate::Init(void* window) { 38113 return true; 38114 } 38115 38116+void NWebDelegate::RegisterReleaseSurfaceListener( 38117+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) { 38118+ if (handler_delegate_ == nullptr) { 38119+ LOG(ERROR) << "fail to register release surface, NWEB handler is nullptr"; 38120+ return; 38121+ } 38122+ handler_delegate_->RegisterReleaseSurfaceListener(releaseSurfaceListener); 38123+} 38124+ 38125 void NWebDelegate::OnDestroy(bool is_close_all) { 38126 if (display_listener_ != nullptr && 38127 display_manager_adapter_ != nullptr) { 38128@@ -195,6 +287,15 @@ void NWebDelegate::RegisterWebAppClientExtensionListener( 38129 web_app_client_extension_listener); 38130 } 38131 38132+void NWebDelegate::UnRegisterWebAppClientExtensionListener() { 38133+ if (handler_delegate_ == nullptr) { 38134+ LOG(ERROR) << "fail to unregister web app client extension listener, nweb " 38135+ "handler delegate is nullptr"; 38136+ return; 38137+ } 38138+ handler_delegate_->UnRegisterWebAppClientExtensionListener(); 38139+} 38140+ 38141 void NWebDelegate::RegisterNWebHandler(std::shared_ptr<NWebHandler> handler) { 38142 if (handler_delegate_ == nullptr) { 38143 LOG(ERROR) 38144@@ -287,7 +388,8 @@ void NWebDelegate::NotifyScreenInfoChanged( 38145 LOG(ERROR) << "Get display_manager_adapter_ failed"; 38146 return; 38147 } 38148- std::shared_ptr<DisplayAdapter> display = display_manager_adapter_->GetDefaultDisplay(); 38149+ std::shared_ptr<DisplayAdapter> display = 38150+ display_manager_adapter_->GetDefaultDisplay(); 38151 if (display == nullptr) { 38152 LOG(ERROR) << "Get display failed"; 38153 return; 38154@@ -299,7 +401,9 @@ void NWebDelegate::NotifyScreenInfoChanged( 38155 } 38156 int width = display->GetWidth() / display_ratio; 38157 int height = display->GetHeight() / display_ratio; 38158- render_handler_->SetScreenInfo(rotation, orientation, width, height, display_ratio); 38159+ bool default_portrait = display_manager_adapter_->IsDefaultPortrait(); 38160+ render_handler_->SetScreenInfo({rotation, orientation, width, height, 38161+ display_ratio, default_portrait}); 38162 auto browser = GetBrowser(); 38163 if (browser != nullptr && browser->GetHost() != nullptr) { 38164 browser->GetHost()->NotifyScreenInfoChanged(); 38165@@ -422,6 +526,36 @@ void NWebDelegate::ReloadOriginalUrl() const { 38166 } 38167 } 38168 38169+const std::string NWebDelegate::GetOriginalUrl() { 38170+ LOG(INFO) << "NWebDelegate::GetOriginalUrl"; 38171+ if (GetBrowser().get()) { 38172+ return GetBrowser()->GetHost()->GetOriginalUrl(); 38173+ } 38174+ return std::string(); 38175+} 38176+ 38177+bool NWebDelegate::GetFavicon(const void** data, 38178+ size_t& width, 38179+ size_t& height, 38180+ ImageColorType& colorType, 38181+ ImageAlphaType& alphaType) { 38182+ LOG(INFO) << "NWebDelegate::getFavicon"; 38183+ if (handler_delegate_) { 38184+ return handler_delegate_->GetFavicon(data, width, height, colorType, 38185+ alphaType); 38186+ } else { 38187+ LOG(ERROR) << "handler_delegate_ is null"; 38188+ return false; 38189+ } 38190+} 38191+ 38192+void NWebDelegate::PutNetworkAvailable(bool avaiable) { 38193+ LOG(INFO) << "NWebDelegate::PutNetworkAvailable"; 38194+ if (GetBrowser().get()) { 38195+ GetBrowser()->GetHost()->PutNetworkAvailable(avaiable); 38196+ } 38197+} 38198+ 38199 void NWebDelegate::SetBrowserUserAgentString(const std::string& user_agent) { 38200 LOG(INFO) << "NWebDelegate::SetBrowserUserAgentString"; 38201 if (GetBrowser().get()) { 38202@@ -602,9 +736,10 @@ void NWebDelegate::OnContinue() { 38203 GetBrowser()->GetHost()->SetFocus(true); 38204 } 38205 38206-void NWebDelegate::InitializeCef(std::string url, void* window) { 38207+void NWebDelegate::InitializeCef(std::string url, bool is_enhance_surface, void* window) { 38208 handler_delegate_ = NWebHandlerDelegate::Create( 38209- preference_delegate_, render_handler_, event_handler_, find_delegate_, window); 38210+ preference_delegate_, render_handler_, event_handler_, find_delegate_, 38211+ is_enhance_surface, window); 38212 nweb_app_ = 38213 new NWebApplication(preference_delegate_, url, handler_delegate_, window); 38214 38215@@ -697,26 +832,33 @@ void NWebDelegate::ClosePort(std::string& portHandle) { 38216 GetBrowser()->GetHost()->ClosePort(handleCef); 38217 } 38218 38219-void NWebDelegate::PostPortMessage(std::string& portHandle, std::string& data) { 38220+void NWebDelegate::PostPortMessage(std::string& portHandle, std::shared_ptr<NWebMessage> data) { 38221 if (!GetBrowser().get()) { 38222 LOG(ERROR) << "JSAPI PostPortMessage can not get browser"; 38223 return; 38224 } 38225 CefString handleCef; 38226 handleCef.FromString(portHandle); 38227- CefString dataCef; 38228- dataCef.FromString(data); 38229 38230- GetBrowser()->GetHost()->PostPortMessage(handleCef, dataCef); 38231+ CefRefPtr<CefValue> message = CefValue::Create(); 38232+ if (data->GetType() == NWebValue::Type::STRING) { 38233+ message->SetString(data->GetString()); 38234+ } else if (data->GetType() == NWebValue::Type::BINARY) { 38235+ std::vector<uint8_t> vecBinary = data->GetBinary(); 38236+ CefRefPtr<CefBinaryValue> value = CefBinaryValue::Create(vecBinary.data(), vecBinary.size()); 38237+ message->SetBinary(value); 38238+ } 38239+ 38240+ GetBrowser()->GetHost()->PostPortMessage(handleCef, message); 38241 } 38242 38243 void NWebDelegate::SetPortMessageCallback(std::string& portHandle, 38244- std::shared_ptr<NWebValueCallback<std::string>> callback) { 38245+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) { 38246 if (!GetBrowser().get()) { 38247 LOG(ERROR) << "JSAPI SetPortMessageCallback can not get browser"; 38248 return; 38249 } 38250- CefRefPtr<JavaScriptResultCallbackImpl> JsResultCb = new JavaScriptResultCallbackImpl(callback); 38251+ CefRefPtr<CefWebMessageReceiver> JsResultCb = new CefWebMessageReceiverImpl(callback); 38252 CefString handleCef; 38253 handleCef.FromString(portHandle); 38254 GetBrowser()->GetHost()->SetPortMessageCallback(handleCef, JsResultCb); 38255@@ -725,7 +867,10 @@ void NWebDelegate::SetPortMessageCallback(std::string& portHandle, 38256 std::string NWebDelegate::GetUrl() const { 38257 LOG(INFO) << "NWebDelegate::get url"; 38258 if (GetBrowser().get()) { 38259- return GetBrowser()->GetMainFrame()->GetURL().ToString(); 38260+ auto entry = GetBrowser()->GetHost()->GetVisibleNavigationEntry(); 38261+ if (entry) { 38262+ return entry->GetDisplayURL().ToString(); 38263+ } 38264 } 38265 return ""; 38266 } 38267@@ -790,10 +935,10 @@ int NWebDelegate::Load( 38268 } 38269 38270 int NWebDelegate::LoadWithDataAndBaseUrl(const std::string& baseUrl, 38271- const std::string& data, 38272- const std::string& mimeType, 38273- const std::string& encoding, 38274- const std::string& historyUrl) { 38275+ const std::string& data, 38276+ const std::string& mimeType, 38277+ const std::string& encoding, 38278+ const std::string& historyUrl) { 38279 LOG(INFO) << "NWebDelegate::LoadWithDataAndBaseUrl"; 38280 if (!GetBrowser().get()) { 38281 return NWEB_ERR; 38282@@ -805,8 +950,8 @@ int NWebDelegate::LoadWithDataAndBaseUrl(const std::string& baseUrl, 38283 } 38284 38285 int NWebDelegate::LoadWithData(const std::string& data, 38286- const std::string& mimeType, 38287- const std::string& encoding) { 38288+ const std::string& mimeType, 38289+ const std::string& encoding) { 38290 LOG(INFO) << "NWebDelegate::LoadWithData"; 38291 if (!GetBrowser().get()) { 38292 return NWEB_ERR; 38293@@ -883,24 +1028,29 @@ void NWebDelegate::RegisterNWebJavaScriptCallBack( 38294 } 38295 38296 void NWebDelegate::OnFocus() const { 38297- LOG(INFO) << "NWebDelegate::OnFocus"; 38298 if (!GetBrowser().get()) { 38299+ LOG(ERROR) << "NWebDelegate::OnFocus GetBrowser().get() fail"; 38300 return; 38301 } 38302- 38303- GetBrowser()->GetHost()->SetFocus(true); 38304+ if (handler_delegate_ && !handler_delegate_->GetFocusState()) { 38305+ GetBrowser()->GetHost()->SetFocus(true); 38306+ } 38307 } 38308 38309 void NWebDelegate::OnBlur() const { 38310- LOG(INFO) << "NWebDelegate::OnBlur"; 38311 if (!GetBrowser().get()) { 38312+ LOG(ERROR) << "NWebDelegate::OnBlur GetBrowser().get() fail"; 38313 return; 38314 } 38315 38316- GetBrowser()->GetHost()->SetFocus(false); 38317+ if (handler_delegate_ && handler_delegate_->GetFocusState()) { 38318+ handler_delegate_->SetFocusState(false); 38319+ GetBrowser()->GetHost()->SetFocus(false); 38320+ } 38321 } 38322 38323-void NWebDelegate::UpdateLocale(const std::string& language, const std::string& region) { 38324+void NWebDelegate::UpdateLocale(const std::string& language, 38325+ const std::string& region) { 38326 if (!GetBrowser().get()) { 38327 return; 38328 } 38329@@ -971,4 +1121,115 @@ void NWebDelegate::SendDragEvent(const DelegateDragEvent& dragEvent) const { 38330 break; 38331 } 38332 } 38333+ 38334+void NWebDelegate::GetImages( 38335+ std::shared_ptr<NWebValueCallback<bool>> callback) { 38336+ if (!GetBrowser().get()) { 38337+ LOG(ERROR) << "JSAPI GetImages can not get browser"; 38338+ return; 38339+ } 38340+ 38341+ CefRefPtr<GetImagesCallbackImpl> GetImagesCb = 38342+ new GetImagesCallbackImpl(callback); 38343+ GetBrowser()->GetMainFrame()->GetImages(GetImagesCb); 38344+} 38345+ 38346+void NWebDelegate::RemoveCache(bool include_disk_files) { 38347+ if (!GetBrowser().get()) { 38348+ LOG(ERROR) << "JSAPI RemoveCache can not get browser"; 38349+ return; 38350+ } 38351+ 38352+ GetBrowser()->GetHost()->RemoveCache(include_disk_files); 38353+} 38354+ 38355+std::shared_ptr<NWebHistoryList> NWebDelegate::GetHistoryList() { 38356+ if (!GetBrowser().get()) { 38357+ return nullptr; 38358+ } 38359+ 38360+ CefRefPtr<NavigationEntryVisitorImpl> visitor = 38361+ new NavigationEntryVisitorImpl(); 38362+ GetBrowser()->GetHost()->GetNavigationEntries(visitor, false); 38363+ return visitor->GetHistoryList(); 38364+} 38365+ 38366+void NWebDelegate::PageUp(bool top) { 38367+ if (!GetBrowser().get() || !render_handler_ || !handler_delegate_) { 38368+ return; 38369+ } 38370+ float ratio = render_handler_->GetVirtualPixelRatio(); 38371+ float scale = handler_delegate_->GetScale() / 100.0; 38372+ if (ratio <= 0 || scale <= 0) { 38373+ LOG(ERROR) << "get ratio and scale invalid " << ratio << " " << scale; 38374+ return; 38375+ } 38376+ GetBrowser()->GetHost()->ScrollPageUpDown(true, !top, height_ / ratio / scale); 38377+} 38378+ 38379+void NWebDelegate::PageDown(bool bottom) { 38380+ if (!GetBrowser().get() || !render_handler_ || !handler_delegate_) { 38381+ return; 38382+ } 38383+ float ratio = render_handler_->GetVirtualPixelRatio(); 38384+ float scale = handler_delegate_->GetScale() / 100.0; 38385+ if (ratio <= 0 || scale <= 0) { 38386+ LOG(ERROR) << "get ratio and scale invalid " << ratio << " " << scale; 38387+ return; 38388+ } 38389+ GetBrowser()->GetHost()->ScrollPageUpDown(false, !bottom, height_ / ratio / scale); 38390+} 38391+ 38392+void NWebDelegate::ScrollTo(float x, float y) { 38393+ if (!GetBrowser().get()) { 38394+ LOG(ERROR) << "JSAPI ScrollTo can not get browser"; 38395+ return; 38396+ } 38397+ 38398+ GetBrowser()->GetHost()->ScrollTo(x, y); 38399+} 38400+ 38401+void NWebDelegate::ScrollBy(float delta_x, float delta_y) { 38402+ if (!GetBrowser().get()) { 38403+ LOG(ERROR) << "JSAPI ScrollBy can not get browser"; 38404+ return; 38405+ } 38406+ 38407+ GetBrowser()->GetHost()->ScrollBy(delta_x, delta_y); 38408+} 38409+ 38410+void NWebDelegate::SlideScroll(float vx, float vy) { 38411+ if (!GetBrowser().get()) { 38412+ LOG(ERROR) << "JSAPI SlideScroll can not get browser"; 38413+ return; 38414+ } 38415+ 38416+ GetBrowser()->GetHost()->SlideScroll(vx, vy); 38417+} 38418+ 38419+WebState NWebDelegate::SerializeWebState() { 38420+ CefRefPtr<CefBinaryValue> state_value = GetBrowser()->GetHost()->GetWebState(); 38421+ if (!state_value || !GetBrowser().get()) { 38422+ return nullptr; 38423+ } 38424+ size_t state_size = state_value->GetSize(); 38425+ if (state_size == 0) { 38426+ return nullptr; 38427+ } 38428+ WebState state = std::make_shared<std::vector<uint8_t>>(state_size); 38429+ size_t read_size = state_value->GetData(state->data(), state_size, 0); 38430+ if (read_size != state_size) { 38431+ LOG(ERROR) << "SerializeWebState failed"; 38432+ return nullptr; 38433+ } 38434+ return state; 38435+} 38436+ 38437+bool NWebDelegate::RestoreWebState(WebState state) { 38438+ if (!GetBrowser().get() || !state || state->size() == 0) { 38439+ return false; 38440+ } 38441+ auto web_state = CefBinaryValue::Create(state->data(), state->size()); 38442+ return GetBrowser()->GetHost()->RestoreWebState(web_state); 38443+} 38444 } // namespace OHOS::NWeb 38445diff --git a/src/ohos_nweb/src/cef_delegate/nweb_delegate.h b/src/ohos_nweb/src/cef_delegate/nweb_delegate.h 38446index 49492d1f7b894..a188933f6232d 38447--- a/src/ohos_nweb/src/cef_delegate/nweb_delegate.h 38448+++ b/src/ohos_nweb/src/cef_delegate/nweb_delegate.h 38449@@ -37,7 +37,7 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount { 38450 public: 38451 NWebDelegate(int argc, const char* argv[]); 38452 ~NWebDelegate(); 38453- bool Init(void* window); 38454+ bool Init(bool is_enhance_surface, void* window); 38455 38456 bool IsReady() override; 38457 void OnDestroy(bool is_close_all) override; 38458@@ -45,8 +45,11 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount { 38459 void RegisterWebAppClientExtensionListener( 38460 std::shared_ptr<NWebAppClientExtensionCallback> 38461 web_app_client_extension_listener) override; 38462+ void UnRegisterWebAppClientExtensionListener() override; 38463 void RegisterDownLoadListener( 38464 std::shared_ptr<NWebDownloadCallback> downloadListener) override; 38465+ void RegisterReleaseSurfaceListener( 38466+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) override; 38467 void RegisterNWebHandler(std::shared_ptr<NWebHandler> handler) override; 38468 void RegisterRenderCb( 38469 std::function<void(const char*)> render_update_cb) override; 38470@@ -94,9 +97,9 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount { 38471 void CreateWebMessagePorts(std::vector<std::string>& ports) override; 38472 void PostWebMessage(std::string& message, std::vector<std::string>& ports, std::string& targetUri) override; 38473 void ClosePort(std::string& port_handle) override; 38474- void PostPortMessage(std::string& port_handle, std::string& data) override; 38475+ void PostPortMessage(std::string& port_handle, std::shared_ptr<NWebMessage> data) override; 38476 void SetPortMessageCallback(std::string& port_handle, 38477- std::shared_ptr<NWebValueCallback<std::string>> callback) override; 38478+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) override; 38479 HitTestResult GetHitTestResult() const override; 38480 int PageLoadProgress() override; 38481 float Scale() override; 38482@@ -130,6 +133,10 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount { 38483 void ClearMatches() const override; 38484 void FindNext(const bool forward) const override; 38485 std::string GetUrl() const override; 38486+ const std::string GetOriginalUrl() override; 38487+ bool GetFavicon(const void** data, size_t& width, size_t& height, 38488+ ImageColorType& colorType, ImageAlphaType& alphaType) override; 38489+ void PutNetworkAvailable(bool available) override; 38490 38491 bool SetZoomInFactor(float factor); 38492 bool SetZoomOutFactor(float factor); 38493@@ -150,13 +157,25 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount { 38494 CefRefPtr<CefClient> GetCefClient() const override { 38495 return handler_delegate_; 38496 } 38497+ 38498+ void GetImages(std::shared_ptr<NWebValueCallback<bool>> callback) override; 38499+ void RemoveCache(bool include_disk_files) override; 38500+ std::shared_ptr<NWebHistoryList> GetHistoryList() override; 38501+ void PageUp(bool top) override; 38502+ void PageDown(bool bottom) override; 38503+ void ScrollTo(float x, float y) override; 38504+ void ScrollBy(float delta_x, float delta_y) override; 38505+ void SlideScroll(float vx, float vy) override; 38506+ WebState SerializeWebState() override; 38507+ bool RestoreWebState(WebState state) override; 38508+ 38509 public: 38510 int argc_; 38511 const char** argv_; 38512 38513 private: 38514 void RunMessageLoop(); 38515- void InitializeCef(std::string url, void* window); 38516+ void InitializeCef(std::string url, bool is_enhance_surface, void* window); 38517 const CefRefPtr<CefBrowser> GetBrowser() const; 38518 void RequestVisitedHistory(); 38519 void SetVirtualPixelRatio(float ratio); 38520@@ -184,6 +203,7 @@ class NWebDelegate : public NWebDelegateInterface, public virtual CefRefCount { 38521 #if defined(REPORT_SYS_EVENT) 38522 uint32_t nweb_id_; 38523 #endif 38524+ bool is_enhance_surface_ = false; 38525 }; 38526 } // namespace OHOS::NWeb 38527 #endif 38528diff --git a/src/ohos_nweb/src/cef_delegate/nweb_event_handler.cc b/src/ohos_nweb/src/cef_delegate/nweb_event_handler.cc 38529index da697a8331dab..81e11228d08af 38530--- a/src/ohos_nweb/src/cef_delegate/nweb_event_handler.cc 38531+++ b/src/ohos_nweb/src/cef_delegate/nweb_event_handler.cc 38532@@ -24,6 +24,10 @@ 38533 #include "ui/events/keycodes/keysym_to_unicode.h" 38534 38535 namespace OHOS::NWeb { 38536+ 38537+constexpr double MAX_ZOOM_FACTOR = 10.0; 38538+constexpr double ZOOM_FACTOR = 2.0; 38539+ 38540 // static 38541 std::shared_ptr<NWebEventHandler> NWebEventHandler::Create() { 38542 auto event_handler = std::make_shared<NWebEventHandler>(); 38543@@ -128,7 +132,18 @@ void NWebEventHandler::SendMouseWheelEvent(double x, 38544 mouseEvent.x = x; 38545 mouseEvent.y = y; 38546 mouseEvent.modifiers = input_delegate_.GetModifiers(); 38547- if (browser_ && browser_->GetHost()) { 38548+ if (!browser_ || !browser_->GetHost()){ 38549+ return; 38550+ } 38551+ if ((mouseEvent.modifiers & EVENTFLAG_CONTROL_DOWN) && (deltaY != 0)) { 38552+ double curFactor = browser_->GetHost()->GetZoomLevel(); 38553+ double tempZoomFactor = deltaY < 0 ? curFactor + ZOOM_FACTOR : curFactor - ZOOM_FACTOR; 38554+ if (tempZoomFactor > MAX_ZOOM_FACTOR || tempZoomFactor < 0) { 38555+ LOG(ERROR) << "The mouse wheel event can no longer be zoomed in or out."; 38556+ return; 38557+ } 38558+ browser_->GetHost()->SetZoomLevel(tempZoomFactor); 38559+ } else { 38560 browser_->GetHost()->SendMouseWheelEvent( 38561 mouseEvent, deltaX * input_delegate_.GetMouseWheelRatio(), 38562 deltaY * input_delegate_.GetMouseWheelRatio()); 38563diff --git a/src/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc b/src/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc 38564index ed3df9ab91c7b..1836b656164fe 38565--- a/src/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc 38566+++ b/src/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc 38567@@ -42,6 +42,7 @@ 38568 #include "nweb_js_ssl_select_cert_result_impl.h" 38569 #include "nweb_preference_delegate.h" 38570 #include "nweb_resource_handler.h" 38571+#include "nweb_select_popup_menu_callback.h" 38572 #include "nweb_url_resource_error_impl.h" 38573 #include "nweb_url_resource_request_impl.h" 38574 #include "nweb_url_resource_response.h" 38575@@ -180,10 +181,6 @@ char* CopyCefStringToChar(const CefString& str) { 38576 return result; 38577 } 38578 38579-void ReleaseNwebReceivedIconUrlInfo(NWebReceivedIconInfo* iconInfo) { 38580- if (iconInfo->image_url) 38581- delete[] iconInfo->image_url; 38582-} 38583 } // namespace 38584 38585 // static 38586@@ -192,10 +189,11 @@ CefRefPtr<NWebHandlerDelegate> NWebHandlerDelegate::Create( 38587 CefRefPtr<NWebRenderHandler> render_handler, 38588 std::shared_ptr<NWebEventHandler> event_handler, 38589 std::shared_ptr<NWebFindDelegate> find_delegate, 38590+ bool is_enhance_surface, 38591 void* window) { 38592 CefRefPtr<NWebHandlerDelegate> handler_delegate = 38593 new NWebHandlerDelegate(preference_delegate, render_handler, 38594- event_handler, find_delegate, window); 38595+ event_handler, find_delegate, is_enhance_surface, window); 38596 if (handler_delegate == nullptr) { 38597 LOG(ERROR) << "fail to create NWebHandlerDelegate instance"; 38598 return nullptr; 38599@@ -209,17 +207,21 @@ NWebHandlerDelegate::NWebHandlerDelegate( 38600 CefRefPtr<NWebRenderHandler> render_handler, 38601 std::shared_ptr<NWebEventHandler> event_handler, 38602 std::shared_ptr<NWebFindDelegate> find_delegate, 38603+ bool is_enhance_surface, 38604 void* window) 38605 : preference_delegate_(preference_delegate), 38606 render_handler_(render_handler), 38607 event_handler_(event_handler), 38608 find_delegate_(find_delegate), 38609- window_(reinterpret_cast<NativeWindow*>(window)) { 38610+ is_enhance_surface_(is_enhance_surface) { 38611 #if defined(REPORT_SYS_EVENT) 38612 access_sum_count_ = 0; 38613 access_success_count_ = 0; 38614 access_fail_count_ = 0; 38615 #endif 38616+ if (!is_enhance_surface_) { 38617+ window_ = reinterpret_cast<NativeWindow*>(window); 38618+ } 38619 } 38620 38621 void NWebHandlerDelegate::OnDestroy() { 38622@@ -237,12 +239,21 @@ void NWebHandlerDelegate::RegisterDownLoadListener( 38623 download_listener_ = download_listener; 38624 } 38625 38626+void NWebHandlerDelegate::RegisterReleaseSurfaceListener( 38627+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) { 38628+ releaseSurfaceListener_ = releaseSurfaceListener; 38629+} 38630+ 38631 void NWebHandlerDelegate::RegisterWebAppClientExtensionListener( 38632 std::shared_ptr<NWebAppClientExtensionCallback> 38633 web_app_client_extension_listener) { 38634 web_app_client_extension_listener_ = web_app_client_extension_listener; 38635 } 38636 38637+void NWebHandlerDelegate::UnRegisterWebAppClientExtensionListener() { 38638+ web_app_client_extension_listener_ = nullptr; 38639+} 38640+ 38641 void NWebHandlerDelegate::RegisterNWebHandler( 38642 std::shared_ptr<NWebHandler> handler) { 38643 LOG(INFO) << "RegisterNWebHandler"; 38644@@ -410,11 +421,17 @@ bool NWebHandlerDelegate::DoClose(CefRefPtr<CefBrowser> browser) { 38645 void NWebHandlerDelegate::OnBeforeClose(CefRefPtr<CefBrowser> browser) { 38646 LOG(INFO) << "NWebHandlerDelegate::OnBeforeClose"; 38647 CEF_REQUIRE_UI_THREAD(); 38648- 38649 // Destruct window here to ensure that the GPU thread has stopped 38650 // and will not use window again. 38651- DestoryNativeWindow(window_); 38652- window_ = nullptr; 38653+ if (is_enhance_surface_) { 38654+ if (releaseSurfaceListener_ != nullptr) { 38655+ LOG(INFO) << "NWebHandlerDelegate:: ReleaseSurface"; 38656+ releaseSurfaceListener_->ReleaseSurface(); 38657+ } 38658+ } else { 38659+ DestoryNativeWindow(window_); 38660+ window_ = nullptr; 38661+ } 38662 38663 // Remove from the list of existing browsers. 38664 BrowserList::iterator bit = browser_list_.begin(); 38665@@ -439,7 +456,7 @@ bool NWebHandlerDelegate::OnPreBeforePopup(CefRefPtr<CefBrowser> browser, 38666 if (nweb_handler_ == nullptr) { 38667 return true; 38668 } 38669- 38670+ 38671 switch (target_disposition) { 38672 case WOD_NEW_WINDOW: 38673 case WOD_NEW_POPUP: { 38674@@ -988,7 +1005,7 @@ void NWebHandlerDelegate::OnLoadingProgressChange(CefRefPtr<CefBrowser> browser, 38675 on_load_start_notified_ = true; 38676 web_app_client_extension_listener_->OnLoadStarted( 38677 browser != nullptr ? browser->ShouldShowLoadingUI() : false, 38678- web_app_client_extension_listener_->NWebID); 38679+ web_app_client_extension_listener_->nweb_id); 38680 } 38681 if (new_progress == MAX_LOADING_PROGRESS) { 38682 on_load_start_notified_ = false; 38683@@ -1011,9 +1028,40 @@ void NWebHandlerDelegate::OnReceivedIcon(const void* data, 38684 nweb_handler_->OnPageIcon(data, width, height, 38685 TransformColorType(color_type), 38686 TransformAlphaType(alpha_type)); 38687+ SetFavicon(data, width, height, TransformColorType(color_type), TransformAlphaType(alpha_type)); 38688 } 38689 } 38690 38691+void NWebHandlerDelegate::SetFavicon(const void* data, size_t width, size_t height, 38692+ ImageColorType color_type, ImageAlphaType alpha_type) { 38693+ base::AutoLock lock_scope(state_lock_); 38694+ data_ = data; 38695+ width_ = width; 38696+ height_ = height; 38697+ color_type_ = color_type; 38698+ alpha_type_ = alpha_type; 38699+} 38700+ 38701+bool NWebHandlerDelegate::GetFavicon(const void** data, size_t& width, size_t& height, 38702+ ImageColorType& color_type, ImageAlphaType& alpha_type) { 38703+ base::AutoLock lock_scope(state_lock_); 38704+ if (data == nullptr) { 38705+ LOG(ERROR) << "data is null"; 38706+ return false; 38707+ } 38708+ 38709+ if (data_ == nullptr) { 38710+ LOG(ERROR) << "data_ is null"; 38711+ return false; 38712+ } 38713+ *data = data_; 38714+ width = width_; 38715+ height = height_; 38716+ color_type = color_type_; 38717+ alpha_type = alpha_type_; 38718+ return true; 38719+} 38720+ 38721 void NWebHandlerDelegate::OnReceivedIconUrl(const CefString& image_url, 38722 const void* data, 38723 size_t width, 38724@@ -1030,13 +1078,15 @@ void NWebHandlerDelegate::OnReceivedIconUrl(const CefString& image_url, 38725 return; 38726 } 38727 38728- NWebReceivedIconInfo iconInfo{ 38729- CopyCefStringToChar(image_url), width, height, 38730- TransformColorTypeToInt(TransformColorType(color_type)), 38731- TransformAlphaTypeToInt(TransformAlphaType(alpha_type))}; 38732+ char* c_image_url = CopyCefStringToChar(image_url); 38733 web_app_client_extension_listener_->OnReceivedFaviconUrl( 38734- iconInfo, web_app_client_extension_listener_->NWebID); 38735- ReleaseNwebReceivedIconUrlInfo(&iconInfo); 38736+ c_image_url, width, height, 38737+ TransformColorTypeToInt(TransformColorType(color_type)), 38738+ TransformAlphaTypeToInt(TransformAlphaType(alpha_type)), 38739+ web_app_client_extension_listener_->nweb_id); 38740+ if (c_image_url) { 38741+ delete[] c_image_url; 38742+ } 38743 } 38744 38745 void NWebHandlerDelegate::OnReceivedTouchIconUrl(CefRefPtr<CefBrowser> browser, 38746@@ -1071,6 +1121,39 @@ void NWebHandlerDelegate::OnScaleChanged(CefRefPtr<CefBrowser> browser, 38747 << " old scale: " << old_page_scale_factor; 38748 nweb_handler_->OnScaleChanged(old_page_scale_factor, new_page_scale_factor); 38749 } 38750+ scale_ = new_page_scale_factor; 38751+} 38752+ 38753+bool NWebHandlerDelegate::OnCursorChange(CefRefPtr<CefBrowser> browser, 38754+ CefCursorHandle cursor, 38755+ cef_cursor_type_t type, 38756+ const CefCursorInfo& custom_cursor_info) { 38757+ LOG(DEBUG) << "OnCursorChange type: " << type; 38758+ if (nweb_handler_ == nullptr) { 38759+ LOG(ERROR) << "OnCursorChange nweb handler is nullptr"; 38760+ return false; 38761+ } 38762+ if (type < 0 || type >= static_cast<int32_t>(CursorType::CT_MAX_VALUE)) { 38763+ LOG(ERROR) << "OnCursorChange type exception"; 38764+ return false; 38765+ } 38766+ NWebCursorInfo info = {0}; 38767+ if (type == CT_CUSTOM && custom_cursor_info.size.width > 0 && custom_cursor_info.size.height > 0) { 38768+ info.width = custom_cursor_info.size.width; 38769+ info.height = custom_cursor_info.size.height; 38770+ info.x = custom_cursor_info.hotspot.x; 38771+ info.y = custom_cursor_info.hotspot.y; 38772+ info.scale = custom_cursor_info.image_scale_factor; 38773+ uint64_t len = info.width * info.height * 4; 38774+ info.buff = std::make_unique<uint8_t[]>(len); 38775+ if (!info.buff) { 38776+ LOG(ERROR) << "OnCursorChange make_unique failed"; 38777+ return false; 38778+ } 38779+ memcpy((char *)info.buff.get(), custom_cursor_info.buffer, len); 38780+ } 38781+ CursorType cursorType(static_cast<CursorType>(type)); 38782+ return nweb_handler_->OnCursorChange(cursorType, info); 38783 } 38784 /* CefDisplayHandler method end */ 38785 38786@@ -1078,6 +1161,7 @@ void NWebHandlerDelegate::OnScaleChanged(CefRefPtr<CefBrowser> browser, 38787 bool NWebHandlerDelegate::OnSetFocus(CefRefPtr<CefBrowser> browser, 38788 FocusSource source) { 38789 if (nweb_handler_ != nullptr) { 38790+ focusState_ = true; 38791 nweb_handler_->OnFocus(); 38792 } 38793 return false; 38794@@ -1212,6 +1296,54 @@ bool NWebHandlerDelegate::OnFileDialog( 38795 std::make_shared<FileSelectorCallbackImpl>(callback); 38796 return nweb_handler_->OnFileSelectorShow(file_path_callback, param); 38797 } 38798+ 38799+void NWebHandlerDelegate::OnSelectPopupMenu( 38800+ CefRefPtr<CefBrowser> browser, 38801+ const CefRect& bounds, 38802+ int item_height, 38803+ double item_font_size, 38804+ int selected_item, 38805+ const std::vector<CefSelectPopupItem>& menu_items, 38806+ bool right_aligned, 38807+ bool allow_multiple_selection, 38808+ CefRefPtr<CefSelectPopupCallback> callback) { 38809+ if (!nweb_handler_ || !render_handler_) { 38810+ return; 38811+ } 38812+ float ratio = render_handler_->GetVirtualPixelRatio(); 38813+ std::shared_ptr<NWebSelectPopupMenuParam> param = 38814+ std::make_shared<NWebSelectPopupMenuParam>(); 38815+ if (!param) { 38816+ return; 38817+ } 38818+ param->bounds = { bounds.x * ratio, bounds.y * ratio, bounds.width * ratio, 38819+ bounds.height * ratio}; 38820+ param->itemHeight = item_height; 38821+ param->itemFontSize = item_font_size; 38822+ param->selectedItem = selected_item; 38823+ param->rightAligned = right_aligned; 38824+ param->allowMultipleSelection = allow_multiple_selection; 38825+ std::vector<SelectPopupMenuItem> menu_list; 38826+ for (auto& menu_item : menu_items) { 38827+ std::string label = CefString(&menu_item.label); 38828+ SelectPopupMenuItem item = { 38829+ CefString(&menu_item.label).ToString(), 38830+ CefString(&menu_item.tool_tip).ToString(), 38831+ static_cast<SelectPopupMenuItemType>(menu_item.type), 38832+ menu_item.action, 38833+ static_cast<TextDirection>(menu_item.text_direction), 38834+ menu_item.enabled, 38835+ menu_item.has_text_direction_override, 38836+ menu_item.checked, 38837+ }; 38838+ menu_list.push_back(std::move(item)); 38839+ } 38840+ param->menuItems = std::move(menu_list); 38841+ 38842+ std::shared_ptr<NWebSelectPopupMenuCallback> popup_callback = 38843+ std::make_shared<NWebSelectPopupMenuCallbackImpl>(callback); 38844+ nweb_handler_->OnSelectPopupMenu(param, popup_callback); 38845+} 38846 /* CefDialogHandler method end */ 38847 38848 /* CefContextMenuHandler method begin */ 38849@@ -1555,4 +1687,12 @@ void NWebHandlerDelegate::SetNWebId(uint32_t nwebId) { 38850 nweb_id_ = nwebId; 38851 } 38852 #endif 38853+ 38854+bool NWebHandlerDelegate::GetFocusState() { 38855+ return focusState_; 38856+} 38857+ 38858+void NWebHandlerDelegate::SetFocusState(bool focusState) { 38859+ focusState_ = focusState; 38860+} 38861 } // namespace OHOS::NWeb 38862diff --git a/src/ohos_nweb/src/cef_delegate/nweb_handler_delegate.h b/src/ohos_nweb/src/cef_delegate/nweb_handler_delegate.h 38863index 508348374232e..70cb96d606bac 38864--- a/src/ohos_nweb/src/cef_delegate/nweb_handler_delegate.h 38865+++ b/src/ohos_nweb/src/cef_delegate/nweb_handler_delegate.h 38866@@ -65,6 +65,7 @@ class NWebHandlerDelegate : public CefClient, 38867 CefRefPtr<NWebRenderHandler> render_handler, 38868 std::shared_ptr<NWebEventHandler> event_handler, 38869 std::shared_ptr<NWebFindDelegate> find_delegate, 38870+ bool is_enhance_surface, 38871 void* window); 38872 38873 NWebHandlerDelegate( 38874@@ -72,6 +73,7 @@ class NWebHandlerDelegate : public CefClient, 38875 CefRefPtr<NWebRenderHandler> render_handler, 38876 std::shared_ptr<NWebEventHandler> event_handler, 38877 std::shared_ptr<NWebFindDelegate> find_delegate, 38878+ bool is_enhance_surface, 38879 void* window); 38880 ~NWebHandlerDelegate() = default; 38881 38882@@ -79,10 +81,13 @@ class NWebHandlerDelegate : public CefClient, 38883 38884 void RegisterDownLoadListener( 38885 std::shared_ptr<NWebDownloadCallback> download_listener); 38886+ void RegisterReleaseSurfaceListener( 38887+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener); 38888 void RegisterNWebHandler(std::shared_ptr<NWebHandler> handler); 38889 void RegisterWebAppClientExtensionListener( 38890 std::shared_ptr<NWebAppClientExtensionCallback> 38891 web_app_client_extension_listener); 38892+ void UnRegisterWebAppClientExtensionListener(); 38893 void RegisterNWebJavaScriptCallBack( 38894 std::shared_ptr<NWebJavaScriptResultCallBack> callback); 38895 38896@@ -280,6 +285,10 @@ class NWebHandlerDelegate : public CefClient, 38897 void OnScaleChanged(CefRefPtr<CefBrowser> browser, 38898 float old_page_scale_factor, 38899 float new_page_scale_factor) override; 38900+ bool OnCursorChange(CefRefPtr<CefBrowser> browser, 38901+ CefCursorHandle cursor, 38902+ cef_cursor_type_t type, 38903+ const CefCursorInfo& custom_cursor_info) override; 38904 /* CefDisplayHandler method end */ 38905 38906 /* CefFocusHandler method begin */ 38907@@ -320,6 +329,15 @@ class NWebHandlerDelegate : public CefClient, 38908 int selected_accept_filter, 38909 bool capture, 38910 CefRefPtr<CefFileDialogCallback> callback) override; 38911+ void OnSelectPopupMenu(CefRefPtr<CefBrowser> browser, 38912+ const CefRect& bounds, 38913+ int item_height, 38914+ double item_font_size, 38915+ int selected_item, 38916+ const std::vector<CefSelectPopupItem>& menu_items, 38917+ bool right_aligned, 38918+ bool allow_multiple_selection, 38919+ CefRefPtr<CefSelectPopupCallback> callback) override; 38920 /* CefDialogHandler method end */ 38921 38922 /* CefContextMenuHandler method begin */ 38923@@ -383,6 +401,14 @@ class NWebHandlerDelegate : public CefClient, 38924 void SetNWebId(uint32_t nwebId); 38925 #endif 38926 38927+ void SetFavicon(const void* icon_data, size_t width, size_t height, 38928+ ImageColorType color_type, ImageAlphaType alpha_type); 38929+ bool GetFavicon(const void** data, size_t& width, size_t& height, 38930+ ImageColorType& colorType, ImageAlphaType& alphaType); 38931+ float GetScale() const { return scale_; } 38932+ 38933+ bool GetFocusState(); 38934+ void SetFocusState(bool focusState); 38935 private: 38936 void CopyImageToClipboard(CefRefPtr<CefImage> image); 38937 // List of existing browser windows. Only accessed on the CEF UI thread. 38938@@ -401,6 +427,7 @@ class NWebHandlerDelegate : public CefClient, 38939 IMPLEMENT_REFCOUNTING(NWebHandlerDelegate); 38940 38941 std::shared_ptr<NWebDownloadCallback> download_listener_ = nullptr; 38942+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener_ = nullptr; 38943 std::shared_ptr<NWebHandler> nweb_handler_ = nullptr; 38944 std::shared_ptr<NWebJavaScriptResultCallBack> nweb_javascript_callback_ = 38945 nullptr; 38946@@ -410,10 +437,19 @@ class NWebHandlerDelegate : public CefClient, 38947 38948 // lifecycle wrapped by ace WebGeolocationOhos 38949 NWebGeolocationCallback* callback_ = nullptr; 38950+ bool is_enhance_surface_ = false; 38951 NativeWindow* window_ = nullptr; 38952 38953 CefString image_cache_src_url_; 38954 38955+ // the received icon 38956+ base::Lock state_lock_; 38957+ const void* data_ = nullptr; 38958+ size_t width_ = 0; 38959+ size_t height_ = 0; 38960+ ImageColorType color_type_ = ImageColorType::COLOR_TYPE_UNKNOWN; 38961+ ImageAlphaType alpha_type_ = ImageAlphaType::ALPHA_TYPE_UNKNOWN; 38962+ 38963 #if defined(REPORT_SYS_EVENT) 38964 uint32_t nweb_id_ = 0; 38965 // For page load statistics 38966@@ -427,6 +463,9 @@ class NWebHandlerDelegate : public CefClient, 38967 #if defined(OHOS_NWEB_EX) 38968 bool on_load_start_notified_ = false; 38969 #endif // OHOS_NWEB_EX 38970+ bool focusState_ = false; 38971+ 38972+ float scale_ = 100.0; 38973 }; 38974 } // namespace OHOS::NWeb 38975 38976diff --git a/src/ohos_nweb/src/cef_delegate/nweb_history_list_impl.cc b/src/ohos_nweb/src/cef_delegate/nweb_history_list_impl.cc 38977new file mode 100755 38978index 0000000000000..c0e2b7a8fbfff 38979--- /dev/null 38980+++ b/src/ohos_nweb/src/cef_delegate/nweb_history_list_impl.cc 38981@@ -0,0 +1,112 @@ 38982+/* 38983+ * Copyright (c) 2022 Huawei Device Co., Ltd. 38984+ * Licensed under the Apache License, Version 2.0 (the "License"); 38985+ * you may not use this file except in compliance with the License. 38986+ * You may obtain a copy of the License at 38987+ * 38988+ * http://www.apache.org/licenses/LICENSE-2.0 38989+ * 38990+ * Unless required by applicable law or agreed to in writing, software 38991+ * distributed under the License is distributed on an "AS IS" BASIS, 38992+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 38993+ * See the License for the specific language governing permissions and 38994+ * limitations under the License. 38995+ */ 38996+ 38997+#include "nweb.h" 38998+#include "nweb_history_list_impl.h" 38999+ 39000+#include "base/logging.h" 39001+#include "include/core/SkBitmap.h" 39002+ 39003+using namespace OHOS::NWeb; 39004+namespace { 39005+ImageColorType TransformSkColorType(int color_type) { 39006+ switch (color_type) { 39007+ case kRGBA_8888_SkColorType: 39008+ return ImageColorType::COLOR_TYPE_RGBA_8888; 39009+ case kBGRA_8888_SkColorType: 39010+ return ImageColorType::COLOR_TYPE_BGRA_8888; 39011+ default: 39012+ return ImageColorType::COLOR_TYPE_UNKNOWN; 39013+ } 39014+} 39015+ 39016+ImageAlphaType TransformSkAlphaType(int alpha_type) { 39017+ switch (alpha_type) { 39018+ case kOpaque_SkAlphaType: 39019+ return ImageAlphaType::ALPHA_TYPE_OPAQUE; 39020+ case kPremul_SkAlphaType: 39021+ return ImageAlphaType::ALPHA_TYPE_PREMULTIPLIED; 39022+ case kUnpremul_SkAlphaType: 39023+ return ImageAlphaType::ALPHA_TYPE_POSTMULTIPLIED; 39024+ default: 39025+ return ImageAlphaType::ALPHA_TYPE_UNKNOWN; 39026+ } 39027+} 39028+} 39029+ 39030+namespace OHOS::NWeb { 39031+NWebHistoryItemImpl::NWebHistoryItemImpl(CefRefPtr<CefNavigationEntry> entry) 39032+ : entry_(entry) {} 39033+ 39034+std::string NWebHistoryItemImpl::GetHistoryRawUrl() { 39035+ if (!entry_ || !entry_->IsValid()) { 39036+ return std::string(); 39037+ } 39038+ return entry_->GetOriginalURL().ToString().empty() 39039+ ? entry_->GetDisplayURL().ToString() 39040+ : entry_->GetOriginalURL().ToString(); 39041+} 39042+ 39043+std::string NWebHistoryItemImpl::GetHistoryTitle() { 39044+ return (entry_ != nullptr && entry_->IsValid()) 39045+ ? entry_->GetTitle().ToString() 39046+ : std::string(); 39047+} 39048+ 39049+std::string NWebHistoryItemImpl::GetHistoryUrl() { 39050+ return (entry_ != nullptr && entry_->IsValid()) ? entry_->GetURL().ToString() 39051+ : std::string(); 39052+} 39053+ 39054+bool NWebHistoryItemImpl::GetFavicon(void** data, 39055+ int& width, 39056+ int& height, 39057+ ImageColorType& colorType, 39058+ ImageAlphaType& alphaType) { 39059+ if (!entry_ || !entry_->IsValid()) { 39060+ return false; 39061+ } 39062+ int color, alpha; 39063+ bool result = entry_->GetFavicon(data, color, alpha, width, height); 39064+ colorType = TransformSkColorType(color); 39065+ alphaType = TransformSkAlphaType(alpha); 39066+ return result; 39067+} 39068+ 39069+int32_t NWebHistoryListImpl::GetCurrentIndex() { 39070+ return current_index_; 39071+} 39072+ 39073+std::shared_ptr<NWebHistoryItem> NWebHistoryListImpl::GetItem(int32_t index) { 39074+ if (index < 0 || index >= item_list_.size()) { 39075+ return nullptr; 39076+ } 39077+ return item_list_[index]; 39078+} 39079+ 39080+int32_t NWebHistoryListImpl::GetListSize() { 39081+ return item_list_.size(); 39082+} 39083+ 39084+void NWebHistoryListImpl::AddHistoryItem(CefRefPtr<CefNavigationEntry> entry) { 39085+ if (entry) { 39086+ item_list_.push_back(std::make_shared<NWebHistoryItemImpl>(entry)); 39087+ } 39088+} 39089+ 39090+void NWebHistoryListImpl::SetCurrentIndex(int32_t index) { 39091+ current_index_ = index; 39092+} 39093+} // namespace OHOS::NWeb 39094\ No newline at end of file 39095diff --git a/src/ohos_nweb/src/cef_delegate/nweb_history_list_impl.h b/src/ohos_nweb/src/cef_delegate/nweb_history_list_impl.h 39096new file mode 100755 39097index 0000000000000..3c294893a5f98 39098--- /dev/null 39099+++ b/src/ohos_nweb/src/cef_delegate/nweb_history_list_impl.h 39100@@ -0,0 +1,54 @@ 39101+/* 39102+ * Copyright (c) 2022 Huawei Device Co., Ltd. 39103+ * Licensed under the Apache License, Version 2.0 (the "License"); 39104+ * you may not use this file except in compliance with the License. 39105+ * You may obtain a copy of the License at 39106+ * 39107+ * http://www.apache.org/licenses/LICENSE-2.0 39108+ * 39109+ * Unless required by applicable law or agreed to in writing, software 39110+ * distributed under the License is distributed on an "AS IS" BASIS, 39111+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 39112+ * See the License for the specific language governing permissions and 39113+ * limitations under the License. 39114+ */ 39115+ 39116+#ifndef NWEB_HISTORY_LIST_IMPL_H 39117+#define NWEB_HISTORY_LIST_IMPL_H 39118+ 39119+#include <vector> 39120+#include "cef/include/cef_navigation_entry.h" 39121+#include "nweb_history_list.h" 39122+ 39123+namespace OHOS::NWeb { 39124+class NWebHistoryItemImpl : public NWebHistoryItem { 39125+ public: 39126+ NWebHistoryItemImpl() = delete; 39127+ explicit NWebHistoryItemImpl(CefRefPtr<CefNavigationEntry> entry); 39128+ ~NWebHistoryItemImpl() = default; 39129+ std::string GetHistoryRawUrl() override; 39130+ std::string GetHistoryTitle() override; 39131+ std::string GetHistoryUrl() override; 39132+ bool GetFavicon(void** data, int& width, int& height, 39133+ ImageColorType& colorType, ImageAlphaType& alphaType) override; 39134+ 39135+ private: 39136+ CefRefPtr<CefNavigationEntry> entry_; 39137+}; 39138+ 39139+class NWebHistoryListImpl : public NWebHistoryList { 39140+ public: 39141+ NWebHistoryListImpl() = default; 39142+ ~NWebHistoryListImpl() = default; 39143+ int32_t GetCurrentIndex() override; 39144+ std::shared_ptr<NWebHistoryItem> GetItem(int32_t index) override; 39145+ int32_t GetListSize() override; 39146+ void AddHistoryItem(CefRefPtr<CefNavigationEntry> entry); 39147+ void SetCurrentIndex(int32_t index); 39148+ 39149+ private: 39150+ int32_t current_index_ = -1; 39151+ std::vector<std::shared_ptr<NWebHistoryItemImpl>> item_list_; 39152+}; 39153+} // namespace OHOS::NWeb 39154+#endif 39155\ No newline at end of file 39156diff --git a/src/ohos_nweb/src/cef_delegate/nweb_input_delegate.cc b/src/ohos_nweb/src/cef_delegate/nweb_input_delegate.cc 39157index 2a086f2d90e13..5c429feec92a5 39158--- a/src/ohos_nweb/src/cef_delegate/nweb_input_delegate.cc 39159+++ b/src/ohos_nweb/src/cef_delegate/nweb_input_delegate.cc 39160@@ -353,7 +353,6 @@ uint32_t NWebInputDelegate::GetModifiers(cef_mouse_button_type_t button) { 39161 result |= EVENTFLAG_FORWARD_MOUSE_BUTTON; 39162 break; 39163 default: 39164- LOG(INFO) << "invalid button type " << button; 39165 break; 39166 } 39167 return result; 39168diff --git a/src/ohos_nweb/src/cef_delegate/nweb_inputmethod_client.h b/src/ohos_nweb/src/cef_delegate/nweb_inputmethod_client.h 39169index 8ce8c9fc7363b..eb25585d4d23e 39170--- a/src/ohos_nweb/src/cef_delegate/nweb_inputmethod_client.h 39171+++ b/src/ohos_nweb/src/cef_delegate/nweb_inputmethod_client.h 39172@@ -22,10 +22,16 @@ 39173 namespace OHOS::NWeb { 39174 class NWebInputMethodClient: public virtual CefBaseRefCounted { 39175 public: 39176+ enum class HideTextinputType { 39177+ FROM_KERNEL, 39178+ FROM_ONBLUR, 39179+ FROM_ONPAUSE, 39180+ }; 39181+ 39182 virtual ~NWebInputMethodClient() = default; 39183 virtual void Attach(CefRefPtr<CefBrowser> browser, bool show_keyboard) = 0; 39184 virtual void ShowTextInput() = 0; 39185- virtual void HideTextInput() = 0; 39186+ virtual void HideTextInput(HideTextinputType hideType = HideTextinputType::FROM_KERNEL) = 0; 39187 virtual void OnTextSelectionChanged(CefRefPtr<CefBrowser> browser, 39188 const CefString& selected_text, 39189 const CefRange& selected_range) = 0; 39190diff --git a/src/ohos_nweb/src/cef_delegate/nweb_preference_delegate.cc b/src/ohos_nweb/src/cef_delegate/nweb_preference_delegate.cc 39191index 384a9d0e03f45..a327eb75f618d 39192--- a/src/ohos_nweb/src/cef_delegate/nweb_preference_delegate.cc 39193+++ b/src/ohos_nweb/src/cef_delegate/nweb_preference_delegate.cc 39194@@ -32,6 +32,10 @@ 39195 #include "ohos_nweb/src/cef_delegate/nweb_application.h" 39196 39197 namespace OHOS::NWeb { 39198+ 39199+constexpr int fontMinSize = 1; 39200+constexpr int fontMaxSize = 72; 39201+ 39202 int ConvertCacheMode(NWebPreference::CacheModeFlag flag) { 39203 switch (flag) { 39204 case NWebPreference::CacheModeFlag::USE_CACHE_ELSE_NETWORK: 39205@@ -132,7 +136,9 @@ void NWebPreferenceDelegate::ComputeBrowserSettings( 39206 //browser_settings.file_access_from_file_urls = 39207 // EnableRawFileAccessFromFileURLs() ? STATE_ENABLED : STATE_DISABLED; 39208 browser_settings.force_dark_mode_enabled = 39209- DarkModeEnabled() ? STATE_ENABLED : STATE_DISABLED; 39210+ ForceDarkModeEnabled() ? STATE_ENABLED : STATE_DISABLED; 39211+ browser_settings.dark_prefer_color_scheme_enabled = 39212+ DarkSchemeEnabled() ? STATE_ENABLED : STATE_DISABLED; 39213 browser_settings.javascript_can_open_windows_automatically = 39214 IsCreateWindowsByJavaScriptAllowed(); 39215 browser_settings.text_size_percent = ZoomingForTextFactor(); 39216@@ -147,6 +153,10 @@ void NWebPreferenceDelegate::ComputeBrowserSettings( 39217 browser_settings.supports_multi_touch_zoom = ZoomingfunctionEnabled(); 39218 browser_settings.user_gesture_required = GetMediaPlayGestureAccess(); 39219 browser_settings.pinch_smooth_mode = GetPinchSmoothMode(); 39220+ browser_settings.hide_horizontal_scrollbars = 39221+ !IsHorizontalScrollBarAccess() ? STATE_ENABLED : STATE_DISABLED; 39222+ browser_settings.hide_vertical_scrollbars = 39223+ !IsVerticalScrollBarAccess() ? STATE_ENABLED : STATE_DISABLED; 39224 CefRefPtr<CefCommandLine> command_line = 39225 CefCommandLine::GetGlobalCommandLine(); 39226 if (command_line->HasSwitch(::switches::kForBrowser)) { 39227@@ -169,6 +179,16 @@ void NWebPreferenceDelegate::PutMultiWindowAccess(bool flag) { 39228 multiWindow_access_ = flag; 39229 } 39230 39231+void NWebPreferenceDelegate::PutHorizontalScrollBarAccess(bool flag) { 39232+ horizontal_scrollBar_access_ = flag; 39233+ WebPreferencesChanged(); 39234+} 39235+ 39236+void NWebPreferenceDelegate::PutVerticalScrollBarAccess(bool flag) { 39237+ vertical_scrollBar_access_ = flag; 39238+ WebPreferencesChanged(); 39239+} 39240+ 39241 void NWebPreferenceDelegate::PutEnableContentAccess(bool flag) { 39242 content_access_ = flag; 39243 SetBrowserSettingsToNetHelpers(); 39244@@ -176,7 +196,12 @@ void NWebPreferenceDelegate::PutEnableContentAccess(bool flag) { 39245 39246 void NWebPreferenceDelegate::PutEnableRawFileAccess(bool flag) { 39247 raw_file_access_ = flag; 39248- SetBrowserSettingsToNetHelpers(); 39249+ if (!browser_.get()) { 39250+ LOG(ERROR) << "browser is null"; 39251+ return; 39252+ } 39253+ 39254+ browser_->GetHost()->SetFileAccess(flag); 39255 } 39256 39257 void NWebPreferenceDelegate::PutEnableRawFileAccessFromFileURLs(bool flag) { 39258@@ -204,11 +229,11 @@ void NWebPreferenceDelegate::PutDatabaseAllowed(bool flag) { 39259 } 39260 39261 void NWebPreferenceDelegate::PutDefaultFixedFontSize(int size) { 39262- default_fixed_font_size_ = size; 39263+ default_fixed_font_size_ = std::clamp(size, fontMinSize, fontMaxSize); 39264 WebPreferencesChanged(); 39265 } 39266 void NWebPreferenceDelegate::PutDefaultFontSize(int size) { 39267- default_font_size_ = size; 39268+ default_font_size_ = std::clamp(size, fontMinSize, fontMaxSize); 39269 WebPreferencesChanged(); 39270 } 39271 39272@@ -233,8 +258,13 @@ void NWebPreferenceDelegate::PutFixedFontFamilyName(std::string font) { 39273 WebPreferencesChanged(); 39274 } 39275 39276-void NWebPreferenceDelegate::PutDarkModeEnabled(int forceDark) { 39277- dark_mode_enabled_ = forceDark; 39278+void NWebPreferenceDelegate::PutForceDarkModeEnabled(int forceDark) { 39279+ force_dark_mode_enabled_ = forceDark; 39280+ WebPreferencesChanged(); 39281+} 39282+ 39283+void NWebPreferenceDelegate::PutDarkSchemeEnabled(int darkScheme) { 39284+ dark_prefer_color_scheme_enabled_ = darkScheme; 39285 WebPreferencesChanged(); 39286 } 39287 39288@@ -254,12 +284,12 @@ void NWebPreferenceDelegate::PutImageLoadingAllowed(bool flag) { 39289 } 39290 39291 void NWebPreferenceDelegate::PutFontSizeLowerLimit(int size) { 39292- font_size_lower_limit_ = size; 39293+ font_size_lower_limit_ = std::clamp(size, fontMinSize, fontMaxSize); 39294 WebPreferencesChanged(); 39295 } 39296 39297 void NWebPreferenceDelegate::PutLogicalFontSizeLowerLimit(int size) { 39298- logical_font_size_lower_limit_ = size; 39299+ logical_font_size_lower_limit_ = std::clamp(size, fontMinSize, fontMaxSize); 39300 WebPreferencesChanged(); 39301 } 39302 39303@@ -328,12 +358,22 @@ void NWebPreferenceDelegate::PutBlockNetwork(bool flag) { 39304 "INTERNET permission"; 39305 } 39306 is_network_blocked_ = flag; 39307- SetBrowserSettingsToNetHelpers(); 39308+ if (!browser_.get()) { 39309+ LOG(ERROR) << "browser is null"; 39310+ return; 39311+ } 39312+ 39313+ browser_->GetHost()->SetBlockNetwork(flag); 39314 } 39315 39316 void NWebPreferenceDelegate::PutCacheMode(CacheModeFlag flag) { 39317 cache_mode_flag_ = flag; 39318- SetBrowserSettingsToNetHelpers(); 39319+ if (!browser_.get()) { 39320+ LOG(ERROR) << "browser is null"; 39321+ return; 39322+ } 39323+ 39324+ browser_->GetHost()->SetCacheMode(ConvertCacheMode(flag)); 39325 } 39326 39327 void NWebPreferenceDelegate::PutWebDebuggingAccess(bool flag) { 39328@@ -416,8 +456,12 @@ std::string NWebPreferenceDelegate::FixedFontFamilyName() { 39329 return fixed_font_family_name_; 39330 } 39331 39332-int NWebPreferenceDelegate::DarkModeEnabled() { 39333- return dark_mode_enabled_; 39334+int NWebPreferenceDelegate::ForceDarkModeEnabled() { 39335+ return force_dark_mode_enabled_; 39336+} 39337+ 39338+int NWebPreferenceDelegate::DarkSchemeEnabled() { 39339+ return dark_prefer_color_scheme_enabled_; 39340 } 39341 39342 bool NWebPreferenceDelegate::IsCreateWindowsByJavaScriptAllowed() { 39343@@ -530,4 +574,12 @@ bool NWebPreferenceDelegate::GetPinchSmoothMode() { 39344 bool NWebPreferenceDelegate::IsMultiWindowAccess() { 39345 return multiWindow_access_; 39346 } 39347+ 39348+bool NWebPreferenceDelegate::IsHorizontalScrollBarAccess() { 39349+ return horizontal_scrollBar_access_; 39350+} 39351+ 39352+bool NWebPreferenceDelegate::IsVerticalScrollBarAccess() { 39353+ return vertical_scrollBar_access_; 39354+} 39355 } // namespace OHOS::NWeb 39356diff --git a/src/ohos_nweb/src/cef_delegate/nweb_preference_delegate.h b/src/ohos_nweb/src/cef_delegate/nweb_preference_delegate.h 39357index 35363bc75d94d..4c34798987b4b 39358--- a/src/ohos_nweb/src/cef_delegate/nweb_preference_delegate.h 39359+++ b/src/ohos_nweb/src/cef_delegate/nweb_preference_delegate.h 39360@@ -45,7 +45,8 @@ class NWebPreferenceDelegate : public NWebPreference { 39361 void PutDomStorageEnabled(bool flag) override; 39362 void PutFantasyFontFamilyName(std::string font) override; 39363 void PutFixedFontFamilyName(std::string font) override; 39364- void PutDarkModeEnabled(int forceDark) override; 39365+ void PutForceDarkModeEnabled(int forceDark) override; 39366+ void PutDarkSchemeEnabled(int darkScheme) override; 39367 void PutIsCreateWindowsByJavaScriptAllowed(bool flag) override; 39368 void PutJavaScriptEnabled(bool flag) override; 39369 void PutImageLoadingAllowed(bool flag) override; 39370@@ -66,7 +67,8 @@ class NWebPreferenceDelegate : public NWebPreference { 39371 void PutMediaPlayGestureAccess(bool flag) override; 39372 void PutPinchSmoothMode(bool flag) override; 39373 void PutMultiWindowAccess(bool flag) override; 39374- 39375+ void PutHorizontalScrollBarAccess(bool flag) override; 39376+ void PutVerticalScrollBarAccess(bool flag) override; 39377 /* get methods*/ 39378 bool EnableContentAccess() override; 39379 bool EnableRawFileAccess() override; 39380@@ -82,7 +84,8 @@ class NWebPreferenceDelegate : public NWebPreference { 39381 bool IsDomStorageEnabled() override; 39382 std::string FantasyFontFamilyName() override; 39383 std::string FixedFontFamilyName() override; 39384- int DarkModeEnabled() override; 39385+ int ForceDarkModeEnabled() override; 39386+ int DarkSchemeEnabled() override; 39387 bool IsCreateWindowsByJavaScriptAllowed() override; 39388 bool IsJavaScriptAllowed() override; 39389 bool IsImageLoadingAllowed() override; 39390@@ -102,6 +105,8 @@ class NWebPreferenceDelegate : public NWebPreference { 39391 bool IsWebDebuggingAccess() override; 39392 bool GetMediaPlayGestureAccess() override; 39393 bool IsMultiWindowAccess() override; 39394+ bool IsHorizontalScrollBarAccess() override; 39395+ bool IsVerticalScrollBarAccess() override; 39396 39397 bool RunningInsecureContentAllowed(); 39398 bool UseStricMixedContentCheckingAllowed(); 39399@@ -134,10 +139,13 @@ class NWebPreferenceDelegate : public NWebPreference { 39400 bool raw_file_access_{false}; 39401 bool universal_access_from_file_urls_{false}; 39402 bool raw_file_access_from_file_urls_{false}; 39403- bool dark_mode_enabled_{false}; 39404+ bool force_dark_mode_enabled_{false}; 39405+ bool dark_prefer_color_scheme_enabled_{false}; 39406 bool is_need_gesture_access_{true}; 39407 bool pinch_smooth_mode_{false}; 39408 bool multiWindow_access_{false}; 39409+ bool horizontal_scrollBar_access_{true}; 39410+ bool vertical_scrollBar_access_{true}; 39411 /* Web preferences end*/ 39412 bool create_windows_by_javascript_allowed_{false}; 39413 std::string user_agent_{""}; 39414diff --git a/src/ohos_nweb/src/cef_delegate/nweb_render_handler.cc b/src/ohos_nweb/src/cef_delegate/nweb_render_handler.cc 39415index 6f3e2edda6334..0b1c683640c00 39416--- a/src/ohos_nweb/src/cef_delegate/nweb_render_handler.cc 39417+++ b/src/ohos_nweb/src/cef_delegate/nweb_render_handler.cc 39418@@ -26,31 +26,25 @@ 39419 39420 namespace { 39421 cef_screen_orientation_type_t ConvertOrientationType( 39422- OHOS::NWeb::OrientationType type) { 39423+ OHOS::NWeb::OrientationType type, 39424+ bool default_portrait) { 39425 switch (type) { 39426-#if defined(DEFAULT_PORTRAIT) 39427 case OHOS::NWeb::OrientationType::UNSPECIFIED: 39428- return cef_screen_orientation_type_t::PORTRAIT_PRIMARY; 39429- case OHOS::NWeb::OrientationType::VERTICAL: 39430- return cef_screen_orientation_type_t::PORTRAIT_PRIMARY; 39431- case OHOS::NWeb::OrientationType::HORIZONTAL: 39432- return cef_screen_orientation_type_t::LANDSCAPE_SECONDARY; 39433- case OHOS::NWeb::OrientationType::REVERSE_VERTICAL: 39434- return cef_screen_orientation_type_t::PORTRAIT_SECONDARY; 39435- case OHOS::NWeb::OrientationType::REVERSE_HORIZONTAL: 39436- return cef_screen_orientation_type_t::LANDSCAPE_PRIMARY; 39437-#else 39438- case OHOS::NWeb::OrientationType::UNSPECIFIED: 39439- return cef_screen_orientation_type_t::LANDSCAPE_PRIMARY; 39440+ return default_portrait 39441+ ? cef_screen_orientation_type_t::PORTRAIT_PRIMARY 39442+ : cef_screen_orientation_type_t::LANDSCAPE_PRIMARY; 39443 case OHOS::NWeb::OrientationType::VERTICAL: 39444 return cef_screen_orientation_type_t::PORTRAIT_PRIMARY; 39445 case OHOS::NWeb::OrientationType::HORIZONTAL: 39446- return cef_screen_orientation_type_t::LANDSCAPE_PRIMARY; 39447+ return default_portrait 39448+ ? cef_screen_orientation_type_t::LANDSCAPE_SECONDARY 39449+ : cef_screen_orientation_type_t::LANDSCAPE_PRIMARY; 39450 case OHOS::NWeb::OrientationType::REVERSE_VERTICAL: 39451 return cef_screen_orientation_type_t::PORTRAIT_SECONDARY; 39452 case OHOS::NWeb::OrientationType::REVERSE_HORIZONTAL: 39453- return cef_screen_orientation_type_t::LANDSCAPE_SECONDARY; 39454-#endif 39455+ return default_portrait 39456+ ? cef_screen_orientation_type_t::LANDSCAPE_PRIMARY 39457+ : cef_screen_orientation_type_t::LANDSCAPE_SECONDARY; 39458 // Now ohos platform don't hava sensor orientation. 39459 // Will be support later. 39460 case OHOS::NWeb::OrientationType::SENSOR: 39461@@ -62,33 +56,23 @@ cef_screen_orientation_type_t ConvertOrientationType( 39462 } 39463 } 39464 39465-uint16_t ConvertRotationAngel(OHOS::NWeb::RotationType type) { 39466+uint16_t ConvertRotationAngel(OHOS::NWeb::RotationType type, 39467+ bool default_portrait) { 39468 // Notice: 90 and 270 is reverse. 39469 switch (type) { 39470-#if defined(DEFAULT_PORTRAIT) 39471 case OHOS::NWeb::RotationType::ROTATION_0: 39472- return 0; 39473+ return default_portrait ? 0 : 90; 39474 case OHOS::NWeb::RotationType::ROTATION_90: 39475- return 270; 39476+ return default_portrait ? 270 : 0; 39477 case OHOS::NWeb::RotationType::ROTATION_180: 39478- return 180; 39479+ return default_portrait ? 180 : 270; 39480 case OHOS::NWeb::RotationType::ROTATION_270: 39481- return 90; 39482-#else 39483- case OHOS::NWeb::RotationType::ROTATION_0: 39484- return 90; 39485- case OHOS::NWeb::RotationType::ROTATION_90: 39486- return 0; 39487- case OHOS::NWeb::RotationType::ROTATION_180: 39488- return 270; 39489- case OHOS::NWeb::RotationType::ROTATION_270: 39490- return 180; 39491-#endif 39492+ return default_portrait ? 90 : 180; 39493 default: 39494 return 0; 39495 } 39496 } 39497-} 39498+} // namespace 39499 39500 namespace OHOS::NWeb { 39501 // static 39502@@ -130,24 +114,22 @@ void NWebRenderHandler::GetViewRect(CefRefPtr<CefBrowser> browser, 39503 return; 39504 } 39505 39506-void NWebRenderHandler::SetScreenInfo(RotationType rotation, 39507- OrientationType orientation, 39508- int width, 39509- int height, 39510- double display_ratio) { 39511- rotation_ = rotation; 39512- orientation_ = orientation; 39513- screen_width_ = width; 39514- screen_height_ = height; 39515- display_ratio_ = display_ratio; 39516+void NWebRenderHandler::SetScreenInfo(const NWebScreenInfo& screen_info) { 39517+ screen_info_ = screen_info; 39518 } 39519 39520 bool NWebRenderHandler::GetScreenInfo(CefRefPtr<CefBrowser> browser, 39521 CefScreenInfo& screen_info) { 39522- screen_info.orientation = ConvertOrientationType(orientation_); 39523- screen_info.angle = ConvertRotationAngel(rotation_); 39524- screen_info.rect.width = screen_width_; 39525- screen_info.rect.height = screen_height_; 39526+ screen_info.orientation = ConvertOrientationType( 39527+ screen_info_.orientation, screen_info_.default_portrait); 39528+ screen_info.angle = ConvertRotationAngel(screen_info_.rotation, 39529+ screen_info_.default_portrait); 39530+ screen_info.rect.width = screen_info_.width; 39531+ screen_info.rect.height = screen_info_.height; 39532+ 39533+ // TODO: currently display dont have interface to get. We use fix value instead. 39534+ screen_info.depth = 24; 39535+ screen_info.depth_per_component = 8; 39536 return true; 39537 } 39538 39539@@ -186,8 +168,8 @@ void NWebRenderHandler::OnRootLayerChanged(CefRefPtr<CefBrowser> browser, 39540 } 39541 39542 void NWebRenderHandler::OnScrollOffsetChanged(CefRefPtr<CefBrowser> browser, 39543- double x, 39544- double y) { 39545+ double x, 39546+ double y) { 39547 if (auto handler = handler_.lock()) { 39548 handler->OnScroll(x, y); 39549 } 39550@@ -215,8 +197,10 @@ void NWebRenderHandler::OnTextSelectionChanged(CefRefPtr<CefBrowser> browser, 39551 39552 void NWebRenderHandler::OnVirtualKeyboardRequested( 39553 CefRefPtr<CefBrowser> browser, 39554- TextInputMode input_mode, bool show_keyboard) { 39555- LOG(INFO) << "NWebRenderHandler::OnVirtualKeyboardRequested input_mode = " << input_mode << ", show_keyboard = " << show_keyboard; 39556+ TextInputMode input_mode, 39557+ bool show_keyboard) { 39558+ LOG(INFO) << "NWebRenderHandler::OnVirtualKeyboardRequested input_mode = " 39559+ << input_mode << ", show_keyboard = " << show_keyboard; 39560 39561 if (inputmethod_client_) { 39562 if (input_mode != CEF_TEXT_INPUT_MODE_NONE) { 39563@@ -234,17 +218,20 @@ void NWebRenderHandler::GetTouchHandleSize( 39564 // TODO: need to refactor in 3.2.8.1 use arkui refactor. 39565 size.width = 20; 39566 size.height = 20; 39567- if (display_ratio_ <= 0.0) { 39568- LOG(ERROR) << "invalid display_ratio_, display_ratio_ = " << display_ratio_; 39569+ if (screen_info_.display_ratio <= 0.0) { 39570+ LOG(ERROR) << "invalid display_ratio_, display_ratio_ = " 39571+ << screen_info_.display_ratio; 39572 return; 39573 } 39574- if (display_ratio_ <= 1) { 39575+ if (screen_info_.display_ratio <= 1) { 39576 return; 39577- } else if (display_ratio_ > 1 && display_ratio_ < 1.7) { 39578+ } else if (screen_info_.display_ratio > 1 && 39579+ screen_info_.display_ratio < 1.7) { 39580 // rk 39581 size.width = 30; 39582 size.height = 30; 39583- } else if (display_ratio_ >= 1.7 && display_ratio_ < 2.5) { 39584+ } else if (screen_info_.display_ratio >= 1.7 && 39585+ screen_info_.display_ratio < 2.5) { 39586 // wgr 39587 size.width = 40; 39588 size.height = 40; 39589@@ -253,20 +240,26 @@ void NWebRenderHandler::GetTouchHandleSize( 39590 size.width = 60; 39591 size.height = 60; 39592 } 39593+ LOG(ERROR) << "GetTouchHandleSize " << size.width << " " << size.height; 39594 } 39595 39596 std::shared_ptr<NWebTouchHandleState> NWebRenderHandler::GetTouchHandleState( 39597 NWebTouchHandleState::TouchHandleType type) { 39598 switch (type) { 39599 case NWebTouchHandleState::TouchHandleType::INSERT_HANDLE: 39600- return insert_handle_.enabled ? 39601- std::make_shared<NWebTouchHandleStateImpl>(insert_handle_) : nullptr; 39602+ return insert_handle_.enabled 39603+ ? std::make_shared<NWebTouchHandleStateImpl>(insert_handle_) 39604+ : nullptr; 39605 case NWebTouchHandleState::TouchHandleType::SELECTION_BEGIN_HANDLE: 39606- return start_selection_handle_.enabled ? 39607- std::make_shared<NWebTouchHandleStateImpl>(start_selection_handle_) : nullptr; 39608+ return start_selection_handle_.enabled 39609+ ? std::make_shared<NWebTouchHandleStateImpl>( 39610+ start_selection_handle_) 39611+ : nullptr; 39612 case NWebTouchHandleState::TouchHandleType::SELECTION_END_HANDLE: 39613- return end_selection_handle_.enabled ? 39614- std::make_shared<NWebTouchHandleStateImpl>(end_selection_handle_) : nullptr; 39615+ return end_selection_handle_.enabled 39616+ ? std::make_shared<NWebTouchHandleStateImpl>( 39617+ end_selection_handle_) 39618+ : nullptr; 39619 default: 39620 return nullptr; 39621 } 39622@@ -285,9 +278,9 @@ void NWebRenderHandler::OnTouchSelectionChanged( 39623 } 39624 if (auto handler = handler_.lock()) { 39625 handler->OnTouchSelectionChanged( 39626- std::make_shared<NWebTouchHandleStateImpl>(insert_handle_), 39627- std::make_shared<NWebTouchHandleStateImpl>(start_selection_handle_), 39628- std::make_shared<NWebTouchHandleStateImpl>(end_selection_handle_)); 39629+ std::make_shared<NWebTouchHandleStateImpl>(insert_handle_), 39630+ std::make_shared<NWebTouchHandleStateImpl>(start_selection_handle_), 39631+ std::make_shared<NWebTouchHandleStateImpl>(end_selection_handle_)); 39632 } 39633 } 39634 39635@@ -296,7 +289,8 @@ bool NWebRenderHandler::StartDragging(CefRefPtr<CefBrowser> browser, 39636 DragOperationsMask allowed_ops, 39637 int x, 39638 int y) { 39639- LOG(INFO) << "received start dragging callback, operation = " << allowed_ops << ", x = " << x << ", y = " << y; 39640+ LOG(INFO) << "received start dragging callback, operation = " << allowed_ops 39641+ << ", x = " << x << ", y = " << y; 39642 if (!drag_data && !drag_data->HasImage()) { 39643 LOG(ERROR) << "drag data invalid"; 39644 return false; 39645@@ -310,7 +304,8 @@ bool NWebRenderHandler::StartDragging(CefRefPtr<CefBrowser> browser, 39646 39647 int width; 39648 int height; 39649- auto bitmap = image->GetAsBitmap(1, CEF_COLOR_TYPE_BGRA_8888, CEF_ALPHA_TYPE_OPAQUE, width, height); 39650+ auto bitmap = image->GetAsBitmap(1, CEF_COLOR_TYPE_BGRA_8888, 39651+ CEF_ALPHA_TYPE_OPAQUE, width, height); 39652 if (!bitmap) { 39653 LOG(ERROR) << "drag data bitmap invalid"; 39654 return false; 39655@@ -329,7 +324,8 @@ bool NWebRenderHandler::StartDragging(CefRefPtr<CefBrowser> browser, 39656 return false; 39657 } 39658 39659- LOG(INFO) << "drag image width : " << width << ", height : " << height<< ", buffer size : " << read_size; 39660+ LOG(INFO) << "drag image width : " << width << ", height : " << height 39661+ << ", buffer size : " << read_size; 39662 auto handler = handler_.lock(); 39663 if (handler == nullptr) { 39664 LOG(ERROR) << "can't get strong ptr with handler"; 39665diff --git a/src/ohos_nweb/src/cef_delegate/nweb_render_handler.h b/src/ohos_nweb/src/cef_delegate/nweb_render_handler.h 39666index 2f0684513b74f..d871ffd077b26 39667--- a/src/ohos_nweb/src/cef_delegate/nweb_render_handler.h 39668+++ b/src/ohos_nweb/src/cef_delegate/nweb_render_handler.h 39669@@ -26,6 +26,15 @@ 39670 #include "nweb_touch_handle_state_impl.h" 39671 39672 namespace OHOS::NWeb { 39673+struct NWebScreenInfo { 39674+ RotationType rotation = RotationType::ROTATION_0;; 39675+ OrientationType orientation = OrientationType::UNSPECIFIED; 39676+ int width = 0; 39677+ int height = 0; 39678+ double display_ratio = -1.0; 39679+ bool default_portrait = false; 39680+}; 39681+ 39682 class NWebRenderHandler : public CefRenderHandler { 39683 public: 39684 static CefRefPtr<NWebRenderHandler> Create(); 39685@@ -35,8 +44,7 @@ class NWebRenderHandler : public CefRenderHandler { 39686 void RegisterRenderCb(std::function<void(const char*)> render_update_cb); 39687 void RegisterNWebHandler(std::shared_ptr<NWebHandler> handler); 39688 void Resize(uint32_t width, uint32_t height); 39689- void SetScreenInfo(RotationType rotation, OrientationType orientation, 39690- int width, int height, double display_ratio); 39691+ void SetScreenInfo(const NWebScreenInfo& screen_info); 39692 int ContentHeight(); 39693 void SetInputMethodClient(CefRefPtr<NWebInputMethodClient> client); 39694 39695@@ -92,6 +100,8 @@ class NWebRenderHandler : public CefRenderHandler { 39696 39697 CefRefPtr<CefDragData> GetDragData(); 39698 39699+ float GetVirtualPixelRatio() const { return screen_info_.display_ratio; } 39700+ 39701 // Include the default reference counting implementation. 39702 IMPLEMENT_REFCOUNTING(NWebRenderHandler); 39703 39704@@ -100,13 +110,9 @@ class NWebRenderHandler : public CefRenderHandler { 39705 CefRefPtr<NWebInputMethodClient> inputmethod_client_ = nullptr; 39706 uint32_t width_ = 0; 39707 uint32_t height_ = 0; 39708- RotationType rotation_ = RotationType::ROTATION_0; 39709- OrientationType orientation_ = OrientationType::UNSPECIFIED; 39710 int content_height_ = 0; 39711 int content_width_ = 0; 39712- double display_ratio_ = -1.0; 39713- uint32_t screen_width_ = 0; 39714- uint32_t screen_height_ = 0; 39715+ NWebScreenInfo screen_info_; 39716 39717 std::weak_ptr<NWebHandler> handler_; 39718 CefTouchHandleState insert_handle_; 39719diff --git a/src/ohos_nweb/src/cef_delegate/nweb_select_popup_menu_callback.cc b/src/ohos_nweb/src/cef_delegate/nweb_select_popup_menu_callback.cc 39720new file mode 100644 39721index 0000000000000..0a97d72f55ddb 39722--- /dev/null 39723+++ b/src/ohos_nweb/src/cef_delegate/nweb_select_popup_menu_callback.cc 39724@@ -0,0 +1,35 @@ 39725+/* 39726+ * Copyright (c) 2023 Huawei Device Co., Ltd. 39727+ * Licensed under the Apache License, Version 2.0 (the "License"); 39728+ * you may not use this file except in compliance with the License. 39729+ * You may obtain a copy of the License at 39730+ * 39731+ * http://www.apache.org/licenses/LICENSE-2.0 39732+ * 39733+ * Unless required by applicable law or agreed to in writing, software 39734+ * distributed under the License is distributed on an "AS IS" BASIS, 39735+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 39736+ * See the License for the specific language governing permissions and 39737+ * limitations under the License. 39738+ */ 39739+ 39740+#include "nweb_select_popup_menu_callback.h" 39741+ 39742+namespace OHOS::NWeb { 39743+NWebSelectPopupMenuCallbackImpl::NWebSelectPopupMenuCallbackImpl( 39744+ CefRefPtr<CefSelectPopupCallback> callback) 39745+ : callback_(callback) {} 39746+ 39747+void NWebSelectPopupMenuCallbackImpl::Continue( 39748+ const std::vector<int32_t>& indices) { 39749+ if (callback_) { 39750+ callback_->Continue(indices); 39751+ } 39752+} 39753+ 39754+void NWebSelectPopupMenuCallbackImpl::Cancel() { 39755+ if (callback_) { 39756+ callback_->Cancel(); 39757+ } 39758+} 39759+} // namespace OHOS::NWeb 39760\ No newline at end of file 39761diff --git a/src/ohos_nweb/src/cef_delegate/nweb_select_popup_menu_callback.h b/src/ohos_nweb/src/cef_delegate/nweb_select_popup_menu_callback.h 39762new file mode 100644 39763index 0000000000000..0f210c9eb2788 39764--- /dev/null 39765+++ b/src/ohos_nweb/src/cef_delegate/nweb_select_popup_menu_callback.h 39766@@ -0,0 +1,36 @@ 39767+/* 39768+ * Copyright (c) 2023 Huawei Device Co., Ltd. 39769+ * Licensed under the Apache License, Version 2.0 (the "License"); 39770+ * you may not use this file except in compliance with the License. 39771+ * You may obtain a copy of the License at 39772+ * 39773+ * http://www.apache.org/licenses/LICENSE-2.0 39774+ * 39775+ * Unless required by applicable law or agreed to in writing, software 39776+ * distributed under the License is distributed on an "AS IS" BASIS, 39777+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 39778+ * See the License for the specific language governing permissions and 39779+ * limitations under the License. 39780+ */ 39781+ 39782+#ifndef NWEB_SELECT_POPUP_MENU_CALLBACK_H 39783+#define NWEB_SELECT_POPUP_MENU_CALLBACK_H 39784+ 39785+#include "cef/include/cef_dialog_handler.h" 39786+#include "nweb_select_popup_menu.h" 39787+ 39788+namespace OHOS::NWeb { 39789+class NWebSelectPopupMenuCallbackImpl : public NWebSelectPopupMenuCallback { 39790+ public: 39791+ NWebSelectPopupMenuCallbackImpl() = default; 39792+ explicit NWebSelectPopupMenuCallbackImpl( 39793+ CefRefPtr<CefSelectPopupCallback> callback); 39794+ ~NWebSelectPopupMenuCallbackImpl() = default; 39795+ void Continue(const std::vector<int32_t>& indices) override; 39796+ void Cancel() override; 39797+ 39798+ private: 39799+ CefRefPtr<CefSelectPopupCallback> callback_ = nullptr; 39800+}; 39801+} // namespace OHOS::NWeb 39802+#endif 39803\ No newline at end of file 39804diff --git a/src/ohos_nweb/src/nweb_data_base_impl.cc b/src/ohos_nweb/src/nweb_data_base_impl.cc 39805index 962f3552f65bd..0419148be6d41 39806--- a/src/ohos_nweb/src/nweb_data_base_impl.cc 39807+++ b/src/ohos_nweb/src/nweb_data_base_impl.cc 39808@@ -48,16 +48,15 @@ void NWebDataBaseImpl::DeleteHttpAuthCredentials() { 39809 void NWebDataBaseImpl::SaveHttpAuthCredentials(const std::string& host, const std::string& realm, 39810 const std::string& username, const char* password) { 39811 if (delegate_ != nullptr) { 39812- return delegate_->SaveHttpAuthCredentials(host, realm, username, password); 39813+ delegate_->SaveHttpAuthCredentials(host, realm, username, password); 39814 } 39815 } 39816 39817-std::vector<std::string> NWebDataBaseImpl::GetHttpAuthCredentials(const std::string& host, 39818- const std::string& realm) const { 39819+void NWebDataBaseImpl::GetHttpAuthCredentials(const std::string& host, const std::string& realm, 39820+ std::string& username, char* password, uint32_t passwordSize) const { 39821 if (delegate_ != nullptr) { 39822- return delegate_->GetHttpAuthCredentials(host, realm); 39823+ delegate_->GetHttpAuthCredentials(host, realm, username, password, passwordSize); 39824 } 39825- return {}; 39826 } 39827 39828 bool NWebDataBaseImpl::ExistPermissionByOrigin(const std::string& origin, int type) 39829diff --git a/src/ohos_nweb/src/nweb_data_base_impl.h b/src/ohos_nweb/src/nweb_data_base_impl.h 39830index 4b50872ba5d0f..febf150422ed6 39831--- a/src/ohos_nweb/src/nweb_data_base_impl.h 39832+++ b/src/ohos_nweb/src/nweb_data_base_impl.h 39833@@ -35,8 +35,8 @@ class NWebDataBaseImpl : public NWebDataBase { 39834 void SaveHttpAuthCredentials(const std::string& host, const std::string& realm, 39835 const std::string& username, const char* password) override; 39836 39837- std::vector<std::string> GetHttpAuthCredentials(const std::string& host, 39838- const std::string& realm) const override; 39839+ void GetHttpAuthCredentials(const std::string& host, const std::string& realm, 39840+ std::string& username, char* password, uint32_t passwordSize) const override; 39841 39842 bool ExistPermissionByOrigin(const std::string& origin, int type) override; 39843 39844diff --git a/src/ohos_nweb/src/nweb_delegate_adapter.cc b/src/ohos_nweb/src/nweb_delegate_adapter.cc 39845index badff60157498..d770595faea5e 39846--- a/src/ohos_nweb/src/nweb_delegate_adapter.cc 39847+++ b/src/ohos_nweb/src/nweb_delegate_adapter.cc 39848@@ -25,12 +25,13 @@ namespace OHOS::NWeb { 39849 std::shared_ptr<NWebDelegateInterface> NWebDelegateAdapter::CreateNWebDelegate( 39850 int argc, 39851 const char* argv[], 39852+ bool is_enhance_surface, 39853 void* window) { 39854 #if defined(USE_CEF) 39855 std::shared_ptr<NWebDelegate> delegate = 39856 std::make_shared<NWebDelegate>(argc, argv); 39857 39858- if (delegate == nullptr || !delegate->Init(window)) { 39859+ if (delegate == nullptr || !delegate->Init(is_enhance_surface, window)) { 39860 WVLOG_I("FAIL to create nweb delegate instance"); 39861 return nullptr; 39862 } 39863diff --git a/src/ohos_nweb/src/nweb_delegate_adapter.h b/src/ohos_nweb/src/nweb_delegate_adapter.h 39864index 36eb920b24770..7fa0f7bd757c8 39865--- a/src/ohos_nweb/src/nweb_delegate_adapter.h 39866+++ b/src/ohos_nweb/src/nweb_delegate_adapter.h 39867@@ -26,6 +26,7 @@ class OHOS_NWEB_EXPORT NWebDelegateAdapter { 39868 static std::shared_ptr<NWebDelegateInterface> CreateNWebDelegate( 39869 int argc, 39870 const char* argv[], 39871+ bool is_enhance_surface, 39872 void* window); 39873 }; 39874 } 39875diff --git a/src/ohos_nweb/src/nweb_delegate_interface.h b/src/ohos_nweb/src/nweb_delegate_interface.h 39876index 4ae6bab3ada6d..ba7425c3ca4a8 39877--- a/src/ohos_nweb/src/nweb_delegate_interface.h 39878+++ b/src/ohos_nweb/src/nweb_delegate_interface.h 39879@@ -26,6 +26,7 @@ 39880 #include "nweb_find_callback.h" 39881 #include "nweb_handler.h" 39882 #include "nweb_preference.h" 39883+#include "nweb_web_message.h" 39884 39885 namespace OHOS::NWeb { 39886 enum class DelegateDragAction { 39887@@ -44,6 +45,8 @@ struct DelegateDragEvent { 39888 DelegateDragAction action; 39889 }; 39890 39891+using WebState = std::shared_ptr<std::vector<uint8_t>>; 39892+ 39893 class NWebDelegateInterface 39894 : public std::enable_shared_from_this<NWebDelegateInterface>{ 39895 public: 39896@@ -53,12 +56,15 @@ class NWebDelegateInterface 39897 virtual void OnDestroy(bool is_close_all) = 0; 39898 virtual void RegisterDownLoadListener( 39899 std::shared_ptr<NWebDownloadCallback> downloadListener) = 0; 39900+ virtual void RegisterReleaseSurfaceListener( 39901+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) = 0; 39902 virtual void RegisterNWebHandler(std::shared_ptr<NWebHandler> handler) = 0; 39903 virtual void RegisterRenderCb( 39904 std::function<void(const char*)> render_update_cb) = 0; 39905 virtual void RegisterWebAppClientExtensionListener( 39906 std::shared_ptr<NWebAppClientExtensionCallback> 39907 web_app_client_extension_listener) = 0; 39908+ virtual void UnRegisterWebAppClientExtensionListener() = 0; 39909 virtual void SetInputMethodClient( 39910 CefRefPtr<NWebInputMethodClient> client) = 0; 39911 39912@@ -103,9 +109,9 @@ class NWebDelegateInterface 39913 virtual void CreateWebMessagePorts(std::vector<std::string>& ports) = 0; 39914 virtual void PostWebMessage(std::string& message, std::vector<std::string>& ports, std::string& targetUri) = 0; 39915 virtual void ClosePort(std::string& portHandle) = 0; 39916- virtual void PostPortMessage(std::string& portHandle, std::string& data) = 0; 39917+ virtual void PostPortMessage(std::string& portHandle, std::shared_ptr<NWebMessage> data) = 0; 39918 virtual void SetPortMessageCallback(std::string& portHandle, 39919- std::shared_ptr<NWebValueCallback<std::string>> callback) = 0; 39920+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) = 0; 39921 virtual HitTestResult GetHitTestResult() const = 0; 39922 virtual int PageLoadProgress() = 0; 39923 virtual float Scale() = 0; 39924@@ -151,8 +157,23 @@ class NWebDelegateInterface 39925 39926 virtual void SendDragEvent(const DelegateDragEvent& dragEvent) const = 0; 39927 virtual std::string GetUrl() const = 0; 39928+ virtual const std::string GetOriginalUrl() = 0; 39929+ virtual bool GetFavicon(const void** data, size_t& width, size_t& height, 39930+ ImageColorType& colorType, ImageAlphaType& alphaType) = 0; 39931+ virtual void PutNetworkAvailable(bool available) = 0; 39932 39933 virtual CefRefPtr<CefClient> GetCefClient() const = 0; 39934+ 39935+ virtual void GetImages(std::shared_ptr<NWebValueCallback<bool>> callback) = 0; 39936+ virtual void RemoveCache(bool include_disk_files) = 0; 39937+ virtual std::shared_ptr<NWebHistoryList> GetHistoryList() = 0; 39938+ virtual WebState SerializeWebState() = 0; 39939+ virtual bool RestoreWebState(WebState state) = 0; 39940+ virtual void PageUp(bool top) = 0; 39941+ virtual void PageDown(bool bottom) = 0; 39942+ virtual void ScrollTo(float x, float y) = 0; 39943+ virtual void ScrollBy(float delta_x, float delta_y) = 0; 39944+ virtual void SlideScroll(float vx, float vy) = 0; 39945 }; 39946 } // namespace OHOS::NWeb 39947 39948diff --git a/src/ohos_nweb/src/nweb_impl.cc b/src/ohos_nweb/src/nweb_impl.cc 39949index 5c27fac19c62a..ca4bbfcc0e5ef 39950--- a/src/ohos_nweb/src/nweb_impl.cc 39951+++ b/src/ohos_nweb/src/nweb_impl.cc 39952@@ -19,6 +19,7 @@ 39953 #include <cerrno> 39954 #include <iostream> 39955 #include <map> 39956+#include <memory> 39957 #include <string> 39958 #include <thread> 39959 39960@@ -47,51 +48,32 @@ bool g_browser_service_api_enabled = false; 39961 #endif 39962 } 39963 39964-using namespace OHOS::NWeb; 39965-extern "C" OHOS_NWEB_EXPORT NWeb* CreateNWeb( 39966- const NWebCreateInfo& create_info) { 39967- static uint32_t current_nweb_id = 0; 39968- uint32_t nweb_id = ++current_nweb_id; 39969- TRACE_EVENT1("NWebImpl", "NWebImpl | CreateNWeb", "nweb_id", nweb_id); 39970- WVLOG_I("creating nweb %{public}u, size %{public}u*%{public}u", nweb_id, 39971- create_info.width, create_info.height); 39972- auto nweb = new NWebImpl(nweb_id); 39973- if (nweb == nullptr) { 39974- WVLOG_E("fail to create nweb instance"); 39975- return nullptr; 39976- } 39977- 39978- if (!nweb->Init(create_info)) { 39979- WVLOG_E("fail to init nweb"); 39980- delete nweb; 39981- return nullptr; 39982- } 39983- 39984- ++g_nweb_count; 39985-#if defined(REPORT_SYS_EVENT) 39986- // Report nweb instance count 39987- if (g_nweb_count > g_nweb_max_count) { 39988- g_nweb_max_count = g_nweb_count; 39989- } 39990- ReportMultiInstanceStats(nweb_id, g_nweb_count, g_nweb_max_count); 39991-#endif 39992- return nweb; 39993-} 39994- 39995 namespace OHOS::NWeb { 39996 39997 // For NWebEx 39998-typedef std::unordered_map<int32_t, NWebImpl*> NWebMap; 39999+typedef std::unordered_map<int32_t, std::weak_ptr<NWebImpl>> NWebMap; 40000 base::LazyInstance<NWebMap>::DestructorAtExit g_nweb_map = 40001 LAZY_INSTANCE_INITIALIZER; 40002 40003 base::LazyInstance<std::vector<std::string>>::DestructorAtExit g_browser_args = 40004 LAZY_INSTANCE_INITIALIZER; 40005 40006+void NWebImpl::AddNWebToMap(uint32_t id, std::shared_ptr<NWebImpl>& nweb) { 40007+ if (nweb) { 40008+ std::weak_ptr<NWebImpl> nweb_weak(nweb); 40009+ g_nweb_map.Get().emplace(id, nweb_weak); 40010+ } 40011+} 40012+ 40013 NWebImpl* NWebImpl::FromID(int32_t nweb_id) { 40014 NWebMap* map = g_nweb_map.Pointer(); 40015- auto it = map->find(nweb_id); 40016- return it == map->end() ? nullptr : it->second; 40017+ if (auto it = map->find(nweb_id); it != map->end()) { 40018+ auto nweb = it->second.lock(); 40019+ if (nweb) { 40020+ return nweb.get(); 40021+ } 40022+ } 40023+ return nullptr; 40024 } 40025 40026 void NWebImpl::InitBrowserServiceApi(std::vector<std::string>& browser_args) { 40027@@ -107,9 +89,7 @@ bool NWebImpl::GetBrowserServiceApiEnabled() { 40028 return g_browser_service_api_enabled; 40029 } 40030 40031-NWebImpl::NWebImpl(uint32_t id) : nweb_id_(id) { 40032- g_nweb_map.Get().emplace(id, this); 40033-} 40034+NWebImpl::NWebImpl(uint32_t id) : nweb_id_(id) {} 40035 40036 NWebImpl::~NWebImpl() { 40037 g_nweb_map.Get().erase(nweb_id_); 40038@@ -190,15 +170,22 @@ bool NWebImpl::InitWebEngine(const NWebCreateInfo& create_info) { 40039 argv[i] = it->c_str(); 40040 } 40041 40042- void* window = 40043+ bool is_enhance_surface = create_info.init_args.is_enhance_surface; 40044+ void* window = nullptr; 40045+ if (is_enhance_surface) { 40046+ window = create_info.enhance_surface_info; 40047+ } else { 40048+ window = 40049 reinterpret_cast<void*>(output_handler_->GetNativeWindowFromSurface( 40050 create_info.producer_surface)); 40051+ } 40052+ 40053 if (window == nullptr) { 40054 WVLOG_E("fail to init web engine, get native window from surface failed"); 40055 delete[] argv; 40056 return false; 40057 } 40058- nweb_delegate_ = NWebDelegateAdapter::CreateNWebDelegate(argc, argv, window); 40059+ nweb_delegate_ = NWebDelegateAdapter::CreateNWebDelegate(argc, argv, is_enhance_surface, window); 40060 if (nweb_delegate_ == nullptr) { 40061 WVLOG_E("fail to create nweb delegate of web engine"); 40062 delete[] argv; 40063@@ -231,6 +218,7 @@ bool NWebImpl::InitWebEngine(const NWebCreateInfo& create_info) { 40064 void NWebImpl::InitWebEngineArgs(const NWebInitArgs& init_args) { 40065 web_engine_args_.clear(); 40066 40067+ WVLOG_E("===OH=== InitWebEngineArgs 60fps"); 40068 auto args = g_browser_args.Get(); 40069 for (const std::string& arg : args) { 40070 web_engine_args_.emplace_back(arg); 40071@@ -245,7 +233,7 @@ void NWebImpl::InitWebEngineArgs(const NWebInitArgs& init_args) { 40072 #ifdef RK3568 40073 web_engine_args_.emplace_back("--off-screen-frame-rate=70"); 40074 #else 40075- web_engine_args_.emplace_back("--off-screen-frame-rate=65"); 40076+ web_engine_args_.emplace_back("--off-screen-frame-rate=60"); 40077 #endif 40078 web_engine_args_.emplace_back("--no-unsandboxed-zygote"); 40079 web_engine_args_.emplace_back("--no-zygote"); 40080@@ -260,7 +248,10 @@ void NWebImpl::InitWebEngineArgs(const NWebInitArgs& init_args) { 40081 web_engine_args_.emplace_back("--zygote-cmd-prefix=/system/bin/web_render"); 40082 web_engine_args_.emplace_back("--remote-debugging-port=9222"); 40083 web_engine_args_.emplace_back("--enable-touch-drag-drop"); 40084- 40085+ if (init_args.is_enhance_surface) { 40086+ WVLOG_I("is_enhance_surface is true"); 40087+ web_engine_args_.emplace_back("--ohos-enhance-surface"); 40088+ } 40089 for (auto arg : init_args.web_engine_args_to_delete) { 40090 auto it = std::find(web_engine_args_.begin(), web_engine_args_.end(), arg); 40091 if (it != web_engine_args_.end()) { 40092@@ -287,6 +278,10 @@ void NWebImpl::PutWebAppClientExtensionCallback( 40093 web_app_client_extension_listener); 40094 } 40095 40096+void NWebImpl::RemoveWebAppClientExtensionCallback() { 40097+ nweb_delegate_->UnRegisterWebAppClientExtensionListener(); 40098+} 40099+ 40100 void NWebImpl::SetNWebHandler(std::shared_ptr<NWebHandler> client) { 40101 nweb_handle_ = client; 40102 nweb_delegate_->RegisterNWebHandler(client); 40103@@ -511,7 +506,7 @@ void NWebImpl::OnPause() const { 40104 if (inputmethod_handler_ == nullptr) { 40105 return; 40106 } 40107- inputmethod_handler_->HideTextInput(); 40108+ inputmethod_handler_->HideTextInput(NWebInputMethodClient::HideTextinputType::FROM_ONPAUSE); 40109 } 40110 40111 void NWebImpl::OnContinue() const { 40112@@ -519,6 +514,7 @@ void NWebImpl::OnContinue() const { 40113 return; 40114 } 40115 nweb_delegate_->OnContinue(); 40116+ inputmethod_handler_->Reattach(NWebInputMethodHandler::ReattachType::FROM_CONTINUE); 40117 } 40118 40119 const std::shared_ptr<NWebPreference> NWebImpl::GetPreference() const { 40120@@ -560,7 +556,7 @@ void NWebImpl::ClosePort(std::string& portHandle) { 40121 nweb_delegate_->ClosePort(portHandle); 40122 } 40123 40124-void NWebImpl::PostPortMessage(std::string& portHandle, std::string& data) { 40125+void NWebImpl::PostPortMessage(std::string& portHandle, std::shared_ptr<NWebMessage> data) { 40126 if (nweb_delegate_ == nullptr) { 40127 WVLOG_E("JSAPI nweb_delegate_ its null"); 40128 return; 40129@@ -569,7 +565,7 @@ void NWebImpl::PostPortMessage(std::string& portHandle, std::string& data) { 40130 } 40131 40132 void NWebImpl::SetPortMessageCallback(std::string& portHandle, 40133- std::shared_ptr<NWebValueCallback<std::string>> callback) { 40134+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) { 40135 if (nweb_delegate_ == nullptr) { 40136 WVLOG_E("JSAPI nweb_delegate_ its null"); 40137 return; 40138@@ -675,6 +671,11 @@ void NWebImpl::OnFocus() const { 40139 return; 40140 } 40141 nweb_delegate_->OnFocus(); 40142+ 40143+ if (inputmethod_handler_ == nullptr) { 40144+ return; 40145+ } 40146+ inputmethod_handler_->Reattach(NWebInputMethodHandler::ReattachType::FROM_ONFOCUS); 40147 } 40148 40149 void NWebImpl::OnBlur() const { 40150@@ -685,7 +686,7 @@ void NWebImpl::OnBlur() const { 40151 if (inputmethod_handler_ == nullptr) { 40152 return; 40153 } 40154- inputmethod_handler_->HideTextInput(); 40155+ inputmethod_handler_->HideTextInput(NWebInputMethodClient::HideTextinputType::FROM_ONBLUR); 40156 } 40157 40158 void NWebImpl::ReloadOriginalUrl() const { 40159@@ -767,10 +768,148 @@ void NWebImpl::UpdateLocale(const std::string& language, const std::string& regi 40160 } 40161 nweb_delegate_->UpdateLocale(language, region); 40162 } 40163+ 40164+void NWebImpl::PutReleaseSurfaceCallback( 40165+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) { 40166+ nweb_delegate_->RegisterReleaseSurfaceListener(releaseSurfaceListener); 40167+} 40168+ 40169+const std::string NWebImpl::GetOriginalUrl() const { 40170+ if (nweb_delegate_ == nullptr) { 40171+ WVLOG_E("nweb_delegate_ is null"); 40172+ return std::string(); 40173+ } 40174+ return nweb_delegate_->GetOriginalUrl(); 40175+} 40176+ 40177+bool NWebImpl::GetFavicon(const void** data, size_t& width, size_t& height, 40178+ ImageColorType& colorType, ImageAlphaType& alphaType) { 40179+ if (nweb_delegate_ == nullptr) { 40180+ WVLOG_E("nweb_delegate_ is null"); 40181+ return false; 40182+ } 40183+ return nweb_delegate_->GetFavicon(data, width, height, colorType, alphaType); 40184+} 40185+ 40186+void NWebImpl::PutNetworkAvailable(bool available) { 40187+ if (nweb_delegate_ == nullptr) { 40188+ WVLOG_E("nweb_delegate_ is null"); 40189+ return; 40190+ } 40191+ nweb_delegate_->PutNetworkAvailable(available); 40192+} 40193+ 40194+void NWebImpl::HasImages(std::shared_ptr<NWebValueCallback<bool>> callback) { 40195+ if (nweb_delegate_ == nullptr) { 40196+ WVLOG_E("JSAPI HasImages nweb_delegate_ is null"); 40197+ return; 40198+ } 40199+ 40200+ nweb_delegate_->GetImages(callback); 40201+} 40202+ 40203+std::shared_ptr<NWebHistoryList> NWebImpl::GetHistoryList() { 40204+ if (nweb_delegate_ == nullptr) { 40205+ return nullptr; 40206+ } 40207+ 40208+ return nweb_delegate_->GetHistoryList(); 40209+} 40210+ 40211+void NWebImpl::RemoveCache(bool include_disk_files) { 40212+ if (nweb_delegate_ == nullptr) { 40213+ WVLOG_E("JSAPI RemoveCache nweb_delegate_ is null"); 40214+ return; 40215+ } 40216+ 40217+ nweb_delegate_->RemoveCache(include_disk_files); 40218+} 40219+ 40220+WebState NWebImpl::SerializeWebState() { 40221+ if (nweb_delegate_ == nullptr) { 40222+ return nullptr; 40223+ } 40224+ return nweb_delegate_->SerializeWebState(); 40225+} 40226+ 40227+bool NWebImpl::RestoreWebState(WebState state) { 40228+ if (nweb_delegate_ == nullptr) { 40229+ return false; 40230+ } 40231+ return nweb_delegate_->RestoreWebState(state); 40232+} 40233+ 40234+void NWebImpl::PageUp(bool top) { 40235+ if (nweb_delegate_ == nullptr) { 40236+ return; 40237+ } 40238+ return nweb_delegate_->PageUp(top); 40239+} 40240+ 40241+void NWebImpl::PageDown(bool bottom) { 40242+ if (nweb_delegate_ == nullptr) { 40243+ return; 40244+ } 40245+ return nweb_delegate_->PageDown(bottom); 40246+} 40247+ 40248+void NWebImpl::ScrollTo(float x, float y) { 40249+ if (nweb_delegate_ == nullptr) { 40250+ return; 40251+ } 40252+ return nweb_delegate_->ScrollTo(x, y); 40253+} 40254+ 40255+void NWebImpl::ScrollBy(float delta_x, float delta_y) { 40256+ if (nweb_delegate_ == nullptr) { 40257+ return; 40258+ } 40259+ return nweb_delegate_->ScrollBy(delta_x, delta_y); 40260+} 40261+ 40262+void NWebImpl::SlideScroll(float vx, float vy) { 40263+ if (nweb_delegate_ == nullptr) { 40264+ return; 40265+ } 40266+ return nweb_delegate_->SlideScroll(vx, vy); 40267+} 40268+ 40269 } // namespace OHOS::NWeb 40270 40271-extern "C" OHOS_NWEB_EXPORT NWeb* GetNWeb(int32_t nweb_id) { 40272+using namespace OHOS::NWeb; 40273+extern "C" OHOS_NWEB_EXPORT void CreateNWeb(const NWebCreateInfo& create_info, 40274+ std::shared_ptr<NWebImpl>& nweb) { 40275+ static uint32_t current_nweb_id = 0; 40276+ uint32_t nweb_id = ++current_nweb_id; 40277+ TRACE_EVENT1("NWebImpl", "NWebImpl | CreateNWeb", "nweb_id", nweb_id); 40278+ WVLOG_I("creating nweb %{public}u, size %{public}u*%{public}u", nweb_id, 40279+ create_info.width, create_info.height); 40280+ nweb = std::make_shared<NWebImpl>(nweb_id); 40281+ if (nweb == nullptr) { 40282+ WVLOG_E("fail to create nweb instance"); 40283+ return; 40284+ } 40285+ 40286+ if (!nweb->Init(create_info)) { 40287+ WVLOG_E("fail to init nweb"); 40288+ return; 40289+ } 40290+ 40291+ nweb->AddNWebToMap(nweb_id, nweb); 40292+ ++g_nweb_count; 40293+#if defined(REPORT_SYS_EVENT) 40294+ // Report nweb instance count 40295+ if (g_nweb_count > g_nweb_max_count) { 40296+ g_nweb_max_count = g_nweb_count; 40297+ } 40298+ ReportMultiInstanceStats(nweb_id, g_nweb_count, g_nweb_max_count); 40299+#endif 40300+} 40301+ 40302+extern "C" OHOS_NWEB_EXPORT void GetNWeb(int32_t nweb_id, 40303+ std::weak_ptr<NWebImpl>& nweb) { 40304 NWebMap* map = OHOS::NWeb::g_nweb_map.Pointer(); 40305- auto it = map->find(nweb_id); 40306- return it == map->end() ? nullptr : it->second; 40307+ if (auto it = map->find(nweb_id); it != map->end()) { 40308+ nweb = it->second; 40309+ } 40310 } 40311diff --git a/src/ohos_nweb/src/nweb_impl.h b/src/ohos_nweb/src/nweb_impl.h 40312index 54d42f014c3e2..7c71ae7550fb2 40313--- a/src/ohos_nweb/src/nweb_impl.h 40314+++ b/src/ohos_nweb/src/nweb_impl.h 40315@@ -76,15 +76,17 @@ class NWebImpl : public NWeb { 40316 const std::shared_ptr<NWebPreference> GetPreference() const override; 40317 void PutDownloadCallback( 40318 std::shared_ptr<NWebDownloadCallback> downloadListener) override; 40319+ void PutReleaseSurfaceCallback( 40320+ std::shared_ptr<NWebReleaseSurfaceCallback> releaseSurfaceListener) override; 40321 void SetNWebHandler(std::shared_ptr<NWebHandler> handler) override; 40322 const std::shared_ptr<NWebHandler> GetNWebHandler() const override; 40323 std::string Title() override; 40324 void CreateWebMessagePorts(std::vector<std::string>& ports) override; 40325 void PostWebMessage(std::string& message, std::vector<std::string>& ports, std::string& targetUri) override; 40326 void ClosePort(std::string& port_handle) override; 40327- void PostPortMessage(std::string& port_handle, std::string& data) override; 40328+ void PostPortMessage(std::string& port_handle, std::shared_ptr<NWebMessage> data) override; 40329 void SetPortMessageCallback(std::string& port_handle, 40330- std::shared_ptr<NWebValueCallback<std::string>> callback) override; 40331+ std::shared_ptr<NWebValueCallback<std::shared_ptr<NWebMessage>>> callback) override; 40332 uint32_t GetWebId() const override; 40333 HitTestResult GetHitTestResult() const override; 40334 int PageLoadProgress() override; 40335@@ -119,10 +121,24 @@ class NWebImpl : public NWeb { 40336 void FindAllAsync(const std::string& search_string) const override; 40337 void ClearMatches() const override; 40338 void FindNext(const bool forward) const override; 40339- 40340+ const std::string GetOriginalUrl() const override; 40341+ bool GetFavicon(const void** data, size_t& width, size_t& height, 40342+ ImageColorType& colorType, ImageAlphaType& alphaType) override; 40343+ void PutNetworkAvailable(bool available) override; 40344 void SendDragEvent(const DragEvent& dragEvent) const override; 40345 void UpdateLocale(const std::string& language, const std::string& region) override; 40346 40347+ void HasImages(std::shared_ptr<NWebValueCallback<bool>> callback) override; 40348+ void RemoveCache(bool include_disk_files) override; 40349+ std::shared_ptr<NWebHistoryList> GetHistoryList() override; 40350+ WebState SerializeWebState() override; 40351+ bool RestoreWebState(WebState state) override; 40352+ void PageUp(bool top) override; 40353+ void PageDown(bool bottom) override; 40354+ void ScrollTo(float x, float y) override; 40355+ void ScrollBy(float delta_x, float delta_y) override; 40356+ void SlideScroll(float vx, float vy) override; 40357+ 40358 // For NWebEx 40359 static NWebImpl* FromID(int32_t nweb_id); 40360 void ReloadOriginalUrl() const; 40361@@ -133,10 +149,12 @@ class NWebImpl : public NWeb { 40362 void PutWebAppClientExtensionCallback( 40363 std::shared_ptr<NWebAppClientExtensionCallback> 40364 web_app_client_extension_listener); 40365+ void RemoveWebAppClientExtensionCallback(); 40366 40367 CefRefPtr<CefClient> GetCefClient() const { 40368 return nweb_delegate_->GetCefClient(); 40369 } 40370+ void AddNWebToMap(uint32_t id, std::shared_ptr<NWebImpl>& nweb); 40371 private: 40372 void ProcessInitArgs(const NWebInitArgs& init_args); 40373 void InitWebEngineArgs(const NWebInitArgs& init_args); 40374diff --git a/src/ohos_nweb/src/nweb_inputmethod_handler.cc b/src/ohos_nweb/src/nweb_inputmethod_handler.cc 40375index a6edba00d76cd..1ba435427517b 40376--- a/src/ohos_nweb/src/nweb_inputmethod_handler.cc 40377+++ b/src/ohos_nweb/src/nweb_inputmethod_handler.cc 40378@@ -79,6 +79,10 @@ class OnTextChangedListenerImpl : public OnTextChangedListener { 40379 handler_->MoveCursor(direction); 40380 } 40381 40382+ void HandleSetSelection(int32_t start, int32_t end) override {}; 40383+ void HandleExtendAction(int32_t action) override {}; 40384+ void HandleSelect(int32_t keyCode, int32_t cursorMoveSkip) override {}; 40385+ 40386 private: 40387 NWebInputMethodHandler* handler_; 40388 }; 40389@@ -108,23 +112,88 @@ NWebInputMethodHandler::~NWebInputMethodHandler() {} 40390 40391 void NWebInputMethodHandler::Attach(CefRefPtr<CefBrowser> browser, 40392 bool show_keyboard) { 40393+ show_keyboard_ = show_keyboard; 40394 composing_text_.clear(); 40395 browser_ = browser; 40396 if (inputmethod_listener_ == nullptr) { 40397 inputmethod_listener_ = new OnTextChangedListenerImpl(this); 40398 } 40399- InputMethodController::GetInstance()->Attach(inputmethod_listener_, 40400- show_keyboard); 40401+ 40402+ if (show_keyboard && isAttached_) { 40403+ LOG(INFO) << "Attach ShowCurrentInput" ; 40404+ InputMethodController::GetInstance()->ShowCurrentInput(); 40405+ } else { 40406+ InputMethodController::GetInstance()->Attach(inputmethod_listener_, show_keyboard); 40407+ isAttached_ = true; 40408+ } 40409+} 40410+ 40411+void NWebInputMethodHandler::Reattach(ReattachType type) { 40412+ if (type == ReattachType::FROM_CONTINUE) { 40413+ if (!isNeedReattachOncontinue_) { 40414+ LOG(INFO) << "don't need reattach input method"; 40415+ return; 40416+ } 40417+ isNeedReattachOncontinue_ = false; 40418+ } 40419+ 40420+ if (type == ReattachType::FROM_ONFOCUS) { 40421+ if (!isNeedReattachOnfocus_) { 40422+ LOG(INFO) << "ReAttchOnfocus, don't need reattach input method"; 40423+ return; 40424+ } 40425+ isNeedReattachOnfocus_ = false; 40426+ } 40427+ 40428+ LOG(INFO) << "need to reattach input method, show_keyboard_ = " << show_keyboard_ << ", \ 40429+ reattach type = " << static_cast<int>(type); 40430+ composing_text_.clear(); 40431+ if (inputmethod_listener_ == nullptr) { 40432+ inputmethod_listener_ = new OnTextChangedListenerImpl(this); 40433+ } 40434+ 40435+ if (show_keyboard_ && isAttached_) { 40436+ LOG(INFO) << "Attach ShowCurrentInput" ; 40437+ InputMethodController::GetInstance()->ShowCurrentInput(); 40438+ } else { 40439+ InputMethodController::GetInstance()->Attach(inputmethod_listener_, show_keyboard_); 40440+ isAttached_ = true; 40441+ } 40442 } 40443 40444 void NWebInputMethodHandler::ShowTextInput() { 40445 LOG(INFO) << "NWebInputMethodHandler::ShowTextInput"; 40446 } 40447 40448-void NWebInputMethodHandler::HideTextInput() { 40449- LOG(INFO) << "NWebInputMethodHandler::HideTextInput " << ime_shown_; 40450+void NWebInputMethodHandler::HideTextInput(HideTextinputType hideType) { 40451+ if (!isAttached_) { 40452+ LOG(INFO) << "keyboard is not attach"; 40453+ if (hideType != HideTextinputType::FROM_ONPAUSE) { 40454+ LOG(INFO) << "not from switch front and background, ingnore"; 40455+ return; 40456+ } 40457+ auto nowTime = std::chrono::high_resolution_clock::now(); 40458+ std::chrono::duration<double, std::milli> diff = std::chrono::duration_cast<std::chrono::milliseconds>(nowTime - lastCloseInputMethodTime_); 40459+ // 100: received another hide textinput event in 100ms, we set isNeedReattachOncontinue_ flag. 40460+ if (diff.count() < 100) { 40461+ isNeedReattachOncontinue_ = true; 40462+ LOG(INFO) << "set isNeedReattachOncontinue_ flag, diff = " << diff.count() << "ms"; 40463+ } 40464+ return; 40465+ } 40466+ 40467+ LOG(INFO) << "need to hide text input, hidetype = " << static_cast<int>(hideType); 40468 InputMethodController::GetInstance()->HideTextInput(); 40469 InputMethodController::GetInstance()->Close(); 40470+ isAttached_ = false; 40471+ lastCloseInputMethodTime_ = std::chrono::high_resolution_clock::now(); 40472+ if (hideType == HideTextinputType::FROM_ONPAUSE) { 40473+ isNeedReattachOncontinue_ = true; 40474+ } 40475+ 40476+ if (hideType == HideTextinputType::FROM_ONBLUR) { 40477+ isNeedReattachOnfocus_ = true; 40478+ } 40479 } 40480 40481 void NWebInputMethodHandler::OnTextSelectionChanged( 40482@@ -141,10 +210,6 @@ void NWebInputMethodHandler::OnTextSelectionChanged( 40483 selected_to_ = selected_range.to; 40484 ime_text_composing_ = false; 40485 composing_text_.clear(); 40486- 40487- std::lock_guard<std::mutex> lock(textSelectMutex_); 40488- isTextSelectReady_ = true; 40489- textSelectCv_.notify_all(); 40490 } 40491 40492 void NWebInputMethodHandler::SetIMEStatus(bool status) { 40493@@ -162,14 +227,6 @@ void NWebInputMethodHandler::InsertText(const std::u16string& text) { 40494 } 40495 40496 if (browser_ != nullptr && browser_->GetHost() != nullptr) { 40497- std::unique_lock<std::mutex> lock(textSelectMutex_); 40498- bool isNormal = textSelectCv_.wait_for( 40499- lock, std::chrono::seconds(1), [this] { return isTextSelectReady_; }); 40500- if (!isNormal) { 40501- LOG(ERROR) << "InsertText wait_for timeout"; 40502- } 40503- isTextSelectReady_ = false; 40504- 40505 CefRefPtr<CefTask> insert_task = new InputMethodTask(base::BindOnce( 40506 &NWebInputMethodHandler::InsertTextHandlerOnUI, this, std::move(text))); 40507 browser_->GetHost()->PostTaskToUIThread(insert_task); 40508@@ -186,16 +243,6 @@ void NWebInputMethodHandler::DeleteBackward(int32_t length) { 40509 40510 void NWebInputMethodHandler::DeleteForward(int32_t length) { 40511 if (browser_ != nullptr && browser_->GetHost() != nullptr) { 40512- if (selected_to_ != 0) { 40513- std::unique_lock<std::mutex> lock(textSelectMutex_); 40514- bool isNormal = textSelectCv_.wait_for( 40515- lock, std::chrono::seconds(1), [this] { return isTextSelectReady_; }); 40516- if (!isNormal) { 40517- LOG(ERROR) << "DeleteForward wait_for timeout"; 40518- } 40519- isTextSelectReady_ = false; 40520- } 40521- 40522 CefRefPtr<CefTask> delete_task = new InputMethodTask(base::BindOnce( 40523 &NWebInputMethodHandler::DeleteForwardHandlerOnUI, this, length)); 40524 browser_->GetHost()->PostTaskToUIThread(delete_task); 40525@@ -217,26 +264,29 @@ void NWebInputMethodHandler::InsertTextHandlerOnUI(const std::u16string& text) { 40526 return; 40527 } 40528 40529+ CefKeyEvent keyEvent; 40530+ keyEvent.windows_key_code = ui::VKEY_PROCESSKEY; 40531+ keyEvent.modifiers = 0; 40532+ keyEvent.is_system_key = false; 40533+ keyEvent.type = KEYEVENT_RAWKEYDOWN; 40534+ browser_->GetHost()->SendKeyEvent(keyEvent); 40535+ 40536 if (!ime_text_composing_) { 40537 ime_text_composing_ = true; 40538 composing_text_.clear(); 40539 } 40540 composing_text_.append(text); 40541+ browser_->GetHost()->ImeCommitText(composing_text_, 40542+ CefRange(UINT32_MAX, UINT32_MAX), 0); 40543 40544- std::vector<CefCompositionUnderline> underlines; 40545- CefRange new_range(0, static_cast<int>(composing_text_.length())); 40546- cef_composition_underline_t line = {new_range, 0xFF000000, 0, false}; 40547- underlines.push_back(line); 40548- CefRange replacement_range(selected_from_, selected_to_); 40549- CefRange selection_range(0, static_cast<int>(composing_text_.length())); 40550- browser_->GetHost()->ImeSetComposition(CefString(composing_text_), underlines, 40551- replacement_range, selection_range); 40552 // no selection 40553- browser_->GetHost()->ImeFinishComposingText(false); 40554 ime_text_composing_ = false; 40555 selected_from_ += static_cast<int>(composing_text_.length()); 40556 selected_to_ += static_cast<int>(composing_text_.length()); 40557 composing_text_.clear(); 40558+ 40559+ keyEvent.type = KEYEVENT_KEYUP; 40560+ browser_->GetHost()->SendKeyEvent(keyEvent); 40561 } 40562 40563 void NWebInputMethodHandler::DeleteBackwardHandlerOnUI(int32_t length) { 40564diff --git a/src/ohos_nweb/src/nweb_inputmethod_handler.h b/src/ohos_nweb/src/nweb_inputmethod_handler.h 40565index 4f9af714e2911..2fdf0ce659fcf 40566--- a/src/ohos_nweb/src/nweb_inputmethod_handler.h 40567+++ b/src/ohos_nweb/src/nweb_inputmethod_handler.h 40568@@ -24,6 +24,10 @@ 40569 namespace OHOS::NWeb { 40570 class NWebInputMethodHandler : public NWebInputMethodClient { 40571 public: 40572+ enum class ReattachType { 40573+ FROM_ONFOCUS, 40574+ FROM_CONTINUE, 40575+ }; 40576 NWebInputMethodHandler(); 40577 ~NWebInputMethodHandler(); 40578 NWebInputMethodHandler(const NWebInputMethodHandler&) = delete; 40579@@ -31,11 +35,12 @@ class NWebInputMethodHandler : public NWebInputMethodClient { 40580 40581 void Attach(CefRefPtr<CefBrowser> browser, bool show_keyboard) override; 40582 void ShowTextInput() override; 40583- void HideTextInput() override; 40584+ void HideTextInput(HideTextinputType hideType = HideTextinputType::FROM_KERNEL) override; 40585 void OnTextSelectionChanged(CefRefPtr<CefBrowser> browser, 40586 const CefString& selected_text, 40587 const CefRange& selected_range) override; 40588 40589+ void Reattach(ReattachType type); 40590 void SetIMEStatus(bool status); 40591 void InsertText(const std::u16string& text); 40592 void DeleteBackward(int32_t length); 40593@@ -58,10 +63,11 @@ class NWebInputMethodHandler : public NWebInputMethodClient { 40594 int selected_to_; 40595 OHOS::sptr<OHOS::MiscServices::OnTextChangedListener> inputmethod_listener_ = 40596 nullptr; 40597- 40598- bool isTextSelectReady_ = true; 40599- std::mutex textSelectMutex_; 40600- std::condition_variable textSelectCv_; 40601+ bool isAttached_ = false; 40602+ bool show_keyboard_ = false; 40603+ bool isNeedReattachOncontinue_ = false; 40604+ std::chrono::high_resolution_clock::time_point lastCloseInputMethodTime_; 40605+ bool isNeedReattachOnfocus_ = false; 40606 40607 IMPLEMENT_REFCOUNTING(NWebInputMethodHandler); 40608 }; 40609diff --git a/src/ohos_nweb/src/nweb_output_handler.cc b/src/ohos_nweb/src/nweb_output_handler.cc 40610index f9abaef29ed95..bc6645eed3bf1 40611--- a/src/ohos_nweb/src/nweb_output_handler.cc 40612+++ b/src/ohos_nweb/src/nweb_output_handler.cc 40613@@ -254,9 +254,9 @@ void NWebOutputHandler::BmpDumpHelper::RgbaToRgb(char* buf, 40614 if (i % 4 == 3) { 40615 // check alpha value, if 0, set related color to white 40616 if (buf[i] == 0) { 40617- *(p_rgb - 3) = 255; 40618- *(p_rgb - 2) = 255; 40619- *(p_rgb - 1) = 255; 40620+ *(p_rgb - 3) = 0xff; 40621+ *(p_rgb - 2) = 0xff; 40622+ *(p_rgb - 1) = 0xff; 40623 } 40624 continue; 40625 } 40626diff --git a/src/pdf/features.gni b/src/pdf/features.gni 40627index 67ce26d618975..c321ba7cdcca5 40628--- a/src/pdf/features.gni 40629+++ b/src/pdf/features.gni 40630@@ -21,5 +21,6 @@ declare_args() { 40631 # currently depends on PPAPI. It does not make sense to port PPAPI, which is 40632 # being deprecated, to Fuchsia. Once the PDF Viewer no longer uses PPAPI, the 40633 # PDF Viewer should be enabled on Fuchsia, like on other desktop platforms. 40634- enable_pdf = !is_android && !is_ios && !is_chromecast && !is_fuchsia 40635+ enable_pdf = 40636+ !is_android && !is_ios && !is_chromecast && !is_fuchsia && !is_ohos 40637 } 40638diff --git a/src/pdf/ui/document_properties.cc b/src/pdf/ui/document_properties.cc 40639index d6c9e9078d284..e265dfcf79e83 40640--- a/src/pdf/ui/document_properties.cc 40641+++ b/src/pdf/ui/document_properties.cc 40642@@ -17,6 +17,10 @@ 40643 #include "ui/base/l10n/l10n_util.h" 40644 #include "ui/gfx/geometry/size.h" 40645 40646+#if BUILDFLAG(IS_OHOS) 40647+#include "ppapi/buildflags/buildflags.h" 40648+#endif 40649+ 40650 using printing::kMicronsPerInch; 40651 using printing::kPointsPerInch; 40652 40653@@ -24,6 +28,7 @@ namespace chrome_pdf { 40654 40655 namespace { 40656 40657+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 40658 // Scales `length_points` to be in inches instead of points. 40659 constexpr float ConvertPointsToInches(int length_points) { 40660 constexpr float kInchesPerPoint = 1.0f / kPointsPerInch; 40661@@ -72,10 +77,12 @@ bool ShowInches() { 40662 // On error, assume the units are SI. 40663 return U_SUCCESS(error_code) && system == UMS_US; 40664 } 40665+#endif 40666 40667 } // namespace 40668 40669 std::u16string FormatPageSize(const absl::optional<gfx::Size>& size_points) { 40670+#if BUILDFLAG(IS_OHOS) && BUILDFLAG(ENABLE_PLUGINS) 40671 if (!size_points.has_value()) 40672 return l10n_util::GetStringUTF16(IDS_PDF_PROPERTIES_PAGE_SIZE_VARIABLE); 40673 40674@@ -93,6 +100,9 @@ std::u16string FormatPageSize(const absl::optional<gfx::Size>& size_points) { 40675 FormatLengthInMillimeters(size_points.value().width()), 40676 FormatLengthInMillimeters(size_points.value().height()), 40677 GetOrientation(size_points.value())); 40678+#else 40679+ return u""; 40680+#endif 40681 } 40682 40683 std::string FormatPdfVersion(PdfVersion version) { 40684diff --git a/src/ppapi/buildflags/buildflags.gni b/src/ppapi/buildflags/buildflags.gni 40685index 560d1ecaecbdf..72d1a5917be45 40686--- a/src/ppapi/buildflags/buildflags.gni 40687+++ b/src/ppapi/buildflags/buildflags.gni 40688@@ -7,5 +7,6 @@ import("//build/config/chromecast_build.gni") 40689 import("//build/config/features.gni") 40690 40691 declare_args() { 40692- enable_plugins = !is_android && !is_ios && !is_chromecast && !is_fuchsia 40693+ enable_plugins = 40694+ !is_android && !is_ios && !is_chromecast && !is_fuchsia && !is_ohos 40695 } 40696diff --git a/src/printing/buildflags/buildflags.gni b/src/printing/buildflags/buildflags.gni 40697index 422abea3f1ea1..68f202491b801 40698--- a/src/printing/buildflags/buildflags.gni 40699+++ b/src/printing/buildflags/buildflags.gni 40700@@ -15,7 +15,7 @@ declare_args() { 40701 40702 declare_args() { 40703 # Enable printing with print preview. 40704- enable_print_preview = enable_basic_printing && !is_android 40705+ enable_print_preview = enable_basic_printing && !is_android && !is_ohos 40706 40707 if (use_fuzzing_engine && (is_linux || is_chromeos)) { 40708 # For fuzzing, just restrict to chromeos and linux. 40709@@ -29,7 +29,7 @@ declare_args() { 40710 # `enable_print_preview`, do not base this definition upon that. This 40711 # feature could still be appropriate for some build configurations which 40712 # explicitly disable print preview. 40713- enable_oop_printing = enable_basic_printing && !is_android 40714+ enable_oop_printing = enable_basic_printing && !is_android && !is_ohos 40715 } 40716 40717 declare_args() { 40718diff --git a/src/services/audio/local_muter.h b/src/services/audio/local_muter.h 40719index b70c04b4d3496..577802e7416bb 40720--- a/src/services/audio/local_muter.h 40721+++ b/src/services/audio/local_muter.h 40722@@ -7,6 +7,7 @@ 40723 40724 #include "base/callback.h" 40725 #include "base/memory/raw_ptr.h" 40726+#include "base/memory/weak_ptr.h" 40727 #include "base/sequence_checker.h" 40728 #include "base/unguessable_token.h" 40729 #include "media/mojo/mojom/audio_stream_factory.mojom.h" 40730@@ -44,6 +45,8 @@ class LocalMuter final : public media::mojom::LocalMuter, 40731 void OnMemberJoinedGroup(LoopbackGroupMember* member) final; 40732 void OnMemberLeftGroup(LoopbackGroupMember* member) final; 40733 40734+ base::WeakPtr<LocalMuter> GetWeakPtr() { return weak_factory_.GetWeakPtr(); } 40735+ 40736 private: 40737 // Runs the |all_bindings_lost_callback_| when |bindings_| becomes empty. 40738 void OnBindingLost(); 40739@@ -55,6 +58,8 @@ class LocalMuter final : public media::mojom::LocalMuter, 40740 base::OnceClosure all_bindings_lost_callback_; 40741 40742 SEQUENCE_CHECKER(sequence_checker_); 40743+ 40744+ base::WeakPtrFactory<LocalMuter> weak_factory_{this}; 40745 }; 40746 40747 } // namespace audio 40748diff --git a/src/services/audio/stream_factory.cc b/src/services/audio/stream_factory.cc 40749index c84a403722a39..2a831c4e06c0e 40750--- a/src/services/audio/stream_factory.cc 40751+++ b/src/services/audio/stream_factory.cc 40752@@ -174,8 +174,9 @@ void StreamFactory::BindMuter( 40753 if (it == muters_.end()) { 40754 auto muter_ptr = std::make_unique<LocalMuter>(&coordinator_, group_id); 40755 muter = muter_ptr.get(); 40756- muter->SetAllBindingsLostCallback(base::BindOnce( 40757- &StreamFactory::DestroyMuter, base::Unretained(this), muter)); 40758+ muter->SetAllBindingsLostCallback( 40759+ base::BindRepeating(&StreamFactory::DestroyMuter, 40760+ base::Unretained(this), muter_ptr->GetWeakPtr())); 40761 muters_.emplace_back(std::move(muter_ptr)); 40762 } else { 40763 muter = it->get(); 40764@@ -247,9 +248,10 @@ void StreamFactory::DestroyOutputStream(OutputStream* stream) { 40765 DCHECK_EQ(1u, erased); 40766 } 40767 40768-void StreamFactory::DestroyMuter(LocalMuter* muter) { 40769+void StreamFactory::DestroyMuter(base::WeakPtr<LocalMuter> muter) { 40770 DCHECK_CALLED_ON_VALID_SEQUENCE(owning_sequence_); 40771- DCHECK(muter); 40772+ if (!muter) 40773+ return; 40774 40775 // Output streams have a task posting before destruction (see the OnError 40776 // function in output_stream.cc). To ensure that stream destruction and 40777@@ -258,13 +260,10 @@ void StreamFactory::DestroyMuter(LocalMuter* muter) { 40778 // Otherwise, a "destroy all streams, then destroy the muter" sequence may 40779 // result in a brief blip of audio. 40780 auto do_destroy = [](base::WeakPtr<StreamFactory> weak_this, 40781- LocalMuter* muter) { 40782- if (weak_this) { 40783- 40784- const auto it = 40785- std::find_if(weak_this->muters_.begin(), weak_this->muters_.end(), 40786- base::MatchesUniquePtr(muter)); 40787- DCHECK(it != weak_this->muters_.end()); 40788+ base::WeakPtr<LocalMuter> muter) { 40789+ if (weak_this && muter) { 40790+ const auto it = base::ranges::find_if( 40791+ weak_this->muters_, base::MatchesUniquePtr(muter.get())); 40792 weak_this->muters_.erase(it); 40793 } 40794 }; 40795diff --git a/src/services/audio/stream_factory.h b/src/services/audio/stream_factory.h 40796index 234af1020d487..106d68dae9bf6 40797--- a/src/services/audio/stream_factory.h 40798+++ b/src/services/audio/stream_factory.h 40799@@ -104,7 +104,7 @@ class StreamFactory final : public media::mojom::AudioStreamFactory { 40800 40801 void DestroyInputStream(InputStream* stream); 40802 void DestroyOutputStream(OutputStream* stream); 40803- void DestroyMuter(LocalMuter* muter); 40804+ void DestroyMuter(base::WeakPtr<LocalMuter> muter); 40805 void DestroyLoopbackStream(LoopbackStream* stream); 40806 40807 SEQUENCE_CHECKER(owning_sequence_); 40808diff --git a/src/services/device/geolocation/location_arbitrator.cc b/src/services/device/geolocation/location_arbitrator.cc 40809index 98bcc64fe3372..cedf1d2b2fd8e 40810--- a/src/services/device/geolocation/location_arbitrator.cc 40811+++ b/src/services/device/geolocation/location_arbitrator.cc 40812@@ -161,8 +161,7 @@ LocationArbitrator::NewNetworkLocationProvider( 40813 40814 std::unique_ptr<LocationProvider> 40815 LocationArbitrator::NewSystemLocationProvider() { 40816-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || \ 40817- BUILDFLAG(IS_OHOS) 40818+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) 40819 return nullptr; 40820 #else 40821 return device::NewSystemLocationProvider(main_task_runner_, 40822diff --git a/src/services/device/geolocation/ohos/location_provider_ohos.cc b/src/services/device/geolocation/ohos/location_provider_ohos.cc 40823index a4b69fed8f32d..a2b16ceddb3ce 40824--- a/src/services/device/geolocation/ohos/location_provider_ohos.cc 40825+++ b/src/services/device/geolocation/ohos/location_provider_ohos.cc 40826@@ -14,7 +14,7 @@ 40827 #include "base/memory/singleton.h" 40828 40829 namespace device { 40830- 40831+class GeolocationManager; 40832 // LocationProviderOhos 40833 LocationProviderOhos::LocationProviderOhos() { 40834 locator_callback_ = new LocationProviderCallback(); 40835@@ -102,10 +102,15 @@ void LocationProviderOhos::RequestLocationUpdate(bool high_accuracy) { 40836 return; 40837 } 40838 40839- locator_->EnableAbility(true); 40840 std::unique_ptr<OHOS::Location::RequestConfig> requestConfig = 40841 std::make_unique<OHOS::Location::RequestConfig>(); 40842 SetRequestConfig(requestConfig, high_accuracy); 40843+ if (locator_->GetSwitchState() != 1) { 40844+ LOG(ERROR) << "geolocation setting is not turned on"; 40845+ locator_callback_->OnErrorReport( 40846+ LocationProviderCallback::LOCATION_GET_FAILED); 40847+ return; 40848+ } 40849 OHOS::sptr<OHOS::Location::ILocatorCallback> locator_call_back = 40850 locator_callback_; 40851 int ret = locator_->StartLocating(requestConfig, locator_call_back, "location.ILocator", 40852@@ -190,7 +195,9 @@ void LocationProviderCallback::OnErrorReport(const int errorCode) { 40853 } 40854 40855 // static 40856-std::unique_ptr<LocationProvider> NewSystemLocationProvider() { 40857+std::unique_ptr<LocationProvider> NewSystemLocationProvider( 40858+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 40859+ GeolocationManager* geolocation_manager) { 40860 return base::WrapUnique(new LocationProviderOhos); 40861 } 40862 40863diff --git a/src/services/network/cors/cors_util.cc b/src/services/network/cors/cors_util.cc 40864index 14fb9d818978c..761c6a0de1a31 40865--- a/src/services/network/cors/cors_util.cc 40866+++ b/src/services/network/cors/cors_util.cc 40867@@ -21,7 +21,7 @@ std::vector<std::string> CorsUnsafeNotForbiddenRequestHeaderNames( 40868 size_t safe_list_value_size = 0; 40869 40870 for (const auto& header : headers) { 40871- if (!net::HttpUtil::IsSafeHeader(header.key)) 40872+ if (!net::HttpUtil::IsSafeHeader(header.key, header.value)) 40873 continue; 40874 40875 const std::string name = base::ToLowerASCII(header.key); 40876diff --git a/src/services/network/public/mojom/network_context.mojom b/src/services/network/public/mojom/network_context.mojom 40877index 958c2c27211f7..7b41da79f02a3 40878--- a/src/services/network/public/mojom/network_context.mojom 40879+++ b/src/services/network/public/mojom/network_context.mojom 40880@@ -526,11 +526,11 @@ struct NetworkConditions { 40881 // response received. 40882 mojo_base.mojom.TimeDelta latency; 40883 40884- // Maximal aggregated download throughput (bytes/sec). 0 disables download 40885+ // Maximal aggregated download throughput (bytes/sec). <=0 disables download 40886 // throttling. 40887 double download_throughput; 40888 40889- // Maximal aggregated upload throughput (bytes/sec). 0 disables upload 40890+ // Maximal aggregated upload throughput (bytes/sec). <=0 disables upload 40891 // throttling. 40892 double upload_throughput; 40893 }; 40894diff --git a/src/services/network/throttling/network_conditions.cc b/src/services/network/throttling/network_conditions.cc 40895index 71cd4ac0e52cc..18b2b6e0efdc2 40896--- a/src/services/network/throttling/network_conditions.cc 40897+++ b/src/services/network/throttling/network_conditions.cc 40898@@ -4,6 +4,8 @@ 40899 40900 #include "services/network/throttling/network_conditions.h" 40901 40902+#include <algorithm> 40903+ 40904 namespace network { 40905 40906 NetworkConditions::NetworkConditions() : NetworkConditions(false) {} 40907@@ -16,9 +18,9 @@ NetworkConditions::NetworkConditions(bool offline, 40908 double download_throughput, 40909 double upload_throughput) 40910 : offline_(offline), 40911- latency_(latency), 40912- download_throughput_(download_throughput), 40913- upload_throughput_(upload_throughput) {} 40914+ latency_(std::max(latency, 0.0)), 40915+ download_throughput_(std::max(download_throughput, 0.0)), 40916+ upload_throughput_(std::max(upload_throughput, 0.0)) {} 40917 40918 NetworkConditions::~NetworkConditions() {} 40919 40920diff --git a/src/services/network/throttling/network_conditions.h b/src/services/network/throttling/network_conditions.h 40921index f8c8214b34baf..c5232231d308b 40922--- a/src/services/network/throttling/network_conditions.h 40923+++ b/src/services/network/throttling/network_conditions.h 40924@@ -28,6 +28,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkConditions { 40925 bool IsThrottling() const; 40926 40927 bool offline() const { return offline_; } 40928+ 40929+ // These are 0 if the corresponding throttle is disabled, >0 otherwise. 40930 double latency() const { return latency_; } 40931 double download_throughput() const { return download_throughput_; } 40932 double upload_throughput() const { return upload_throughput_; } 40933diff --git a/src/services/network/throttling/throttling_controller_unittest.cc b/src/services/network/throttling/throttling_controller_unittest.cc 40934index 6be9f572ed131..5c3b87df6ea5d 40935--- a/src/services/network/throttling/throttling_controller_unittest.cc 40936+++ b/src/services/network/throttling/throttling_controller_unittest.cc 40937@@ -298,7 +298,7 @@ TEST(ThrottlingControllerTest, DownloadOnly) { 40938 ThrottlingControllerTestHelper helper; 40939 TestCallback* callback = helper.callback(); 40940 40941- helper.SetNetworkState(false, 10000000, 0); 40942+ helper.SetNetworkState(false, 10000000, -1); 40943 int rv = helper.Start(false); 40944 EXPECT_EQ(rv, net::ERR_IO_PENDING); 40945 helper.FastForwardUntilNoTasksRemain(); 40946@@ -317,7 +317,7 @@ TEST(ThrottlingControllerTest, UploadOnly) { 40947 ThrottlingControllerTestHelper helper; 40948 TestCallback* callback = helper.callback(); 40949 40950- helper.SetNetworkState(false, 0, 1000000); 40951+ helper.SetNetworkState(false, -2, 1000000); 40952 int rv = helper.Start(true); 40953 EXPECT_EQ(rv, net::OK); 40954 helper.FastForwardUntilNoTasksRemain(); 40955diff --git a/src/services/network/websocket.cc b/src/services/network/websocket.cc 40956index 3da24fc1be25a..9cd1fbdb1ee2d 40957--- a/src/services/network/websocket.cc 40958+++ b/src/services/network/websocket.cc 40959@@ -625,7 +625,7 @@ void WebSocket::AddChannel( 40960 for (const auto& header : additional_headers) { 40961 if (net::HttpUtil::IsValidHeaderName(header->name) && 40962 net::HttpUtil::IsValidHeaderValue(header->value) && 40963- (net::HttpUtil::IsSafeHeader(header->name) || 40964+ (net::HttpUtil::IsSafeHeader(header->name, header->value) || 40965 base::EqualsCaseInsensitiveASCII( 40966 header->name, net::HttpRequestHeaders::kUserAgent) || 40967 base::EqualsCaseInsensitiveASCII(header->name, 40968diff --git a/src/storage/browser/database/database_tracker.cc b/src/storage/browser/database/database_tracker.cc 40969index b56eb0727550f..c5ccadca3566f 40970--- a/src/storage/browser/database/database_tracker.cc 40971+++ b/src/storage/browser/database/database_tracker.cc 40972@@ -64,10 +64,9 @@ const base::FilePath::CharType kTemporaryDirectoryPattern[] = 40973 FILE_PATH_LITERAL("DeleteMe*"); 40974 40975 #if BUILDFLAG(IS_OHOS) 40976-const std::u16string baseDatabaseDir = 40977+static const std::u16string kBaseDatabaseDir = 40978 base::UTF8ToUTF16("/data/storage/el2/base/"); 40979-const std::u16string divisionStr = base::UTF8ToUTF16("/"); 40980-const std::u16string suffixStr = base::UTF8ToUTF16(".db"); 40981+static const std::u16string kSuffixStr = base::UTF8ToUTF16(".db"); 40982 #endif 40983 40984 OriginInfo::OriginInfo() : total_size_(0) {} 40985@@ -340,20 +339,35 @@ base::FilePath DatabaseTracker::GetOriginDirectory( 40986 incognito_origin_directories_[origin_identifier] = origin_directory; 40987 } 40988 } 40989- 40990+#if BUILDFLAG(IS_OHOS) 40991+ return base::FilePath::FromUTF16Unsafe(kBaseDatabaseDir + origin_directory); 40992+#else 40993 return db_dir_.Append(base::FilePath::FromUTF16Unsafe(origin_directory)); 40994+#endif 40995 } 40996 40997+#if BUILDFLAG(IS_OHOS) 40998 base::FilePath DatabaseTracker::GetFullDBFilePath( 40999 const std::string& origin_identifier, 41000- const std::u16string& database_name) { 41001-#if BUILDFLAG(IS_OHOS) 41002+ const std::u16string& database_name, 41003+ bool suffix) { 41004+ DCHECK(task_runner_->RunsTasksInCurrentSequence()); 41005 DCHECK(!origin_identifier.empty()); 41006- std::u16string origin_directory = base::UTF8ToUTF16(origin_identifier); 41007- std::u16string filename = baseDatabaseDir + origin_directory + divisionStr + 41008- database_name + suffixStr; 41009- return base::FilePath::FromUTF16Unsafe(filename); 41010+ if (!LazyInit()) 41011+ return base::FilePath(); 41012+ 41013+ int64_t id = 41014+ databases_table_->GetDatabaseID(origin_identifier, database_name); 41015+ if (id < 0) 41016+ return base::FilePath(); 41017+ 41018+ return GetOriginDirectory(origin_identifier) 41019+ .AppendASCII((suffix? base::UTF16ToASCII(database_name + kSuffixStr): base::UTF16ToASCII(database_name))); 41020+} 41021 #else 41022+base::FilePath DatabaseTracker::GetFullDBFilePath( 41023+ const std::string& origin_identifier, 41024+ const std::u16string& database_name) { 41025 DCHECK(task_runner_->RunsTasksInCurrentSequence()); 41026 DCHECK(!origin_identifier.empty()); 41027 if (!LazyInit()) 41028@@ -366,8 +380,8 @@ base::FilePath DatabaseTracker::GetFullDBFilePath( 41029 41030 return GetOriginDirectory(origin_identifier) 41031 .AppendASCII(base::NumberToString(id)); 41032-#endif 41033 } 41034+#endif 41035 41036 bool DatabaseTracker::GetOriginInfo(const std::string& origin_identifier, 41037 OriginInfo* info) { 41038@@ -655,7 +669,11 @@ DatabaseTracker::CachedOriginInfo* DatabaseTracker::MaybeGetCachedOriginInfo( 41039 origin_info.SetDatabaseSize(db.database_name, db_file_size); 41040 41041 base::FilePath path = 41042+ #if BUILDFLAG(IS_OHOS) 41043+ GetFullDBFilePath(origin_identifier, db.database_name, true); 41044+ #else 41045 GetFullDBFilePath(origin_identifier, db.database_name); 41046+ #endif 41047 base::File::Info file_info; 41048 // TODO(jsbell): Avoid duplicate base::GetFileInfo calls between this and 41049 // the GetDBFileSize() call above. 41050@@ -672,7 +690,11 @@ int64_t DatabaseTracker::GetDBFileSize(const std::string& origin_identifier, 41051 const std::u16string& database_name) { 41052 DCHECK(task_runner_->RunsTasksInCurrentSequence()); 41053 base::FilePath db_file_name = 41054+ #if BUILDFLAG(IS_OHOS) 41055+ GetFullDBFilePath(origin_identifier, database_name, true); 41056+ #else 41057 GetFullDBFilePath(origin_identifier, database_name); 41058+ #endif 41059 int64_t db_file_size = 0; 41060 if (!base::GetFileSize(db_file_name, &db_file_size)) 41061 db_file_size = 0; 41062@@ -797,7 +819,11 @@ void DatabaseTracker::DeleteDataModifiedSince( 41063 rv = net::ERR_FAILED; 41064 } 41065 for (const DatabaseDetails& db : details) { 41066+ #if BUILDFLAG(IS_OHOS) 41067+ base::FilePath db_file = GetFullDBFilePath(origin, db.database_name, true); 41068+ #else 41069 base::FilePath db_file = GetFullDBFilePath(origin, db.database_name); 41070+ #endif 41071 base::File::Info file_info; 41072 base::GetFileInfo(db_file, &file_info); 41073 if (file_info.last_modified < cutoff) 41074diff --git a/src/storage/browser/database/database_tracker.h b/src/storage/browser/database/database_tracker.h 41075index 63d2c3acc8663..b7c5aaeab1cec 41076--- a/src/storage/browser/database/database_tracker.h 41077+++ b/src/storage/browser/database/database_tracker.h 41078@@ -138,9 +138,14 @@ class COMPONENT_EXPORT(STORAGE_BROWSER) DatabaseTracker 41079 41080 // Thread-safe getter. 41081 const base::FilePath& database_directory() const { return db_dir_; } 41082- 41083+#if BUILDFLAG(IS_OHOS) 41084+ base::FilePath GetFullDBFilePath(const std::string& origin_identifier, 41085+ const std::u16string& database_name, 41086+ bool suffix = false); 41087+#else 41088 base::FilePath GetFullDBFilePath(const std::string& origin_identifier, 41089 const std::u16string& database_name); 41090+#endif 41091 41092 // virtual for unit-testing only 41093 virtual bool GetOriginInfo(const std::string& origin_id, OriginInfo* info); 41094diff --git a/src/storage/browser/database/database_util.cc b/src/storage/browser/database/database_util.cc 41095index 5742c252f93e5..3ddd3400a51b5 41096--- a/src/storage/browser/database/database_util.cc 41097+++ b/src/storage/browser/database/database_util.cc 41098@@ -39,6 +39,41 @@ bool DatabaseUtil::CrackVfsFileName(const std::u16string& vfs_file_name, 41099 // 'vfs_file_name' is of the form <origin_identifier>/<db_name>#<suffix>. 41100 // <suffix> is optional. 41101 DCHECK(!vfs_file_name.empty()); 41102+#if BUILDFLAG(IS_OHOS) 41103+ size_t first_slash_index = vfs_file_name.rfind('/'); 41104+ if (first_slash_index == std::u16string::npos) { 41105+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName not find /"; 41106+ return false; 41107+ } 41108+ std::u16string dbnameAndSuffix = vfs_file_name.substr( 41109+ first_slash_index + 1, vfs_file_name.length() - first_slash_index - 1); 41110+ size_t last_pound_index = dbnameAndSuffix.rfind('.'); 41111+ if (last_pound_index == std::u16string::npos) { 41112+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName not find ."; 41113+ return false; 41114+ } 41115+ std::u16string suffix = dbnameAndSuffix.substr(last_pound_index, dbnameAndSuffix.length() - last_pound_index); 41116+ if (!IsSafeSuffix(suffix)) { 41117+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName IsSafeSuffix failed"; 41118+ return false; 41119+ } 41120+ std::u16string path = vfs_file_name.substr(0, first_slash_index); 41121+ first_slash_index = path.rfind('/'); 41122+ if (first_slash_index == std::u16string::npos) { 41123+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName not find /"; 41124+ return false; 41125+ } 41126+ std::u16string name = dbnameAndSuffix.substr(0, last_pound_index); 41127+ std::string origin_id = base::UTF16ToASCII(path.substr(first_slash_index + 1, path.length() - first_slash_index - 1)); 41128+ if (!IsValidOriginIdentifier(origin_id)) { 41129+ LOG(ERROR) << "DatabaseUtil::CrackVfsFileName IsValidOriginIdentifier failed"; 41130+ return false; 41131+ } 41132+ if (sqlite_suffix) *sqlite_suffix = suffix; 41133+ if (database_name) *database_name = name; 41134+ if (origin_identifier) *origin_identifier = origin_id; 41135+ return true; 41136+#else 41137 size_t first_slash_index = vfs_file_name.find('/'); 41138 size_t last_pound_index = vfs_file_name.rfind('#'); 41139 // '/' and '#' must be present in the string. Also, the string cannot start 41140@@ -71,6 +106,7 @@ bool DatabaseUtil::CrackVfsFileName(const std::u16string& vfs_file_name, 41141 *sqlite_suffix = suffix; 41142 41143 return true; 41144+#endif 41145 } 41146 41147 base::FilePath DatabaseUtil::GetFullFilePathForVfsFile( 41148diff --git a/src/storage/browser/quota/quota_manager_impl.cc b/src/storage/browser/quota/quota_manager_impl.cc 41149index 49aeefc797ad8..ea56592db0e58 41150--- a/src/storage/browser/quota/quota_manager_impl.cc 41151+++ b/src/storage/browser/quota/quota_manager_impl.cc 41152@@ -1295,7 +1295,6 @@ void QuotaManagerImpl::GetStorageKeysForType(blink::mojom::StorageType type, 41153 GetStorageKeysCallback callback) { 41154 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 41155 EnsureDatabaseOpened(); 41156- 41157 if (db_disabled_) { 41158 std::move(callback).Run(std::set<StorageKey>()); 41159 return; 41160diff --git a/src/third_party/blink/common/BUILD.gn b/src/third_party/blink/common/BUILD.gn 41161index bdba2399c662f..7a17b8a0211e9 41162--- a/src/third_party/blink/common/BUILD.gn 41163+++ b/src/third_party/blink/common/BUILD.gn 41164@@ -262,7 +262,7 @@ source_set("common") { 41165 deps += [ "//media" ] 41166 } 41167 41168- if (is_android || is_win) { 41169+ if (is_android || is_win || is_ohos) { 41170 sources += [ 41171 "font_unique_name_lookup/font_table_matcher.cc", 41172 "font_unique_name_lookup/font_table_persistence.cc", 41173diff --git a/src/third_party/blink/common/context_menu_data/context_menu_params_builder.cc b/src/third_party/blink/common/context_menu_data/context_menu_params_builder.cc 41174index 2e3afe39e2299..e464ba68c3269 41175--- a/src/third_party/blink/common/context_menu_data/context_menu_params_builder.cc 41176+++ b/src/third_party/blink/common/context_menu_data/context_menu_params_builder.cc 41177@@ -64,6 +64,16 @@ UntrustworthyContextMenuParams ContextMenuParamsBuilder::Build( 41178 params.suggested_filename = base::UTF8ToUTF16(data.suggested_filename); 41179 params.input_field_type = data.input_field_type; 41180 params.opened_from_highlight = data.opened_from_highlight; 41181+#if BUILDFLAG(IS_OHOS) 41182+ params.source_type = static_cast<ui::MenuSourceType>(data.source_type); 41183+ 41184+ LOG(DEBUG) << "ContextMenuParamsBuilder::Build [params] " 41185+ << "is_editable = " << params.is_editable 41186+ << ", edit_flags = " << params.edit_flags 41187+ << ", input_field_type = " << params.input_field_type 41188+ << ", source_type = " << params.source_type 41189+ << ", media_type = " << params.media_type; 41190+#endif 41191 41192 for (const auto& suggestion : data.dictionary_suggestions) 41193 params.dictionary_suggestions.push_back(suggestion); 41194diff --git a/src/third_party/blink/common/features.cc b/src/third_party/blink/common/features.cc 41195index d5b0e1e2b3455..446554b1497d7 41196--- a/src/third_party/blink/common/features.cc 41197+++ b/src/third_party/blink/common/features.cc 41198@@ -242,6 +242,11 @@ bool IsFencedFramesMPArchBased() { 41199 blink::features::FencedFramesImplementationType::kMPArch; 41200 } 41201 41202+bool IsFencedFramesShadowDOMBased() { 41203+ return blink::features::kFencedFramesImplementationTypeParam.Get() == 41204+ blink::features::FencedFramesImplementationType::kShadowDOM; 41205+} 41206+ 41207 const base::Feature kInitialNavigationEntry{"InitialNavigationEntry", 41208 base::FEATURE_DISABLED_BY_DEFAULT}; 41209 41210@@ -460,7 +465,13 @@ const base::Feature kWebFontsCacheAwareTimeoutAdaption { 41211 // Enabled to block programmatic focus in subframes when not triggered by user 41212 // activation (see htpps://crbug.com/954349). 41213 const base::Feature kBlockingFocusWithoutUserActivation{ 41214- "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT}; 41215+ "BlockingFocusWithoutUserActivation", 41216+#if defined(OS_OHOS) 41217+ base::FEATURE_ENABLED_BY_DEFAULT 41218+#else 41219+ base::FEATURE_DISABLED_BY_DEFAULT 41220+#endif 41221+}; 41222 41223 // A server-side switch for the REALTIME_AUDIO thread priority of 41224 // RealtimeAudioWorkletThread object. This can be controlled by a field trial, 41225diff --git a/src/third_party/blink/common/messaging/string_message_codec.cc b/src/third_party/blink/common/messaging/string_message_codec.cc 41226index 85ff7e230499e..fbb5a2e555d3d 41227--- a/src/third_party/blink/common/messaging/string_message_codec.cc 41228+++ b/src/third_party/blink/common/messaging/string_message_codec.cc 41229@@ -8,17 +8,34 @@ 41230 41231 #include "base/containers/buffer_iterator.h" 41232 #include "base/logging.h" 41233+#if BUILDFLAG(IS_OHOS) 41234+#include "base/notreached.h" 41235+#include "mojo/public/cpp/base/big_buffer.h" 41236+#include "third_party/blink/public/mojom/array_buffer/array_buffer_contents.mojom.h" 41237+#endif 41238 41239 namespace blink { 41240 namespace { 41241 41242+// Template helpers for visiting std::variant. 41243+template <class... Ts> 41244+struct overloaded : Ts... { 41245+ using Ts::operator()...; 41246+}; 41247+template <class... Ts> 41248+overloaded(Ts...) -> overloaded<Ts...>; 41249+ 41250 const uint32_t kVarIntShift = 7; 41251 const uint32_t kVarIntMask = (1 << kVarIntShift) - 1; 41252 41253 const uint8_t kVersionTag = 0xFF; 41254 const uint8_t kPaddingTag = '\0'; 41255+ 41256+// serialization_tag, see v8/src/objects/value-serializer.cc 41257 const uint8_t kOneByteStringTag = '"'; 41258 const uint8_t kTwoByteStringTag = 'c'; 41259+const uint8_t kArrayBuffer = 'B'; 41260+const uint8_t kArrayBufferTransferTag = 't'; 41261 41262 const uint32_t kVersion = 10; 41263 41264@@ -144,5 +161,129 @@ bool DecodeStringMessage(base::span<const uint8_t> encoded_data, 41265 DLOG(WARNING) << "Unexpected tag: " << tag; 41266 return false; 41267 } 41268+TransferableMessage EncodeWebMessagePayload(const WebMessagePayload& payload) { 41269+ TransferableMessage message; 41270+ std::vector<uint8_t> buffer; 41271+ WriteUint8(kVersionTag, &buffer); 41272+ WriteUint32(kVersion, &buffer); 41273+ 41274+ absl::visit( 41275+ overloaded{ 41276+ [&](const std::u16string& str) { 41277+ if (ContainsOnlyLatin1(str)) { 41278+ std::string data_latin1(str.cbegin(), str.cend()); 41279+ WriteUint8(kOneByteStringTag, &buffer); 41280+ WriteUint32(data_latin1.size(), &buffer); 41281+ WriteBytes(data_latin1.c_str(), data_latin1.size(), &buffer); 41282+ } else { 41283+ size_t num_bytes = str.size() * sizeof(char16_t); 41284+ if ((buffer.size() + 1 + BytesNeededForUint32(num_bytes)) & 1) 41285+ WriteUint8(kPaddingTag, &buffer); 41286+ WriteUint8(kTwoByteStringTag, &buffer); 41287+ WriteUint32(num_bytes, &buffer); 41288+ WriteBytes(reinterpret_cast<const char*>(str.data()), num_bytes, 41289+ &buffer); 41290+ } 41291+ }, 41292+ [&](const std::vector<uint8_t>& array_buffer) { 41293+ WriteUint8(kArrayBufferTransferTag, &buffer); 41294+ // Write at the first slot. 41295+ WriteUint32(0, &buffer); 41296+ 41297+ mojo_base::BigBuffer big_buffer(array_buffer); 41298+ message.array_buffer_contents_array.push_back( 41299+ mojom::SerializedArrayBufferContents::New( 41300+ std::move(big_buffer))); 41301+ }}, 41302+ payload); 41303+ 41304+ message.owned_encoded_message = std::move(buffer); 41305+ message.encoded_message = message.owned_encoded_message; 41306+ 41307+ return message; 41308+} 41309+ 41310+absl::optional<WebMessagePayload> DecodeToWebMessagePayload( 41311+ const TransferableMessage& message) { 41312+ base::BufferIterator<const uint8_t> iter(message.encoded_message); 41313+ uint8_t tag = 0; 41314+ 41315+ // Discard the outer envelope, including trailer info if applicable. 41316+ if (!ReadUint8(iter, &tag)) 41317+ return absl::nullopt; 41318+ if (tag == kVersionTag) { 41319+ uint32_t version = 0; 41320+ if (!ReadUint32(iter, &version)) 41321+ return absl::nullopt; 41322+ static constexpr uint32_t kMinWireFormatVersionWithTrailer = 21; 41323+ if (version >= kMinWireFormatVersionWithTrailer) { 41324+ // In these versions, we expect kTrailerOffsetTag (0xFE) followed by an 41325+ // offset and size. 41326+ // See details in v8/serialization/serialization_tag.h 41327+ auto span = iter.Span<uint8_t>(1 + sizeof(uint64_t) + sizeof(uint32_t)); 41328+ if (span.empty() || span[0] != 0xFE) { 41329+ LOG(ERROR) << "Span is empty or span[0] not correct"; 41330+ return absl::nullopt; 41331+ } 41332+ } 41333+ if (!ReadUint8(iter, &tag)) { 41334+ return absl::nullopt; 41335+ } 41336+ } 41337+ 41338+ // Discard any leading version and padding tags. 41339+ while (tag == kVersionTag || tag == kPaddingTag) { 41340+ uint32_t version; 41341+ if (tag == kVersionTag && !ReadUint32(iter, &version)) { 41342+ LOG(ERROR) << "Read tag or version failed, tag:" << (int)tag; 41343+ return absl::nullopt; 41344+ } 41345+ if (!ReadUint8(iter, &tag)) { 41346+ LOG(ERROR) << "ReadUint8 failed"; 41347+ return absl::nullopt; 41348+ } 41349+ } 41350 41351+ switch (tag) { 41352+ case kOneByteStringTag: { 41353+ // Use of unsigned char rather than char here matters, so that Latin-1 41354+ // characters are zero-extended rather than sign-extended 41355+ uint32_t num_bytes; 41356+ if (!ReadUint32(iter, &num_bytes)) { 41357+ LOG(ERROR) << "ReadUint32 failed"; 41358+ return absl::nullopt; 41359+ } 41360+ auto span = iter.Span<unsigned char>(num_bytes / sizeof(unsigned char)); 41361+ std::u16string str(span.begin(), span.end()); 41362+ return span.size_bytes() == num_bytes 41363+ ? absl::make_optional(WebMessagePayload(std::move(str))) 41364+ : absl::nullopt; 41365+ } 41366+ case kTwoByteStringTag: { 41367+ uint32_t num_bytes; 41368+ if (!ReadUint32(iter, &num_bytes)) { 41369+ LOG(ERROR) << "ReadUint32 failed"; 41370+ return absl::nullopt; 41371+ } 41372+ auto span = iter.Span<char16_t>(num_bytes / sizeof(char16_t)); 41373+ std::u16string str(span.begin(), span.end()); 41374+ return span.size_bytes() == num_bytes 41375+ ? absl::make_optional(WebMessagePayload(std::move(str))) 41376+ : absl::nullopt; 41377+ } 41378+ case kArrayBuffer: { 41379+ uint32_t num_bytes; 41380+ if (!ReadUint32(iter, &num_bytes)) 41381+ return absl::nullopt; 41382+ auto span = iter.Span<uint8_t>(num_bytes); 41383+ std::vector<uint8_t> array_buf(span.begin(), span.end()); 41384+ return span.size_bytes() == num_bytes 41385+ ? absl::make_optional( 41386+ WebMessagePayload(std::move(array_buf))) 41387+ : absl::nullopt; 41388+ } 41389+ } 41390+ LOG(ERROR) << "Unexpected tag:"<< tag; 41391+ return absl::nullopt; 41392+} 41393 } // namespace blink 41394diff --git a/src/third_party/blink/common/messaging/web_message_port.cc b/src/third_party/blink/common/messaging/web_message_port.cc 41395index 88adf1bf32a79..48dba36367fbb 41396--- a/src/third_party/blink/common/messaging/web_message_port.cc 41397+++ b/src/third_party/blink/common/messaging/web_message_port.cc 41398@@ -4,6 +4,7 @@ 41399 41400 #include "third_party/blink/public/common/messaging/web_message_port.h" 41401 41402+#include "base/logging.h" 41403 #include "base/memory/ptr_util.h" 41404 #include "third_party/blink/public/common/messaging/message_port_channel.h" 41405 #include "third_party/blink/public/common/messaging/string_message_codec.h" 41406@@ -22,6 +23,11 @@ WebMessagePort::Message::~Message() = default; 41407 41408 WebMessagePort::Message::Message(const std::u16string& data) : data(data) {} 41409 41410+#if BUILDFLAG(IS_OHOS) 41411+WebMessagePort::Message::Message(std::vector<uint8_t> array_buffer) 41412+ : array_buffer(std::move(array_buffer)) {} 41413+#endif 41414+ 41415 WebMessagePort::Message::Message(std::vector<WebMessagePort> ports) 41416 : ports(std::move(ports)) {} 41417 41418@@ -152,11 +158,12 @@ bool WebMessagePort::PostMessage(Message&& message) { 41419 // Build the message. 41420 // TODO(chrisha): Finally kill off MessagePortChannel, once 41421 // MessagePortDescriptor more thoroughly plays that role. 41422- blink::TransferableMessage transferable_message; 41423- transferable_message.owned_encoded_message = 41424- blink::EncodeStringMessage(message.data); 41425- transferable_message.encoded_message = 41426- transferable_message.owned_encoded_message; 41427+ blink::TransferableMessage transferable_message = 41428+ blink::EncodeWebMessagePayload( 41429+ message.array_buffer.size() != 0 ? 41430+ WebMessagePayload(std::move(message.array_buffer)) : 41431+ WebMessagePayload(std::move(message.data))); 41432+ 41433 transferable_message.ports = 41434 blink::MessagePortChannel::CreateFromHandles(std::move(ports)); 41435 41436@@ -228,9 +235,20 @@ bool WebMessagePort::Accept(mojo::Message* mojo_message) { 41437 41438 // Decode the string portion of the message. 41439 Message message; 41440- if (!blink::DecodeStringMessage(transferable_message.encoded_message, 41441- &message.data)) { 41442- return false; 41443+ absl::optional<WebMessagePayload> optional_payload = 41444+ blink::DecodeToWebMessagePayload(transferable_message); 41445+ if (!optional_payload) { 41446+ LOG(ERROR) << "WebMessagePort::Accept DecodeToWebMessagePayload failed"; 41447+ return true; 41448+ } 41449+ auto& payload = optional_payload.value(); 41450+ if (auto* str = absl::get_if<std::u16string>(&payload)) { 41451+ message.data = std::move(*str); 41452+ } else if (auto* array_buffer = absl::get_if<std::vector<uint8_t>>(&payload)) { 41453+ message.array_buffer = std::move(*array_buffer); 41454+ } else { 41455+ LOG(INFO) << "WebMessagePort::Accept Get string or arraybuffer failed"; 41456+ return true; 41457 } 41458 41459 // Convert raw handles to MessagePorts. 41460diff --git a/src/third_party/blink/common/web_preferences/web_preferences.cc b/src/third_party/blink/common/web_preferences/web_preferences.cc 41461index f9e653d370fe9..3a5033aa662d2 41462--- a/src/third_party/blink/common/web_preferences/web_preferences.cc 41463+++ b/src/third_party/blink/common/web_preferences/web_preferences.cc 41464@@ -80,6 +80,10 @@ WebPreferences::WebPreferences() 41465 privileged_webgl_extensions_enabled(false), 41466 webgl_errors_to_console_enabled(true), 41467 hide_scrollbars(false), 41468+#if BUILDFLAG(IS_OHOS) 41469+ hide_vertical_scrollbars(false), 41470+ hide_horizontal_scrollbars(false), 41471+#endif 41472 accelerated_2d_canvas_enabled(false), 41473 new_canvas_2d_api_enabled(false), 41474 antialiased_2d_canvas_disabled(false), 41475diff --git a/src/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/src/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc 41476index 381c5180ce7de..8546be13bbf80 41477--- a/src/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc 41478+++ b/src/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc 41479@@ -94,6 +94,10 @@ bool StructTraits<blink::mojom::WebPreferencesDataView, 41480 data.privileged_webgl_extensions_enabled(); 41481 out->webgl_errors_to_console_enabled = data.webgl_errors_to_console_enabled(); 41482 out->hide_scrollbars = data.hide_scrollbars(); 41483+#if BUILDFLAG(IS_OHOS) 41484+ out->hide_vertical_scrollbars = data.hide_vertical_scrollbars(); 41485+ out->hide_horizontal_scrollbars = data.hide_horizontal_scrollbars(); 41486+#endif 41487 out->accelerated_2d_canvas_enabled = data.accelerated_2d_canvas_enabled(); 41488 out->new_canvas_2d_api_enabled = data.new_canvas_2d_api_enabled(); 41489 out->canvas_2d_layers_enabled = data.canvas_2d_layers_enabled(); 41490diff --git a/src/third_party/blink/public/common/BUILD.gn b/src/third_party/blink/public/common/BUILD.gn 41491index 8a9134a87b2e4..bae7b4d127606 41492--- a/src/third_party/blink/public/common/BUILD.gn 41493+++ b/src/third_party/blink/public/common/BUILD.gn 41494@@ -300,7 +300,7 @@ source_set("headers") { 41495 public_deps += [ "//media/mojo/mojom" ] 41496 } 41497 41498- if (is_android || is_win) { 41499+ if (is_android || is_win || is_ohos) { 41500 sources += [ 41501 "font_unique_name_lookup/font_table_matcher.h", 41502 "font_unique_name_lookup/font_table_persistence.h", 41503@@ -318,7 +318,7 @@ source_set("headers") { 41504 } 41505 } 41506 41507-if (is_android || is_win) { 41508+if (is_android || is_win || is_ohos) { 41509 proto_library("font_unique_name_table_proto") { 41510 sources = [ "font_unique_name_lookup/font_unique_name_table.proto" ] 41511 } 41512diff --git a/src/third_party/blink/public/common/features.h b/src/third_party/blink/public/common/features.h 41513index 5eb6f0b297af5..88bade5382fc0 41514--- a/src/third_party/blink/public/common/features.h 41515+++ b/src/third_party/blink/public/common/features.h 41516@@ -92,6 +92,7 @@ BLINK_COMMON_EXPORT bool IsPrerender2Enabled(); 41517 // Fenced Frames: 41518 BLINK_COMMON_EXPORT bool IsFencedFramesEnabled(); 41519 BLINK_COMMON_EXPORT bool IsFencedFramesMPArchBased(); 41520+BLINK_COMMON_EXPORT bool IsFencedFramesShadowDOMBased(); 41521 41522 // Whether we will create initial NavigationEntry or not on FrameTree creation, 41523 // which also impacts the session history replacement decisions made in the 41524diff --git a/src/third_party/blink/public/common/messaging/string_message_codec.h b/src/third_party/blink/public/common/messaging/string_message_codec.h 41525index c17506bc8ab74..48b0a5ad6de03 41526--- a/src/third_party/blink/public/common/messaging/string_message_codec.h 41527+++ b/src/third_party/blink/public/common/messaging/string_message_codec.h 41528@@ -8,7 +8,14 @@ 41529 #include <string> 41530 #include <vector> 41531 #include "base/containers/span.h" 41532+#if BUILDFLAG(IS_OHOS) 41533+#include "third_party/abseil-cpp/absl/types/optional.h" 41534+#include "third_party/abseil-cpp/absl/types/variant.h" 41535+#endif 41536 #include "third_party/blink/public/common/common_export.h" 41537+#if BUILDFLAG(IS_OHOS) 41538+#include "third_party/blink/public/common/messaging/transferable_message.h" 41539+#endif 41540 41541 namespace blink { 41542 41543@@ -29,6 +36,15 @@ BLINK_COMMON_EXPORT bool DecodeStringMessage( 41544 base::span<const uint8_t> encoded_data, 41545 std::u16string* result); 41546 41547+#if BUILDFLAG(IS_OHOS) 41548+using WebMessagePayload = absl::variant<std::u16string, std::vector<uint8_t>>; 41549+BLINK_COMMON_EXPORT TransferableMessage 41550+EncodeWebMessagePayload(const WebMessagePayload& payload); 41551+ 41552+BLINK_COMMON_EXPORT absl::optional<WebMessagePayload> DecodeToWebMessagePayload( 41553+ const TransferableMessage& message); 41554+#endif 41555+ 41556 } // namespace blink 41557 41558 #endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_MESSAGING_STRING_MESSAGE_CODEC_H_ 41559diff --git a/src/third_party/blink/public/common/messaging/web_message_port.h b/src/third_party/blink/public/common/messaging/web_message_port.h 41560index 254698d73120e..665c684870cc0 41561--- a/src/third_party/blink/public/common/messaging/web_message_port.h 41562+++ b/src/third_party/blink/public/common/messaging/web_message_port.h 41563@@ -192,6 +192,11 @@ struct BLINK_COMMON_EXPORT WebMessagePort::Message { 41564 // Creates a message with the given |data|. 41565 explicit Message(const std::u16string& data); 41566 41567+ #if BUILDFLAG(IS_OHOS) 41568+ // Creates a message with the given |array_buffer|. 41569+ explicit Message(std::vector<uint8_t> array_buffer); 41570+ #endif 41571+ 41572 // Creates a message with the given collection of |ports| to be transferred. 41573 explicit Message(std::vector<WebMessagePort> ports); 41574 41575@@ -208,6 +213,11 @@ struct BLINK_COMMON_EXPORT WebMessagePort::Message { 41576 // A UTF-16 message. 41577 std::u16string data; 41578 41579+ #if BUILDFLAG(IS_OHOS) 41580+ // std::vector<uint8_t>: the ArrayBuffer. 41581+ std::vector<uint8_t> array_buffer; 41582+ #endif 41583+ 41584 // Other message ports that are to be transmitted as part of this message. 41585 std::vector<WebMessagePort> ports; 41586 }; 41587diff --git a/src/third_party/blink/public/common/web_preferences/web_preferences.h b/src/third_party/blink/public/common/web_preferences/web_preferences.h 41588index 7e52226b871ac..f3c469e00b158 41589--- a/src/third_party/blink/public/common/web_preferences/web_preferences.h 41590+++ b/src/third_party/blink/public/common/web_preferences/web_preferences.h 41591@@ -94,6 +94,10 @@ struct BLINK_COMMON_EXPORT WebPreferences { 41592 bool privileged_webgl_extensions_enabled; 41593 bool webgl_errors_to_console_enabled; 41594 bool hide_scrollbars; 41595+#if BUILDFLAG(IS_OHOS) 41596+ bool hide_vertical_scrollbars; 41597+ bool hide_horizontal_scrollbars; 41598+#endif 41599 bool accelerated_2d_canvas_enabled; 41600 bool canvas_2d_layers_enabled = false; 41601 bool canvas_context_lost_in_background_enabled = false; 41602diff --git a/src/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/src/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h 41603index 8a60777eefdda..178bcd6e60134 41604--- a/src/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h 41605+++ b/src/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h 41606@@ -771,6 +771,16 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView, 41607 return r.pinch_smooth_mode; 41608 } 41609 41610+#if BUILDFLAG(IS_OHOS) 41611+ static bool hide_vertical_scrollbars(const blink::web_pref::WebPreferences& r) { 41612+ return r.hide_vertical_scrollbars; 41613+ } 41614+ 41615+ static bool hide_horizontal_scrollbars(const blink::web_pref::WebPreferences& r) { 41616+ return r.hide_horizontal_scrollbars; 41617+ } 41618+#endif 41619+ 41620 static bool Read(blink::mojom::WebPreferencesDataView r, 41621 blink::web_pref::WebPreferences* out); 41622 }; 41623diff --git a/src/third_party/blink/public/mojom/frame/policy_container.mojom b/src/third_party/blink/public/mojom/frame/policy_container.mojom 41624index 69a7a379298ce..ba6ab15b0f9d5 41625--- a/src/third_party/blink/public/mojom/frame/policy_container.mojom 41626+++ b/src/third_party/blink/public/mojom/frame/policy_container.mojom 41627@@ -12,6 +12,7 @@ struct PolicyContainerPolicies { 41628 network.mojom.ReferrerPolicy referrer_policy = network.mojom.ReferrerPolicy.kDefault; 41629 network.mojom.IPAddressSpace ip_address_space = network.mojom.IPAddressSpace.kUnknown; 41630 array<network.mojom.ContentSecurityPolicy> content_security_policies; 41631+ bool can_navigate_top_without_user_gesture = true; 41632 }; 41633 41634 // This interface is implemented in the browser process. It defines methods to 41635diff --git a/src/third_party/blink/public/mojom/input/focus_type.mojom b/src/third_party/blink/public/mojom/input/focus_type.mojom 41636index 207adda4ce349..fad19126fb01f 41637--- a/src/third_party/blink/public/mojom/input/focus_type.mojom 41638+++ b/src/third_party/blink/public/mojom/input/focus_type.mojom 41639@@ -5,8 +5,10 @@ 41640 module blink.mojom; 41641 41642 enum FocusType { 41643- // Element::focus(), etc. 41644+ // Catch-all focus type. Includes accessibility-based focusing. 41645 kNone = 0, 41646+ // element.focus()/element.blur() in JavaScript 41647+ kScript, 41648 // Sequential navigation with TAB, or Shift + TAB. 41649 kForward, 41650 kBackward, 41651diff --git a/src/third_party/blink/public/mojom/input/input_handler.mojom b/src/third_party/blink/public/mojom/input/input_handler.mojom 41652index 8fa77f86ee7de..9dbd8452c9978 41653--- a/src/third_party/blink/public/mojom/input/input_handler.mojom 41654+++ b/src/third_party/blink/public/mojom/input/input_handler.mojom 41655@@ -425,7 +425,10 @@ interface WidgetInputHandler { 41656 TouchActionOptional? touch_action); 41657 41658 [EnableIf=is_ohos] 41659- StartFling(); 41660+ TryStartFling(); 41661+ 41662+ [EnableIf=is_ohos] 41663+ TryFinishFling(); 41664 41665 // Sends a non-blocking input event to the render widget. The behaviour 41666 // of this API is the same as DispatchEvent just that there is no callback 41667diff --git a/src/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/src/third_party/blink/public/mojom/webpreferences/web_preferences.mojom 41668index 7872cd0dafc85..4d2af1424accf 41669--- a/src/third_party/blink/public/mojom/webpreferences/web_preferences.mojom 41670+++ b/src/third_party/blink/public/mojom/webpreferences/web_preferences.mojom 41671@@ -150,6 +150,8 @@ struct WebPreferences { 41672 bool privileged_webgl_extensions_enabled; 41673 bool webgl_errors_to_console_enabled; 41674 bool hide_scrollbars; 41675+ bool hide_vertical_scrollbars; 41676+ bool hide_horizontal_scrollbars; 41677 bool accelerated_2d_canvas_enabled; 41678 bool canvas_context_lost_in_background_enabled; 41679 bool new_canvas_2d_api_enabled; 41680diff --git a/src/third_party/blink/public/platform/web_policy_container.h b/src/third_party/blink/public/platform/web_policy_container.h 41681index b4eaac0716408..e8ed3f2383bc9 41682--- a/src/third_party/blink/public/platform/web_policy_container.h 41683+++ b/src/third_party/blink/public/platform/web_policy_container.h 41684@@ -20,6 +20,7 @@ struct WebPolicyContainerPolicies { 41685 network::mojom::ReferrerPolicy referrer_policy; 41686 network::mojom::IPAddressSpace ip_address_space; 41687 WebVector<WebContentSecurityPolicy> content_security_policies; 41688+ bool can_navigate_top_without_user_gesture = true; 41689 }; 41690 41691 // TODO(antoniosartori): Remove this when CommitNavigation IPC will be handled 41692diff --git a/src/third_party/blink/public/web/web_settings.h b/src/third_party/blink/public/web/web_settings.h 41693index 35e1ee688b31b..9a924f0bb6096 41694--- a/src/third_party/blink/public/web/web_settings.h 41695+++ b/src/third_party/blink/public/web/web_settings.h 41696@@ -171,6 +171,10 @@ class WebSettings { 41697 virtual void SetMinimumFontSize(int) = 0; 41698 virtual void SetMinimumLogicalFontSize(int) = 0; 41699 virtual void SetHideScrollbars(bool) = 0; 41700+#if BUILDFLAG(IS_OHOS) 41701+ virtual void SetVerticalHideScrollbars(bool) = 0; 41702+ virtual void SetHorizontalHideScrollbars(bool) = 0; 41703+#endif 41704 virtual void SetPasswordEchoDurationInSeconds(double) = 0; 41705 virtual void SetPasswordEchoEnabled(bool) = 0; 41706 virtual void SetPluginsEnabled(bool) = 0; 41707diff --git a/src/third_party/blink/public/web/web_view.h b/src/third_party/blink/public/web/web_view.h 41708index fc574edaaa2ad..655f075c3d9fe 41709--- a/src/third_party/blink/public/web/web_view.h 41710+++ b/src/third_party/blink/public/web/web_view.h 41711@@ -470,6 +470,12 @@ class WebView { 41712 // Returns whether this WebView represents a fenced frame root or not. 41713 virtual bool IsFencedFrameRoot() const = 0; 41714 41715+#if BUILDFLAG(IS_OHOS) 41716+ virtual gfx::PointF GetScrollOffset() = 0; 41717+ virtual float GetScrollBottom() = 0; 41718+ virtual void SetScrollOffset(const gfx::PointF point) = 0; 41719+#endif 41720+ 41721 // Misc ------------------------------------------------------------- 41722 41723 // Returns the number of live WebView instances in this process. 41724diff --git a/src/third_party/blink/renderer/core/css/css_variable_data.cc b/src/third_party/blink/renderer/core/css/css_variable_data.cc 41725index a2294cc70c59a..b3a61b312eb5f 41726--- a/src/third_party/blink/renderer/core/css/css_variable_data.cc 41727+++ b/src/third_party/blink/renderer/core/css/css_variable_data.cc 41728@@ -4,6 +4,7 @@ 41729 41730 #include "third_party/blink/renderer/core/css/css_variable_data.h" 41731 41732+#include "base/containers/span.h" 41733 #include "third_party/blink/renderer/core/css/css_syntax_definition.h" 41734 #include "third_party/blink/renderer/core/css/parser/css_parser_context.h" 41735 #include "third_party/blink/renderer/platform/wtf/text/character_names.h" 41736@@ -109,6 +110,51 @@ void CSSVariableData::ConsumeAndUpdateTokens(const CSSParserTokenRange& range) { 41737 UpdateTokens<UChar>(range, backing_string, tokens_); 41738 } 41739 41740+#if EXPENSIVE_DCHECKS_ARE_ON() 41741+ 41742+namespace { 41743+ 41744+template <typename CharacterType> 41745+bool IsSubspan(base::span<const CharacterType> inner, 41746+ base::span<const CharacterType> outer) { 41747+ // Note that base::span uses CheckedContiguousIterator, which restricts 41748+ // which comparisons are allowed. Therefore we must avoid begin()/end() here. 41749+ return inner.data() >= outer.data() && 41750+ (inner.data() + inner.size()) <= (outer.data() + outer.size()); 41751+} 41752+ 41753+bool TokenValueIsBacked(const CSSParserToken& token, 41754+ const String& backing_string) { 41755+ StringView value = token.Value(); 41756+ if (value.Is8Bit() != backing_string.Is8Bit()) 41757+ return false; 41758+ return value.Is8Bit() ? IsSubspan(value.Span8(), backing_string.Span8()) 41759+ : IsSubspan(value.Span16(), backing_string.Span16()); 41760+} 41761+ 41762+bool TokenValueIsBacked(const CSSParserToken& token, 41763+ const Vector<String>& backing_strings) { 41764+ DCHECK(token.HasStringBacking()); 41765+ for (const String& backing_string : backing_strings) { 41766+ if (TokenValueIsBacked(token, backing_string)) { 41767+ return true; 41768+ } 41769+ } 41770+ return false; 41771+} 41772+ 41773+} // namespace 41774+ 41775+void CSSVariableData::VerifyStringBacking() const { 41776+ for (const CSSParserToken& token : tokens_) { 41777+ DCHECK(!token.HasStringBacking() || 41778+ TokenValueIsBacked(token, backing_strings_)) 41779+ << "Token value is not backed: " << token.Value().ToString(); 41780+ } 41781+} 41782+ 41783+#endif // EXPENSIVE_DCHECKS_ARE_ON() 41784+ 41785 CSSVariableData::CSSVariableData(const CSSTokenizedValue& tokenized_value, 41786 bool is_animation_tainted, 41787 bool needs_variable_resolution, 41788@@ -120,6 +166,9 @@ CSSVariableData::CSSVariableData(const CSSTokenizedValue& tokenized_value, 41789 base_url_(base_url.IsValid() ? base_url.GetString() : String()), 41790 charset_(charset) { 41791 ConsumeAndUpdateTokens(tokenized_value.range); 41792+#if EXPENSIVE_DCHECKS_ARE_ON() 41793+ VerifyStringBacking(); 41794+#endif // EXPENSIVE_DCHECKS_ARE_ON() 41795 } 41796 41797 const CSSValue* CSSVariableData::ParseForSyntax( 41798diff --git a/src/third_party/blink/renderer/core/css/css_variable_data.h b/src/third_party/blink/renderer/core/css/css_variable_data.h 41799index 1f0d35e394d9f..ed9b6891edf99 41800--- a/src/third_party/blink/renderer/core/css/css_variable_data.h 41801+++ b/src/third_party/blink/renderer/core/css/css_variable_data.h 41802@@ -99,11 +99,18 @@ class CORE_EXPORT CSSVariableData : public RefCounted<CSSVariableData> { 41803 has_font_units_(has_font_units), 41804 has_root_font_units_(has_root_font_units), 41805 base_url_(base_url), 41806- charset_(charset) {} 41807+ charset_(charset) { 41808+#if EXPENSIVE_DCHECKS_ARE_ON() 41809+ VerifyStringBacking(); 41810+#endif // EXPENSIVE_DCHECKS_ARE_ON() 41811+ } 41812 CSSVariableData(const CSSVariableData&) = delete; 41813 CSSVariableData& operator=(const CSSVariableData&) = delete; 41814 41815 void ConsumeAndUpdateTokens(const CSSParserTokenRange&); 41816+#if EXPENSIVE_DCHECKS_ARE_ON() 41817+ void VerifyStringBacking() const; 41818+#endif // EXPENSIVE_DCHECKS_ARE_ON() 41819 41820 // tokens_ may have raw pointers to string data, we store the String objects 41821 // owning that data in backing_strings_ to keep it alive alongside the 41822diff --git a/src/third_party/blink/renderer/core/css/parser/css_tokenizer.h b/src/third_party/blink/renderer/core/css/parser/css_tokenizer.h 41823index 817bcbd4b6b9a..682a44a478bcd 41824--- a/src/third_party/blink/renderer/core/css/parser/css_tokenizer.h 41825+++ b/src/third_party/blink/renderer/core/css/parser/css_tokenizer.h 41826@@ -33,6 +33,7 @@ class CORE_EXPORT CSSTokenizer { 41827 wtf_size_t Offset() const { return input_.Offset(); } 41828 wtf_size_t PreviousOffset() const { return prev_offset_; } 41829 StringView StringRangeAt(wtf_size_t start, wtf_size_t length) const; 41830+ const Vector<String>& StringPool() const { return string_pool_; } 41831 41832 private: 41833 CSSParserToken TokenizeSingle(); 41834diff --git a/src/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc b/src/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc 41835index 34bed060c91e8..39d4113c7c714 41836--- a/src/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc 41837+++ b/src/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc 41838@@ -2147,6 +2147,10 @@ StyleBuilderConverter::ConvertRegisteredPropertyVariableData( 41839 41840 Vector<String> backing_strings; 41841 backing_strings.push_back(text); 41842+ // CSSTokenizer may allocate new strings for some tokens (e.g. for escapes) 41843+ // and produce tokens that point to those strings. We need to retain those 41844+ // strings (if any) as well. 41845+ backing_strings.AppendVector(tokenizer.StringPool()); 41846 41847 const bool has_font_units = false; 41848 const bool has_root_font_units = false; 41849diff --git a/src/third_party/blink/renderer/core/css/style_engine.cc b/src/third_party/blink/renderer/core/css/style_engine.cc 41850index e157b5b645eda..85268203bf6d1 41851--- a/src/third_party/blink/renderer/core/css/style_engine.cc 41852+++ b/src/third_party/blink/renderer/core/css/style_engine.cc 41853@@ -2435,6 +2435,7 @@ void StyleEngine::RecalcStyle(StyleRecalcChange change, 41854 const StyleRecalcContext& style_recalc_context) { 41855 DCHECK(GetDocument().documentElement()); 41856 HasMatchedCacheScope has_matched_cache_scope(&GetDocument()); 41857+ SkipStyleRecalcScope skip_scope(*this); 41858 Element& root_element = style_recalc_root_.RootElement(); 41859 Element* parent = FlatTreeTraversal::ParentElement(root_element); 41860 41861@@ -2997,4 +2998,17 @@ void StyleEngine::MarkForLayoutTreeChangesAfterDetach() { 41862 parent_for_detached_subtree_ = nullptr; 41863 } 41864 41865+bool StyleEngine::AllowSkipStyleRecalcForScope() const { 41866+ if (InContainerQueryStyleRecalc()) 41867+ return true; 41868+ if (LocalFrameView* view = GetDocument().View()) { 41869+ // Existing layout roots before starting style recalc may end up being 41870+ // inside skipped subtrees if we allowed skipping. If we start out with an 41871+ // empty list, any added ones will be a result of an element style recalc, 41872+ // which means the will not be inside a skipped subtree. 41873+ return !view->IsSubtreeLayout(); 41874+ } 41875+ return true; 41876+} 41877+ 41878 } // namespace blink 41879diff --git a/src/third_party/blink/renderer/core/css/style_engine.h b/src/third_party/blink/renderer/core/css/style_engine.h 41880index f9867e203b9a8..862b269a6e7d3 41881--- a/src/third_party/blink/renderer/core/css/style_engine.h 41882+++ b/src/third_party/blink/renderer/core/css/style_engine.h 41883@@ -163,6 +163,20 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, 41884 base::AutoReset<bool> allow_marking_; 41885 }; 41886 41887+ // Set up the condition for allowing to skip style recalc before starting 41888+ // RecalcStyle(). 41889+ class SkipStyleRecalcScope { 41890+ STACK_ALLOCATED(); 41891+ 41892+ public: 41893+ explicit SkipStyleRecalcScope(StyleEngine& engine) 41894+ : allow_skip_(&engine.allow_skip_style_recalc_, 41895+ engine.AllowSkipStyleRecalcForScope()) {} 41896+ 41897+ private: 41898+ base::AutoReset<bool> allow_skip_; 41899+ }; 41900+ 41901 explicit StyleEngine(Document&); 41902 ~StyleEngine() override; 41903 41904@@ -323,6 +337,10 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, 41905 void UpdateStyleRecalcRoot(ContainerNode* ancestor, Node* dirty_node); 41906 void UpdateLayoutTreeRebuildRoot(ContainerNode* ancestor, Node* dirty_node); 41907 41908+ // Returns true if we can skip style recalc for a size container subtree and 41909+ // resume it during layout. 41910+ bool SkipStyleRecalcAllowed() const { return allow_skip_style_recalc_; } 41911+ 41912 CSSFontSelector* GetFontSelector() { return font_selector_; } 41913 41914 void RemoveFontFaceRules(const HeapVector<Member<const StyleRuleFontFace>>&); 41915@@ -673,6 +691,9 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, 41916 // container. 41917 void RebuildFieldSetContainer(HTMLFieldSetElement& fieldset); 41918 41919+ // Initialization value for SkipStyleRecalcScope. 41920+ bool AllowSkipStyleRecalcForScope() const; 41921+ 41922 Member<Document> document_; 41923 41924 // Tracks the number of currently loading top-level stylesheets. Sheets loaded 41925@@ -746,6 +767,9 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, 41926 // AllowMarkStyleDirtyFromRecalcScope. 41927 bool allow_mark_for_reattach_from_rebuild_layout_tree_{false}; 41928 41929+ // Set to true if we are allowed to skip recalc for a size container subtree. 41930+ bool allow_skip_style_recalc_{false}; 41931+ 41932 VisionDeficiency vision_deficiency_{VisionDeficiency::kNoVisionDeficiency}; 41933 Member<ReferenceFilterOperation> vision_deficiency_filter_; 41934 41935diff --git a/src/third_party/blink/renderer/core/dom/document.cc b/src/third_party/blink/renderer/core/dom/document.cc 41936index f6cb04deef8bb..398acdbcdb891 41937--- a/src/third_party/blink/renderer/core/dom/document.cc 41938+++ b/src/third_party/blink/renderer/core/dom/document.cc 41939@@ -4788,8 +4788,10 @@ bool Document::SetFocusedElement(Element* new_focused_element, 41940 focused_element_ = new_focused_element; 41941 SetSequentialFocusNavigationStartingPoint(focused_element_.Get()); 41942 41943- // Keep track of last focus from user interaction, ignoring focus from code. 41944- if (params.type != mojom::blink::FocusType::kNone) 41945+ // Keep track of last focus from user interaction, ignoring focus from code 41946+ // and other non-user internal interventions. 41947+ if (params.type != mojom::blink::FocusType::kNone && 41948+ params.type != mojom::blink::FocusType::kScript) 41949 last_focus_type_ = params.type; 41950 41951 focused_element_->SetFocused(true, params.type); 41952diff --git a/src/third_party/blink/renderer/core/dom/element.cc b/src/third_party/blink/renderer/core/dom/element.cc 41953index 7903efdbcfab6..92ae9e773fd3a 41954--- a/src/third_party/blink/renderer/core/dom/element.cc 41955+++ b/src/third_party/blink/renderer/core/dom/element.cc 41956@@ -2904,6 +2904,10 @@ bool Element::SkipStyleRecalcForContainer( 41957 const ComputedStyle& style, 41958 const StyleRecalcChange& child_change) { 41959 DCHECK(RuntimeEnabledFeatures::CSSContainerSkipStyleRecalcEnabled()); 41960+ 41961+ if (!GetDocument().GetStyleEngine().SkipStyleRecalcAllowed()) 41962+ return false; 41963+ 41964 if (!child_change.TraversePseudoElements(*this)) { 41965 // If none of the children or pseudo elements need to be traversed for style 41966 // recalc, there is no point in marking the subtree as skipped. 41967@@ -4391,13 +4395,21 @@ Element* Element::GetFocusableArea() const { 41968 return FocusController::FindFocusableElementInShadowHost(*this); 41969 } 41970 41971+void Element::focusForBindings(const FocusOptions* options) { 41972+ focus(FocusParams(SelectionBehaviorOnFocus::kRestore, 41973+ mojom::blink::FocusType::kScript, 41974+ /*capabilities=*/nullptr, options, 41975+ /*gate_on_user_activation=*/true)); 41976+} 41977+ 41978 void Element::focus() { 41979 focus(FocusParams()); 41980 } 41981 41982 void Element::focus(const FocusOptions* options) { 41983 focus(FocusParams(SelectionBehaviorOnFocus::kRestore, 41984- mojom::blink::FocusType::kNone, nullptr, options)); 41985+ mojom::blink::FocusType::kNone, /*capabilities=*/nullptr, 41986+ options)); 41987 } 41988 41989 void Element::focus(const FocusParams& params) { 41990@@ -4418,6 +4430,37 @@ void Element::focus(const FocusParams& params) { 41991 frame_owner_element->contentDocument()->UnloadStarted()) 41992 return; 41993 41994+ FocusOptions* focus_options = nullptr; 41995+ if (params.gate_on_user_activation) { 41996+ LocalFrame& frame = *GetDocument().GetFrame(); 41997+ if (!frame.AllowFocusWithoutUserActivation() && 41998+ !LocalFrame::HasTransientUserActivation(&frame)) { 41999+ return; 42000+ } 42001+ 42002+ // Fenced frame focusing should not auto-scroll, since that behavior can 42003+ // be observed by an embedder. 42004+ if (frame.IsInFencedFrameTree()) { 42005+ focus_options = FocusOptions::Create(); 42006+ focus_options->setPreventScroll(true); 42007+ } 42008+ 42009+ // Fenced frames should consume user activation when attempting to pull 42010+ // focus across a fenced boundary into itself. 42011+ // TODO(crbug.com/848778) Right now the browser can't verify that the 42012+ // renderer properly consumed user activation. When user activation code is 42013+ // migrated to the browser, move this logic to the browser as well. 42014+ if (!frame.AllowFocusWithoutUserActivation() && 42015+ frame.IsInFencedFrameTree()) { 42016+ LocalFrame::ConsumeTransientUserActivation(&frame); 42017+ } 42018+ } 42019+ 42020+ FocusParams params_to_use = FocusParams( 42021+ params.selection_behavior, params.type, params.source_capabilities, 42022+ focus_options ? focus_options : params.options, 42023+ params.gate_on_user_activation); 42024+ 42025 // Ensure we have clean style (including forced display locks). 42026 GetDocument().UpdateStyleAndLayoutTreeForNode(this); 42027 42028@@ -4428,23 +4471,24 @@ void Element::focus(const FocusParams& params) { 42029 if (Element* new_focus_target = GetFocusableArea()) { 42030 // Unlike the specification, we re-run focus() for new_focus_target 42031 // because we can't change |this| in a member function. 42032- new_focus_target->focus(FocusParams(SelectionBehaviorOnFocus::kReset, 42033- mojom::blink::FocusType::kForward, 42034- nullptr, params.options)); 42035+ new_focus_target->focus(FocusParams( 42036+ SelectionBehaviorOnFocus::kReset, mojom::blink::FocusType::kForward, 42037+ /*capabilities=*/nullptr, params_to_use.options)); 42038 } 42039 // 2. If new focus target is null, then: 42040 // 2.1. If no fallback target was specified, then return. 42041 return; 42042 } 42043- // If script called focus(), then the type would be none. This means we are 42044- // activating because of a script action (kScriptFocus). Otherwise, this is a 42045- // user activation (kUserFocus). 42046- ActivateDisplayLockIfNeeded(params.type == mojom::blink::FocusType::kNone 42047+ // If a script called focus(), then the type would be kScript. This means 42048+ // we are activating because of a script action (kScriptFocus). Otherwise, 42049+ // this is a user activation (kUserFocus). 42050+ ActivateDisplayLockIfNeeded(params_to_use.type == 42051+ mojom::blink::FocusType::kScript 42052 ? DisplayLockActivationReason::kScriptFocus 42053 : DisplayLockActivationReason::kUserFocus); 42054 42055 if (!GetDocument().GetPage()->GetFocusController().SetFocusedElement( 42056- this, GetDocument().GetFrame(), params)) 42057+ this, GetDocument().GetFrame(), params_to_use)) 42058 return; 42059 42060 if (GetDocument().FocusedElement() == this) { 42061@@ -4465,15 +4509,16 @@ void Element::focus(const FocusParams& params) { 42062 // Trigger a tooltip to show for the newly focused element only when the 42063 // focus was set resulting from a keyboard action. 42064 // 42065- // TODO(bebeaudr): To also trigger a tooltip when the |params.type| is 42066- // kSpatialNavigation, we'll first have to ensure that the fake mouse move 42067- // event fired by `SpatialNavigationController::DispatchMouseMoveEvent` does 42068- // not lead to a cursor triggered tooltip update. The only tooltip update 42069- // that there should be in that case is the one triggered from the spatial 42070- // navigation keypress. This issue is tracked in https://crbug.com/1206446. 42071+ // TODO(bebeaudr): To also trigger a tooltip when the |params_to_use.type| 42072+ // is kSpatialNavigation, we'll first have to ensure that the fake mouse 42073+ // move event fired by `SpatialNavigationController::DispatchMouseMoveEvent` 42074+ // does not lead to a cursor triggered tooltip update. The only tooltip 42075+ // update that there should be in that case is the one triggered from the 42076+ // spatial navigation keypress. This issue is tracked in 42077+ // https://crbug.com/1206446. 42078 bool is_focused_from_keypress = false; 42079- switch (params.type) { 42080- case mojom::blink::FocusType::kNone: 42081+ switch (params_to_use.type) { 42082+ case mojom::blink::FocusType::kScript: 42083 if (GetDocument() 42084 .GetFrame() 42085 ->LocalFrameRoot() 42086diff --git a/src/third_party/blink/renderer/core/dom/element.h b/src/third_party/blink/renderer/core/dom/element.h 42087index 7ac352e3cdf40..28a045bd9cb2a 42088--- a/src/third_party/blink/renderer/core/dom/element.h 42089+++ b/src/third_party/blink/renderer/core/dom/element.h 42090@@ -690,6 +690,11 @@ class CORE_EXPORT Element : public ContainerNode, public Animatable { 42091 // delegatesFocus flag. 42092 bool DelegatesFocus() const; 42093 Element* GetFocusableArea() const; 42094+ // Element focus function called through IDL (i.e. element.focus() in JS) 42095+ // Delegates to Focus() with focus type set to kScript 42096+ void focusForBindings(const FocusOptions*); 42097+ // Element focus function called from outside IDL (user focus, 42098+ // accessibility, etc...) 42099 virtual void focus(const FocusParams&); 42100 void focus(); 42101 void focus(const FocusOptions*); 42102diff --git a/src/third_party/blink/renderer/core/dom/events/event_dispatcher.cc b/src/third_party/blink/renderer/core/dom/events/event_dispatcher.cc 42103index f7ce838a77e45..0e3aab7a26af9 42104--- a/src/third_party/blink/renderer/core/dom/events/event_dispatcher.cc 42105+++ b/src/third_party/blink/renderer/core/dom/events/event_dispatcher.cc 42106@@ -359,8 +359,13 @@ inline void EventDispatcher::DispatchEventPostProcess( 42107 // Call default event handlers. While the DOM does have a concept of 42108 // preventing default handling, the detail of which handlers are called is an 42109 // internal implementation detail and not part of the DOM. 42110+#if BUILDFLAG(IS_OHOS) 42111+ if ((event_->type() == event_type_names::kClick || !event_->defaultPrevented()) 42112+ && !event_->DefaultHandled() && is_trusted_or_click) { 42113+#elif 42114 if (!event_->defaultPrevented() && !event_->DefaultHandled() && 42115 is_trusted_or_click) { 42116+#endif 42117 // Non-bubbling events call only one default event handler, the one for the 42118 // target. 42119 node_->DefaultEventHandler(*event_); 42120diff --git a/src/third_party/blink/renderer/core/dom/focus_params.h b/src/third_party/blink/renderer/core/dom/focus_params.h 42121index c6245bcd9ea3f..4ea14c48fdb3f 42122--- a/src/third_party/blink/renderer/core/dom/focus_params.h 42123+++ b/src/third_party/blink/renderer/core/dom/focus_params.h 42124@@ -17,14 +17,19 @@ struct FocusParams { 42125 42126 public: 42127 FocusParams() : options(FocusOptions::Create()) {} 42128+ explicit FocusParams(bool gate_on_user_activation) 42129+ : options(FocusOptions::Create()), 42130+ gate_on_user_activation(gate_on_user_activation) {} 42131 FocusParams(SelectionBehaviorOnFocus selection, 42132 mojom::blink::FocusType focus_type, 42133 InputDeviceCapabilities* capabilities, 42134- const FocusOptions* focus_options = FocusOptions::Create()) 42135+ const FocusOptions* focus_options = FocusOptions::Create(), 42136+ bool gate_on_user_activation = false) 42137 : selection_behavior(selection), 42138 type(focus_type), 42139 source_capabilities(capabilities), 42140- options(focus_options) {} 42141+ options(focus_options), 42142+ gate_on_user_activation(gate_on_user_activation) {} 42143 42144 SelectionBehaviorOnFocus selection_behavior = 42145 SelectionBehaviorOnFocus::kRestore; 42146@@ -32,6 +37,7 @@ struct FocusParams { 42147 InputDeviceCapabilities* source_capabilities = nullptr; 42148 const FocusOptions* options = nullptr; 42149 bool omit_blur_events = false; 42150+ bool gate_on_user_activation = false; 42151 }; 42152 42153 } // namespace blink 42154diff --git a/src/third_party/blink/renderer/core/exported/web_settings_impl.cc b/src/third_party/blink/renderer/core/exported/web_settings_impl.cc 42155index b5415691e3d7f..e690b6db1f07b 42156--- a/src/third_party/blink/renderer/core/exported/web_settings_impl.cc 42157+++ b/src/third_party/blink/renderer/core/exported/web_settings_impl.cc 42158@@ -463,6 +463,16 @@ void WebSettingsImpl::SetHideScrollbars(bool enabled) { 42159 dev_tools_emulator_->SetHideScrollbars(enabled); 42160 } 42161 42162+#if BUILDFLAG(IS_OHOS) 42163+void WebSettingsImpl::SetVerticalHideScrollbars(bool enabled) { 42164+ settings_->SetVerticalHideScrollbars(enabled); 42165+} 42166+ 42167+void WebSettingsImpl::SetHorizontalHideScrollbars(bool enabled) { 42168+ settings_->SetHorizontalHideScrollbars(enabled); 42169+} 42170+#endif 42171+ 42172 void WebSettingsImpl::SetMockGestureTapHighlightsEnabled(bool enabled) { 42173 settings_->SetMockGestureTapHighlightsEnabled(enabled); 42174 } 42175diff --git a/src/third_party/blink/renderer/core/exported/web_settings_impl.h b/src/third_party/blink/renderer/core/exported/web_settings_impl.h 42176index 910d094b33358..30018f7be038f 42177--- a/src/third_party/blink/renderer/core/exported/web_settings_impl.h 42178+++ b/src/third_party/blink/renderer/core/exported/web_settings_impl.h 42179@@ -122,6 +122,10 @@ class CORE_EXPORT WebSettingsImpl final : public WebSettings { 42180 void SetMinimumFontSize(int) override; 42181 void SetMinimumLogicalFontSize(int) override; 42182 void SetHideScrollbars(bool) override; 42183+#if BUILDFLAG(IS_OHOS) 42184+ void SetVerticalHideScrollbars(bool) override; 42185+ void SetHorizontalHideScrollbars(bool) override; 42186+#endif 42187 void SetPasswordEchoDurationInSeconds(double) override; 42188 void SetPasswordEchoEnabled(bool) override; 42189 void SetPluginsEnabled(bool) override; 42190diff --git a/src/third_party/blink/renderer/core/exported/web_view_impl.cc b/src/third_party/blink/renderer/core/exported/web_view_impl.cc 42191index c47b95908fc0d..b4a7a145ddd91 42192--- a/src/third_party/blink/renderer/core/exported/web_view_impl.cc 42193+++ b/src/third_party/blink/renderer/core/exported/web_view_impl.cc 42194@@ -629,7 +629,6 @@ bool WebViewImpl::StartPageScaleAnimation(const gfx::Point& target_position, 42195 // compositing. 42196 DCHECK(MainFrameImpl()); 42197 DCHECK(does_composite_); 42198- 42199 VisualViewport& visual_viewport = GetPage()->GetVisualViewport(); 42200 gfx::Point clamped_point = target_position; 42201 if (!use_anchor) { 42202@@ -1483,6 +1482,11 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, 42203 42204 settings->SetHideScrollbars(prefs.hide_scrollbars); 42205 42206+#if BUILDFLAG(IS_OHOS) 42207+ settings->SetVerticalHideScrollbars(prefs.hide_vertical_scrollbars); 42208+ settings->SetHorizontalHideScrollbars(prefs.hide_horizontal_scrollbars); 42209+#endif 42210+ 42211 // Enable gpu-accelerated 2d canvas if requested on the command line. 42212 RuntimeEnabledFeatures::SetAccelerated2dCanvasEnabled( 42213 prefs.accelerated_2d_canvas_enabled); 42214@@ -2076,6 +2080,34 @@ void WebViewImpl::SmoothScroll(int target_x, 42215 StartPageScaleAnimation(target_position, false, PageScaleFactor(), duration); 42216 } 42217 42218+#if BUILDFLAG(IS_OHOS) 42219+gfx::PointF WebViewImpl::GetScrollOffset() { 42220+ DCHECK(MainFrameImpl()); 42221+ DCHECK(MainFrameImpl()->GetFrameView()); 42222+ LocalFrameView* view = MainFrameImpl()->GetFrameView(); 42223+ DCHECK(view->GetScrollableArea()); 42224+ ScrollOffset offset = view->GetScrollableArea()->GetScrollOffset(); 42225+ return view->GetScrollableArea()->ScrollOffsetToPosition(offset); 42226+} 42227+ 42228+float WebViewImpl::GetScrollBottom() { 42229+ ScrollableArea* root_viewport = 42230+ MainFrameImpl()->GetFrame()->View()->GetScrollableArea(); 42231+ if (!root_viewport) { 42232+ return -1.0; 42233+ } 42234+ return root_viewport->MaximumScrollOffset().y(); 42235+} 42236+ 42237+void WebViewImpl::SetScrollOffset(const gfx::PointF point) { 42238+ DCHECK(MainFrameImpl()); 42239+ DCHECK(MainFrameImpl()->GetFrameView()); 42240+ LocalFrameView* view = MainFrameImpl()->GetFrameView(); 42241+ DCHECK(view->GetScrollableArea()); 42242+ view->GetScrollableArea()->SetScrollOffset(gfx::Vector2dF(point.OffsetFromOrigin()), mojom::blink::ScrollType::kProgrammatic); 42243+} 42244+#endif 42245+ 42246 void WebViewImpl::ComputeScaleAndScrollForEditableElementRects( 42247 const gfx::Rect& element_bounds_in_document, 42248 const gfx::Rect& caret_bounds_in_document, 42249diff --git a/src/third_party/blink/renderer/core/exported/web_view_impl.h b/src/third_party/blink/renderer/core/exported/web_view_impl.h 42250index 0ecba5732b21a..fbed3cc646da6 42251--- a/src/third_party/blink/renderer/core/exported/web_view_impl.h 42252+++ b/src/third_party/blink/renderer/core/exported/web_view_impl.h 42253@@ -591,6 +591,12 @@ class CORE_EXPORT WebViewImpl final : public WebView, 42254 // words, after the frame has painted something. 42255 void DidFirstVisuallyNonEmptyPaint(); 42256 42257+#if BUILDFLAG(IS_OHOS) 42258+ gfx::PointF GetScrollOffset() override; 42259+ float GetScrollBottom() override; 42260+ void SetScrollOffset(const gfx::PointF point) override; 42261+#endif 42262+ 42263 private: 42264 FRIEND_TEST_ALL_PREFIXES(WebFrameTest, DivScrollIntoEditableTest); 42265 FRIEND_TEST_ALL_PREFIXES(WebFrameTest, 42266diff --git a/src/third_party/blink/renderer/core/fetch/headers.cc b/src/third_party/blink/renderer/core/fetch/headers.cc 42267index 9b6c76500e70b..395ad05df0c15 42268--- a/src/third_party/blink/renderer/core/fetch/headers.cc 42269+++ b/src/third_party/blink/renderer/core/fetch/headers.cc 42270@@ -96,7 +96,7 @@ void Headers::append(const String& name, 42271 } 42272 // "4. Otherwise, if guard is |request| and |name| is a forbidden header 42273 // name, return." 42274- if (guard_ == kRequestGuard && cors::IsForbiddenHeaderName(name)) 42275+ if (guard_ == kRequestGuard && cors::IsForbiddenRequestHeader(name, value)) 42276 return; 42277 // 5. Otherwise, if guard is |request-no-cors|: 42278 if (guard_ == kRequestNoCorsGuard) { 42279@@ -145,9 +145,9 @@ void Headers::remove(const String& name, ExceptionState& exception_state) { 42280 exception_state.ThrowTypeError("Headers are immutable"); 42281 return; 42282 } 42283- // "3. Otherwise, if guard is |request| and |name| is a forbidden header 42284- // name, return." 42285- if (guard_ == kRequestGuard && cors::IsForbiddenHeaderName(name)) 42286+ // "3. Otherwise, if guard is |request| and (|name|, '') is a forbidden 42287+ // request header, return." 42288+ if (guard_ == kRequestGuard && cors::IsForbiddenRequestHeader(name, "")) 42289 return; 42290 // "4. Otherwise, if the context object’s guard is |request-no-cors|, |name| 42291 // is not a no-CORS-safelisted request-header name, and |name| is not a 42292@@ -222,9 +222,9 @@ void Headers::set(const String& name, 42293 exception_state.ThrowTypeError("Headers are immutable"); 42294 return; 42295 } 42296- // "4. Otherwise, if guard is |request| and |name| is a forbidden header 42297- // name, return." 42298- if (guard_ == kRequestGuard && cors::IsForbiddenHeaderName(name)) 42299+ // "4. Otherwise, if guard is |request| and (|name|, |value|) is a forbidden 42300+ // request header, return." 42301+ if (guard_ == kRequestGuard && cors::IsForbiddenRequestHeader(name, value)) 42302 return; 42303 // "5. Otherwise, if guard is |request-no-CORS| and |name|/|value| is not a 42304 // no-CORS-safelisted header, return." 42305diff --git a/src/third_party/blink/renderer/core/frame/dom_window.cc b/src/third_party/blink/renderer/core/frame/dom_window.cc 42306index de0e82d3fc66c..c09d5d365b643 42307--- a/src/third_party/blink/renderer/core/frame/dom_window.cc 42308+++ b/src/third_party/blink/renderer/core/frame/dom_window.cc 42309@@ -439,6 +439,18 @@ void DOMWindow::focus(v8::Isolate* isolate) { 42310 if (!page) 42311 return; 42312 42313+ if (!frame->AllowFocusWithoutUserActivation()) { 42314+ // Disallow script focus that crosses a fenced frame boundary on a 42315+ // frame that doesn't have transient user activation. Note: all calls to 42316+ // DOMWindow::focus come from JavaScript calls in the web platform 42317+ if (!frame->HasTransientUserActivation()) 42318+ return; 42319+ // Fenced frames should consume user activation when attempting to pull 42320+ // focus across a fenced boundary into itself. 42321+ if (frame->IsInFencedFrameTree()) 42322+ LocalFrame::ConsumeTransientUserActivation(DynamicTo<LocalFrame>(frame)); 42323+ } 42324+ 42325 RecordWindowProxyAccessMetrics( 42326 WebFeature::kWindowProxyCrossOriginAccessFocus, 42327 WebFeature::kWindowProxyCrossOriginAccessFromOtherPageFocus); 42328diff --git a/src/third_party/blink/renderer/core/frame/frame.cc b/src/third_party/blink/renderer/core/frame/frame.cc 42329index 4a1d747aa1ea4..be44da94f7375 42330--- a/src/third_party/blink/renderer/core/frame/frame.cc 42331+++ b/src/third_party/blink/renderer/core/frame/frame.cc 42332@@ -334,10 +334,12 @@ void Frame::RenderFallbackContentWithResourceTiming( 42333 } 42334 42335 bool Frame::IsInFencedFrameTree() const { 42336- if (!blink::features::IsFencedFramesEnabled()) 42337+ DCHECK(!IsDetached()); 42338+ const auto& ff_impl = GetPage()->FencedFramesImplementationType(); 42339+ if (!ff_impl) 42340 return false; 42341 42342- switch (blink::features::kFencedFramesImplementationTypeParam.Get()) { 42343+ switch (ff_impl.value()) { 42344 case blink::features::FencedFramesImplementationType::kMPArch: 42345 return GetPage()->IsMainFrameFencedFrameRoot(); 42346 case blink::features::FencedFramesImplementationType::kShadowDOM: 42347@@ -582,6 +584,38 @@ Frame* Frame::FirstChild(FrameTreeBoundary frame_tree_boundary) const { 42348 return first_child_; 42349 } 42350 42351+bool Frame::FocusCrossesFencedBoundary() { 42352+ DCHECK(blink::features::IsFencedFramesShadowDOMBased()); 42353+ 42354+ if (Frame* focused_frame = GetPage()->GetFocusController().FocusedFrame()) { 42355+ if (!focused_frame->IsInFencedFrameTree() && !IsInFencedFrameTree()) 42356+ return false; 42357+ 42358+ return Tree().Top(FrameTreeBoundary::kFenced) != 42359+ focused_frame->Tree().Top(FrameTreeBoundary::kFenced); 42360+ } 42361+ 42362+ return false; 42363+} 42364+ 42365+bool Frame::AllowFocusWithoutUserActivation() { 42366+ const auto& ff_impl = GetPage()->FencedFramesImplementationType(); 42367+ if (!ff_impl) 42368+ return true; 42369+ 42370+ switch (ff_impl.value()) { 42371+ case blink::features::FencedFramesImplementationType::kMPArch: 42372+ // For a newly-loaded page, no page will have focus. We allow a non-fenced 42373+ // frame to get the first focus before enforcing if a page already has 42374+ // focus. 42375+ return (!GetPage()->GetFocusController().IsActive() && 42376+ !IsInFencedFrameTree()) || 42377+ GetPage()->GetFocusController().IsFocused(); 42378+ case blink::features::FencedFramesImplementationType::kShadowDOM: 42379+ return !FocusCrossesFencedBoundary(); 42380+ } 42381+} 42382+ 42383 bool Frame::Swap(WebFrame* new_web_frame) { 42384 DCHECK(IsAttached()); 42385 42386diff --git a/src/third_party/blink/renderer/core/frame/frame.h b/src/third_party/blink/renderer/core/frame/frame.h 42387index 0c1b8d618245d..1ad6c387903c1 42388--- a/src/third_party/blink/renderer/core/frame/frame.h 42389+++ b/src/third_party/blink/renderer/core/frame/frame.h 42390@@ -192,6 +192,14 @@ class CORE_EXPORT Frame : public GarbageCollected<Frame> { 42391 void SetIsLoading(bool is_loading) { is_loading_ = is_loading; } 42392 bool IsLoading() const { return is_loading_; } 42393 42394+ // Determines if the frame should be allowed to pull focus without receiving 42395+ // user activation. A frame cannot pull focus without user activation if 42396+ // doing so would cross a fenced frame boundary. 42397+ // Note: the only time focus can be pulled across a fence without the target 42398+ // frame having user activation is in the case of tab-focusing. In that case, 42399+ // this function is not called and focus is blanket allowed. 42400+ bool AllowFocusWithoutUserActivation(); 42401+ 42402 // Tells the frame to check whether its load has completed, based on the state 42403 // of its subframes, etc. 42404 virtual void CheckCompleted() = 0; 42405@@ -456,6 +464,12 @@ class CORE_EXPORT Frame : public GarbageCollected<Frame> { 42406 // null. The child frame's parent must be set in the constructor. 42407 void InsertAfter(Frame* new_child, Frame* previous_sibling); 42408 42409+ // Returns true if this frame pulling focus will cause focus to traverse 42410+ // across a fenced frame boundary. This handles checking for focus entering 42411+ // a fenced frame, as well as focus leaving a fenced frames. 42412+ // Note: This is only called if fenced frames are enabled with ShadowDOM 42413+ bool FocusCrossesFencedBoundary(); 42414+ 42415 Member<FrameClient> client_; 42416 const Member<WindowProxyManager> window_proxy_manager_; 42417 FrameLifecycle lifecycle_; 42418diff --git a/src/third_party/blink/renderer/core/frame/local_frame.cc b/src/third_party/blink/renderer/core/frame/local_frame.cc 42419index 1ab6e2fe3876a..897202c75cb87 42420--- a/src/third_party/blink/renderer/core/frame/local_frame.cc 42421+++ b/src/third_party/blink/renderer/core/frame/local_frame.cc 42422@@ -1570,60 +1570,40 @@ static bool CanAccessAncestor(const SecurityOrigin& active_security_origin, 42423 return false; 42424 } 42425 42426-// `initiating_frame` - The frame that CanNavigate was initially requested for. 42427-// `source_frame` - The frame that is currently being tested to see if it can 42428-// navigate `target_frame`. 42429-// `target_frame` - The frame to be navigated. 42430-// `destination_url` - The URL to navigate to on `target_frame`. 42431-static bool CanNavigateHelper(LocalFrame& initiating_frame, 42432- const Frame& source_frame, 42433- const Frame& target_frame, 42434- const KURL& destination_url) { 42435- // The only time the helper is called with a different `initiating_frame` from 42436- // its `source_frame` is to recursively check if ancestors can navigate the 42437- // top frame. 42438- DCHECK(&initiating_frame == &source_frame || 42439- target_frame == initiating_frame.Tree().Top()); 42440- 42441- // Only report navigation blocking on the initial call to CanNavigateHelper, 42442- // not the recursive calls. 42443- bool should_report = &initiating_frame == &source_frame; 42444- 42445- if (&target_frame == &source_frame) 42446+bool LocalFrame::CanNavigate(const Frame& target_frame, 42447+ const KURL& destination_url) { 42448+ // https://html.spec.whatwg.org/multipage/browsers.html#allowed-to-navigate 42449+ // If source is target, then return true. 42450+ if (&target_frame == this) 42451 return true; 42452 42453 // Navigating window.opener cross origin, without user activation. See 42454 // https://crbug.com/813643. 42455- if (should_report && source_frame.Opener() == target_frame && 42456- !source_frame.HasTransientUserActivation() && 42457+ if (Opener() == target_frame && !HasTransientUserActivation(this) && 42458 !target_frame.GetSecurityContext()->GetSecurityOrigin()->CanAccess( 42459 SecurityOrigin::Create(destination_url).get())) { 42460- UseCounter::Count(initiating_frame.GetDocument(), 42461+ UseCounter::Count(GetDocument(), 42462 WebFeature::kOpenerNavigationWithoutGesture); 42463 } 42464 42465 if (destination_url.ProtocolIsJavaScript() && 42466- !source_frame.GetSecurityContext()->GetSecurityOrigin()->CanAccess( 42467+ !GetSecurityContext()->GetSecurityOrigin()->CanAccess( 42468 target_frame.GetSecurityContext()->GetSecurityOrigin())) { 42469- if (should_report) { 42470- initiating_frame.PrintNavigationErrorMessage( 42471- target_frame, 42472- "The frame attempting navigation must be same-origin with the target " 42473- "if navigating to a javascript: url"); 42474- } 42475+ PrintNavigationErrorMessage( 42476+ target_frame, 42477+ "The frame attempting navigation must be same-origin with the target " 42478+ "if navigating to a javascript: url"); 42479 return false; 42480 } 42481 42482- if (source_frame.GetSecurityContext()->IsSandboxed( 42483+ if (GetSecurityContext()->IsSandboxed( 42484 network::mojom::blink::WebSandboxFlags::kNavigation)) { 42485- if (!target_frame.Tree().IsDescendantOf(&source_frame) && 42486+ if (!target_frame.Tree().IsDescendantOf(this) && 42487 !target_frame.IsMainFrame()) { 42488- if (should_report) { 42489- initiating_frame.PrintNavigationErrorMessage( 42490- target_frame, 42491- "The frame attempting navigation is sandboxed, and is therefore " 42492- "disallowed from navigating its ancestors."); 42493- } 42494+ PrintNavigationErrorMessage( 42495+ target_frame, 42496+ "The frame attempting navigation is sandboxed, and is therefore " 42497+ "disallowed from navigating its ancestors."); 42498 return false; 42499 } 42500 42501@@ -1631,91 +1611,80 @@ static bool CanNavigateHelper(LocalFrame& initiating_frame, 42502 // 'allow-sandbox-escape-via-popup' flag is specified, or if 42503 // 'allow-popups' flag is specified, or if the 42504 if (target_frame.IsMainFrame() && 42505- target_frame != source_frame.Tree().Top() && 42506- source_frame.GetSecurityContext()->IsSandboxed( 42507+ target_frame != Tree().Top() && 42508+ GetSecurityContext()->IsSandboxed( 42509 network::mojom::blink::WebSandboxFlags:: 42510 kPropagatesToAuxiliaryBrowsingContexts) && 42511- (source_frame.GetSecurityContext()->IsSandboxed( 42512+ (GetSecurityContext()->IsSandboxed( 42513 network::mojom::blink::WebSandboxFlags::kPopups) || 42514- target_frame.Opener() != &source_frame)) { 42515- if (should_report) { 42516- initiating_frame.PrintNavigationErrorMessage( 42517- target_frame, 42518- "The frame attempting navigation is sandboxed and is trying " 42519- "to navigate a popup, but is not the popup's opener and is not " 42520- "set to propagate sandboxing to popups."); 42521- } 42522+ target_frame.Opener() != this)) { 42523+ PrintNavigationErrorMessage( 42524+ target_frame, 42525+ "The frame attempting navigation is sandboxed and is trying " 42526+ "to navigate a popup, but is not the popup's opener and is not " 42527+ "set to propagate sandboxing to popups."); 42528 return false; 42529 } 42530 42531 // Top navigation is forbidden in sandboxed frames unless opted-in, and only 42532 // then if the ancestor chain allowed to navigate the top frame. 42533- if (target_frame == source_frame.Tree().Top()) { 42534- if (source_frame.GetSecurityContext()->IsSandboxed( 42535+ if (target_frame == Tree().Top()) { 42536+ if (GetSecurityContext()->IsSandboxed( 42537 network::mojom::blink::WebSandboxFlags::kTopNavigation) && 42538- source_frame.GetSecurityContext()->IsSandboxed( 42539+ GetSecurityContext()->IsSandboxed( 42540 network::mojom::blink::WebSandboxFlags:: 42541 kTopNavigationByUserActivation)) { 42542- if (should_report) { 42543- initiating_frame.PrintNavigationErrorMessage( 42544- target_frame, 42545- "The frame attempting navigation of the top-level window is " 42546- "sandboxed, but the flag of 'allow-top-navigation' or " 42547- "'allow-top-navigation-by-user-activation' is not set."); 42548- } 42549+ PrintNavigationErrorMessage( 42550+ target_frame, 42551+ "The frame attempting navigation of the top-level window is " 42552+ "sandboxed, but the flag of 'allow-top-navigation' or " 42553+ "'allow-top-navigation-by-user-activation' is not set."); 42554 return false; 42555 } 42556 42557- if (source_frame.GetSecurityContext()->IsSandboxed( 42558+ if (GetSecurityContext()->IsSandboxed( 42559 network::mojom::blink::WebSandboxFlags::kTopNavigation) && 42560- !source_frame.GetSecurityContext()->IsSandboxed( 42561+ !GetSecurityContext()->IsSandboxed( 42562 network::mojom::blink::WebSandboxFlags:: 42563 kTopNavigationByUserActivation) && 42564- !source_frame.HasTransientUserActivation()) { 42565- if (should_report) { 42566- // With only 'allow-top-navigation-by-user-activation' (but not 42567- // 'allow-top-navigation'), top navigation requires a user gesture. 42568- initiating_frame.GetLocalFrameHostRemote().DidBlockNavigation( 42569- destination_url, initiating_frame.GetDocument()->Url(), 42570+ !HasTransientUserActivation(this)) { 42571+ GetLocalFrameHostRemote().DidBlockNavigation( 42572+ destination_url, GetDocument()->Url(), 42573 mojom::NavigationBlockedReason:: 42574 kRedirectWithNoUserGestureSandbox); 42575- initiating_frame.PrintNavigationErrorMessage( 42576+ PrintNavigationErrorMessage( 42577 target_frame, 42578 "The frame attempting navigation of the top-level window is " 42579 "sandboxed with the 'allow-top-navigation-by-user-activation' " 42580 "flag, but has no user activation (aka gesture). See " 42581 "https://www.chromestatus.com/feature/5629582019395584."); 42582- } 42583 return false; 42584 } 42585 42586- // If the nearest non-sandboxed ancestor frame is not allowed to navigate, 42587- // then this sandboxed frame can't either. This prevents a cross-origin 42588- // frame from embedding a sandboxed iframe with kTopNavigate from 42589- // navigating the top frame. See (crbug.com/1145553) 42590- if (Frame* parent_frame = source_frame.Tree().Parent()) { 42591- bool parent_can_navigate = CanNavigateHelper( 42592- initiating_frame, *parent_frame, target_frame, destination_url); 42593- if (!parent_can_navigate) { 42594- if (should_report) { 42595- String message = 42596- "The frame attempting navigation of the top-level window is " 42597- "sandboxed and is not allowed to navigate since its ancestor " 42598- "frame " + 42599- FrameDescription(*parent_frame) + 42600- " is unable to navigate the top frame.\n"; 42601- initiating_frame.PrintNavigationErrorMessage(target_frame, message); 42602- } 42603- return false; 42604- } 42605+ // This is a "last line of defense" to prevent a cross-origin document 42606+ // from escalating its own top-navigation privileges. See 42607+ // `PolicyContainerPolicies::can_navigate_top_without_user_gesture` 42608+ // for the cases where this would be allowed or disallowed. 42609+ // See (crbug.com/1145553) and (crbug.com/1251790). 42610+ if (!DomWindow() 42611+ ->GetExecutionContext() 42612+ ->GetPolicyContainer() 42613+ ->GetPolicies() 42614+ .can_navigate_top_without_user_gesture && 42615+ !HasStickyUserActivation()) { 42616+ String message = 42617+ "The frame attempting to navigate the top-level window is " 42618+ "cross-origin and either it or one of its ancestors is not " 42619+ "allowed to navigate the top frame.\n"; 42620+ PrintNavigationErrorMessage(target_frame, message); 42621+ return false; 42622 } 42623 return true; 42624 } 42625 } 42626 42627- DCHECK(source_frame.GetSecurityContext()->GetSecurityOrigin()); 42628- const SecurityOrigin& origin = 42629- *source_frame.GetSecurityContext()->GetSecurityOrigin(); 42630+ DCHECK(GetSecurityContext()->GetSecurityOrigin()); 42631+ const SecurityOrigin& origin = *GetSecurityContext()->GetSecurityOrigin(); 42632 42633 // This is the normal case. A document can navigate its decendant frames, 42634 // or, more generally, a document can navigate a frame if the document is 42635@@ -1739,17 +1708,17 @@ static bool CanNavigateHelper(LocalFrame& initiating_frame, 42636 // and/or "parent" relation). Requiring some sort of relation prevents a 42637 // document from navigating arbitrary, unrelated top-level frames. 42638 if (!target_frame.Tree().Parent()) { 42639- if (target_frame == source_frame.Opener()) 42640+ if (target_frame == Opener()) 42641 return true; 42642 if (CanAccessAncestor(origin, target_frame.Opener())) 42643 return true; 42644 } 42645 42646- if (target_frame == source_frame.Tree().Top()) { 42647+ if (target_frame == Tree().Top()) { 42648 // A frame navigating its top may blocked if the document initiating 42649 // the navigation has never received a user gesture and the navigation 42650 // isn't same-origin with the target. 42651- if (source_frame.HasStickyUserActivation() || 42652+ if (HasStickyUserActivation() || 42653 target_frame.GetSecurityContext()->GetSecurityOrigin()->CanAccess( 42654 SecurityOrigin::Create(destination_url).get())) { 42655 return true; 42656@@ -1769,44 +1738,29 @@ static bool CanNavigateHelper(LocalFrame& initiating_frame, 42657 return true; 42658 } 42659 42660- // We skip this check for recursive calls on remote frames, in which case 42661- // we're less permissive. 42662- if (const LocalFrame* local_frame = DynamicTo<LocalFrame>(&source_frame)) { 42663- if (auto* settings_client = 42664- local_frame->Client()->GetContentSettingsClient()) { 42665- if (settings_client->AllowPopupsAndRedirects(false /* default_value*/)) 42666- return true; 42667- } 42668- } 42669- 42670- if (should_report) { 42671- initiating_frame.PrintNavigationErrorMessage( 42672- target_frame, 42673- "The frame attempting navigation is targeting its top-level window, " 42674- "but is neither same-origin with its target nor has it received a " 42675- "user gesture. See " 42676- "https://www.chromestatus.com/feature/5851021045661696."); 42677- initiating_frame.GetLocalFrameHostRemote().DidBlockNavigation( 42678- destination_url, initiating_frame.GetDocument()->Url(), 42679- mojom::NavigationBlockedReason::kRedirectWithNoUserGesture); 42680+ if (auto* settings_client = Client()->GetContentSettingsClient()) { 42681+ if (settings_client->AllowPopupsAndRedirects(false /* default_value*/)) 42682+ return true; 42683 } 42684+ PrintNavigationErrorMessage( 42685+ target_frame, 42686+ "The frame attempting navigation is targeting its top-level window, " 42687+ "but is neither same-origin with its target nor has it received a " 42688+ "user gesture. See " 42689+ "https://www.chromestatus.com/feature/5851021045661696."); 42690+ GetLocalFrameHostRemote().DidBlockNavigation( 42691+ destination_url, GetDocument()->Url(), 42692+ mojom::blink::NavigationBlockedReason::kRedirectWithNoUserGesture); 42693 42694 } else { 42695- if (should_report) { 42696- initiating_frame.PrintNavigationErrorMessage( 42697- target_frame, 42698- "The frame attempting navigation is neither same-origin with the " 42699- "target, nor is it the target's parent or opener."); 42700- } 42701+ PrintNavigationErrorMessage( 42702+ target_frame, 42703+ "The frame attempting navigation is neither same-origin with the " 42704+ "target, nor is it the target's parent or opener."); 42705 } 42706 return false; 42707 } 42708 42709-bool LocalFrame::CanNavigate(const Frame& target_frame, 42710- const KURL& destination_url) { 42711- return CanNavigateHelper(*this, *this, target_frame, destination_url); 42712-} 42713- 42714 ContentCaptureManager* LocalFrame::GetContentCaptureManager() { 42715 DCHECK(Client()); 42716 if (!IsLocalRoot()) 42717diff --git a/src/third_party/blink/renderer/core/frame/local_frame_view.cc b/src/third_party/blink/renderer/core/frame/local_frame_view.cc 42718index 082268919cb16..ec423d63e46c7 42719--- a/src/third_party/blink/renderer/core/frame/local_frame_view.cc 42720+++ b/src/third_party/blink/renderer/core/frame/local_frame_view.cc 42721@@ -837,6 +837,7 @@ void LocalFrameView::PerformLayout() { 42722 } 42723 for (auto& root : layout_subtree_root_list_.Ordered()) { 42724 bool should_rebuild_fragments = false; 42725+ LayoutObject& root_layout_object = *root; 42726 LayoutBlock* cb = root->ContainingNGBlock(); 42727 if (cb) { 42728 auto it = fragment_tree_spines.find(cb); 42729@@ -856,7 +857,7 @@ void LocalFrameView::PerformLayout() { 42730 // We need to ensure that we mark up all layoutObjects up to the 42731 // LayoutView for paint invalidation. This simplifies our code as we 42732 // just always do a full tree walk. 42733- if (LayoutObject* container = root->Container()) 42734+ if (LayoutObject* container = root_layout_object.Container()) 42735 container->SetShouldCheckForPaintInvalidation(); 42736 } 42737 layout_subtree_root_list_.Clear(); 42738diff --git a/src/third_party/blink/renderer/core/frame/policy_container.cc b/src/third_party/blink/renderer/core/frame/policy_container.cc 42739index e70464d5ef04f..9dd007a677608 42740--- a/src/third_party/blink/renderer/core/frame/policy_container.cc 42741+++ b/src/third_party/blink/renderer/core/frame/policy_container.cc 42742@@ -37,7 +37,8 @@ std::unique_ptr<PolicyContainer> PolicyContainer::CreateFromWebPolicyContainer( 42743 container->policies.referrer_policy, 42744 container->policies.ip_address_space, 42745 ConvertToMojoBlink( 42746- std::move(container->policies.content_security_policies))); 42747+ std::move(container->policies.content_security_policies)), 42748+ container->policies.can_navigate_top_without_user_gesture); 42749 return std::make_unique<PolicyContainer>(std::move(container->remote), 42750 std::move(policies)); 42751 } 42752diff --git a/src/third_party/blink/renderer/core/frame/policy_container_test.cc b/src/third_party/blink/renderer/core/frame/policy_container_test.cc 42753index b093dbc5a6bd8..a62965150efe1 42754--- a/src/third_party/blink/renderer/core/frame/policy_container_test.cc 42755+++ b/src/third_party/blink/renderer/core/frame/policy_container_test.cc 42756@@ -16,7 +16,8 @@ TEST(PolicyContainerTest, MembersAreSetDuringConstruction) { 42757 auto policies = mojom::blink::PolicyContainerPolicies::New( 42758 network::mojom::blink::ReferrerPolicy::kNever, 42759 network::mojom::blink::IPAddressSpace::kPrivate, 42760- Vector<network::mojom::blink::ContentSecurityPolicyPtr>()); 42761+ Vector<network::mojom::blink::ContentSecurityPolicyPtr>(), 42762+ /*can_navigate_top_without_user_gesture=*/true); 42763 PolicyContainer policy_container(host.BindNewEndpointAndPassDedicatedRemote(), 42764 std::move(policies)); 42765 42766@@ -31,7 +32,8 @@ TEST(PolicyContainerTest, UpdateReferrerPolicyIsPropagated) { 42767 auto policies = mojom::blink::PolicyContainerPolicies::New( 42768 network::mojom::blink::ReferrerPolicy::kAlways, 42769 network::mojom::blink::IPAddressSpace::kPublic, 42770- Vector<network::mojom::blink::ContentSecurityPolicyPtr>()); 42771+ Vector<network::mojom::blink::ContentSecurityPolicyPtr>(), 42772+ /*can_navigate_top_without_user_gesture=*/true); 42773 PolicyContainer policy_container(host.BindNewEndpointAndPassDedicatedRemote(), 42774 std::move(policies)); 42775 42776diff --git a/src/third_party/blink/renderer/core/frame/settings.h b/src/third_party/blink/renderer/core/frame/settings.h 42777index a4d0d886b379f..f2739a6a9e749 42778--- a/src/third_party/blink/renderer/core/frame/settings.h 42779+++ b/src/third_party/blink/renderer/core/frame/settings.h 42780@@ -67,6 +67,21 @@ class CORE_EXPORT Settings { 42781 42782 SETTINGS_GETTERS_AND_SETTERS 42783 42784+#if BUILDFLAG(IS_OHOS) 42785+ void SetVerticalHideScrollbars(bool hide_vertical_scrollbars) { 42786+ hide_vertical_scrollbars_ = hide_vertical_scrollbars; 42787+ } 42788+ void SetHorizontalHideScrollbars(bool hide_horizontal_scrollbars) { 42789+ hide_horizontal_scrollbars_ = hide_horizontal_scrollbars; 42790+ } 42791+ bool GetVerticalHideScrollbars() { 42792+ return hide_vertical_scrollbars_; 42793+ } 42794+ bool GetHorizontalHideScrollbars() { 42795+ return hide_horizontal_scrollbars_; 42796+ } 42797+#endif 42798+ 42799 void SetDelegate(SettingsDelegate*); 42800 42801 private: 42802@@ -77,6 +92,11 @@ class CORE_EXPORT Settings { 42803 GenericFontFamilySettings generic_font_family_settings_; 42804 42805 SETTINGS_MEMBER_VARIABLES 42806+ 42807+#if BUILDFLAG(IS_OHOS) 42808+ bool hide_vertical_scrollbars_ = true; 42809+ bool hide_horizontal_scrollbars_ = true; 42810+#endif 42811 }; 42812 42813 } // namespace blink 42814diff --git a/src/third_party/blink/renderer/core/frame/visual_viewport.cc b/src/third_party/blink/renderer/core/frame/visual_viewport.cc 42815index 4d63c50a1374d..196fbfb63c97e 42816--- a/src/third_party/blink/renderer/core/frame/visual_viewport.cc 42817+++ b/src/third_party/blink/renderer/core/frame/visual_viewport.cc 42818@@ -644,11 +644,25 @@ void VisualViewport::InitializeScrollbars() { 42819 42820 scrollbar_layer_horizontal_ = nullptr; 42821 scrollbar_layer_vertical_ = nullptr; 42822+#if BUILDFLAG(IS_OHOS) 42823 if (VisualViewportSuppliesScrollbars() && 42824 !GetPage().GetSettings().GetHideScrollbars()) { 42825+ if (!GetPage().GetSettings().GetVerticalHideScrollbars()) { 42826+ UpdateScrollbarLayer(kVerticalScrollbar); 42827+ } 42828+ if (!GetPage().GetSettings().GetHorizontalHideScrollbars()) { 42829+ UpdateScrollbarLayer(kHorizontalScrollbar); 42830+ } 42831+ } 42832+#else 42833+ if (VisualViewportSuppliesScrollbars() && 42834+ !GetPage().GetSettings().GetHideScrollbars()) { 42835+#ifndef OS_OHOS 42836 UpdateScrollbarLayer(kHorizontalScrollbar); 42837+#endif 42838 UpdateScrollbarLayer(kVerticalScrollbar); 42839 } 42840+#endif 42841 42842 // Ensure existing LocalFrameView scrollbars are removed if the visual 42843 // viewport scrollbars are now supplied, or created if the visual viewport no 42844@@ -1134,7 +1148,32 @@ void VisualViewport::Paint(GraphicsContext& context) const { 42845 DisplayItem::kForeignLayerViewportScroll, scroll_layer_, 42846 gfx::Point(), &state); 42847 } 42848+#if BUILDFLAG(IS_OHOS) 42849+ if (scrollbar_layer_horizontal_ && !GetPage().GetSettings().GetHorizontalHideScrollbars()) { 42850+ auto state = parent_property_tree_state_; 42851+ state.SetEffect(*horizontal_scrollbar_effect_node_); 42852+ DEFINE_STATIC_LOCAL(Persistent<LiteralDebugNameClient>, debug_name_client, 42853+ (MakeGarbageCollected<LiteralDebugNameClient>( 42854+ "Inner Viewport Horizontal Scrollbar"))); 42855+ RecordForeignLayer(context, *debug_name_client, 42856+ DisplayItem::kForeignLayerViewportScrollbar, 42857+ scrollbar_layer_horizontal_, 42858+ gfx::Point(0, size_.height() - ScrollbarThickness()), 42859+ &state); 42860+ } 42861 42862+ if (scrollbar_layer_vertical_ && !GetPage().GetSettings().GetVerticalHideScrollbars()) { 42863+ auto state = parent_property_tree_state_; 42864+ state.SetEffect(*vertical_scrollbar_effect_node_); 42865+ DEFINE_STATIC_LOCAL(Persistent<LiteralDebugNameClient>, debug_name_client, 42866+ (MakeGarbageCollected<LiteralDebugNameClient>( 42867+ "Inner Viewport Vertical Scrollbar"))); 42868+ RecordForeignLayer( 42869+ context, *debug_name_client, 42870+ DisplayItem::kForeignLayerViewportScrollbar, scrollbar_layer_vertical_, 42871+ gfx::Point(size_.width() - ScrollbarThickness(), 0), &state); 42872+ } 42873+#else 42874 if (scrollbar_layer_horizontal_) { 42875 auto state = parent_property_tree_state_; 42876 state.SetEffect(*horizontal_scrollbar_effect_node_); 42877@@ -1159,6 +1198,7 @@ void VisualViewport::Paint(GraphicsContext& context) const { 42878 DisplayItem::kForeignLayerViewportScrollbar, scrollbar_layer_vertical_, 42879 gfx::Point(size_.width() - ScrollbarThickness(), 0), &state); 42880 } 42881+#endif 42882 } 42883 42884 } // namespace blink 42885diff --git a/src/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/src/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc 42886index 6a30ed402c272..a3f26374f7cd2 42887--- a/src/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc 42888+++ b/src/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc 42889@@ -2434,10 +2434,15 @@ WebInputEventResult WebFrameWidgetImpl::HandleInputEvent( 42890 DCHECK(!WebInputEvent::IsTouchEventType(input_event.GetType())); 42891 CHECK(LocalRootImpl()); 42892 42893+ // Clients shouldn't be dispatching events to a provisional frame but this 42894+ // can happen. Ensure that event handling can assume we're in a committed 42895+ // frame. 42896+ if (IsProvisional()) 42897+ return WebInputEventResult::kHandledSuppressed; 42898+ 42899 // Only record metrics for the main frame. 42900- if (ForMainFrame()) { 42901+ if (ForMainFrame()) 42902 GetPage()->GetVisualViewport().StartTrackingPinchStats(); 42903- } 42904 42905 // If a drag-and-drop operation is in progress, ignore input events except 42906 // PointerCancel. 42907diff --git a/src/third_party/blink/renderer/core/html/custom/custom_element_registry.cc b/src/third_party/blink/renderer/core/html/custom/custom_element_registry.cc 42908index 5a63b6f0fd74d..cbfdcfef806a9 42909--- a/src/third_party/blink/renderer/core/html/custom/custom_element_registry.cc 42910+++ b/src/third_party/blink/renderer/core/html/custom/custom_element_registry.cc 42911@@ -217,8 +217,11 @@ CustomElementDefinition* CustomElementRegistry::DefineInternal( 42912 // 16: when-defined promise processing 42913 const auto& entry = when_defined_promise_map_.find(name); 42914 if (entry != when_defined_promise_map_.end()) { 42915- entry->value->Resolve(); 42916+ ScriptPromiseResolver* resolver = entry->value; 42917 when_defined_promise_map_.erase(entry); 42918+ // Resolve() may run synchronous JavaScript that invalidates iterators of 42919+ // |when_defined_promise_map_|, so it must be called after erasing |entry|. 42920+ resolver->Resolve(definition->GetConstructorForScript()); 42921 } 42922 42923 return definition; 42924@@ -299,8 +302,10 @@ ScriptPromise CustomElementRegistry::whenDefined( 42925 if (ThrowIfInvalidName(name, false, exception_state)) 42926 return ScriptPromise(); 42927 CustomElementDefinition* definition = DefinitionForName(name); 42928- if (definition) 42929- return ScriptPromise::CastUndefined(script_state); 42930+ if (definition) { 42931+ return ScriptPromise::Cast(script_state, 42932+ definition->GetConstructorForScript()); 42933+ } 42934 const auto it = when_defined_promise_map_.find(name); 42935 if (it != when_defined_promise_map_.end()) 42936 return it->value->Promise(); 42937diff --git a/src/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.cc b/src/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.cc 42938index 63a7a291c771b..d0e1377c7ec9b 42939--- a/src/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.cc 42940+++ b/src/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.cc 42941@@ -448,13 +448,10 @@ void MultipleFieldsTemporalInputTypeView::HandleFocusInEvent( 42942 if (GetElement().GetDocument().GetPage()) 42943 GetElement().GetDocument().GetPage()->GetFocusController().AdvanceFocus( 42944 type); 42945- } else if (type == mojom::blink::FocusType::kNone || 42946- type == mojom::blink::FocusType::kMouse || 42947- type == mojom::blink::FocusType::kPage || 42948- type == mojom::blink::FocusType::kAccessKey) { 42949- edit->FocusByOwner(old_focused_element); 42950- } else { 42951+ } else if (type == mojom::blink::FocusType::kForward) { 42952 edit->FocusByOwner(); 42953+ } else { 42954+ edit->FocusByOwner(old_focused_element); 42955 } 42956 } 42957 42958diff --git a/src/third_party/blink/renderer/core/html/html_or_foreign_element.idl b/src/third_party/blink/renderer/core/html/html_or_foreign_element.idl 42959index e15efe2f853d1..2036817c21cac 42960--- a/src/third_party/blink/renderer/core/html/html_or_foreign_element.idl 42961+++ b/src/third_party/blink/renderer/core/html/html_or_foreign_element.idl 42962@@ -11,6 +11,6 @@ interface mixin HTMLOrForeignElement { 42963 42964 [CEReactions, Reflect] attribute boolean autofocus; 42965 [CEReactions] attribute long tabIndex; 42966- void focus(optional FocusOptions options = {}); 42967+ [ImplementedAs=focusForBindings] void focus(optional FocusOptions options = {}); 42968 void blur(); 42969 }; 42970diff --git a/src/third_party/blink/renderer/core/inspector/inspector_media_context_impl.cc b/src/third_party/blink/renderer/core/inspector/inspector_media_context_impl.cc 42971index c0965693783d5..6e89262ca229b 42972--- a/src/third_party/blink/renderer/core/inspector/inspector_media_context_impl.cc 42973+++ b/src/third_party/blink/renderer/core/inspector/inspector_media_context_impl.cc 42974@@ -109,9 +109,13 @@ void MediaInspectorContextImpl::TrimPlayer(const WebString& playerId) { 42975 42976 void MediaInspectorContextImpl::CullPlayers(const WebString& prefer_keep) { 42977 // Erase all the dead players, but only erase the required number of others. 42978- for (const auto& playerId : dead_players_) 42979+ while (!dead_players_.IsEmpty()) { 42980+ auto playerId = dead_players_.back(); 42981+ // remove it first, since |RemovePlayer| can cause a GC event which can 42982+ // potentially caues more players to get added to |dead_players_|. 42983+ dead_players_.pop_back(); 42984 RemovePlayer(playerId); 42985- dead_players_.clear(); 42986+ } 42987 42988 while (!expendable_players_.IsEmpty()) { 42989 if (total_event_count_ <= kMaxCachedPlayerEvents) 42990diff --git a/src/third_party/blink/renderer/core/loader/frame_loader_test.cc b/src/third_party/blink/renderer/core/loader/frame_loader_test.cc 42991index a0dce40840771..acd12bea8de97 42992--- a/src/third_party/blink/renderer/core/loader/frame_loader_test.cc 42993+++ b/src/third_party/blink/renderer/core/loader/frame_loader_test.cc 42994@@ -147,7 +147,8 @@ TEST_F(FrameLoaderTest, PolicyContainerIsStoredOnCommitNavigation) { 42995 EXPECT_EQ(*mojom::blink::PolicyContainerPolicies::New( 42996 network::mojom::ReferrerPolicy::kAlways, 42997 network::mojom::IPAddressSpace::kPublic, 42998- Vector<network::mojom::blink::ContentSecurityPolicyPtr>()), 42999+ Vector<network::mojom::blink::ContentSecurityPolicyPtr>(), 43000+ /*can_navigate_top_without_user_gesture=*/true), 43001 local_frame->DomWindow()->GetPolicyContainer()->GetPolicies()); 43002 } 43003 43004diff --git a/src/third_party/blink/renderer/core/loader/web_associated_url_loader_impl.cc b/src/third_party/blink/renderer/core/loader/web_associated_url_loader_impl.cc 43005index 4de2d8c49cb6e..21f11a9a76f2b 43006--- a/src/third_party/blink/renderer/core/loader/web_associated_url_loader_impl.cc 43007+++ b/src/third_party/blink/renderer/core/loader/web_associated_url_loader_impl.cc 43008@@ -88,7 +88,7 @@ class HTTPRequestHeaderValidator : public WebHTTPHeaderVisitor { 43009 void HTTPRequestHeaderValidator::VisitHeader(const WebString& name, 43010 const WebString& value) { 43011 is_safe_ = is_safe_ && IsValidHTTPToken(name) && 43012- !cors::IsForbiddenHeaderName(name) && 43013+ !cors::IsForbiddenRequestHeader(name, value) && 43014 IsValidHTTPHeaderValue(value); 43015 } 43016 43017@@ -377,7 +377,7 @@ void WebAssociatedURLLoaderImpl::LoadAsynchronously( 43018 // consult it separately, if set. 43019 if (request.ReferrerString() != 43020 blink::WebString(Referrer::ClientReferrerString())) { 43021- DCHECK(cors::IsForbiddenHeaderName("Referer")); 43022+ DCHECK(cors::IsForbiddenRequestHeader("Referer", "")); 43023 // `Referer` is a forbidden header name, so we must disallow this to 43024 // load. 43025 allow_load = false; 43026diff --git a/src/third_party/blink/renderer/core/page/focus_controller.cc b/src/third_party/blink/renderer/core/page/focus_controller.cc 43027index 9d76b0642bc8c..95e5f3d4d3741 43028--- a/src/third_party/blink/renderer/core/page/focus_controller.cc 43029+++ b/src/third_party/blink/renderer/core/page/focus_controller.cc 43030@@ -1305,6 +1305,7 @@ bool FocusController::SetFocusedElement(Element* element, 43031 SetFocusedFrame(nullptr); 43032 return false; 43033 } 43034+ 43035 SetFocusedFrame(new_focused_frame); 43036 43037 if (new_document) { 43038diff --git a/src/third_party/blink/renderer/core/page/page.cc b/src/third_party/blink/renderer/core/page/page.cc 43039index 321818f9dbf4d..5dfffea91de43 43040--- a/src/third_party/blink/renderer/core/page/page.cc 43041+++ b/src/third_party/blink/renderer/core/page/page.cc 43042@@ -104,6 +104,7 @@ const int kMaxNumberOfFrames = 1000; 43043 const int kTenFrames = 10; 43044 43045 bool g_limit_max_frames_to_ten_for_testing = false; 43046+ 43047 } // namespace 43048 43049 // Function defined in third_party/blink/public/web/blink.h. 43050@@ -189,6 +190,11 @@ Page::Page(base::PassKey<Page>, 43051 bool is_ordinary) 43052 : SettingsDelegate(std::make_unique<Settings>()), 43053 main_frame_(nullptr), 43054+ fenced_frames_impl_( 43055+ features::IsFencedFramesEnabled() 43056+ ? absl::optional<features::FencedFramesImplementationType>( 43057+ features::kFencedFramesImplementationTypeParam.Get()) 43058+ : absl::nullopt), 43059 agent_group_scheduler_(agent_group_scheduler), 43060 animator_(MakeGarbageCollected<PageAnimator>(*this)), 43061 autoscroll_controller_(MakeGarbageCollected<AutoscrollController>(*this)), 43062@@ -628,10 +634,10 @@ void CheckFrameCountConsistency(int expected_frame_count, Frame* frame) { 43063 // a fenced frame and creates a new ``DocumentFencedFrames`` object). 43064 if (features::IsFencedFramesMPArchBased()) { 43065 if (auto* local_frame = DynamicTo<LocalFrame>(frame)) { 43066- actual_frame_count += static_cast<int>( 43067- DocumentFencedFrames::From(*local_frame->GetDocument()) 43068- .GetFencedFrames() 43069- .size()); 43070+ actual_frame_count += static_cast<int>( 43071+ DocumentFencedFrames::From(*local_frame->GetDocument()) 43072+ .GetFencedFrames() 43073+ .size()); 43074 } 43075 } 43076 } 43077diff --git a/src/third_party/blink/renderer/core/page/page.h b/src/third_party/blink/renderer/core/page/page.h 43078index f3231c1cbda4a..a83a1aa7fb1bf 43079--- a/src/third_party/blink/renderer/core/page/page.h 43080+++ b/src/third_party/blink/renderer/core/page/page.h 43081@@ -27,6 +27,8 @@ 43082 43083 #include "base/dcheck_is_on.h" 43084 #include "base/types/pass_key.h" 43085+#include "third_party/abseil-cpp/absl/types/optional.h" 43086+#include "third_party/blink/public/common/features.h" 43087 #include "third_party/blink/public/mojom/devtools/inspector_issue.mojom-blink-forward.h" 43088 #include "third_party/blink/public/mojom/frame/text_autosizer_page_info.mojom-blink.h" 43089 #include "third_party/blink/public/mojom/page/page.mojom-blink.h" 43090@@ -208,6 +210,11 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>, 43091 return window_features_; 43092 } 43093 43094+ const absl::optional<features::FencedFramesImplementationType>& 43095+ FencedFramesImplementationType() const { 43096+ return fenced_frames_impl_; 43097+ } 43098+ 43099 PageScaleConstraintsSet& GetPageScaleConstraintsSet(); 43100 const PageScaleConstraintsSet& GetPageScaleConstraintsSet() const; 43101 43102@@ -418,6 +425,9 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>, 43103 // longer needed. 43104 Member<Frame> main_frame_; 43105 43106+ // The type of fenced frames being used. 43107+ absl::optional<features::FencedFramesImplementationType> fenced_frames_impl_; 43108+ 43109 scheduler::WebAgentGroupScheduler& agent_group_scheduler_; 43110 Member<PageAnimator> animator_; 43111 const Member<AutoscrollController> autoscroll_controller_; 43112diff --git a/src/third_party/blink/renderer/core/page/scrolling/element_fragment_anchor.cc b/src/third_party/blink/renderer/core/page/scrolling/element_fragment_anchor.cc 43113index 25a286558b65c..de3628676a5e5 43114--- a/src/third_party/blink/renderer/core/page/scrolling/element_fragment_anchor.cc 43115+++ b/src/third_party/blink/renderer/core/page/scrolling/element_fragment_anchor.cc 43116@@ -9,6 +9,7 @@ 43117 #include "third_party/blink/renderer/core/display_lock/display_lock_context.h" 43118 #include "third_party/blink/renderer/core/dom/document.h" 43119 #include "third_party/blink/renderer/core/dom/element.h" 43120+#include "third_party/blink/renderer/core/dom/focus_params.h" 43121 #include "third_party/blink/renderer/core/dom/events/event.h" 43122 #include "third_party/blink/renderer/core/dom/node.h" 43123 #include "third_party/blink/renderer/core/editing/frame_selection.h" 43124@@ -199,7 +200,7 @@ void ElementFragmentAnchor::ApplyFocusIfNeeded() { 43125 // clear focus, which matches the behavior of other browsers. 43126 auto* element = DynamicTo<Element>(anchor_node_.Get()); 43127 if (element && element->IsFocusable()) { 43128- element->focus(); 43129+ element->focus(FocusParams(/*gate_on_user_activation=*/true)); 43130 } else { 43131 frame_->GetDocument()->SetSequentialFocusNavigationStartingPoint( 43132 anchor_node_); 43133diff --git a/src/third_party/blink/renderer/core/page/validation_message_overlay_delegate.cc b/src/third_party/blink/renderer/core/page/validation_message_overlay_delegate.cc 43134index b026292ddefd5..1ee39994b0069 43135--- a/src/third_party/blink/renderer/core/page/validation_message_overlay_delegate.cc 43136+++ b/src/third_party/blink/renderer/core/page/validation_message_overlay_delegate.cc 43137@@ -84,6 +84,8 @@ ValidationMessageOverlayDelegate::~ValidationMessageOverlayDelegate() { 43138 EventDispatchForbiddenScope::AllowUserAgentEvents allow_events; 43139 page_->WillBeDestroyed(); 43140 } 43141+ if (destroyed_ptr_) 43142+ *destroyed_ptr_ = true; 43143 } 43144 43145 LocalFrameView& ValidationMessageOverlayDelegate::FrameView() const { 43146@@ -164,7 +166,18 @@ void ValidationMessageOverlayDelegate::CreatePage(const FrameOverlay& overlay) { 43147 // Propagate deprecated DSF for platforms without use-zoom-for-dsf. 43148 page_->SetDeviceScaleFactorDeprecated( 43149 main_page_->DeviceScaleFactorDeprecated()); 43150+ 43151+ // ForceSynchronousDocumentInstall can cause another call to 43152+ // ValidationMessageClientImpl::ShowValidationMessage, which will hide this 43153+ // validation message and may even delete this. In order to avoid continuing 43154+ // when this is destroyed, |destroyed| will be set to true in the destructor. 43155+ bool destroyed = false; 43156+ DCHECK(!destroyed_ptr_); 43157+ destroyed_ptr_ = &destroyed; 43158 frame->ForceSynchronousDocumentInstall("text/html", data); 43159+ if (destroyed) 43160+ return; 43161+ destroyed_ptr_ = nullptr; 43162 43163 Element& main_message = GetElementById("main-message"); 43164 main_message.setTextContent(message_); 43165diff --git a/src/third_party/blink/renderer/core/page/validation_message_overlay_delegate.h b/src/third_party/blink/renderer/core/page/validation_message_overlay_delegate.h 43166index e9ed36969ccbc..06bdfd2f63742 43167--- a/src/third_party/blink/renderer/core/page/validation_message_overlay_delegate.h 43168+++ b/src/third_party/blink/renderer/core/page/validation_message_overlay_delegate.h 43169@@ -71,6 +71,10 @@ class CORE_EXPORT ValidationMessageOverlayDelegate 43170 String sub_message_; 43171 TextDirection message_dir_; 43172 TextDirection sub_message_dir_; 43173+ 43174+ // Used by CreatePage() to determine if this has been deleted in the middle of 43175+ // the function. 43176+ bool* destroyed_ptr_ = nullptr; 43177 }; 43178 43179 } // namespace blink 43180diff --git a/src/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc b/src/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc 43181index a9b0ec0580666..6c219b6b4395d 43182--- a/src/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc 43183+++ b/src/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc 43184@@ -1484,6 +1484,7 @@ bool PaintLayerScrollableArea::NeedsScrollbarReconstruction() const { 43185 return false; 43186 } 43187 43188+#if BUILDFLAG(IS_OHOS) 43189 void PaintLayerScrollableArea::ComputeScrollbarExistence( 43190 bool& needs_horizontal_scrollbar, 43191 bool& needs_vertical_scrollbar, 43192@@ -1499,7 +1500,108 @@ void PaintLayerScrollableArea::ComputeScrollbarExistence( 43193 needs_vertical_scrollbar = false; 43194 return; 43195 } 43196+ mojom::blink::ScrollbarMode h_mode = mojom::blink::ScrollbarMode::kAuto; 43197+ mojom::blink::ScrollbarMode v_mode = mojom::blink::ScrollbarMode::kAuto; 43198+ bool is_vertical_scrollbars_hide = GetLayoutBox()->GetFrame()->GetSettings()->GetVerticalHideScrollbars(); 43199+ bool is_horizontal_scrollbars_hide = GetLayoutBox()->GetFrame()->GetSettings()->GetHorizontalHideScrollbars(); 43200+ 43201+ // First, determine what behavior the scrollbars say they should have. 43202+ { 43203+ if (auto* layout_view = DynamicTo<LayoutView>(GetLayoutBox())) { 43204+ // LayoutView is special as there's various quirks and settings that 43205+ // style doesn't account for. 43206+ layout_view->CalculateScrollbarModes(h_mode, v_mode); 43207+ h_mode = is_vertical_scrollbars_hide ? mojom::blink::ScrollbarMode::kAlwaysOff : h_mode; 43208+ v_mode = is_horizontal_scrollbars_hide ? mojom::blink::ScrollbarMode::kAlwaysOff : v_mode; 43209+ } else { 43210+ auto overflow_x = GetLayoutBox()->StyleRef().OverflowX(); 43211+ if (overflow_x == EOverflow::kScroll) { 43212+ h_mode = is_horizontal_scrollbars_hide ? mojom::blink::ScrollbarMode::kAlwaysOff : mojom::blink::ScrollbarMode::kAlwaysOn; 43213+ } else if (overflow_x == EOverflow::kHidden || 43214+ overflow_x == EOverflow::kVisible) { 43215+ h_mode = mojom::blink::ScrollbarMode::kAlwaysOff; 43216+ } 43217+ 43218+ auto overflow_y = GetLayoutBox()->StyleRef().OverflowY(); 43219+ if (overflow_y == EOverflow::kScroll) { 43220+ v_mode = is_vertical_scrollbars_hide ? mojom::blink::ScrollbarMode::kAlwaysOff : mojom::blink::ScrollbarMode::kAlwaysOn; 43221+ } else if (overflow_y == EOverflow::kHidden || 43222+ overflow_y == EOverflow::kVisible) { 43223+ v_mode = mojom::blink::ScrollbarMode::kAlwaysOff; 43224+ } 43225+ } 43226 43227+ // Since overlay scrollbars (the fade-in/out kind, not overflow: overlay) 43228+ // only appear when scrolling, we don't create them if there isn't overflow 43229+ // to scroll. Thus, overlay scrollbars can't be "always on". i.e. 43230+ // |overlay:scroll| behaves like |overlay:auto|. 43231+ bool has_custom_scrollbar_style = ScrollbarStyleSource(*GetLayoutBox()) 43232+ .StyleRef() 43233+ .HasCustomScrollbarStyle(); 43234+ bool will_be_overlay = GetPageScrollbarTheme().UsesOverlayScrollbars() && 43235+ !has_custom_scrollbar_style; 43236+ if (will_be_overlay) { 43237+ if (!is_horizontal_scrollbars_hide && h_mode == mojom::blink::ScrollbarMode::kAlwaysOn) 43238+ h_mode = mojom::blink::ScrollbarMode::kAuto; 43239+ if (!is_vertical_scrollbars_hide && v_mode == mojom::blink::ScrollbarMode::kAlwaysOn) 43240+ v_mode = mojom::blink::ScrollbarMode::kAuto; 43241+ } 43242+ } 43243+ 43244+ // By default, don't make any changes. 43245+ needs_horizontal_scrollbar = is_horizontal_scrollbars_hide ? false : HasHorizontalScrollbar(); 43246+ needs_vertical_scrollbar = is_vertical_scrollbars_hide ? false : HasVerticalScrollbar(); 43247+ // If the behavior doesn't depend on overflow or any other information, we 43248+ // can set it now. 43249+ { 43250+ if (h_mode == mojom::blink::ScrollbarMode::kAlwaysOn) 43251+ needs_horizontal_scrollbar = true; 43252+ else if (h_mode == mojom::blink::ScrollbarMode::kAlwaysOff) 43253+ needs_horizontal_scrollbar = false; 43254+ 43255+ if (v_mode == mojom::blink::ScrollbarMode::kAlwaysOn) 43256+ needs_vertical_scrollbar = true; 43257+ else if (v_mode == mojom::blink::ScrollbarMode::kAlwaysOff) 43258+ needs_vertical_scrollbar = false; 43259+ } 43260+ 43261+ // If this is being performed before layout, we want to only update scrollbar 43262+ // existence if its based on purely style based reasons. 43263+ if (option == kOverflowIndependent) 43264+ return; 43265+ 43266+ // If we have clean layout, we can make a decision on any scrollbars that 43267+ // depend on overflow. 43268+ { 43269+ if (!is_horizontal_scrollbars_hide && h_mode == mojom::blink::ScrollbarMode::kAuto) { 43270+ // Don't add auto scrollbars if the box contents aren't visible. 43271+ needs_horizontal_scrollbar = 43272+ GetLayoutBox()->IsRooted() && HasHorizontalOverflow() && 43273+ VisibleContentRect(kIncludeScrollbars).height(); 43274+ } 43275+ if (!is_vertical_scrollbars_hide && v_mode == mojom::blink::ScrollbarMode::kAuto) { 43276+ needs_vertical_scrollbar = GetLayoutBox()->IsRooted() && 43277+ HasVerticalOverflow() && 43278+ VisibleContentRect(kIncludeScrollbars).width(); 43279+ } 43280+ } 43281+} 43282+#else 43283+void PaintLayerScrollableArea::ComputeScrollbarExistence( 43284+ bool& needs_horizontal_scrollbar, 43285+ bool& needs_vertical_scrollbar, 43286+ ComputeScrollbarExistenceOption option) const { 43287+ // Scrollbars may be hidden or provided by visual viewport or frame instead. 43288+ DCHECK(GetLayoutBox()->GetFrame()->GetSettings()); 43289+ if (VisualViewportSuppliesScrollbars() || 43290+ !CanHaveOverflowScrollbars(*GetLayoutBox()) || 43291+ GetLayoutBox()->GetFrame()->GetSettings()->GetHideScrollbars() || 43292+ GetLayoutBox()->IsLayoutNGFieldset() || 43293+ GetLayoutBox()->StyleRef().ScrollbarWidth() == EScrollbarWidth::kNone) { 43294+ needs_horizontal_scrollbar = false; 43295+ needs_vertical_scrollbar = false; 43296+ return; 43297+ } 43298 mojom::blink::ScrollbarMode h_mode = mojom::blink::ScrollbarMode::kAuto; 43299 mojom::blink::ScrollbarMode v_mode = mojom::blink::ScrollbarMode::kAuto; 43300 43301@@ -1583,7 +1685,7 @@ void PaintLayerScrollableArea::ComputeScrollbarExistence( 43302 } 43303 } 43304 } 43305- 43306+#endif 43307 bool PaintLayerScrollableArea::TryRemovingAutoScrollbars( 43308 const bool& needs_horizontal_scrollbar, 43309 const bool& needs_vertical_scrollbar) { 43310diff --git a/src/third_party/blink/renderer/core/workers/threaded_worklet_test.cc b/src/third_party/blink/renderer/core/workers/threaded_worklet_test.cc 43311index a4058d1da8461..45f8ab84a1531 43312--- a/src/third_party/blink/renderer/core/workers/threaded_worklet_test.cc 43313+++ b/src/third_party/blink/renderer/core/workers/threaded_worklet_test.cc 43314@@ -234,6 +234,7 @@ class ThreadedWorkletMessagingProxyForTest 43315 43316 private: 43317 friend class ThreadedWorkletTest; 43318+ FRIEND_TEST_ALL_PREFIXES(ThreadedWorkletTest, NestedRunLoopTermination); 43319 43320 std::unique_ptr<WorkerThread> CreateWorkerThread() final { 43321 return std::make_unique<ThreadedWorkletThreadForTest>(WorkletObjectProxy()); 43322@@ -280,6 +281,16 @@ class ThreadedWorkletTest : public testing::Test { 43323 } 43324 Document& GetDocument() { return page_->GetDocument(); } 43325 43326+ void WaitForReady(WorkerThread* worker_thread) { 43327+ base::WaitableEvent child_waitable; 43328+ PostCrossThreadTask( 43329+ *worker_thread->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, 43330+ CrossThreadBindOnce(&base::WaitableEvent::Signal, 43331+ CrossThreadUnretained(&child_waitable))); 43332+ 43333+ child_waitable.Wait(); 43334+ } 43335+ 43336 private: 43337 std::unique_ptr<DummyPageHolder> page_; 43338 Persistent<ThreadedWorkletMessagingProxyForTest> messaging_proxy_; 43339@@ -403,4 +414,40 @@ TEST_F(ThreadedWorkletTest, TaskRunner) { 43340 test::EnterRunLoop(); 43341 } 43342 43343+TEST_F(ThreadedWorkletTest, NestedRunLoopTermination) { 43344+ MessagingProxy()->Start(); 43345+ 43346+ ThreadedWorkletMessagingProxyForTest* second_messaging_proxy = 43347+ MakeGarbageCollected<ThreadedWorkletMessagingProxyForTest>( 43348+ GetExecutionContext()); 43349+ 43350+ // Get a nested event loop where the first one is on the stack 43351+ // and the second is still alive. 43352+ second_messaging_proxy->Start(); 43353+ 43354+ // Wait until the workers are setup and ready to accept work before we 43355+ // pause them. 43356+ WaitForReady(GetWorkerThread()); 43357+ WaitForReady(second_messaging_proxy->GetWorkerThread()); 43358+ 43359+ // Pause the second worker, then the first. 43360+ second_messaging_proxy->GetWorkerThread()->Pause(); 43361+ GetWorkerThread()->Pause(); 43362+ 43363+ // Resume then terminate the second worker. 43364+ second_messaging_proxy->GetWorkerThread()->Resume(); 43365+ second_messaging_proxy->GetWorkerThread()->Terminate(); 43366+ second_messaging_proxy = nullptr; 43367+ 43368+ // Now resume the first worker. 43369+ GetWorkerThread()->Resume(); 43370+ 43371+ // Make sure execution still works without crashing. 43372+ PostCrossThreadTask( 43373+ *GetWorkerThread()->GetTaskRunner(TaskType::kInternalTest), FROM_HERE, 43374+ CrossThreadBindOnce(&ThreadedWorkletThreadForTest::TestTaskRunner, 43375+ CrossThreadUnretained(GetWorkerThread()))); 43376+ test::EnterRunLoop(); 43377+} 43378+ 43379 } // namespace blink 43380diff --git a/src/third_party/blink/renderer/core/workers/worker_thread.cc b/src/third_party/blink/renderer/core/workers/worker_thread.cc 43381index 3d29142e7e9d6..369252c3ea49c 43382--- a/src/third_party/blink/renderer/core/workers/worker_thread.cc 43383+++ b/src/third_party/blink/renderer/core/workers/worker_thread.cc 43384@@ -589,6 +589,7 @@ void WorkerThread::InitializeOnWorkerThread( 43385 const absl::optional<WorkerBackingThreadStartupData>& thread_startup_data, 43386 std::unique_ptr<WorkerDevToolsParams> devtools_params) { 43387 DCHECK(IsCurrentThread()); 43388+ backing_thread_weak_factory_.emplace(this); 43389 worker_reporting_proxy_.WillInitializeWorkerContext(); 43390 { 43391 TRACE_EVENT0("blink.worker", "WorkerThread::InitializeWorkerContext"); 43392@@ -724,11 +725,13 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() { 43393 SetThreadState(ThreadState::kReadyToShutdown); 43394 } 43395 43396+ backing_thread_weak_factory_ = absl::nullopt; 43397 if (pause_or_freeze_count_ > 0) { 43398 DCHECK(nested_runner_); 43399 pause_or_freeze_count_ = 0; 43400 nested_runner_->QuitNow(); 43401 } 43402+ pause_handle_.reset(); 43403 43404 if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::From(GetIsolate())) 43405 debugger->WorkerThreadDestroyed(this); 43406@@ -873,8 +876,7 @@ void WorkerThread::PauseOrFreezeOnWorkerThread( 43407 if (pause_or_freeze_count_ > 1) 43408 return; 43409 43410- std::unique_ptr<scheduler::WorkerScheduler::PauseHandle> pause_handle = 43411- GetScheduler()->Pause(); 43412+ pause_handle_ = GetScheduler()->Pause(); 43413 { 43414 // Since the nested message loop runner needs to be created and destroyed on 43415 // the same thread we allocate and destroy a new message loop runner each 43416@@ -882,13 +884,20 @@ void WorkerThread::PauseOrFreezeOnWorkerThread( 43417 // the worker thread such that the resume/terminate can quit this runner. 43418 std::unique_ptr<Platform::NestedMessageLoopRunner> nested_runner = 43419 Platform::Current()->CreateNestedMessageLoopRunner(); 43420- base::AutoReset<Platform::NestedMessageLoopRunner*> nested_runner_autoreset( 43421- &nested_runner_, nested_runner.get()); 43422+ auto weak_this = backing_thread_weak_factory_->GetWeakPtr(); 43423+ nested_runner_ = nested_runner.get(); 43424 nested_runner->Run(); 43425+ 43426+ // Careful `this` may be destroyed. 43427+ if (!weak_this) { 43428+ return; 43429+ } 43430+ nested_runner_ = nullptr; 43431 } 43432 GlobalScope()->SetDefersLoadingForResourceFetchers(LoaderFreezeMode::kNone); 43433 GlobalScope()->SetIsInBackForwardCache(false); 43434 GlobalScope()->SetLifecycleState(mojom::blink::FrameLifecycleState::kRunning); 43435+ pause_handle_.reset(); 43436 } 43437 43438 void WorkerThread::ResumeOnWorkerThread() { 43439diff --git a/src/third_party/blink/renderer/core/workers/worker_thread.h b/src/third_party/blink/renderer/core/workers/worker_thread.h 43440index 223545216b296..abc812d93ffc7 43441--- a/src/third_party/blink/renderer/core/workers/worker_thread.h 43442+++ b/src/third_party/blink/renderer/core/workers/worker_thread.h 43443@@ -31,6 +31,7 @@ 43444 43445 #include "base/gtest_prod_util.h" 43446 #include "base/memory/scoped_refptr.h" 43447+#include "base/memory/weak_ptr.h" 43448 #include "base/synchronization/waitable_event.h" 43449 #include "base/task/single_thread_task_runner.h" 43450 #include "base/thread_annotations.h" 43451@@ -77,7 +78,7 @@ struct WorkerMainScriptLoadParameters; 43452 // abstract class. Multiple WorkerThreads may share one WorkerBackingThread for 43453 // worklets. 43454 // 43455-// WorkerThread start and termination must be initiated on the main thread and 43456+// WorkerThread start and termination must be initiated on the parent thread and 43457 // an actual task is executed on the worker thread. 43458 // 43459 // When termination starts, (debugger) tasks on WorkerThread are handled as 43460@@ -100,7 +101,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43461 ~WorkerThread() override; 43462 43463 // Starts the underlying thread and creates the global scope. Called on the 43464- // main thread. 43465+ // parent thread. 43466 // Startup data for WorkerBackingThread is absl::nullopt if |this| doesn't own 43467 // the underlying WorkerBackingThread. 43468 // TODO(nhiroki): We could separate WorkerBackingThread initialization from 43469@@ -112,14 +113,14 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43470 std::unique_ptr<WorkerDevToolsParams>); 43471 43472 // Posts a task to evaluate a top-level classic script on the worker thread. 43473- // Called on the main thread after Start(). 43474+ // Called on the parent thread after Start(). 43475 void EvaluateClassicScript(const KURL& script_url, 43476 const String& source_code, 43477 std::unique_ptr<Vector<uint8_t>> cached_meta_data, 43478 const v8_inspector::V8StackTraceId& stack_id); 43479 43480 // Posts a task to fetch and run a top-level classic script on the worker 43481- // thread. Called on the main thread after Start(). 43482+ // thread. Called on the parent thread after Start(). 43483 void FetchAndRunClassicScript( 43484 const KURL& script_url, 43485 std::unique_ptr<WorkerMainScriptLoadParameters> 43486@@ -130,7 +131,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43487 const v8_inspector::V8StackTraceId& stack_id); 43488 43489 // Posts a task to fetch and run a top-level module script on the worker 43490- // thread. Called on the main thread after Start(). 43491+ // thread. Called on the parent thread after Start(). 43492 void FetchAndRunModuleScript( 43493 const KURL& script_url, 43494 std::unique_ptr<WorkerMainScriptLoadParameters> 43495@@ -151,7 +152,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43496 // Terminates the worker thread. Subclasses of WorkerThread can override this 43497 // to do cleanup. The default behavior is to call Terminate() and 43498 // synchronously call EnsureScriptExecutionTerminates() to ensure the thread 43499- // is quickly terminated. Called on the main thread. 43500+ // is quickly terminated. Called on the parent thread. 43501 virtual void TerminateForTesting(); 43502 43503 // Thread::TaskObserver. 43504@@ -178,7 +179,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43505 void DebuggerTaskStarted(); 43506 void DebuggerTaskFinished(); 43507 43508- // Callable on both the main thread and the worker thread. 43509+ // Callable on both the parent thread and the worker thread. 43510 const base::UnguessableToken& GetDevToolsWorkerToken() const { 43511 return devtools_worker_token_; 43512 } 43513@@ -322,7 +323,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43514 // already shutting down. Does not terminate if a debugger task is running, 43515 // because the debugger task is guaranteed to finish and it heavily uses V8 43516 // API calls which would crash after forcible script termination. Called on 43517- // the main thread. 43518+ // the parent thread. 43519 void EnsureScriptExecutionTerminates(ExitCode) LOCKS_EXCLUDED(mutex_); 43520 43521 // These are called in this order during worker thread startup. 43522@@ -407,7 +408,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43523 // A unique identifier among all WorkerThreads. 43524 const int worker_thread_id_; 43525 43526- // Set on the main thread. 43527+ // Set on the parent thread. 43528 bool requested_to_terminate_ GUARDED_BY(mutex_) = false; 43529 43530 ThreadState thread_state_ GUARDED_BY(mutex_) = ThreadState::kNotStarted; 43531@@ -441,7 +442,7 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43532 TaskTypeTraits>; 43533 TaskRunnerHashMap worker_task_runners_; 43534 43535- // This lock protects shared states between the main thread and the worker 43536+ // This lock protects shared states between the parent thread and the worker 43537 // thread. See thread-safety annotations (e.g., GUARDED_BY) in this header 43538 // file. 43539 Mutex mutex_; 43540@@ -450,6 +451,10 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43541 // only on the worker thread. 43542 int pause_or_freeze_count_ = 0; 43543 43544+ // The `PauseHandle` needs to be destroyed before the scheduler is destroyed 43545+ // otherwise we will hit a DCHECK. 43546+ std::unique_ptr<scheduler::WorkerScheduler::PauseHandle> pause_handle_; 43547+ 43548 // A nested message loop for handling pausing. Pointer is not owned. Used only 43549 // on the worker thread. 43550 Platform::NestedMessageLoopRunner* nested_runner_ = nullptr; 43551@@ -476,6 +481,12 @@ class CORE_EXPORT WorkerThread : public Thread::TaskObserver { 43552 HashSet<std::unique_ptr<InterruptData>> pending_interrupts_ 43553 GUARDED_BY(mutex_); 43554 43555+ // Since the WorkerThread is allocated and deallocated on the parent thread, 43556+ // we need a WeakPtrFactory that is allocated and cleared on the backing 43557+ // thread. 43558+ absl::optional<base::WeakPtrFactory<WorkerThread>> 43559+ backing_thread_weak_factory_; 43560+ 43561 THREAD_CHECKER(parent_thread_checker_); 43562 }; 43563 43564diff --git a/src/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc b/src/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc 43565index c9e167094da06..206f0bfb80117 43566--- a/src/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc 43567+++ b/src/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc 43568@@ -1394,9 +1394,10 @@ void XMLHttpRequest::setRequestHeader(const AtomicString& name, 43569 return; 43570 } 43571 43572- // "5. Terminate these steps if |name| is a forbidden header name." 43573+ // "5. Terminate these steps if (|name|, |value|) is a forbidden request 43574+ // header." 43575 // No script (privileged or not) can set unsafe headers. 43576- if (cors::IsForbiddenHeaderName(name)) { 43577+ if (cors::IsForbiddenRequestHeader(name, value)) { 43578 LogConsoleError(GetExecutionContext(), 43579 "Refused to set unsafe header \"" + name + "\""); 43580 return; 43581diff --git a/src/third_party/blink/renderer/modules/breakout_box/frame_queue_transferring_optimizer.cc b/src/third_party/blink/renderer/modules/breakout_box/frame_queue_transferring_optimizer.cc 43582index fbd2d13b920b8..ad2d5b7c1c062 43583--- a/src/third_party/blink/renderer/modules/breakout_box/frame_queue_transferring_optimizer.cc 43584+++ b/src/third_party/blink/renderer/modules/breakout_box/frame_queue_transferring_optimizer.cc 43585@@ -18,10 +18,13 @@ FrameQueueTransferringOptimizer<NativeFrameType>:: 43586 FrameQueueHost* host, 43587 scoped_refptr<base::SequencedTaskRunner> host_runner, 43588 wtf_size_t max_queue_size, 43589- ConnectHostCallback connect_host_callback) 43590+ ConnectHostCallback connect_host_callback, 43591+ CrossThreadOnceClosure transferred_source_destroyed_callback) 43592 : host_(host), 43593 host_runner_(std::move(host_runner)), 43594 connect_host_callback_(std::move(connect_host_callback)), 43595+ transferred_source_destroyed_callback_( 43596+ std::move(transferred_source_destroyed_callback)), 43597 max_queue_size_(max_queue_size) {} 43598 43599 template <typename NativeFrameType> 43600@@ -39,7 +42,8 @@ FrameQueueTransferringOptimizer<NativeFrameType>::PerformInProcessOptimization( 43601 43602 auto* source = MakeGarbageCollected< 43603 TransferredFrameQueueUnderlyingSource<NativeFrameType>>( 43604- script_state, host, host_runner_); 43605+ script_state, host, host_runner_, 43606+ std::move(transferred_source_destroyed_callback_)); 43607 43608 PostCrossThreadTask( 43609 *host_runner_, FROM_HERE, 43610diff --git a/src/third_party/blink/renderer/modules/breakout_box/frame_queue_transferring_optimizer.h b/src/third_party/blink/renderer/modules/breakout_box/frame_queue_transferring_optimizer.h 43611index 6d33945b7c840..336073235ba7f 43612--- a/src/third_party/blink/renderer/modules/breakout_box/frame_queue_transferring_optimizer.h 43613+++ b/src/third_party/blink/renderer/modules/breakout_box/frame_queue_transferring_optimizer.h 43614@@ -25,13 +25,15 @@ class FrameQueueTransferringOptimizer final 43615 43616 using ConnectHostCallback = CrossThreadOnceFunction<void( 43617 scoped_refptr<base::SequencedTaskRunner>, 43618- TransferredFrameQueueUnderlyingSource<NativeFrameType>*)>; 43619+ CrossThreadPersistent< 43620+ TransferredFrameQueueUnderlyingSource<NativeFrameType>>)>; 43621 43622 FrameQueueTransferringOptimizer( 43623 FrameQueueHost*, 43624 scoped_refptr<base::SequencedTaskRunner> host_runner, 43625 wtf_size_t max_queue_size, 43626- ConnectHostCallback callback); 43627+ ConnectHostCallback connect_host_callback, 43628+ CrossThreadOnceFunction<void()> transferred_source_destroyed_callback); 43629 ~FrameQueueTransferringOptimizer() override = default; 43630 43631 UnderlyingSourceBase* PerformInProcessOptimization( 43632@@ -41,6 +43,7 @@ class FrameQueueTransferringOptimizer final 43633 CrossThreadWeakPersistent<FrameQueueHost> host_; 43634 scoped_refptr<base::SequencedTaskRunner> host_runner_; 43635 ConnectHostCallback connect_host_callback_; 43636+ CrossThreadOnceFunction<void()> transferred_source_destroyed_callback_; 43637 wtf_size_t max_queue_size_; 43638 }; 43639 43640diff --git a/src/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.cc b/src/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.cc 43641index 5e0f6a7761a50..a5b00e1319258 43642--- a/src/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.cc 43643+++ b/src/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.cc 43644@@ -266,15 +266,22 @@ double FrameQueueUnderlyingSource<NativeFrameType>::DesiredSizeForTesting() 43645 43646 template <typename NativeFrameType> 43647 void FrameQueueUnderlyingSource<NativeFrameType>::TransferSource( 43648- FrameQueueUnderlyingSource<NativeFrameType>* transferred_source) { 43649+ CrossThreadPersistent<FrameQueueUnderlyingSource<NativeFrameType>> 43650+ transferred_source) { 43651 DCHECK(realm_task_runner_->RunsTasksInCurrentSequence()); 43652 MutexLocker locker(mutex_); 43653 DCHECK(!transferred_source_); 43654- transferred_source_ = transferred_source; 43655+ transferred_source_ = std::move(transferred_source); 43656 CloseController(); 43657 frame_queue_handle_.Invalidate(); 43658 } 43659 43660+template <typename NativeFrameType> 43661+void FrameQueueUnderlyingSource<NativeFrameType>::ClearTransferredSource() { 43662+ MutexLocker locker(mutex_); 43663+ transferred_source_.Clear(); 43664+} 43665+ 43666 template <typename NativeFrameType> 43667 void FrameQueueUnderlyingSource<NativeFrameType>::CloseController() { 43668 DCHECK(realm_task_runner_->RunsTasksInCurrentSequence()); 43669diff --git a/src/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.h b/src/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.h 43670index a5d529a4231a8..f7457b15002b2 43671--- a/src/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.h 43672+++ b/src/third_party/blink/renderer/modules/breakout_box/frame_queue_underlying_source.h 43673@@ -84,7 +84,13 @@ class FrameQueueUnderlyingSource 43674 // QueueFrame(). |transferred_source| will pull frames from the same circular 43675 // queue. Must be called on |realm_task_runner_|. 43676 void TransferSource( 43677- FrameQueueUnderlyingSource<NativeFrameType>* transferred_source); 43678+ CrossThreadPersistent<FrameQueueUnderlyingSource<NativeFrameType>> 43679+ transferred_source); 43680+ 43681+ // Due to a potential race condition between |transferred_source_|'s heap 43682+ // being destroyed and the Close() method being called, we need to explicitly 43683+ // clear |transferred_source_| when its context is being destroyed. 43684+ void ClearTransferredSource(); 43685 43686 protected: 43687 bool MustUseMonitor() const; 43688diff --git a/src/third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.cc b/src/third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.cc 43689index bfc966452e413..da9a4bffc3a8c 43690--- a/src/third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.cc 43691+++ b/src/third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.cc 43692@@ -93,14 +93,17 @@ MediaStreamAudioTrackUnderlyingSource::GetTransferringOptimizer() { 43693 this, GetRealmRunner(), MaxQueueSize(), 43694 CrossThreadBindOnce( 43695 &MediaStreamAudioTrackUnderlyingSource::OnSourceTransferStarted, 43696+ WrapCrossThreadWeakPersistent(this)), 43697+ CrossThreadBindOnce( 43698+ &MediaStreamAudioTrackUnderlyingSource::ClearTransferredSource, 43699 WrapCrossThreadWeakPersistent(this))); 43700 } 43701 43702 void MediaStreamAudioTrackUnderlyingSource::OnSourceTransferStarted( 43703 scoped_refptr<base::SequencedTaskRunner> transferred_runner, 43704- TransferredAudioDataQueueUnderlyingSource* source) { 43705+ CrossThreadPersistent<TransferredAudioDataQueueUnderlyingSource> source) { 43706 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 43707- TransferSource(source); 43708+ TransferSource(std::move(source)); 43709 RecordBreakoutBoxUsage(BreakoutBoxUsage::kReadableAudioWorker); 43710 } 43711 43712diff --git a/src/third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.h b/src/third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.h 43713index 19a290ea6b83e..73c16dc5ff385 43714--- a/src/third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.h 43715+++ b/src/third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.h 43716@@ -56,7 +56,7 @@ class MODULES_EXPORT MediaStreamAudioTrackUnderlyingSource 43717 void DisconnectFromTrack(); 43718 void OnSourceTransferStarted( 43719 scoped_refptr<base::SequencedTaskRunner> transferred_runner, 43720- TransferredAudioDataQueueUnderlyingSource* source); 43721+ CrossThreadPersistent<TransferredAudioDataQueueUnderlyingSource> source); 43722 43723 // Only used to prevent the gargabe collector from reclaiming the media 43724 // stream track processor that created |this|. 43725diff --git a/src/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source.cc b/src/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source.cc 43726index 94d7af5fc6bb7..77548bc1a437b 43727--- a/src/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source.cc 43728+++ b/src/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source.cc 43729@@ -68,6 +68,9 @@ MediaStreamVideoTrackUnderlyingSource::GetStreamTransferOptimizer() { 43730 this, GetRealmRunner(), MaxQueueSize(), 43731 CrossThreadBindOnce( 43732 &MediaStreamVideoTrackUnderlyingSource::OnSourceTransferStarted, 43733+ WrapCrossThreadWeakPersistent(this)), 43734+ CrossThreadBindOnce( 43735+ &MediaStreamVideoTrackUnderlyingSource::ClearTransferredSource, 43736 WrapCrossThreadWeakPersistent(this))); 43737 } 43738 43739@@ -78,9 +81,9 @@ MediaStreamVideoTrackUnderlyingSource::GetIOTaskRunner() { 43740 43741 void MediaStreamVideoTrackUnderlyingSource::OnSourceTransferStarted( 43742 scoped_refptr<base::SequencedTaskRunner> transferred_runner, 43743- TransferredVideoFrameQueueUnderlyingSource* source) { 43744+ CrossThreadPersistent<TransferredVideoFrameQueueUnderlyingSource> source) { 43745 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 43746- TransferSource(source); 43747+ TransferSource(std::move(source)); 43748 RecordBreakoutBoxUsage(BreakoutBoxUsage::kReadableVideoWorker); 43749 } 43750 43751diff --git a/src/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source.h b/src/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source.h 43752index 163082fc71460..e72e6b2631e81 43753--- a/src/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source.h 43754+++ b/src/third_party/blink/renderer/modules/breakout_box/media_stream_video_track_underlying_source.h 43755@@ -60,8 +60,9 @@ class MODULES_EXPORT MediaStreamVideoTrackUnderlyingSource 43756 bool StartFrameDelivery() override; 43757 void StopFrameDelivery() override; 43758 43759- void OnSourceTransferStarted(scoped_refptr<base::SequencedTaskRunner>, 43760- TransferredVideoFrameQueueUnderlyingSource*); 43761+ void OnSourceTransferStarted( 43762+ scoped_refptr<base::SequencedTaskRunner>, 43763+ CrossThreadPersistent<TransferredVideoFrameQueueUnderlyingSource>); 43764 43765 void OnFrameFromTrack( 43766 scoped_refptr<media::VideoFrame> media_frame, 43767diff --git a/src/third_party/blink/renderer/modules/breakout_box/transferred_frame_queue_underlying_source.cc b/src/third_party/blink/renderer/modules/breakout_box/transferred_frame_queue_underlying_source.cc 43768index 5c62b8f1b752c..e38173482d455 43769--- a/src/third_party/blink/renderer/modules/breakout_box/transferred_frame_queue_underlying_source.cc 43770+++ b/src/third_party/blink/renderer/modules/breakout_box/transferred_frame_queue_underlying_source.cc 43771@@ -15,11 +15,14 @@ template <typename NativeFrameType> 43772 TransferredFrameQueueUnderlyingSource<NativeFrameType>:: 43773 TransferredFrameQueueUnderlyingSource( 43774 ScriptState* script_state, 43775- FrameQueueHost* host, 43776- scoped_refptr<base::SequencedTaskRunner> host_runner) 43777+ CrossThreadPersistent<FrameQueueHost> host, 43778+ scoped_refptr<base::SequencedTaskRunner> host_runner, 43779+ CrossThreadOnceClosure transferred_source_destroyed_callback) 43780 : FrameQueueUnderlyingSource<NativeFrameType>(script_state, host), 43781 host_runner_(host_runner), 43782- host_(host) {} 43783+ host_(std::move(host)), 43784+ transferred_source_destroyed_callback_( 43785+ std::move(transferred_source_destroyed_callback)) {} 43786 43787 template <typename NativeFrameType> 43788 bool TransferredFrameQueueUnderlyingSource< 43789@@ -44,6 +47,13 @@ void TransferredFrameQueueUnderlyingSource< 43790 CrossThreadBindOnce(&FrameQueueHost::Close, host_)); 43791 } 43792 43793+template <typename NativeFrameType> 43794+void TransferredFrameQueueUnderlyingSource< 43795+ NativeFrameType>::ContextDestroyed() { 43796+ std::move(transferred_source_destroyed_callback_).Run(); 43797+ FrameQueueUnderlyingSource<NativeFrameType>::ContextDestroyed(); 43798+} 43799+ 43800 template <typename NativeFrameType> 43801 void TransferredFrameQueueUnderlyingSource<NativeFrameType>::Trace( 43802 Visitor* visitor) const { 43803diff --git a/src/third_party/blink/renderer/modules/breakout_box/transferred_frame_queue_underlying_source.h b/src/third_party/blink/renderer/modules/breakout_box/transferred_frame_queue_underlying_source.h 43804index 5f8a36719407a..7cd3270fbb3cf 43805--- a/src/third_party/blink/renderer/modules/breakout_box/transferred_frame_queue_underlying_source.h 43806+++ b/src/third_party/blink/renderer/modules/breakout_box/transferred_frame_queue_underlying_source.h 43807@@ -19,8 +19,9 @@ class TransferredFrameQueueUnderlyingSource 43808 43809 TransferredFrameQueueUnderlyingSource( 43810 ScriptState*, 43811- FrameQueueHost*, 43812- scoped_refptr<base::SequencedTaskRunner> host_runner); 43813+ CrossThreadPersistent<FrameQueueHost>, 43814+ scoped_refptr<base::SequencedTaskRunner> host_runner, 43815+ CrossThreadOnceClosure transferred_source_destroyed_callback); 43816 ~TransferredFrameQueueUnderlyingSource() override = default; 43817 43818 TransferredFrameQueueUnderlyingSource( 43819@@ -32,11 +33,15 @@ class TransferredFrameQueueUnderlyingSource 43820 bool StartFrameDelivery() override; 43821 void StopFrameDelivery() override; 43822 43823+ // ExecutionLifecycleObserver 43824+ void ContextDestroyed() override; 43825+ 43826 void Trace(Visitor*) const override; 43827 43828 private: 43829 scoped_refptr<base::SequencedTaskRunner> host_runner_; 43830 CrossThreadPersistent<FrameQueueHost> host_; 43831+ CrossThreadOnceClosure transferred_source_destroyed_callback_; 43832 }; 43833 43834 extern template class MODULES_EXTERN_TEMPLATE_EXPORT 43835diff --git a/src/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.cc b/src/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.cc 43836index 8ce835e080cbd..0c4d6bfcd2af4 43837--- a/src/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.cc 43838+++ b/src/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.cc 43839@@ -643,16 +643,20 @@ PeerConnectionTracker::PeerConnectionTracker( 43840 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, 43841 base::PassKey<PeerConnectionTracker>) 43842 : Supplement<LocalDOMWindow>(window), 43843+ receiver_(this, &window), 43844 main_thread_task_runner_(std::move(main_thread_task_runner)) { 43845 window.GetBrowserInterfaceBroker().GetInterface( 43846 peer_connection_tracker_host_.BindNewPipeAndPassReceiver()); 43847 } 43848 43849+// Constructor used for testing. Note that receiver_ doesn't have a context 43850+// notifier in this case. 43851 PeerConnectionTracker::PeerConnectionTracker( 43852 mojo::Remote<blink::mojom::blink::PeerConnectionTrackerHost> host, 43853 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) 43854 : Supplement(nullptr), 43855 peer_connection_tracker_host_(std::move(host)), 43856+ receiver_(this, nullptr), 43857 main_thread_task_runner_(std::move(main_thread_task_runner)) {} 43858 43859 PeerConnectionTracker::~PeerConnectionTracker() {} 43860diff --git a/src/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.h b/src/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.h 43861index adb482f83e4d2..33f33238120e1 43862--- a/src/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.h 43863+++ b/src/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.h 43864@@ -14,6 +14,7 @@ 43865 #include "third_party/blink/renderer/core/frame/local_dom_window.h" 43866 #include "third_party/blink/renderer/modules/mediastream/media_stream.h" 43867 #include "third_party/blink/renderer/modules/modules_export.h" 43868+#include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver.h" 43869 #include "third_party/blink/renderer/platform/peerconnection/rtc_peer_connection_handler_client.h" 43870 #include "third_party/blink/renderer/platform/peerconnection/rtc_rtp_transceiver_platform.h" 43871 #include "third_party/blink/renderer/platform/peerconnection/rtc_session_description_platform.h" 43872@@ -256,6 +257,11 @@ class MODULES_EXPORT PeerConnectionTracker 43873 virtual void TrackRtcEventLogWrite(RTCPeerConnectionHandler* pc_handler, 43874 const WTF::Vector<uint8_t>& output); 43875 43876+ void Trace(Visitor* visitor) const override { 43877+ visitor->Trace(receiver_); 43878+ Supplement<LocalDOMWindow>::Trace(visitor); 43879+ } 43880+ 43881 private: 43882 FRIEND_TEST_ALL_PREFIXES(PeerConnectionTrackerTest, OnSuspend); 43883 FRIEND_TEST_ALL_PREFIXES(PeerConnectionTrackerTest, OnThermalStateChange); 43884@@ -324,7 +330,9 @@ class MODULES_EXPORT PeerConnectionTracker 43885 THREAD_CHECKER(main_thread_); 43886 mojo::Remote<blink::mojom::blink::PeerConnectionTrackerHost> 43887 peer_connection_tracker_host_; 43888- mojo::Receiver<blink::mojom::blink::PeerConnectionManager> receiver_{this}; 43889+ HeapMojoReceiver<blink::mojom::blink::PeerConnectionManager, 43890+ PeerConnectionTracker> 43891+ receiver_; 43892 43893 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 43894 }; 43895diff --git a/src/third_party/blink/renderer/modules/webcodecs/video_encoder.cc b/src/third_party/blink/renderer/modules/webcodecs/video_encoder.cc 43896index 9c7cc65e32507..4135a8bbfb907 43897--- a/src/third_party/blink/renderer/modules/webcodecs/video_encoder.cc 43898+++ b/src/third_party/blink/renderer/modules/webcodecs/video_encoder.cc 43899@@ -97,16 +97,6 @@ namespace { 43900 constexpr const char kCategory[] = "media"; 43901 constexpr int kMaxActiveEncodes = 5; 43902 43903-// Use this function in cases when we can't immediately delete |ptr| because 43904-// there might be its methods on the call stack. 43905-template <typename T> 43906-void DeleteLater(ScriptState* state, std::unique_ptr<T> ptr) { 43907- DCHECK(state->ContextIsValid()); 43908- auto* context = ExecutionContext::From(state); 43909- auto runner = context->GetTaskRunner(TaskType::kInternalDefault); 43910- runner->DeleteSoon(FROM_HERE, std::move(ptr)); 43911-} 43912- 43913 bool IsAcceleratedConfigurationSupported( 43914 media::VideoCodecProfile profile, 43915 const media::VideoEncoder::Options& options, 43916@@ -985,6 +975,7 @@ void VideoEncoder::ResetInternal() { 43917 } 43918 43919 static void isConfigSupportedWithSoftwareOnly( 43920+ ScriptState* script_state, 43921 ScriptPromiseResolver* resolver, 43922 VideoEncoderSupport* support, 43923 VideoEncoderTraits::ParsedConfig* config) { 43924@@ -1009,22 +1000,25 @@ static void isConfigSupportedWithSoftwareOnly( 43925 return; 43926 } 43927 43928- auto done_callback = [](std::unique_ptr<media::VideoEncoder> sw_encoder, 43929+ auto done_callback = [](std::unique_ptr<media::VideoEncoder> encoder, 43930 ScriptPromiseResolver* resolver, 43931+ scoped_refptr<base::SingleThreadTaskRunner> runner, 43932 VideoEncoderSupport* support, 43933 media::EncoderStatus status) { 43934 support->setSupported(status.is_ok()); 43935 resolver->Resolve(support); 43936- DeleteLater(resolver->GetScriptState(), std::move(sw_encoder)); 43937+ runner->DeleteSoon(FROM_HERE, std::move(encoder)); 43938 }; 43939 43940+ auto* context = ExecutionContext::From(script_state); 43941+ auto runner = context->GetTaskRunner(TaskType::kInternalDefault); 43942 auto* software_encoder_raw = software_encoder.get(); 43943 software_encoder_raw->Initialize( 43944 config->profile, config->options, base::DoNothing(), 43945- ConvertToBaseOnceCallback( 43946- CrossThreadBindOnce(done_callback, std::move(software_encoder), 43947- WrapCrossThreadPersistent(resolver), 43948- WrapCrossThreadPersistent(support)))); 43949+ ConvertToBaseOnceCallback(CrossThreadBindOnce( 43950+ done_callback, std::move(software_encoder), 43951+ WrapCrossThreadPersistent(resolver), std::move(runner), 43952+ WrapCrossThreadPersistent(support)))); 43953 } 43954 43955 static void isConfigSupportedWithHardwareOnly( 43956@@ -1111,7 +1105,8 @@ ScriptPromise VideoEncoder::isConfigSupported(ScriptState* script_state, 43957 promises.push_back(resolver->Promise()); 43958 auto* support = VideoEncoderSupport::Create(); 43959 support->setConfig(config_copy); 43960- isConfigSupportedWithSoftwareOnly(resolver, support, parsed_config); 43961+ isConfigSupportedWithSoftwareOnly(script_state, resolver, support, 43962+ parsed_config); 43963 } 43964 43965 // Wait for all |promises| to resolve and check if any of them have 43966diff --git a/src/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_database.cc b/src/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_database.cc 43967index 4ccc6fbce329f..b35b16647701f 43968--- a/src/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_database.cc 43969+++ b/src/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_database.cc 43970@@ -46,14 +46,10 @@ std::tuple<int, sqlite3*> OpenDatabase(const String& filename) { 43971 /*make_default=*/false); 43972 43973 sqlite3* connection; 43974-#if BUILDFLAG(IS_OHOS) 43975- int status = sqlite3_open(filename.Utf8().c_str(), &connection); 43976-#else 43977 constexpr int open_flags = 43978 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_PRIVATECACHE; 43979 int status = sqlite3_open_v2(filename.Utf8().c_str(), &connection, open_flags, 43980 kSqliteVfsName); 43981-#endif 43982 if (status != SQLITE_OK) { 43983 // SQLite creates a connection handle in most cases where open fails. 43984 if (connection) { 43985diff --git a/src/third_party/blink/renderer/platform/BUILD.gn b/src/third_party/blink/renderer/platform/BUILD.gn 43986index 2a0a9c27a7eff..43d84d8c29028 43987--- a/src/third_party/blink/renderer/platform/BUILD.gn 43988+++ b/src/third_party/blink/renderer/platform/BUILD.gn 43989@@ -1752,7 +1752,11 @@ component("platform") { 43990 } 43991 43992 if (is_ohos) { 43993- sources += [ "fonts/android/font_cache_android.cc" ] 43994+ sources += [ 43995+ "fonts/android/font_cache_android.cc", 43996+ "fonts/ohos/font_unique_name_lookup_ohos.cc", 43997+ "fonts/ohos/font_unique_name_lookup_ohos.h", 43998+ ] 43999 } 44000 44001 if (is_android) { 44002diff --git a/src/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.cc b/src/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.cc 44003index 2fa363a2a4e7b..6db06babe48b5 44004--- a/src/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.cc 44005+++ b/src/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.cc 44006@@ -11,6 +11,8 @@ 44007 #include "third_party/blink/renderer/platform/fonts/linux/font_unique_name_lookup_linux.h" 44008 #elif defined(OS_WIN) 44009 #include "third_party/blink/renderer/platform/fonts/win/font_unique_name_lookup_win.h" 44010+#elif BUILDFLAG(IS_OHOS) 44011+#include "third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.h" 44012 #endif 44013 44014 namespace blink { 44015@@ -26,6 +28,8 @@ FontUniqueNameLookup::GetPlatformUniqueNameLookup() { 44016 return std::make_unique<FontUniqueNameLookupLinux>(); 44017 #elif defined(OS_WIN) 44018 return std::make_unique<FontUniqueNameLookupWin>(); 44019+#elif BUILDFLAG(IS_OHOS) 44020+ return std::make_unique<FontUniqueNameLookupOhos>(); 44021 #else 44022 return nullptr; 44023 #endif 44024diff --git a/src/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h b/src/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h 44025index 8b265ad1f08ed..89115d77f4795 44026--- a/src/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h 44027+++ b/src/third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h 44028@@ -12,7 +12,7 @@ 44029 #include "third_party/skia/include/core/SkRefCnt.h" 44030 #include "third_party/skia/include/core/SkTypeface.h" 44031 44032-#if defined(OS_ANDROID) || defined(OS_WIN) 44033+#if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_OHOS) 44034 #include "third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h" 44035 #endif 44036 44037@@ -65,7 +65,7 @@ class FontUniqueNameLookup { 44038 44039 // Windows and Android share the concept of connecting to a Mojo service for 44040 // retrieving a ReadOnlySharedMemoryRegion with the lookup table in it. 44041-#if defined(OS_WIN) || defined(OS_ANDROID) 44042+#if defined(OS_WIN) || defined(OS_ANDROID) || BUILDFLAG(IS_OHOS) 44043 std::unique_ptr<FontTableMatcher> font_table_matcher_; 44044 #endif 44045 }; 44046diff --git a/src/third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.cc b/src/third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.cc 44047new file mode 100755 44048index 0000000000000..165eb7a6c8c6d 44049--- /dev/null 44050+++ b/src/third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.cc 44051@@ -0,0 +1,104 @@ 44052+// Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. 44053+// Use of this source code is governed by a BSD-style license that can be 44054+// found in the LICENSE file. 44055+ 44056+#include "third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.h" 44057+ 44058+#include "base/files/file.h" 44059+#include "base/logging.h" 44060+#include "base/metrics/histogram_macros.h" 44061+#include "base/timer/elapsed_timer.h" 44062+#include "third_party/blink/public/common/features.h" 44063+#include "third_party/blink/public/common/font_unique_name_lookup/icu_fold_case_util.h" 44064+#include "third_party/blink/public/common/thread_safe_browser_interface_broker_proxy.h" 44065+#include "third_party/blink/public/platform/platform.h" 44066+#include "third_party/blink/renderer/platform/instrumentation/histogram.h" 44067+#include "third_party/blink/renderer/platform/runtime_enabled_features.h" 44068+#include "third_party/skia/include/core/SkData.h" 44069+#include "third_party/skia/include/core/SkRefCnt.h" 44070+#include "third_party/skia/include/core/SkTypeface.h" 44071+ 44072+#include "base/logging.h" 44073+ 44074+namespace blink { 44075+ 44076+FontUniqueNameLookupOhos::~FontUniqueNameLookupOhos() = default; 44077+ 44078+sk_sp<SkTypeface> FontUniqueNameLookupOhos::MatchUniqueName( 44079+ const String& font_unique_name) { 44080+ if (!IsFontUniqueNameLookupReadyForSyncLookup()) 44081+ return nullptr; 44082+ absl::optional<FontTableMatcher::MatchResult> match_result = 44083+ font_table_matcher_->MatchName(font_unique_name.Utf8().c_str()); 44084+ if (!match_result) 44085+ return nullptr; 44086+ return SkTypeface::MakeFromFile(match_result->font_path.c_str(), 44087+ match_result->ttc_index); 44088+} 44089+ 44090+void FontUniqueNameLookupOhos::Init() { 44091+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 44092+ EnsureServiceConnected(); 44093+} 44094+ 44095+bool FontUniqueNameLookupOhos::IsFontUniqueNameLookupReadyForSyncLookup() { 44096+ if (!RuntimeEnabledFeatures::FontSrcLocalMatchingEnabled()) 44097+ return true; 44098+ 44099+ EnsureServiceConnected(); 44100+ 44101+ if (font_table_matcher_.get()) 44102+ return true; 44103+ 44104+ if (sync_available_.has_value()) 44105+ return sync_available_.value(); 44106+ 44107+ bool sync_available_from_mojo = false; 44108+ base::ReadOnlySharedMemoryRegion shared_memory_region; 44109+ ohos_font_lookup_service_->GetUniqueNameLookupTableIfAvailable( 44110+ &sync_available_from_mojo, &shared_memory_region); 44111+ sync_available_ = sync_available_from_mojo; 44112+ 44113+ if (*sync_available_) { 44114+ DCHECK_EQ(pending_callbacks_.size(), 0u); 44115+ ReceiveReadOnlySharedMemoryRegion(std::move(shared_memory_region)); 44116+ } 44117+ 44118+ return *sync_available_; 44119+} 44120+ 44121+void FontUniqueNameLookupOhos::PrepareFontUniqueNameLookup( 44122+ NotifyFontUniqueNameLookupReady callback) { 44123+ DCHECK(!font_table_matcher_.get()); 44124+ DCHECK(RuntimeEnabledFeatures::FontSrcLocalMatchingEnabled()); 44125+ 44126+ pending_callbacks_.push_back(std::move(callback)); 44127+ 44128+ if (pending_callbacks_.size() > 1) 44129+ return; 44130+ 44131+ EnsureServiceConnected(); 44132+ 44133+ ohos_font_lookup_service_->GetUniqueNameLookupTable(base::BindOnce( 44134+ &FontUniqueNameLookupOhos::ReceiveReadOnlySharedMemoryRegion, 44135+ base::Unretained(this))); 44136+} 44137+ 44138+void FontUniqueNameLookupOhos::EnsureServiceConnected() { 44139+ if (!ohos_font_lookup_service_) { 44140+ Platform::Current()->GetBrowserInterfaceBroker()->GetInterface( 44141+ ohos_font_lookup_service_.BindNewPipeAndPassReceiver()); 44142+ } 44143+} 44144+ 44145+void FontUniqueNameLookupOhos::ReceiveReadOnlySharedMemoryRegion( 44146+ base::ReadOnlySharedMemoryRegion shared_memory_region) { 44147+ font_table_matcher_ = 44148+ std::make_unique<FontTableMatcher>(shared_memory_region.Map()); 44149+ while (!pending_callbacks_.IsEmpty()) { 44150+ NotifyFontUniqueNameLookupReady callback = pending_callbacks_.TakeFirst(); 44151+ std::move(callback).Run(); 44152+ } 44153+} 44154+ 44155+} // namespace blink 44156diff --git a/src/third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.h b/src/third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.h 44157new file mode 100755 44158index 0000000000000..5b5892c9c6b98 44159--- /dev/null 44160+++ b/src/third_party/blink/renderer/platform/fonts/ohos/font_unique_name_lookup_ohos.h 44161@@ -0,0 +1,49 @@ 44162+// Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. 44163+// Use of this source code is governed by a BSD-style license that can be 44164+// found in the LICENSE file. 44165+ 44166+#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_LINUX_FONT_UNIQUE_NAME_LOOKUP_OHOS_H_ 44167+#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_LINUX_FONT_UNIQUE_NAME_LOOKUP_OHOS_H_ 44168+ 44169+#include "base/sequence_checker.h" 44170+#include "mojo/public/cpp/bindings/remote.h" 44171+#include "third_party/blink/public/common/font_unique_name_lookup/font_table_matcher.h" 44172+#include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom-blink.h" 44173+#include "third_party/blink/public/mojom/font_unique_name_lookup/font_unique_name_lookup.mojom-blink.h" 44174+#include "third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h" 44175+#include "third_party/blink/renderer/platform/wtf/deque.h" 44176+ 44177+namespace blink { 44178+ 44179+class FontUniqueNameLookupOhos : public FontUniqueNameLookup { 44180+ public: 44181+ FontUniqueNameLookupOhos() = default; 44182+ FontUniqueNameLookupOhos(const FontUniqueNameLookupOhos&) = delete; 44183+ FontUniqueNameLookupOhos& operator=(const FontUniqueNameLookupOhos&) = delete; 44184+ ~FontUniqueNameLookupOhos() override; 44185+ 44186+ bool IsFontUniqueNameLookupReadyForSyncLookup() override; 44187+ 44188+ void PrepareFontUniqueNameLookup( 44189+ NotifyFontUniqueNameLookupReady callback) override; 44190+ 44191+ sk_sp<SkTypeface> MatchUniqueName(const String& font_unique_name) override; 44192+ 44193+ void Init() override; 44194+ 44195+ private: 44196+ void EnsureServiceConnected(); 44197+ 44198+ void ReceiveReadOnlySharedMemoryRegion( 44199+ base::ReadOnlySharedMemoryRegion shared_memory_region); 44200+ 44201+ mojo::Remote<mojom::blink::FontUniqueNameLookup> ohos_font_lookup_service_; 44202+ WTF::Deque<NotifyFontUniqueNameLookupReady> pending_callbacks_; 44203+ absl::optional<bool> sync_available_; 44204+ 44205+ SEQUENCE_CHECKER(sequence_checker_); 44206+}; 44207+ 44208+} // namespace blink 44209+ 44210+#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_LINUX_FONT_UNIQUE_NAME_LOOKUP_OHOS_H_ 44211diff --git a/src/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc b/src/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc 44212index 55a6f844bfd49..ded092c7de514 44213--- a/src/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc 44214+++ b/src/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc 44215@@ -200,7 +200,6 @@ sk_sp<SkTypeface> FontCache::CreateTypeface( 44216 std::string& name) { 44217 #if !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_FUCHSIA) 44218 // TODO(fuchsia): Revisit this and other font code for Fuchsia. 44219- 44220 if (creation_params.CreationType() == kCreateFontByFciIdAndTtcIndex) { 44221 if (Platform::Current()->GetSandboxSupport()) { 44222 return SkTypeface_Factory::FromFontConfigInterfaceIdAndTtcIndex( 44223@@ -242,6 +241,7 @@ sk_sp<SkTypeface> FontCache::CreateTypeface( 44224 // the embedder provided font Manager rather than calling 44225 // SkTypeface::CreateFromName which may redirect the call to the default font 44226 // Manager. On Windows the font manager is always present. 44227+ 44228 if (font_manager_) { 44229 auto tf = sk_sp<SkTypeface>(font_manager_->matchFamilyStyle( 44230 name.c_str(), font_description.SkiaFontStyle())); 44231@@ -264,7 +264,7 @@ std::unique_ptr<FontPlatformData> FontCache::CreateFontPlatformData( 44232 std::string name; 44233 44234 sk_sp<SkTypeface> typeface; 44235-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) 44236+#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_OHOS) 44237 bool noto_color_emoji_from_gmscore = false; 44238 #if defined(OS_ANDROID) 44239 // Use the unique local matching pathway for fetching Noto Color Emoji Compat 44240diff --git a/src/third_party/blink/renderer/platform/loader/cors/cors.cc b/src/third_party/blink/renderer/platform/loader/cors/cors.cc 44241index 3062b4be0819f..94aed1c793d17 44242--- a/src/third_party/blink/renderer/platform/loader/cors/cors.cc 44243+++ b/src/third_party/blink/renderer/platform/loader/cors/cors.cc 44244@@ -136,8 +136,8 @@ PLATFORM_EXPORT Vector<String> PrivilegedNoCorsHeaderNames() { 44245 return header_names; 44246 } 44247 44248-bool IsForbiddenHeaderName(const String& name) { 44249- return !net::HttpUtil::IsSafeHeader(name.Latin1()); 44250+bool IsForbiddenRequestHeader(const String& name, const String& value) { 44251+ return !net::HttpUtil::IsSafeHeader(name.Latin1(), value.Latin1()); 44252 } 44253 44254 bool ContainsOnlyCorsSafelistedHeaders(const HTTPHeaderMap& header_map) { 44255diff --git a/src/third_party/blink/renderer/platform/loader/cors/cors.h b/src/third_party/blink/renderer/platform/loader/cors/cors.h 44256index 1f1bdbc079d2b..c4eb638e74139 44257--- a/src/third_party/blink/renderer/platform/loader/cors/cors.h 44258+++ b/src/third_party/blink/renderer/platform/loader/cors/cors.h 44259@@ -39,7 +39,8 @@ PLATFORM_EXPORT bool IsNoCorsSafelistedHeader(const String& name, 44260 PLATFORM_EXPORT bool IsPrivilegedNoCorsHeaderName(const String& name); 44261 PLATFORM_EXPORT bool IsNoCorsSafelistedHeaderName(const String& name); 44262 PLATFORM_EXPORT Vector<String> PrivilegedNoCorsHeaderNames(); 44263-PLATFORM_EXPORT bool IsForbiddenHeaderName(const String& name); 44264+PLATFORM_EXPORT bool IsForbiddenRequestHeader(const String& name, 44265+ const String& value); 44266 PLATFORM_EXPORT bool ContainsOnlyCorsSafelistedHeaders(const HTTPHeaderMap&); 44267 44268 PLATFORM_EXPORT bool IsOkStatus(int status); 44269diff --git a/src/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/src/third_party/blink/renderer/platform/runtime_enabled_features.json5 44270index ffce9bb7d9bd3..8478e2da3e625 44271--- a/src/third_party/blink/renderer/platform/runtime_enabled_features.json5 44272+++ b/src/third_party/blink/renderer/platform/runtime_enabled_features.json5 44273@@ -1599,7 +1599,8 @@ 44274 }, 44275 { 44276 name: "OrientationEvent", 44277- status: {"Android": "stable"}, 44278+ // BUILDFLAG(IS_OHOS) 44279+ status: "stable", 44280 }, 44281 { 44282 name: "OriginIsolationHeader", 44283diff --git a/src/third_party/blink/renderer/platform/widget/input/widget_input_handler_impl.cc b/src/third_party/blink/renderer/platform/widget/input/widget_input_handler_impl.cc 44284index e8ea6cd4f553f..861c39cba08f8 44285--- a/src/third_party/blink/renderer/platform/widget/input/widget_input_handler_impl.cc 44286+++ b/src/third_party/blink/renderer/platform/widget/input/widget_input_handler_impl.cc 44287@@ -151,8 +151,12 @@ void WidgetInputHandlerImpl::DispatchEvent( 44288 } 44289 44290 #if BUILDFLAG(IS_OHOS) 44291-void WidgetInputHandlerImpl::StartFling() { 44292- soc_perf::SocPerUtil::ApplySocConfig(); 44293+void WidgetInputHandlerImpl::TryStartFling() { 44294+ soc_perf::SocPerUtil::EnableFlingBoost(); 44295+} 44296+ 44297+void WidgetInputHandlerImpl::TryFinishFling() { 44298+ soc_perf::SocPerUtil::DisableFlingBoost(); 44299 } 44300 #endif 44301 44302diff --git a/src/third_party/blink/renderer/platform/widget/input/widget_input_handler_impl.h b/src/third_party/blink/renderer/platform/widget/input/widget_input_handler_impl.h 44303index de2ef56ee3a36..8f4598b6a7d95 44304--- a/src/third_party/blink/renderer/platform/widget/input/widget_input_handler_impl.h 44305+++ b/src/third_party/blink/renderer/platform/widget/input/widget_input_handler_impl.h 44306@@ -62,7 +62,8 @@ class WidgetInputHandlerImpl : public mojom::blink::WidgetInputHandler { 44307 void DispatchEvent(std::unique_ptr<WebCoalescedInputEvent>, 44308 DispatchEventCallback callback) override; 44309 #if BUILDFLAG(IS_OHOS) 44310- void StartFling() override; 44311+ void TryStartFling() override; 44312+ void TryFinishFling() override; 44313 #endif 44314 void DispatchNonBlockingEvent( 44315 std::unique_ptr<WebCoalescedInputEvent>) override; 44316diff --git a/src/third_party/blink/renderer/platform/widget/widget_base.cc b/src/third_party/blink/renderer/platform/widget/widget_base.cc 44317index 1b5aff93b708b..7980b4b20fc90 44318--- a/src/third_party/blink/renderer/platform/widget/widget_base.cc 44319+++ b/src/third_party/blink/renderer/platform/widget/widget_base.cc 44320@@ -819,8 +819,14 @@ void WidgetBase::BeginMainFrame(base::TimeTicks frame_time) { 44321 if (ShouldRecordBeginMainFrameMetrics()) { 44322 raf_aligned_input_start_time = base::TimeTicks::Now(); 44323 } 44324+ 44325+ auto weak_this = weak_ptr_factory_.GetWeakPtr(); 44326 widget_input_handler_manager_->input_event_queue()->DispatchRafAlignedInput( 44327 frame_time); 44328+ // DispatchRafAlignedInput could have detached the frame. 44329+ if (!weak_this) 44330+ return; 44331+ 44332 if (ShouldRecordBeginMainFrameMetrics()) { 44333 client_->RecordDispatchRafAlignedInputTime(raf_aligned_input_start_time); 44334 } 44335diff --git a/src/third_party/blink/web_tests/TestExpectations b/src/third_party/blink/web_tests/TestExpectations 44336index dbda152b7a2ee..875d185af57dd 44337--- a/src/third_party/blink/web_tests/TestExpectations 44338+++ b/src/third_party/blink/web_tests/TestExpectations 44339@@ -7609,3 +7609,6 @@ crbug.com/1282347 [ Mac ] virtual/clipboard-custom-formats/clipboard/async-clipb 44340 44341 # Sheriff 2022-01-25 44342 crbug.com/1289992 virtual/document-transition/document-transition/paint-order.html [ Skip ] 44343+ 44344+crbug.com/1295980 [ Mac ] virtual/fenced-frame-mparch/wpt_internal/fenced_frame/script-focus.https.html [ Pass Timeout ] 44345+crbug.com/1295980 [ Mac ] virtual/fenced-frame-shadow-dom/wpt_internal/fenced_frame/script-focus.https.html [ Pass Timeout ] 44346\ No newline at end of file 44347diff --git a/src/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/crashtests/chrome-layout-root-crash.html b/src/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/crashtests/chrome-layout-root-crash.html 44348new file mode 100644 44349index 0000000000000..e3e709a240bd8 44350--- /dev/null 44351+++ b/src/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/crashtests/chrome-layout-root-crash.html 44352@@ -0,0 +1,17 @@ 44353+<!doctype html> 44354+<html class="reftest-wait"> 44355+<link rel="help" href="https://crbug.com/1371820"> 44356+<style> 44357+ body, div, img { container-type: size; } 44358+</style> 44359+<p>Pass if no crash.</p> 44360+<div id="div"><img id="img" alt="a"></div> 44361+<script> 44362+ requestAnimationFrame(() => requestAnimationFrame(() => { 44363+ // Adds a layout root inside the div size container. 44364+ img.alt = img.src = "b"; 44365+ // Marks div size container for layout which skips style recalc for the sub-tree. 44366+ div.style.width = "500px"; 44367+ document.documentElement.classList.remove("reftest-wait"); 44368+ })); 44369+</script> 44370diff --git a/src/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt b/src/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt 44371index 3823a752b99f5..eeed0dfc0def1 44372--- a/src/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt 44373+++ b/src/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt 44374@@ -1,5 +1,5 @@ 44375 This is a testharness.js-based test. 44376-Found 60 tests; 59 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN. 44377+Found 61 tests; 60 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN. 44378 PASS <length> values computed are correctly via var()-reference 44379 PASS <length> values computed are correctly via var()-reference when font-size is inherited 44380 PASS <length> values are computed correctly when font-size is inherited [14em] 44381@@ -60,5 +60,6 @@ PASS * values are computed correctly [50dpi] 44382 PASS <resolution> values are computed correctly [1dppx] 44383 PASS <resolution> values are computed correctly [96dpi] 44384 FAIL <resolution> values are computed correctly [calc(1dppx + 96dpi)] assert_equals: expected "2dppx" but got "0dppx" 44385+PASS * values are computed correctly [url(why)] 44386 Harness: the test ran to completion. 44387 44388diff --git a/src/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation.html b/src/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation.html 44389index f03b257246e52..168495247a3b1 44390--- a/src/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation.html 44391+++ b/src/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation.html 44392@@ -167,4 +167,6 @@ test_computed_value('<resolution>', '1dppx', '1dppx'); 44393 test_computed_value('<resolution>', '96dpi', '1dppx'); 44394 test_computed_value('<resolution>', 'calc(1dppx + 96dpi)', '2dppx'); 44395 44396+test_computed_value('*', 'url(why)', 'url(why)'); 44397+ 44398 </script> 44399diff --git a/src/third_party/blink/web_tests/external/wpt/custom-elements/when-defined-reentry-crash.html b/src/third_party/blink/web_tests/external/wpt/custom-elements/when-defined-reentry-crash.html 44400new file mode 100644 44401index 0000000000000..5f1ceb12a3504 44402--- /dev/null 44403+++ b/src/third_party/blink/web_tests/external/wpt/custom-elements/when-defined-reentry-crash.html 44404@@ -0,0 +1,25 @@ 44405+<!DOCTYPE html> 44406+<meta charset="utf-8"> 44407+<title>Check for crashes when a whenDefined promise resolving re-entries</title> 44408+<meta name="author" href="mailto:xiaochengh@chromium.org"> 44409+<link rel="help" href="https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-api"> 44410+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1366813"> 44411+<script> 44412+class CustomElement extends HTMLElement {} 44413+ 44414+Object.prototype.__defineGetter__("then", main); 44415+ 44416+let depth = 0; 44417+function main() { 44418+ if (depth > 1) return; 44419+ ++depth; 44420+ customElements.whenDefined("custom-a"); // Causes re-entry of main() 44421+ try { customElements.define("custom-a", CustomElement) } catch (e) {} 44422+ customElements.whenDefined("custom-b"); 44423+ --depth; 44424+} 44425+ 44426+main(); 44427+</script> 44428+ 44429+Test passes if it does not crash. 44430\ No newline at end of file 44431diff --git a/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/resources/sandbox-top-navigation-helper.js b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/resources/sandbox-top-navigation-helper.js 44432new file mode 100644 44433index 0000000000000..7792c26130958 44434--- /dev/null 44435+++ b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/resources/sandbox-top-navigation-helper.js 44436@@ -0,0 +1,78 @@ 44437+// To use this file, use the following imports: 44438+// // META: script=/common/dispatcher/dispatcher.js 44439+// // META: script=/common/get-host-info.sub.js 44440+// // META: script=/common/utils.js 44441+// // META: script=/resources/testdriver.js 44442+// // META: script=/resources/testdriver-vendor.js 44443+// // META: script=/resources/testharness.js 44444+// // META: script=/resources/testharnessreport.js 44445+// // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 44446+// // META: script=./resources/sandbox-top-navigation-helper.js 44447+ 44448+// Helper file that provides various functions to test top-level navigation 44449+// with various frame and sandbox flag configurations. 44450+ 44451+async function createNestedIframe(parent, origin, frame_sandbox, header_sandbox) 44452+{ 44453+ let headers = []; 44454+ if (header_sandbox) { 44455+ headers.push([ 44456+ "Content-Security-Policy", 44457+ "sandbox allow-scripts " + header_sandbox 44458+ ]); 44459+ } 44460+ let iframe_attributes = {}; 44461+ if (frame_sandbox) { 44462+ iframe_attributes.sandbox = "allow-scripts " + frame_sandbox; 44463+ } 44464+ return parent.addIframe({ 44465+ origin: origin, 44466+ scripts: [ 44467+ '/resources/testdriver.js', 44468+ '/resources/testdriver-driver.js', 44469+ '/resources/testdriver-vendor.js' 44470+ ], 44471+ headers: headers, 44472+ }, iframe_attributes); 44473+} 44474+ 44475+async function attemptTopNavigation(iframe, should_succeed) { 44476+ let did_succeed; 44477+ try { 44478+ await iframe.executeScript(() => { 44479+ window.top.location.href = "https://google.com"; 44480+ }); 44481+ did_succeed = true; 44482+ } catch (e) { 44483+ did_succeed = false; 44484+ } 44485+ 44486+ assert_equals(did_succeed, should_succeed, 44487+ should_succeed ? 44488+ "The navigation should succeed." : 44489+ "The navigation should fail."); 44490+} 44491+ 44492+async function setupTest() { 44493+ const rcHelper = new RemoteContextHelper(); 44494+ return rcHelper.addWindow(/*config=*/ null, /*options=*/ {}); 44495+} 44496+ 44497+async function activate(iframe) { 44498+ return iframe.executeScript(async () => { 44499+ let b = document.createElement("button"); 44500+ document.body.appendChild(b); 44501+ 44502+ // Since test_driver.bless() does not play nicely with the remote context 44503+ // helper, this is a workaround to trigger user activation in the iframe. 44504+ // This adds a button to the iframe and then simulates hitting the 'tab' key 44505+ // twice. Once to focus on the button, and once to trigger user activation 44506+ // in the iframe (user activation is given to the frame that has focus when 44507+ // the tab key is pressed, not the frame that ends up getting focus). Note 44508+ // that this will result in both the parent and this frame getting user 44509+ // activation. Note that this currently only works for iframes nested 1 44510+ // level deep. 44511+ test_driver.set_test_context(window.top); 44512+ return test_driver.send_keys(document.body, "\uE004\uE004"); 44513+ }); 44514+} 44515diff --git a/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-child-special-cases.tentative.sub.window.js b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-child-special-cases.tentative.sub.window.js 44516new file mode 100644 44517index 0000000000000..a9ea9e4723238 44518--- /dev/null 44519+++ b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-child-special-cases.tentative.sub.window.js 44520@@ -0,0 +1,49 @@ 44521+// META: title=Top-level navigation tests with cross origin & user activated child frames 44522+// META: script=/common/dispatcher/dispatcher.js 44523+// META: script=/common/get-host-info.sub.js 44524+// META: script=/common/utils.js 44525+// META: script=/resources/testdriver.js 44526+// META: script=/resources/testdriver-vendor.js 44527+// META: script=/resources/testharness.js 44528+// META: script=/resources/testharnessreport.js 44529+// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 44530+// META: script=./resources/sandbox-top-navigation-helper.js 44531+ 44532+'use strict'; 44533+ 44534+/* ------------------------- USER ACTIVATION TESTS ------------------------- */ 44535+ 44536+promise_test(async t => { 44537+ const main = await setupTest(); 44538+ const iframe_1 = await createNestedIframe(main, 44539+ "HTTP_ORIGIN", "allow-top-navigation-by-user-activation", ""); 44540+ await activate(iframe_1); 44541+ 44542+ await attemptTopNavigation(iframe_1, true); 44543+}, "Allow top with user activation + user activation"); 44544+ 44545+promise_test(async t => { 44546+ const main = await setupTest(); 44547+ const iframe_1 = await createNestedIframe(main, 44548+ "HTTP_ORIGIN", "allow-top-navigation-by-user-activation", ""); 44549+ 44550+ await attemptTopNavigation(iframe_1, false); 44551+}, "allow-top-navigation-by-user-activation set but no sticky activation"); 44552+ 44553+/* ---------------------- CROSS ORIGIN (A -> B) TESTS ---------------------- */ 44554+ 44555+promise_test(async t => { 44556+ const main = await setupTest(); 44557+ const iframe_1 = await createNestedIframe(main, 44558+ "HTTP_REMOTE_ORIGIN", "allow-top-navigation", ""); 44559+ 44560+ await attemptTopNavigation(iframe_1, true); 44561+}, "A cross-origin frame with frame sandbox flags can navigate top"); 44562+ 44563+promise_test(async t => { 44564+ const main = await setupTest(); 44565+ const iframe_1 = await createNestedIframe(main, 44566+ "HTTP_REMOTE_ORIGIN", "", "allow-top-navigation"); 44567+ 44568+ await attemptTopNavigation(iframe_1, false); 44569+}, "A cross-origin frame with delivered sandbox flags can not navigate top"); 44570diff --git a/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-child.tentative.sub.window.js b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-child.tentative.sub.window.js 44571new file mode 100644 44572index 0000000000000..58133456970a7 44573--- /dev/null 44574+++ b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-child.tentative.sub.window.js 44575@@ -0,0 +1,58 @@ 44576+// META: title=Top-level navigation tests with child frames 44577+// META: script=/common/dispatcher/dispatcher.js 44578+// META: script=/common/get-host-info.sub.js 44579+// META: script=/common/utils.js 44580+// META: script=/resources/testdriver.js 44581+// META: script=/resources/testdriver-vendor.js 44582+// META: script=/resources/testharness.js 44583+// META: script=/resources/testharnessreport.js 44584+// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 44585+// META: script=./resources/sandbox-top-navigation-helper.js 44586+ 44587+'use strict'; 44588+ 44589+/* ----------------------- SAME ORIGIN (A -> A) TESTS ----------------------- */ 44590+ 44591+promise_test(async t => { 44592+ const main = await setupTest(); 44593+ const iframe_1 = await createNestedIframe(main, 44594+ "HTTP_ORIGIN", "", "allow-top-navigation allow-same-origin"); 44595+ 44596+ await attemptTopNavigation(iframe_1, true); 44597+}, "A same-origin frame with delivered sandbox flags can navigate top"); 44598+ 44599+promise_test(async t => { 44600+ const main = await setupTest(); 44601+ const iframe_1 = await createNestedIframe(main, 44602+ "HTTP_ORIGIN", "allow-top-navigation allow-same-origin", ""); 44603+ 44604+ await attemptTopNavigation(iframe_1, true); 44605+}, "A same-origin frame with frame sandbox flags can navigate top"); 44606+ 44607+promise_test(async t => { 44608+ const main = await setupTest(); 44609+ const iframe_1 = await createNestedIframe(main, 44610+ "HTTP_ORIGIN", "", ""); 44611+ 44612+ await attemptTopNavigation(iframe_1, true); 44613+}, "A same-origin unsandboxed frame can navigate top"); 44614+ 44615+promise_test(async t => { 44616+ const main = await setupTest(); 44617+ const iframe_1 = await createNestedIframe(main, 44618+ "HTTP_ORIGIN", "", 44619+ "allow-top-navigation allow-top-navigation-by-user-activation allow-same-origin"); 44620+ 44621+ await attemptTopNavigation(iframe_1, true); 44622+}, "A frame with both top navigation delivered sandbox flags uses the less \ 44623+ restrictive one"); 44624+ 44625+promise_test(async t => { 44626+ const main = await setupTest(); 44627+ const iframe_1 = await createNestedIframe(main, 44628+ "HTTP_ORIGIN", 44629+ "allow-top-navigation allow-top-navigation-by-user-activation", ""); 44630+ 44631+ await attemptTopNavigation(iframe_1, true); 44632+}, "A frame with both top navigation frame sandbox flags uses the less \ 44633+ restrictive one"); 44634diff --git a/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-escalate-privileges.tentative.sub.window.js b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-escalate-privileges.tentative.sub.window.js 44635new file mode 100644 44636index 0000000000000..999f056f334db 44637--- /dev/null 44638+++ b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-escalate-privileges.tentative.sub.window.js 44639@@ -0,0 +1,65 @@ 44640+// META: title=Top-level navigation tests with frames that try to give themselves top-nav permission 44641+// META: script=/common/dispatcher/dispatcher.js 44642+// META: script=/common/get-host-info.sub.js 44643+// META: script=/common/utils.js 44644+// META: script=/resources/testdriver.js 44645+// META: script=/resources/testdriver-vendor.js 44646+// META: script=/resources/testharness.js 44647+// META: script=/resources/testharnessreport.js 44648+// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 44649+// META: script=./resources/sandbox-top-navigation-helper.js 44650+ 44651+'use strict'; 44652+ 44653+promise_test(async t => { 44654+ const main = await setupTest(); 44655+ const iframe_1 = await createNestedIframe(main, 44656+ "HTTP_REMOTE_ORIGIN", "", ""); 44657+ const iframe_2 = await createNestedIframe(iframe_1, 44658+ "HTTP_REMOTE_ORIGIN", "allow-top-navigation", ""); 44659+ 44660+ await attemptTopNavigation(iframe_2, false); 44661+}, "A cross origin unsandboxed frame can't escalate privileges in a child \ 44662+ frame"); 44663+ 44664+promise_test(async t => { 44665+ const main = await setupTest(); 44666+ const iframe_1 = await createNestedIframe(main, 44667+ "HTTP_REMOTE_ORIGIN", "allow-top-navigation", ""); 44668+ const iframe_2 = await createNestedIframe(iframe_1, 44669+ "OTHER_ORIGIN", "", ""); 44670+ 44671+ await attemptTopNavigation(iframe_2, true); 44672+}, "An unsandboxed grandchild inherits its parents ability to navigate top."); 44673+ 44674+promise_test(async t => { 44675+ const main = await setupTest(); 44676+ const iframe_1 = await createNestedIframe(main, 44677+ "HTTP_ORIGIN", "", ""); 44678+ const iframe_2 = await createNestedIframe(iframe_1, 44679+ "HTTP_ORIGIN", "allow-top-navigation", ""); 44680+ 44681+ await attemptTopNavigation(iframe_2, true); 44682+}, "A same-origin grandchild with frame allow-top can navigate top"); 44683+ 44684+promise_test(async t => { 44685+ const main = await setupTest(); 44686+ const iframe_1 = await createNestedIframe(main, 44687+ "HTTP_ORIGIN", "", ""); 44688+ const iframe_2 = await createNestedIframe(iframe_1, 44689+ "HTTP_ORIGIN", "", "allow-top-navigation"); 44690+ 44691+ await attemptTopNavigation(iframe_2, false); 44692+}, "A sandboxed same-origin grandchild without allow-same-origin can't \ 44693+ escalate its own top-nav privileges"); 44694+ 44695+promise_test(async t => { 44696+ const main = await setupTest(); 44697+ const iframe_1 = await createNestedIframe(main, 44698+ "HTTP_ORIGIN", "", ""); 44699+ const iframe_2 = await createNestedIframe(iframe_1, 44700+ "HTTP_ORIGIN", "", "allow-same-origin allow-top-navigation"); 44701+ 44702+ await attemptTopNavigation(iframe_2, true); 44703+}, "A sandboxed same-origin grandchild with allow-same-origin can \ 44704+ give itself top-nav privileges"); 44705diff --git a/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-grandchild.tentative.sub.window.js b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-grandchild.tentative.sub.window.js 44706new file mode 100644 44707index 0000000000000..519efc94e516d 44708--- /dev/null 44709+++ b/src/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-grandchild.tentative.sub.window.js 44710@@ -0,0 +1,52 @@ 44711+// META: title=Top-level navigation tests with grandchild frames 44712+// META: script=/common/dispatcher/dispatcher.js 44713+// META: script=/common/get-host-info.sub.js 44714+// META: script=/common/utils.js 44715+// META: script=/resources/testdriver.js 44716+// META: script=/resources/testdriver-vendor.js 44717+// META: script=/resources/testharness.js 44718+// META: script=/resources/testharnessreport.js 44719+// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 44720+// META: script=./resources/sandbox-top-navigation-helper.js 44721+ 44722+'use strict'; 44723+ 44724+promise_test(async t => { 44725+ const main = await setupTest(); 44726+ const iframe_1 = await createNestedIframe(main, 44727+ "HTTP_ORIGIN", "", ""); 44728+ const iframe_2 = await createNestedIframe(iframe_1, 44729+ "HTTP_ORIGIN", "allow-scripts", ""); 44730+ 44731+ await attemptTopNavigation(iframe_2, false); 44732+}, "A fully sandboxed same-origin grandchild can't navigate top"); 44733+ 44734+promise_test(async t => { 44735+ const main = await setupTest(); 44736+ const iframe_1 = await createNestedIframe(main, 44737+ "HTTP_ORIGIN", "", ""); 44738+ const iframe_2 = await createNestedIframe(iframe_1, 44739+ "HTTP_ORIGIN", "", ""); 44740+ 44741+ await attemptTopNavigation(iframe_2, true); 44742+}, "An unsandboxed same-origin grandchild can navigate top"); 44743+ 44744+promise_test(async t => { 44745+ const main = await setupTest(); 44746+ const iframe_1 = await createNestedIframe(main, 44747+ "HTTP_REMOTE_ORIGIN", "", ""); 44748+ const iframe_2 = await createNestedIframe(iframe_1, 44749+ "HTTP_ORIGIN", "", ""); 44750+ 44751+ await attemptTopNavigation(iframe_2, true); 44752+}, "A same-origin grandchild in a cross-origin parent can navigate top"); 44753+ 44754+promise_test(async t => { 44755+ const main = await setupTest(); 44756+ const iframe_1 = await createNestedIframe(main, 44757+ "HTTP_REMOTE_ORIGIN", "", ""); 44758+ const iframe_2 = await createNestedIframe(iframe_1, 44759+ "HTTP_ORIGIN", "allow-top-navigation allow-same-origin", ""); 44760+ 44761+ await attemptTopNavigation(iframe_2, true); 44762+}, "A same-origin sandboxed grandchild in a cross-origin parent can navigate top"); 44763\ No newline at end of file 44764diff --git a/src/third_party/blink/web_tests/external/wpt/html/semantics/forms/constraints/reportValidity-crash.html b/src/third_party/blink/web_tests/external/wpt/html/semantics/forms/constraints/reportValidity-crash.html 44765new file mode 100644 44766index 0000000000000..d6bab924adc9f 44767--- /dev/null 44768+++ b/src/third_party/blink/web_tests/external/wpt/html/semantics/forms/constraints/reportValidity-crash.html 44769@@ -0,0 +1,37 @@ 44770+<!DOCTYPE html> 44771+<html> 44772+ 44773+<head> 44774+<script> 44775+Object.prototype.__defineGetter__('then', prom); 44776+var prom_count = 0; 44777+function prom() { 44778+prom_count++; 44779+if (prom_count > 2) return; 44780+var v14 = x37.animate({},100); 44781+v14.reverse(); 44782+v14.ready; 44783+v14.currentTime = 0; 44784+x57.reportValidity(); 44785+} 44786+function f0() { 44787+var v38 = x37.animate({},300); 44788+v38.ready; 44789+x57.prepend(x78); 44790+} 44791+function f1() { 44792+var x57 = document.getElementById("x57"); 44793+x57.disabled = false; 44794+} 44795+</script> 44796+</head> 44797+ 44798+<body> 44799+<fieldset id="x37"> 44800+<canvas onfocusin="f0()" > 44801+<input id="x78" autofocus="" onfocusout="f1()" > 44802+</canvas> 44803+<select id="x57" disabled="" required=""></select> 44804+</body> 44805+ 44806+</html> 44807diff --git a/src/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-expected.txt b/src/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-expected.txt 44808deleted file mode 100644 44809index 7648d5e97300d..0000000000000 44810--- a/src/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-expected.txt 44811+++ /dev/null 44812@@ -1,6 +0,0 @@ 44813-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. 44814- 44815- 44816-This tests that an iframe in sandbox with 'allow-top-navigation' can't navigate the top level page if its ancestor can't. 44817- 44818-DOMAIN 44819diff --git a/src/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox-expected.txt b/src/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox-expected.txt 44820deleted file mode 100644 44821index 9d4da3a1c8422..0000000000000 44822--- a/src/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox-expected.txt 44823+++ /dev/null 44824@@ -1,6 +0,0 @@ 44825-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. 44826- 44827- 44828-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. 44829- 44830-DOMAIN 44831diff --git a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/resources/cross-iframe-that-performs-top-navigation-in-nested-sandboxed-frame.html b/src/third_party/blink/web_tests/http/tests/security/frameNavigation/resources/cross-iframe-that-performs-top-navigation-in-nested-sandboxed-frame.html 44832deleted file mode 100644 44833index 1de9f51f53a4c..0000000000000 44834--- a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/resources/cross-iframe-that-performs-top-navigation-in-nested-sandboxed-frame.html 44835+++ /dev/null 44836@@ -1,10 +0,0 @@ 44837-<html> 44838- 44839-<body> 44840- This should create a sandboxed iframe. 44841- 44842- <iframe sandbox="allow-scripts allow-top-navigation" src="cross-iframe-that-performs-top-navigation-in-sandboxed-frame.html"></iframe> 44843- The navigation should fail. This text should be visible. 44844-</body> 44845- 44846-</html> 44847diff --git a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-two-flags-expected.txt b/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-two-flags-expected.txt 44848deleted file mode 100644 44849index 9968bd11ac101..0000000000000 44850--- a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-two-flags-expected.txt 44851+++ /dev/null 44852@@ -1,3 +0,0 @@ 44853-localhost 44854- 44855-PASSED: Navigation succeeded. 44856diff --git a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-two-flags.html b/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-two-flags.html 44857deleted file mode 100644 44858index 4a497cfbcfb8a..0000000000000 44859--- a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-two-flags.html 44860+++ /dev/null 44861@@ -1,28 +0,0 @@ 44862-<html> 44863-<head> 44864- <style> 44865- iframe { width: 400px; height: 200px;} 44866- </style> 44867- <script> 44868- if (window.testRunner) { 44869- testRunner.dumpAsText(); 44870- testRunner.waitUntilDone(); 44871- } 44872- 44873- function loaded() 44874- { 44875- document.getElementsByTagName('h4')[0].innerHTML = document.domain; 44876- var iframe = document.getElementById("i"); 44877- // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates. 44878- // Because the iframe is cross-origin, it can't get the offsets itself, so leak them. 44879- frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*"); 44880- } 44881- </script> 44882-</head> 44883-<body onload="loaded();"> 44884- <p>This tests that an iframe in sandbox with both 'allow-top-navigation' and 'allow-top-navigation-by-user-activation' 44885- can navigate the top level page with a user gesture: Basically the later flag is ignored.</p> 44886- <h4>DOMAIN</h4> 44887- <iframe id="i" sandbox="allow-scripts allow-top-navigation allow-top-navigation-by-user-activation" src="resources/iframe-that-performs-parent-navigation.html"></iframe> 44888-</body> 44889-</html> 44890diff --git a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-expected.txt b/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-expected.txt 44891deleted file mode 100644 44892index 9968bd11ac101..0000000000000 44893--- a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-expected.txt 44894+++ /dev/null 44895@@ -1,3 +0,0 @@ 44896-localhost 44897- 44898-PASSED: Navigation succeeded. 44899diff --git a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture.html b/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture.html 44900deleted file mode 100644 44901index f2d93da4dc64a..0000000000000 44902--- a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture.html 44903+++ /dev/null 44904@@ -1,28 +0,0 @@ 44905-<html> 44906-<head> 44907- <style> 44908- iframe { width: 400px; height: 200px;} 44909- </style> 44910- <script> 44911- if (window.testRunner) { 44912- testRunner.dumpAsText(); 44913- testRunner.waitUntilDone(); 44914- } 44915- 44916- function loaded() 44917- { 44918- document.getElementsByTagName('h4')[0].innerHTML = document.domain; 44919- var iframe = document.getElementById("i"); 44920- // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates. 44921- // Because the iframe is cross-origin, it can't get the offsets itself, so leak them. 44922- frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*"); 44923- } 44924- </script> 44925-</head> 44926-<body onload="loaded();"> 44927- <p>This tests that an iframe in sandbox with 'allow-top-navigation-by-user-activation' 44928- can navigate the top level page, if it is trigged by a user gesture.</p> 44929- <h4>DOMAIN</h4> 44930- <iframe id="i" sandbox="allow-scripts allow-top-navigation-by-user-activation" src="resources/iframe-that-performs-parent-navigation.html"></iframe> 44931-</body> 44932-</html> 44933diff --git a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-expected.txt b/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-expected.txt 44934deleted file mode 100644 44935index 0700a107dc2e0..0000000000000 44936--- a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-expected.txt 44937+++ /dev/null 44938@@ -1,6 +0,0 @@ 44939-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. 44940- 44941- 44942-This tests that an iframe in sandbox with 'allow-top-navigation' can't navigate the top level page if its ancestor can't. 44943- 44944-DOMAIN 44945diff --git a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox-expected.txt b/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox-expected.txt 44946deleted file mode 100644 44947index e2d0b476cfa88..0000000000000 44948--- a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox-expected.txt 44949+++ /dev/null 44950@@ -1,6 +0,0 @@ 44951-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. 44952- 44953- 44954-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. 44955- 44956-DOMAIN 44957diff --git a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox.html b/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox.html 44958deleted file mode 100644 44959index 183f4c49cf825..0000000000000 44960--- a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation-nested-sandbox.html 44961+++ /dev/null 44962@@ -1,32 +0,0 @@ 44963-<html> 44964- 44965-<head> 44966- <style> 44967- iframe { 44968- width: 400px; 44969- height: 200px; 44970- } 44971- </style> 44972- <script> 44973- if (window.testRunner) { 44974- testRunner.dumpAsText(); 44975- testRunner.waitUntilDone(); 44976- } 44977- window.addEventListener("message", e => { 44978- if (e.data == "PASS") 44979- testRunner.notifyDone(); 44980- else 44981- testRunner.testFailed("'top.location' didn't throw."); 44982- }); 44983- </script> 44984-</head> 44985- 44986-<body> 44987- <p>This tests that an iframe in a nested sandbox with 'allow-top-navigation' 44988- can't navigate the top level page if its ancestor can't.</p> 44989- <h4>DOMAIN</h4> 44990- <iframe 44991- src="http://localhost:8080/security/frameNavigation/resources/cross-iframe-that-performs-top-navigation-in-nested-sandboxed-frame.html"></iframe> 44992-</body> 44993- 44994-</html> 44995diff --git a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation.html b/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation.html 44996deleted file mode 100644 44997index d174414760739..0000000000000 44998--- a/src/third_party/blink/web_tests/http/tests/security/frameNavigation/sandbox-DENIED-cross-origin-top-navigation.html 44999+++ /dev/null 45000@@ -1,32 +0,0 @@ 45001-<html> 45002- 45003-<head> 45004- <style> 45005- iframe { 45006- width: 400px; 45007- height: 200px; 45008- } 45009- </style> 45010- <script> 45011- if (window.testRunner) { 45012- testRunner.dumpAsText(); 45013- testRunner.waitUntilDone(); 45014- } 45015- window.addEventListener("message", e => { 45016- if (e.data == "PASS") 45017- testRunner.notifyDone(); 45018- else 45019- testRunner.testFailed("'top.location' didn't throw."); 45020- }); 45021- </script> 45022-</head> 45023- 45024-<body> 45025- <p>This tests that an iframe in sandbox with 'allow-top-navigation' 45026- can't navigate the top level page if its ancestor can't.</p> 45027- <h4>DOMAIN</h4> 45028- <iframe 45029- src="http://localhost:8080/security/frameNavigation/resources/cross-iframe-that-performs-top-navigation-in-sandboxed-frame.html"></iframe> 45030-</body> 45031- 45032-</html> 45033diff --git a/src/third_party/blink/web_tests/wpt_internal/fenced_frame/anchor-focus.https.html b/src/third_party/blink/web_tests/wpt_internal/fenced_frame/anchor-focus.https.html 45034new file mode 100644 45035index 0000000000000..82794d4666d21 45036--- /dev/null 45037+++ b/src/third_party/blink/web_tests/wpt_internal/fenced_frame/anchor-focus.https.html 45038@@ -0,0 +1,47 @@ 45039+<!DOCTYPE html> 45040+<title>Anchor based focusing across a fenced frame boundary</title> 45041+<script src="/resources/testdriver.js"></script> 45042+<script src="/resources/testdriver-actions.js"></script> 45043+<script src="/resources/testdriver-vendor.js"></script> 45044+<script src="/resources/testharness.js"></script> 45045+<script src="/resources/testharnessreport.js"></script> 45046+<script src="/common/utils.js"></script> 45047+<script src="/common/dispatcher/dispatcher.js"></script> 45048+<script src="resources/utils.js"></script> 45049+ 45050+<body> 45051+<script> 45052+function attemptAutofocus(frame) { 45053+ return frame.execute(async () => { 45054+ let autofocusInput = document.createElement('input'); 45055+ autofocusInput.id = "myinput"; 45056+ document.body.appendChild(autofocusInput); 45057+ document.location.href = document.location.href + "#myinput"; 45058+ await new Promise(resolve => requestAnimationFrame(resolve)); 45059+ return document.activeElement == autofocusInput; 45060+ }); 45061+} 45062+ 45063+promise_test(async () => { 45064+ const frame = attachFencedFrameContext(); 45065+ let autofocusIsFocused = await attemptAutofocus(frame); 45066+ assert_false(autofocusIsFocused, 45067+ "element should not get focus through anchor focusing"); 45068+}, "Anchor focusing is blocked on an element in a fenced frame " + 45069+ "without user activation."); 45070+ 45071+promise_test(async () => { 45072+ const frame = attachFencedFrameContext(); 45073+ const actions = new test_driver.Actions(); 45074+ await actions.pointerMove(0, 0, {origin: frame.element}) 45075+ .pointerDown() 45076+ .pointerUp() 45077+ .send(); 45078+ let autofocusIsFocused = await attemptAutofocus(frame); 45079+ assert_true(autofocusIsFocused, 45080+ "element should get focus through anchor focusing"); 45081+}, "Anchor focusing is allowed on an element in a fenced frame " + 45082+ "with user activation."); 45083+</script> 45084+</body> 45085+</html> 45086\ No newline at end of file 45087diff --git a/src/third_party/blink/web_tests/wpt_internal/fenced_frame/script-focus.https.html b/src/third_party/blink/web_tests/wpt_internal/fenced_frame/script-focus.https.html 45088new file mode 100644 45089index 0000000000000..14eae553efc1a 45090--- /dev/null 45091+++ b/src/third_party/blink/web_tests/wpt_internal/fenced_frame/script-focus.https.html 45092@@ -0,0 +1,205 @@ 45093+<!DOCTYPE html> 45094+<title>Test Script-Based Focus for Fenced Frames</title> 45095+<script src="/resources/testharness.js"></script> 45096+<script src="/resources/testharnessreport.js"></script> 45097+<script src="/resources/testdriver.js"></script> 45098+<script src="/resources/testdriver-actions.js"></script> 45099+<script src="/resources/testdriver-vendor.js"></script> 45100+<script src="/common/utils.js"></script> 45101+<script src="resources/utils.js"></script> 45102+<script src="/common/dispatcher/dispatcher.js"></script> 45103+ 45104+<script src="/common/get-host-info.sub.js"></script> 45105+ 45106+<body> 45107+<script> 45108+async function AttemptButtonFocus(frame, expecting_focus) { 45109+ await frame.execute(async (expecting_focus) => { 45110+ const button = document.createElement("button"); 45111+ document.body.append(button); 45112+ button.focus(); 45113+ assert_equals(document.activeElement == button, expecting_focus, 45114+ "Button's focus should match expected focus"); 45115+ }, [expecting_focus]); 45116+} 45117+ 45118+async function ClickOn(element, actions) { 45119+ // Wait until the window size is initialized. 45120+ while (window.innerWidth == 0) { 45121+ await new Promise(resolve => requestAnimationFrame(resolve)); 45122+ } 45123+ await actions.pointerMove(0, 0, {origin: element}) 45124+ .pointerDown() 45125+ .pointerUp() 45126+ .send(); 45127+} 45128+ 45129+async function SetupTest(click=true) { 45130+ // Clean up any leftover frames from prior tests. 45131+ document.querySelectorAll("fencedframe").forEach(e => { 45132+ e.remove(); 45133+ }) 45134+ 45135+ const actions = new test_driver.Actions(); 45136+ 45137+ const frame = attachFencedFrameContext(); 45138+ const fencedframe_element = frame.element; 45139+ 45140+ if (click) 45141+ await ClickOn(document.body, actions); 45142+ 45143+ return [actions, frame, fencedframe_element]; 45144+} 45145+ 45146+promise_test(async () => { 45147+ const [actions, ff1, ff1_element] = await SetupTest(false); 45148+ 45149+ await ClickOn(ff1_element, actions); 45150+ await AttemptButtonFocus(ff1, true); 45151+ 45152+ const button = document.createElement("button"); 45153+ document.body.append(button); 45154+ button.focus(); 45155+ assert_false(document.activeElement == button, 45156+ "The button should not have focus"); 45157+ assert_false(navigator.userActivation.isActive, 45158+ "Window should not have user activation"); 45159+}, "An embedder cannot pull focus out of a fenced frame"); 45160+ 45161+promise_test(async () => { 45162+ const [actions, frame, fencedframe_element] = await SetupTest(); 45163+ 45164+ await AttemptButtonFocus(frame, false); 45165+ await ClickOn(fencedframe_element, actions); 45166+ await AttemptButtonFocus(frame, true); 45167+}, "Fenced frames can't pull script focus until getting user activation"); 45168+ 45169+promise_test(async () => { 45170+ const [actions, frame, fencedframe_element] = await SetupTest(); 45171+ 45172+ await ClickOn(fencedframe_element, actions); 45173+ await ClickOn(document.body, actions); 45174+ 45175+ await AttemptButtonFocus(frame, true); 45176+ 45177+ // Give the browser time to receive the focus event before attempting 45178+ // another focus. 45179+ await setTimeout(async () => {await AttemptButtonFocus(frame, true);}, 20); 45180+}, "Focused fenced frames can move programmatic focus within frame"); 45181+ 45182+promise_test(async () => { 45183+ const [actions, frame, fencedframe_element] = await SetupTest(); 45184+ 45185+ await ClickOn(fencedframe_element, actions); 45186+ await ClickOn(document.body, actions); 45187+ 45188+ // This will pull focus across a frame boundary and consume user activation. 45189+ await AttemptButtonFocus(frame, true); 45190+ 45191+ await ClickOn(document.body, actions); 45192+ await AttemptButtonFocus(frame, false); 45193+}, "Script focus into a fenced frame consumes user activation"); 45194+ 45195+promise_test(async () => { 45196+ const [actions, ff1, ff1_element] = await SetupTest(); 45197+ 45198+ const ff2 = attachFencedFrameContext(); 45199+ const ff2_element = ff2.element; 45200+ 45201+ await ClickOn(ff1_element, actions); 45202+ 45203+ await AttemptButtonFocus(ff1, true); 45204+ await AttemptButtonFocus(ff2, false); 45205+}, "Another fenced frame cannot pull focus out of a focused fenced frame"); 45206+ 45207+promise_test(async () => { 45208+ const [actions, ff1, ff1_element] = await SetupTest(); 45209+ 45210+ await ClickOn(ff1_element, actions); 45211+ await AttemptButtonFocus(ff1, true); 45212+ 45213+ await ff1.execute(async () => { 45214+ const ff2 = attachFencedFrameContext(); 45215+ 45216+ await ff2.execute(async () => { 45217+ const button = document.createElement("button"); 45218+ document.body.append(button); 45219+ button.focus(); 45220+ assert_false(document.activeElement == button, 45221+ "The button should not have focus"); 45222+ assert_false(navigator.userActivation.isActive, 45223+ "The fenced frame should not have user activation"); 45224+ }); 45225+ }); 45226+}, "A fenced frame nested in another fenced frame cannot pull focus"); 45227+ 45228+promise_test(async () => { 45229+ const [actions, ff1, ff1_element] = await SetupTest(); 45230+ 45231+ await ClickOn(document.body, actions); 45232+ 45233+ const button = document.createElement("button"); 45234+ document.body.append(button); 45235+ button.focus(); 45236+ assert_equals(document.activeElement, button, 45237+ "The button in the main page should have focus."); 45238+ 45239+ await ff1.execute(async () => { 45240+ assert_false(navigator.userActivation.isActive, 45241+ "The fenced frame should not have user activation."); 45242+ window.focus(); 45243+ }); 45244+ 45245+ assert_equals(document.activeElement, button, 45246+ "The button in the main page should still have focus."); 45247+}, "A fenced frame cannot pull window.focus() without user activation"); 45248+ 45249+promise_test(async () => { 45250+ const [actions, ff1, ff1_element] = await SetupTest(); 45251+ 45252+ await ClickOn(ff1_element, actions); 45253+ await ClickOn(document.body, actions); 45254+ 45255+ const button = document.createElement("button"); 45256+ document.body.append(button); 45257+ button.focus(); 45258+ assert_equals(document.activeElement, button, 45259+ "The button should have focus."); 45260+ 45261+ await ff1.execute(async () => { 45262+ assert_true(navigator.userActivation.isActive, 45263+ "The fenced frame should have user activation."); 45264+ window.focus(); 45265+ assert_false(navigator.userActivation.isActive, 45266+ "The fenced frame's user activation should be consumed by the focus"); 45267+ }); 45268+ 45269+ assert_equals(document.activeElement, document.body, 45270+ "The main page's focus should be pulled away from the button."); 45271+}, "A fenced frame can pull window.focus() after user activation"); 45272+ 45273+promise_test(async () => { 45274+ var actions = new test_driver.Actions(); 45275+ 45276+ const frame = attachIFrameContext( 45277+ {origin: get_host_info().HTTPS_REMOTE_ORIGIN}); 45278+ const iframe_element = 45279+ document.body.getElementsByTagName('iframe')[0]; 45280+ 45281+ await frame.execute(async () => { 45282+ const button = document.createElement("button"); 45283+ document.body.append(button); 45284+ button.focus(); 45285+ assert_equals(document.activeElement, button, 45286+ "The button in the iframe should have focus."); 45287+ }, [true]); 45288+ 45289+ const button = document.createElement("button"); 45290+ document.body.append(button); 45291+ button.focus(); 45292+ assert_equals(document.activeElement, button, 45293+ "The button in the main page should have focus."); 45294+}, "An cross-origin iframe can pull focus back and forth without activation"); 45295+ 45296+</script> 45297+</body> 45298\ No newline at end of file 45299diff --git a/src/third_party/crashpad/crashpad/util/linux/ptrace_client.cc b/src/third_party/crashpad/crashpad/util/linux/ptrace_client.cc 45300index 9a34722ae2b53..d2b6638099450 45301--- a/src/third_party/crashpad/crashpad/util/linux/ptrace_client.cc 45302+++ b/src/third_party/crashpad/crashpad/util/linux/ptrace_client.cc 45303@@ -331,6 +331,11 @@ ssize_t PtraceClient::ReadUpTo(VMAddress address, size_t size, void* buffer) { 45304 return total_read; 45305 } 45306 45307+ if (static_cast<size_t>(bytes_read) > size) { 45308+ LOG(ERROR) << "invalid size " << bytes_read; 45309+ return -1; 45310+ } 45311+ 45312 if (!LoggingReadFileExactly(sock_, buffer_c, bytes_read)) { 45313 return -1; 45314 } 45315diff --git a/src/third_party/devtools-frontend/src/front_end/core/host/ResourceLoader.ts b/src/third_party/devtools-frontend/src/front_end/core/host/ResourceLoader.ts 45316index e4798d1a02a01..1623c308e2312 45317--- a/src/third_party/devtools-frontend/src/front_end/core/host/ResourceLoader.ts 45318+++ b/src/third_party/devtools-frontend/src/front_end/core/host/ResourceLoader.ts 45319@@ -105,9 +105,10 @@ export let load = function( 45320 arg0: boolean, arg1: { 45321 [x: string]: string, 45322 }, 45323- arg2: string, arg3: LoadErrorDescription) => void): void { 45324+ arg2: string, arg3: LoadErrorDescription) => void, 45325+ allowRemoteFilePaths: boolean): void { 45326 const stream = new Common.StringOutputStream.StringOutputStream(); 45327- loadAsStream(url, headers, stream, mycallback); 45328+ loadAsStream(url, headers, stream, mycallback, allowRemoteFilePaths); 45329 45330 function mycallback( 45331 success: boolean, headers: { 45332@@ -233,6 +234,15 @@ const loadXHR = (url: string): Promise<string> => { 45333 }); 45334 }; 45335 45336+function canBeRemoteFilePath(url: string): boolean { 45337+ try { 45338+ const urlObject = new URL(url); 45339+ return urlObject.protocol === 'file:' && urlObject.host !== ''; 45340+ } catch (exception) { 45341+ return false; 45342+ } 45343+} 45344+ 45345 export const loadAsStream = function( 45346 url: string, headers: { 45347 [x: string]: string, 45348@@ -242,7 +252,8 @@ export const loadAsStream = function( 45349 ((arg0: boolean, arg1: { 45350 [x: string]: string, 45351 }, 45352- arg2: LoadErrorDescription) => void)): void { 45353+ arg2: LoadErrorDescription) => void), 45354+ allowRemoteFilePaths?: boolean): void { 45355 const streamId = _bindOutputStream(stream); 45356 const parsedURL = new Common.ParsedURL.ParsedURL(url); 45357 if (parsedURL.isDataURL()) { 45358@@ -250,6 +261,19 @@ export const loadAsStream = function( 45359 return; 45360 } 45361 45362+ if (!allowRemoteFilePaths && canBeRemoteFilePath(url)) { 45363+ // Remote file paths can cause security problems, see crbug.com/1342722. 45364+ if (callback) { 45365+ callback(/* success */ false, /* headers */ {}, { 45366+ statusCode: 400, // BAD_REQUEST 45367+ netError: -20, // BLOCKED_BY_CLIENT 45368+ netErrorName: 'net::BLOCKED_BY_CLIENT', 45369+ message: 'Loading from a remote file path is prohibited for security reasons.', 45370+ }); 45371+ } 45372+ return; 45373+ } 45374+ 45375 const rawHeaders = []; 45376 if (headers) { 45377 for (const key in headers) { 45378diff --git a/src/third_party/devtools-frontend/src/front_end/core/i18n/DevToolsLocale.ts b/src/third_party/devtools-frontend/src/front_end/core/i18n/DevToolsLocale.ts 45379index ca742c9476dbe..589133b13533f 45380--- a/src/third_party/devtools-frontend/src/front_end/core/i18n/DevToolsLocale.ts 45381+++ b/src/third_party/devtools-frontend/src/front_end/core/i18n/DevToolsLocale.ts 45382@@ -55,6 +55,10 @@ export class DevToolsLocale { 45383 return devToolsLocaleInstance as DevToolsLocale; 45384 } 45385 45386+ static removeInstance(): void { 45387+ devToolsLocaleInstance = null; 45388+ } 45389+ 45390 forceFallbackLocale(): void { 45391 // Locale is 'readonly', this is the only case where we want to forceably 45392 // overwrite the locale. 45393diff --git a/src/third_party/devtools-frontend/src/front_end/core/i18n/locales/en-US.json b/src/third_party/devtools-frontend/src/front_end/core/i18n/locales/en-US.json 45394index 71fb5dab8441c..2bfc75c6aef02 45395--- a/src/third_party/devtools-frontend/src/front_end/core/i18n/locales/en-US.json 45396+++ b/src/third_party/devtools-frontend/src/front_end/core/i18n/locales/en-US.json 45397@@ -692,6 +692,9 @@ 45398 "core/sdk/sdk-meta.ts | enableNetworkRequestBlocking": { 45399 "message": "Enable network request blocking" 45400 }, 45401+ "core/sdk/sdk-meta.ts | enableRemoteFileLoading": { 45402+ "message": "Allow DevTools to load resources, such as source maps, from remote file paths. Disabled by default for security reasons." 45403+ }, 45404 "core/sdk/sdk-meta.ts | enableWebpFormat": { 45405 "message": "Enable WebP format" 45406 }, 45407diff --git a/src/third_party/devtools-frontend/src/front_end/core/i18n/locales/en-XL.json b/src/third_party/devtools-frontend/src/front_end/core/i18n/locales/en-XL.json 45408index b4cab385aae68..299cf99653c59 45409--- a/src/third_party/devtools-frontend/src/front_end/core/i18n/locales/en-XL.json 45410+++ b/src/third_party/devtools-frontend/src/front_end/core/i18n/locales/en-XL.json 45411@@ -692,6 +692,9 @@ 45412 "core/sdk/sdk-meta.ts | enableNetworkRequestBlocking": { 45413 "message": "Êńâb́l̂é n̂ét̂ẃôŕk̂ ŕêq́ûéŝt́ b̂ĺôćk̂ín̂ǵ" 45414 }, 45415+ "core/sdk/sdk-meta.ts | enableRemoteFileLoading": { 45416+ "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̂ś." 45417+ }, 45418 "core/sdk/sdk-meta.ts | enableWebpFormat": { 45419 "message": "Êńâb́l̂é WebP f̂ór̂ḿât́" 45420 }, 45421diff --git a/src/third_party/devtools-frontend/src/front_end/core/sdk/NetworkManager.ts b/src/third_party/devtools-frontend/src/front_end/core/sdk/NetworkManager.ts 45422index 51504a3685397..3313544f1201c 45423--- a/src/third_party/devtools-frontend/src/front_end/core/sdk/NetworkManager.ts 45424+++ b/src/third_party/devtools-frontend/src/front_end/core/sdk/NetworkManager.ts 45425@@ -1442,10 +1442,13 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe 45426 headers['Cache-Control'] = 'no-cache'; 45427 } 45428 45429+ const allowRemoteFilePaths = 45430+ Common.Settings.Settings.instance().moduleSetting('network.enable-remote-file-loading').get(); 45431+ 45432 return new Promise( 45433 resolve => Host.ResourceLoader.load(url, headers, (success, _responseHeaders, content, errorDescription) => { 45434 resolve({success, content, errorDescription}); 45435- })); 45436+ }, allowRemoteFilePaths)); 45437 } 45438 } 45439 45440diff --git a/src/third_party/devtools-frontend/src/front_end/core/sdk/sdk-meta.ts b/src/third_party/devtools-frontend/src/front_end/core/sdk/sdk-meta.ts 45441index 51965731f4158..1808d192246e9 45442--- a/src/third_party/devtools-frontend/src/front_end/core/sdk/sdk-meta.ts 45443+++ b/src/third_party/devtools-frontend/src/front_end/core/sdk/sdk-meta.ts 45444@@ -314,6 +314,11 @@ const UIStrings = { 45445 * emulates that the webpage is in auto dark mode. 45446 */ 45447 emulateAutoDarkMode: 'Emulate auto dark mode', 45448+ /** 45449+ * @description Label of a checkbox in the DevTools settings UI. 45450+ */ 45451+ enableRemoteFileLoading: 45452+ 'Allow `DevTools` to load resources, such as source maps, from remote file paths. Disabled by default for security reasons.', 45453 }; 45454 const str_ = i18n.i18n.registerUIStrings('core/sdk/sdk-meta.ts', UIStrings); 45455 const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_); 45456@@ -1033,3 +1038,12 @@ Common.Settings.registerSettingExtension({ 45457 storageType: Common.Settings.SettingStorageType.Session, 45458 defaultValue: false, 45459 }); 45460+ 45461+Common.Settings.registerSettingExtension({ 45462+ category: Common.Settings.SettingCategory.SOURCES, 45463+ storageType: Common.Settings.SettingStorageType.Synced, 45464+ title: i18nLazyString(UIStrings.enableRemoteFileLoading), 45465+ settingName: 'network.enable-remote-file-loading', 45466+ settingType: Common.Settings.SettingType.BOOLEAN, 45467+ defaultValue: false, 45468+}); 45469diff --git a/src/third_party/devtools-frontend/src/front_end/panels/timeline/TimelineLoader.ts b/src/third_party/devtools-frontend/src/front_end/panels/timeline/TimelineLoader.ts 45470index c00d1e4099e84..87f38defe9107 45471--- a/src/third_party/devtools-frontend/src/front_end/panels/timeline/TimelineLoader.ts 45472+++ b/src/third_party/devtools-frontend/src/front_end/panels/timeline/TimelineLoader.ts 45473@@ -79,17 +79,8 @@ export class TimelineLoader implements Common.StringOutputStream.OutputStream { 45474 45475 static loadFromEvents(events: SDK.TracingManager.EventPayload[], client: Client): TimelineLoader { 45476 const loader = new TimelineLoader(client); 45477- 45478 window.setTimeout(async () => { 45479- const eventsPerChunk = 5000; 45480- client.loadingStarted(); 45481- for (let i = 0; i < events.length; i += eventsPerChunk) { 45482- const chunk = events.slice(i, i + eventsPerChunk); 45483- (loader.tracingModel as SDK.TracingModel.TracingModel).addEvents(chunk); 45484- client.loadingProgress((i + chunk.length) / events.length); 45485- await new Promise(r => window.setTimeout(r)); // Yield event loop to paint. 45486- } 45487- void loader.close(); 45488+ void loader.addEvents(events); 45489 }); 45490 45491 return loader; 45492@@ -97,10 +88,39 @@ export class TimelineLoader implements Common.StringOutputStream.OutputStream { 45493 45494 static loadFromURL(url: string, client: Client): TimelineLoader { 45495 const loader = new TimelineLoader(client); 45496- Host.ResourceLoader.loadAsStream(url, null, loader); 45497+ const stream = new Common.StringOutputStream.StringOutputStream(); 45498+ client.loadingStarted(); 45499+ 45500+ const allowRemoteFilePaths = 45501+ Common.Settings.Settings.instance().moduleSetting('network.enable-remote-file-loading').get(); 45502+ Host.ResourceLoader.loadAsStream(url, null, stream, finishedCallback, allowRemoteFilePaths); 45503+ 45504+ function finishedCallback( 45505+ success: boolean, _headers: {[x: string]: string}, 45506+ errorDescription: Host.ResourceLoader.LoadErrorDescription): void { 45507+ if (!success) { 45508+ return loader.reportErrorAndCancelLoading(errorDescription.message); 45509+ } 45510+ const txt = stream.data(); 45511+ const events = JSON.parse(txt); 45512+ void loader.addEvents(events); 45513+ } 45514+ 45515 return loader; 45516 } 45517 45518+ async addEvents(events: SDK.TracingManager.EventPayload[]): Promise<void> { 45519+ this.client?.loadingStarted(); 45520+ const eventsPerChunk = 5000; 45521+ for (let i = 0; i < events.length; i += eventsPerChunk) { 45522+ const chunk = events.slice(i, i + eventsPerChunk); 45523+ (this.tracingModel as SDK.TracingModel.TracingModel).addEvents(chunk); 45524+ this.client?.loadingProgress((i + chunk.length) / events.length); 45525+ await new Promise(r => window.setTimeout(r)); // Yield event loop to paint. 45526+ } 45527+ void this.close(); 45528+ } 45529+ 45530 cancel(): void { 45531 this.tracingModel = null; 45532 this.backingStorage.reset(); 45533diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/core/sdk/PageResourceLoader_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/core/sdk/PageResourceLoader_test.ts 45534index 70d667decad2b..c072b3195ca08 45535--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/core/sdk/PageResourceLoader_test.ts 45536+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/core/sdk/PageResourceLoader_test.ts 45537@@ -4,9 +4,12 @@ 45538 45539 const {assert} = chai; 45540 45541-import type * as Host from '../../../../../front_end/core/host/host.js'; 45542+import * as Common from '../../../../../front_end/core/common/common.js'; 45543+import * as Host from '../../../../../front_end/core/host/host.js'; 45544 import * as SDK from '../../../../../front_end/core/sdk/sdk.js'; 45545+import * as Platform from '../../../../../front_end/core/platform/platform.js'; 45546 import type * as Protocol from '../../../../../front_end/generated/protocol.js'; 45547+import {describeWithEnvironment, describeWithLocale} from '../../helpers/EnvironmentHelpers.js'; 45548 45549 interface LoadResult { 45550 success: boolean; 45551@@ -14,7 +17,13 @@ interface LoadResult { 45552 errorDescription: Host.ResourceLoader.LoadErrorDescription; 45553 } 45554 45555-describe('PageResourceLoader', () => { 45556+const initiator = { 45557+ target: null, 45558+ frameId: '123' as Protocol.Page.FrameId, 45559+ initiatorUrl: '' 45560+}; 45561+ 45562+describeWithLocale('PageResourceLoader', () => { 45563 const loads: Array<{url: string}> = []; 45564 const load = (url: string): Promise<LoadResult> => { 45565 loads.push({url}); 45566@@ -26,8 +35,6 @@ describe('PageResourceLoader', () => { 45567 }); 45568 }; 45569 45570- const initiator = {target: null, frameId: '123' as Protocol.Page.FrameId, initiatorUrl: ''}; 45571- 45572 beforeEach(() => { 45573 loads.length = 0; 45574 }); 45575@@ -120,3 +127,85 @@ describe('PageResourceLoader', () => { 45576 assert.isTrue(resources.every(x => x.success)); 45577 }); 45578 }); 45579+ 45580+// Loading via host bindings requires the settings infra to be booted. 45581+describeWithEnvironment('PageResourceLoader', () => { 45582+ it('blocks UNC file paths with the default setting', async () => { 45583+ if (!Host.Platform.isWin()) { 45584+ return; 45585+ } 45586+ 45587+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance( 45588+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000}); 45589+ 45590+ const message = 45591+ await loader 45592+ .loadResource('file:////127.0.0.1/share/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator) 45593+ .catch(e => e.message); 45594+ 45595+ assert.include(message, 'remote file'); 45596+ }); 45597+ 45598+ it('blocks remote file paths with the default setting', async () => { 45599+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance( 45600+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000}); 45601+ 45602+ const message = 45603+ await loader.loadResource('file://host/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator) 45604+ .catch(e => e.message); 45605+ 45606+ assert.include(message, 'remote file'); 45607+ }); 45608+ 45609+ it('blocks UNC file paths with a backslash on Windows with the default setting', async () => { 45610+ if (!Host.Platform.isWin()) { 45611+ return; 45612+ } 45613+ 45614+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance( 45615+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000}); 45616+ 45617+ const message = 45618+ await loader 45619+ .loadResource('file:///\\127.0.0.1/share/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator) 45620+ .catch(e => e.message); 45621+ 45622+ assert.include(message, 'remote file'); 45623+ }); 45624+ 45625+ it('allows remote file paths with the setting enabled', async () => { 45626+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance( 45627+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000}); 45628+ sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'loadNetworkResource') 45629+ .callsFake((_url, _headers, streamId, callback) => { 45630+ Host.ResourceLoader.streamWrite(streamId, 'content of the source map'); 45631+ callback({statusCode: 200}); 45632+ }); 45633+ 45634+ Common.Settings.Settings.instance().moduleSetting('network.enable-remote-file-loading').set(true); 45635+ const response = 45636+ await loader.loadResource('file://host/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator); 45637+ 45638+ assert.strictEqual(response.content, 'content of the source map'); 45639+ }); 45640+ 45641+ it('allows UNC paths on Windows with the setting enabled', async () => { 45642+ if (!Host.Platform.isWin()) { 45643+ return; 45644+ } 45645+ 45646+ const loader = SDK.PageResourceLoader.PageResourceLoader.instance( 45647+ {forceNew: true, loadOverride: null, maxConcurrentLoads: 1, loadTimeout: 30_000}); 45648+ sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'loadNetworkResource') 45649+ .callsFake((_url, _headers, streamId, callback) => { 45650+ Host.ResourceLoader.streamWrite(streamId, 'content of the source map'); 45651+ callback({statusCode: 200}); 45652+ }); 45653+ 45654+ Common.Settings.Settings.instance().moduleSetting('network.enable-remote-file-loading').set(true); 45655+ const response = await loader.loadResource( 45656+ 'file:////127.0.0.1/share/source-map.js.map' as Platform.DevToolsPath.UrlString, initiator); 45657+ 45658+ assert.strictEqual(response.content, 'content of the source map'); 45659+ }); 45660+}); 45661diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/core/sdk/ServerTiming_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/core/sdk/ServerTiming_test.ts 45662index d3c9ca762a25e..c30c5d30a2bda 45663--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/core/sdk/ServerTiming_test.ts 45664+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/core/sdk/ServerTiming_test.ts 45665@@ -5,6 +5,7 @@ 45666 const {assert} = chai; 45667 45668 import * as SDK from '../../../../../front_end/core/sdk/sdk.js'; 45669+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js'; 45670 45671 describe('ServerTiming', () => { 45672 it('can be instantiated correctly', () => { 45673@@ -15,7 +16,7 @@ describe('ServerTiming', () => { 45674 }); 45675 }); 45676 45677-describe('SDK.ServerTiming.ServerTiming.createFromHeaderValue', () => { 45678+describeWithLocale('SDK.ServerTiming.ServerTiming.createFromHeaderValue', () => { 45679 it('parses headers correctly', () => { 45680 // A real-world-like example with some edge cases. 45681 const actual = SDK.ServerTiming.ServerTiming.createFromHeaderValue( 45682diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/helpers/EnvironmentHelpers.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/helpers/EnvironmentHelpers.ts 45683index d67800bfdd23e..940e78e39dc2a 45684--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/helpers/EnvironmentHelpers.ts 45685+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/helpers/EnvironmentHelpers.ts 45686@@ -48,25 +48,7 @@ const REGISTERED_EXPERIMENTS = [ 45687 ]; 45688 45689 export async function initializeGlobalVars({reset = true} = {}) { 45690- // Expose the locale. 45691- i18n.DevToolsLocale.DevToolsLocale.instance({ 45692- create: true, 45693- data: { 45694- navigatorLanguage: 'en-US', 45695- settingLanguage: 'en-US', 45696- lookupClosestDevToolsLocale: () => 'en-US', 45697- }, 45698- }); 45699- 45700- // Load the strings from the resource file. 45701- const locale = i18n.DevToolsLocale.DevToolsLocale.instance().locale; 45702- // proxied call. 45703- try { 45704- await i18n.i18n.fetchAndRegisterLocaleData(locale); 45705- } catch (error) { 45706- // eslint-disable-next-line no-console 45707- console.warn('EnvironmentHelper: Loading en-US locale failed', error.message); 45708- } 45709+ await initializeGlobalLocaleVars(); 45710 45711 // Create the appropriate settings needed to boot. 45712 const settings = [ 45713@@ -150,6 +132,9 @@ export async function initializeGlobalVars({reset = true} = {}) { 45714 Common.Settings.SettingCategory.APPEARANCE, 'uiTheme', 'systemPreferred', Common.Settings.SettingType.ENUM), 45715 createSettingValue( 45716 Common.Settings.SettingCategory.APPEARANCE, 'language', 'en-US', Common.Settings.SettingType.ENUM), 45717+ createSettingValue( 45718+ Common.Settings.SettingCategory.SOURCES, 'network.enable-remote-file-loading', false, 45719+ Common.Settings.SettingType.BOOLEAN), 45720 ]; 45721 45722 Common.Settings.registerSettingsForTest(settings, reset); 45723@@ -185,6 +170,7 @@ export async function deinitializeGlobalVars() { 45724 Root.Runtime.experiments.clearForTest(); 45725 45726 // Remove instances. 45727+ await deinitializeGlobalLocaleVars(); 45728 SDK.TargetManager.TargetManager.removeInstance(); 45729 Root.Runtime.Runtime.removeInstance(); 45730 Common.Settings.Settings.removeInstance(); 45731@@ -210,6 +196,40 @@ export function describeWithEnvironment(title: string, fn: (this: Mocha.Suite) = 45732 }); 45733 } 45734 45735+export async function initializeGlobalLocaleVars() { 45736+ // Expose the locale. 45737+ i18n.DevToolsLocale.DevToolsLocale.instance({ 45738+ create: true, 45739+ data: { 45740+ navigatorLanguage: 'en-US', 45741+ settingLanguage: 'en-US', 45742+ lookupClosestDevToolsLocale: () => 'en-US', 45743+ }, 45744+ }); 45745+ 45746+ // Load the strings from the resource file. 45747+ const locale = i18n.DevToolsLocale.DevToolsLocale.instance().locale; 45748+ // proxied call. 45749+ try { 45750+ await i18n.i18n.fetchAndRegisterLocaleData(locale); 45751+ } catch (error) { 45752+ // eslint-disable-next-line no-console 45753+ console.warn('EnvironmentHelper: Loading en-US locale failed', error.message); 45754+ } 45755+} 45756+ 45757+export function deinitializeGlobalLocaleVars() { 45758+ i18n.DevToolsLocale.DevToolsLocale.removeInstance(); 45759+} 45760+ 45761+export function describeWithLocale(title: string, fn: (this: Mocha.Suite) => void) { 45762+ return describe(`locale-${title}`, () => { 45763+ before(async () => await initializeGlobalLocaleVars()); 45764+ after(deinitializeGlobalLocaleVars); 45765+ describe(title, fn); 45766+ }); 45767+} 45768+ 45769 export function createFakeSetting<T>(name: string, defaultValue: T): Common.Settings.Setting<T> { 45770 const storage = new Common.Settings.SettingsStorage({}, Common.Settings.NOOP_STORAGE, 'test'); 45771 return new Common.Settings.Setting(name, defaultValue, new Common.ObjectWrapper.ObjectWrapper(), storage); 45772diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/models/har/HARWriter_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/models/har/HARWriter_test.ts 45773index 27fd0f46921f5..7c6c9a374dc3b 45774--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/models/har/HARWriter_test.ts 45775+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/models/har/HARWriter_test.ts 45776@@ -9,6 +9,7 @@ import * as SDK from '../../../../../front_end/core/sdk/sdk.js'; 45777 import * as UI from '../../../../../front_end/ui/legacy/legacy.js'; 45778 import * as HAR from '../../../../../front_end/models/har/har.js'; 45779 import type * as Protocol from '../../../../../front_end/generated/protocol.js'; 45780+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js'; 45781 45782 const simulateRequestWithStartTime = (startTime: number): SDK.NetworkRequest.NetworkRequest => { 45783 const requestId = 'r0' as Protocol.Network.RequestId; 45784@@ -18,7 +19,7 @@ const simulateRequestWithStartTime = (startTime: number): SDK.NetworkRequest.Net 45785 return request; 45786 }; 45787 45788-describe('HARWriter', () => { 45789+describeWithLocale('HARWriter', () => { 45790 it('can correctly sort exported requests logs', async () => { 45791 const req1Time = new Date(2020, 0, 3); 45792 const req2Time = new Date(2020, 1, 3); 45793diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/ServiceWorkerUpdateCycleView_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/ServiceWorkerUpdateCycleView_test.ts 45794index db346b014fa37..30aa50e1fe083 45795--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/ServiceWorkerUpdateCycleView_test.ts 45796+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/ServiceWorkerUpdateCycleView_test.ts 45797@@ -7,10 +7,11 @@ const {assert} = chai; 45798 import type * as SDKModule from '../../../../../front_end/core/sdk/sdk.js'; 45799 import * as Resources from '../../../../../front_end/panels/application/application.js'; 45800 import * as Protocol from '../../../../../front_end/generated/protocol.js'; 45801+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js'; 45802 45803 import View = Resources.ServiceWorkerUpdateCycleView; 45804 45805-describe('ServiceWorkerUpdateCycleView', () => { 45806+describeWithLocale('ServiceWorkerUpdateCycleView', () => { 45807 let versionId = 0; 45808 let SDK: typeof SDKModule; 45809 before(async () => { 45810diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/EndpointsGrid_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/EndpointsGrid_test.ts 45811index 99e9e8fb39f5e..e2f98b8e87b83 45812--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/EndpointsGrid_test.ts 45813+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/EndpointsGrid_test.ts 45814@@ -6,6 +6,7 @@ import * as ApplicationComponents from '../../../../../../front_end/panels/appli 45815 import * as DataGrid from '../../../../../../front_end/ui/components/data_grid/data_grid.js'; 45816 import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js'; 45817 import {assertShadowRoot, getElementWithinComponent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 45818+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 45819 import {getHeaderCells, getValuesOfAllBodyRows} from '../../../ui/components/DataGridHelpers.js'; 45820 45821 const {assert} = chai; 45822@@ -38,7 +39,7 @@ const getHeaderText = (cell: HTMLTableCellElement): string|null => { 45823 cell.querySelector('devtools-resources-endpoints-grid-status-header')?.shadowRoot?.textContent?.trim() || null; 45824 }; 45825 45826-describe('EndpointsGrid', async () => { 45827+describeWithLocale('EndpointsGrid', async () => { 45828 it('displays placeholder text if no data', async () => { 45829 const component = new ApplicationComponents.EndpointsGrid.EndpointsGrid(); 45830 renderElementIntoDOM(component); 45831diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/OriginTrialTreeView_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/OriginTrialTreeView_test.ts 45832index 476dd2cc7f43f..2e2e3febbee82 45833--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/OriginTrialTreeView_test.ts 45834+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/OriginTrialTreeView_test.ts 45835@@ -7,6 +7,7 @@ import * as ApplicationComponents from '../../../../../../front_end/panels/appli 45836 import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js'; 45837 import * as TreeOutline from '../../../../../../front_end/ui/components/tree_outline/tree_outline.js'; 45838 import {assertElement, assertShadowRoot, getElementWithinComponent, renderElementIntoDOM, stripLitHtmlCommentNodes} from '../../../helpers/DOMHelpers.js'; 45839+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 45840 45841 const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); 45842 45843@@ -204,7 +205,7 @@ async function waitForRenderedTreeNodeCount(shadowRoot: ShadowRoot, expectedNode 45844 }); 45845 } 45846 45847-describe('OriginTrialTreeView', () => { 45848+describeWithLocale('OriginTrialTreeView', () => { 45849 it('renders trial names as root tree nodes', async () => { 45850 const {shadowRoot} = await renderOriginTrialTreeViewTreeOutline({ 45851 trials: [ 45852diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/StackTrace_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/StackTrace_test.ts 45853index 570f29a5e451f..0256dc4c788bf 45854--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/StackTrace_test.ts 45855+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/StackTrace_test.ts 45856@@ -8,6 +8,7 @@ import * as ExpandableList from '../../../../../../front_end/ui/components/expan 45857 import * as Components from '../../../../../../front_end/ui/legacy/components/utils/utils.js'; 45858 import type * as Protocol from '../../../../../../front_end/generated/protocol.js'; 45859 import {assertElement, assertShadowRoot, dispatchClickEvent, getCleanTextContentFromElements, getElementWithinComponent, getElementsWithinComponent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 45860+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 45861 45862 const {assert} = chai; 45863 45864@@ -40,7 +41,7 @@ function mockBuildStackTraceRows( 45865 45866 const fakeScriptId = '1' as Protocol.Runtime.ScriptId; 45867 45868-describe('StackTrace', () => { 45869+describeWithLocale('StackTrace', () => { 45870 it('does not generate rows when there is no data', () => { 45871 const component = new ApplicationComponents.StackTrace.StackTrace(); 45872 const rows = component.createRowTemplates(); 45873diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/TrustTokensView_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/TrustTokensView_test.ts 45874index ecef6ea6f9186..97bbfe2bdb1be 45875--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/TrustTokensView_test.ts 45876+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/application/components/TrustTokensView_test.ts 45877@@ -8,6 +8,7 @@ import * as Coordinator from '../../../../../../front_end/ui/components/render_c 45878 import type * as Protocol from '../../../../../../front_end/generated/protocol.js'; 45879 import {assertElement, assertShadowRoot, dispatchClickEvent, getElementWithinComponent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 45880 import {getCellByIndexes, getValuesOfAllBodyRows} from '../../../ui/components/DataGridHelpers.js'; 45881+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 45882 45883 const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); 45884 45885@@ -35,7 +36,7 @@ function getInternalDataGridShadowRoot(component: ApplicationComponents.TrustTok 45886 return dataGrid.shadowRoot; 45887 } 45888 45889-describe('TrustTokensView', () => { 45890+describeWithLocale('TrustTokensView', () => { 45891 it('renders trust token data', async () => { 45892 const component = await renderTrustTokensView([ 45893 {issuerOrigin: 'foo.com', count: 42}, 45894diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/AccessibilityTreeNode_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/AccessibilityTreeNode_test.ts 45895index f677eb6e05d1a..4425fc4a8a966 45896--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/AccessibilityTreeNode_test.ts 45897+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/AccessibilityTreeNode_test.ts 45898@@ -5,10 +5,11 @@ 45899 import * as ElementsComponents from '../../../../../../front_end/panels/elements/components/components.js'; 45900 import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js'; 45901 import {assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 45902+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 45903 45904 const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); 45905 45906-describe('AccessibilityTreeNode', () => { 45907+describeWithLocale('AccessibilityTreeNode', () => { 45908 it('renders role and name correctly for unignored nodes', async () => { 45909 const component = new ElementsComponents.AccessibilityTreeNode.AccessibilityTreeNode(); 45910 renderElementIntoDOM(component); 45911diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/LayoutPane_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/LayoutPane_test.ts 45912index 6a11386234a04..11d7571a6fb80 45913--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/LayoutPane_test.ts 45914+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/LayoutPane_test.ts 45915@@ -5,10 +5,11 @@ 45916 import * as Common from '../../../../../../front_end/core/common/common.js'; 45917 import * as ElementsComponents from '../../../../../../front_end/panels/elements/components/components.js'; 45918 import {assertElement, assertShadowRoot, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 45919+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 45920 45921 const {assert} = chai; 45922 45923-describe('LayoutPane', async () => { 45924+describeWithLocale('LayoutPane', async () => { 45925 function queryLabels(component: HTMLElement, selector: string) { 45926 assertShadowRoot(component.shadowRoot); 45927 return Array.from(component.shadowRoot.querySelectorAll(selector)).map(label => { 45928diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/StylePropertyEditor_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/StylePropertyEditor_test.ts 45929index bf8b02367840e..7c37b78806923 45930--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/StylePropertyEditor_test.ts 45931+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/elements/components/StylePropertyEditor_test.ts 45932@@ -4,10 +4,11 @@ 45933 45934 import * as ElementsComponents from '../../../../../../front_end/panels/elements/components/components.js'; 45935 import {assertElement, assertShadowRoot, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 45936+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 45937 45938 const {assert} = chai; 45939 45940-describe('StylePropertyEditor', async () => { 45941+describeWithLocale('StylePropertyEditor', async () => { 45942 function assertValues(component: HTMLElement, values: string[]) { 45943 assertShadowRoot(component.shadowRoot); 45944 const propertyElements = component.shadowRoot.querySelectorAll('.property'); 45945diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/issues/GenericIssue_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/issues/GenericIssue_test.ts 45946index 17731d050b3d7..9c05056dfca7e 45947--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/issues/GenericIssue_test.ts 45948+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/issues/GenericIssue_test.ts 45949@@ -8,8 +8,9 @@ import * as IssuesManager from '../../../../../front_end/models/issues_manager/i 45950 import type * as SDK from '../../../../../front_end/core/sdk/sdk.js'; 45951 import {MockIssuesModel} from '../../models/issues_manager/MockIssuesModel.js'; 45952 import * as Protocol from '../../../../../front_end/generated/protocol.js'; 45953+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js'; 45954 45955-describe('GenericIssue', async () => { 45956+describeWithLocale('GenericIssue', async () => { 45957 const mockModel = new MockIssuesModel([]) as unknown as SDK.IssuesModel.IssuesModel; 45958 45959 function createProtocolIssueWithoutDetails(): Protocol.Audits.InspectorIssue { 45960diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/network/components/RequestTrustTokensView_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/network/components/RequestTrustTokensView_test.ts 45961index 4bad3af24c994..5818b66c1c5b3 45962--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/network/components/RequestTrustTokensView_test.ts 45963+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/network/components/RequestTrustTokensView_test.ts 45964@@ -6,10 +6,11 @@ import {assertNotNullOrUndefined} from '../../../../../../front_end/core/platfor 45965 import * as Protocol from '../../../../../../front_end/generated/protocol.js'; 45966 import * as NetworkComponents from '../../../../../../front_end/panels/network/components/components.js'; 45967 import {getElementsWithinComponent, getElementWithinComponent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 45968+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 45969 45970 const {assert} = chai; 45971 45972-describe('RequestTrustTokensView', () => { 45973+describeWithLocale('RequestTrustTokensView', () => { 45974 const mockId = 'mockId' as Protocol.Network.RequestId; 45975 45976 const renderRequestTrustTokensView = () => { 45977diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/settings/emulation/components/UserAgentClientHintsForm_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/settings/emulation/components/UserAgentClientHintsForm_test.ts 45978index 577cf7d306f9c..802270f0329d0 45979--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/settings/emulation/components/UserAgentClientHintsForm_test.ts 45980+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/settings/emulation/components/UserAgentClientHintsForm_test.ts 45981@@ -4,10 +4,11 @@ 45982 import * as EmulationComponents from '../../../../../../../front_end/panels/settings/emulation/components/components.js'; 45983 import * as Buttons from '../../../../../../../front_end/ui/components/buttons/buttons.js'; 45984 import {getElementsWithinComponent, getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../../helpers/DOMHelpers.js'; 45985+import {describeWithLocale} from '../../../../helpers/EnvironmentHelpers.js'; 45986 45987 const {assert} = chai; 45988 45989-describe('UserAgentClientHintsForm', () => { 45990+describeWithLocale('UserAgentClientHintsForm', () => { 45991 const testMetaData = { 45992 brands: [ 45993 { 45994diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/timeline/components/WebVitalsTimeline_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/timeline/components/WebVitalsTimeline_test.ts 45995index 42534f5f955ee..28a6391bf00b8 45996--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/timeline/components/WebVitalsTimeline_test.ts 45997+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/panels/timeline/components/WebVitalsTimeline_test.ts 45998@@ -3,10 +3,11 @@ 45999 // found in the LICENSE file. 46000 46001 import * as TimelineComponents from '../../../../../../front_end/panels/timeline/components/components.js'; 46002+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46003 46004 const {assert} = chai; 46005 46006-describe('WebVitalsTimeline', () => { 46007+describeWithLocale('WebVitalsTimeline', () => { 46008 it('should instantiate without problems', () => { 46009 const node = new TimelineComponents.WebVitalsTimeline.WebVitalsTimeline(); 46010 assert.instanceOf(node, TimelineComponents.WebVitalsTimeline.WebVitalsTimeline); 46011diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/ListWidget_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/ListWidget_test.ts 46012index b9ca80afdc02f..c917a10fef72d 46013--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/ListWidget_test.ts 46014+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/ListWidget_test.ts 46015@@ -5,8 +5,9 @@ 46016 const {assert} = chai; 46017 46018 import * as UI from '../../../../front_end/ui/legacy/legacy.js'; 46019+import {describeWithLocale} from '../helpers/EnvironmentHelpers.js'; 46020 46021-describe('ListWidget', () => { 46022+describeWithLocale('ListWidget', () => { 46023 it('Cancel button triggers on mouse click event', () => { 46024 const editor = new UI.ListWidget.Editor<string>(); 46025 document.body.appendChild(editor.element); 46026diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/Linkifier_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/Linkifier_test.ts 46027index a65ca46e7a867..8e26ffab83110 46028--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/Linkifier_test.ts 46029+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/Linkifier_test.ts 46030@@ -4,13 +4,14 @@ 46031 46032 import * as Linkifier from '../../../../../front_end/ui/components/linkifier/linkifier.js'; 46033 import * as Coordinator from '../../../../../front_end/ui/components/render_coordinator/render_coordinator.js'; 46034+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js'; 46035 46036 const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); 46037 46038 import {assertElement, assertShadowRoot, dispatchClickEvent, getEventPromise, renderElementIntoDOM} from '../../helpers/DOMHelpers.js'; 46039 const {assert} = chai; 46040 46041-describe('Linkifier', () => { 46042+describeWithLocale('Linkifier', () => { 46043 it('renders a link when given a URL', async () => { 46044 const component = new Linkifier.Linkifier.Linkifier(); 46045 component.data = { 46046diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/SurveyLink_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/SurveyLink_test.ts 46047index c69af412b7c14..5ebe0bb59ad57 46048--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/SurveyLink_test.ts 46049+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/SurveyLink_test.ts 46050@@ -8,6 +8,7 @@ import * as SurveyLink from '../../../../../front_end/ui/components/survey_link/ 46051 import * as Common from '../../../../../front_end/core/common/common.js'; 46052 import {assertNotNullOrUndefined} from '../../../../../front_end/core/platform/platform.js'; 46053 import {assertShadowRoot, renderElementIntoDOM} from '../../helpers/DOMHelpers.js'; 46054+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js'; 46055 46056 function canShowSuccessfulCallback(trigger: string, callback: SurveyLink.SurveyLink.CanShowSurveyCallback) { 46057 callback({canShowSurvey: true}); 46058@@ -24,7 +25,7 @@ function showFailureCallback(trigger: string, callback: SurveyLink.SurveyLink.Sh 46059 46060 const empty = Common.UIString.LocalizedEmptyString; 46061 46062-describe('SurveyLink', async () => { 46063+describeWithLocale('SurveyLink', async () => { 46064 it('shows no link when canShowSurvey is still pending', () => { 46065 const link = new SurveyLink.SurveyLink.SurveyLink(); 46066 link.data = {trigger: 'test trigger', promptText: empty, canShowSurvey: () => {}, showSurvey: () => {}}; 46067diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/diff_view/BUILD.gn b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/diff_view/BUILD.gn 46068index 583f97bcc8c3b..5e9f4b2bf187d 46069--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/diff_view/BUILD.gn 46070+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/diff_view/BUILD.gn 46071@@ -11,5 +11,6 @@ ts_library("diff_view") { 46072 deps = [ 46073 "../../../../../../front_end/third_party/diff:bundle", 46074 "../../../../../../front_end/ui/components/diff_view:bundle", 46075+ "../../../helpers", 46076 ] 46077 } 46078diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/diff_view/DiffView_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/diff_view/DiffView_test.ts 46079index 5b4f9c23d9386..8223642fbeffc 46080--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/diff_view/DiffView_test.ts 46081+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/diff_view/DiffView_test.ts 46082@@ -6,6 +6,7 @@ const {assert} = chai; 46083 46084 import * as DiffView from '../../../../../../front_end/ui/components/diff_view/diff_view.js'; 46085 import * as Diff from '../../../../../../front_end/third_party/diff/diff.js'; 46086+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46087 46088 function buildDiff(original: string, updated: string): Promise<DocumentFragment> { 46089 const diff = Diff.Diff.DiffWrapper.lineDiff(original.split('\n'), updated.split('\n')); 46090@@ -35,7 +36,7 @@ function text(elt: Node): string { 46091 return ''; 46092 } 46093 46094-describe('DiffView', () => { 46095+describeWithLocale('DiffView', () => { 46096 it('renders the proper content', async () => { 46097 const output = await simpleDiff(); 46098 const lines = Array.from(output.querySelectorAll('.diff-line-content')); 46099diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/issue_counter/IssueCounter_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/issue_counter/IssueCounter_test.ts 46100index ed74e953e3ec4..4ba96593820d1 46101--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/issue_counter/IssueCounter_test.ts 46102+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/issue_counter/IssueCounter_test.ts 46103@@ -7,6 +7,7 @@ import * as IssuesManager from '../../../../../../front_end/models/issues_manage 46104 import * as IconButton from '../../../../../../front_end/ui/components/icon_button/icon_button.js'; 46105 import * as IssueCounter from '../../../../../../front_end/ui/components/issue_counter/issue_counter.js'; 46106 import {assertElement, assertElements, assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46107+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46108 import {MockIssuesManager} from '../../../models/issues_manager/MockIssuesManager.js'; 46109 46110 const {assert} = chai; 46111@@ -50,7 +51,7 @@ export const extractButton = (shadowRoot: ShadowRoot): HTMLButtonElement => { 46112 return button; 46113 }; 46114 46115-describe('IssueCounter', () => { 46116+describeWithLocale('IssueCounter', () => { 46117 describe('with omitting zero-count issue kinds', () => { 46118 it('renders correctly', () => { 46119 const issuesManager = new MockIssuesManager([]); 46120@@ -216,7 +217,7 @@ describe('IssueCounter', () => { 46121 }); 46122 }); 46123 46124-describe('getIssueCountsEnumeration', () => { 46125+describeWithLocale('getIssueCountsEnumeration', () => { 46126 it('formats issue counts correctly', () => { 46127 const issuesManager = new MockIssuesManager([]); 46128 const string = IssueCounter.IssueCounter.getIssueCountsEnumeration( 46129diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/issue_counter/IssueLinkIcon_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/issue_counter/IssueLinkIcon_test.ts 46130index 498dfb23f694a..6e3237c1ce027 46131--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/issue_counter/IssueLinkIcon_test.ts 46132+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/issue_counter/IssueLinkIcon_test.ts 46133@@ -8,6 +8,7 @@ import * as IconButton from '../../../../../../front_end/ui/components/icon_butt 46134 import * as IssueCounter from '../../../../../../front_end/ui/components/issue_counter/issue_counter.js'; 46135 import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js'; 46136 import {assertElement, assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46137+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46138 46139 import type * as Protocol from '../../../../../../front_end/generated/protocol.js'; 46140 import * as IssuesManager from '../../../../../../front_end/models/issues_manager/issues_manager.js'; 46141@@ -92,7 +93,7 @@ class MockIssueResolver { 46142 } 46143 } 46144 46145-describe('IssueLinkIcon', () => { 46146+describeWithLocale('IssueLinkIcon', () => { 46147 const issueId = 'issue1' as Protocol.Audits.IssueId; 46148 const defaultIcon = {iconName: 'issue-questionmark-icon', color: 'var(--color-text-secondary)'}; 46149 const breakingChangeIcon = 46150diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector_test.ts 46151index f1a916cb9431e..adc899ad2a420 46152--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector_test.ts 46153+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector_test.ts 46154@@ -4,6 +4,7 @@ 46155 46156 import * as LinearMemoryInspectorModule from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js'; 46157 import {dispatchClickEvent, getElementsWithinComponent, getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46158+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46159 46160 import {NAVIGATOR_ADDRESS_SELECTOR, NAVIGATOR_HISTORY_BUTTON_SELECTOR, NAVIGATOR_PAGE_BUTTON_SELECTOR} from './LinearMemoryNavigator_test.js'; 46161 import {ENDIANNESS_SELECTOR} from './LinearMemoryValueInterpreter_test.js'; 46162@@ -16,7 +17,7 @@ const NAVIGATOR_SELECTOR = 'devtools-linear-memory-inspector-navigator'; 46163 const VIEWER_SELECTOR = 'devtools-linear-memory-inspector-viewer'; 46164 const INTERPRETER_SELECTOR = 'devtools-linear-memory-inspector-interpreter'; 46165 46166-describe('LinearMemoryInspector', () => { 46167+describeWithLocale('LinearMemoryInspector', () => { 46168 function getViewer(component: LinearMemoryInspectorModule.LinearMemoryInspector.LinearMemoryInspector) { 46169 return getElementWithinComponent( 46170 component, VIEWER_SELECTOR, LinearMemoryInspectorModule.LinearMemoryViewer.LinearMemoryViewer); 46171diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator_test.ts 46172index ff712a3c2e142..a0838fc4f4bc1 46173--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator_test.ts 46174+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator_test.ts 46175@@ -4,6 +4,7 @@ 46176 46177 import * as LinearMemoryInspector from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js'; 46178 import {assertElement, assertElements, assertShadowRoot, getElementsWithinComponent, getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46179+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46180 46181 const {assert} = chai; 46182 46183@@ -12,7 +13,7 @@ export const NAVIGATOR_PAGE_BUTTON_SELECTOR = '[data-button=pagenavigation]'; 46184 export const NAVIGATOR_HISTORY_BUTTON_SELECTOR = '[data-button=historynavigation]'; 46185 export const NAVIGATOR_REFRESH_BUTTON_SELECTOR = '[data-button=refreshrequested]'; 46186 46187-describe('LinearMemoryNavigator', () => { 46188+describeWithLocale('LinearMemoryNavigator', () => { 46189 let component: LinearMemoryInspector.LinearMemoryNavigator.LinearMemoryNavigator; 46190 46191 beforeEach(renderNavigator); 46192diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter_test.ts 46193index ad0f05f4ae589..47d086133878c 46194--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter_test.ts 46195+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter_test.ts 46196@@ -4,6 +4,7 @@ 46197 46198 import * as LinearMemoryInspector from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js'; 46199 import {getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46200+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46201 46202 const {assert} = chai; 46203 46204@@ -30,7 +31,7 @@ function clickSettingsButton( 46205 settingsButton.click(); 46206 } 46207 46208-describe('LinearMemoryValueInterpreter', () => { 46209+describeWithLocale('LinearMemoryValueInterpreter', () => { 46210 function setUpComponent() { 46211 const buffer = new Uint8Array([34, 234, 12, 3]).buffer; 46212 const component = new LinearMemoryInspector.LinearMemoryValueInterpreter.LinearMemoryValueInterpreter(); 46213diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay_test.ts 46214index 375c549d59be2..ed97e54e12a18 46215--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay_test.ts 46216+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay_test.ts 46217@@ -4,12 +4,13 @@ 46218 46219 import * as LinearMemoryInspector from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js'; 46220 import {dispatchClickEvent, getElementsWithinComponent, getElementWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46221+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46222 46223 export const DISPLAY_JUMP_TO_POINTER_BUTTON_SELECTOR = '[data-jump]'; 46224 46225 const {assert} = chai; 46226 46227-describe('ValueInterpreterDisplay', () => { 46228+describeWithLocale('ValueInterpreterDisplay', () => { 46229 const combinationsForNumbers = [ 46230 {endianness: LinearMemoryInspector.ValueInterpreterDisplayUtils.Endianness.Little, signed: true}, 46231 {endianness: LinearMemoryInspector.ValueInterpreterDisplayUtils.Endianness.Little, signed: false}, 46232diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings_test.ts 46233index c69ceb8c2e5d7..54e11960df30e 46234--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings_test.ts 46235+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings_test.ts 46236@@ -4,6 +4,7 @@ 46237 46238 import * as LinearMemoryInspector from '../../../../../../front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js'; 46239 import {assertElement, getElementsWithinComponent, getEventPromise, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46240+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46241 46242 const {assert} = chai; 46243 46244@@ -11,7 +12,7 @@ const SETTINGS_INPUT_SELECTOR = '[data-input]'; 46245 const SETTINGS_TITLE_SELECTOR = '[data-title]'; 46246 const SETTINGS_LABEL_SELECTOR = '.type-label'; 46247 46248-describe('ValueInterpreterSettings', () => { 46249+describeWithLocale('ValueInterpreterSettings', () => { 46250 function setUpComponent() { 46251 const component = new LinearMemoryInspector.ValueInterpreterSettings.ValueInterpreterSettings(); 46252 const data = { 46253diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/feedback_button_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/feedback_button_test.ts 46254index 2934702e4af4f..234794fdaff6f 46255--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/feedback_button_test.ts 46256+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/feedback_button_test.ts 46257@@ -6,10 +6,11 @@ import * as Host from '../../../../../../front_end/core/host/host.js'; 46258 import * as PanelFeedback from '../../../../../../front_end/ui/components/panel_feedback/panel_feedback.js'; 46259 import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js'; 46260 import {assertElement, assertShadowRoot, dispatchClickEvent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46261+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46262 46263 const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); 46264 46265-describe('Feedback button', () => { 46266+describeWithLocale('Feedback button', () => { 46267 it('calls out to the Host API to open the link in a new tab', async () => { 46268 const openInNewTabStub = sinon.stub(Host.InspectorFrontendHost.InspectorFrontendHostInstance, 'openInNewTab'); 46269 const component = new PanelFeedback.FeedbackButton.FeedbackButton(); 46270diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/panel_feedback_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/panel_feedback_test.ts 46271index 5c0176e4aad0f..bf4c5d66ce5d6 46272--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/panel_feedback_test.ts 46273+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/panel_feedback_test.ts 46274@@ -5,10 +5,11 @@ 46275 import * as PanelFeedback from '../../../../../../front_end/ui/components/panel_feedback/panel_feedback.js'; 46276 import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js'; 46277 import {assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46278+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46279 46280 const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); 46281 46282-describe('Panel Feedback', () => { 46283+describeWithLocale('Panel Feedback', () => { 46284 async function renderFeedbackComponent(): Promise<PanelFeedback.PanelFeedback.PanelFeedback> { 46285 const component = new PanelFeedback.PanelFeedback.PanelFeedback(); 46286 component.data = { 46287diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/preview_toggle_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/preview_toggle_test.ts 46288index 8b5038463b26d..adb40c741a21e 46289--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/preview_toggle_test.ts 46290+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/panel_feedback/preview_toggle_test.ts 46291@@ -6,10 +6,11 @@ import * as Root from '../../../../../../front_end/core/root/root.js'; 46292 import * as PanelFeedback from '../../../../../../front_end/ui/components/panel_feedback/panel_feedback.js'; 46293 import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js'; 46294 import {assertElement, assertShadowRoot, dispatchClickEvent, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46295+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46296 46297 const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance(); 46298 46299-describe('Preview toggle', () => { 46300+describeWithLocale('Preview toggle', () => { 46301 it('calls out correctly to enable experiment', async () => { 46302 const isEnabledStub = sinon.stub(Root.Runtime.experiments, 'isEnabled'); 46303 isEnabledStub.callsFake(() => false); 46304diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/request_link_icon/RequestLinkIcon_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/request_link_icon/RequestLinkIcon_test.ts 46305index 68ab1f8ccad36..7a032572abf66 46306--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/request_link_icon/RequestLinkIcon_test.ts 46307+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/components/request_link_icon/RequestLinkIcon_test.ts 46308@@ -11,6 +11,7 @@ import * as IconButton from '../../../../../../front_end/ui/components/icon_butt 46309 import {assertElement, assertShadowRoot, renderElementIntoDOM} from '../../../helpers/DOMHelpers.js'; 46310 import * as Coordinator from '../../../../../../front_end/ui/components/render_coordinator/render_coordinator.js'; 46311 import type * as Protocol from '../../../../../../front_end/generated/protocol.js'; 46312+import {describeWithLocale} from '../../../helpers/EnvironmentHelpers.js'; 46313 46314 const {assert} = chai; 46315 46316@@ -104,7 +105,7 @@ class MockRequestResolver { 46317 } 46318 } 46319 46320-describe('RequestLinkIcon', () => { 46321+describeWithLocale('RequestLinkIcon', () => { 46322 const requestId1 = 'r1' as Protocol.Network.RequestId; 46323 const requestId2 = 'r2' as Protocol.Network.RequestId; 46324 46325diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/SuggestBox_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/SuggestBox_test.ts 46326index c59fc7963de8d..91032a4043e87 46327--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/SuggestBox_test.ts 46328+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/SuggestBox_test.ts 46329@@ -3,6 +3,7 @@ 46330 // found in the LICENSE file. 46331 46332 import * as UI from '../../../../../front_end/ui/legacy/legacy.js'; 46333+import {describeWithLocale} from '../../helpers/EnvironmentHelpers.js'; 46334 46335 const {assert} = chai; 46336 46337@@ -34,7 +35,7 @@ class MockSuggestBoxDelegate implements UI.SuggestBox.SuggestBoxDelegate { 46338 46339 const createKeyEvent = (key: string) => new KeyboardEvent('keydown', {bubbles: true, cancelable: true, key}); 46340 46341-describe('SuggestBox', () => { 46342+describeWithLocale('SuggestBox', () => { 46343 let delegate: MockSuggestBoxDelegate; 46344 let div: HTMLElement; 46345 let suggestBox: UI.SuggestBox.SuggestBox; 46346diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/inline_editor/CSSVarSwatch_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/inline_editor/CSSVarSwatch_test.ts 46347index 5e46665edae83..33b8d32083f3e 46348--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/inline_editor/CSSVarSwatch_test.ts 46349+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/inline_editor/CSSVarSwatch_test.ts 46350@@ -5,6 +5,7 @@ 46351 import {assertNotNullOrUndefined} from '../../../../../../../front_end/core/platform/platform.js'; 46352 import * as InlineEditor from '../../../../../../../front_end/ui/legacy/components/inline_editor/inline_editor.js'; 46353 import {assertShadowRoot, renderElementIntoDOM} from '../../../../helpers/DOMHelpers.js'; 46354+import {describeWithLocale} from '../../../../helpers/EnvironmentHelpers.js'; 46355 46356 const {assert} = chai; 46357 46358@@ -31,7 +32,7 @@ function assertSwatch(swatch: InlineEditor.CSSVarSwatch.CSSVarSwatch, expected: 46359 assert.strictEqual(link.textContent, expected.varText, 'The link has the right text content'); 46360 } 46361 46362-describe('CSSVarSwatch', () => { 46363+describeWithLocale('CSSVarSwatch', () => { 46364 it('can be instantiated successfully', () => { 46365 const component = new InlineEditor.CSSVarSwatch.CSSVarSwatch(); 46366 renderElementIntoDOM(component); 46367diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/inline_editor/ColorSwatch_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/inline_editor/ColorSwatch_test.ts 46368index db01f257c71dc..2d60353cb2837 46369--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/inline_editor/ColorSwatch_test.ts 46370+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/inline_editor/ColorSwatch_test.ts 46371@@ -6,6 +6,7 @@ import * as Common from '../../../../../../../front_end/core/common/common.js'; 46372 import {assertNotNullOrUndefined} from '../../../../../../../front_end/core/platform/platform.js'; 46373 import * as InlineEditor from '../../../../../../../front_end/ui/legacy/components/inline_editor/inline_editor.js'; 46374 import {assertElement, assertShadowRoot, dispatchClickEvent, renderElementIntoDOM} from '../../../../helpers/DOMHelpers.js'; 46375+import {describeWithLocale} from '../../../../helpers/EnvironmentHelpers.js'; 46376 46377 const {assert} = chai; 46378 46379@@ -45,7 +46,7 @@ function getClickTarget(swatch: InlineEditor.ColorSwatch.ColorSwatch) { 46380 return swatch.shadowRoot.querySelector('.color-swatch-inner') as HTMLElement; 46381 } 46382 46383-describe('ColorSwatch', () => { 46384+describeWithLocale('ColorSwatch', () => { 46385 it('accepts colors as text', () => { 46386 const swatch = createSwatch('red'); 46387 46388diff --git a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/perf_ui/PieChart_test.ts b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/perf_ui/PieChart_test.ts 46389index aac10c6ecc8b8..5604dcd6d1917 46390--- a/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/perf_ui/PieChart_test.ts 46391+++ b/src/third_party/devtools-frontend/src/test/unittests/front_end/ui/legacy/components/perf_ui/PieChart_test.ts 46392@@ -5,6 +5,7 @@ 46393 import {assertNotNullOrUndefined} from '../../../../../../../front_end/core/platform/platform.js'; 46394 import * as PerfUI from '../../../../../../../front_end/ui/legacy/components/perf_ui/perf_ui.js'; 46395 import {assertShadowRoot, renderElementIntoDOM} from '../../../../helpers/DOMHelpers.js'; 46396+import {describeWithLocale} from '../../../../helpers/EnvironmentHelpers.js'; 46397 46398 const {assert} = chai; 46399 46400@@ -26,7 +27,7 @@ const testChartNoLegendData = { 46401 slices: [{value: 75, color: 'crimson', title: 'Filling'}, {value: 25, color: 'burlywood', title: 'Crust'}], 46402 }; 46403 46404-describe('PieChart', () => { 46405+describeWithLocale('PieChart', () => { 46406 describe('with legend', () => { 46407 it('is labelled by the chart name', () => { 46408 const chart = new PerfUI.PieChart.PieChart(); 46409diff --git a/src/third_party/icu/BUILD.gn b/src/third_party/icu/BUILD.gn 46410index daf8b97df5346..482e5b7db65c5 46411--- a/src/third_party/icu/BUILD.gn 46412+++ b/src/third_party/icu/BUILD.gn 46413@@ -364,7 +364,7 @@ if (is_android && enable_java_templates) { 46414 } 46415 } 46416 46417-if (is_android) { 46418+if (is_android || is_ohos) { 46419 # Use android_small for now to keep the size till we decide to switch to the new one. 46420 data_dir = "android_small" 46421 } else if (is_ios) { 46422diff --git a/src/third_party/libphonenumber/BUILD.gn b/src/third_party/libphonenumber/BUILD.gn 46423index 3386fcafbb5ba..7d492055be972 46424--- a/src/third_party/libphonenumber/BUILD.gn 46425+++ b/src/third_party/libphonenumber/BUILD.gn 46426@@ -2,6 +2,7 @@ 46427 # Use of this source code is governed by a BSD-style license that can be 46428 # found in the LICENSE file. 46429 46430+import("//testing/libfuzzer/fuzzer_test.gni") 46431 import("//testing/test.gni") 46432 import("//third_party/protobuf/proto_library.gni") 46433 46434@@ -116,3 +117,16 @@ test("libphonenumber_unittests") { 46435 "//third_party/icu", 46436 ] 46437 } 46438+ 46439+fuzzer_test("libphonenumber_fuzzer") { 46440+ sources = [ "libphonenumber_fuzzer.cc" ] 46441+ deps = [ 46442+ ":libphonenumber", 46443+ "//third_party/abseil-cpp:absl", 46444+ ] 46445+} 46446+ 46447+fuzzer_test("charntorune_fuzzer") { 46448+ sources = [ "charntorune_fuzzer.cc" ] 46449+ deps = [ ":libphonenumber" ] 46450+} 46451diff --git a/src/third_party/libphonenumber/README.chromium b/src/third_party/libphonenumber/README.chromium 46452index e50686688b07f..c4a4e2c789f92 46453--- a/src/third_party/libphonenumber/README.chromium 46454+++ b/src/third_party/libphonenumber/README.chromium 46455@@ -19,6 +19,8 @@ Additional files, not in the original library: 46456 BUILD.gn 46457 README.chromium 46458 LICENSE # Taken from https://github.com/googlei18n/libphonenumber/ 46459+ charntorune_fuzzer.cc 46460+ libphonenumber_fuzzer.cc 46461 phonenumber_api.h 46462 46463 The library is mapped through the DEPS file into the Chromium sources root 46464diff --git a/src/third_party/libphonenumber/charntorune_fuzzer.cc b/src/third_party/libphonenumber/charntorune_fuzzer.cc 46465new file mode 100644 46466index 0000000000000..82a6d8a2b86b6 46467--- /dev/null 46468+++ b/src/third_party/libphonenumber/charntorune_fuzzer.cc 46469@@ -0,0 +1,15 @@ 46470+// Copyright 2022 The Chromium Authors 46471+// Use of this source code is governed by a BSD-style license that can be 46472+// found in the LICENSE file. 46473+ 46474+#include <string> 46475+ 46476+#include <fuzzer/FuzzedDataProvider.h> 46477+ 46478+#include "third_party/libphonenumber/dist/cpp/src/phonenumbers/utf/utf.h" 46479+ 46480+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 46481+ Rune rune; 46482+ charntorune(&rune, reinterpret_cast<const char*>(data), size); 46483+ return 0; 46484+} 46485\ No newline at end of file 46486diff --git a/src/third_party/libphonenumber/libphonenumber_fuzzer.cc b/src/third_party/libphonenumber/libphonenumber_fuzzer.cc 46487new file mode 100644 46488index 0000000000000..7fc0391a921bb 46489--- /dev/null 46490+++ b/src/third_party/libphonenumber/libphonenumber_fuzzer.cc 46491@@ -0,0 +1,22 @@ 46492+// Copyright 2022 The Chromium Authors 46493+// Use of this source code is governed by a BSD-style license that can be 46494+// found in the LICENSE file. 46495+ 46496+#include <string> 46497+ 46498+#include <fuzzer/FuzzedDataProvider.h> 46499+ 46500+#include "third_party/libphonenumber/phonenumber_api.h" 46501+ 46502+using ::i18n::phonenumbers::PhoneNumber; 46503+using ::i18n::phonenumbers::PhoneNumberUtil; 46504+ 46505+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 46506+ std::string input(reinterpret_cast<const char*>(data), size); 46507+ 46508+ PhoneNumber parsed_number; 46509+ PhoneNumberUtil* phone_number_util = PhoneNumberUtil::GetInstance(); 46510+ phone_number_util->Parse(input, "US", &parsed_number); 46511+ 46512+ return 0; 46513+} 46514\ No newline at end of file 46515diff --git a/src/third_party/skia/include/gpu/GrDirectContext.h b/src/third_party/skia/include/gpu/GrDirectContext.h 46516index 4ff25b0f5f34d..f67049a915df1 46517--- a/src/third_party/skia/include/gpu/GrDirectContext.h 46518+++ b/src/third_party/skia/include/gpu/GrDirectContext.h 46519@@ -143,6 +143,9 @@ public: 46520 * The typical use case for this function is that the underlying 3D context was lost and further 46521 * API calls may crash. 46522 * 46523+ * This call is not valid to be made inside ReleaseProcs passed into SkSurface or SkImages. The 46524+ * call will simply fail (and assert in debug) if it is called while inside a ReleaseProc. 46525+ * 46526 * For Vulkan, even if the device becomes lost, the VkQueue, VkDevice, or VkInstance used to 46527 * create the context must be kept alive even after abandoning the context. Those objects must 46528 * live for the lifetime of the context object itself. The reason for this is so that 46529@@ -860,6 +863,12 @@ private: 46530 std::unique_ptr<GrResourceCache> fResourceCache; 46531 std::unique_ptr<GrResourceProvider> fResourceProvider; 46532 46533+ // This is incremented before we start calling ReleaseProcs from GrSurfaces and decremented 46534+ // after. A ReleaseProc may trigger code causing another resource to get freed so we to track 46535+ // the count to know if we in a ReleaseProc at any level. When this is set to a value greated 46536+ // than zero we will not allow abandonContext calls to be made on the context. 46537+ int fInsideReleaseProcCnt = 0; 46538+ 46539 bool fDidTestPMConversions; 46540 // true if the PM/UPM conversion succeeded; false otherwise 46541 bool fPMUPMConversionsRoundTrip; 46542diff --git a/src/third_party/skia/src/gpu/GrDirectContext.cpp b/src/third_party/skia/src/gpu/GrDirectContext.cpp 46543index 20cb3e24947e0..c386e203d38db 46544--- a/src/third_party/skia/src/gpu/GrDirectContext.cpp 46545+++ b/src/third_party/skia/src/gpu/GrDirectContext.cpp 46546@@ -126,6 +126,12 @@ void GrDirectContext::abandonContext() { 46547 return; 46548 } 46549 46550+ if (fInsideReleaseProcCnt) { 46551+ SkDEBUGFAIL("Calling GrDirectContext::abandonContext() while inside a ReleaseProc is not " 46552+ "allowed"); 46553+ return; 46554+ } 46555+ 46556 INHERITED::abandonContext(); 46557 46558 // We need to make sure all work is finished on the gpu before we start releasing resources. 46559@@ -142,9 +148,6 @@ void GrDirectContext::abandonContext() { 46560 46561 fGpu->disconnect(GrGpu::DisconnectType::kAbandon); 46562 46563- // Must be after GrResourceCache::abandonAll(). 46564- fMappedBufferManager.reset(); 46565- 46566 if (fSmallPathAtlasMgr) { 46567 fSmallPathAtlasMgr->reset(); 46568 } 46569diff --git a/src/third_party/skia/src/gpu/GrFinishCallbacks.cpp b/src/third_party/skia/src/gpu/GrFinishCallbacks.cpp 46570index 4c0abf9d3badf..9391d6e635707 46571--- a/src/third_party/skia/src/gpu/GrFinishCallbacks.cpp 46572+++ b/src/third_party/skia/src/gpu/GrFinishCallbacks.cpp 46573@@ -35,10 +35,16 @@ void GrFinishCallbacks::check() { 46574 46575 void GrFinishCallbacks::callAll(bool doDelete) { 46576 while (!fCallbacks.empty()) { 46577- fCallbacks.front().fCallback(fCallbacks.front().fContext); 46578+ // While we are processing a proc we need to make sure to remove it from 46579+ // the callback list before calling it. This is because the client could 46580+ // trigger a call (e.g. calling flushAndSubmit(/*sync=*/true)) that has 46581+ // us process the finished callbacks. We also must process deleting the 46582+ // fence before a client may abandon the context. 46583+ auto finishCallback = fCallbacks.front(); 46584 if (doDelete) { 46585- fGpu->deleteFence(fCallbacks.front().fFence); 46586+ fGpu->deleteFence(finishCallback.fFence); 46587 } 46588 fCallbacks.pop_front(); 46589+ finishCallback.fCallback(finishCallback.fContext); 46590 } 46591 } 46592diff --git a/src/third_party/skia/tests/GrFinishedFlushTest.cpp b/src/third_party/skia/tests/GrFinishedFlushTest.cpp 46593index 481c06d2bb53f..49e2e0ae6889f 46594--- a/src/third_party/skia/tests/GrFinishedFlushTest.cpp 46595+++ b/src/third_party/skia/tests/GrFinishedFlushTest.cpp 46596@@ -9,10 +9,12 @@ 46597 46598 #include <chrono> 46599 #include "include/core/SkCanvas.h" 46600+#include "include/core/SkColorSpace.h" 46601 #include "include/core/SkSurface.h" 46602 #include "include/gpu/GrDirectContext.h" 46603 #include "src/gpu/GrDirectContextPriv.h" 46604 #include "src/gpu/GrGpu.h" 46605+#include "tools/gpu/ManagedBackendTexture.h" 46606 46607 using namespace sk_gpu_test; 46608 46609@@ -140,3 +142,71 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FlushFinishedProcTest, reporter, ctxInfo) { 46610 REPORTER_ASSERT(reporter, count == count2); 46611 } 46612 46613+ 46614+static void abandon_context(void* context) { 46615+ ((GrDirectContext*)context)->abandonContext(); 46616+} 46617+ 46618+static void async_callback(void* c, std::unique_ptr<const SkImage::AsyncReadResult> result) { 46619+ // We don't actually care about the results so just drop them without doing anything. 46620+}; 46621+ 46622+// This test checks that calls to the async read pixels callback can safely be made even if the 46623+// context has been abandoned previously. Specifically there was a bug where the client buffer 46624+// manager stored on the GrDirectContext was accessed in the async callback after it was deleted. 46625+// This bug is detected on ASAN bots running non GL backends (GL isn't affected purely based on 46626+// how we call finish callbacks during abandon). 46627+DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(FinishedAsyncProcWhenAbandonedTest, 46628+ reporter, 46629+ ctxInfo, 46630+ CtsEnforcement::kApiLevel_T) { 46631+ auto dContext = ctxInfo.directContext(); 46632+ 46633+ SkImageInfo info = 46634+ SkImageInfo::Make(8, 8, kRGBA_8888_SkColorType, kPremul_SkAlphaType); 46635+ 46636+ auto mbet = sk_gpu_test::ManagedBackendTexture::MakeFromInfo(dContext, 46637+ info, 46638+ GrMipmapped::kNo, 46639+ GrRenderable::kYes); 46640+ if (!mbet) { 46641+ return; 46642+ } 46643+ 46644+ auto surface = SkSurface::MakeFromBackendTexture( 46645+ dContext, 46646+ mbet->texture(), 46647+ kTopLeft_GrSurfaceOrigin, 46648+ /*sample count*/ 1, 46649+ kRGBA_8888_SkColorType, 46650+ /*color space*/ nullptr, 46651+ /*surface props*/ nullptr, 46652+ sk_gpu_test::ManagedBackendTexture::ReleaseProc, 46653+ mbet->releaseContext(nullptr, nullptr)); 46654+ 46655+ if (!surface) { 46656+ return; 46657+ } 46658+ SkCanvas* canvas = surface->getCanvas(); 46659+ canvas->clear(SK_ColorGREEN); 46660+ 46661+ // To trigger bug we must have a finish callback that abanonds the context before an asyc 46662+ // read callbck on the same command buffer. So we add the abandon callback first and flush 46663+ // then add the asyc to enforce this order. 46664+ GrFlushInfo flushInfo; 46665+ flushInfo.fFinishedProc = abandon_context; 46666+ flushInfo.fFinishedContext = dContext; 46667+ 46668+ dContext->flush(flushInfo); 46669+ 46670+ surface->asyncRescaleAndReadPixels(info, 46671+ SkIRect::MakeWH(8, 8), 46672+ SkImage::RescaleGamma::kSrc, 46673+ SkImage::RescaleMode::kNearest, 46674+ async_callback, 46675+ nullptr); 46676+ 46677+ surface.reset(); 46678+ 46679+ dContext->flushAndSubmit(/*syncCpu=*/true); 46680+} 46681diff --git a/src/third_party/sqlite/README.chromium b/src/third_party/sqlite/README.chromium 46682index c98407ee85395..27cd78288c865 46683--- a/src/third_party/sqlite/README.chromium 46684+++ b/src/third_party/sqlite/README.chromium 46685@@ -1,7 +1,7 @@ 46686 Name: sqlite 46687 URL: https://sqlite.org/ 46688-Version: 3.39.2 46689-CPEPrefix: cpe:/a:sqlite:sqlite:3.39.2 46690+Version: 3.39.4 46691+CPEPrefix: cpe:/a:sqlite:sqlite:3.39.4 46692 Included In Release: Yes 46693 Security Critical: Yes 46694 License: Public domain 46695diff --git a/src/third_party/sqlite/src/VERSION b/src/third_party/sqlite/src/VERSION 46696index 5f7b534c95969..bd5311787509b 46697--- a/src/third_party/sqlite/src/VERSION 46698+++ b/src/third_party/sqlite/src/VERSION 46699@@ -1 +1 @@ 46700-3.39.2 46701+3.39.4 46702diff --git a/src/third_party/sqlite/src/amalgamation/sqlite3.c b/src/third_party/sqlite/src/amalgamation/sqlite3.c 46703index d9b7b77905a46..f69ab3b421eea 46704--- a/src/third_party/sqlite/src/amalgamation/sqlite3.c 46705+++ b/src/third_party/sqlite/src/amalgamation/sqlite3.c 46706@@ -1,6 +1,6 @@ 46707 /****************************************************************************** 46708 ** This file is an amalgamation of many separate C source files from SQLite 46709-** version 3.39.2. By combining all the individual C code files into this 46710+** version 3.39.4. By combining all the individual C code files into this 46711 ** single large file, the entire code can be compiled as a single translation 46712 ** unit. This allows many compilers to do optimizations that would not be 46713 ** possible if the files were compiled separately. Performance improvements 46714@@ -452,9 +452,9 @@ extern "C" { 46715 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 46716 ** [sqlite_version()] and [sqlite_source_id()]. 46717 */ 46718-#define SQLITE_VERSION "3.39.2" 46719-#define SQLITE_VERSION_NUMBER 3039002 46720-#define SQLITE_SOURCE_ID "2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603" 46721+#define SQLITE_VERSION "3.39.4" 46722+#define SQLITE_VERSION_NUMBER 3039004 46723+#define SQLITE_SOURCE_ID "2022-09-29 15:55:41 a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309" 46724 46725 /* 46726 ** CAPI3REF: Run-Time Library Version Numbers 46727@@ -13144,6 +13144,11 @@ struct fts5_api { 46728 /************** End of sqlite3.h *********************************************/ 46729 /************** Continuing where we left off in sqliteInt.h ******************/ 46730 46731+/* 46732+** Reuse the STATIC_LRU for mutex access to sqlite3_temp_directory. 46733+*/ 46734+#define SQLITE_MUTEX_STATIC_TEMPDIR SQLITE_MUTEX_STATIC_VFS1 46735+ 46736 /* 46737 ** Include the configuration header output by 'configure' if we're using the 46738 ** autoconf-based build 46739@@ -29550,8 +29555,13 @@ SQLITE_PRIVATE void *sqlite3OomFault(sqlite3 *db){ 46740 } 46741 DisableLookaside; 46742 if( db->pParse ){ 46743+ Parse *pParse; 46744 sqlite3ErrorMsg(db->pParse, "out of memory"); 46745 db->pParse->rc = SQLITE_NOMEM_BKPT; 46746+ for(pParse=db->pParse->pOuterParse; pParse; pParse = pParse->pOuterParse){ 46747+ pParse->nErr++; 46748+ pParse->rc = SQLITE_NOMEM; 46749+ } 46750 } 46751 } 46752 return 0; 46753@@ -33446,7 +33456,7 @@ SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){ 46754 va_list ap; 46755 sqlite3 *db = pParse->db; 46756 assert( db!=0 ); 46757- assert( db->pParse==pParse ); 46758+ assert( db->pParse==pParse || db->pParse->pToplevel==pParse ); 46759 db->errByteOffset = -2; 46760 va_start(ap, zFormat); 46761 zMsg = sqlite3VMPrintf(db, zFormat, ap); 46762@@ -41307,6 +41317,7 @@ static const char *unixTempFileDir(void){ 46763 static int unixGetTempname(int nBuf, char *zBuf){ 46764 const char *zDir; 46765 int iLimit = 0; 46766+ int rc = SQLITE_OK; 46767 46768 /* It's odd to simulate an io-error here, but really this is just 46769 ** using the io-error infrastructure to test that SQLite handles this 46770@@ -41315,18 +41326,26 @@ static int unixGetTempname(int nBuf, char *zBuf){ 46771 zBuf[0] = 0; 46772 SimulateIOError( return SQLITE_IOERR ); 46773 46774+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 46775 zDir = unixTempFileDir(); 46776- if( zDir==0 ) return SQLITE_IOERR_GETTEMPPATH; 46777- do{ 46778- u64 r; 46779- sqlite3_randomness(sizeof(r), &r); 46780- assert( nBuf>2 ); 46781- zBuf[nBuf-2] = 0; 46782- sqlite3_snprintf(nBuf, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX"%llx%c", 46783- zDir, r, 0); 46784- if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ) return SQLITE_ERROR; 46785- }while( osAccess(zBuf,0)==0 ); 46786- return SQLITE_OK; 46787+ if( zDir==0 ){ 46788+ rc = SQLITE_IOERR_GETTEMPPATH; 46789+ }else{ 46790+ do{ 46791+ u64 r; 46792+ sqlite3_randomness(sizeof(r), &r); 46793+ assert( nBuf>2 ); 46794+ zBuf[nBuf-2] = 0; 46795+ sqlite3_snprintf(nBuf, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX"%llx%c", 46796+ zDir, r, 0); 46797+ if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ){ 46798+ rc = SQLITE_ERROR; 46799+ break; 46800+ } 46801+ }while( osAccess(zBuf,0)==0 ); 46802+ } 46803+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 46804+ return rc; 46805 } 46806 46807 #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) 46808@@ -45465,10 +45484,12 @@ SQLITE_API int sqlite3_win32_set_directory8( 46809 const char *zValue /* New value for directory being set or reset */ 46810 ){ 46811 char **ppDirectory = 0; 46812+ int rc; 46813 #ifndef SQLITE_OMIT_AUTOINIT 46814- int rc = sqlite3_initialize(); 46815+ rc = sqlite3_initialize(); 46816 if( rc ) return rc; 46817 #endif 46818+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 46819 if( type==SQLITE_WIN32_DATA_DIRECTORY_TYPE ){ 46820 ppDirectory = &sqlite3_data_directory; 46821 }else if( type==SQLITE_WIN32_TEMP_DIRECTORY_TYPE ){ 46822@@ -45483,14 +45504,19 @@ SQLITE_API int sqlite3_win32_set_directory8( 46823 if( zValue && zValue[0] ){ 46824 zCopy = sqlite3_mprintf("%s", zValue); 46825 if ( zCopy==0 ){ 46826- return SQLITE_NOMEM_BKPT; 46827+ rc = SQLITE_NOMEM_BKPT; 46828+ goto set_directory8_done; 46829 } 46830 } 46831 sqlite3_free(*ppDirectory); 46832 *ppDirectory = zCopy; 46833- return SQLITE_OK; 46834+ rc = SQLITE_OK; 46835+ }else{ 46836+ rc = SQLITE_ERROR; 46837 } 46838- return SQLITE_ERROR; 46839+set_directory8_done: 46840+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 46841+ return rc; 46842 } 46843 46844 /* 46845@@ -48264,6 +48290,18 @@ static int winMakeEndInDirSep(int nBuf, char *zBuf){ 46846 return 0; 46847 } 46848 46849+/* 46850+** If sqlite3_temp_directory is not, take the mutex and return true. 46851+** 46852+** If sqlite3_temp_directory is NULL, omit the mutex and return false. 46853+*/ 46854+static int winTempDirDefined(void){ 46855+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 46856+ if( sqlite3_temp_directory!=0 ) return 1; 46857+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 46858+ return 0; 46859+} 46860+ 46861 /* 46862 ** Create a temporary file name and store the resulting pointer into pzBuf. 46863 ** The pointer returned in pzBuf must be freed via sqlite3_free(). 46864@@ -48300,20 +48338,23 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){ 46865 */ 46866 nDir = nMax - (nPre + 15); 46867 assert( nDir>0 ); 46868- if( sqlite3_temp_directory ){ 46869+ if( winTempDirDefined() ){ 46870 int nDirLen = sqlite3Strlen30(sqlite3_temp_directory); 46871 if( nDirLen>0 ){ 46872 if( !winIsDirSep(sqlite3_temp_directory[nDirLen-1]) ){ 46873 nDirLen++; 46874 } 46875 if( nDirLen>nDir ){ 46876+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 46877 sqlite3_free(zBuf); 46878 OSTRACE(("TEMP-FILENAME rc=SQLITE_ERROR\n")); 46879 return winLogError(SQLITE_ERROR, 0, "winGetTempname1", 0); 46880 } 46881 sqlite3_snprintf(nMax, zBuf, "%s", sqlite3_temp_directory); 46882 } 46883+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 46884 } 46885+ 46886 #if defined(__CYGWIN__) 46887 else{ 46888 static const char *azDirs[] = { 46889@@ -49102,7 +49143,7 @@ static BOOL winIsVerbatimPathname( 46890 ** pathname into zOut[]. zOut[] will be at least pVfs->mxPathname 46891 ** bytes in size. 46892 */ 46893-static int winFullPathname( 46894+static int winFullPathnameNoMutex( 46895 sqlite3_vfs *pVfs, /* Pointer to vfs object */ 46896 const char *zRelative, /* Possibly relative input path */ 46897 int nFull, /* Size of output buffer in bytes */ 46898@@ -49281,6 +49322,19 @@ static int winFullPathname( 46899 } 46900 #endif 46901 } 46902+static int winFullPathname( 46903+ sqlite3_vfs *pVfs, /* Pointer to vfs object */ 46904+ const char *zRelative, /* Possibly relative input path */ 46905+ int nFull, /* Size of output buffer in bytes */ 46906+ char *zFull /* Output buffer */ 46907+){ 46908+ int rc; 46909+ sqlite3_mutex *pMutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR); 46910+ sqlite3_mutex_enter(pMutex); 46911+ rc = winFullPathnameNoMutex(pVfs, zRelative, nFull, zFull); 46912+ sqlite3_mutex_leave(pMutex); 46913+ return rc; 46914+} 46915 46916 #ifndef SQLITE_OMIT_LOAD_EXTENSION 46917 /* 46918@@ -51625,14 +51679,24 @@ SQLITE_PRIVATE void sqlite3PcacheClearSyncFlags(PCache *pCache){ 46919 */ 46920 SQLITE_PRIVATE void sqlite3PcacheMove(PgHdr *p, Pgno newPgno){ 46921 PCache *pCache = p->pCache; 46922+ sqlite3_pcache_page *pOther; 46923 assert( p->nRef>0 ); 46924 assert( newPgno>0 ); 46925 assert( sqlite3PcachePageSanity(p) ); 46926 pcacheTrace(("%p.MOVE %d -> %d\n",pCache,p->pgno,newPgno)); 46927+ pOther = sqlite3GlobalConfig.pcache2.xFetch(pCache->pCache, newPgno, 0); 46928+ if( pOther ){ 46929+ PgHdr *pXPage = (PgHdr*)pOther->pExtra; 46930+ assert( pXPage->nRef==0 ); 46931+ pXPage->nRef++; 46932+ pCache->nRefSum++; 46933+ sqlite3PcacheDrop(pXPage); 46934+ } 46935 sqlite3GlobalConfig.pcache2.xRekey(pCache->pCache, p->pPage, p->pgno,newPgno); 46936 p->pgno = newPgno; 46937 if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){ 46938 pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT); 46939+ assert( sqlite3PcachePageSanity(p) ); 46940 } 46941 } 46942 46943@@ -53014,23 +53078,26 @@ static void pcache1Rekey( 46944 PCache1 *pCache = (PCache1 *)p; 46945 PgHdr1 *pPage = (PgHdr1 *)pPg; 46946 PgHdr1 **pp; 46947- unsigned int h; 46948+ unsigned int hOld, hNew; 46949 assert( pPage->iKey==iOld ); 46950 assert( pPage->pCache==pCache ); 46951+ assert( iOld!=iNew ); /* The page number really is changing */ 46952 46953 pcache1EnterMutex(pCache->pGroup); 46954 46955- h = iOld%pCache->nHash; 46956- pp = &pCache->apHash[h]; 46957+ assert( pcache1FetchNoMutex(p, iOld, 0)==pPage ); /* pPg really is iOld */ 46958+ hOld = iOld%pCache->nHash; 46959+ pp = &pCache->apHash[hOld]; 46960 while( (*pp)!=pPage ){ 46961 pp = &(*pp)->pNext; 46962 } 46963 *pp = pPage->pNext; 46964 46965- h = iNew%pCache->nHash; 46966+ assert( pcache1FetchNoMutex(p, iNew, 0)==0 ); /* iNew not in cache */ 46967+ hNew = iNew%pCache->nHash; 46968 pPage->iKey = iNew; 46969- pPage->pNext = pCache->apHash[h]; 46970- pCache->apHash[h] = pPage; 46971+ pPage->pNext = pCache->apHash[hNew]; 46972+ pCache->apHash[hNew] = pPage; 46973 if( iNew>pCache->iMaxKey ){ 46974 pCache->iMaxKey = iNew; 46975 } 46976@@ -59663,6 +59730,7 @@ static int pager_open_journal(Pager *pPager){ 46977 if( rc!=SQLITE_OK ){ 46978 sqlite3BitvecDestroy(pPager->pInJournal); 46979 pPager->pInJournal = 0; 46980+ pPager->journalOff = 0; 46981 }else{ 46982 assert( pPager->eState==PAGER_WRITER_LOCKED ); 46983 pPager->eState = PAGER_WRITER_CACHEMOD; 46984@@ -61218,7 +61286,7 @@ SQLITE_PRIVATE int sqlite3PagerGetJournalMode(Pager *pPager){ 46985 SQLITE_PRIVATE int sqlite3PagerOkToChangeJournalMode(Pager *pPager){ 46986 assert( assert_pager_state(pPager) ); 46987 if( pPager->eState>=PAGER_WRITER_CACHEMOD ) return 0; 46988- if( NEVER(isOpen(pPager->jfd) && pPager->journalOff>0) ) return 0; 46989+ if( isOpen(pPager->jfd) && pPager->journalOff>0 ) return 0; 46990 return 1; 46991 } 46992 46993@@ -68333,7 +68401,7 @@ static int defragmentPage(MemPage *pPage, int nMaxFrag){ 46994 if( iFree2+sz2 > usableSize ) return SQLITE_CORRUPT_PAGE(pPage); 46995 memmove(&data[iFree+sz+sz2], &data[iFree+sz], iFree2-(iFree+sz)); 46996 sz += sz2; 46997- }else if( NEVER(iFree+sz>usableSize) ){ 46998+ }else if( iFree+sz>usableSize ){ 46999 return SQLITE_CORRUPT_PAGE(pPage); 47000 } 47001 47002@@ -74689,8 +74757,6 @@ static int balance_nonroot( 47003 Pgno pgno; /* Temp var to store a page number in */ 47004 u8 abDone[NB+2]; /* True after i'th new page is populated */ 47005 Pgno aPgno[NB+2]; /* Page numbers of new pages before shuffling */ 47006- Pgno aPgOrder[NB+2]; /* Copy of aPgno[] used for sorting pages */ 47007- u16 aPgFlags[NB+2]; /* flags field of new pages before shuffling */ 47008 CellArray b; /* Parsed information on cells being balanced */ 47009 47010 memset(abDone, 0, sizeof(abDone)); 47011@@ -75114,42 +75180,39 @@ static int balance_nonroot( 47012 ** of the table is closer to a linear scan through the file. That in turn 47013 ** helps the operating system to deliver pages from the disk more rapidly. 47014 ** 47015- ** An O(n^2) insertion sort algorithm is used, but since n is never more 47016- ** than (NB+2) (a small constant), that should not be a problem. 47017+ ** An O(N*N) sort algorithm is used, but since N is never more than NB+2 47018+ ** (5), that is not a performance concern. 47019 ** 47020 ** When NB==3, this one optimization makes the database about 25% faster 47021 ** for large insertions and deletions. 47022 */ 47023 for(i=0; i<nNew; i++){ 47024- aPgOrder[i] = aPgno[i] = apNew[i]->pgno; 47025- aPgFlags[i] = apNew[i]->pDbPage->flags; 47026- for(j=0; j<i; j++){ 47027- if( NEVER(aPgno[j]==aPgno[i]) ){ 47028- /* This branch is taken if the set of sibling pages somehow contains 47029- ** duplicate entries. This can happen if the database is corrupt. 47030- ** It would be simpler to detect this as part of the loop below, but 47031- ** we do the detection here in order to avoid populating the pager 47032- ** cache with two separate objects associated with the same 47033- ** page number. */ 47034- assert( CORRUPT_DB ); 47035- rc = SQLITE_CORRUPT_BKPT; 47036- goto balance_cleanup; 47037- } 47038- } 47039+ aPgno[i] = apNew[i]->pgno; 47040+ assert( apNew[i]->pDbPage->flags & PGHDR_WRITEABLE ); 47041+ assert( apNew[i]->pDbPage->flags & PGHDR_DIRTY ); 47042 } 47043- for(i=0; i<nNew; i++){ 47044- int iBest = 0; /* aPgno[] index of page number to use */ 47045- for(j=1; j<nNew; j++){ 47046- if( aPgOrder[j]<aPgOrder[iBest] ) iBest = j; 47047+ for(i=0; i<nNew-1; i++){ 47048+ int iB = i; 47049+ for(j=i+1; j<nNew; j++){ 47050+ if( apNew[j]->pgno < apNew[iB]->pgno ) iB = j; 47051 } 47052- pgno = aPgOrder[iBest]; 47053- aPgOrder[iBest] = 0xffffffff; 47054- if( iBest!=i ){ 47055- if( iBest>i ){ 47056- sqlite3PagerRekey(apNew[iBest]->pDbPage, pBt->nPage+iBest+1, 0); 47057- } 47058- sqlite3PagerRekey(apNew[i]->pDbPage, pgno, aPgFlags[iBest]); 47059- apNew[i]->pgno = pgno; 47060+ 47061+ /* If apNew[i] has a page number that is bigger than any of the 47062+ ** subsequence apNew[i] entries, then swap apNew[i] with the subsequent 47063+ ** entry that has the smallest page number (which we know to be 47064+ ** entry apNew[iB]). 47065+ */ 47066+ if( iB!=i ){ 47067+ Pgno pgnoA = apNew[i]->pgno; 47068+ Pgno pgnoB = apNew[iB]->pgno; 47069+ Pgno pgnoTemp = (PENDING_BYTE/pBt->pageSize)+1; 47070+ u16 fgA = apNew[i]->pDbPage->flags; 47071+ u16 fgB = apNew[iB]->pDbPage->flags; 47072+ sqlite3PagerRekey(apNew[i]->pDbPage, pgnoTemp, fgB); 47073+ sqlite3PagerRekey(apNew[iB]->pDbPage, pgnoA, fgA); 47074+ sqlite3PagerRekey(apNew[i]->pDbPage, pgnoB, fgB); 47075+ apNew[i]->pgno = pgnoB; 47076+ apNew[iB]->pgno = pgnoA; 47077 } 47078 } 47079 47080@@ -81022,6 +81085,7 @@ SQLITE_PRIVATE int sqlite3VdbeAddFunctionCall( 47081 addr = sqlite3VdbeAddOp4(v, eCallCtx ? OP_PureFunc : OP_Function, 47082 p1, p2, p3, (char*)pCtx, P4_FUNCCTX); 47083 sqlite3VdbeChangeP5(v, eCallCtx & NC_SelfRef); 47084+ sqlite3MayAbort(pParse); 47085 return addr; 47086 } 47087 47088@@ -81357,6 +81421,7 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){ 47089 || opcode==OP_VDestroy 47090 || opcode==OP_VCreate 47091 || opcode==OP_ParseSchema 47092+ || opcode==OP_Function || opcode==OP_PureFunc 47093 || ((opcode==OP_Halt || opcode==OP_HaltIfNull) 47094 && ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort)) 47095 ){ 47096@@ -132691,6 +132756,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47097 ** 47098 */ 47099 case PragTyp_TEMP_STORE_DIRECTORY: { 47100+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47101 if( !zRight ){ 47102 returnSingleText(v, sqlite3_temp_directory); 47103 }else{ 47104@@ -132700,6 +132766,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47105 rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); 47106 if( rc!=SQLITE_OK || res==0 ){ 47107 sqlite3ErrorMsg(pParse, "not a writable directory"); 47108+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47109 goto pragma_out; 47110 } 47111 } 47112@@ -132717,6 +132784,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47113 } 47114 #endif /* SQLITE_OMIT_WSD */ 47115 } 47116+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47117 break; 47118 } 47119 47120@@ -132735,6 +132803,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47121 ** 47122 */ 47123 case PragTyp_DATA_STORE_DIRECTORY: { 47124+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47125 if( !zRight ){ 47126 returnSingleText(v, sqlite3_data_directory); 47127 }else{ 47128@@ -132744,6 +132813,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47129 rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); 47130 if( rc!=SQLITE_OK || res==0 ){ 47131 sqlite3ErrorMsg(pParse, "not a writable directory"); 47132+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47133 goto pragma_out; 47134 } 47135 } 47136@@ -132755,6 +132825,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47137 } 47138 #endif /* SQLITE_OMIT_WSD */ 47139 } 47140+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47141 break; 47142 } 47143 #endif 47144@@ -137200,7 +137271,7 @@ static void generateSortTail( 47145 if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce); 47146 addr = 1 + sqlite3VdbeAddOp2(v, OP_SorterSort, iTab, addrBreak); 47147 VdbeCoverage(v); 47148- codeOffset(v, p->iOffset, addrContinue); 47149+ assert( p->iLimit==0 && p->iOffset==0 ); 47150 sqlite3VdbeAddOp3(v, OP_SorterData, iTab, regSortOut, iSortTab); 47151 bSeq = 0; 47152 }else{ 47153@@ -137208,6 +137279,9 @@ static void generateSortTail( 47154 codeOffset(v, p->iOffset, addrContinue); 47155 iSortTab = iTab; 47156 bSeq = 1; 47157+ if( p->iOffset>0 ){ 47158+ sqlite3VdbeAddOp2(v, OP_AddImm, p->iLimit, -1); 47159+ } 47160 } 47161 for(i=0, iCol=nKey+bSeq-1; i<nColumn; i++){ 47162 #ifdef SQLITE_ENABLE_SORTER_REFERENCES 47163@@ -139200,10 +139274,11 @@ static int multiSelectOrderBy( 47164 */ 47165 sqlite3VdbeResolveLabel(v, labelEnd); 47166 47167- /* Reassembly the compound query so that it will be freed correctly 47168+ /* Reassemble the compound query so that it will be freed correctly 47169 ** by the calling function */ 47170 if( pSplit->pPrior ){ 47171- sqlite3SelectDelete(db, pSplit->pPrior); 47172+ sqlite3ParserAddCleanup(pParse, 47173+ (void(*)(sqlite3*,void*))sqlite3SelectDelete, pSplit->pPrior); 47174 } 47175 pSplit->pPrior = pPrior; 47176 pPrior->pNext = pSplit; 47177@@ -140722,6 +140797,7 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){ 47178 || p->pSrc->nSrc!=1 47179 || p->pSrc->a[0].pSelect 47180 || pAggInfo->nFunc!=1 47181+ || p->pHaving 47182 ){ 47183 return 0; 47184 } 47185@@ -143959,6 +144035,23 @@ SQLITE_PRIVATE void sqlite3FinishTrigger( 47186 Vdbe *v; 47187 char *z; 47188 47189+ /* If this is a new CREATE TABLE statement, and if shadow tables 47190+ ** are read-only, and the trigger makes a change to a shadow table, 47191+ ** then raise an error - do not allow the trigger to be created. */ 47192+ if( sqlite3ReadOnlyShadowTables(db) ){ 47193+ TriggerStep *pStep; 47194+ for(pStep=pTrig->step_list; pStep; pStep=pStep->pNext){ 47195+ if( pStep->zTarget!=0 47196+ && sqlite3ShadowTableName(db, pStep->zTarget) 47197+ ){ 47198+ sqlite3ErrorMsg(pParse, 47199+ "trigger \"%s\" may not write to shadow table \"%s\"", 47200+ pTrig->zName, pStep->zTarget); 47201+ goto triggerfinish_cleanup; 47202+ } 47203+ } 47204+ } 47205+ 47206 /* Make an entry in the sqlite_schema table */ 47207 v = sqlite3GetVdbe(pParse); 47208 if( v==0 ) goto triggerfinish_cleanup; 47209@@ -176420,7 +176513,7 @@ struct Fts3MultiSegReader { 47210 int nAdvance; /* How many seg-readers to advance */ 47211 Fts3SegFilter *pFilter; /* Pointer to filter object */ 47212 char *aBuffer; /* Buffer to merge doclists in */ 47213- int nBuffer; /* Allocated size of aBuffer[] in bytes */ 47214+ i64 nBuffer; /* Allocated size of aBuffer[] in bytes */ 47215 47216 int iColFilter; /* If >=0, filter for this column */ 47217 int bRestart; 47218@@ -179116,7 +179209,7 @@ static int fts3TermSelectMerge( 47219 ** 47220 ** Similar padding is added in the fts3DoclistOrMerge() function. 47221 */ 47222- pTS->aaOutput[0] = sqlite3_malloc(nDoclist + FTS3_VARINT_MAX + 1); 47223+ pTS->aaOutput[0] = sqlite3_malloc64((i64)nDoclist + FTS3_VARINT_MAX + 1); 47224 pTS->anOutput[0] = nDoclist; 47225 if( pTS->aaOutput[0] ){ 47226 memcpy(pTS->aaOutput[0], aDoclist, nDoclist); 47227@@ -180604,7 +180697,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ 47228 nDistance = iPrev - nMaxUndeferred; 47229 } 47230 47231- aOut = (char *)sqlite3_malloc(nPoslist+8); 47232+ aOut = (char *)sqlite3Fts3MallocZero(nPoslist+FTS3_BUFFER_PADDING); 47233 if( !aOut ){ 47234 sqlite3_free(aPoslist); 47235 return SQLITE_NOMEM; 47236@@ -180973,7 +181066,7 @@ static int fts3EvalIncrPhraseNext( 47237 if( bEof==0 ){ 47238 int nList = 0; 47239 int nByte = a[p->nToken-1].nList; 47240- char *aDoclist = sqlite3_malloc(nByte+FTS3_BUFFER_PADDING); 47241+ char *aDoclist = sqlite3_malloc64((i64)nByte+FTS3_BUFFER_PADDING); 47242 if( !aDoclist ) return SQLITE_NOMEM; 47243 memcpy(aDoclist, a[p->nToken-1].pList, nByte+1); 47244 memset(&aDoclist[nByte], 0, FTS3_BUFFER_PADDING); 47245@@ -185209,7 +185302,7 @@ static int porterNext( 47246 if( n>c->nAllocated ){ 47247 char *pNew; 47248 c->nAllocated = n+20; 47249- pNew = sqlite3_realloc(c->zToken, c->nAllocated); 47250+ pNew = sqlite3_realloc64(c->zToken, c->nAllocated); 47251 if( !pNew ) return SQLITE_NOMEM; 47252 c->zToken = pNew; 47253 } 47254@@ -185961,7 +186054,7 @@ static int simpleNext( 47255 if( n>c->nTokenAllocated ){ 47256 char *pNew; 47257 c->nTokenAllocated = n+20; 47258- pNew = sqlite3_realloc(c->pToken, c->nTokenAllocated); 47259+ pNew = sqlite3_realloc64(c->pToken, c->nTokenAllocated); 47260 if( !pNew ) return SQLITE_NOMEM; 47261 c->pToken = pNew; 47262 } 47263@@ -187123,7 +187216,7 @@ static int fts3PendingListAppendVarint( 47264 47265 /* Allocate or grow the PendingList as required. */ 47266 if( !p ){ 47267- p = sqlite3_malloc(sizeof(*p) + 100); 47268+ p = sqlite3_malloc64(sizeof(*p) + 100); 47269 if( !p ){ 47270 return SQLITE_NOMEM; 47271 } 47272@@ -187132,14 +187225,14 @@ static int fts3PendingListAppendVarint( 47273 p->nData = 0; 47274 } 47275 else if( p->nData+FTS3_VARINT_MAX+1>p->nSpace ){ 47276- int nNew = p->nSpace * 2; 47277- p = sqlite3_realloc(p, sizeof(*p) + nNew); 47278+ i64 nNew = p->nSpace * 2; 47279+ p = sqlite3_realloc64(p, sizeof(*p) + nNew); 47280 if( !p ){ 47281 sqlite3_free(*pp); 47282 *pp = 0; 47283 return SQLITE_NOMEM; 47284 } 47285- p->nSpace = nNew; 47286+ p->nSpace = (int)nNew; 47287 p->aData = (char *)&p[1]; 47288 } 47289 47290@@ -187696,7 +187789,7 @@ SQLITE_PRIVATE int sqlite3Fts3ReadBlock( 47291 int nByte = sqlite3_blob_bytes(p->pSegments); 47292 *pnBlob = nByte; 47293 if( paBlob ){ 47294- char *aByte = sqlite3_malloc(nByte + FTS3_NODE_PADDING); 47295+ char *aByte = sqlite3_malloc64((i64)nByte + FTS3_NODE_PADDING); 47296 if( !aByte ){ 47297 rc = SQLITE_NOMEM; 47298 }else{ 47299@@ -187813,7 +187906,7 @@ static int fts3SegReaderNext( 47300 int nTerm = fts3HashKeysize(pElem); 47301 if( (nTerm+1)>pReader->nTermAlloc ){ 47302 sqlite3_free(pReader->zTerm); 47303- pReader->zTerm = (char*)sqlite3_malloc((nTerm+1)*2); 47304+ pReader->zTerm = (char*)sqlite3_malloc64(((i64)nTerm+1)*2); 47305 if( !pReader->zTerm ) return SQLITE_NOMEM; 47306 pReader->nTermAlloc = (nTerm+1)*2; 47307 } 47308@@ -187821,7 +187914,7 @@ static int fts3SegReaderNext( 47309 pReader->zTerm[nTerm] = '\0'; 47310 pReader->nTerm = nTerm; 47311 47312- aCopy = (char*)sqlite3_malloc(nCopy); 47313+ aCopy = (char*)sqlite3_malloc64(nCopy); 47314 if( !aCopy ) return SQLITE_NOMEM; 47315 memcpy(aCopy, pList->aData, nCopy); 47316 pReader->nNode = pReader->nDoclist = nCopy; 47317@@ -188108,7 +188201,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderNew( 47318 nExtra = nRoot + FTS3_NODE_PADDING; 47319 } 47320 47321- pReader = (Fts3SegReader *)sqlite3_malloc(sizeof(Fts3SegReader) + nExtra); 47322+ pReader = (Fts3SegReader *)sqlite3_malloc64(sizeof(Fts3SegReader) + nExtra); 47323 if( !pReader ){ 47324 return SQLITE_NOMEM; 47325 } 47326@@ -188200,7 +188293,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderPending( 47327 if( nElem==nAlloc ){ 47328 Fts3HashElem **aElem2; 47329 nAlloc += 16; 47330- aElem2 = (Fts3HashElem **)sqlite3_realloc( 47331+ aElem2 = (Fts3HashElem **)sqlite3_realloc64( 47332 aElem, nAlloc*sizeof(Fts3HashElem *) 47333 ); 47334 if( !aElem2 ){ 47335@@ -188534,7 +188627,7 @@ static int fts3NodeAddTerm( 47336 ** this is not expected to be a serious problem. 47337 */ 47338 assert( pTree->aData==(char *)&pTree[1] ); 47339- pTree->aData = (char *)sqlite3_malloc(nReq); 47340+ pTree->aData = (char *)sqlite3_malloc64(nReq); 47341 if( !pTree->aData ){ 47342 return SQLITE_NOMEM; 47343 } 47344@@ -188552,7 +188645,7 @@ static int fts3NodeAddTerm( 47345 47346 if( isCopyTerm ){ 47347 if( pTree->nMalloc<nTerm ){ 47348- char *zNew = sqlite3_realloc(pTree->zMalloc, nTerm*2); 47349+ char *zNew = sqlite3_realloc64(pTree->zMalloc, (i64)nTerm*2); 47350 if( !zNew ){ 47351 return SQLITE_NOMEM; 47352 } 47353@@ -188578,7 +188671,7 @@ static int fts3NodeAddTerm( 47354 ** now. Instead, the term is inserted into the parent of pTree. If pTree 47355 ** has no parent, one is created here. 47356 */ 47357- pNew = (SegmentNode *)sqlite3_malloc(sizeof(SegmentNode) + p->nNodeSize); 47358+ pNew = (SegmentNode *)sqlite3_malloc64(sizeof(SegmentNode) + p->nNodeSize); 47359 if( !pNew ){ 47360 return SQLITE_NOMEM; 47361 } 47362@@ -188716,7 +188809,7 @@ static int fts3SegWriterAdd( 47363 ){ 47364 int nPrefix; /* Size of term prefix in bytes */ 47365 int nSuffix; /* Size of term suffix in bytes */ 47366- int nReq; /* Number of bytes required on leaf page */ 47367+ i64 nReq; /* Number of bytes required on leaf page */ 47368 int nData; 47369 SegmentWriter *pWriter = *ppWriter; 47370 47371@@ -188725,13 +188818,13 @@ static int fts3SegWriterAdd( 47372 sqlite3_stmt *pStmt; 47373 47374 /* Allocate the SegmentWriter structure */ 47375- pWriter = (SegmentWriter *)sqlite3_malloc(sizeof(SegmentWriter)); 47376+ pWriter = (SegmentWriter *)sqlite3_malloc64(sizeof(SegmentWriter)); 47377 if( !pWriter ) return SQLITE_NOMEM; 47378 memset(pWriter, 0, sizeof(SegmentWriter)); 47379 *ppWriter = pWriter; 47380 47381 /* Allocate a buffer in which to accumulate data */ 47382- pWriter->aData = (char *)sqlite3_malloc(p->nNodeSize); 47383+ pWriter->aData = (char *)sqlite3_malloc64(p->nNodeSize); 47384 if( !pWriter->aData ) return SQLITE_NOMEM; 47385 pWriter->nSize = p->nNodeSize; 47386 47387@@ -188806,7 +188899,7 @@ static int fts3SegWriterAdd( 47388 ** the buffer to make it large enough. 47389 */ 47390 if( nReq>pWriter->nSize ){ 47391- char *aNew = sqlite3_realloc(pWriter->aData, nReq); 47392+ char *aNew = sqlite3_realloc64(pWriter->aData, nReq); 47393 if( !aNew ) return SQLITE_NOMEM; 47394 pWriter->aData = aNew; 47395 pWriter->nSize = nReq; 47396@@ -188831,7 +188924,7 @@ static int fts3SegWriterAdd( 47397 */ 47398 if( isCopyTerm ){ 47399 if( nTerm>pWriter->nMalloc ){ 47400- char *zNew = sqlite3_realloc(pWriter->zMalloc, nTerm*2); 47401+ char *zNew = sqlite3_realloc64(pWriter->zMalloc, (i64)nTerm*2); 47402 if( !zNew ){ 47403 return SQLITE_NOMEM; 47404 } 47405@@ -189139,12 +189232,12 @@ static void fts3ColumnFilter( 47406 static int fts3MsrBufferData( 47407 Fts3MultiSegReader *pMsr, /* Multi-segment-reader handle */ 47408 char *pList, 47409- int nList 47410+ i64 nList 47411 ){ 47412 if( nList>pMsr->nBuffer ){ 47413 char *pNew; 47414 pMsr->nBuffer = nList*2; 47415- pNew = (char *)sqlite3_realloc(pMsr->aBuffer, pMsr->nBuffer); 47416+ pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, pMsr->nBuffer); 47417 if( !pNew ) return SQLITE_NOMEM; 47418 pMsr->aBuffer = pNew; 47419 } 47420@@ -189200,7 +189293,7 @@ SQLITE_PRIVATE int sqlite3Fts3MsrIncrNext( 47421 fts3SegReaderSort(pMsr->apSegment, nMerge, j, xCmp); 47422 47423 if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){ 47424- rc = fts3MsrBufferData(pMsr, pList, nList+1); 47425+ rc = fts3MsrBufferData(pMsr, pList, (i64)nList+1); 47426 if( rc!=SQLITE_OK ) return rc; 47427 assert( (pMsr->aBuffer[nList] & 0xFE)==0x00 ); 47428 pList = pMsr->aBuffer; 47429@@ -189337,11 +189430,11 @@ SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr){ 47430 return SQLITE_OK; 47431 } 47432 47433-static int fts3GrowSegReaderBuffer(Fts3MultiSegReader *pCsr, int nReq){ 47434+static int fts3GrowSegReaderBuffer(Fts3MultiSegReader *pCsr, i64 nReq){ 47435 if( nReq>pCsr->nBuffer ){ 47436 char *aNew; 47437 pCsr->nBuffer = nReq*2; 47438- aNew = sqlite3_realloc(pCsr->aBuffer, pCsr->nBuffer); 47439+ aNew = sqlite3_realloc64(pCsr->aBuffer, pCsr->nBuffer); 47440 if( !aNew ){ 47441 return SQLITE_NOMEM; 47442 } 47443@@ -189432,7 +189525,8 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( 47444 ){ 47445 pCsr->nDoclist = apSegment[0]->nDoclist; 47446 if( fts3SegReaderIsPending(apSegment[0]) ){ 47447- rc = fts3MsrBufferData(pCsr, apSegment[0]->aDoclist, pCsr->nDoclist); 47448+ rc = fts3MsrBufferData(pCsr, apSegment[0]->aDoclist, 47449+ (i64)pCsr->nDoclist); 47450 pCsr->aDoclist = pCsr->aBuffer; 47451 }else{ 47452 pCsr->aDoclist = apSegment[0]->aDoclist; 47453@@ -189485,7 +189579,8 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( 47454 47455 nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0); 47456 47457- rc = fts3GrowSegReaderBuffer(pCsr, nByte+nDoclist+FTS3_NODE_PADDING); 47458+ rc = fts3GrowSegReaderBuffer(pCsr, 47459+ (i64)nByte+nDoclist+FTS3_NODE_PADDING); 47460 if( rc ) return rc; 47461 47462 if( isFirst ){ 47463@@ -189511,7 +189606,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( 47464 fts3SegReaderSort(apSegment, nMerge, j, xCmp); 47465 } 47466 if( nDoclist>0 ){ 47467- rc = fts3GrowSegReaderBuffer(pCsr, nDoclist+FTS3_NODE_PADDING); 47468+ rc = fts3GrowSegReaderBuffer(pCsr, (i64)nDoclist+FTS3_NODE_PADDING); 47469 if( rc ) return rc; 47470 memset(&pCsr->aBuffer[nDoclist], 0, FTS3_NODE_PADDING); 47471 pCsr->aDoclist = pCsr->aBuffer; 47472@@ -190224,7 +190319,7 @@ struct NodeReader { 47473 static void blobGrowBuffer(Blob *pBlob, int nMin, int *pRc){ 47474 if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){ 47475 int nAlloc = nMin; 47476- char *a = (char *)sqlite3_realloc(pBlob->a, nAlloc); 47477+ char *a = (char *)sqlite3_realloc64(pBlob->a, nAlloc); 47478 if( a ){ 47479 pBlob->nAlloc = nAlloc; 47480 pBlob->a = a; 47481@@ -191021,7 +191116,7 @@ static int fts3RepackSegdirLevel( 47482 if( nIdx>=nAlloc ){ 47483 int *aNew; 47484 nAlloc += 16; 47485- aNew = sqlite3_realloc(aIdx, nAlloc*sizeof(int)); 47486+ aNew = sqlite3_realloc64(aIdx, nAlloc*sizeof(int)); 47487 if( !aNew ){ 47488 rc = SQLITE_NOMEM; 47489 break; 47490@@ -191395,7 +191490,7 @@ SQLITE_PRIVATE int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ 47491 47492 /* Allocate space for the cursor, filter and writer objects */ 47493 const int nAlloc = sizeof(*pCsr) + sizeof(*pFilter) + sizeof(*pWriter); 47494- pWriter = (IncrmergeWriter *)sqlite3_malloc(nAlloc); 47495+ pWriter = (IncrmergeWriter *)sqlite3_malloc64(nAlloc); 47496 if( !pWriter ) return SQLITE_NOMEM; 47497 pFilter = (Fts3SegFilter *)&pWriter[1]; 47498 pCsr = (Fts3MultiSegReader *)&pFilter[1]; 47499@@ -192031,7 +192126,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferredTokenList( 47500 return SQLITE_OK; 47501 } 47502 47503- pRet = (char *)sqlite3_malloc(p->pList->nData); 47504+ pRet = (char *)sqlite3_malloc64(p->pList->nData); 47505 if( !pRet ) return SQLITE_NOMEM; 47506 47507 nSkip = sqlite3Fts3GetVarint(p->pList->aData, &dummy); 47508@@ -192051,7 +192146,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferToken( 47509 int iCol /* Column that token must appear in (or -1) */ 47510 ){ 47511 Fts3DeferredToken *pDeferred; 47512- pDeferred = sqlite3_malloc(sizeof(*pDeferred)); 47513+ pDeferred = sqlite3_malloc64(sizeof(*pDeferred)); 47514 if( !pDeferred ){ 47515 return SQLITE_NOMEM; 47516 } 47517@@ -203630,7 +203725,7 @@ static int geopolyUpdate( 47518 sqlite3_free(p); 47519 nChange = 1; 47520 } 47521- for(jj=1; jj<pRtree->nAux; jj++){ 47522+ for(jj=1; jj<nData-2; jj++){ 47523 nChange++; 47524 sqlite3_bind_value(pUp, jj+2, aData[jj+2]); 47525 } 47526@@ -204233,8 +204328,9 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ 47527 47528 if( U_SUCCESS(status) ){ 47529 sqlite3_set_auxdata(p, 0, pExpr, icuRegexpDelete); 47530- }else{ 47531- assert(!pExpr); 47532+ pExpr = sqlite3_get_auxdata(p, 0); 47533+ } 47534+ if( !pExpr ){ 47535 icuFunctionError(p, "uregex_open", status); 47536 return; 47537 } 47538@@ -236120,7 +236216,7 @@ static void fts5SourceIdFunc( 47539 ){ 47540 assert( nArg==0 ); 47541 UNUSED_PARAM2(nArg, apUnused); 47542- sqlite3_result_text(pCtx, "fts5: 2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603", -1, SQLITE_TRANSIENT); 47543+ sqlite3_result_text(pCtx, "fts5: 2022-09-29 15:55:41 a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309", -1, SQLITE_TRANSIENT); 47544 } 47545 47546 /* 47547diff --git a/src/third_party/sqlite/src/amalgamation/sqlite3.h b/src/third_party/sqlite/src/amalgamation/sqlite3.h 47548index f0df724d7b8d6..9b284d2764aed 47549--- a/src/third_party/sqlite/src/amalgamation/sqlite3.h 47550+++ b/src/third_party/sqlite/src/amalgamation/sqlite3.h 47551@@ -146,9 +146,9 @@ extern "C" { 47552 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 47553 ** [sqlite_version()] and [sqlite_source_id()]. 47554 */ 47555-#define SQLITE_VERSION "3.39.2" 47556-#define SQLITE_VERSION_NUMBER 3039002 47557-#define SQLITE_SOURCE_ID "2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603" 47558+#define SQLITE_VERSION "3.39.4" 47559+#define SQLITE_VERSION_NUMBER 3039004 47560+#define SQLITE_SOURCE_ID "2022-09-29 15:55:41 a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309" 47561 47562 /* 47563 ** CAPI3REF: Run-Time Library Version Numbers 47564diff --git a/src/third_party/sqlite/src/amalgamation_dev/sqlite3.c b/src/third_party/sqlite/src/amalgamation_dev/sqlite3.c 47565index b8f98c7c1e7c0..51d5dbd0ee052 47566--- a/src/third_party/sqlite/src/amalgamation_dev/sqlite3.c 47567+++ b/src/third_party/sqlite/src/amalgamation_dev/sqlite3.c 47568@@ -1,6 +1,6 @@ 47569 /****************************************************************************** 47570 ** This file is an amalgamation of many separate C source files from SQLite 47571-** version 3.39.2. By combining all the individual C code files into this 47572+** version 3.39.4. By combining all the individual C code files into this 47573 ** single large file, the entire code can be compiled as a single translation 47574 ** unit. This allows many compilers to do optimizations that would not be 47575 ** possible if the files were compiled separately. Performance improvements 47576@@ -452,9 +452,9 @@ extern "C" { 47577 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 47578 ** [sqlite_version()] and [sqlite_source_id()]. 47579 */ 47580-#define SQLITE_VERSION "3.39.2" 47581-#define SQLITE_VERSION_NUMBER 3039002 47582-#define SQLITE_SOURCE_ID "2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603" 47583+#define SQLITE_VERSION "3.39.4" 47584+#define SQLITE_VERSION_NUMBER 3039004 47585+#define SQLITE_SOURCE_ID "2022-09-29 15:55:41 a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309" 47586 47587 /* 47588 ** CAPI3REF: Run-Time Library Version Numbers 47589@@ -13144,6 +13144,11 @@ struct fts5_api { 47590 /************** End of sqlite3.h *********************************************/ 47591 /************** Continuing where we left off in sqliteInt.h ******************/ 47592 47593+/* 47594+** Reuse the STATIC_LRU for mutex access to sqlite3_temp_directory. 47595+*/ 47596+#define SQLITE_MUTEX_STATIC_TEMPDIR SQLITE_MUTEX_STATIC_VFS1 47597+ 47598 /* 47599 ** Include the configuration header output by 'configure' if we're using the 47600 ** autoconf-based build 47601@@ -29563,8 +29568,13 @@ SQLITE_PRIVATE void *sqlite3OomFault(sqlite3 *db){ 47602 } 47603 DisableLookaside; 47604 if( db->pParse ){ 47605+ Parse *pParse; 47606 sqlite3ErrorMsg(db->pParse, "out of memory"); 47607 db->pParse->rc = SQLITE_NOMEM_BKPT; 47608+ for(pParse=db->pParse->pOuterParse; pParse; pParse = pParse->pOuterParse){ 47609+ pParse->nErr++; 47610+ pParse->rc = SQLITE_NOMEM; 47611+ } 47612 } 47613 } 47614 return 0; 47615@@ -33459,7 +33469,7 @@ SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){ 47616 va_list ap; 47617 sqlite3 *db = pParse->db; 47618 assert( db!=0 ); 47619- assert( db->pParse==pParse ); 47620+ assert( db->pParse==pParse || db->pParse->pToplevel==pParse ); 47621 db->errByteOffset = -2; 47622 va_start(ap, zFormat); 47623 zMsg = sqlite3VMPrintf(db, zFormat, ap); 47624@@ -41320,6 +41330,7 @@ static const char *unixTempFileDir(void){ 47625 static int unixGetTempname(int nBuf, char *zBuf){ 47626 const char *zDir; 47627 int iLimit = 0; 47628+ int rc = SQLITE_OK; 47629 47630 /* It's odd to simulate an io-error here, but really this is just 47631 ** using the io-error infrastructure to test that SQLite handles this 47632@@ -41328,18 +41339,26 @@ static int unixGetTempname(int nBuf, char *zBuf){ 47633 zBuf[0] = 0; 47634 SimulateIOError( return SQLITE_IOERR ); 47635 47636+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47637 zDir = unixTempFileDir(); 47638- if( zDir==0 ) return SQLITE_IOERR_GETTEMPPATH; 47639- do{ 47640- u64 r; 47641- sqlite3_randomness(sizeof(r), &r); 47642- assert( nBuf>2 ); 47643- zBuf[nBuf-2] = 0; 47644- sqlite3_snprintf(nBuf, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX"%llx%c", 47645- zDir, r, 0); 47646- if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ) return SQLITE_ERROR; 47647- }while( osAccess(zBuf,0)==0 ); 47648- return SQLITE_OK; 47649+ if( zDir==0 ){ 47650+ rc = SQLITE_IOERR_GETTEMPPATH; 47651+ }else{ 47652+ do{ 47653+ u64 r; 47654+ sqlite3_randomness(sizeof(r), &r); 47655+ assert( nBuf>2 ); 47656+ zBuf[nBuf-2] = 0; 47657+ sqlite3_snprintf(nBuf, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX"%llx%c", 47658+ zDir, r, 0); 47659+ if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ){ 47660+ rc = SQLITE_ERROR; 47661+ break; 47662+ } 47663+ }while( osAccess(zBuf,0)==0 ); 47664+ } 47665+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47666+ return rc; 47667 } 47668 47669 #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) 47670@@ -45478,10 +45497,12 @@ SQLITE_API int sqlite3_win32_set_directory8( 47671 const char *zValue /* New value for directory being set or reset */ 47672 ){ 47673 char **ppDirectory = 0; 47674+ int rc; 47675 #ifndef SQLITE_OMIT_AUTOINIT 47676- int rc = sqlite3_initialize(); 47677+ rc = sqlite3_initialize(); 47678 if( rc ) return rc; 47679 #endif 47680+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47681 if( type==SQLITE_WIN32_DATA_DIRECTORY_TYPE ){ 47682 ppDirectory = &sqlite3_data_directory; 47683 }else if( type==SQLITE_WIN32_TEMP_DIRECTORY_TYPE ){ 47684@@ -45496,14 +45517,19 @@ SQLITE_API int sqlite3_win32_set_directory8( 47685 if( zValue && zValue[0] ){ 47686 zCopy = sqlite3_mprintf("%s", zValue); 47687 if ( zCopy==0 ){ 47688- return SQLITE_NOMEM_BKPT; 47689+ rc = SQLITE_NOMEM_BKPT; 47690+ goto set_directory8_done; 47691 } 47692 } 47693 sqlite3_free(*ppDirectory); 47694 *ppDirectory = zCopy; 47695- return SQLITE_OK; 47696+ rc = SQLITE_OK; 47697+ }else{ 47698+ rc = SQLITE_ERROR; 47699 } 47700- return SQLITE_ERROR; 47701+set_directory8_done: 47702+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47703+ return rc; 47704 } 47705 47706 /* 47707@@ -48277,6 +48303,18 @@ static int winMakeEndInDirSep(int nBuf, char *zBuf){ 47708 return 0; 47709 } 47710 47711+/* 47712+** If sqlite3_temp_directory is not, take the mutex and return true. 47713+** 47714+** If sqlite3_temp_directory is NULL, omit the mutex and return false. 47715+*/ 47716+static int winTempDirDefined(void){ 47717+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47718+ if( sqlite3_temp_directory!=0 ) return 1; 47719+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47720+ return 0; 47721+} 47722+ 47723 /* 47724 ** Create a temporary file name and store the resulting pointer into pzBuf. 47725 ** The pointer returned in pzBuf must be freed via sqlite3_free(). 47726@@ -48313,20 +48351,23 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){ 47727 */ 47728 nDir = nMax - (nPre + 15); 47729 assert( nDir>0 ); 47730- if( sqlite3_temp_directory ){ 47731+ if( winTempDirDefined() ){ 47732 int nDirLen = sqlite3Strlen30(sqlite3_temp_directory); 47733 if( nDirLen>0 ){ 47734 if( !winIsDirSep(sqlite3_temp_directory[nDirLen-1]) ){ 47735 nDirLen++; 47736 } 47737 if( nDirLen>nDir ){ 47738+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47739 sqlite3_free(zBuf); 47740 OSTRACE(("TEMP-FILENAME rc=SQLITE_ERROR\n")); 47741 return winLogError(SQLITE_ERROR, 0, "winGetTempname1", 0); 47742 } 47743 sqlite3_snprintf(nMax, zBuf, "%s", sqlite3_temp_directory); 47744 } 47745+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47746 } 47747+ 47748 #if defined(__CYGWIN__) 47749 else{ 47750 static const char *azDirs[] = { 47751@@ -49115,7 +49156,7 @@ static BOOL winIsVerbatimPathname( 47752 ** pathname into zOut[]. zOut[] will be at least pVfs->mxPathname 47753 ** bytes in size. 47754 */ 47755-static int winFullPathname( 47756+static int winFullPathnameNoMutex( 47757 sqlite3_vfs *pVfs, /* Pointer to vfs object */ 47758 const char *zRelative, /* Possibly relative input path */ 47759 int nFull, /* Size of output buffer in bytes */ 47760@@ -49294,6 +49335,19 @@ static int winFullPathname( 47761 } 47762 #endif 47763 } 47764+static int winFullPathname( 47765+ sqlite3_vfs *pVfs, /* Pointer to vfs object */ 47766+ const char *zRelative, /* Possibly relative input path */ 47767+ int nFull, /* Size of output buffer in bytes */ 47768+ char *zFull /* Output buffer */ 47769+){ 47770+ int rc; 47771+ sqlite3_mutex *pMutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR); 47772+ sqlite3_mutex_enter(pMutex); 47773+ rc = winFullPathnameNoMutex(pVfs, zRelative, nFull, zFull); 47774+ sqlite3_mutex_leave(pMutex); 47775+ return rc; 47776+} 47777 47778 #ifndef SQLITE_OMIT_LOAD_EXTENSION 47779 /* 47780@@ -51638,14 +51692,24 @@ SQLITE_PRIVATE void sqlite3PcacheClearSyncFlags(PCache *pCache){ 47781 */ 47782 SQLITE_PRIVATE void sqlite3PcacheMove(PgHdr *p, Pgno newPgno){ 47783 PCache *pCache = p->pCache; 47784+ sqlite3_pcache_page *pOther; 47785 assert( p->nRef>0 ); 47786 assert( newPgno>0 ); 47787 assert( sqlite3PcachePageSanity(p) ); 47788 pcacheTrace(("%p.MOVE %d -> %d\n",pCache,p->pgno,newPgno)); 47789+ pOther = sqlite3GlobalConfig.pcache2.xFetch(pCache->pCache, newPgno, 0); 47790+ if( pOther ){ 47791+ PgHdr *pXPage = (PgHdr*)pOther->pExtra; 47792+ assert( pXPage->nRef==0 ); 47793+ pXPage->nRef++; 47794+ pCache->nRefSum++; 47795+ sqlite3PcacheDrop(pXPage); 47796+ } 47797 sqlite3GlobalConfig.pcache2.xRekey(pCache->pCache, p->pPage, p->pgno,newPgno); 47798 p->pgno = newPgno; 47799 if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){ 47800 pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT); 47801+ assert( sqlite3PcachePageSanity(p) ); 47802 } 47803 } 47804 47805@@ -53027,23 +53091,26 @@ static void pcache1Rekey( 47806 PCache1 *pCache = (PCache1 *)p; 47807 PgHdr1 *pPage = (PgHdr1 *)pPg; 47808 PgHdr1 **pp; 47809- unsigned int h; 47810+ unsigned int hOld, hNew; 47811 assert( pPage->iKey==iOld ); 47812 assert( pPage->pCache==pCache ); 47813+ assert( iOld!=iNew ); /* The page number really is changing */ 47814 47815 pcache1EnterMutex(pCache->pGroup); 47816 47817- h = iOld%pCache->nHash; 47818- pp = &pCache->apHash[h]; 47819+ assert( pcache1FetchNoMutex(p, iOld, 0)==pPage ); /* pPg really is iOld */ 47820+ hOld = iOld%pCache->nHash; 47821+ pp = &pCache->apHash[hOld]; 47822 while( (*pp)!=pPage ){ 47823 pp = &(*pp)->pNext; 47824 } 47825 *pp = pPage->pNext; 47826 47827- h = iNew%pCache->nHash; 47828+ assert( pcache1FetchNoMutex(p, iNew, 0)==0 ); /* iNew not in cache */ 47829+ hNew = iNew%pCache->nHash; 47830 pPage->iKey = iNew; 47831- pPage->pNext = pCache->apHash[h]; 47832- pCache->apHash[h] = pPage; 47833+ pPage->pNext = pCache->apHash[hNew]; 47834+ pCache->apHash[hNew] = pPage; 47835 if( iNew>pCache->iMaxKey ){ 47836 pCache->iMaxKey = iNew; 47837 } 47838@@ -59676,6 +59743,7 @@ static int pager_open_journal(Pager *pPager){ 47839 if( rc!=SQLITE_OK ){ 47840 sqlite3BitvecDestroy(pPager->pInJournal); 47841 pPager->pInJournal = 0; 47842+ pPager->journalOff = 0; 47843 }else{ 47844 assert( pPager->eState==PAGER_WRITER_LOCKED ); 47845 pPager->eState = PAGER_WRITER_CACHEMOD; 47846@@ -61231,7 +61299,7 @@ SQLITE_PRIVATE int sqlite3PagerGetJournalMode(Pager *pPager){ 47847 SQLITE_PRIVATE int sqlite3PagerOkToChangeJournalMode(Pager *pPager){ 47848 assert( assert_pager_state(pPager) ); 47849 if( pPager->eState>=PAGER_WRITER_CACHEMOD ) return 0; 47850- if( NEVER(isOpen(pPager->jfd) && pPager->journalOff>0) ) return 0; 47851+ if( isOpen(pPager->jfd) && pPager->journalOff>0 ) return 0; 47852 return 1; 47853 } 47854 47855@@ -68346,7 +68414,7 @@ static int defragmentPage(MemPage *pPage, int nMaxFrag){ 47856 if( iFree2+sz2 > usableSize ) return SQLITE_CORRUPT_PAGE(pPage); 47857 memmove(&data[iFree+sz+sz2], &data[iFree+sz], iFree2-(iFree+sz)); 47858 sz += sz2; 47859- }else if( NEVER(iFree+sz>usableSize) ){ 47860+ }else if( iFree+sz>usableSize ){ 47861 return SQLITE_CORRUPT_PAGE(pPage); 47862 } 47863 47864@@ -74702,8 +74770,6 @@ static int balance_nonroot( 47865 Pgno pgno; /* Temp var to store a page number in */ 47866 u8 abDone[NB+2]; /* True after i'th new page is populated */ 47867 Pgno aPgno[NB+2]; /* Page numbers of new pages before shuffling */ 47868- Pgno aPgOrder[NB+2]; /* Copy of aPgno[] used for sorting pages */ 47869- u16 aPgFlags[NB+2]; /* flags field of new pages before shuffling */ 47870 CellArray b; /* Parsed information on cells being balanced */ 47871 47872 memset(abDone, 0, sizeof(abDone)); 47873@@ -75127,42 +75193,39 @@ static int balance_nonroot( 47874 ** of the table is closer to a linear scan through the file. That in turn 47875 ** helps the operating system to deliver pages from the disk more rapidly. 47876 ** 47877- ** An O(n^2) insertion sort algorithm is used, but since n is never more 47878- ** than (NB+2) (a small constant), that should not be a problem. 47879+ ** An O(N*N) sort algorithm is used, but since N is never more than NB+2 47880+ ** (5), that is not a performance concern. 47881 ** 47882 ** When NB==3, this one optimization makes the database about 25% faster 47883 ** for large insertions and deletions. 47884 */ 47885 for(i=0; i<nNew; i++){ 47886- aPgOrder[i] = aPgno[i] = apNew[i]->pgno; 47887- aPgFlags[i] = apNew[i]->pDbPage->flags; 47888- for(j=0; j<i; j++){ 47889- if( NEVER(aPgno[j]==aPgno[i]) ){ 47890- /* This branch is taken if the set of sibling pages somehow contains 47891- ** duplicate entries. This can happen if the database is corrupt. 47892- ** It would be simpler to detect this as part of the loop below, but 47893- ** we do the detection here in order to avoid populating the pager 47894- ** cache with two separate objects associated with the same 47895- ** page number. */ 47896- assert( CORRUPT_DB ); 47897- rc = SQLITE_CORRUPT_BKPT; 47898- goto balance_cleanup; 47899- } 47900- } 47901+ aPgno[i] = apNew[i]->pgno; 47902+ assert( apNew[i]->pDbPage->flags & PGHDR_WRITEABLE ); 47903+ assert( apNew[i]->pDbPage->flags & PGHDR_DIRTY ); 47904 } 47905- for(i=0; i<nNew; i++){ 47906- int iBest = 0; /* aPgno[] index of page number to use */ 47907- for(j=1; j<nNew; j++){ 47908- if( aPgOrder[j]<aPgOrder[iBest] ) iBest = j; 47909+ for(i=0; i<nNew-1; i++){ 47910+ int iB = i; 47911+ for(j=i+1; j<nNew; j++){ 47912+ if( apNew[j]->pgno < apNew[iB]->pgno ) iB = j; 47913 } 47914- pgno = aPgOrder[iBest]; 47915- aPgOrder[iBest] = 0xffffffff; 47916- if( iBest!=i ){ 47917- if( iBest>i ){ 47918- sqlite3PagerRekey(apNew[iBest]->pDbPage, pBt->nPage+iBest+1, 0); 47919- } 47920- sqlite3PagerRekey(apNew[i]->pDbPage, pgno, aPgFlags[iBest]); 47921- apNew[i]->pgno = pgno; 47922+ 47923+ /* If apNew[i] has a page number that is bigger than any of the 47924+ ** subsequence apNew[i] entries, then swap apNew[i] with the subsequent 47925+ ** entry that has the smallest page number (which we know to be 47926+ ** entry apNew[iB]). 47927+ */ 47928+ if( iB!=i ){ 47929+ Pgno pgnoA = apNew[i]->pgno; 47930+ Pgno pgnoB = apNew[iB]->pgno; 47931+ Pgno pgnoTemp = (PENDING_BYTE/pBt->pageSize)+1; 47932+ u16 fgA = apNew[i]->pDbPage->flags; 47933+ u16 fgB = apNew[iB]->pDbPage->flags; 47934+ sqlite3PagerRekey(apNew[i]->pDbPage, pgnoTemp, fgB); 47935+ sqlite3PagerRekey(apNew[iB]->pDbPage, pgnoA, fgA); 47936+ sqlite3PagerRekey(apNew[i]->pDbPage, pgnoB, fgB); 47937+ apNew[i]->pgno = pgnoB; 47938+ apNew[iB]->pgno = pgnoA; 47939 } 47940 } 47941 47942@@ -81035,6 +81098,7 @@ SQLITE_PRIVATE int sqlite3VdbeAddFunctionCall( 47943 addr = sqlite3VdbeAddOp4(v, eCallCtx ? OP_PureFunc : OP_Function, 47944 p1, p2, p3, (char*)pCtx, P4_FUNCCTX); 47945 sqlite3VdbeChangeP5(v, eCallCtx & NC_SelfRef); 47946+ sqlite3MayAbort(pParse); 47947 return addr; 47948 } 47949 47950@@ -81370,6 +81434,7 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){ 47951 || opcode==OP_VDestroy 47952 || opcode==OP_VCreate 47953 || opcode==OP_ParseSchema 47954+ || opcode==OP_Function || opcode==OP_PureFunc 47955 || ((opcode==OP_Halt || opcode==OP_HaltIfNull) 47956 && ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort)) 47957 ){ 47958@@ -132704,6 +132769,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47959 ** 47960 */ 47961 case PragTyp_TEMP_STORE_DIRECTORY: { 47962+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47963 if( !zRight ){ 47964 returnSingleText(v, sqlite3_temp_directory); 47965 }else{ 47966@@ -132713,6 +132779,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47967 rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); 47968 if( rc!=SQLITE_OK || res==0 ){ 47969 sqlite3ErrorMsg(pParse, "not a writable directory"); 47970+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47971 goto pragma_out; 47972 } 47973 } 47974@@ -132730,6 +132797,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47975 } 47976 #endif /* SQLITE_OMIT_WSD */ 47977 } 47978+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47979 break; 47980 } 47981 47982@@ -132748,6 +132816,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47983 ** 47984 */ 47985 case PragTyp_DATA_STORE_DIRECTORY: { 47986+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47987 if( !zRight ){ 47988 returnSingleText(v, sqlite3_data_directory); 47989 }else{ 47990@@ -132757,6 +132826,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47991 rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); 47992 if( rc!=SQLITE_OK || res==0 ){ 47993 sqlite3ErrorMsg(pParse, "not a writable directory"); 47994+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 47995 goto pragma_out; 47996 } 47997 } 47998@@ -132768,6 +132838,7 @@ SQLITE_PRIVATE void sqlite3Pragma( 47999 } 48000 #endif /* SQLITE_OMIT_WSD */ 48001 } 48002+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 48003 break; 48004 } 48005 #endif 48006@@ -137213,7 +137284,7 @@ static void generateSortTail( 48007 if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce); 48008 addr = 1 + sqlite3VdbeAddOp2(v, OP_SorterSort, iTab, addrBreak); 48009 VdbeCoverage(v); 48010- codeOffset(v, p->iOffset, addrContinue); 48011+ assert( p->iLimit==0 && p->iOffset==0 ); 48012 sqlite3VdbeAddOp3(v, OP_SorterData, iTab, regSortOut, iSortTab); 48013 bSeq = 0; 48014 }else{ 48015@@ -137221,6 +137292,9 @@ static void generateSortTail( 48016 codeOffset(v, p->iOffset, addrContinue); 48017 iSortTab = iTab; 48018 bSeq = 1; 48019+ if( p->iOffset>0 ){ 48020+ sqlite3VdbeAddOp2(v, OP_AddImm, p->iLimit, -1); 48021+ } 48022 } 48023 for(i=0, iCol=nKey+bSeq-1; i<nColumn; i++){ 48024 #ifdef SQLITE_ENABLE_SORTER_REFERENCES 48025@@ -139213,10 +139287,11 @@ static int multiSelectOrderBy( 48026 */ 48027 sqlite3VdbeResolveLabel(v, labelEnd); 48028 48029- /* Reassembly the compound query so that it will be freed correctly 48030+ /* Reassemble the compound query so that it will be freed correctly 48031 ** by the calling function */ 48032 if( pSplit->pPrior ){ 48033- sqlite3SelectDelete(db, pSplit->pPrior); 48034+ sqlite3ParserAddCleanup(pParse, 48035+ (void(*)(sqlite3*,void*))sqlite3SelectDelete, pSplit->pPrior); 48036 } 48037 pSplit->pPrior = pPrior; 48038 pPrior->pNext = pSplit; 48039@@ -140735,6 +140810,7 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){ 48040 || p->pSrc->nSrc!=1 48041 || p->pSrc->a[0].pSelect 48042 || pAggInfo->nFunc!=1 48043+ || p->pHaving 48044 ){ 48045 return 0; 48046 } 48047@@ -143972,6 +144048,23 @@ SQLITE_PRIVATE void sqlite3FinishTrigger( 48048 Vdbe *v; 48049 char *z; 48050 48051+ /* If this is a new CREATE TABLE statement, and if shadow tables 48052+ ** are read-only, and the trigger makes a change to a shadow table, 48053+ ** then raise an error - do not allow the trigger to be created. */ 48054+ if( sqlite3ReadOnlyShadowTables(db) ){ 48055+ TriggerStep *pStep; 48056+ for(pStep=pTrig->step_list; pStep; pStep=pStep->pNext){ 48057+ if( pStep->zTarget!=0 48058+ && sqlite3ShadowTableName(db, pStep->zTarget) 48059+ ){ 48060+ sqlite3ErrorMsg(pParse, 48061+ "trigger \"%s\" may not write to shadow table \"%s\"", 48062+ pTrig->zName, pStep->zTarget); 48063+ goto triggerfinish_cleanup; 48064+ } 48065+ } 48066+ } 48067+ 48068 /* Make an entry in the sqlite_schema table */ 48069 v = sqlite3GetVdbe(pParse); 48070 if( v==0 ) goto triggerfinish_cleanup; 48071@@ -149783,7 +149876,8 @@ static int codeEqualityTerm( 48072 } 48073 sqlite3ExprDelete(db, pX); 48074 }else{ 48075- aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); 48076+ int n = sqlite3ExprVectorSize(pX->pLeft); 48077+ aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*MAX(nEq,n)); 48078 eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); 48079 } 48080 pX = pExpr; 48081@@ -176936,7 +177030,7 @@ struct Fts3MultiSegReader { 48082 int nAdvance; /* How many seg-readers to advance */ 48083 Fts3SegFilter *pFilter; /* Pointer to filter object */ 48084 char *aBuffer; /* Buffer to merge doclists in */ 48085- int nBuffer; /* Allocated size of aBuffer[] in bytes */ 48086+ i64 nBuffer; /* Allocated size of aBuffer[] in bytes */ 48087 48088 int iColFilter; /* If >=0, filter for this column */ 48089 int bRestart; 48090@@ -179632,7 +179726,7 @@ static int fts3TermSelectMerge( 48091 ** 48092 ** Similar padding is added in the fts3DoclistOrMerge() function. 48093 */ 48094- pTS->aaOutput[0] = sqlite3_malloc(nDoclist + FTS3_VARINT_MAX + 1); 48095+ pTS->aaOutput[0] = sqlite3_malloc64((i64)nDoclist + FTS3_VARINT_MAX + 1); 48096 pTS->anOutput[0] = nDoclist; 48097 if( pTS->aaOutput[0] ){ 48098 memcpy(pTS->aaOutput[0], aDoclist, nDoclist); 48099@@ -181120,7 +181214,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ 48100 nDistance = iPrev - nMaxUndeferred; 48101 } 48102 48103- aOut = (char *)sqlite3_malloc(nPoslist+8); 48104+ aOut = (char *)sqlite3Fts3MallocZero(nPoslist+FTS3_BUFFER_PADDING); 48105 if( !aOut ){ 48106 sqlite3_free(aPoslist); 48107 return SQLITE_NOMEM; 48108@@ -181489,7 +181583,7 @@ static int fts3EvalIncrPhraseNext( 48109 if( bEof==0 ){ 48110 int nList = 0; 48111 int nByte = a[p->nToken-1].nList; 48112- char *aDoclist = sqlite3_malloc(nByte+FTS3_BUFFER_PADDING); 48113+ char *aDoclist = sqlite3_malloc64((i64)nByte+FTS3_BUFFER_PADDING); 48114 if( !aDoclist ) return SQLITE_NOMEM; 48115 memcpy(aDoclist, a[p->nToken-1].pList, nByte+1); 48116 memset(&aDoclist[nByte], 0, FTS3_BUFFER_PADDING); 48117@@ -185725,7 +185819,7 @@ static int porterNext( 48118 if( n>c->nAllocated ){ 48119 char *pNew; 48120 c->nAllocated = n+20; 48121- pNew = sqlite3_realloc(c->zToken, c->nAllocated); 48122+ pNew = sqlite3_realloc64(c->zToken, c->nAllocated); 48123 if( !pNew ) return SQLITE_NOMEM; 48124 c->zToken = pNew; 48125 } 48126@@ -186477,7 +186571,7 @@ static int simpleNext( 48127 if( n>c->nTokenAllocated ){ 48128 char *pNew; 48129 c->nTokenAllocated = n+20; 48130- pNew = sqlite3_realloc(c->pToken, c->nTokenAllocated); 48131+ pNew = sqlite3_realloc64(c->pToken, c->nTokenAllocated); 48132 if( !pNew ) return SQLITE_NOMEM; 48133 c->pToken = pNew; 48134 } 48135@@ -187639,7 +187733,7 @@ static int fts3PendingListAppendVarint( 48136 48137 /* Allocate or grow the PendingList as required. */ 48138 if( !p ){ 48139- p = sqlite3_malloc(sizeof(*p) + 100); 48140+ p = sqlite3_malloc64(sizeof(*p) + 100); 48141 if( !p ){ 48142 return SQLITE_NOMEM; 48143 } 48144@@ -187648,14 +187742,14 @@ static int fts3PendingListAppendVarint( 48145 p->nData = 0; 48146 } 48147 else if( p->nData+FTS3_VARINT_MAX+1>p->nSpace ){ 48148- int nNew = p->nSpace * 2; 48149- p = sqlite3_realloc(p, sizeof(*p) + nNew); 48150+ i64 nNew = p->nSpace * 2; 48151+ p = sqlite3_realloc64(p, sizeof(*p) + nNew); 48152 if( !p ){ 48153 sqlite3_free(*pp); 48154 *pp = 0; 48155 return SQLITE_NOMEM; 48156 } 48157- p->nSpace = nNew; 48158+ p->nSpace = (int)nNew; 48159 p->aData = (char *)&p[1]; 48160 } 48161 48162@@ -188212,7 +188306,7 @@ SQLITE_PRIVATE int sqlite3Fts3ReadBlock( 48163 int nByte = sqlite3_blob_bytes(p->pSegments); 48164 *pnBlob = nByte; 48165 if( paBlob ){ 48166- char *aByte = sqlite3_malloc(nByte + FTS3_NODE_PADDING); 48167+ char *aByte = sqlite3_malloc64((i64)nByte + FTS3_NODE_PADDING); 48168 if( !aByte ){ 48169 rc = SQLITE_NOMEM; 48170 }else{ 48171@@ -188329,7 +188423,7 @@ static int fts3SegReaderNext( 48172 int nTerm = fts3HashKeysize(pElem); 48173 if( (nTerm+1)>pReader->nTermAlloc ){ 48174 sqlite3_free(pReader->zTerm); 48175- pReader->zTerm = (char*)sqlite3_malloc((nTerm+1)*2); 48176+ pReader->zTerm = (char*)sqlite3_malloc64(((i64)nTerm+1)*2); 48177 if( !pReader->zTerm ) return SQLITE_NOMEM; 48178 pReader->nTermAlloc = (nTerm+1)*2; 48179 } 48180@@ -188337,7 +188431,7 @@ static int fts3SegReaderNext( 48181 pReader->zTerm[nTerm] = '\0'; 48182 pReader->nTerm = nTerm; 48183 48184- aCopy = (char*)sqlite3_malloc(nCopy); 48185+ aCopy = (char*)sqlite3_malloc64(nCopy); 48186 if( !aCopy ) return SQLITE_NOMEM; 48187 memcpy(aCopy, pList->aData, nCopy); 48188 pReader->nNode = pReader->nDoclist = nCopy; 48189@@ -188624,7 +188718,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderNew( 48190 nExtra = nRoot + FTS3_NODE_PADDING; 48191 } 48192 48193- pReader = (Fts3SegReader *)sqlite3_malloc(sizeof(Fts3SegReader) + nExtra); 48194+ pReader = (Fts3SegReader *)sqlite3_malloc64(sizeof(Fts3SegReader) + nExtra); 48195 if( !pReader ){ 48196 return SQLITE_NOMEM; 48197 } 48198@@ -188716,7 +188810,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderPending( 48199 if( nElem==nAlloc ){ 48200 Fts3HashElem **aElem2; 48201 nAlloc += 16; 48202- aElem2 = (Fts3HashElem **)sqlite3_realloc( 48203+ aElem2 = (Fts3HashElem **)sqlite3_realloc64( 48204 aElem, nAlloc*sizeof(Fts3HashElem *) 48205 ); 48206 if( !aElem2 ){ 48207@@ -189050,7 +189144,7 @@ static int fts3NodeAddTerm( 48208 ** this is not expected to be a serious problem. 48209 */ 48210 assert( pTree->aData==(char *)&pTree[1] ); 48211- pTree->aData = (char *)sqlite3_malloc(nReq); 48212+ pTree->aData = (char *)sqlite3_malloc64(nReq); 48213 if( !pTree->aData ){ 48214 return SQLITE_NOMEM; 48215 } 48216@@ -189068,7 +189162,7 @@ static int fts3NodeAddTerm( 48217 48218 if( isCopyTerm ){ 48219 if( pTree->nMalloc<nTerm ){ 48220- char *zNew = sqlite3_realloc(pTree->zMalloc, nTerm*2); 48221+ char *zNew = sqlite3_realloc64(pTree->zMalloc, (i64)nTerm*2); 48222 if( !zNew ){ 48223 return SQLITE_NOMEM; 48224 } 48225@@ -189094,7 +189188,7 @@ static int fts3NodeAddTerm( 48226 ** now. Instead, the term is inserted into the parent of pTree. If pTree 48227 ** has no parent, one is created here. 48228 */ 48229- pNew = (SegmentNode *)sqlite3_malloc(sizeof(SegmentNode) + p->nNodeSize); 48230+ pNew = (SegmentNode *)sqlite3_malloc64(sizeof(SegmentNode) + p->nNodeSize); 48231 if( !pNew ){ 48232 return SQLITE_NOMEM; 48233 } 48234@@ -189232,7 +189326,7 @@ static int fts3SegWriterAdd( 48235 ){ 48236 int nPrefix; /* Size of term prefix in bytes */ 48237 int nSuffix; /* Size of term suffix in bytes */ 48238- int nReq; /* Number of bytes required on leaf page */ 48239+ i64 nReq; /* Number of bytes required on leaf page */ 48240 int nData; 48241 SegmentWriter *pWriter = *ppWriter; 48242 48243@@ -189241,13 +189335,13 @@ static int fts3SegWriterAdd( 48244 sqlite3_stmt *pStmt; 48245 48246 /* Allocate the SegmentWriter structure */ 48247- pWriter = (SegmentWriter *)sqlite3_malloc(sizeof(SegmentWriter)); 48248+ pWriter = (SegmentWriter *)sqlite3_malloc64(sizeof(SegmentWriter)); 48249 if( !pWriter ) return SQLITE_NOMEM; 48250 memset(pWriter, 0, sizeof(SegmentWriter)); 48251 *ppWriter = pWriter; 48252 48253 /* Allocate a buffer in which to accumulate data */ 48254- pWriter->aData = (char *)sqlite3_malloc(p->nNodeSize); 48255+ pWriter->aData = (char *)sqlite3_malloc64(p->nNodeSize); 48256 if( !pWriter->aData ) return SQLITE_NOMEM; 48257 pWriter->nSize = p->nNodeSize; 48258 48259@@ -189322,7 +189416,7 @@ static int fts3SegWriterAdd( 48260 ** the buffer to make it large enough. 48261 */ 48262 if( nReq>pWriter->nSize ){ 48263- char *aNew = sqlite3_realloc(pWriter->aData, nReq); 48264+ char *aNew = sqlite3_realloc64(pWriter->aData, nReq); 48265 if( !aNew ) return SQLITE_NOMEM; 48266 pWriter->aData = aNew; 48267 pWriter->nSize = nReq; 48268@@ -189347,7 +189441,7 @@ static int fts3SegWriterAdd( 48269 */ 48270 if( isCopyTerm ){ 48271 if( nTerm>pWriter->nMalloc ){ 48272- char *zNew = sqlite3_realloc(pWriter->zMalloc, nTerm*2); 48273+ char *zNew = sqlite3_realloc64(pWriter->zMalloc, (i64)nTerm*2); 48274 if( !zNew ){ 48275 return SQLITE_NOMEM; 48276 } 48277@@ -189655,12 +189749,12 @@ static void fts3ColumnFilter( 48278 static int fts3MsrBufferData( 48279 Fts3MultiSegReader *pMsr, /* Multi-segment-reader handle */ 48280 char *pList, 48281- int nList 48282+ i64 nList 48283 ){ 48284 if( nList>pMsr->nBuffer ){ 48285 char *pNew; 48286 pMsr->nBuffer = nList*2; 48287- pNew = (char *)sqlite3_realloc(pMsr->aBuffer, pMsr->nBuffer); 48288+ pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, pMsr->nBuffer); 48289 if( !pNew ) return SQLITE_NOMEM; 48290 pMsr->aBuffer = pNew; 48291 } 48292@@ -189716,7 +189810,7 @@ SQLITE_PRIVATE int sqlite3Fts3MsrIncrNext( 48293 fts3SegReaderSort(pMsr->apSegment, nMerge, j, xCmp); 48294 48295 if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){ 48296- rc = fts3MsrBufferData(pMsr, pList, nList+1); 48297+ rc = fts3MsrBufferData(pMsr, pList, (i64)nList+1); 48298 if( rc!=SQLITE_OK ) return rc; 48299 assert( (pMsr->aBuffer[nList] & 0xFE)==0x00 ); 48300 pList = pMsr->aBuffer; 48301@@ -189853,11 +189947,11 @@ SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr){ 48302 return SQLITE_OK; 48303 } 48304 48305-static int fts3GrowSegReaderBuffer(Fts3MultiSegReader *pCsr, int nReq){ 48306+static int fts3GrowSegReaderBuffer(Fts3MultiSegReader *pCsr, i64 nReq){ 48307 if( nReq>pCsr->nBuffer ){ 48308 char *aNew; 48309 pCsr->nBuffer = nReq*2; 48310- aNew = sqlite3_realloc(pCsr->aBuffer, pCsr->nBuffer); 48311+ aNew = sqlite3_realloc64(pCsr->aBuffer, pCsr->nBuffer); 48312 if( !aNew ){ 48313 return SQLITE_NOMEM; 48314 } 48315@@ -189948,7 +190042,8 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( 48316 ){ 48317 pCsr->nDoclist = apSegment[0]->nDoclist; 48318 if( fts3SegReaderIsPending(apSegment[0]) ){ 48319- rc = fts3MsrBufferData(pCsr, apSegment[0]->aDoclist, pCsr->nDoclist); 48320+ rc = fts3MsrBufferData(pCsr, apSegment[0]->aDoclist, 48321+ (i64)pCsr->nDoclist); 48322 pCsr->aDoclist = pCsr->aBuffer; 48323 }else{ 48324 pCsr->aDoclist = apSegment[0]->aDoclist; 48325@@ -190001,7 +190096,8 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( 48326 48327 nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0); 48328 48329- rc = fts3GrowSegReaderBuffer(pCsr, nByte+nDoclist+FTS3_NODE_PADDING); 48330+ rc = fts3GrowSegReaderBuffer(pCsr, 48331+ (i64)nByte+nDoclist+FTS3_NODE_PADDING); 48332 if( rc ) return rc; 48333 48334 if( isFirst ){ 48335@@ -190027,7 +190123,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( 48336 fts3SegReaderSort(apSegment, nMerge, j, xCmp); 48337 } 48338 if( nDoclist>0 ){ 48339- rc = fts3GrowSegReaderBuffer(pCsr, nDoclist+FTS3_NODE_PADDING); 48340+ rc = fts3GrowSegReaderBuffer(pCsr, (i64)nDoclist+FTS3_NODE_PADDING); 48341 if( rc ) return rc; 48342 memset(&pCsr->aBuffer[nDoclist], 0, FTS3_NODE_PADDING); 48343 pCsr->aDoclist = pCsr->aBuffer; 48344@@ -190740,7 +190836,7 @@ struct NodeReader { 48345 static void blobGrowBuffer(Blob *pBlob, int nMin, int *pRc){ 48346 if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){ 48347 int nAlloc = nMin; 48348- char *a = (char *)sqlite3_realloc(pBlob->a, nAlloc); 48349+ char *a = (char *)sqlite3_realloc64(pBlob->a, nAlloc); 48350 if( a ){ 48351 pBlob->nAlloc = nAlloc; 48352 pBlob->a = a; 48353@@ -191537,7 +191633,7 @@ static int fts3RepackSegdirLevel( 48354 if( nIdx>=nAlloc ){ 48355 int *aNew; 48356 nAlloc += 16; 48357- aNew = sqlite3_realloc(aIdx, nAlloc*sizeof(int)); 48358+ aNew = sqlite3_realloc64(aIdx, nAlloc*sizeof(int)); 48359 if( !aNew ){ 48360 rc = SQLITE_NOMEM; 48361 break; 48362@@ -191911,7 +192007,7 @@ SQLITE_PRIVATE int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ 48363 48364 /* Allocate space for the cursor, filter and writer objects */ 48365 const int nAlloc = sizeof(*pCsr) + sizeof(*pFilter) + sizeof(*pWriter); 48366- pWriter = (IncrmergeWriter *)sqlite3_malloc(nAlloc); 48367+ pWriter = (IncrmergeWriter *)sqlite3_malloc64(nAlloc); 48368 if( !pWriter ) return SQLITE_NOMEM; 48369 pFilter = (Fts3SegFilter *)&pWriter[1]; 48370 pCsr = (Fts3MultiSegReader *)&pFilter[1]; 48371@@ -192547,7 +192643,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferredTokenList( 48372 return SQLITE_OK; 48373 } 48374 48375- pRet = (char *)sqlite3_malloc(p->pList->nData); 48376+ pRet = (char *)sqlite3_malloc64(p->pList->nData); 48377 if( !pRet ) return SQLITE_NOMEM; 48378 48379 nSkip = sqlite3Fts3GetVarint(p->pList->aData, &dummy); 48380@@ -192567,7 +192663,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferToken( 48381 int iCol /* Column that token must appear in (or -1) */ 48382 ){ 48383 Fts3DeferredToken *pDeferred; 48384- pDeferred = sqlite3_malloc(sizeof(*pDeferred)); 48385+ pDeferred = sqlite3_malloc64(sizeof(*pDeferred)); 48386 if( !pDeferred ){ 48387 return SQLITE_NOMEM; 48388 } 48389@@ -204146,7 +204242,7 @@ static int geopolyUpdate( 48390 sqlite3_free(p); 48391 nChange = 1; 48392 } 48393- for(jj=1; jj<pRtree->nAux; jj++){ 48394+ for(jj=1; jj<nData-2; jj++){ 48395 nChange++; 48396 sqlite3_bind_value(pUp, jj+2, aData[jj+2]); 48397 } 48398@@ -204749,8 +204845,9 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ 48399 48400 if( U_SUCCESS(status) ){ 48401 sqlite3_set_auxdata(p, 0, pExpr, icuRegexpDelete); 48402- }else{ 48403- assert(!pExpr); 48404+ pExpr = sqlite3_get_auxdata(p, 0); 48405+ } 48406+ if( !pExpr ){ 48407 icuFunctionError(p, "uregex_open", status); 48408 return; 48409 } 48410@@ -236636,7 +236733,7 @@ static void fts5SourceIdFunc( 48411 ){ 48412 assert( nArg==0 ); 48413 UNUSED_PARAM2(nArg, apUnused); 48414- sqlite3_result_text(pCtx, "fts5: 2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603", -1, SQLITE_TRANSIENT); 48415+ sqlite3_result_text(pCtx, "fts5: 2022-09-29 15:55:41 a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309", -1, SQLITE_TRANSIENT); 48416 } 48417 48418 /* 48419diff --git a/src/third_party/sqlite/src/amalgamation_dev/sqlite3.h b/src/third_party/sqlite/src/amalgamation_dev/sqlite3.h 48420index f0df724d7b8d6..9b284d2764aed 48421--- a/src/third_party/sqlite/src/amalgamation_dev/sqlite3.h 48422+++ b/src/third_party/sqlite/src/amalgamation_dev/sqlite3.h 48423@@ -146,9 +146,9 @@ extern "C" { 48424 ** [sqlite3_libversion_number()], [sqlite3_sourceid()], 48425 ** [sqlite_version()] and [sqlite_source_id()]. 48426 */ 48427-#define SQLITE_VERSION "3.39.2" 48428-#define SQLITE_VERSION_NUMBER 3039002 48429-#define SQLITE_SOURCE_ID "2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603" 48430+#define SQLITE_VERSION "3.39.4" 48431+#define SQLITE_VERSION_NUMBER 3039004 48432+#define SQLITE_SOURCE_ID "2022-09-29 15:55:41 a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309" 48433 48434 /* 48435 ** CAPI3REF: Run-Time Library Version Numbers 48436diff --git a/src/third_party/sqlite/src/configure b/src/third_party/sqlite/src/configure 48437index 24135817d9d13..367b1485f20a7 48438--- a/src/third_party/sqlite/src/configure 48439+++ b/src/third_party/sqlite/src/configure 48440@@ -1,6 +1,6 @@ 48441 #! /bin/sh 48442 # Guess values for system-dependent variables and create Makefiles. 48443-# Generated by GNU Autoconf 2.69 for sqlite 3.39.2. 48444+# Generated by GNU Autoconf 2.69 for sqlite 3.39.4. 48445 # 48446 # 48447 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. 48448@@ -726,8 +726,8 @@ MAKEFLAGS= 48449 # Identity of this package. 48450 PACKAGE_NAME='sqlite' 48451 PACKAGE_TARNAME='sqlite' 48452-PACKAGE_VERSION='3.39.2' 48453-PACKAGE_STRING='sqlite 3.39.2' 48454+PACKAGE_VERSION='3.39.4' 48455+PACKAGE_STRING='sqlite 3.39.4' 48456 PACKAGE_BUGREPORT='' 48457 PACKAGE_URL='' 48458 48459@@ -1468,7 +1468,7 @@ if test "$ac_init_help" = "long"; then 48460 # Omit some internal or obsolete options to make the list less imposing. 48461 # This message is too long to be a string in the A/UX 3.1 sh. 48462 cat <<_ACEOF 48463-\`configure' configures sqlite 3.39.2 to adapt to many kinds of systems. 48464+\`configure' configures sqlite 3.39.4 to adapt to many kinds of systems. 48465 48466 Usage: $0 [OPTION]... [VAR=VALUE]... 48467 48468@@ -1533,7 +1533,7 @@ fi 48469 48470 if test -n "$ac_init_help"; then 48471 case $ac_init_help in 48472- short | recursive ) echo "Configuration of sqlite 3.39.2:";; 48473+ short | recursive ) echo "Configuration of sqlite 3.39.4:";; 48474 esac 48475 cat <<\_ACEOF 48476 48477@@ -1661,7 +1661,7 @@ fi 48478 test -n "$ac_init_help" && exit $ac_status 48479 if $ac_init_version; then 48480 cat <<\_ACEOF 48481-sqlite configure 3.39.2 48482+sqlite configure 3.39.4 48483 generated by GNU Autoconf 2.69 48484 48485 Copyright (C) 2012 Free Software Foundation, Inc. 48486@@ -2080,7 +2080,7 @@ cat >config.log <<_ACEOF 48487 This file contains any messages produced by compilers while 48488 running configure, to aid debugging if configure makes a mistake. 48489 48490-It was created by sqlite $as_me 3.39.2, which was 48491+It was created by sqlite $as_me 3.39.4, which was 48492 generated by GNU Autoconf 2.69. Invocation command line was 48493 48494 $ $0 $@ 48495@@ -12390,7 +12390,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 48496 # report actual input values of CONFIG_FILES etc. instead of their 48497 # values after options handling. 48498 ac_log=" 48499-This file was extended by sqlite $as_me 3.39.2, which was 48500+This file was extended by sqlite $as_me 3.39.4, which was 48501 generated by GNU Autoconf 2.69. Invocation command line was 48502 48503 CONFIG_FILES = $CONFIG_FILES 48504@@ -12456,7 +12456,7 @@ _ACEOF 48505 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 48506 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 48507 ac_cs_version="\\ 48508-sqlite config.status 3.39.2 48509+sqlite config.status 3.39.4 48510 configured by $0, generated by GNU Autoconf 2.69, 48511 with options \\"\$ac_cs_config\\" 48512 48513diff --git a/src/third_party/sqlite/src/ext/fts3/fts3.c b/src/third_party/sqlite/src/ext/fts3/fts3.c 48514index 1a1672512ada2..c43eac4914ce4 48515--- a/src/third_party/sqlite/src/ext/fts3/fts3.c 48516+++ b/src/third_party/sqlite/src/ext/fts3/fts3.c 48517@@ -2888,7 +2888,7 @@ static int fts3TermSelectMerge( 48518 ** 48519 ** Similar padding is added in the fts3DoclistOrMerge() function. 48520 */ 48521- pTS->aaOutput[0] = sqlite3_malloc(nDoclist + FTS3_VARINT_MAX + 1); 48522+ pTS->aaOutput[0] = sqlite3_malloc64((i64)nDoclist + FTS3_VARINT_MAX + 1); 48523 pTS->anOutput[0] = nDoclist; 48524 if( pTS->aaOutput[0] ){ 48525 memcpy(pTS->aaOutput[0], aDoclist, nDoclist); 48526@@ -4376,7 +4376,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ 48527 nDistance = iPrev - nMaxUndeferred; 48528 } 48529 48530- aOut = (char *)sqlite3_malloc(nPoslist+8); 48531+ aOut = (char *)sqlite3Fts3MallocZero(nPoslist+FTS3_BUFFER_PADDING); 48532 if( !aOut ){ 48533 sqlite3_free(aPoslist); 48534 return SQLITE_NOMEM; 48535@@ -4745,7 +4745,7 @@ static int fts3EvalIncrPhraseNext( 48536 if( bEof==0 ){ 48537 int nList = 0; 48538 int nByte = a[p->nToken-1].nList; 48539- char *aDoclist = sqlite3_malloc(nByte+FTS3_BUFFER_PADDING); 48540+ char *aDoclist = sqlite3_malloc64((i64)nByte+FTS3_BUFFER_PADDING); 48541 if( !aDoclist ) return SQLITE_NOMEM; 48542 memcpy(aDoclist, a[p->nToken-1].pList, nByte+1); 48543 memset(&aDoclist[nByte], 0, FTS3_BUFFER_PADDING); 48544diff --git a/src/third_party/sqlite/src/ext/fts3/fts3Int.h b/src/third_party/sqlite/src/ext/fts3/fts3Int.h 48545index 0626486edff3a..e821d6be31352 48546--- a/src/third_party/sqlite/src/ext/fts3/fts3Int.h 48547+++ b/src/third_party/sqlite/src/ext/fts3/fts3Int.h 48548@@ -558,7 +558,7 @@ struct Fts3MultiSegReader { 48549 int nAdvance; /* How many seg-readers to advance */ 48550 Fts3SegFilter *pFilter; /* Pointer to filter object */ 48551 char *aBuffer; /* Buffer to merge doclists in */ 48552- int nBuffer; /* Allocated size of aBuffer[] in bytes */ 48553+ i64 nBuffer; /* Allocated size of aBuffer[] in bytes */ 48554 48555 int iColFilter; /* If >=0, filter for this column */ 48556 int bRestart; 48557diff --git a/src/third_party/sqlite/src/ext/fts3/fts3_porter.c b/src/third_party/sqlite/src/ext/fts3/fts3_porter.c 48558index 8fb4c25daa0a9..fbe7913020a4e 48559--- a/src/third_party/sqlite/src/ext/fts3/fts3_porter.c 48560+++ b/src/third_party/sqlite/src/ext/fts3/fts3_porter.c 48561@@ -621,7 +621,7 @@ static int porterNext( 48562 if( n>c->nAllocated ){ 48563 char *pNew; 48564 c->nAllocated = n+20; 48565- pNew = sqlite3_realloc(c->zToken, c->nAllocated); 48566+ pNew = sqlite3_realloc64(c->zToken, c->nAllocated); 48567 if( !pNew ) return SQLITE_NOMEM; 48568 c->zToken = pNew; 48569 } 48570diff --git a/src/third_party/sqlite/src/ext/fts3/fts3_tokenizer1.c b/src/third_party/sqlite/src/ext/fts3/fts3_tokenizer1.c 48571index deea06d92bf89..78e5889da5250 48572--- a/src/third_party/sqlite/src/ext/fts3/fts3_tokenizer1.c 48573+++ b/src/third_party/sqlite/src/ext/fts3/fts3_tokenizer1.c 48574@@ -185,7 +185,7 @@ static int simpleNext( 48575 if( n>c->nTokenAllocated ){ 48576 char *pNew; 48577 c->nTokenAllocated = n+20; 48578- pNew = sqlite3_realloc(c->pToken, c->nTokenAllocated); 48579+ pNew = sqlite3_realloc64(c->pToken, c->nTokenAllocated); 48580 if( !pNew ) return SQLITE_NOMEM; 48581 c->pToken = pNew; 48582 } 48583diff --git a/src/third_party/sqlite/src/ext/fts3/fts3_write.c b/src/third_party/sqlite/src/ext/fts3/fts3_write.c 48584index f1a4bd6bba231..6a727eaf5f9cd 48585--- a/src/third_party/sqlite/src/ext/fts3/fts3_write.c 48586+++ b/src/third_party/sqlite/src/ext/fts3/fts3_write.c 48587@@ -649,7 +649,7 @@ static int fts3PendingListAppendVarint( 48588 48589 /* Allocate or grow the PendingList as required. */ 48590 if( !p ){ 48591- p = sqlite3_malloc(sizeof(*p) + 100); 48592+ p = sqlite3_malloc64(sizeof(*p) + 100); 48593 if( !p ){ 48594 return SQLITE_NOMEM; 48595 } 48596@@ -658,14 +658,14 @@ static int fts3PendingListAppendVarint( 48597 p->nData = 0; 48598 } 48599 else if( p->nData+FTS3_VARINT_MAX+1>p->nSpace ){ 48600- int nNew = p->nSpace * 2; 48601- p = sqlite3_realloc(p, sizeof(*p) + nNew); 48602+ i64 nNew = p->nSpace * 2; 48603+ p = sqlite3_realloc64(p, sizeof(*p) + nNew); 48604 if( !p ){ 48605 sqlite3_free(*pp); 48606 *pp = 0; 48607 return SQLITE_NOMEM; 48608 } 48609- p->nSpace = nNew; 48610+ p->nSpace = (int)nNew; 48611 p->aData = (char *)&p[1]; 48612 } 48613 48614@@ -1222,7 +1222,7 @@ int sqlite3Fts3ReadBlock( 48615 int nByte = sqlite3_blob_bytes(p->pSegments); 48616 *pnBlob = nByte; 48617 if( paBlob ){ 48618- char *aByte = sqlite3_malloc(nByte + FTS3_NODE_PADDING); 48619+ char *aByte = sqlite3_malloc64((i64)nByte + FTS3_NODE_PADDING); 48620 if( !aByte ){ 48621 rc = SQLITE_NOMEM; 48622 }else{ 48623@@ -1339,7 +1339,7 @@ static int fts3SegReaderNext( 48624 int nTerm = fts3HashKeysize(pElem); 48625 if( (nTerm+1)>pReader->nTermAlloc ){ 48626 sqlite3_free(pReader->zTerm); 48627- pReader->zTerm = (char*)sqlite3_malloc((nTerm+1)*2); 48628+ pReader->zTerm = (char*)sqlite3_malloc64(((i64)nTerm+1)*2); 48629 if( !pReader->zTerm ) return SQLITE_NOMEM; 48630 pReader->nTermAlloc = (nTerm+1)*2; 48631 } 48632@@ -1347,7 +1347,7 @@ static int fts3SegReaderNext( 48633 pReader->zTerm[nTerm] = '\0'; 48634 pReader->nTerm = nTerm; 48635 48636- aCopy = (char*)sqlite3_malloc(nCopy); 48637+ aCopy = (char*)sqlite3_malloc64(nCopy); 48638 if( !aCopy ) return SQLITE_NOMEM; 48639 memcpy(aCopy, pList->aData, nCopy); 48640 pReader->nNode = pReader->nDoclist = nCopy; 48641@@ -1634,7 +1634,7 @@ int sqlite3Fts3SegReaderNew( 48642 nExtra = nRoot + FTS3_NODE_PADDING; 48643 } 48644 48645- pReader = (Fts3SegReader *)sqlite3_malloc(sizeof(Fts3SegReader) + nExtra); 48646+ pReader = (Fts3SegReader *)sqlite3_malloc64(sizeof(Fts3SegReader) + nExtra); 48647 if( !pReader ){ 48648 return SQLITE_NOMEM; 48649 } 48650@@ -1726,7 +1726,7 @@ int sqlite3Fts3SegReaderPending( 48651 if( nElem==nAlloc ){ 48652 Fts3HashElem **aElem2; 48653 nAlloc += 16; 48654- aElem2 = (Fts3HashElem **)sqlite3_realloc( 48655+ aElem2 = (Fts3HashElem **)sqlite3_realloc64( 48656 aElem, nAlloc*sizeof(Fts3HashElem *) 48657 ); 48658 if( !aElem2 ){ 48659@@ -2060,7 +2060,7 @@ static int fts3NodeAddTerm( 48660 ** this is not expected to be a serious problem. 48661 */ 48662 assert( pTree->aData==(char *)&pTree[1] ); 48663- pTree->aData = (char *)sqlite3_malloc(nReq); 48664+ pTree->aData = (char *)sqlite3_malloc64(nReq); 48665 if( !pTree->aData ){ 48666 return SQLITE_NOMEM; 48667 } 48668@@ -2078,7 +2078,7 @@ static int fts3NodeAddTerm( 48669 48670 if( isCopyTerm ){ 48671 if( pTree->nMalloc<nTerm ){ 48672- char *zNew = sqlite3_realloc(pTree->zMalloc, nTerm*2); 48673+ char *zNew = sqlite3_realloc64(pTree->zMalloc, (i64)nTerm*2); 48674 if( !zNew ){ 48675 return SQLITE_NOMEM; 48676 } 48677@@ -2104,7 +2104,7 @@ static int fts3NodeAddTerm( 48678 ** now. Instead, the term is inserted into the parent of pTree. If pTree 48679 ** has no parent, one is created here. 48680 */ 48681- pNew = (SegmentNode *)sqlite3_malloc(sizeof(SegmentNode) + p->nNodeSize); 48682+ pNew = (SegmentNode *)sqlite3_malloc64(sizeof(SegmentNode) + p->nNodeSize); 48683 if( !pNew ){ 48684 return SQLITE_NOMEM; 48685 } 48686@@ -2242,7 +2242,7 @@ static int fts3SegWriterAdd( 48687 ){ 48688 int nPrefix; /* Size of term prefix in bytes */ 48689 int nSuffix; /* Size of term suffix in bytes */ 48690- int nReq; /* Number of bytes required on leaf page */ 48691+ i64 nReq; /* Number of bytes required on leaf page */ 48692 int nData; 48693 SegmentWriter *pWriter = *ppWriter; 48694 48695@@ -2251,13 +2251,13 @@ static int fts3SegWriterAdd( 48696 sqlite3_stmt *pStmt; 48697 48698 /* Allocate the SegmentWriter structure */ 48699- pWriter = (SegmentWriter *)sqlite3_malloc(sizeof(SegmentWriter)); 48700+ pWriter = (SegmentWriter *)sqlite3_malloc64(sizeof(SegmentWriter)); 48701 if( !pWriter ) return SQLITE_NOMEM; 48702 memset(pWriter, 0, sizeof(SegmentWriter)); 48703 *ppWriter = pWriter; 48704 48705 /* Allocate a buffer in which to accumulate data */ 48706- pWriter->aData = (char *)sqlite3_malloc(p->nNodeSize); 48707+ pWriter->aData = (char *)sqlite3_malloc64(p->nNodeSize); 48708 if( !pWriter->aData ) return SQLITE_NOMEM; 48709 pWriter->nSize = p->nNodeSize; 48710 48711@@ -2332,7 +2332,7 @@ static int fts3SegWriterAdd( 48712 ** the buffer to make it large enough. 48713 */ 48714 if( nReq>pWriter->nSize ){ 48715- char *aNew = sqlite3_realloc(pWriter->aData, nReq); 48716+ char *aNew = sqlite3_realloc64(pWriter->aData, nReq); 48717 if( !aNew ) return SQLITE_NOMEM; 48718 pWriter->aData = aNew; 48719 pWriter->nSize = nReq; 48720@@ -2357,7 +2357,7 @@ static int fts3SegWriterAdd( 48721 */ 48722 if( isCopyTerm ){ 48723 if( nTerm>pWriter->nMalloc ){ 48724- char *zNew = sqlite3_realloc(pWriter->zMalloc, nTerm*2); 48725+ char *zNew = sqlite3_realloc64(pWriter->zMalloc, (i64)nTerm*2); 48726 if( !zNew ){ 48727 return SQLITE_NOMEM; 48728 } 48729@@ -2665,12 +2665,12 @@ static void fts3ColumnFilter( 48730 static int fts3MsrBufferData( 48731 Fts3MultiSegReader *pMsr, /* Multi-segment-reader handle */ 48732 char *pList, 48733- int nList 48734+ i64 nList 48735 ){ 48736 if( nList>pMsr->nBuffer ){ 48737 char *pNew; 48738 pMsr->nBuffer = nList*2; 48739- pNew = (char *)sqlite3_realloc(pMsr->aBuffer, pMsr->nBuffer); 48740+ pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, pMsr->nBuffer); 48741 if( !pNew ) return SQLITE_NOMEM; 48742 pMsr->aBuffer = pNew; 48743 } 48744@@ -2726,7 +2726,7 @@ int sqlite3Fts3MsrIncrNext( 48745 fts3SegReaderSort(pMsr->apSegment, nMerge, j, xCmp); 48746 48747 if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){ 48748- rc = fts3MsrBufferData(pMsr, pList, nList+1); 48749+ rc = fts3MsrBufferData(pMsr, pList, (i64)nList+1); 48750 if( rc!=SQLITE_OK ) return rc; 48751 assert( (pMsr->aBuffer[nList] & 0xFE)==0x00 ); 48752 pList = pMsr->aBuffer; 48753@@ -2863,11 +2863,11 @@ int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr){ 48754 return SQLITE_OK; 48755 } 48756 48757-static int fts3GrowSegReaderBuffer(Fts3MultiSegReader *pCsr, int nReq){ 48758+static int fts3GrowSegReaderBuffer(Fts3MultiSegReader *pCsr, i64 nReq){ 48759 if( nReq>pCsr->nBuffer ){ 48760 char *aNew; 48761 pCsr->nBuffer = nReq*2; 48762- aNew = sqlite3_realloc(pCsr->aBuffer, pCsr->nBuffer); 48763+ aNew = sqlite3_realloc64(pCsr->aBuffer, pCsr->nBuffer); 48764 if( !aNew ){ 48765 return SQLITE_NOMEM; 48766 } 48767@@ -2958,7 +2958,8 @@ int sqlite3Fts3SegReaderStep( 48768 ){ 48769 pCsr->nDoclist = apSegment[0]->nDoclist; 48770 if( fts3SegReaderIsPending(apSegment[0]) ){ 48771- rc = fts3MsrBufferData(pCsr, apSegment[0]->aDoclist, pCsr->nDoclist); 48772+ rc = fts3MsrBufferData(pCsr, apSegment[0]->aDoclist, 48773+ (i64)pCsr->nDoclist); 48774 pCsr->aDoclist = pCsr->aBuffer; 48775 }else{ 48776 pCsr->aDoclist = apSegment[0]->aDoclist; 48777@@ -3011,7 +3012,8 @@ int sqlite3Fts3SegReaderStep( 48778 48779 nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0); 48780 48781- rc = fts3GrowSegReaderBuffer(pCsr, nByte+nDoclist+FTS3_NODE_PADDING); 48782+ rc = fts3GrowSegReaderBuffer(pCsr, 48783+ (i64)nByte+nDoclist+FTS3_NODE_PADDING); 48784 if( rc ) return rc; 48785 48786 if( isFirst ){ 48787@@ -3037,7 +3039,7 @@ int sqlite3Fts3SegReaderStep( 48788 fts3SegReaderSort(apSegment, nMerge, j, xCmp); 48789 } 48790 if( nDoclist>0 ){ 48791- rc = fts3GrowSegReaderBuffer(pCsr, nDoclist+FTS3_NODE_PADDING); 48792+ rc = fts3GrowSegReaderBuffer(pCsr, (i64)nDoclist+FTS3_NODE_PADDING); 48793 if( rc ) return rc; 48794 memset(&pCsr->aBuffer[nDoclist], 0, FTS3_NODE_PADDING); 48795 pCsr->aDoclist = pCsr->aBuffer; 48796@@ -3750,7 +3752,7 @@ struct NodeReader { 48797 static void blobGrowBuffer(Blob *pBlob, int nMin, int *pRc){ 48798 if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){ 48799 int nAlloc = nMin; 48800- char *a = (char *)sqlite3_realloc(pBlob->a, nAlloc); 48801+ char *a = (char *)sqlite3_realloc64(pBlob->a, nAlloc); 48802 if( a ){ 48803 pBlob->nAlloc = nAlloc; 48804 pBlob->a = a; 48805@@ -4547,7 +4549,7 @@ static int fts3RepackSegdirLevel( 48806 if( nIdx>=nAlloc ){ 48807 int *aNew; 48808 nAlloc += 16; 48809- aNew = sqlite3_realloc(aIdx, nAlloc*sizeof(int)); 48810+ aNew = sqlite3_realloc64(aIdx, nAlloc*sizeof(int)); 48811 if( !aNew ){ 48812 rc = SQLITE_NOMEM; 48813 break; 48814@@ -4921,7 +4923,7 @@ int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ 48815 48816 /* Allocate space for the cursor, filter and writer objects */ 48817 const int nAlloc = sizeof(*pCsr) + sizeof(*pFilter) + sizeof(*pWriter); 48818- pWriter = (IncrmergeWriter *)sqlite3_malloc(nAlloc); 48819+ pWriter = (IncrmergeWriter *)sqlite3_malloc64(nAlloc); 48820 if( !pWriter ) return SQLITE_NOMEM; 48821 pFilter = (Fts3SegFilter *)&pWriter[1]; 48822 pCsr = (Fts3MultiSegReader *)&pFilter[1]; 48823@@ -5557,7 +5559,7 @@ int sqlite3Fts3DeferredTokenList( 48824 return SQLITE_OK; 48825 } 48826 48827- pRet = (char *)sqlite3_malloc(p->pList->nData); 48828+ pRet = (char *)sqlite3_malloc64(p->pList->nData); 48829 if( !pRet ) return SQLITE_NOMEM; 48830 48831 nSkip = sqlite3Fts3GetVarint(p->pList->aData, &dummy); 48832@@ -5577,7 +5579,7 @@ int sqlite3Fts3DeferToken( 48833 int iCol /* Column that token must appear in (or -1) */ 48834 ){ 48835 Fts3DeferredToken *pDeferred; 48836- pDeferred = sqlite3_malloc(sizeof(*pDeferred)); 48837+ pDeferred = sqlite3_malloc64(sizeof(*pDeferred)); 48838 if( !pDeferred ){ 48839 return SQLITE_NOMEM; 48840 } 48841diff --git a/src/third_party/sqlite/src/ext/icu/icu.c b/src/third_party/sqlite/src/ext/icu/icu.c 48842index 92d7c5438e4d1..e745ab0253865 48843--- a/src/third_party/sqlite/src/ext/icu/icu.c 48844+++ b/src/third_party/sqlite/src/ext/icu/icu.c 48845@@ -299,8 +299,9 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ 48846 48847 if( U_SUCCESS(status) ){ 48848 sqlite3_set_auxdata(p, 0, pExpr, icuRegexpDelete); 48849- }else{ 48850- assert(!pExpr); 48851+ pExpr = sqlite3_get_auxdata(p, 0); 48852+ } 48853+ if( !pExpr ){ 48854 icuFunctionError(p, "uregex_open", status); 48855 return; 48856 } 48857diff --git a/src/third_party/sqlite/src/ext/rtree/geopoly.c b/src/third_party/sqlite/src/ext/rtree/geopoly.c 48858index 68cde873442d4..7b41e790920f8 48859--- a/src/third_party/sqlite/src/ext/rtree/geopoly.c 48860+++ b/src/third_party/sqlite/src/ext/rtree/geopoly.c 48861@@ -1695,7 +1695,7 @@ static int geopolyUpdate( 48862 sqlite3_free(p); 48863 nChange = 1; 48864 } 48865- for(jj=1; jj<pRtree->nAux; jj++){ 48866+ for(jj=1; jj<nData-2; jj++){ 48867 nChange++; 48868 sqlite3_bind_value(pUp, jj+2, aData[jj+2]); 48869 } 48870diff --git a/src/third_party/sqlite/src/manifest b/src/third_party/sqlite/src/manifest 48871index 7a3c6e9635492..229149d08dd66 48872--- a/src/third_party/sqlite/src/manifest 48873+++ b/src/third_party/sqlite/src/manifest 48874@@ -1,5 +1,5 @@ 48875-C Version\s3.39.2 48876-D 2022-07-21T15:24:47.212 48877+C Version\s3.39.4 48878+D 2022-09-29T15:55:41.801 48879 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 48880 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea 48881 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 48882@@ -7,7 +7,7 @@ F Makefile.in 4e1cacdce04497567464116cf5798674e8a21e15b4d44838ceaa8a49c527028c 48883 F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241 48884 F Makefile.msc de7cb3e095ce2fdc33513ccd76ebdaeda1483d0ddab0410fe65cbdeadd4c0ee1 48885 F README.md 8b8df9ca852aeac4864eb1e400002633ee6db84065bd01b78c33817f97d31f5e 48886-F VERSION 10105f5660ef070881d1a9cd2ac5cea1ab539c85bc0a4196d3fb8c7de513aa6c 48887+F VERSION ad74f073c8910c112b5db75d9a7be486305a91d8a352d53f2a4c7dda9e9e5efa 48888 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 48889 F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 48890 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 48891@@ -34,7 +34,7 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63 48892 F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6 48893 F config.h.in 6376abec766e9a0785178b1823b5a587e9f1ccbc 48894 F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559 48895-F configure cafd64df0dc76ea68574e355fd5831de9836a95ac5750a1fb98e176a44f6bf12 x 48896+F configure 01ce1a8ad8aa8450bc4e7bef937588a116ed724aa49802537ec9399ee18a8488 x 48897 F configure.ac 3ef6eeff4387585bfcab76b0c3f6e15a0618587bb90245dd5d44e4378141bb35 48898 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad 48899 F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd 48900@@ -102,25 +102,25 @@ F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c 48901 F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a 48902 F ext/fts3/README.tokenizers b92bdeb8b46503f0dd301d364efc5ef59ef9fa8e2758b8e742f39fa93a2e422d 48903 F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d 48904-F ext/fts3/fts3.c 8cd361bd8612de3e5ec451d33ced8575cbc5af6744e7efc05d54bde4d2df3cd0 48905+F ext/fts3/fts3.c 46c116ee0868fc09520d61a1b747c62343c71c399ba67a3d0395b0be29b1a19f 48906 F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe 48907-F ext/fts3/fts3Int.h dafdc371f9fbab175744b06cfe019d5f040cdfdbd11fea752f5dc28d45b04c05 48908+F ext/fts3/fts3Int.h ae2a44b04cddb5fb35cac4ea5f7f819b2894fd258186465777a19f7acfdf84ed 48909 F ext/fts3/fts3_aux.c f0dc9bd98582615b7750218899bd0c729879b6bbf94d1be57ca1833ff49afc6f 48910 F ext/fts3/fts3_expr.c 903bfb9433109fffb10e910d7066c49cbf8eeae316adc93f0499c4da7dfc932a 48911 F ext/fts3/fts3_hash.c 8b6e31bfb0844c27dc6092c2620bdb1fca17ed613072db057d96952c6bdb48b7 48912 F ext/fts3/fts3_hash.h 39cf6874dc239d6b4e30479b1975fe5b22a3caaf 48913 F ext/fts3/fts3_icu.c 305ce7fb6036484085b5556a9c8e62acdc7763f0f4cdf5fd538212a9f3720116 48914-F ext/fts3/fts3_porter.c 3565faf04b626cddf85f03825e86056a4562c009 48915+F ext/fts3/fts3_porter.c e19807ce0ae31c1c6e9898e89ecc93183d7ec224ea101af039722a4f49e5f2b8 48916 F ext/fts3/fts3_snippet.c f9a8149173553113f3c495a503843e30028b5dc3723d0ca798c5ad6142e130e6 48917 F ext/fts3/fts3_term.c f45a1e7c6ef464abb1231245d123dae12266b69e05cc56e14045b76591ae92d1 48918 F ext/fts3/fts3_test.c d8d7b2734f894e8a489987447658e374cdd3a3bc8575c401decf1911cb7c6454 48919 F ext/fts3/fts3_tokenize_vtab.c a95feda3590f3c3e17672fe35b67ea6112471aeea4c07ef7744a6606b66549aa 48920 F ext/fts3/fts3_tokenizer.c 6d8fc150c48238955d5182bf661498db0dd473c8a2a80e00c16994a646fa96e7 48921 F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3 48922-F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004 48923+F ext/fts3/fts3_tokenizer1.c c1de4ae28356ad98ccb8b2e3388a7fdcce7607b5523738c9afb6275dab765154 48924 F ext/fts3/fts3_unicode.c de426ff05c1c2e7bce161cf6b706638419c3a1d9c2667de9cb9dc0458c18e226 48925 F ext/fts3/fts3_unicode2.c 416eb7e1e81142703520d284b768ca2751d40e31fa912cae24ba74860532bf0f 48926-F ext/fts3/fts3_write.c 85279b980f99253c296006503a13f92957ec49b716123083f021acc74545ecfc 48927+F ext/fts3/fts3_write.c 4fb644df0ff840267e47a724286c7a1fa5540273a7ce15756dd5913a101ec302 48928 F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9 48929 F ext/fts3/tool/fts3cov.sh c331d006359456cf6f8f953e37f2b9c7d568f3863f00bb5f7eb87fea4ac01b73 48930 F ext/fts3/tool/fts3view.c 413c346399159df81f86c4928b7c4a455caab73bfbc8cd68f950f632e5751674 48931@@ -255,7 +255,7 @@ F ext/fts5/tool/loadfts5.tcl 95b03429ee6b138645703c6ca192c3ac96eaf093 48932 F ext/fts5/tool/mkfts5c.tcl 3eba8e9bee4221ed165f3304b51b2a74a705f4ec5df3d044573a2be539534af8 48933 F ext/fts5/tool/showfts5.tcl d54da0e067306663e2d5d523965ca487698e722c 48934 F ext/icu/README.txt 7ab7ced8ae78e3a645b57e78570ff589d4c672b71370f5aa9e1cd7024f400fc9 48935-F ext/icu/icu.c 91c021c7e3e8bbba286960810fa303295c622e323567b2e6def4ce58e4466e60 48936+F ext/icu/icu.c c074519b46baa484bb5396c7e01e051034da8884bad1a1cb7f09bbe6be3f0282 48937 F ext/icu/sqliteicu.h fa373836ed5a1ee7478bdf8a1650689294e41d0c89c1daab26e9ae78a32075a8 48938 F ext/lsm1/Makefile a553b728bba6c11201b795188c5708915cc4290f02b7df6ba7e8c4c943fd5cd9 48939 F ext/lsm1/Makefile.msc f8c878b467232226de288da320e1ac71c131f5ec91e08b21f502303347260013 48940@@ -413,7 +413,7 @@ F ext/repair/test/checkfreelist01.test 3e8aa6aeb4007680c94a8d07b41c339aa635cc782 48941 F ext/repair/test/checkindex01.test b530f141413b587c9eb78ff734de6bb79bc3515c335096108c12c01bddbadcec 48942 F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c 48943 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761 48944-F ext/rtree/geopoly.c cc3f89c11abcf114fa60d74709ae8b5bc1eae5a261b30bc1bb7085089c03bfab 48945+F ext/rtree/geopoly.c bb0dcd013dbb3fe0335b6bbae0d9c29fcfffda93d5ef6c31daa47e802132e435 48946 F ext/rtree/rtree.c d7b4b8b81d8d54376a7f81de5be85ec58b37c11604bcf42984a8418b34158d93 48947 F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412 48948 F ext/rtree/rtree1.test d47f58832145fcfed9067bc457ca8664962196c4566c17a1ebd679367db55d11 48949@@ -510,7 +510,7 @@ F src/auth.c f4fa91b6a90bbc8e0d0f738aa284551739c9543a367071f55574681e0f24f8cf 48950 F src/backup.c a2891172438e385fdbe97c11c9745676bec54f518d4447090af97189fd8e52d7 48951 F src/bitvec.c 7c849aac407230278445cb069bebc5f89bf2ddd87c5ed9459b070a9175707b3d 48952 F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6 48953-F src/btree.c b5a74c39d3123dadd190019c0afadd7f62b43dfe0712a39e9d0ff2fe26be5d93 48954+F src/btree.c 98e30d582239e1c940390f6487aa0d231691989a142fa863a689c021517ede08 48955 F src/btree.h 74d64b8f28cfa4a894d14d4ed64fa432cd697b98b61708d4351482ae15913e22 48956 F src/btreeInt.h 8ce1332edd89dfd2461d561ac10a0ab5601c8e06200cb5230596c3caaf54482e 48957 F src/build.c 29fcc97af5197511788a571ed35a001eea472cbe3bcdbae88178e17fcafd4341 48958@@ -535,7 +535,7 @@ F src/json.c 7749b98c62f691697c7ee536b570c744c0583cab4a89200fdd0fc2aa8cc8cbd6 48959 F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa 48960 F src/loadext.c 853385cc7a604157e137585097949252d5d0c731768e16b044608e5c95c3614b 48961 F src/main.c b91c7e71af6f33640c35b8239a285040aad8dfcfdaaf979152e743c0f8017ea8 48962-F src/malloc.c a9127efdcef92d6934c6339ea9813075b90edc0ce2e5c723556381a3828fb720 48963+F src/malloc.c 4a3785323104678a8b4b0a482fe0c2a80900e7468ddf76ab0f2ea1c79a8ca8cd 48964 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 48965 F src/mem1.c c12a42539b1ba105e3707d0e628ad70e611040d8f5e38cf942cee30c867083de 48966 F src/mem2.c c8bfc9446fd0798bddd495eb5d9dbafa7d4b7287d8c22d50a83ac9daa26d8a75 48967@@ -554,28 +554,28 @@ F src/os.c b1c4f2d485961e9a5b6b648c36687d25047c252222e9660b7cc25a6e1ea436ab 48968 F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63 48969 F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85 48970 F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586 48971-F src/os_unix.c 2df2b33db88f00af13805d4573ee126bc5973f9e3b91d03c575fa7ba64e7dc41 48972-F src/os_win.c a8ea80037e81127ca01959daa87387cc135f325c88dc745376c4f760de852a10 48973+F src/os_unix.c e020676e334a0a78c3affb7dd1789a240071ed6af98309f1bef76948cb8382bd 48974+F src/os_win.c e9454cb141908e8eef2102180bad353a36480612d5b736e4c2bd5777d9b25a34 48975 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a 48976-F src/pager.c 74596fc3d5d8a50de32c37225fc300cccd5ea27ea303c5f4b845d6572f999c5f 48977+F src/pager.c 8c3853cad320c24904a2f970777bbdda2deb9572f53e6a1d73b28b85a7fd30cc 48978 F src/pager.h f82e9844166e1585f5786837ddc7709966138ced17f568c16af7ccf946c2baa3 48979 F src/parse.y 8e67d820030d2655b9942ffe61c1e7e6b96cea2f2f72183533299393907d0564 48980-F src/pcache.c 084e638432c610f95aea72b8509f0845d2791293f39d1b82f0c0a7e089c3bb6b 48981+F src/pcache.c 5df59c993907b742dfac6aa9038d2515856bede56040a7640d39d06e1c93b494 48982 F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586 48983-F src/pcache1.c 54881292a9a5db202b2c0ac541c5e3ef9a5e8c4f1c1383adb2601d5499a60e65 48984-F src/pragma.c d1aead03e8418ff586c7cfca344c50a914b8eb06abd841e8e91a982d823671da 48985+F src/pcache1.c 3e6267b17bae4cbaf02dfa08c4507794452991206862e3fc5c94d28313d32c18 48986+F src/pragma.c 404c0fe37b51f6def2c9ec6b07c80f0355673f0e74d720dc9a58a78725502417 48987 F src/pragma.h e690a356c18e98414d2e870ea791c1be1545a714ba623719deb63f7f226d8bb7 48988 F src/prepare.c c62820c15dcb63013519c8e41d9f928d7478672cc902cfd0581c733c271dbf45 48989 F src/printf.c e99ee9741e79ae3873458146f59644276657340385ade4e76a5f5d1c25793764 48990 F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c 48991 F src/resolve.c f0d663c9b1ceeb3e7d262ede872dd3b24b323a7cc11d84c05a39d962e7d64b07 48992 F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 48993-F src/select.c a5bff2d563375cbbc6a542e5b61fda2b0833c4ccbae8fef8bb789932995aff68 48994+F src/select.c fea5ae26259dc995b2144a28bbb5b013196dbcc86527cd992ed109b00af7f9e8 48995 F src/shell.c.in 2b85128ca8ea13fc2dc32f971d628d9f688a324a30f469619b817ce490764fcb 48996 F src/sqlite.h.in 01573eae96721f2a8ee2a9e3b7140ceeba2e9c44350911890b89b8ff0dcf6781 48997 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 48998 F src/sqlite3ext.h a988810c9b21c0dc36dc7a62735012339dc76fc7ab448fb0792721d30eacb69d 48999-F src/sqliteInt.h 059d5a017ebf488c7484f79ea507f56b2bf4bb700f340abf91c5d2227869f275 49000+F src/sqliteInt.h 9491831b5faa77584f0f7f52c087b48ba573714fa20a448a1550180ce42ef5aa 49001 F src/sqliteLimit.h d7323ffea5208c6af2734574bae933ca8ed2ab728083caa117c9738581a31657 49002 F src/status.c 4a3da6d77eeb3531cb0dbdf7047772a2a1b99f98c69e90ce009c75fe6328b2c0 49003 F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 49004@@ -636,17 +636,17 @@ F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 49005 F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c 49006 F src/tokenize.c 36eb0799e487759bbe73e5742b82ee676f06cea2515ff578d03c59a74ccf2d6c 49007 F src/treeview.c 07787f67cd297a6d09d04b8d70c06769c60c9c1d9080378f93929c16f8fd3298 49008-F src/trigger.c 61bea163b1fa3039bc572ed8312461b978e5c527e5301f302b078f4c1ccdec6a 49009+F src/trigger.c bc70c58e713dcfb6cabe5cc0bed71aedb02c3e9e128c6089a78aca945ba4d720 49010 F src/update.c c52a7991bece0453d22c77c08469512ee2f1391c12503fd347d1c939220c5877 49011 F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937 49012 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 49013-F src/util.c 602fe229f32a96ceccae4f40824129669582096f7c355f53dbac156c9fecef23 49014+F src/util.c 0be191521ff6d2805995f4910f0b6231b42843678b2efdc1abecaf39929a673f 49015 F src/vacuum.c bb346170b0b54c6683bba4a5983aea40485597fdf605c87ec8bc2e199fe88cd8 49016 F src/vdbe.c 3df15f0f2cd9d8faeeea18398a62f16c07fda2bfd8d726186f07508ad69b40e2 49017 F src/vdbe.h 07641758ca8b4f4c6d81ea667ea167c541e6ece21f5574da11e3d21ec37e2662 49018 F src/vdbeInt.h 2cad0aeeb106371ed0e0946bab89f60627087068847afc2451c05056961c18da 49019 F src/vdbeapi.c 602610f1252d59cd69742f78a1e2f6fbae40a4b407f5506a6a7b869b0df08ff2 49020-F src/vdbeaux.c 328b866880e67526300aa2361c5e50beb3d97dd8746db37dd4aa0135aea60e4d 49021+F src/vdbeaux.c dbdfa27cdaf91f18fbc960902fc45e79db3dbfcc05edd9f1f878c144437ce9f6 49022 F src/vdbeblob.c 5e61ce31aca17db8fb60395407457a8c1c7fb471dde405e0cd675974611dcfcd 49023 F src/vdbemem.c 5ebf05c0182addedb1607ade848e1c83cef40981df94d1abfab0c59288c6064f 49024 F src/vdbesort.c 43756031ca7430f7aec3ef904824a7883c4ede783e51f280d99b9b65c0796e35 49025@@ -659,7 +659,7 @@ F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a 49026 F src/walker.c f890a3298418d7cba3b69b8803594fdc484ea241206a8dfa99db6dd36f8cbb3b 49027 F src/where.c e7b7c9d37f4f8d14d4d05b20e57ae43712a51ffed7d45f547a23f9c42ee483dd 49028 F src/whereInt.h b48ca529ffe293c18cbfa8326af18a09e39910de66fb3e96ef788c7cbf8ef3a7 49029-F src/wherecode.c 0b09abfcb88c61c6a6984a3e065786631ff35495e9bdf865e6b74ab0a1299c5b 49030+F src/wherecode.c f8acceb057286ed95b66689d1981985228fd925001fdc49dbd3b112f4d739174 49031 F src/whereexpr.c 55a39f42aaf982574fbf52906371a84cceed98a994422198dfd03db4fce4cc46 49032 F src/window.c fff1b51757438c664e471d5184634e48dcdf8ea34b640f3b1b0810b1e06de18c 49033 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 49034@@ -1183,7 +1183,7 @@ F test/journal3.test 7c3cf23ffc77db06601c1fcfc9743de8441cb77db9d1aa931863d94f5ff 49035 F test/jrnlmode.test 9b5bc01dac22223cb60ec2d5f97acf568d73820794386de5634dcadbea9e1946 49036 F test/jrnlmode2.test 8759a1d4657c064637f8b079592651530db738419e1d649c6df7048cd724363d 49037 F test/jrnlmode3.test 556b447a05be0e0963f4311e95ab1632b11c9eaa 49038-F test/json101.test 9d46b8e254c4e23306da175dd226d5c4f164db6b294bcea98e5dcd891ba48c91 49039+F test/json101.test 9f6337e7423d2c1774d1d485c919fc4e11c8f7e423a2f8831f73471983432108 49040 F test/json102.test 327e77275f338c028faefa2da5164daf6b142a165e3015ff2a6e4251ddc6a0ac 49041 F test/json103.test 53df87f83a4e5fa0c0a56eb29ff6c94055c6eb919f33316d62161a8880112dbe 49042 F test/json104.test a502dc01853aada95d721b3b275afbe2dc18fffdac1fea6e96fb20c13586bbb5 49043@@ -1285,7 +1285,7 @@ F test/null.test b7ff206a1c60fe01aa2abd33ef9ea83c93727d993ca8a613de86e925c9f2bc6 49044 F test/nulls1.test 7a5e4346ee4285034100b4cd20e6784f16a9d6c927e44ecdf10034086bbee9c9 49045 F test/numcast.test 5d126f7f581432e86a90d1e35cac625164aec4a1 49046 F test/numindex1.test 20a5450d4b056e48cd5db30e659f13347a099823 49047-F test/offset1.test f06b83657bcf26f9ce805e67450e189e282143b2 49048+F test/offset1.test 72cca52482cbd5bc687cfa67aa2566c859081b5a353fd2f9da9bbd3914dea1ef 49049 F test/openv2.test 0d3040974bf402e19b7df4b783e447289d7ab394 49050 F test/optfuzz-db01.c 9f2fa80b8f84ebbf1f2e8b13421a4e0477fe300f6686fbd76cac1d2db66e0fdc 49051 F test/optfuzz-db01.txt 21f6bdeadc701cf11528276e2a55c70bfcb846ba42df327f979bd9e7b6ce7041 49052@@ -1390,7 +1390,7 @@ F test/securedel.test 2f70b2449186a1921bd01ec9da407fbfa98c3a7a5521854c300c194b2f 49053 F test/securedel2.test 2d54c28e46eb1fd6902089958b20b1b056c6f1c5 49054 F test/select1.test 692e84cfa29c405854c69e8a4027183d64c22952866a123fabbce741a379e889 49055 F test/select2.test 352480e0e9c66eda9c3044e412abdf5be0215b56 49056-F test/select3.test 399a0b23f8618bfe07ea24fb67f2952f620d6eba662bccabf6f4f71c2d89e6c9 49057+F test/select3.test ce4f78bbc809b0513f960f1ee84cdbc5af50ba112c343d5266558a8b2468f656 49058 F test/select4.test f0684d3da3bccacbe2a1ebadf6fb49d9df6f53acb4c6ebc228a88d0d6054cc7b 49059 F test/select5.test 8afc5e5dcdebc2be54472e73ebd9cd1adef1225fd15d37a1c62f969159f390ae 49060 F test/select6.test 9b2fb4ffedf52e1b5703cfcae1212e7a4a063f014c0458d78d29aca3db766d1f 49061@@ -1978,10 +1978,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 49062 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc 49063 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e 49064 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 49065-P 9141e873c575b049ce7aeaf313d05966f1966087caf33a6c80d2416a28571a21 49066-R 8d3cb391daa96d7d2c40e5bc9d5676de 49067+P 6607dd010359d0f2e07e49ce69d4bfd1e57c3505df5d667cf7735facf34112d7 49068+R 7ddc9e480f1c6dbefb10e119ae3343ea 49069 T +sym-release * 49070-T +sym-version-3.39.2 * 49071+T +sym-version-3.39.4 * 49072 U drh 49073-Z 89ae78e7fc05abf10cde154f943a869d 49074+Z 191c67622a74f691de0b6643916bb1a3 49075 # Remove this line to create a well-formed Fossil manifest. 49076diff --git a/src/third_party/sqlite/src/manifest.uuid b/src/third_party/sqlite/src/manifest.uuid 49077index d21002e2be16e..9979aed78d467 49078--- a/src/third_party/sqlite/src/manifest.uuid 49079+++ b/src/third_party/sqlite/src/manifest.uuid 49080@@ -1 +1 @@ 49081-698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603 49082\ No newline at end of file 49083+a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309 49084\ No newline at end of file 49085diff --git a/src/third_party/sqlite/src/src/btree.c b/src/third_party/sqlite/src/src/btree.c 49086index facb951d3cbd7..ebfca451b94d1 49087--- a/src/third_party/sqlite/src/src/btree.c 49088+++ b/src/third_party/sqlite/src/src/btree.c 49089@@ -1548,7 +1548,7 @@ static int defragmentPage(MemPage *pPage, int nMaxFrag){ 49090 if( iFree2+sz2 > usableSize ) return SQLITE_CORRUPT_PAGE(pPage); 49091 memmove(&data[iFree+sz+sz2], &data[iFree+sz], iFree2-(iFree+sz)); 49092 sz += sz2; 49093- }else if( NEVER(iFree+sz>usableSize) ){ 49094+ }else if( iFree+sz>usableSize ){ 49095 return SQLITE_CORRUPT_PAGE(pPage); 49096 } 49097 49098@@ -7904,8 +7904,6 @@ static int balance_nonroot( 49099 Pgno pgno; /* Temp var to store a page number in */ 49100 u8 abDone[NB+2]; /* True after i'th new page is populated */ 49101 Pgno aPgno[NB+2]; /* Page numbers of new pages before shuffling */ 49102- Pgno aPgOrder[NB+2]; /* Copy of aPgno[] used for sorting pages */ 49103- u16 aPgFlags[NB+2]; /* flags field of new pages before shuffling */ 49104 CellArray b; /* Parsed information on cells being balanced */ 49105 49106 memset(abDone, 0, sizeof(abDone)); 49107@@ -8329,42 +8327,39 @@ static int balance_nonroot( 49108 ** of the table is closer to a linear scan through the file. That in turn 49109 ** helps the operating system to deliver pages from the disk more rapidly. 49110 ** 49111- ** An O(n^2) insertion sort algorithm is used, but since n is never more 49112- ** than (NB+2) (a small constant), that should not be a problem. 49113+ ** An O(N*N) sort algorithm is used, but since N is never more than NB+2 49114+ ** (5), that is not a performance concern. 49115 ** 49116 ** When NB==3, this one optimization makes the database about 25% faster 49117 ** for large insertions and deletions. 49118 */ 49119 for(i=0; i<nNew; i++){ 49120- aPgOrder[i] = aPgno[i] = apNew[i]->pgno; 49121- aPgFlags[i] = apNew[i]->pDbPage->flags; 49122- for(j=0; j<i; j++){ 49123- if( NEVER(aPgno[j]==aPgno[i]) ){ 49124- /* This branch is taken if the set of sibling pages somehow contains 49125- ** duplicate entries. This can happen if the database is corrupt. 49126- ** It would be simpler to detect this as part of the loop below, but 49127- ** we do the detection here in order to avoid populating the pager 49128- ** cache with two separate objects associated with the same 49129- ** page number. */ 49130- assert( CORRUPT_DB ); 49131- rc = SQLITE_CORRUPT_BKPT; 49132- goto balance_cleanup; 49133- } 49134- } 49135+ aPgno[i] = apNew[i]->pgno; 49136+ assert( apNew[i]->pDbPage->flags & PGHDR_WRITEABLE ); 49137+ assert( apNew[i]->pDbPage->flags & PGHDR_DIRTY ); 49138 } 49139- for(i=0; i<nNew; i++){ 49140- int iBest = 0; /* aPgno[] index of page number to use */ 49141- for(j=1; j<nNew; j++){ 49142- if( aPgOrder[j]<aPgOrder[iBest] ) iBest = j; 49143- } 49144- pgno = aPgOrder[iBest]; 49145- aPgOrder[iBest] = 0xffffffff; 49146- if( iBest!=i ){ 49147- if( iBest>i ){ 49148- sqlite3PagerRekey(apNew[iBest]->pDbPage, pBt->nPage+iBest+1, 0); 49149- } 49150- sqlite3PagerRekey(apNew[i]->pDbPage, pgno, aPgFlags[iBest]); 49151- apNew[i]->pgno = pgno; 49152+ for(i=0; i<nNew-1; i++){ 49153+ int iB = i; 49154+ for(j=i+1; j<nNew; j++){ 49155+ if( apNew[j]->pgno < apNew[iB]->pgno ) iB = j; 49156+ } 49157+ 49158+ /* If apNew[i] has a page number that is bigger than any of the 49159+ ** subsequence apNew[i] entries, then swap apNew[i] with the subsequent 49160+ ** entry that has the smallest page number (which we know to be 49161+ ** entry apNew[iB]). 49162+ */ 49163+ if( iB!=i ){ 49164+ Pgno pgnoA = apNew[i]->pgno; 49165+ Pgno pgnoB = apNew[iB]->pgno; 49166+ Pgno pgnoTemp = (PENDING_BYTE/pBt->pageSize)+1; 49167+ u16 fgA = apNew[i]->pDbPage->flags; 49168+ u16 fgB = apNew[iB]->pDbPage->flags; 49169+ sqlite3PagerRekey(apNew[i]->pDbPage, pgnoTemp, fgB); 49170+ sqlite3PagerRekey(apNew[iB]->pDbPage, pgnoA, fgA); 49171+ sqlite3PagerRekey(apNew[i]->pDbPage, pgnoB, fgB); 49172+ apNew[i]->pgno = pgnoB; 49173+ apNew[iB]->pgno = pgnoA; 49174 } 49175 } 49176 49177diff --git a/src/third_party/sqlite/src/src/malloc.c b/src/third_party/sqlite/src/src/malloc.c 49178index cfda60a0b6c7b..c508bf752cc36 49179--- a/src/third_party/sqlite/src/src/malloc.c 49180+++ b/src/third_party/sqlite/src/src/malloc.c 49181@@ -776,8 +776,13 @@ void *sqlite3OomFault(sqlite3 *db){ 49182 } 49183 DisableLookaside; 49184 if( db->pParse ){ 49185+ Parse *pParse; 49186 sqlite3ErrorMsg(db->pParse, "out of memory"); 49187 db->pParse->rc = SQLITE_NOMEM_BKPT; 49188+ for(pParse=db->pParse->pOuterParse; pParse; pParse = pParse->pOuterParse){ 49189+ pParse->nErr++; 49190+ pParse->rc = SQLITE_NOMEM; 49191+ } 49192 } 49193 } 49194 return 0; 49195diff --git a/src/third_party/sqlite/src/src/os_unix.c b/src/third_party/sqlite/src/src/os_unix.c 49196index b933de3765ced..81a41263ba9c5 49197--- a/src/third_party/sqlite/src/src/os_unix.c 49198+++ b/src/third_party/sqlite/src/src/os_unix.c 49199@@ -5855,6 +5855,7 @@ static const char *unixTempFileDir(void){ 49200 static int unixGetTempname(int nBuf, char *zBuf){ 49201 const char *zDir; 49202 int iLimit = 0; 49203+ int rc = SQLITE_OK; 49204 49205 /* It's odd to simulate an io-error here, but really this is just 49206 ** using the io-error infrastructure to test that SQLite handles this 49207@@ -5863,18 +5864,26 @@ static int unixGetTempname(int nBuf, char *zBuf){ 49208 zBuf[0] = 0; 49209 SimulateIOError( return SQLITE_IOERR ); 49210 49211+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49212 zDir = unixTempFileDir(); 49213- if( zDir==0 ) return SQLITE_IOERR_GETTEMPPATH; 49214- do{ 49215- u64 r; 49216- sqlite3_randomness(sizeof(r), &r); 49217- assert( nBuf>2 ); 49218- zBuf[nBuf-2] = 0; 49219- sqlite3_snprintf(nBuf, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX"%llx%c", 49220- zDir, r, 0); 49221- if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ) return SQLITE_ERROR; 49222- }while( osAccess(zBuf,0)==0 ); 49223- return SQLITE_OK; 49224+ if( zDir==0 ){ 49225+ rc = SQLITE_IOERR_GETTEMPPATH; 49226+ }else{ 49227+ do{ 49228+ u64 r; 49229+ sqlite3_randomness(sizeof(r), &r); 49230+ assert( nBuf>2 ); 49231+ zBuf[nBuf-2] = 0; 49232+ sqlite3_snprintf(nBuf, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX"%llx%c", 49233+ zDir, r, 0); 49234+ if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ){ 49235+ rc = SQLITE_ERROR; 49236+ break; 49237+ } 49238+ }while( osAccess(zBuf,0)==0 ); 49239+ } 49240+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49241+ return rc; 49242 } 49243 49244 #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) 49245diff --git a/src/third_party/sqlite/src/src/os_win.c b/src/third_party/sqlite/src/src/os_win.c 49246index 8832c8012ae68..2827b0b49b9c9 49247--- a/src/third_party/sqlite/src/src/os_win.c 49248+++ b/src/third_party/sqlite/src/src/os_win.c 49249@@ -1918,10 +1918,12 @@ int sqlite3_win32_set_directory8( 49250 const char *zValue /* New value for directory being set or reset */ 49251 ){ 49252 char **ppDirectory = 0; 49253+ int rc; 49254 #ifndef SQLITE_OMIT_AUTOINIT 49255- int rc = sqlite3_initialize(); 49256+ rc = sqlite3_initialize(); 49257 if( rc ) return rc; 49258 #endif 49259+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49260 if( type==SQLITE_WIN32_DATA_DIRECTORY_TYPE ){ 49261 ppDirectory = &sqlite3_data_directory; 49262 }else if( type==SQLITE_WIN32_TEMP_DIRECTORY_TYPE ){ 49263@@ -1936,14 +1938,19 @@ int sqlite3_win32_set_directory8( 49264 if( zValue && zValue[0] ){ 49265 zCopy = sqlite3_mprintf("%s", zValue); 49266 if ( zCopy==0 ){ 49267- return SQLITE_NOMEM_BKPT; 49268+ rc = SQLITE_NOMEM_BKPT; 49269+ goto set_directory8_done; 49270 } 49271 } 49272 sqlite3_free(*ppDirectory); 49273 *ppDirectory = zCopy; 49274- return SQLITE_OK; 49275+ rc = SQLITE_OK; 49276+ }else{ 49277+ rc = SQLITE_ERROR; 49278 } 49279- return SQLITE_ERROR; 49280+set_directory8_done: 49281+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49282+ return rc; 49283 } 49284 49285 /* 49286@@ -4717,6 +4724,18 @@ static int winMakeEndInDirSep(int nBuf, char *zBuf){ 49287 return 0; 49288 } 49289 49290+/* 49291+** If sqlite3_temp_directory is not, take the mutex and return true. 49292+** 49293+** If sqlite3_temp_directory is NULL, omit the mutex and return false. 49294+*/ 49295+static int winTempDirDefined(void){ 49296+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49297+ if( sqlite3_temp_directory!=0 ) return 1; 49298+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49299+ return 0; 49300+} 49301+ 49302 /* 49303 ** Create a temporary file name and store the resulting pointer into pzBuf. 49304 ** The pointer returned in pzBuf must be freed via sqlite3_free(). 49305@@ -4753,20 +4772,23 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){ 49306 */ 49307 nDir = nMax - (nPre + 15); 49308 assert( nDir>0 ); 49309- if( sqlite3_temp_directory ){ 49310+ if( winTempDirDefined() ){ 49311 int nDirLen = sqlite3Strlen30(sqlite3_temp_directory); 49312 if( nDirLen>0 ){ 49313 if( !winIsDirSep(sqlite3_temp_directory[nDirLen-1]) ){ 49314 nDirLen++; 49315 } 49316 if( nDirLen>nDir ){ 49317+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49318 sqlite3_free(zBuf); 49319 OSTRACE(("TEMP-FILENAME rc=SQLITE_ERROR\n")); 49320 return winLogError(SQLITE_ERROR, 0, "winGetTempname1", 0); 49321 } 49322 sqlite3_snprintf(nMax, zBuf, "%s", sqlite3_temp_directory); 49323 } 49324+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49325 } 49326+ 49327 #if defined(__CYGWIN__) 49328 else{ 49329 static const char *azDirs[] = { 49330@@ -5555,7 +5577,7 @@ static BOOL winIsVerbatimPathname( 49331 ** pathname into zOut[]. zOut[] will be at least pVfs->mxPathname 49332 ** bytes in size. 49333 */ 49334-static int winFullPathname( 49335+static int winFullPathnameNoMutex( 49336 sqlite3_vfs *pVfs, /* Pointer to vfs object */ 49337 const char *zRelative, /* Possibly relative input path */ 49338 int nFull, /* Size of output buffer in bytes */ 49339@@ -5734,6 +5756,19 @@ static int winFullPathname( 49340 } 49341 #endif 49342 } 49343+static int winFullPathname( 49344+ sqlite3_vfs *pVfs, /* Pointer to vfs object */ 49345+ const char *zRelative, /* Possibly relative input path */ 49346+ int nFull, /* Size of output buffer in bytes */ 49347+ char *zFull /* Output buffer */ 49348+){ 49349+ int rc; 49350+ sqlite3_mutex *pMutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR); 49351+ sqlite3_mutex_enter(pMutex); 49352+ rc = winFullPathnameNoMutex(pVfs, zRelative, nFull, zFull); 49353+ sqlite3_mutex_leave(pMutex); 49354+ return rc; 49355+} 49356 49357 #ifndef SQLITE_OMIT_LOAD_EXTENSION 49358 /* 49359diff --git a/src/third_party/sqlite/src/src/pager.c b/src/third_party/sqlite/src/src/pager.c 49360index 95e6eb8af1870..dcb72857b637f 49361--- a/src/third_party/sqlite/src/src/pager.c 49362+++ b/src/third_party/sqlite/src/src/pager.c 49363@@ -5821,6 +5821,7 @@ static int pager_open_journal(Pager *pPager){ 49364 if( rc!=SQLITE_OK ){ 49365 sqlite3BitvecDestroy(pPager->pInJournal); 49366 pPager->pInJournal = 0; 49367+ pPager->journalOff = 0; 49368 }else{ 49369 assert( pPager->eState==PAGER_WRITER_LOCKED ); 49370 pPager->eState = PAGER_WRITER_CACHEMOD; 49371@@ -7376,7 +7377,7 @@ int sqlite3PagerGetJournalMode(Pager *pPager){ 49372 int sqlite3PagerOkToChangeJournalMode(Pager *pPager){ 49373 assert( assert_pager_state(pPager) ); 49374 if( pPager->eState>=PAGER_WRITER_CACHEMOD ) return 0; 49375- if( NEVER(isOpen(pPager->jfd) && pPager->journalOff>0) ) return 0; 49376+ if( isOpen(pPager->jfd) && pPager->journalOff>0 ) return 0; 49377 return 1; 49378 } 49379 49380diff --git a/src/third_party/sqlite/src/src/pcache.c b/src/third_party/sqlite/src/src/pcache.c 49381index 14d1e7cde0fca..e130affd2372a 49382--- a/src/third_party/sqlite/src/src/pcache.c 49383+++ b/src/third_party/sqlite/src/src/pcache.c 49384@@ -622,14 +622,24 @@ void sqlite3PcacheClearSyncFlags(PCache *pCache){ 49385 */ 49386 void sqlite3PcacheMove(PgHdr *p, Pgno newPgno){ 49387 PCache *pCache = p->pCache; 49388+ sqlite3_pcache_page *pOther; 49389 assert( p->nRef>0 ); 49390 assert( newPgno>0 ); 49391 assert( sqlite3PcachePageSanity(p) ); 49392 pcacheTrace(("%p.MOVE %d -> %d\n",pCache,p->pgno,newPgno)); 49393+ pOther = sqlite3GlobalConfig.pcache2.xFetch(pCache->pCache, newPgno, 0); 49394+ if( pOther ){ 49395+ PgHdr *pXPage = (PgHdr*)pOther->pExtra; 49396+ assert( pXPage->nRef==0 ); 49397+ pXPage->nRef++; 49398+ pCache->nRefSum++; 49399+ sqlite3PcacheDrop(pXPage); 49400+ } 49401 sqlite3GlobalConfig.pcache2.xRekey(pCache->pCache, p->pPage, p->pgno,newPgno); 49402 p->pgno = newPgno; 49403 if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){ 49404 pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT); 49405+ assert( sqlite3PcachePageSanity(p) ); 49406 } 49407 } 49408 49409diff --git a/src/third_party/sqlite/src/src/pcache1.c b/src/third_party/sqlite/src/src/pcache1.c 49410index a93b146894f15..ce595f2c20123 49411--- a/src/third_party/sqlite/src/src/pcache1.c 49412+++ b/src/third_party/sqlite/src/src/pcache1.c 49413@@ -1123,23 +1123,26 @@ static void pcache1Rekey( 49414 PCache1 *pCache = (PCache1 *)p; 49415 PgHdr1 *pPage = (PgHdr1 *)pPg; 49416 PgHdr1 **pp; 49417- unsigned int h; 49418+ unsigned int hOld, hNew; 49419 assert( pPage->iKey==iOld ); 49420 assert( pPage->pCache==pCache ); 49421+ assert( iOld!=iNew ); /* The page number really is changing */ 49422 49423 pcache1EnterMutex(pCache->pGroup); 49424- 49425- h = iOld%pCache->nHash; 49426- pp = &pCache->apHash[h]; 49427+ 49428+ assert( pcache1FetchNoMutex(p, iOld, 0)==pPage ); /* pPg really is iOld */ 49429+ hOld = iOld%pCache->nHash; 49430+ pp = &pCache->apHash[hOld]; 49431 while( (*pp)!=pPage ){ 49432 pp = &(*pp)->pNext; 49433 } 49434 *pp = pPage->pNext; 49435 49436- h = iNew%pCache->nHash; 49437+ assert( pcache1FetchNoMutex(p, iNew, 0)==0 ); /* iNew not in cache */ 49438+ hNew = iNew%pCache->nHash; 49439 pPage->iKey = iNew; 49440- pPage->pNext = pCache->apHash[h]; 49441- pCache->apHash[h] = pPage; 49442+ pPage->pNext = pCache->apHash[hNew]; 49443+ pCache->apHash[hNew] = pPage; 49444 if( iNew>pCache->iMaxKey ){ 49445 pCache->iMaxKey = iNew; 49446 } 49447diff --git a/src/third_party/sqlite/src/src/pragma.c b/src/third_party/sqlite/src/src/pragma.c 49448index 9860da86d7d05..e2f2577ae8952 49449--- a/src/third_party/sqlite/src/src/pragma.c 49450+++ b/src/third_party/sqlite/src/src/pragma.c 49451@@ -965,6 +965,7 @@ void sqlite3Pragma( 49452 ** 49453 */ 49454 case PragTyp_TEMP_STORE_DIRECTORY: { 49455+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49456 if( !zRight ){ 49457 returnSingleText(v, sqlite3_temp_directory); 49458 }else{ 49459@@ -974,6 +975,7 @@ void sqlite3Pragma( 49460 rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); 49461 if( rc!=SQLITE_OK || res==0 ){ 49462 sqlite3ErrorMsg(pParse, "not a writable directory"); 49463+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49464 goto pragma_out; 49465 } 49466 } 49467@@ -991,6 +993,7 @@ void sqlite3Pragma( 49468 } 49469 #endif /* SQLITE_OMIT_WSD */ 49470 } 49471+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49472 break; 49473 } 49474 49475@@ -1009,6 +1012,7 @@ void sqlite3Pragma( 49476 ** 49477 */ 49478 case PragTyp_DATA_STORE_DIRECTORY: { 49479+ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49480 if( !zRight ){ 49481 returnSingleText(v, sqlite3_data_directory); 49482 }else{ 49483@@ -1018,6 +1022,7 @@ void sqlite3Pragma( 49484 rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); 49485 if( rc!=SQLITE_OK || res==0 ){ 49486 sqlite3ErrorMsg(pParse, "not a writable directory"); 49487+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49488 goto pragma_out; 49489 } 49490 } 49491@@ -1029,6 +1034,7 @@ void sqlite3Pragma( 49492 } 49493 #endif /* SQLITE_OMIT_WSD */ 49494 } 49495+ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); 49496 break; 49497 } 49498 #endif 49499diff --git a/src/third_party/sqlite/src/src/select.c b/src/third_party/sqlite/src/src/select.c 49500index 7d0c5f8e5da8a..4242730e2047b 49501--- a/src/third_party/sqlite/src/src/select.c 49502+++ b/src/third_party/sqlite/src/src/select.c 49503@@ -1688,7 +1688,7 @@ static void generateSortTail( 49504 if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce); 49505 addr = 1 + sqlite3VdbeAddOp2(v, OP_SorterSort, iTab, addrBreak); 49506 VdbeCoverage(v); 49507- codeOffset(v, p->iOffset, addrContinue); 49508+ assert( p->iLimit==0 && p->iOffset==0 ); 49509 sqlite3VdbeAddOp3(v, OP_SorterData, iTab, regSortOut, iSortTab); 49510 bSeq = 0; 49511 }else{ 49512@@ -1696,6 +1696,9 @@ static void generateSortTail( 49513 codeOffset(v, p->iOffset, addrContinue); 49514 iSortTab = iTab; 49515 bSeq = 1; 49516+ if( p->iOffset>0 ){ 49517+ sqlite3VdbeAddOp2(v, OP_AddImm, p->iLimit, -1); 49518+ } 49519 } 49520 for(i=0, iCol=nKey+bSeq-1; i<nColumn; i++){ 49521 #ifdef SQLITE_ENABLE_SORTER_REFERENCES 49522@@ -3688,10 +3691,11 @@ static int multiSelectOrderBy( 49523 */ 49524 sqlite3VdbeResolveLabel(v, labelEnd); 49525 49526- /* Reassembly the compound query so that it will be freed correctly 49527+ /* Reassemble the compound query so that it will be freed correctly 49528 ** by the calling function */ 49529 if( pSplit->pPrior ){ 49530- sqlite3SelectDelete(db, pSplit->pPrior); 49531+ sqlite3ParserAddCleanup(pParse, 49532+ (void(*)(sqlite3*,void*))sqlite3SelectDelete, pSplit->pPrior); 49533 } 49534 pSplit->pPrior = pPrior; 49535 pPrior->pNext = pSplit; 49536@@ -5210,6 +5214,7 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){ 49537 || p->pSrc->nSrc!=1 49538 || p->pSrc->a[0].pSelect 49539 || pAggInfo->nFunc!=1 49540+ || p->pHaving 49541 ){ 49542 return 0; 49543 } 49544diff --git a/src/third_party/sqlite/src/src/sqliteInt.h b/src/third_party/sqlite/src/src/sqliteInt.h 49545index 106a5d14750d8..1c96339906883 49546--- a/src/third_party/sqlite/src/src/sqliteInt.h 49547+++ b/src/third_party/sqlite/src/src/sqliteInt.h 49548@@ -198,6 +198,11 @@ 49549 */ 49550 #include "sqlite3.h" 49551 49552+/* 49553+** Reuse the STATIC_LRU for mutex access to sqlite3_temp_directory. 49554+*/ 49555+#define SQLITE_MUTEX_STATIC_TEMPDIR SQLITE_MUTEX_STATIC_VFS1 49556+ 49557 /* 49558 ** Include the configuration header output by 'configure' if we're using the 49559 ** autoconf-based build 49560diff --git a/src/third_party/sqlite/src/src/trigger.c b/src/third_party/sqlite/src/src/trigger.c 49561index 3b7d0d9e88c61..1c62fc231b522 49562--- a/src/third_party/sqlite/src/src/trigger.c 49563+++ b/src/third_party/sqlite/src/src/trigger.c 49564@@ -351,6 +351,23 @@ void sqlite3FinishTrigger( 49565 Vdbe *v; 49566 char *z; 49567 49568+ /* If this is a new CREATE TABLE statement, and if shadow tables 49569+ ** are read-only, and the trigger makes a change to a shadow table, 49570+ ** then raise an error - do not allow the trigger to be created. */ 49571+ if( sqlite3ReadOnlyShadowTables(db) ){ 49572+ TriggerStep *pStep; 49573+ for(pStep=pTrig->step_list; pStep; pStep=pStep->pNext){ 49574+ if( pStep->zTarget!=0 49575+ && sqlite3ShadowTableName(db, pStep->zTarget) 49576+ ){ 49577+ sqlite3ErrorMsg(pParse, 49578+ "trigger \"%s\" may not write to shadow table \"%s\"", 49579+ pTrig->zName, pStep->zTarget); 49580+ goto triggerfinish_cleanup; 49581+ } 49582+ } 49583+ } 49584+ 49585 /* Make an entry in the sqlite_schema table */ 49586 v = sqlite3GetVdbe(pParse); 49587 if( v==0 ) goto triggerfinish_cleanup; 49588diff --git a/src/third_party/sqlite/src/src/util.c b/src/third_party/sqlite/src/src/util.c 49589index 84608739ae2db..32e9c277866f4 49590--- a/src/third_party/sqlite/src/src/util.c 49591+++ b/src/third_party/sqlite/src/src/util.c 49592@@ -190,7 +190,7 @@ void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){ 49593 va_list ap; 49594 sqlite3 *db = pParse->db; 49595 assert( db!=0 ); 49596- assert( db->pParse==pParse ); 49597+ assert( db->pParse==pParse || db->pParse->pToplevel==pParse ); 49598 db->errByteOffset = -2; 49599 va_start(ap, zFormat); 49600 zMsg = sqlite3VMPrintf(db, zFormat, ap); 49601diff --git a/src/third_party/sqlite/src/src/vdbeaux.c b/src/third_party/sqlite/src/src/vdbeaux.c 49602index 7c3be404ef903..3ef2bac316704 49603--- a/src/third_party/sqlite/src/src/vdbeaux.c 49604+++ b/src/third_party/sqlite/src/src/vdbeaux.c 49605@@ -381,6 +381,7 @@ int sqlite3VdbeAddFunctionCall( 49606 addr = sqlite3VdbeAddOp4(v, eCallCtx ? OP_PureFunc : OP_Function, 49607 p1, p2, p3, (char*)pCtx, P4_FUNCCTX); 49608 sqlite3VdbeChangeP5(v, eCallCtx & NC_SelfRef); 49609+ sqlite3MayAbort(pParse); 49610 return addr; 49611 } 49612 49613@@ -716,6 +717,7 @@ int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){ 49614 || opcode==OP_VDestroy 49615 || opcode==OP_VCreate 49616 || opcode==OP_ParseSchema 49617+ || opcode==OP_Function || opcode==OP_PureFunc 49618 || ((opcode==OP_Halt || opcode==OP_HaltIfNull) 49619 && ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort)) 49620 ){ 49621diff --git a/src/third_party/sqlite/src/test/json101.test b/src/third_party/sqlite/src/test/json101.test 49622index b84846d8889c9..135c988e97b5b 49623--- a/src/third_party/sqlite/src/test/json101.test 49624+++ b/src/third_party/sqlite/src/test/json101.test 49625@@ -867,4 +867,22 @@ do_catchsql_test json-18.5 { 49626 SELECT json_extract('{"":8}', '$.'); 49627 } {1 {JSON path error near ''}} 49628 49629+# 2022-08-29 https://sqlite.org/forum/forumpost/9b9e4716c0d7bbd1 49630+# This is not a problem specifically with JSON functions. It is 49631+# a problem with transaction control. But the json() function makes 49632+# the problem more easily accessible, so it is tested here. 49633+# 49634+do_execsql_test json-19.1 { 49635+ DROP TABLE IF EXISTS t1; 49636+ CREATE TABLE t1(x); 49637+} {} 49638+do_catchsql_test json-19.2 { 49639+ BEGIN; 49640+ INSERT INTO t1 VALUES(0), (json('not-valid-json')); 49641+} {1 {malformed JSON}} 49642+do_execsql_test json-19.3 { 49643+ COMMIT; 49644+ SELECT * FROM t1; 49645+} {} 49646+ 49647 finish_test 49648diff --git a/src/third_party/sqlite/src/test/offset1.test b/src/third_party/sqlite/src/test/offset1.test 49649index 91dc0b00a14bd..5b04bd836c5db 49650--- a/src/third_party/sqlite/src/test/offset1.test 49651+++ b/src/third_party/sqlite/src/test/offset1.test 49652@@ -156,6 +156,47 @@ do_execsql_test offset1-1.4.9 { 49653 LIMIT 9 OFFSET 1; 49654 } {2 b 3 c 4 d 5 e 6 w 7 x 8 y 9 z} 49655 49656- 49657+# 2022-08-04 49658+# https://sqlite.org/forum/forumpost/6b5e9188f0657616 49659+# 49660+do_execsql_test offset1-2.0 { 49661+ CREATE TABLE employees ( 49662+ id integer primary key, 49663+ name text, 49664+ city text, 49665+ department text, 49666+ salary integer 49667+ ); 49668+ INSERT INTO employees VALUES 49669+ (11,'Diane','London','hr',70), 49670+ (12,'Bob','London','hr',78), 49671+ (21,'Emma','London','it',84), 49672+ (22,'Grace','Berlin','it',90), 49673+ (23,'Henry','London','it',104), 49674+ (24,'Irene','Berlin','it',104), 49675+ (25,'Frank','Berlin','it',120), 49676+ (31,'Cindy','Berlin','sales',96), 49677+ (32,'Dave','London','sales',96), 49678+ (33,'Alice','Berlin','sales',100); 49679+ CREATE VIEW v AS 49680+ SELECT * FROM ( 49681+ SELECT * FROM employees 49682+ WHERE salary < 100 49683+ ORDER BY salary desc) 49684+ UNION ALL 49685+ SELECT * FROM ( 49686+ SELECT * FROM employees 49687+ WHERE salary >= 100 49688+ ORDER BY salary asc); 49689+} {} 49690+do_execsql_test offset1-2.1 { 49691+ SELECT * FROM v LIMIT 5 OFFSET 2; 49692+} { 49693+ 22 Grace Berlin it 90 49694+ 21 Emma London it 84 49695+ 12 Bob London hr 78 49696+ 11 Diane London hr 70 49697+ 33 Alice Berlin sales 100 49698+} 49699 49700 finish_test 49701diff --git a/src/third_party/sqlite/src/test/select3.test b/src/third_party/sqlite/src/test/select3.test 49702index 690514b496a7c..809b5490289f7 49703--- a/src/third_party/sqlite/src/test/select3.test 49704+++ b/src/third_party/sqlite/src/test/select3.test 49705@@ -118,10 +118,18 @@ do_test select3-2.14 { 49706 } {1 {near ";": syntax error}} 49707 49708 # Cannot have a HAVING without a GROUP BY 49709+# 49710+# Update: As of 3.39.0, you can. 49711 # 49712 do_execsql_test select3-3.1 { 49713 SELECT log, count(*) FROM t1 HAVING log>=4 49714 } {} 49715+do_execsql_test select3-3.2 { 49716+ SELECT count(*) FROM t1 HAVING log>=4 49717+} {} 49718+do_execsql_test select3-3.3 { 49719+ SELECT count(*) FROM t1 HAVING log!=400 49720+} {31} 49721 49722 # Toss in some HAVING clauses 49723 # 49724diff --git a/src/third_party/tflite_support/README.chromium b/src/third_party/tflite_support/README.chromium 49725index 4995893eb475d..4f931abde86d9 49726--- a/src/third_party/tflite_support/README.chromium 49727+++ b/src/third_party/tflite_support/README.chromium 49728@@ -35,6 +35,7 @@ is a no-op in chromium builds and upsets clang. 49729 only available on POSIX systems. 49730 11) Run clang-format. 49731 12) Remove an unneeded static initializer. 49732+13) Remove whitespace tokenizer since it uses the unsafe function `chartorune`. 49733 49734 Update Process: 49735 1) Clone the tflite-support github repo at the desired commit into src/ 49736diff --git a/src/third_party/tflite_support/patches/0014-remove-whitespace-tokenizer.patch b/src/third_party/tflite_support/patches/0014-remove-whitespace-tokenizer.patch 49737new file mode 100644 49738index 0000000000000..d488455d929b6 49739--- /dev/null 49740+++ b/src/third_party/tflite_support/patches/0014-remove-whitespace-tokenizer.patch 49741@@ -0,0 +1,776 @@ 49742+From 3e2574d49dd6a93efef8de6c5256a428c9d9c784 Mon Sep 17 00:00:00 2001 49743+From: Robert Ogden <robertogden@chromium.org> 49744+Date: Mon, 17 Oct 2022 13:09:01 -0700 49745+Subject: [PATCH] remove whitespace tokenizer 49746+ 49747+--- 49748+ .../custom_ops/kernel/whitespace_tokenizer.cc | 227 ------------------ 49749+ .../custom_ops/kernel/whitespace_tokenizer.h | 31 --- 49750+ .../whitespace_tokenizer_op_resolver.cc | 32 --- 49751+ .../kernel/whitespace_tokenizer_op_resolver.h | 34 --- 49752+ ...hitespace_tokenizer_op_resolver_wrapper.cc | 29 --- 49753+ .../kernel/whitespace_tokenizer_test.cc | 189 --------------- 49754+ .../kernel/whitespace_tokenizer_test.py | 167 ------------- 49755+ 7 files changed, 709 deletions(-) 49756+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.cc 49757+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h 49758+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.cc 49759+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h 49760+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver_wrapper.cc 49761+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.cc 49762+ delete mode 100644 third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.py 49763+ 49764+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 49765+deleted file mode 100644 49766+index 8096a5008bd12..0000000000000 49767+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.cc 49768++++ /dev/null 49769+@@ -1,227 +0,0 @@ 49770+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 49771+- 49772+-Licensed under the Apache License, Version 2.0 (the "License"); 49773+-you may not use this file except in compliance with the License. 49774+-You may obtain a copy of the License at 49775+- 49776+- http://www.apache.org/licenses/LICENSE-2.0 49777+- 49778+-Unless required by applicable law or agreed to in writing, software 49779+-distributed under the License is distributed on an "AS IS" BASIS, 49780+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 49781+-See the License for the specific language governing permissions and 49782+-limitations under the License. 49783+-==============================================================================*/ 49784+- 49785+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h" 49786+- 49787+-#include <algorithm> 49788+-#include <utility> 49789+-#include <vector> 49790+- 49791+-#include "libutf/utf.h" 49792+-#include "tensorflow/lite/context.h" 49793+-#include "tensorflow/lite/kernels/kernel_util.h" 49794+-#include "tensorflow/lite/string_util.h" 49795+- 49796+-constexpr int kInput = 0; 49797+-constexpr int kOutputValues = 0; 49798+-constexpr int kOutputRowSplitsStart = 1; 49799+- 49800+-namespace tflite { 49801+-namespace ops { 49802+-namespace custom { 49803+-namespace whitespace_tokenizer { 49804+- 49805+-// This TFLite op implements a whitespace tokenizer, and can output the 49806+-// tokens as either a padded tensor or a ragged tensor. 49807+-// 49808+-// If we're outputting a padded tensor, our outputs are: 49809+-// * A string tensor 49810+-// 49811+-// If we're outputting a ragged tensor, our outputs are: 49812+-// * A string tensor (the innermost values of the ragged tensor) 49813+-// * N int64 tensors (the row_splits of the ragged tensor, where N is the 49814+-// rank of the input tensor) 49815+- 49816+-inline bool OutputIsPaddedTensor(TfLiteNode* node) { 49817+- return NumOutputs(node) == 1; 49818+-} 49819+- 49820+-inline int charntorune(Rune* r, const char* s, int n) { 49821+- const int bytes_read = chartorune(r, const_cast<char*>(s)); 49822+- if (bytes_read > n) { 49823+- *r = Runeerror; 49824+- return 0; 49825+- } 49826+- return bytes_read; 49827+-} 49828+- 49829+-std::vector<std::pair<const char*, int>> Tokenize(StringRef str) { 49830+- const char* p = str.str; 49831+- int n = str.len; 49832+- 49833+- std::vector<std::pair<const char*, int>> tokens; 49834+- const char* start = nullptr; 49835+- while (n > 0) { 49836+- Rune r; 49837+- int c = charntorune(&r, p, n); 49838+- if (r == Runeerror) 49839+- break; 49840+- 49841+- if (isspacerune(r)) { 49842+- if (start != nullptr) { 49843+- tokens.push_back({start, p - start}); 49844+- } 49845+- start = nullptr; 49846+- } else { 49847+- if (start == nullptr) { 49848+- start = p; 49849+- } 49850+- } 49851+- 49852+- p += c; 49853+- n -= c; 49854+- } 49855+- if (start != nullptr) { 49856+- tokens.push_back({start, p - start}); 49857+- } 49858+- 49859+- return tokens; 49860+-} 49861+- 49862+-TfLiteStatus WritePaddedOutput( 49863+- const std::vector<std::vector<std::pair<const char*, int>>>& list_of_tokens, 49864+- const TfLiteTensor* input, 49865+- TfLiteTensor* output_values) { 49866+- TfLiteIntArray* output_shape = TfLiteIntArrayCreate(NumDimensions(input) + 1); 49867+- for (int i = 0; i < NumDimensions(input); ++i) { 49868+- output_shape->data[i] = SizeOfDimension(input, i); 49869+- } 49870+- 49871+- size_t max_tokens = 0; 49872+- for (const auto& tokens : list_of_tokens) { 49873+- max_tokens = std::max(max_tokens, tokens.size()); 49874+- } 49875+- 49876+- output_shape->data[NumDimensions(input)] = max_tokens; 49877+- DynamicBuffer buffer; 49878+- for (const auto& tokens : list_of_tokens) { 49879+- for (const auto& token : tokens) { 49880+- buffer.AddString(token.first, token.second); 49881+- } 49882+- for (int i = tokens.size(); i < max_tokens; ++i) { 49883+- buffer.AddString(nullptr, 0); 49884+- } 49885+- } 49886+- buffer.WriteToTensor(output_values, output_shape); 49887+- return kTfLiteOk; 49888+-} 49889+- 49890+-TfLiteStatus WriteRaggedOutput( 49891+- const std::vector<std::vector<std::pair<const char*, int>>>& list_of_tokens, 49892+- const TfLiteTensor* input, 49893+- TfLiteTensor* output_values, 49894+- std::vector<TfLiteTensor*> nested_row_splits) { 49895+- // The outer dimensions of the ragged tensor are all non-ragged. 49896+- for (int i = 0; i < nested_row_splits.size() - 1; ++i) { 49897+- int row_splits_step = SizeOfDimension(input, i + 1); 49898+- TfLiteTensor* row_splits = nested_row_splits[i]; 49899+- for (int j = 0; j < SizeOfDimension(row_splits, 0); ++j) { 49900+- row_splits->data.i64[j] = j * row_splits_step; 49901+- } 49902+- } 49903+- 49904+- // Generate the innermost row_splits and values tensors. 49905+- TfLiteTensor* row_splits = nested_row_splits.back(); 49906+- TfLiteIntArray* output_shape = TfLiteIntArrayCreate(1); 49907+- DynamicBuffer buffer; 49908+- int token_index = 0; 49909+- int row_splits_index = 0; 49910+- for (const auto& tokens : list_of_tokens) { 49911+- row_splits->data.i64[row_splits_index] = token_index; 49912+- for (const auto& token : tokens) { 49913+- buffer.AddString(token.first, token.second); 49914+- ++token_index; 49915+- } 49916+- ++row_splits_index; 49917+- } 49918+- row_splits->data.i64[row_splits_index] = token_index; 49919+- output_shape->data[0] = token_index; 49920+- buffer.WriteToTensor(output_values, output_shape); 49921+- return kTfLiteOk; 49922+-} 49923+- 49924+-TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { 49925+- TfLiteTensor* output_values = GetOutput(context, node, kOutputValues); 49926+- SetTensorToDynamic(output_values); 49927+- 49928+- if (OutputIsPaddedTensor(node)) { 49929+- return kTfLiteOk; 49930+- } 49931+- 49932+- const TfLiteTensor* input = GetInput(context, node, kInput); 49933+- TF_LITE_ENSURE(context, NumDimensions(input) == 49934+- (NumOutputs(node) - kOutputRowSplitsStart)); 49935+- 49936+- // Resize the row_splits tensors. We're just adding a ragged inner 49937+- // dimension to the shape of the input tensor, so the size of the 49938+- // row_splits tensors can be calculated using the input tensor's shape. 49939+- int input_size = 1; 49940+- for (int i = 0; i < NumDimensions(input); ++i) { 49941+- input_size *= SizeOfDimension(input, i); 49942+- 49943+- TfLiteIntArray* row_splits_shape = TfLiteIntArrayCreate(1); 49944+- row_splits_shape->data[0] = input_size + 1; 49945+- TfLiteTensor* row_splits = 49946+- GetOutput(context, node, kOutputRowSplitsStart + i); 49947+- TF_LITE_ENSURE_STATUS( 49948+- context->ResizeTensor(context, row_splits, row_splits_shape)); 49949+- } 49950+- 49951+- return kTfLiteOk; 49952+-} 49953+- 49954+-TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { 49955+- const TfLiteTensor* input = GetInput(context, node, kInput); 49956+- int input_size = 1; 49957+- for (int i = 0; i < NumDimensions(input); ++i) { 49958+- input_size *= SizeOfDimension(input, i); 49959+- } 49960+- 49961+- std::vector<std::vector<std::pair<const char*, int>>> list_of_tokens; 49962+- list_of_tokens.reserve(input_size); 49963+- for (int i = 0; i < input_size; ++i) { 49964+- list_of_tokens.emplace_back(Tokenize(GetString(input, i))); 49965+- } 49966+- 49967+- TfLiteTensor* output_values = GetOutput(context, node, kOutputValues); 49968+- TF_LITE_ENSURE(context, IsDynamicTensor(output_values)); 49969+- 49970+- if (OutputIsPaddedTensor(node)) { 49971+- return WritePaddedOutput(list_of_tokens, input, output_values); 49972+- } 49973+- 49974+- std::vector<TfLiteTensor*> nested_row_splits; 49975+- nested_row_splits.reserve(NumDimensions(input)); 49976+- for (int i = 0; i < NumDimensions(input); ++i) { 49977+- TfLiteTensor* output_row_splits = 49978+- GetOutput(context, node, kOutputRowSplitsStart + i); 49979+- nested_row_splits.push_back(output_row_splits); 49980+- } 49981+- return WriteRaggedOutput(list_of_tokens, input, output_values, 49982+- nested_row_splits); 49983+-} 49984+- 49985+-} // namespace whitespace_tokenizer 49986+- 49987+-TfLiteRegistration* Register_tftext_WhitespaceTokenizer() { 49988+- static TfLiteRegistration r = {nullptr, nullptr, 49989+- whitespace_tokenizer::Prepare, 49990+- whitespace_tokenizer::Eval}; 49991+- return &r; 49992+-} 49993+- 49994+-} // namespace custom 49995+-} // namespace ops 49996+-} // namespace tflite 49997+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 49998+deleted file mode 100644 49999+index b190248087d20..0000000000000 50000+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h 50001++++ /dev/null 50002+@@ -1,31 +0,0 @@ 50003+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50004+- 50005+-Licensed under the Apache License, Version 2.0 (the "License"); 50006+-you may not use this file except in compliance with the License. 50007+-You may obtain a copy of the License at 50008+- 50009+- http://www.apache.org/licenses/LICENSE-2.0 50010+- 50011+-Unless required by applicable law or agreed to in writing, software 50012+-distributed under the License is distributed on an "AS IS" BASIS, 50013+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50014+-See the License for the specific language governing permissions and 50015+-limitations under the License. 50016+-==============================================================================*/ 50017+- 50018+-#ifndef TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_ 50019+-#define TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_ 50020+- 50021+-#include "tensorflow/lite/context.h" 50022+- 50023+-namespace tflite { 50024+-namespace ops { 50025+-namespace custom { 50026+- 50027+-TfLiteRegistration* Register_tftext_WhitespaceTokenizer(); 50028+- 50029+-} // namespace custom 50030+-} // namespace ops 50031+-} // namespace tflite 50032+- 50033+-#endif // TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_ 50034+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 50035+deleted file mode 100644 50036+index 6166bc149bc00..0000000000000 50037+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.cc 50038++++ /dev/null 50039+@@ -1,32 +0,0 @@ 50040+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50041+- 50042+-Licensed under the Apache License, Version 2.0 (the "License"); 50043+-you may not use this file except in compliance with the License. 50044+-You may obtain a copy of the License at 50045+- 50046+- http://www.apache.org/licenses/LICENSE-2.0 50047+- 50048+-Unless required by applicable law or agreed to in writing, software 50049+-distributed under the License is distributed on an "AS IS" BASIS, 50050+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50051+-See the License for the specific language governing permissions and 50052+-limitations under the License. 50053+-==============================================================================*/ 50054+- 50055+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h" 50056+- 50057+-#include "tensorflow/lite/mutable_op_resolver.h" 50058+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h" 50059+- 50060+-namespace tflite { 50061+-namespace ops { 50062+-namespace custom { 50063+- 50064+-void AddWhitespaceTokenizerCustomOp(MutableOpResolver* resolver) { 50065+- resolver->AddCustom("tftext:WhitespaceTokenizer", 50066+- Register_tftext_WhitespaceTokenizer()); 50067+-} 50068+- 50069+-} // namespace custom 50070+-} // namespace ops 50071+-} // namespace tflite 50072+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 50073+deleted file mode 100644 50074+index 4f57d8d8010cb..0000000000000 50075+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h 50076++++ /dev/null 50077+@@ -1,34 +0,0 @@ 50078+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50079+- 50080+-Licensed under the Apache License, Version 2.0 (the "License"); 50081+-you may not use this file except in compliance with the License. 50082+-You may obtain a copy of the License at 50083+- 50084+- http://www.apache.org/licenses/LICENSE-2.0 50085+- 50086+-Unless required by applicable law or agreed to in writing, software 50087+-distributed under the License is distributed on an "AS IS" BASIS, 50088+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50089+-See the License for the specific language governing permissions and 50090+-limitations under the License. 50091+-==============================================================================*/ 50092+- 50093+-#ifndef TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_ 50094+-#define TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_ 50095+- 50096+-#include "tensorflow/lite/mutable_op_resolver.h" 50097+- 50098+-namespace tflite { 50099+-namespace ops { 50100+-namespace custom { 50101+- 50102+-// Adds the WhitespaceTokenizer custom op to an op resolver. 50103+-// This function can be loaded using dlopen. Since C++ function names get 50104+-// mangled, declare this function as extern C, so its name is unchanged. 50105+-extern "C" void AddWhitespaceTokenizerCustomOp(MutableOpResolver* resolver); 50106+- 50107+-} // namespace custom 50108+-} // namespace ops 50109+-} // namespace tflite 50110+- 50111+-#endif // LETENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_ 50112+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 50113+deleted file mode 100644 50114+index 03d3ba899395a..0000000000000 50115+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver_wrapper.cc 50116++++ /dev/null 50117+@@ -1,29 +0,0 @@ 50118+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50119+- 50120+-Licensed under the Apache License, Version 2.0 (the "License"); 50121+-you may not use this file except in compliance with the License. 50122+-You may obtain a copy of the License at 50123+- 50124+- http://www.apache.org/licenses/LICENSE-2.0 50125+- 50126+-Unless required by applicable law or agreed to in writing, software 50127+-distributed under the License is distributed on an "AS IS" BASIS, 50128+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50129+-See the License for the specific language governing permissions and 50130+-limitations under the License. 50131+-==============================================================================*/ 50132+- 50133+-#include "pybind11/pybind11.h" 50134+-#include "tensorflow/lite/mutable_op_resolver.h" 50135+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h" 50136+- 50137+-PYBIND11_MODULE(_pywrap_whitespace_tokenizer_op_resolver, m) { 50138+- m.doc() = "_pywrap_whitespace_tokenizer_op_resolver"; 50139+- m.def( 50140+- "AddWhitespaceTokenizerCustomOp", 50141+- [](uintptr_t resolver) { 50142+- tflite::ops::custom::AddWhitespaceTokenizerCustomOp( 50143+- reinterpret_cast<tflite::MutableOpResolver*>(resolver)); 50144+- }, 50145+- "Op registerer function for the tftext:WhitespaceTokenizer custom op."); 50146+-} 50147+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 50148+deleted file mode 100644 50149+index 4654e46c4a270..0000000000000 50150+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.cc 50151++++ /dev/null 50152+@@ -1,189 +0,0 @@ 50153+-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50154+- 50155+-Licensed under the Apache License, Version 2.0 (the "License"); 50156+-you may not use this file except in compliance with the License. 50157+-You may obtain a copy of the License at 50158+- 50159+- http://www.apache.org/licenses/LICENSE-2.0 50160+- 50161+-Unless required by applicable law or agreed to in writing, software 50162+-distributed under the License is distributed on an "AS IS" BASIS, 50163+-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50164+-See the License for the specific language governing permissions and 50165+-limitations under the License. 50166+-==============================================================================*/ 50167+- 50168+-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h" 50169+- 50170+-#include <string> 50171+-#include <vector> 50172+- 50173+-#include <gmock/gmock.h> 50174+-#include <gtest/gtest.h> 50175+-#include "tensorflow/lite/kernels/test_util.h" 50176+-#include "tensorflow/lite/schema/schema_generated.h" 50177+-#include "tensorflow/lite/string_util.h" 50178+- 50179+-namespace tflite { 50180+-namespace ops { 50181+-namespace custom { 50182+-namespace whitespace_tokenizer { 50183+-namespace test { 50184+-namespace { 50185+- 50186+-using ::testing::ElementsAre; 50187+-using ::testing::ElementsAreArray; 50188+- 50189+-} // namespace 50190+- 50191+-enum OutputType { PADDED, RAGGED }; 50192+- 50193+-class WhitespaceTokenizerModel : public SingleOpModel { 50194+- public: 50195+- WhitespaceTokenizerModel(OutputType output_type, 50196+- const std::vector<std::string>& input_values, 50197+- const std::vector<int>& input_shape) 50198+- : input_shape_(input_shape) { 50199+- input_ = AddInput(TensorType_STRING); 50200+- output_values_ = AddOutput(TensorType_STRING); 50201+- if (output_type == RAGGED) { 50202+- for (int i = 0; i < input_shape_.size(); ++i) { 50203+- output_row_splits_.push_back(AddOutput(TensorType_INT64)); 50204+- } 50205+- } 50206+- SetCustomOp("WhitespaceTokenizer", {}, Register_tftext_WhitespaceTokenizer); 50207+- 50208+- BuildInterpreter({input_shape}); 50209+- PopulateStringTensor(input_, input_values); 50210+- Invoke(); 50211+- } 50212+- 50213+- std::vector<int> GetValuesTensorShape() { 50214+- return GetTensorShape(output_values_); 50215+- } 50216+- 50217+- std::vector<std::string> ExtractValuesTensorVector() { 50218+- std::vector<std::string> r; 50219+- TfLiteTensor* tensor = interpreter_->tensor(output_values_); 50220+- int n = GetStringCount(tensor); 50221+- for (int i = 0; i < n; ++i) { 50222+- StringRef ref = GetString(tensor, i); 50223+- r.emplace_back(ref.str, ref.len); 50224+- } 50225+- return r; 50226+- } 50227+- 50228+- void CheckRowSplits(const std::vector<int>& token_counts) { 50229+- int size = 1; 50230+- for (int i = 0; i < input_shape_.size(); ++i) { 50231+- size *= input_shape_[i]; 50232+- EXPECT_THAT(GetTensorShape(output_row_splits_[i]), ElementsAre(size + 1)) 50233+- << "row_splits " << i << " has the wrong shape"; 50234+- 50235+- std::vector<int64_t> expected_values(size + 1); 50236+- if (i == input_shape_.size() - 1) { 50237+- ASSERT_EQ(token_counts.size(), size); 50238+- 50239+- int index = 0; 50240+- expected_values[0] = index; 50241+- for (int j = 0; j < size; ++j) { 50242+- index += token_counts[j]; 50243+- expected_values[j + 1] = index; 50244+- } 50245+- } else { 50246+- for (int j = 0; j <= size; ++j) { 50247+- expected_values[j] = j * input_shape_[i + 1]; 50248+- } 50249+- } 50250+- EXPECT_THAT(ExtractVector<int64_t>(output_row_splits_[i]), 50251+- ElementsAreArray(expected_values)) 50252+- << "row_splits " << i << " has an incorrect value/index"; 50253+- } 50254+- } 50255+- 50256+- private: 50257+- int input_; 50258+- std::vector<int> input_shape_; 50259+- int output_values_; 50260+- std::vector<int> output_row_splits_; 50261+-}; // namespace test 50262+- 50263+-TEST(WhitespaceTokenizerTest, SingleStringPaddedOutput) { 50264+- WhitespaceTokenizerModel m(PADDED, {"this is a test"}, {1}); 50265+- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(1, 4)); 50266+- EXPECT_THAT(m.ExtractValuesTensorVector(), 50267+- ElementsAre("this", "is", "a", "test")); 50268+-} 50269+- 50270+-TEST(WhitespaceTokenizerTest, SingleStringRaggedOutput) { 50271+- WhitespaceTokenizerModel m(RAGGED, {"this is a test"}, {1}); 50272+- m.CheckRowSplits({4}); 50273+- EXPECT_THAT(m.ExtractValuesTensorVector(), 50274+- ElementsAre("this", "is", "a", "test")); 50275+-} 50276+- 50277+-TEST(WhitespaceTokenizerTest, VectorPaddedOutput) { 50278+- WhitespaceTokenizerModel m(PADDED, 50279+- {"this is a test", // 50280+- "three token sentence", // 50281+- "many more tokens than that sentence"}, 50282+- {3}); 50283+- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(3, 6)); 50284+- EXPECT_THAT( 50285+- m.ExtractValuesTensorVector(), 50286+- ElementsAre("this", "is", "a", "test", "", "", // 50287+- "three", "token", "sentence", "", "", "", // 50288+- "many", "more", "tokens", "than", "that", "sentence")); 50289+-} 50290+- 50291+-TEST(WhitespaceTokenizerTest, VectorRaggedOutput) { 50292+- WhitespaceTokenizerModel m(RAGGED, 50293+- {"this is a test", // 50294+- "three token sentence", // 50295+- "many more tokens than that sentence"}, 50296+- {3}); 50297+- m.CheckRowSplits({4, 3, 6}); 50298+- EXPECT_THAT( 50299+- m.ExtractValuesTensorVector(), 50300+- ElementsAre("this", "is", "a", "test", // 50301+- "three", "token", "sentence", // 50302+- "many", "more", "tokens", "than", "that", "sentence")); 50303+-} 50304+- 50305+-TEST(WhitespaceTokenizerTest, MatrixPaddedOutput) { 50306+- WhitespaceTokenizerModel m(PADDED, 50307+- {"a b c", "d e f", // 50308+- "g h", "i j k l", // 50309+- "m", "n o p q r"}, 50310+- {3, 2}); 50311+- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(3, 2, 5)); 50312+- EXPECT_THAT(m.ExtractValuesTensorVector(), 50313+- ElementsAre("a", "b", "c", "", "", // 50314+- "d", "e", "f", "", "", // 50315+- "g", "h", "", "", "", // 50316+- "i", "j", "k", "l", "", // 50317+- "m", "", "", "", "", // 50318+- "n", "o", "p", "q", "r")); 50319+-} 50320+- 50321+-TEST(WhitespaceTokenizerTest, MatrixRAGGEDOutput) { 50322+- WhitespaceTokenizerModel m(RAGGED, 50323+- {"a b c", "d e f", // 50324+- "g h", "i j k l", // 50325+- "m", "n o p q r"}, 50326+- {3, 2}); 50327+- m.CheckRowSplits({3, 3, 2, 4, 1, 5}); 50328+- EXPECT_THAT(m.ExtractValuesTensorVector(), 50329+- ElementsAre("a", "b", "c", // 50330+- "d", "e", "f", // 50331+- "g", "h", // 50332+- "i", "j", "k", "l", // 50333+- "m", // 50334+- "n", "o", "p", "q", "r")); 50335+-} 50336+- 50337+-} // namespace test 50338+-} // namespace whitespace_tokenizer 50339+-} // namespace custom 50340+-} // namespace ops 50341+-} // namespace tflite 50342+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 50343+deleted file mode 100644 50344+index 70de237a22dad..0000000000000 50345+--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.py 50346++++ /dev/null 50347+@@ -1,167 +0,0 @@ 50348+-# Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50349+-# 50350+-# Licensed under the Apache License, Version 2.0 (the "License"); 50351+-# you may not use this file except in compliance with the License. 50352+-# You may obtain a copy of the License at 50353+-# 50354+-# http://www.apache.org/licenses/LICENSE-2.0 50355+-# 50356+-# Unless required by applicable law or agreed to in writing, software 50357+-# distributed under the License is distributed on an "AS IS" BASIS, 50358+-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50359+-# See the License for the specific language governing permissions and 50360+-# limitations under the License. 50361+-# ============================================================================== 50362+-"""Tests for tensorflow_lite_support.custom_ops.kernel.whitespace_tokenizer.""" 50363+- 50364+-import os 50365+-import sys 50366+-import timeit 50367+- 50368+-from absl import logging 50369+-from absl.testing import parameterized 50370+-import numpy as np 50371+-import tensorflow as tf 50372+-import tensorflow_text as tf_text 50373+-# pylint: disable=g-direct-tensorflow-import 50374+-from tensorflow.lite.python import interpreter as interpreter_wrapper 50375+-from tensorflow.python.platform import resource_loader 50376+- 50377+-# Force loaded shared object symbols to be globally visible. This is needed so 50378+-# that the interpreter_wrapper, in one .so file, can see the op resolver 50379+-# in a different .so file. Note that this may already be set by default. 50380+-# pylint: disable=g-import-not-at-top,g-bad-import-order,unused-import 50381+-if hasattr(sys, 'setdlopenflags') and hasattr(sys, 'getdlopenflags'): 50382+- sys.setdlopenflags(sys.getdlopenflags() | os.RTLD_GLOBAL) 50383+-from tensorflow_lite_support.custom_ops.kernel import _pywrap_whitespace_tokenizer_op_resolver 50384+- 50385+-TEST_CASES = [ 50386+- ['this is a test'], 50387+- ['extra spaces in here'], 50388+- ['a four token sentence', 'a five token sentence thing.'], 50389+- [['a multi dimensional test case', 'a b c d', 'e f g'], 50390+- ['h i j', 'k l m 2 3', 'n o p'], ['q r s 0 1', 't u v', 'w x y z']], 50391+-] 50392+- 50393+-INVOKES_FOR_SINGLE_OP_BENCHMARK = 1000 50394+-INVOKES_FOR_FLEX_DELEGATE_BENCHMARK = 10 50395+- 50396+- 50397+-@tf.function 50398+-def _call_whitespace_tokenizer_to_tensor(test_case): 50399+- tokenizer = tf_text.WhitespaceTokenizer() 50400+- return tokenizer.tokenize(test_case).to_tensor() 50401+- 50402+- 50403+-@tf.function 50404+-def _call_whitespace_tokenizer_to_ragged(test_case): 50405+- tokenizer = tf_text.WhitespaceTokenizer() 50406+- return tokenizer.tokenize(test_case) 50407+- 50408+- 50409+-class WhitespaceTokenizerTest(parameterized.TestCase): 50410+- 50411+- @parameterized.parameters([t] for t in TEST_CASES) 50412+- def testToTensorEquivalence(self, test_case): 50413+- tf_output = _call_whitespace_tokenizer_to_tensor(test_case) 50414+- 50415+- model_filename = resource_loader.get_path_to_datafile( 50416+- 'testdata/whitespace_tokenizer_to_tensor.tflite') 50417+- with open(model_filename, 'rb') as file: 50418+- model = file.read() 50419+- interpreter = interpreter_wrapper.InterpreterWithCustomOps( 50420+- model_content=model, 50421+- custom_op_registerers=['AddWhitespaceTokenizerCustomOp']) 50422+- 50423+- np_test_case = np.array(test_case, dtype=np.str) 50424+- interpreter.resize_tensor_input(0, np_test_case.shape) 50425+- interpreter.allocate_tensors() 50426+- interpreter.set_tensor(interpreter.get_input_details()[0]['index'], 50427+- np_test_case) 50428+- interpreter.invoke() 50429+- tflite_output = interpreter.get_tensor( 50430+- interpreter.get_output_details()[0]['index']) 50431+- 50432+- self.assertEqual(tf_output.numpy().tolist(), tflite_output.tolist()) 50433+- 50434+- @parameterized.parameters([t] for t in TEST_CASES) 50435+- def testToRaggedEquivalence(self, test_case): 50436+- tf_output = _call_whitespace_tokenizer_to_ragged(test_case) 50437+- 50438+- np_test_case = np.array(test_case, dtype=np.str) 50439+- rank = len(np_test_case.shape) 50440+- 50441+- model_filename = resource_loader.get_path_to_datafile( 50442+- 'testdata/whitespace_tokenizer_to_ragged_{}d_input.tflite'.format(rank)) 50443+- with open(model_filename, 'rb') as file: 50444+- model = file.read() 50445+- interpreter = interpreter_wrapper.InterpreterWithCustomOps( 50446+- model_content=model, 50447+- custom_op_registerers=['AddWhitespaceTokenizerCustomOp']) 50448+- interpreter.resize_tensor_input(0, np_test_case.shape) 50449+- interpreter.allocate_tensors() 50450+- interpreter.set_tensor(interpreter.get_input_details()[0]['index'], 50451+- np_test_case) 50452+- interpreter.invoke() 50453+- 50454+- # Traverse the nested row_splits/values of the ragged tensor. 50455+- for i in range(rank): 50456+- tflite_output_cur_row_splits = interpreter.get_tensor( 50457+- interpreter.get_output_details()[1 + i]['index']) 50458+- self.assertEqual(tf_output.row_splits.numpy().tolist(), 50459+- tflite_output_cur_row_splits.tolist()) 50460+- tf_output = tf_output.values 50461+- 50462+- tflite_output_values = interpreter.get_tensor( 50463+- interpreter.get_output_details()[0]['index']) 50464+- self.assertEqual(tf_output.numpy().tolist(), tflite_output_values.tolist()) 50465+- 50466+- def testSingleOpLatency(self): 50467+- model_filename = resource_loader.get_path_to_datafile( 50468+- 'testdata/whitespace_tokenizer_to_tensor.tflite') 50469+- with open(model_filename, 'rb') as file: 50470+- model = file.read() 50471+- interpreter = interpreter_wrapper.InterpreterWithCustomOps( 50472+- model_content=model, 50473+- custom_op_registerers=['AddWhitespaceTokenizerCustomOp']) 50474+- 50475+- latency = 0.0 50476+- for test_case in TEST_CASES: 50477+- np_test_case = np.array(test_case, dtype=np.str) 50478+- interpreter.resize_tensor_input(0, np_test_case.shape) 50479+- interpreter.allocate_tensors() 50480+- interpreter.set_tensor(interpreter.get_input_details()[0]['index'], 50481+- np_test_case) 50482+- start_time = timeit.default_timer() 50483+- for _ in range(INVOKES_FOR_SINGLE_OP_BENCHMARK): 50484+- interpreter.invoke() 50485+- latency = latency + timeit.default_timer() - start_time 50486+- 50487+- latency = latency / (INVOKES_FOR_SINGLE_OP_BENCHMARK * len(TEST_CASES)) 50488+- logging.info('Latency: %fms', latency * 1000.0) 50489+- 50490+- def testFlexDelegateLatency(self): 50491+- model_filename = resource_loader.get_path_to_datafile( 50492+- 'testdata/whitespace_tokenizer_flex_delegate.tflite') 50493+- with open(model_filename, 'rb') as file: 50494+- model = file.read() 50495+- interpreter = interpreter_wrapper.Interpreter(model_content=model) 50496+- 50497+- latency = 0.0 50498+- for test_case in TEST_CASES: 50499+- np_test_case = np.array(test_case, dtype=np.str) 50500+- interpreter.resize_tensor_input(0, np_test_case.shape) 50501+- interpreter.allocate_tensors() 50502+- interpreter.set_tensor(interpreter.get_input_details()[0]['index'], 50503+- np_test_case) 50504+- start_time = timeit.default_timer() 50505+- for _ in range(INVOKES_FOR_FLEX_DELEGATE_BENCHMARK): 50506+- interpreter.invoke() 50507+- latency = latency + timeit.default_timer() - start_time 50508+- 50509+- latency = latency / (INVOKES_FOR_FLEX_DELEGATE_BENCHMARK * len(TEST_CASES)) 50510+- logging.info('Latency: %fms', latency * 1000.0) 50511+- 50512+- 50513+-if __name__ == '__main__': 50514+- tf.test.main() 50515+-- 50516+2.38.0.413.g74048e4d9e-goog 50517+ 50518diff --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 50519deleted file mode 100644 50520index 8096a5008bd12..0000000000000 50521--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.cc 50522+++ /dev/null 50523@@ -1,227 +0,0 @@ 50524-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50525- 50526-Licensed under the Apache License, Version 2.0 (the "License"); 50527-you may not use this file except in compliance with the License. 50528-You may obtain a copy of the License at 50529- 50530- http://www.apache.org/licenses/LICENSE-2.0 50531- 50532-Unless required by applicable law or agreed to in writing, software 50533-distributed under the License is distributed on an "AS IS" BASIS, 50534-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50535-See the License for the specific language governing permissions and 50536-limitations under the License. 50537-==============================================================================*/ 50538- 50539-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h" 50540- 50541-#include <algorithm> 50542-#include <utility> 50543-#include <vector> 50544- 50545-#include "libutf/utf.h" 50546-#include "tensorflow/lite/context.h" 50547-#include "tensorflow/lite/kernels/kernel_util.h" 50548-#include "tensorflow/lite/string_util.h" 50549- 50550-constexpr int kInput = 0; 50551-constexpr int kOutputValues = 0; 50552-constexpr int kOutputRowSplitsStart = 1; 50553- 50554-namespace tflite { 50555-namespace ops { 50556-namespace custom { 50557-namespace whitespace_tokenizer { 50558- 50559-// This TFLite op implements a whitespace tokenizer, and can output the 50560-// tokens as either a padded tensor or a ragged tensor. 50561-// 50562-// If we're outputting a padded tensor, our outputs are: 50563-// * A string tensor 50564-// 50565-// If we're outputting a ragged tensor, our outputs are: 50566-// * A string tensor (the innermost values of the ragged tensor) 50567-// * N int64 tensors (the row_splits of the ragged tensor, where N is the 50568-// rank of the input tensor) 50569- 50570-inline bool OutputIsPaddedTensor(TfLiteNode* node) { 50571- return NumOutputs(node) == 1; 50572-} 50573- 50574-inline int charntorune(Rune* r, const char* s, int n) { 50575- const int bytes_read = chartorune(r, const_cast<char*>(s)); 50576- if (bytes_read > n) { 50577- *r = Runeerror; 50578- return 0; 50579- } 50580- return bytes_read; 50581-} 50582- 50583-std::vector<std::pair<const char*, int>> Tokenize(StringRef str) { 50584- const char* p = str.str; 50585- int n = str.len; 50586- 50587- std::vector<std::pair<const char*, int>> tokens; 50588- const char* start = nullptr; 50589- while (n > 0) { 50590- Rune r; 50591- int c = charntorune(&r, p, n); 50592- if (r == Runeerror) 50593- break; 50594- 50595- if (isspacerune(r)) { 50596- if (start != nullptr) { 50597- tokens.push_back({start, p - start}); 50598- } 50599- start = nullptr; 50600- } else { 50601- if (start == nullptr) { 50602- start = p; 50603- } 50604- } 50605- 50606- p += c; 50607- n -= c; 50608- } 50609- if (start != nullptr) { 50610- tokens.push_back({start, p - start}); 50611- } 50612- 50613- return tokens; 50614-} 50615- 50616-TfLiteStatus WritePaddedOutput( 50617- const std::vector<std::vector<std::pair<const char*, int>>>& list_of_tokens, 50618- const TfLiteTensor* input, 50619- TfLiteTensor* output_values) { 50620- TfLiteIntArray* output_shape = TfLiteIntArrayCreate(NumDimensions(input) + 1); 50621- for (int i = 0; i < NumDimensions(input); ++i) { 50622- output_shape->data[i] = SizeOfDimension(input, i); 50623- } 50624- 50625- size_t max_tokens = 0; 50626- for (const auto& tokens : list_of_tokens) { 50627- max_tokens = std::max(max_tokens, tokens.size()); 50628- } 50629- 50630- output_shape->data[NumDimensions(input)] = max_tokens; 50631- DynamicBuffer buffer; 50632- for (const auto& tokens : list_of_tokens) { 50633- for (const auto& token : tokens) { 50634- buffer.AddString(token.first, token.second); 50635- } 50636- for (int i = tokens.size(); i < max_tokens; ++i) { 50637- buffer.AddString(nullptr, 0); 50638- } 50639- } 50640- buffer.WriteToTensor(output_values, output_shape); 50641- return kTfLiteOk; 50642-} 50643- 50644-TfLiteStatus WriteRaggedOutput( 50645- const std::vector<std::vector<std::pair<const char*, int>>>& list_of_tokens, 50646- const TfLiteTensor* input, 50647- TfLiteTensor* output_values, 50648- std::vector<TfLiteTensor*> nested_row_splits) { 50649- // The outer dimensions of the ragged tensor are all non-ragged. 50650- for (int i = 0; i < nested_row_splits.size() - 1; ++i) { 50651- int row_splits_step = SizeOfDimension(input, i + 1); 50652- TfLiteTensor* row_splits = nested_row_splits[i]; 50653- for (int j = 0; j < SizeOfDimension(row_splits, 0); ++j) { 50654- row_splits->data.i64[j] = j * row_splits_step; 50655- } 50656- } 50657- 50658- // Generate the innermost row_splits and values tensors. 50659- TfLiteTensor* row_splits = nested_row_splits.back(); 50660- TfLiteIntArray* output_shape = TfLiteIntArrayCreate(1); 50661- DynamicBuffer buffer; 50662- int token_index = 0; 50663- int row_splits_index = 0; 50664- for (const auto& tokens : list_of_tokens) { 50665- row_splits->data.i64[row_splits_index] = token_index; 50666- for (const auto& token : tokens) { 50667- buffer.AddString(token.first, token.second); 50668- ++token_index; 50669- } 50670- ++row_splits_index; 50671- } 50672- row_splits->data.i64[row_splits_index] = token_index; 50673- output_shape->data[0] = token_index; 50674- buffer.WriteToTensor(output_values, output_shape); 50675- return kTfLiteOk; 50676-} 50677- 50678-TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { 50679- TfLiteTensor* output_values = GetOutput(context, node, kOutputValues); 50680- SetTensorToDynamic(output_values); 50681- 50682- if (OutputIsPaddedTensor(node)) { 50683- return kTfLiteOk; 50684- } 50685- 50686- const TfLiteTensor* input = GetInput(context, node, kInput); 50687- TF_LITE_ENSURE(context, NumDimensions(input) == 50688- (NumOutputs(node) - kOutputRowSplitsStart)); 50689- 50690- // Resize the row_splits tensors. We're just adding a ragged inner 50691- // dimension to the shape of the input tensor, so the size of the 50692- // row_splits tensors can be calculated using the input tensor's shape. 50693- int input_size = 1; 50694- for (int i = 0; i < NumDimensions(input); ++i) { 50695- input_size *= SizeOfDimension(input, i); 50696- 50697- TfLiteIntArray* row_splits_shape = TfLiteIntArrayCreate(1); 50698- row_splits_shape->data[0] = input_size + 1; 50699- TfLiteTensor* row_splits = 50700- GetOutput(context, node, kOutputRowSplitsStart + i); 50701- TF_LITE_ENSURE_STATUS( 50702- context->ResizeTensor(context, row_splits, row_splits_shape)); 50703- } 50704- 50705- return kTfLiteOk; 50706-} 50707- 50708-TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { 50709- const TfLiteTensor* input = GetInput(context, node, kInput); 50710- int input_size = 1; 50711- for (int i = 0; i < NumDimensions(input); ++i) { 50712- input_size *= SizeOfDimension(input, i); 50713- } 50714- 50715- std::vector<std::vector<std::pair<const char*, int>>> list_of_tokens; 50716- list_of_tokens.reserve(input_size); 50717- for (int i = 0; i < input_size; ++i) { 50718- list_of_tokens.emplace_back(Tokenize(GetString(input, i))); 50719- } 50720- 50721- TfLiteTensor* output_values = GetOutput(context, node, kOutputValues); 50722- TF_LITE_ENSURE(context, IsDynamicTensor(output_values)); 50723- 50724- if (OutputIsPaddedTensor(node)) { 50725- return WritePaddedOutput(list_of_tokens, input, output_values); 50726- } 50727- 50728- std::vector<TfLiteTensor*> nested_row_splits; 50729- nested_row_splits.reserve(NumDimensions(input)); 50730- for (int i = 0; i < NumDimensions(input); ++i) { 50731- TfLiteTensor* output_row_splits = 50732- GetOutput(context, node, kOutputRowSplitsStart + i); 50733- nested_row_splits.push_back(output_row_splits); 50734- } 50735- return WriteRaggedOutput(list_of_tokens, input, output_values, 50736- nested_row_splits); 50737-} 50738- 50739-} // namespace whitespace_tokenizer 50740- 50741-TfLiteRegistration* Register_tftext_WhitespaceTokenizer() { 50742- static TfLiteRegistration r = {nullptr, nullptr, 50743- whitespace_tokenizer::Prepare, 50744- whitespace_tokenizer::Eval}; 50745- return &r; 50746-} 50747- 50748-} // namespace custom 50749-} // namespace ops 50750-} // namespace tflite 50751diff --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 50752deleted file mode 100644 50753index b190248087d20..0000000000000 50754--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h 50755+++ /dev/null 50756@@ -1,31 +0,0 @@ 50757-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50758- 50759-Licensed under the Apache License, Version 2.0 (the "License"); 50760-you may not use this file except in compliance with the License. 50761-You may obtain a copy of the License at 50762- 50763- http://www.apache.org/licenses/LICENSE-2.0 50764- 50765-Unless required by applicable law or agreed to in writing, software 50766-distributed under the License is distributed on an "AS IS" BASIS, 50767-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50768-See the License for the specific language governing permissions and 50769-limitations under the License. 50770-==============================================================================*/ 50771- 50772-#ifndef TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_ 50773-#define TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_ 50774- 50775-#include "tensorflow/lite/context.h" 50776- 50777-namespace tflite { 50778-namespace ops { 50779-namespace custom { 50780- 50781-TfLiteRegistration* Register_tftext_WhitespaceTokenizer(); 50782- 50783-} // namespace custom 50784-} // namespace ops 50785-} // namespace tflite 50786- 50787-#endif // TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_H_ 50788diff --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 50789deleted file mode 100644 50790index 6166bc149bc00..0000000000000 50791--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.cc 50792+++ /dev/null 50793@@ -1,32 +0,0 @@ 50794-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50795- 50796-Licensed under the Apache License, Version 2.0 (the "License"); 50797-you may not use this file except in compliance with the License. 50798-You may obtain a copy of the License at 50799- 50800- http://www.apache.org/licenses/LICENSE-2.0 50801- 50802-Unless required by applicable law or agreed to in writing, software 50803-distributed under the License is distributed on an "AS IS" BASIS, 50804-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50805-See the License for the specific language governing permissions and 50806-limitations under the License. 50807-==============================================================================*/ 50808- 50809-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h" 50810- 50811-#include "tensorflow/lite/mutable_op_resolver.h" 50812-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h" 50813- 50814-namespace tflite { 50815-namespace ops { 50816-namespace custom { 50817- 50818-void AddWhitespaceTokenizerCustomOp(MutableOpResolver* resolver) { 50819- resolver->AddCustom("tftext:WhitespaceTokenizer", 50820- Register_tftext_WhitespaceTokenizer()); 50821-} 50822- 50823-} // namespace custom 50824-} // namespace ops 50825-} // namespace tflite 50826diff --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 50827deleted file mode 100644 50828index 4f57d8d8010cb..0000000000000 50829--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h 50830+++ /dev/null 50831@@ -1,34 +0,0 @@ 50832-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50833- 50834-Licensed under the Apache License, Version 2.0 (the "License"); 50835-you may not use this file except in compliance with the License. 50836-You may obtain a copy of the License at 50837- 50838- http://www.apache.org/licenses/LICENSE-2.0 50839- 50840-Unless required by applicable law or agreed to in writing, software 50841-distributed under the License is distributed on an "AS IS" BASIS, 50842-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50843-See the License for the specific language governing permissions and 50844-limitations under the License. 50845-==============================================================================*/ 50846- 50847-#ifndef TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_ 50848-#define TENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_ 50849- 50850-#include "tensorflow/lite/mutable_op_resolver.h" 50851- 50852-namespace tflite { 50853-namespace ops { 50854-namespace custom { 50855- 50856-// Adds the WhitespaceTokenizer custom op to an op resolver. 50857-// This function can be loaded using dlopen. Since C++ function names get 50858-// mangled, declare this function as extern C, so its name is unchanged. 50859-extern "C" void AddWhitespaceTokenizerCustomOp(MutableOpResolver* resolver); 50860- 50861-} // namespace custom 50862-} // namespace ops 50863-} // namespace tflite 50864- 50865-#endif // LETENSORFLOW_LITE_SUPPORT_CUSTOM_OPS_KERNEL_WHITESPACE_TOKENIZER_OP_RESOLVER_H_ 50866diff --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 50867deleted file mode 100644 50868index 03d3ba899395a..0000000000000 50869--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver_wrapper.cc 50870+++ /dev/null 50871@@ -1,29 +0,0 @@ 50872-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50873- 50874-Licensed under the Apache License, Version 2.0 (the "License"); 50875-you may not use this file except in compliance with the License. 50876-You may obtain a copy of the License at 50877- 50878- http://www.apache.org/licenses/LICENSE-2.0 50879- 50880-Unless required by applicable law or agreed to in writing, software 50881-distributed under the License is distributed on an "AS IS" BASIS, 50882-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50883-See the License for the specific language governing permissions and 50884-limitations under the License. 50885-==============================================================================*/ 50886- 50887-#include "pybind11/pybind11.h" 50888-#include "tensorflow/lite/mutable_op_resolver.h" 50889-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_op_resolver.h" 50890- 50891-PYBIND11_MODULE(_pywrap_whitespace_tokenizer_op_resolver, m) { 50892- m.doc() = "_pywrap_whitespace_tokenizer_op_resolver"; 50893- m.def( 50894- "AddWhitespaceTokenizerCustomOp", 50895- [](uintptr_t resolver) { 50896- tflite::ops::custom::AddWhitespaceTokenizerCustomOp( 50897- reinterpret_cast<tflite::MutableOpResolver*>(resolver)); 50898- }, 50899- "Op registerer function for the tftext:WhitespaceTokenizer custom op."); 50900-} 50901diff --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 50902deleted file mode 100644 50903index 4654e46c4a270..0000000000000 50904--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.cc 50905+++ /dev/null 50906@@ -1,189 +0,0 @@ 50907-/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 50908- 50909-Licensed under the Apache License, Version 2.0 (the "License"); 50910-you may not use this file except in compliance with the License. 50911-You may obtain a copy of the License at 50912- 50913- http://www.apache.org/licenses/LICENSE-2.0 50914- 50915-Unless required by applicable law or agreed to in writing, software 50916-distributed under the License is distributed on an "AS IS" BASIS, 50917-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 50918-See the License for the specific language governing permissions and 50919-limitations under the License. 50920-==============================================================================*/ 50921- 50922-#include "tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer.h" 50923- 50924-#include <string> 50925-#include <vector> 50926- 50927-#include <gmock/gmock.h> 50928-#include <gtest/gtest.h> 50929-#include "tensorflow/lite/kernels/test_util.h" 50930-#include "tensorflow/lite/schema/schema_generated.h" 50931-#include "tensorflow/lite/string_util.h" 50932- 50933-namespace tflite { 50934-namespace ops { 50935-namespace custom { 50936-namespace whitespace_tokenizer { 50937-namespace test { 50938-namespace { 50939- 50940-using ::testing::ElementsAre; 50941-using ::testing::ElementsAreArray; 50942- 50943-} // namespace 50944- 50945-enum OutputType { PADDED, RAGGED }; 50946- 50947-class WhitespaceTokenizerModel : public SingleOpModel { 50948- public: 50949- WhitespaceTokenizerModel(OutputType output_type, 50950- const std::vector<std::string>& input_values, 50951- const std::vector<int>& input_shape) 50952- : input_shape_(input_shape) { 50953- input_ = AddInput(TensorType_STRING); 50954- output_values_ = AddOutput(TensorType_STRING); 50955- if (output_type == RAGGED) { 50956- for (int i = 0; i < input_shape_.size(); ++i) { 50957- output_row_splits_.push_back(AddOutput(TensorType_INT64)); 50958- } 50959- } 50960- SetCustomOp("WhitespaceTokenizer", {}, Register_tftext_WhitespaceTokenizer); 50961- 50962- BuildInterpreter({input_shape}); 50963- PopulateStringTensor(input_, input_values); 50964- Invoke(); 50965- } 50966- 50967- std::vector<int> GetValuesTensorShape() { 50968- return GetTensorShape(output_values_); 50969- } 50970- 50971- std::vector<std::string> ExtractValuesTensorVector() { 50972- std::vector<std::string> r; 50973- TfLiteTensor* tensor = interpreter_->tensor(output_values_); 50974- int n = GetStringCount(tensor); 50975- for (int i = 0; i < n; ++i) { 50976- StringRef ref = GetString(tensor, i); 50977- r.emplace_back(ref.str, ref.len); 50978- } 50979- return r; 50980- } 50981- 50982- void CheckRowSplits(const std::vector<int>& token_counts) { 50983- int size = 1; 50984- for (int i = 0; i < input_shape_.size(); ++i) { 50985- size *= input_shape_[i]; 50986- EXPECT_THAT(GetTensorShape(output_row_splits_[i]), ElementsAre(size + 1)) 50987- << "row_splits " << i << " has the wrong shape"; 50988- 50989- std::vector<int64_t> expected_values(size + 1); 50990- if (i == input_shape_.size() - 1) { 50991- ASSERT_EQ(token_counts.size(), size); 50992- 50993- int index = 0; 50994- expected_values[0] = index; 50995- for (int j = 0; j < size; ++j) { 50996- index += token_counts[j]; 50997- expected_values[j + 1] = index; 50998- } 50999- } else { 51000- for (int j = 0; j <= size; ++j) { 51001- expected_values[j] = j * input_shape_[i + 1]; 51002- } 51003- } 51004- EXPECT_THAT(ExtractVector<int64_t>(output_row_splits_[i]), 51005- ElementsAreArray(expected_values)) 51006- << "row_splits " << i << " has an incorrect value/index"; 51007- } 51008- } 51009- 51010- private: 51011- int input_; 51012- std::vector<int> input_shape_; 51013- int output_values_; 51014- std::vector<int> output_row_splits_; 51015-}; // namespace test 51016- 51017-TEST(WhitespaceTokenizerTest, SingleStringPaddedOutput) { 51018- WhitespaceTokenizerModel m(PADDED, {"this is a test"}, {1}); 51019- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(1, 4)); 51020- EXPECT_THAT(m.ExtractValuesTensorVector(), 51021- ElementsAre("this", "is", "a", "test")); 51022-} 51023- 51024-TEST(WhitespaceTokenizerTest, SingleStringRaggedOutput) { 51025- WhitespaceTokenizerModel m(RAGGED, {"this is a test"}, {1}); 51026- m.CheckRowSplits({4}); 51027- EXPECT_THAT(m.ExtractValuesTensorVector(), 51028- ElementsAre("this", "is", "a", "test")); 51029-} 51030- 51031-TEST(WhitespaceTokenizerTest, VectorPaddedOutput) { 51032- WhitespaceTokenizerModel m(PADDED, 51033- {"this is a test", // 51034- "three token sentence", // 51035- "many more tokens than that sentence"}, 51036- {3}); 51037- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(3, 6)); 51038- EXPECT_THAT( 51039- m.ExtractValuesTensorVector(), 51040- ElementsAre("this", "is", "a", "test", "", "", // 51041- "three", "token", "sentence", "", "", "", // 51042- "many", "more", "tokens", "than", "that", "sentence")); 51043-} 51044- 51045-TEST(WhitespaceTokenizerTest, VectorRaggedOutput) { 51046- WhitespaceTokenizerModel m(RAGGED, 51047- {"this is a test", // 51048- "three token sentence", // 51049- "many more tokens than that sentence"}, 51050- {3}); 51051- m.CheckRowSplits({4, 3, 6}); 51052- EXPECT_THAT( 51053- m.ExtractValuesTensorVector(), 51054- ElementsAre("this", "is", "a", "test", // 51055- "three", "token", "sentence", // 51056- "many", "more", "tokens", "than", "that", "sentence")); 51057-} 51058- 51059-TEST(WhitespaceTokenizerTest, MatrixPaddedOutput) { 51060- WhitespaceTokenizerModel m(PADDED, 51061- {"a b c", "d e f", // 51062- "g h", "i j k l", // 51063- "m", "n o p q r"}, 51064- {3, 2}); 51065- EXPECT_THAT(m.GetValuesTensorShape(), ElementsAre(3, 2, 5)); 51066- EXPECT_THAT(m.ExtractValuesTensorVector(), 51067- ElementsAre("a", "b", "c", "", "", // 51068- "d", "e", "f", "", "", // 51069- "g", "h", "", "", "", // 51070- "i", "j", "k", "l", "", // 51071- "m", "", "", "", "", // 51072- "n", "o", "p", "q", "r")); 51073-} 51074- 51075-TEST(WhitespaceTokenizerTest, MatrixRAGGEDOutput) { 51076- WhitespaceTokenizerModel m(RAGGED, 51077- {"a b c", "d e f", // 51078- "g h", "i j k l", // 51079- "m", "n o p q r"}, 51080- {3, 2}); 51081- m.CheckRowSplits({3, 3, 2, 4, 1, 5}); 51082- EXPECT_THAT(m.ExtractValuesTensorVector(), 51083- ElementsAre("a", "b", "c", // 51084- "d", "e", "f", // 51085- "g", "h", // 51086- "i", "j", "k", "l", // 51087- "m", // 51088- "n", "o", "p", "q", "r")); 51089-} 51090- 51091-} // namespace test 51092-} // namespace whitespace_tokenizer 51093-} // namespace custom 51094-} // namespace ops 51095-} // namespace tflite 51096diff --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 51097deleted file mode 100644 51098index b6a1a67d74ba2..0000000000000 51099--- a/src/third_party/tflite_support/src/tensorflow_lite_support/custom_ops/kernel/whitespace_tokenizer_test.py 51100+++ /dev/null 51101@@ -1,168 +0,0 @@ 51102-# Copyright 2020 The TensorFlow Authors. All Rights Reserved. 51103-# 51104-# Licensed under the Apache License, Version 2.0 (the "License"); 51105-# you may not use this file except in compliance with the License. 51106-# You may obtain a copy of the License at 51107-# 51108-# http://www.apache.org/licenses/LICENSE-2.0 51109-# 51110-# Unless required by applicable law or agreed to in writing, software 51111-# distributed under the License is distributed on an "AS IS" BASIS, 51112-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 51113-# See the License for the specific language governing permissions and 51114-# limitations under the License. 51115-# ============================================================================== 51116-# Lint as: python3 51117-"""Tests for tensorflow_lite_support.custom_ops.kernel.whitespace_tokenizer.""" 51118- 51119-import os 51120-import sys 51121-import timeit 51122- 51123-from absl import logging 51124-from absl.testing import parameterized 51125-import numpy as np 51126-import tensorflow as tf 51127-import tensorflow_text as tf_text 51128-# pylint: disable=g-direct-tensorflow-import 51129-from tensorflow.lite.python import interpreter as interpreter_wrapper 51130-from tensorflow.python.platform import resource_loader 51131- 51132-# Force loaded shared object symbols to be globally visible. This is needed so 51133-# that the interpreter_wrapper, in one .so file, can see the op resolver 51134-# in a different .so file. Note that this may already be set by default. 51135-# pylint: disable=g-import-not-at-top,g-bad-import-order,unused-import 51136-if hasattr(sys, 'setdlopenflags') and hasattr(sys, 'getdlopenflags'): 51137- sys.setdlopenflags(sys.getdlopenflags() | os.RTLD_GLOBAL) 51138-from tensorflow_lite_support.custom_ops.kernel import _pywrap_whitespace_tokenizer_op_resolver 51139- 51140-TEST_CASES = [ 51141- ['this is a test'], 51142- ['extra spaces in here'], 51143- ['a four token sentence', 'a five token sentence thing.'], 51144- [['a multi dimensional test case', 'a b c d', 'e f g'], 51145- ['h i j', 'k l m 2 3', 'n o p'], ['q r s 0 1', 't u v', 'w x y z']], 51146-] 51147- 51148-INVOKES_FOR_SINGLE_OP_BENCHMARK = 1000 51149-INVOKES_FOR_FLEX_DELEGATE_BENCHMARK = 10 51150- 51151- 51152-@tf.function 51153-def _call_whitespace_tokenizer_to_tensor(test_case): 51154- tokenizer = tf_text.WhitespaceTokenizer() 51155- return tokenizer.tokenize(test_case).to_tensor() 51156- 51157- 51158-@tf.function 51159-def _call_whitespace_tokenizer_to_ragged(test_case): 51160- tokenizer = tf_text.WhitespaceTokenizer() 51161- return tokenizer.tokenize(test_case) 51162- 51163- 51164-class WhitespaceTokenizerTest(parameterized.TestCase): 51165- 51166- @parameterized.parameters([t] for t in TEST_CASES) 51167- def testToTensorEquivalence(self, test_case): 51168- tf_output = _call_whitespace_tokenizer_to_tensor(test_case) 51169- 51170- model_filename = resource_loader.get_path_to_datafile( 51171- 'testdata/whitespace_tokenizer_to_tensor.tflite') 51172- with open(model_filename, 'rb') as file: 51173- model = file.read() 51174- interpreter = interpreter_wrapper.InterpreterWithCustomOps( 51175- model_content=model, 51176- custom_op_registerers=['AddWhitespaceTokenizerCustomOp']) 51177- 51178- np_test_case = np.array(test_case, dtype=np.str) 51179- interpreter.resize_tensor_input(0, np_test_case.shape) 51180- interpreter.allocate_tensors() 51181- interpreter.set_tensor(interpreter.get_input_details()[0]['index'], 51182- np_test_case) 51183- interpreter.invoke() 51184- tflite_output = interpreter.get_tensor( 51185- interpreter.get_output_details()[0]['index']) 51186- 51187- self.assertEqual(tf_output.numpy().tolist(), tflite_output.tolist()) 51188- 51189- @parameterized.parameters([t] for t in TEST_CASES) 51190- def testToRaggedEquivalence(self, test_case): 51191- tf_output = _call_whitespace_tokenizer_to_ragged(test_case) 51192- 51193- np_test_case = np.array(test_case, dtype=np.str) 51194- rank = len(np_test_case.shape) 51195- 51196- model_filename = resource_loader.get_path_to_datafile( 51197- 'testdata/whitespace_tokenizer_to_ragged_{}d_input.tflite'.format(rank)) 51198- with open(model_filename, 'rb') as file: 51199- model = file.read() 51200- interpreter = interpreter_wrapper.InterpreterWithCustomOps( 51201- model_content=model, 51202- custom_op_registerers=['AddWhitespaceTokenizerCustomOp']) 51203- interpreter.resize_tensor_input(0, np_test_case.shape) 51204- interpreter.allocate_tensors() 51205- interpreter.set_tensor(interpreter.get_input_details()[0]['index'], 51206- np_test_case) 51207- interpreter.invoke() 51208- 51209- # Traverse the nested row_splits/values of the ragged tensor. 51210- for i in range(rank): 51211- tflite_output_cur_row_splits = interpreter.get_tensor( 51212- interpreter.get_output_details()[1 + i]['index']) 51213- self.assertEqual(tf_output.row_splits.numpy().tolist(), 51214- tflite_output_cur_row_splits.tolist()) 51215- tf_output = tf_output.values 51216- 51217- tflite_output_values = interpreter.get_tensor( 51218- interpreter.get_output_details()[0]['index']) 51219- self.assertEqual(tf_output.numpy().tolist(), tflite_output_values.tolist()) 51220- 51221- def testSingleOpLatency(self): 51222- model_filename = resource_loader.get_path_to_datafile( 51223- 'testdata/whitespace_tokenizer_to_tensor.tflite') 51224- with open(model_filename, 'rb') as file: 51225- model = file.read() 51226- interpreter = interpreter_wrapper.InterpreterWithCustomOps( 51227- model_content=model, 51228- custom_op_registerers=['AddWhitespaceTokenizerCustomOp']) 51229- 51230- latency = 0.0 51231- for test_case in TEST_CASES: 51232- np_test_case = np.array(test_case, dtype=np.str) 51233- interpreter.resize_tensor_input(0, np_test_case.shape) 51234- interpreter.allocate_tensors() 51235- interpreter.set_tensor(interpreter.get_input_details()[0]['index'], 51236- np_test_case) 51237- start_time = timeit.default_timer() 51238- for _ in range(INVOKES_FOR_SINGLE_OP_BENCHMARK): 51239- interpreter.invoke() 51240- latency = latency + timeit.default_timer() - start_time 51241- 51242- latency = latency / (INVOKES_FOR_SINGLE_OP_BENCHMARK * len(TEST_CASES)) 51243- logging.info('Latency: %fms', latency * 1000.0) 51244- 51245- def testFlexDelegateLatency(self): 51246- model_filename = resource_loader.get_path_to_datafile( 51247- 'testdata/whitespace_tokenizer_flex_delegate.tflite') 51248- with open(model_filename, 'rb') as file: 51249- model = file.read() 51250- interpreter = interpreter_wrapper.Interpreter(model_content=model) 51251- 51252- latency = 0.0 51253- for test_case in TEST_CASES: 51254- np_test_case = np.array(test_case, dtype=np.str) 51255- interpreter.resize_tensor_input(0, np_test_case.shape) 51256- interpreter.allocate_tensors() 51257- interpreter.set_tensor(interpreter.get_input_details()[0]['index'], 51258- np_test_case) 51259- start_time = timeit.default_timer() 51260- for _ in range(INVOKES_FOR_FLEX_DELEGATE_BENCHMARK): 51261- interpreter.invoke() 51262- latency = latency + timeit.default_timer() - start_time 51263- 51264- latency = latency / (INVOKES_FOR_FLEX_DELEGATE_BENCHMARK * len(TEST_CASES)) 51265- logging.info('Latency: %fms', latency * 1000.0) 51266- 51267- 51268-if __name__ == '__main__': 51269- tf.test.main() 51270diff --git a/src/tools/metrics/histograms/enums.xml b/src/tools/metrics/histograms/enums.xml 51271index 6c9de291ba594..9b5cd62a72864 51272--- a/src/tools/metrics/histograms/enums.xml 51273+++ b/src/tools/metrics/histograms/enums.xml 51274@@ -8455,6 +8455,7 @@ Called by update_bad_message_reasons.py.--> 51275 <int value="16" label="EMF_INVALID_EXTENSION_ID_FOR_CONTENT_SCRIPT"/> 51276 <int value="17" label="EMF_INVALID_EXTENSION_ID_FOR_WORKER_CONTEXT"/> 51277 <int value="18" label="EMF_INVALID_PORT_CONTEXT"/> 51278+ <int value="21" label="EMF_INVALID_EXTENSION_ID_FOR_TAB_MSG"/> 51279 </enum> 51280 51281 <enum name="BadMessageReasonGuestView"> 51282diff --git a/src/ui/base/clipboard/ohos/clipboard_ohos.cc b/src/ui/base/clipboard/ohos/clipboard_ohos.cc 51283index ac7413b89d5ab..f4c9e9ff47175 51284--- a/src/ui/base/clipboard/ohos/clipboard_ohos.cc 51285+++ b/src/ui/base/clipboard/ohos/clipboard_ohos.cc 51286@@ -71,6 +71,14 @@ bool IsRegisteredInstance(const Clipboard* clipboard) { 51287 return base::Contains(*GetInstanceRegistry(), clipboard); 51288 } 51289 51290+std::string RemoveFileSchemePerfix(const std::string img_src) { 51291+ GURL img_url(img_src); 51292+ if (img_url.SchemeIsFile()) { 51293+ return img_url.path(); 51294+ } 51295+ return img_src; 51296+} 51297+ 51298 std::string GetImgLocalPath(const char* img_src) { 51299 if (!img_src) { 51300 return ""; 51301@@ -82,7 +90,7 @@ std::string GetImgLocalPath(const char* img_src) { 51302 } 51303 if (img_url.SchemeIsFile() && 51304 base::PathExists(base::FilePath(img_url.path()))) { 51305- return img_url.path(); 51306+ return std::string(img_src); 51307 } 51308 if (base::PathExists(base::FilePath(img_src))) { 51309 return std::string(img_src); 51310@@ -348,8 +356,9 @@ class ClipboardOHOSInternal { 51311 std::vector<uint8_t> offset_list( 51312 offset_data, offset_data + it->second.size() * sizeof(int)); 51313 custom_data.insert(std::make_pair(it->first, offset_list)); 51314- if (uri_record->SetUri(it->first) && 51315+ if (uri_record->SetUri(RemoveFileSchemePerfix(it->first)) && 51316 uri_record->SetCustomData(custom_data)) { 51317+ LOG(ERROR) << it->first; 51318 result_list.push_back(uri_record); 51319 } else { 51320 LOG(ERROR) << "WriteHTML extra record failed"; 51321@@ -533,7 +542,6 @@ class ClipboardDataBuilder { 51322 std::map<std::string, std::vector<int>>& img_src_set, 51323 int offset) { 51324 std::string img_path = GetImgLocalPath(img_src); 51325- // LOG(ERROR) << "AddImgUrlToSet:" << img_path; 51326 if (!img_path.empty()) { 51327 std::map<std::string, std::vector<int>>::iterator iter = 51328 img_src_set.find(img_path); 51329diff --git a/src/ui/base/clipboard/ohos/clipboard_ohos_read_data.cc b/src/ui/base/clipboard/ohos/clipboard_ohos_read_data.cc 51330index 9983b83565535..8a788bcd48d88 51331--- a/src/ui/base/clipboard/ohos/clipboard_ohos_read_data.cc 51332+++ b/src/ui/base/clipboard/ohos/clipboard_ohos_read_data.cc 51333@@ -10,12 +10,21 @@ 51334 #include "base/files/file_util.h" 51335 #include "base/logging.h" 51336 #include "third_party/icu/source/i18n/unicode/regex.h" 51337+#include "url/gurl.h" 51338 51339 using namespace OHOS::NWeb; 51340 51341 namespace ui { 51342 const std::string kImgPasteboardDir = "/data/storage/el2/base/cache/pasteboard"; 51343 51344+std::string RemoveFileSchemePerfix(const std::string& img_src) { 51345+ GURL img_url(img_src); 51346+ if (img_url.SchemeIsFile()) { 51347+ return img_url.path(); 51348+ } 51349+ return img_src; 51350+} 51351+ 51352 ClipboardOhosReadData::ClipboardOhosReadData(PasteRecordList& record_list) 51353 : record_list_(record_list) { 51354 is_in_app_ = OhosAdapterHelper::GetInstance().GetPasteBoard().IsLocalPaste(); 51355@@ -41,11 +50,12 @@ void ClipboardOhosReadData::SaveImgFile(const std::string& old_uri, 51356 std::string& new_uri, 51357 uint32_t token_id) { 51358 base::FilePath pasteboard_root_path(kImgPasteboardDir); 51359+ std::string old_uri_without_prefix = RemoveFileSchemePerfix(old_uri); 51360 base::FilePath dest_file_dir_path( 51361 pasteboard_root_path.Append(std::to_string(token_id)) 51362- .Append(base::FilePath(old_uri).DirName())); 51363- base::FilePath new_file_path( 51364- dest_file_dir_path.Append(base::FilePath(old_uri).BaseName())); 51365+ .Append(base::FilePath(old_uri_without_prefix).DirName())); 51366+ base::FilePath new_file_path(dest_file_dir_path.Append( 51367+ base::FilePath(old_uri_without_prefix).BaseName())); 51368 if (!base::DirectoryExists(dest_file_dir_path) && 51369 !base::CreateDirectory(dest_file_dir_path)) { 51370 return; 51371diff --git a/src/ui/base/ui_features.gni b/src/ui/base/ui_features.gni 51372index 44c1552b35e4c..febd84e679d21 51373--- a/src/ui/base/ui_features.gni 51374+++ b/src/ui/base/ui_features.gni 51375@@ -32,4 +32,4 @@ declare_args() { 51376 has_platform_accessibility_support = 51377 has_native_accessibility || is_android || is_fuchsia 51378 51379-enable_hidpi = !is_android 51380+enable_hidpi = !is_android && !is_ohos 51381diff --git a/src/ui/gl/gl_surface_egl_ohos.cc b/src/ui/gl/gl_surface_egl_ohos.cc 51382index a8c5763683753..c52e32315bd20 51383--- a/src/ui/gl/gl_surface_egl_ohos.cc 51384+++ b/src/ui/gl/gl_surface_egl_ohos.cc 51385@@ -3,6 +3,7 @@ 51386 // found in the LICENSE file. 51387 51388 #include "ui/gl/gl_surface_egl_ohos.h" 51389+#include "content/public/common/content_switches.h" 51390 51391 #include <surface.h> 51392 #include <sys/time.h> 51393@@ -25,11 +26,29 @@ namespace gl { 51394 scoped_refptr<gl::NativeViewGLSurfaceEGLOhos> 51395 NativeViewGLSurfaceEGLOhos::CreateNativeViewGLSurfaceEGLOhos( 51396 gfx::AcceleratedWidget widget) { 51397- NativeWindow* window = 51398- (NativeWindow*)NWebNativeWindowTracker::Instance().GetNativeWindow( 51399+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 51400+ if (command_line->HasSwitch(::switches::kOhosHanceSurface)) { 51401+ LOG(INFO) << "CreateNativeViewGLSurfaceEGLOhos:: enhance surface"; 51402+ WindowsSurfaceInfo* surfaceInfo = 51403+ (WindowsSurfaceInfo*)NWebNativeWindowTracker::Instance().GetNativeWindow( 51404 widget); 51405- return scoped_refptr<NativeViewGLSurfaceEGLOhos>( 51406- new NativeViewGLSurfaceEGLOhos(EGLNativeWindowType(window))); 51407+ if (surfaceInfo != nullptr) { 51408+ LOG(INFO) << "clear surface from NWEB"; 51409+ eglDestroySurface(surfaceInfo->display, surfaceInfo->surface); 51410+ eglDestroyContext(surfaceInfo->display, surfaceInfo->context); 51411+ 51412+ return scoped_refptr<NativeViewGLSurfaceEGLOhos>( 51413+ new NativeViewGLSurfaceEGLOhos(EGLNativeWindowType(surfaceInfo->window))); 51414+ } 51415+ } else { 51416+ LOG(INFO) << "CreateNativeViewGLSurfaceEGLOhos:: normal surface"; 51417+ NativeWindow* window = 51418+ (NativeWindow*)NWebNativeWindowTracker::Instance().GetNativeWindow( 51419+ widget); 51420+ return scoped_refptr<NativeViewGLSurfaceEGLOhos>( 51421+ new NativeViewGLSurfaceEGLOhos(EGLNativeWindowType(window))); 51422+ } 51423+ return nullptr; 51424 } 51425 51426 NativeViewGLSurfaceEGLOhos::NativeViewGLSurfaceEGLOhos( 51427@@ -54,9 +73,8 @@ gfx::SwapResult NativeViewGLSurfaceEGLOhos::SwapBuffers( 51428 void NativeViewGLSurfaceEGLOhos::FrameCounter::Start() { 51429 std::weak_ptr<FrameCounter> frame_counter_weak(shared_from_this()); 51430 std::thread frame_stat_thread([frame_counter_weak]() { 51431- while (!frame_counter_weak.expired()) { 51432+ while (auto frame_counter = frame_counter_weak.lock()) { 51433 { 51434- auto frame_counter = frame_counter_weak.lock(); 51435 std::unique_lock<std::mutex> lk(frame_counter->frame_stat_mtx_); 51436 int64_t curr_time = GetNowTime(); 51437 if (frame_counter->last_time_ == 0) { 51438diff --git a/src/ui/gl/gl_surface_egl_ohos.h b/src/ui/gl/gl_surface_egl_ohos.h 51439index c1c1f00eac9a0..dbdc2cc2a777f 51440--- a/src/ui/gl/gl_surface_egl_ohos.h 51441+++ b/src/ui/gl/gl_surface_egl_ohos.h 51442@@ -8,10 +8,17 @@ 51443 #include <condition_variable> 51444 #include <memory> 51445 #include <mutex> 51446+#include "ui/gl/gl_bindings.h" 51447 #include "ui/gl/gl_export.h" 51448 #include "ui/gl/gl_surface_egl.h" 51449 51450 namespace gl { 51451+typedef struct WindowsSurfaceInfoTag { 51452+ void* window; 51453+ EGLDisplay display; 51454+ EGLContext context; 51455+ EGLSurface surface; 51456+} WindowsSurfaceInfo; 51457 51458 class GL_EXPORT NativeViewGLSurfaceEGLOhos : public NativeViewGLSurfaceEGL { 51459 public: 51460diff --git a/src/ui/views/BUILD.gn b/src/ui/views/BUILD.gn 51461index 28f6dff93dec7..d884bc549a58f 51462--- a/src/ui/views/BUILD.gn 51463+++ b/src/ui/views/BUILD.gn 51464@@ -15,7 +15,13 @@ import("//ui/views/features.gni") 51465 assert(toolkit_views || is_ohos) 51466 51467 config("flags") { 51468- defines = [ "TOOLKIT_VIEWS=1" ] 51469+ if (is_ohos) { 51470+ if (toolkit_views) { 51471+ defines = [ "TOOLKIT_VIEWS=1" ] 51472+ } 51473+ } else { 51474+ defines = [ "TOOLKIT_VIEWS=1" ] 51475+ } 51476 } 51477 51478 aggregate_vector_icons("views_vector_icons") { 51479diff --git a/src/ui/views/accessibility/ax_aura_obj_cache.cc b/src/ui/views/accessibility/ax_aura_obj_cache.cc 51480index af4c6b5c39686..7313a9caff32a 51481--- a/src/ui/views/accessibility/ax_aura_obj_cache.cc 51482+++ b/src/ui/views/accessibility/ax_aura_obj_cache.cc 51483@@ -74,6 +74,11 @@ AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(View* view) { 51484 // Avoid problems with transient focus events. https://crbug.com/729449 51485 if (!view->GetWidget()) 51486 return nullptr; 51487+ 51488+ DCHECK(view_to_id_map_.find(view) != view_to_id_map_.end() || 51489+ // This is either a new view or we're erroneously here during ~View. 51490+ view->life_cycle_state() == View::LifeCycleState::kAlive); 51491+ 51492 return CreateInternal<AXViewObjWrapper>(view, &view_to_id_map_); 51493 } 51494 51495diff --git a/src/ui/views/accessibility/ax_aura_obj_cache.h b/src/ui/views/accessibility/ax_aura_obj_cache.h 51496index db6c31a89d023..223f13dd2b6e3 51497--- a/src/ui/views/accessibility/ax_aura_obj_cache.h 51498+++ b/src/ui/views/accessibility/ax_aura_obj_cache.h 51499@@ -88,9 +88,6 @@ class VIEWS_EXPORT AXAuraObjCache : public aura::client::FocusChangeObserver { 51500 // Get the object that has focus. 51501 AXAuraObjWrapper* GetFocus(); 51502 51503- // Send a notification that the focused view may have changed. 51504- void OnFocusedViewChanged(); 51505- 51506 // Tell our delegate to fire an event on a given object. 51507 void FireEvent(AXAuraObjWrapper* aura_obj, ax::mojom::Event event_type); 51508 51509@@ -122,6 +119,9 @@ class VIEWS_EXPORT AXAuraObjCache : public aura::client::FocusChangeObserver { 51510 51511 View* GetFocusedView(); 51512 51513+ // Send a notification that the focused view may have changed. 51514+ void OnFocusedViewChanged(); 51515+ 51516 // aura::client::FocusChangeObserver override. 51517 void OnWindowFocused(aura::Window* gained_focus, 51518 aura::Window* lost_focus) override; 51519diff --git a/src/ui/views/accessibility/ax_aura_obj_cache_unittest.cc b/src/ui/views/accessibility/ax_aura_obj_cache_unittest.cc 51520index 037ad6437c2a2..ccdab6ebd0075 51521--- a/src/ui/views/accessibility/ax_aura_obj_cache_unittest.cc 51522+++ b/src/ui/views/accessibility/ax_aura_obj_cache_unittest.cc 51523@@ -106,15 +106,12 @@ class ViewBlurObserver : public ViewObserver { 51524 observation_.Observe(view); 51525 } 51526 51527- // This is fired while the view is being destroyed, after the cache entry is 51528- // removed by the AXWidgetObjWrapper. Re-create the cache entry so we can 51529- // test that it will also be removed. 51530 void OnViewBlurred(View* view) override { 51531 ASSERT_FALSE(was_called()); 51532 observation_.Reset(); 51533 51534- ASSERT_EQ(cache_->GetID(view), 0); 51535- cache_->GetOrCreate(view); 51536+ // The cache entry gets deleted in 51537+ // AXViewObjWrapper::OnViewIsDeleting which occurs later in ~View. 51538 } 51539 51540 bool was_called() { return !observation_.IsObserving(); } 51541diff --git a/src/ui/views/accessibility/ax_widget_obj_wrapper.cc b/src/ui/views/accessibility/ax_widget_obj_wrapper.cc 51542index 7aba1f32a1d9e..7169dafa3fbf6 51543--- a/src/ui/views/accessibility/ax_widget_obj_wrapper.cc 51544+++ b/src/ui/views/accessibility/ax_widget_obj_wrapper.cc 51545@@ -20,7 +20,6 @@ AXWidgetObjWrapper::AXWidgetObjWrapper(AXAuraObjCache* aura_obj_cache, 51546 : AXAuraObjWrapper(aura_obj_cache), widget_(widget) { 51547 DCHECK(widget->GetNativeView()); 51548 widget_observation_.Observe(widget); 51549- widget_removals_observation_.Observe(widget); 51550 } 51551 51552 AXWidgetObjWrapper::~AXWidgetObjWrapper() = default; 51553@@ -78,14 +77,4 @@ void AXWidgetObjWrapper::OnWidgetClosing(Widget* widget) { 51554 aura_obj_cache_->Remove(widget); 51555 } 51556 51557-void AXWidgetObjWrapper::OnWidgetVisibilityChanged(Widget*, bool) { 51558- // If a widget changes visibility it may affect what's focused, in particular 51559- // when a widget that contains the focused view gets hidden. 51560- aura_obj_cache_->OnFocusedViewChanged(); 51561-} 51562- 51563-void AXWidgetObjWrapper::OnWillRemoveView(Widget* widget, View* view) { 51564- aura_obj_cache_->RemoveViewSubtree(view); 51565-} 51566- 51567 } // namespace views 51568diff --git a/src/ui/views/accessibility/ax_widget_obj_wrapper.h b/src/ui/views/accessibility/ax_widget_obj_wrapper.h 51569index 53f3c600a0a26..6ec90e291d8fc 51570--- a/src/ui/views/accessibility/ax_widget_obj_wrapper.h 51571+++ b/src/ui/views/accessibility/ax_widget_obj_wrapper.h 51572@@ -16,15 +16,12 @@ 51573 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" 51574 #include "ui/views/widget/widget.h" 51575 #include "ui/views/widget/widget_observer.h" 51576-#include "ui/views/widget/widget_removals_observer.h" 51577 51578 namespace views { 51579 class AXAuraObjCache; 51580 51581 // Describes a |Widget| for use with other AX classes. 51582-class AXWidgetObjWrapper : public AXAuraObjWrapper, 51583- public WidgetObserver, 51584- public WidgetRemovalsObserver { 51585+class AXWidgetObjWrapper : public AXAuraObjWrapper, public WidgetObserver { 51586 public: 51587 // |aura_obj_cache| must outlive this object. 51588 AXWidgetObjWrapper(AXAuraObjCache* aura_obj_cache, Widget* widget); 51589@@ -43,10 +40,6 @@ class AXWidgetObjWrapper : public AXAuraObjWrapper, 51590 void OnWidgetDestroying(Widget* widget) override; 51591 void OnWidgetDestroyed(Widget* widget) override; 51592 void OnWidgetClosing(Widget* widget) override; 51593- void OnWidgetVisibilityChanged(Widget*, bool) override; 51594- 51595- // WidgetRemovalsObserver overrides. 51596- void OnWillRemoveView(Widget* widget, View* view) override; 51597 51598 private: 51599 raw_ptr<Widget> widget_; 51600@@ -54,11 +47,6 @@ class AXWidgetObjWrapper : public AXAuraObjWrapper, 51601 const ui::AXUniqueId unique_id_; 51602 51603 base::ScopedObservation<Widget, WidgetObserver> widget_observation_{this}; 51604- base::ScopedObservation<Widget, 51605- WidgetRemovalsObserver, 51606- &Widget::AddRemovalsObserver, 51607- &Widget::RemoveRemovalsObserver> 51608- widget_removals_observation_{this}; 51609 }; 51610 51611 } // namespace views 51612diff --git a/src/ui/views/accessibility/ax_window_obj_wrapper.cc b/src/ui/views/accessibility/ax_window_obj_wrapper.cc 51613index 4fa02617f6fdb..7ccad9445a396 51614--- a/src/ui/views/accessibility/ax_window_obj_wrapper.cc 51615+++ b/src/ui/views/accessibility/ax_window_obj_wrapper.cc 51616@@ -281,19 +281,15 @@ void AXWindowObjWrapper::OnCaretBoundsChanged( 51617 } 51618 51619 void AXWindowObjWrapper::OnWindowDestroyed(aura::Window* window) { 51620+ if (is_root_window_) 51621+ aura_obj_cache_->OnRootWindowObjDestroyed(window_); 51622+ 51623 aura_obj_cache_->Remove(window, nullptr); 51624 } 51625 51626 void AXWindowObjWrapper::OnWindowDestroying(aura::Window* window) { 51627- if (window == window_) 51628- window_destroying_ = true; 51629- 51630- Widget* widget = GetWidgetForWindow(window); 51631- if (widget) 51632- aura_obj_cache_->Remove(widget); 51633- 51634- if (is_root_window_) 51635- aura_obj_cache_->OnRootWindowObjDestroyed(window_); 51636+ DCHECK_EQ(window, window_); 51637+ window_destroying_ = true; 51638 } 51639 51640 void AXWindowObjWrapper::OnWindowHierarchyChanged( 51641diff --git a/src/ui/views/bubble/bubble_dialog_delegate_view.cc b/src/ui/views/bubble/bubble_dialog_delegate_view.cc 51642index b0d39d93fbb05..6453c06d13fe9 51643--- a/src/ui/views/bubble/bubble_dialog_delegate_view.cc 51644+++ b/src/ui/views/bubble/bubble_dialog_delegate_view.cc 51645@@ -35,6 +35,7 @@ 51646 #include "ui/views/view_class_properties.h" 51647 #include "ui/views/widget/widget.h" 51648 #include "ui/views/widget/widget_observer.h" 51649+#include "ui/views/window/dialog_client_view.h" 51650 51651 #if BUILDFLAG(IS_WIN) 51652 #include "ui/base/win/shell.h" 51653@@ -709,6 +710,16 @@ void BubbleDialogDelegate::OnAnchorBoundsChanged() { 51654 // TODO(pbos): Reconsider whether to update the anchor when the view isn't 51655 // drawn. 51656 SizeToContents(); 51657+ 51658+ // We will not accept input event a short time after anchored view changed. 51659+ UpdateInputProtectorsTimeStamp(); 51660+} 51661+ 51662+void BubbleDialogDelegate::UpdateInputProtectorsTimeStamp() { 51663+ if (auto* dialog = GetDialogClientView()) 51664+ dialog->UpdateInputProtectorTimeStamp(); 51665+ 51666+ GetBubbleFrameView()->UpdateInputProtectorTimeStamp(); 51667 } 51668 51669 gfx::Rect BubbleDialogDelegate::GetBubbleBounds() { 51670diff --git a/src/ui/views/bubble/bubble_dialog_delegate_view.h b/src/ui/views/bubble/bubble_dialog_delegate_view.h 51671index 77012f1360ad9..fb0c7a27d8576 51672--- a/src/ui/views/bubble/bubble_dialog_delegate_view.h 51673+++ b/src/ui/views/bubble/bubble_dialog_delegate_view.h 51674@@ -140,6 +140,10 @@ class VIEWS_EXPORT BubbleDialogDelegate : public DialogDelegate { 51675 // normally, do not call this. 51676 void OnAnchorBoundsChanged(); 51677 51678+ // Call this method to update view shown time stamp of underneath input 51679+ // protectors. 51680+ void UpdateInputProtectorsTimeStamp(); 51681+ 51682 ////////////////////////////////////////////////////////////////////////////// 51683 // Miscellaneous bubble behaviors: 51684 // 51685diff --git a/src/ui/views/bubble/bubble_frame_view.cc b/src/ui/views/bubble/bubble_frame_view.cc 51686index 01426297ebb61..feca2ab55844d 51687--- a/src/ui/views/bubble/bubble_frame_view.cc 51688+++ b/src/ui/views/bubble/bubble_frame_view.cc 51689@@ -692,6 +692,10 @@ gfx::Rect BubbleFrameView::GetUpdatedWindowBounds( 51690 return bubble_border_->GetBounds(anchor_rect, size); 51691 } 51692 51693+void BubbleFrameView::UpdateInputProtectorTimeStamp() { 51694+ input_protector_.UpdateViewShownTimeStamp(); 51695+} 51696+ 51697 void BubbleFrameView::ResetViewShownTimeStampForTesting() { 51698 input_protector_.ResetForTesting(); 51699 } 51700diff --git a/src/ui/views/bubble/bubble_frame_view.h b/src/ui/views/bubble/bubble_frame_view.h 51701index f1a77ab30951c..a5cbbd9382e30 51702--- a/src/ui/views/bubble/bubble_frame_view.h 51703+++ b/src/ui/views/bubble/bubble_frame_view.h 51704@@ -166,6 +166,10 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView { 51705 51706 View* GetHeaderViewForTesting() const { return header_view_; } 51707 51708+ // Update the |view_shown_time_stamp_| of input protector. A short time 51709+ // from this point onward, input event will be ignored. 51710+ void UpdateInputProtectorTimeStamp(); 51711+ 51712 // Resets the time when view has been shown. Tests may need to call this 51713 // method if they use events that could be otherwise treated as unintended. 51714 // See IsPossiblyUnintendedInteraction(). 51715@@ -202,6 +206,8 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView { 51716 IgnorePossiblyUnintendedClicksClose); 51717 FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, 51718 IgnorePossiblyUnintendedClicksMinimize); 51719+ FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, 51720+ IgnorePossiblyUnintendedClicksAnchorBoundsChanged); 51721 FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CloseReasons); 51722 FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewTest, CloseMethods); 51723 FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewTest, CreateDelegate); 51724diff --git a/src/ui/views/bubble/bubble_frame_view_unittest.cc b/src/ui/views/bubble/bubble_frame_view_unittest.cc 51725index ccb485eb3ffc8..33f6a6829e0fe 51726--- a/src/ui/views/bubble/bubble_frame_view_unittest.cc 51727+++ b/src/ui/views/bubble/bubble_frame_view_unittest.cc 51728@@ -30,11 +30,10 @@ 51729 #include "ui/views/test/views_test_base.h" 51730 #include "ui/views/widget/widget.h" 51731 #include "ui/views/widget/widget_delegate.h" 51732+#include "ui/views/window/dialog_client_view.h" 51733 51734 namespace views { 51735 51736-using BubbleFrameViewTest = ViewsTestBase; 51737- 51738 namespace { 51739 51740 constexpr BubbleBorder::Arrow kArrow = BubbleBorder::TOP_LEFT; 51741@@ -147,6 +146,18 @@ class TestBubbleFrameView : public BubbleFrameView { 51742 51743 } // namespace 51744 51745+class BubbleFrameViewTest : public ViewsTestBase { 51746+ public: 51747+ BubbleFrameViewTest() 51748+ : views::ViewsTestBase( 51749+ base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} 51750+ 51751+ BubbleFrameViewTest(const BubbleFrameViewTest&) = delete; 51752+ BubbleFrameViewTest& operator=(const BubbleFrameViewTest&) = delete; 51753+ 51754+ ~BubbleFrameViewTest() override = default; 51755+}; 51756+ 51757 TEST_F(BubbleFrameViewTest, GetBoundsForClientView) { 51758 TestBubbleFrameView frame(this); 51759 EXPECT_EQ(kArrow, frame.GetBorderArrow()); 51760@@ -1303,6 +1314,46 @@ TEST_F(BubbleFrameViewTest, IgnorePossiblyUnintendedClicksMinimize) { 51761 EXPECT_TRUE(bubble->IsMinimized()); 51762 } 51763 51764+// Ensures that clicks are ignored for short time after anchor view bounds 51765+// changed. 51766+TEST_F(BubbleFrameViewTest, IgnorePossiblyUnintendedClicksAnchorBoundsChanged) { 51767+ auto delegate_unique = std::make_unique<TestBubbleDialogDelegateView>(); 51768+ TestBubbleDialogDelegateView* const delegate = delegate_unique.get(); 51769+ TestAnchor anchor(CreateParams(Widget::InitParams::TYPE_WINDOW)); 51770+ delegate->SetAnchorView(anchor.widget().GetContentsView()); 51771+ delegate->SetCanMinimize(true); 51772+ Widget* bubble = 51773+ BubbleDialogDelegateView::CreateBubble(std::move(delegate_unique)); 51774+ bubble->Show(); 51775+ ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), 51776+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); 51777+ BubbleFrameView* frame = delegate->GetBubbleFrameView(); 51778+ test::ButtonTestApi(frame->minimize_).NotifyClick(mouse_event); 51779+ auto* widget = delegate->GetWidget(); 51780+ auto* dialog = delegate->GetDialogClientView(); 51781+ auto* ok_button = dialog->ok_button(); 51782+ test::ButtonTestApi(ok_button).NotifyClick(mouse_event); 51783+ EXPECT_FALSE(bubble->IsMinimized()); 51784+ EXPECT_FALSE(widget->IsClosed()); 51785+ 51786+ task_environment()->FastForwardBy( 51787+ base::Milliseconds(GetDoubleClickInterval())); 51788+ anchor.widget().SetBounds(gfx::Rect(10, 10, 100, 100)); 51789+ 51790+ ui::MouseEvent mouse_event_1(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), 51791+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); 51792+ test::ButtonTestApi(ok_button).NotifyClick(mouse_event_1); 51793+ test::ButtonTestApi(frame->minimize_).NotifyClick(mouse_event_1); 51794+ EXPECT_FALSE(widget->IsClosed()); 51795+ EXPECT_FALSE(bubble->IsMinimized()); 51796+ 51797+ test::ButtonTestApi(ok_button).NotifyClick(ui::MouseEvent( 51798+ ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), 51799+ ui::EventTimeForNow() + base::Milliseconds(GetDoubleClickInterval()), 51800+ ui::EF_NONE, ui::EF_NONE)); 51801+ EXPECT_TRUE(widget->IsClosed()); 51802+} 51803+ 51804 // Ensures that layout is correct when the progress indicator is visible. 51805 TEST_F(BubbleFrameViewTest, LayoutWithProgressIndicator) { 51806 auto delegate_unique = std::make_unique<TestBubbleDialogDelegateView>(); 51807diff --git a/src/ui/views/input_event_activation_protector.cc b/src/ui/views/input_event_activation_protector.cc 51808index fd907009fb29d..94b8e47228d49 51809--- a/src/ui/views/input_event_activation_protector.cc 51810+++ b/src/ui/views/input_event_activation_protector.cc 51811@@ -14,6 +14,14 @@ void InputEventActivationProtector::VisibilityChanged(bool is_visible) { 51812 view_shown_time_stamp_ = base::TimeTicks::Now(); 51813 } 51814 51815+void InputEventActivationProtector::UpdateViewShownTimeStamp() { 51816+ // The UI was never shown, ignore. 51817+ if (view_shown_time_stamp_ == base::TimeTicks()) 51818+ return; 51819+ 51820+ view_shown_time_stamp_ = base::TimeTicks::Now(); 51821+} 51822+ 51823 bool InputEventActivationProtector::IsPossiblyUnintendedInteraction( 51824 const ui::Event& event) { 51825 if (view_shown_time_stamp_ == base::TimeTicks()) { 51826diff --git a/src/ui/views/input_event_activation_protector.h b/src/ui/views/input_event_activation_protector.h 51827index 42ffd02397599..7426d0dc5318a 51828--- a/src/ui/views/input_event_activation_protector.h 51829+++ b/src/ui/views/input_event_activation_protector.h 51830@@ -30,6 +30,11 @@ class VIEWS_EXPORT InputEventActivationProtector { 51831 // method must be called when the visibility of the view is changed. 51832 void VisibilityChanged(bool is_visible); 51833 51834+ // Updates the |view_shown_time_stamp_| if needed. This function will be 51835+ // called when we want to reset back the input protector to "initial shown" 51836+ // state, basically under some certain view's proprieties changed events. 51837+ void UpdateViewShownTimeStamp(); 51838+ 51839 // Returns true if the event is a mouse, touch, or pointer event that took 51840 // place within the double-click time interval after |view_shown_time_stamp_|. 51841 bool IsPossiblyUnintendedInteraction(const ui::Event& event); 51842diff --git a/src/ui/views/view.cc b/src/ui/views/view.cc 51843index 99d9510a9647d..8ac4f139f09c9 51844--- a/src/ui/views/view.cc 51845+++ b/src/ui/views/view.cc 51846@@ -224,6 +224,8 @@ View::View() { 51847 } 51848 51849 View::~View() { 51850+ life_cycle_state_ = LifeCycleState::kDestroying; 51851+ 51852 if (parent_) 51853 parent_->RemoveChildView(this); 51854 51855diff --git a/src/ui/views/view.h b/src/ui/views/view.h 51856index be4a0c8ad6695..59d51e1ce0a36 51857--- a/src/ui/views/view.h 51858+++ b/src/ui/views/view.h 51859@@ -1415,6 +1415,16 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, 51860 void RemoveObserver(ViewObserver* observer); 51861 bool HasObserver(const ViewObserver* observer) const; 51862 51863+ // http://crbug.com/1162949 : Instrumentation that indicates if this is alive. 51864+ // Callers should not depend on this as it is meant to be temporary. 51865+ enum class LifeCycleState : uint32_t { 51866+ kAlive = 0x600D600D, 51867+ kDestroying = 0x90141013, 51868+ kDestroyed = 0xBAADBAAD, 51869+ }; 51870+ 51871+ LifeCycleState life_cycle_state() const { return life_cycle_state_; } 51872+ 51873 protected: 51874 // Used to track a drag. RootView passes this into 51875 // ProcessMousePressed/Dragged. 51876@@ -1666,12 +1676,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, 51877 FRIEND_TEST_ALL_PREFIXES(ViewTest, PaintWithMovedViewUsesCacheInRTL); 51878 FRIEND_TEST_ALL_PREFIXES(ViewTest, PaintWithUnknownInvalidation); 51879 51880- // http://crbug.com/1162949 : Instrumentation that indicates if this is alive. 51881- enum class LifeCycleState : uint32_t { 51882- kAlive = 0x600D600D, 51883- kDestroyed = 0xBAADBAAD, 51884- }; 51885- 51886 // This is the default view layout. It is a very simple version of FillLayout, 51887 // which merely sets the bounds of the children to the content bounds. The 51888 // actual FillLayout isn't used here because it supports a couple of features 51889diff --git a/src/ui/views/window/dialog_client_view.cc b/src/ui/views/window/dialog_client_view.cc 51890index 283ee15d15bec..ad9d0862043de 51891--- a/src/ui/views/window/dialog_client_view.cc 51892+++ b/src/ui/views/window/dialog_client_view.cc 51893@@ -225,6 +225,10 @@ void DialogClientView::OnThemeChanged() { 51894 } 51895 } 51896 51897+void DialogClientView::UpdateInputProtectorTimeStamp() { 51898+ input_protector_.UpdateViewShownTimeStamp(); 51899+} 51900+ 51901 void DialogClientView::ResetViewShownTimeStampForTesting() { 51902 input_protector_.ResetForTesting(); 51903 } 51904diff --git a/src/ui/views/window/dialog_client_view.h b/src/ui/views/window/dialog_client_view.h 51905index 016f2531876e8..abff481b0470c 51906--- a/src/ui/views/window/dialog_client_view.h 51907+++ b/src/ui/views/window/dialog_client_view.h 51908@@ -63,6 +63,10 @@ class VIEWS_EXPORT DialogClientView : public ClientView, public DialogObserver { 51909 const ViewHierarchyChangedDetails& details) override; 51910 void OnThemeChanged() override; 51911 51912+ // Update the |view_shown_time_stamp_| of input protector. A short time 51913+ // from this point onward, input event will be ignored. 51914+ void UpdateInputProtectorTimeStamp(); 51915+ 51916 void set_minimum_size(const gfx::Size& size) { minimum_size_ = size; } 51917 51918 // Resets the time when view has been shown. Tests may need to call this 51919diff --git a/src/ui/views/window/dialog_delegate.cc b/src/ui/views/window/dialog_delegate.cc 51920index ba01196119858..b8d7b52bb490d 51921--- a/src/ui/views/window/dialog_delegate.cc 51922+++ b/src/ui/views/window/dialog_delegate.cc 51923@@ -275,12 +275,8 @@ const DialogClientView* DialogDelegate::GetDialogClientView() const { 51924 } 51925 51926 DialogClientView* DialogDelegate::GetDialogClientView() { 51927- if (!GetWidget()) 51928- return nullptr; 51929- views::View* client_view = GetWidget()->client_view(); 51930- return client_view->GetClassName() == DialogClientView::kViewClassName 51931- ? static_cast<DialogClientView*>(client_view) 51932- : nullptr; 51933+ return const_cast<DialogClientView*>( 51934+ const_cast<const DialogDelegate*>(this)->GetDialogClientView()); 51935 } 51936 51937 BubbleFrameView* DialogDelegate::GetBubbleFrameView() const { 51938diff --git a/src/ui/views/window/dialog_delegate.h b/src/ui/views/window/dialog_delegate.h 51939index edfda090a20a3..b5c54aa3753b2 51940--- a/src/ui/views/window/dialog_delegate.h 51941+++ b/src/ui/views/window/dialog_delegate.h 51942@@ -172,6 +172,13 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { 51943 // will only be created when use_custom_frame() is true. 51944 BubbleFrameView* GetBubbleFrameView() const; 51945 51946+ // A helper for accessing the DialogClientView object contained by this 51947+ // delegate's Window. This function can return nullptr if the |client_view| is 51948+ // a DialogClientView subclass which also has metadata or overrides 51949+ // GetClassName(). 51950+ const DialogClientView* GetDialogClientView() const; 51951+ DialogClientView* GetDialogClientView(); 51952+ 51953 // Helpers for accessing parts of the DialogClientView without needing to know 51954 // about DialogClientView. Do not call these before OnWidgetInitialized(). 51955 views::LabelButton* GetOkButton() const; 51956@@ -310,11 +317,6 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { 51957 std::unique_ptr<View> DisownFootnoteView(); 51958 51959 private: 51960- // A helper for accessing the DialogClientView object contained by this 51961- // delegate's Window. 51962- const DialogClientView* GetDialogClientView() const; 51963- DialogClientView* GetDialogClientView(); 51964- 51965 // Runs a close callback, ensuring that at most one close callback is ever 51966 // run. 51967 void RunCloseCallback(base::OnceClosure callback); 51968diff --git a/src/v8/gni/v8.gni b/src/v8/gni/v8.gni 51969index 19f5eeed262c8..974492a827e97 51970--- a/src/v8/gni/v8.gni 51971+++ b/src/v8/gni/v8.gni 51972@@ -87,7 +87,7 @@ declare_args() { 51973 51974 # Enable advanced BigInt algorithms, costing about 10-30 KB binary size 51975 # depending on platform. Disabled on Android to save binary size. 51976- v8_advanced_bigint_algorithms = !is_android 51977+ v8_advanced_bigint_algorithms = !is_android && !is_ohos 51978 } 51979 51980 if (v8_use_external_startup_data == "") { 51981@@ -139,7 +139,8 @@ if (is_debug && !v8_optimized_debug) { 51982 51983 # TODO(crbug.com/621335) Rework this so that we don't have the confusion 51984 # between "optimize_speed" and "optimize_max". 51985- if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) { 51986+ if (((is_posix && !is_android && !is_ohos) || is_fuchsia) && 51987+ !using_sanitizer) { 51988 v8_add_configs += [ "//build/config/compiler:optimize_speed" ] 51989 } else { 51990 v8_add_configs += [ "//build/config/compiler:optimize_max" ] 51991diff --git a/src/v8/src/ast/scopes.cc b/src/v8/src/ast/scopes.cc 51992index 3d5d92ae8b306..971ca2e1d31c4 51993--- a/src/v8/src/ast/scopes.cc 51994+++ b/src/v8/src/ast/scopes.cc 51995@@ -840,9 +840,8 @@ void DeclarationScope::AddLocal(Variable* var) { 51996 } 51997 51998 void Scope::Snapshot::Reparent(DeclarationScope* new_parent) { 51999- DCHECK(!IsCleared()); 52000- DCHECK_EQ(new_parent, outer_scope_and_calls_eval_.GetPointer()->inner_scope_); 52001- DCHECK_EQ(new_parent->outer_scope_, outer_scope_and_calls_eval_.GetPointer()); 52002+ DCHECK_EQ(new_parent, outer_scope_->inner_scope_); 52003+ DCHECK_EQ(new_parent->outer_scope_, outer_scope_); 52004 DCHECK_EQ(new_parent, new_parent->GetClosureScope()); 52005 DCHECK_NULL(new_parent->inner_scope_); 52006 DCHECK(new_parent->unresolved_list_.is_empty()); 52007@@ -867,12 +866,11 @@ void Scope::Snapshot::Reparent(DeclarationScope* new_parent) { 52008 new_parent->sibling_ = top_inner_scope_; 52009 } 52010 52011- Scope* outer_scope = outer_scope_and_calls_eval_.GetPointer(); 52012- new_parent->unresolved_list_.MoveTail(&outer_scope->unresolved_list_, 52013+ new_parent->unresolved_list_.MoveTail(&outer_scope_->unresolved_list_, 52014 top_unresolved_); 52015 52016 // Move temporaries allocated for complex parameter initializers. 52017- DeclarationScope* outer_closure = outer_scope->GetClosureScope(); 52018+ DeclarationScope* outer_closure = outer_scope_->GetClosureScope(); 52019 for (auto it = top_local_; it != outer_closure->locals()->end(); ++it) { 52020 Variable* local = *it; 52021 DCHECK_EQ(VariableMode::kTemporary, local->mode()); 52022@@ -884,16 +882,10 @@ void Scope::Snapshot::Reparent(DeclarationScope* new_parent) { 52023 outer_closure->locals_.Rewind(top_local_); 52024 52025 // Move eval calls since Snapshot's creation into new_parent. 52026- if (outer_scope_and_calls_eval_->calls_eval_) { 52027- new_parent->RecordDeclarationScopeEvalCall(); 52028- new_parent->inner_scope_calls_eval_ = true; 52029+ if (outer_scope_->calls_eval_) { 52030+ new_parent->RecordEvalCall(); 52031+ declaration_scope_->sloppy_eval_can_extend_vars_ = false; 52032 } 52033- 52034- // We are in the arrow function case. The calls eval we may have recorded 52035- // is intended for the inner scope and we should simply restore the 52036- // original "calls eval" flag of the outer scope. 52037- RestoreEvalFlag(); 52038- Clear(); 52039 } 52040 52041 void Scope::ReplaceOuterScope(Scope* outer) { 52042@@ -2510,6 +2502,9 @@ void Scope::AllocateVariablesRecursively() { 52043 this->ForEach([](Scope* scope) -> Iteration { 52044 DCHECK(!scope->already_resolved_); 52045 if (WasLazilyParsed(scope)) return Iteration::kContinue; 52046+ if (scope->sloppy_eval_can_extend_vars_) { 52047+ scope->num_heap_slots_ = Context::MIN_CONTEXT_EXTENDED_SLOTS; 52048+ } 52049 DCHECK_EQ(scope->ContextHeaderLength(), scope->num_heap_slots_); 52050 52051 // Allocate variables for this scope. 52052diff --git a/src/v8/src/ast/scopes.h b/src/v8/src/ast/scopes.h 52053index dd1a693255551..de11f6e69e717 52054--- a/src/v8/src/ast/scopes.h 52055+++ b/src/v8/src/ast/scopes.h 52056@@ -107,12 +107,6 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) { 52057 52058 class Snapshot final { 52059 public: 52060- Snapshot() 52061- : outer_scope_and_calls_eval_(nullptr, false), 52062- top_unresolved_(), 52063- top_local_() { 52064- DCHECK(IsCleared()); 52065- } 52066 inline explicit Snapshot(Scope* scope); 52067 52068 // Disallow copy and move. 52069@@ -120,45 +114,31 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) { 52070 Snapshot(Snapshot&&) = delete; 52071 52072 ~Snapshot() { 52073- // If we're still active, there was no arrow function. In that case outer 52074- // calls eval if it already called eval before this snapshot started, or 52075- // if the code during the snapshot called eval. 52076- if (!IsCleared() && outer_scope_and_calls_eval_.GetPayload()) { 52077- RestoreEvalFlag(); 52078+ // Restore eval flags from before the scope was active. 52079+ if (sloppy_eval_can_extend_vars_) { 52080+ declaration_scope_->sloppy_eval_can_extend_vars_ = true; 52081 } 52082- } 52083- 52084- void RestoreEvalFlag() { 52085- if (outer_scope_and_calls_eval_.GetPayload()) { 52086- // This recreates both calls_eval and sloppy_eval_can_extend_vars. 52087- outer_scope_and_calls_eval_.GetPointer()->RecordEvalCall(); 52088+ if (calls_eval_) { 52089+ outer_scope_->calls_eval_ = true; 52090 } 52091 } 52092 52093 void Reparent(DeclarationScope* new_parent); 52094- bool IsCleared() const { 52095- return outer_scope_and_calls_eval_.GetPointer() == nullptr; 52096- } 52097- 52098- void Clear() { 52099- outer_scope_and_calls_eval_.SetPointer(nullptr); 52100-#ifdef DEBUG 52101- outer_scope_and_calls_eval_.SetPayload(false); 52102- top_inner_scope_ = nullptr; 52103- top_local_ = base::ThreadedList<Variable>::Iterator(); 52104- top_unresolved_ = UnresolvedList::Iterator(); 52105-#endif 52106- } 52107 52108 private: 52109- // During tracking calls_eval caches whether the outer scope called eval. 52110- // Upon move assignment we store whether the new inner scope calls eval into 52111- // the move target calls_eval bit, and restore calls eval on the outer 52112- // scope. 52113- PointerWithPayload<Scope, bool, 1> outer_scope_and_calls_eval_; 52114+ Scope* outer_scope_; 52115+ Scope* declaration_scope_; 52116 Scope* top_inner_scope_; 52117 UnresolvedList::Iterator top_unresolved_; 52118 base::ThreadedList<Variable>::Iterator top_local_; 52119+ // While the scope is active, the scope caches the flag values for 52120+ // outer_scope_ / declaration_scope_ they can be used to know what happened 52121+ // while parsing the arrow head. If this turns out to be an arrow head, new 52122+ // values on the respective scopes will be cleared and moved to the inner 52123+ // scope. Otherwise the cached flags will be merged with the flags from the 52124+ // arrow head. 52125+ bool calls_eval_; 52126+ bool sloppy_eval_can_extend_vars_; 52127 }; 52128 52129 enum class DeserializationMode { kIncludingVariables, kScopesOnly }; 52130@@ -884,8 +864,8 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope { 52131 void RecordDeclarationScopeEvalCall() { 52132 calls_eval_ = true; 52133 52134- // If this isn't a sloppy eval, we don't care about it. 52135- if (language_mode() != LanguageMode::kSloppy) return; 52136+ // The caller already checked whether we're in sloppy mode. 52137+ CHECK(is_sloppy(language_mode())); 52138 52139 // Sloppy eval in script scopes can only introduce global variables anyway, 52140 // so we don't care that it calls sloppy eval. 52141@@ -919,7 +899,6 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope { 52142 } 52143 52144 sloppy_eval_can_extend_vars_ = true; 52145- num_heap_slots_ = Context::MIN_CONTEXT_EXTENDED_SLOTS; 52146 } 52147 52148 bool sloppy_eval_can_extend_vars() const { 52149@@ -1337,7 +1316,9 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope { 52150 52151 void Scope::RecordEvalCall() { 52152 calls_eval_ = true; 52153- GetDeclarationScope()->RecordDeclarationScopeEvalCall(); 52154+ if (is_sloppy(language_mode())) { 52155+ GetDeclarationScope()->RecordDeclarationScopeEvalCall(); 52156+ } 52157 RecordInnerScopeEvalCall(); 52158 // The eval contents might access "super" (if it's inside a function that 52159 // binds super). 52160@@ -1350,14 +1331,18 @@ void Scope::RecordEvalCall() { 52161 } 52162 52163 Scope::Snapshot::Snapshot(Scope* scope) 52164- : outer_scope_and_calls_eval_(scope, scope->calls_eval_), 52165+ : outer_scope_(scope), 52166+ declaration_scope_(scope->GetDeclarationScope()), 52167 top_inner_scope_(scope->inner_scope_), 52168 top_unresolved_(scope->unresolved_list_.end()), 52169- top_local_(scope->GetClosureScope()->locals_.end()) { 52170- // Reset in order to record eval calls during this Snapshot's lifetime. 52171- outer_scope_and_calls_eval_.GetPointer()->calls_eval_ = false; 52172- outer_scope_and_calls_eval_.GetPointer()->sloppy_eval_can_extend_vars_ = 52173- false; 52174+ top_local_(scope->GetClosureScope()->locals_.end()), 52175+ calls_eval_(outer_scope_->calls_eval_), 52176+ sloppy_eval_can_extend_vars_( 52177+ declaration_scope_->sloppy_eval_can_extend_vars_) { 52178+ // Reset in order to record (sloppy) eval calls during this Snapshot's 52179+ // lifetime. 52180+ outer_scope_->calls_eval_ = false; 52181+ declaration_scope_->sloppy_eval_can_extend_vars_ = false; 52182 } 52183 52184 class ModuleScope final : public DeclarationScope { 52185diff --git a/src/v8/src/compiler/access-info.cc b/src/v8/src/compiler/access-info.cc 52186index 2356ba2cb8cf6..9424860b7676b 52187--- a/src/v8/src/compiler/access-info.cc 52188+++ b/src/v8/src/compiler/access-info.cc 52189@@ -477,9 +477,15 @@ PropertyAccessInfo AccessInfoFactory::ComputeDataFieldAccessInfo( 52190 map, descriptor, details_representation)); 52191 } else if (details_representation.IsHeapObject()) { 52192 if (descriptors_field_type->IsNone()) { 52193- // Store is not safe if the field type was cleared. 52194- if (access_mode == AccessMode::kStore) { 52195- return Invalid(); 52196+ switch (access_mode) { 52197+ case AccessMode::kStore: 52198+ case AccessMode::kStoreInLiteral: 52199+ case AccessMode::kDefine: 52200+ // Store is not safe if the field type was cleared. 52201+ return Invalid(); 52202+ case AccessMode::kLoad: 52203+ case AccessMode::kHas: 52204+ break; 52205 } 52206 52207 // The field type was cleared by the GC, so we don't know anything 52208diff --git a/src/v8/src/compiler/compilation-dependencies.cc b/src/v8/src/compiler/compilation-dependencies.cc 52209index 6f5514289b764..62bd0f8c46d1e 52210--- a/src/v8/src/compiler/compilation-dependencies.cc 52211+++ b/src/v8/src/compiler/compilation-dependencies.cc 52212@@ -35,7 +35,8 @@ namespace compiler { 52213 V(Protector) \ 52214 V(PrototypeProperty) \ 52215 V(StableMap) \ 52216- V(Transition) 52217+ V(Transition) \ 52218+ V(ObjectSlotValue) 52219 52220 CompilationDependencies::CompilationDependencies(JSHeapBroker* broker, 52221 Zone* zone) 52222@@ -863,6 +864,42 @@ class ProtectorDependency final : public CompilationDependency { 52223 const PropertyCellRef cell_; 52224 }; 52225 52226+// Check that an object slot will not change during compilation. 52227+class ObjectSlotValueDependency final : public CompilationDependency { 52228+ public: 52229+ explicit ObjectSlotValueDependency(const HeapObjectRef& object, int offset, 52230+ const ObjectRef& value) 52231+ : CompilationDependency(kObjectSlotValue), 52232+ object_(object.object()), 52233+ offset_(offset), 52234+ value_(value.object()) {} 52235+ 52236+ bool IsValid() const override { 52237+ PtrComprCageBase cage_base = GetPtrComprCageBase(*object_); 52238+ Object current_value = 52239+ offset_ == HeapObject::kMapOffset 52240+ ? object_->map() 52241+ : TaggedField<Object>::Relaxed_Load(cage_base, *object_, offset_); 52242+ return *value_ == current_value; 52243+ } 52244+ void Install(PendingDependencies* deps) const override {} 52245+ 52246+ private: 52247+ size_t Hash() const override { 52248+ return base::hash_combine(object_.address(), offset_, value_.address()); 52249+ } 52250+ 52251+ bool Equals(const CompilationDependency* that) const override { 52252+ const ObjectSlotValueDependency* const zat = that->AsObjectSlotValue(); 52253+ return object_->address() == zat->object_->address() && 52254+ offset_ == zat->offset_ && value_.address() == zat->value_.address(); 52255+ } 52256+ 52257+ Handle<HeapObject> object_; 52258+ int offset_; 52259+ Handle<Object> value_; 52260+}; 52261+ 52262 class ElementsKindDependency final : public CompilationDependency { 52263 public: 52264 ElementsKindDependency(const AllocationSiteRef& site, ElementsKind kind) 52265@@ -1110,6 +1147,12 @@ void CompilationDependencies::DependOnElementsKind( 52266 } 52267 } 52268 52269+void CompilationDependencies::DependOnObjectSlotValue( 52270+ const HeapObjectRef& object, int offset, const ObjectRef& value) { 52271+ RecordDependency( 52272+ zone_->New<ObjectSlotValueDependency>(object, offset, value)); 52273+} 52274+ 52275 void CompilationDependencies::DependOnOwnConstantElement( 52276 const JSObjectRef& holder, uint32_t index, const ObjectRef& element) { 52277 RecordDependency( 52278diff --git a/src/v8/src/compiler/compilation-dependencies.h b/src/v8/src/compiler/compilation-dependencies.h 52279index aa8ff7b82abd2..c6a18c400fe75 52280--- a/src/v8/src/compiler/compilation-dependencies.h 52281+++ b/src/v8/src/compiler/compilation-dependencies.h 52282@@ -93,6 +93,10 @@ class V8_EXPORT_PRIVATE CompilationDependencies : public ZoneObject { 52283 // Record the assumption that {site}'s {ElementsKind} doesn't change. 52284 void DependOnElementsKind(const AllocationSiteRef& site); 52285 52286+ // Check that an object slot will not change during compilation. 52287+ void DependOnObjectSlotValue(const HeapObjectRef& object, int offset, 52288+ const ObjectRef& value); 52289+ 52290 void DependOnOwnConstantElement(const JSObjectRef& holder, uint32_t index, 52291 const ObjectRef& element); 52292 52293diff --git a/src/v8/src/compiler/effect-control-linearizer.cc b/src/v8/src/compiler/effect-control-linearizer.cc 52294index bb932732c9692..e1ee380a68785 52295--- a/src/v8/src/compiler/effect-control-linearizer.cc 52296+++ b/src/v8/src/compiler/effect-control-linearizer.cc 52297@@ -5527,6 +5527,8 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { 52298 52299 auto if_double = __ MakeDeferredLabel(); 52300 auto done = __ MakeLabel(MachineRepresentation::kTagged); 52301+ auto loaded_field = __ MakeLabel(MachineRepresentation::kTagged); 52302+ auto done_double = __ MakeLabel(MachineRepresentation::kFloat64); 52303 52304 // Check if field is a mutable double field. 52305 __ GotoIfNot(__ IntPtrEqual(__ WordAnd(index, one), zero), &if_double); 52306@@ -5543,8 +5545,8 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { 52307 Node* offset = 52308 __ IntAdd(__ WordShl(index, __ IntPtrConstant(kTaggedSizeLog2 - 1)), 52309 __ IntPtrConstant(JSObject::kHeaderSize - kHeapObjectTag)); 52310- Node* result = __ Load(MachineType::AnyTagged(), object, offset); 52311- __ Goto(&done, result); 52312+ Node* field = __ Load(MachineType::AnyTagged(), object, offset); 52313+ __ Goto(&loaded_field, field); 52314 } 52315 52316 // The field is located in the properties backing store of {object}. 52317@@ -5558,8 +5560,8 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { 52318 __ IntPtrConstant(kTaggedSizeLog2 - 1)), 52319 __ IntPtrConstant((FixedArray::kHeaderSize - kTaggedSize) - 52320 kHeapObjectTag)); 52321- Node* result = __ Load(MachineType::AnyTagged(), properties, offset); 52322- __ Goto(&done, result); 52323+ Node* field = __ Load(MachineType::AnyTagged(), properties, offset); 52324+ __ Goto(&loaded_field, field); 52325 } 52326 } 52327 52328@@ -5567,9 +5569,6 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { 52329 // architectures, or a mutable HeapNumber. 52330 __ Bind(&if_double); 52331 { 52332- auto loaded_field = __ MakeLabel(MachineRepresentation::kTagged); 52333- auto done_double = __ MakeLabel(MachineRepresentation::kFloat64); 52334- 52335 index = __ WordSar(index, one); 52336 52337 // Check if field is in-object or out-of-object. 52338@@ -5597,27 +5596,27 @@ Node* EffectControlLinearizer::LowerLoadFieldByIndex(Node* node) { 52339 Node* field = __ Load(MachineType::AnyTagged(), properties, offset); 52340 __ Goto(&loaded_field, field); 52341 } 52342+ } 52343 52344- __ Bind(&loaded_field); 52345- { 52346- Node* field = loaded_field.PhiAt(0); 52347- // We may have transitioned in-place away from double, so check that 52348- // this is a HeapNumber -- otherwise the load is fine and we don't need 52349- // to copy anything anyway. 52350- __ GotoIf(ObjectIsSmi(field), &done, field); 52351- Node* field_map = __ LoadField(AccessBuilder::ForMap(), field); 52352- __ GotoIfNot(__ TaggedEqual(field_map, __ HeapNumberMapConstant()), &done, 52353- field); 52354- 52355- Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), field); 52356- __ Goto(&done_double, value); 52357- } 52358+ __ Bind(&loaded_field); 52359+ { 52360+ Node* field = loaded_field.PhiAt(0); 52361+ // We may have transitioned in-place away from double, so check that 52362+ // this is a HeapNumber -- otherwise the load is fine and we don't need 52363+ // to copy anything anyway. 52364+ __ GotoIf(ObjectIsSmi(field), &done, field); 52365+ Node* field_map = __ LoadField(AccessBuilder::ForMap(), field); 52366+ __ GotoIfNot(__ TaggedEqual(field_map, __ HeapNumberMapConstant()), &done, 52367+ field); 52368 52369- __ Bind(&done_double); 52370- { 52371- Node* result = AllocateHeapNumberWithValue(done_double.PhiAt(0)); 52372- __ Goto(&done, result); 52373- } 52374+ Node* value = __ LoadField(AccessBuilder::ForHeapNumberValue(), field); 52375+ __ Goto(&done_double, value); 52376+ } 52377+ 52378+ __ Bind(&done_double); 52379+ { 52380+ Node* result = AllocateHeapNumberWithValue(done_double.PhiAt(0)); 52381+ __ Goto(&done, result); 52382 } 52383 52384 __ Bind(&done); 52385diff --git a/src/v8/src/compiler/js-create-lowering.cc b/src/v8/src/compiler/js-create-lowering.cc 52386index fab65507ea056..25a2ec03d2f4a 52387--- a/src/v8/src/compiler/js-create-lowering.cc 52388+++ b/src/v8/src/compiler/js-create-lowering.cc 52389@@ -1677,6 +1677,10 @@ base::Optional<Node*> JSCreateLowering::TryAllocateFastLiteral( 52390 52391 // Now that we hold the migration lock, get the current map. 52392 MapRef boilerplate_map = boilerplate.map(); 52393+ // Protect against concurrent changes to the boilerplate object by checking 52394+ // for an identical value at the end of the compilation. 52395+ dependencies()->DependOnObjectSlotValue(boilerplate, HeapObject::kMapOffset, 52396+ boilerplate_map); 52397 { 52398 base::Optional<MapRef> current_boilerplate_map = 52399 boilerplate.map_direct_read(); 52400@@ -1841,10 +1845,18 @@ base::Optional<Node*> JSCreateLowering::TryAllocateFastLiteralElements( 52401 boilerplate.elements(kRelaxedLoad); 52402 if (!maybe_boilerplate_elements.has_value()) return {}; 52403 FixedArrayBaseRef boilerplate_elements = maybe_boilerplate_elements.value(); 52404+ // Protect against concurrent changes to the boilerplate object by checking 52405+ // for an identical value at the end of the compilation. 52406+ dependencies()->DependOnObjectSlotValue( 52407+ boilerplate, JSObject::kElementsOffset, boilerplate_elements); 52408 52409 // Empty or copy-on-write elements just store a constant. 52410 int const elements_length = boilerplate_elements.length(); 52411 MapRef elements_map = boilerplate_elements.map(); 52412+ // Protect against concurrent changes to the boilerplate object by checking 52413+ // for an identical value at the end of the compilation. 52414+ dependencies()->DependOnObjectSlotValue(boilerplate_elements, 52415+ HeapObject::kMapOffset, elements_map); 52416 if (boilerplate_elements.length() == 0 || elements_map.IsFixedCowArrayMap()) { 52417 if (allocation == AllocationType::kOld && 52418 !boilerplate.IsElementsTenured(boilerplate_elements)) { 52419diff --git a/src/v8/src/wasm/baseline/liftoff-compiler.cc b/src/v8/src/wasm/baseline/liftoff-compiler.cc 52420index 4d7502687a569..8a47c93c0ae11 52421--- a/src/v8/src/wasm/baseline/liftoff-compiler.cc 52422+++ b/src/v8/src/wasm/baseline/liftoff-compiler.cc 52423@@ -1417,9 +1417,11 @@ class LiftoffCompiler { 52424 __ MergeFullStackWith(c->label_state, *__ cache_state()); 52425 __ emit_jump(c->label.get()); 52426 } 52427- // Merge the else state into the end state. 52428+ // Merge the else state into the end state. Set this state as the current 52429+ // state first so helper functions know which registers are in use. 52430 __ bind(c->else_state->label.get()); 52431- __ MergeFullStackWith(c->label_state, c->else_state->state); 52432+ __ cache_state()->Steal(c->else_state->state); 52433+ __ MergeFullStackWith(c->label_state, *__ cache_state()); 52434 __ cache_state()->Steal(c->label_state); 52435 } else if (c->reachable()) { 52436 // No merge yet at the end of the if, but we need to create a merge for 52437@@ -1431,9 +1433,11 @@ class LiftoffCompiler { 52438 c->stack_depth + c->num_exceptions); 52439 __ MergeFullStackWith(c->label_state, *__ cache_state()); 52440 __ emit_jump(c->label.get()); 52441- // Merge the else state into the end state. 52442+ // Merge the else state into the end state. Set this state as the current 52443+ // state first so helper functions know which registers are in use. 52444 __ bind(c->else_state->label.get()); 52445- __ MergeFullStackWith(c->label_state, c->else_state->state); 52446+ __ cache_state()->Steal(c->else_state->state); 52447+ __ MergeFullStackWith(c->label_state, *__ cache_state()); 52448 __ cache_state()->Steal(c->label_state); 52449 } else { 52450 // No merge needed, just continue with the else state. 52451diff --git a/src/v8/src/wasm/graph-builder-interface.cc b/src/v8/src/wasm/graph-builder-interface.cc 52452index 61a3bc57c9651..25e7b0252f57a 52453--- a/src/v8/src/wasm/graph-builder-interface.cc 52454+++ b/src/v8/src/wasm/graph-builder-interface.cc 52455@@ -87,6 +87,7 @@ class WasmGraphBuildingInterface { 52456 struct TryInfo : public ZoneObject { 52457 SsaEnv* catch_env; 52458 TFNode* exception = nullptr; 52459+ bool first_catch = true; 52460 52461 bool might_throw() const { return exception != nullptr; } 52462 52463@@ -865,6 +866,10 @@ class WasmGraphBuildingInterface { 52464 52465 TFNode* exception = block->try_info->exception; 52466 SetEnv(block->try_info->catch_env); 52467+ if (block->try_info->first_catch) { 52468+ LoadContextIntoSsa(ssa_env_); 52469+ block->try_info->first_catch = false; 52470+ } 52471 52472 TFNode* if_catch = nullptr; 52473 TFNode* if_no_catch = nullptr; 52474@@ -942,6 +947,9 @@ class WasmGraphBuildingInterface { 52475 } 52476 52477 SetEnv(block->try_info->catch_env); 52478+ if (block->try_info->first_catch) { 52479+ LoadContextIntoSsa(ssa_env_); 52480+ } 52481 } 52482 52483 void AtomicOp(FullDecoder* decoder, WasmOpcode opcode, 52484