From eb2d2264d02abd7f34df36809d44752aaf93da93 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 18 Sep 2019 15:58:00 -0400 Subject: [PATCH] chore: bump chromium to 63be48daea281d4f8c834c2e707a7 (master) (#19923) --- DEPS | 7 +- build/args/all.gn | 3 + chromium_src/BUILD.gn | 6 - .../browser/certificate_manager_model.cc | 4 +- .../chrome/browser/process_singleton_posix.cc | 9 +- components/pepper_flash/BUILD.gn | 1 + patches/chromium/.patches | 4 +- ...client_precreatemessageloop_callback.patch | 2 +- patches/chromium/add_realloc.patch | 6 +- .../chromium/blink_initialization_order.patch | 4 +- patches/chromium/blink_local_frame.patch | 6 +- patches/chromium/blink_world_context.patch | 4 +- .../build_add_electron_tracing_category.patch | 4 +- patches/chromium/build_gn.patch | 6 +- patches/chromium/can_create_window.patch | 32 +- .../chromium/content_browser_main_loop.patch | 4 +- patches/chromium/dcheck.patch | 10 +- patches/chromium/disable-redraw-lock.patch | 10 +- .../disable_color_correct_rendering.patch | 46 +- patches/chromium/disable_hidden.patch | 6 +- ...requirement_for_beforeunload_dialogs.patch | 4 +- patches/chromium/dom_storage_limits.patch | 8 +- patches/chromium/dump_syms.patch | 4 +- patches/chromium/enable_widevine.patch | 22 - .../exclude-a-few-test-files-from-build.patch | 4 +- ...xpose_setuseragent_on_networkcontext.patch | 16 +- ...dd_set_theme_source_to_allow_apps_to.patch | 6 +- ...screen_rendering_with_viz_compositor.patch | 636 ------------------ ...akpad_symbol_generation_on_linux_arm.patch | 2 +- ...chdir_np_and_pthread_chdir_np_in_mas.patch | 6 +- patches/chromium/frame_host_manager.patch | 20 +- patches/chromium/ignore_rc_check.patch | 4 +- ...launchservicesserverconnectionstatus.patch | 2 +- patches/chromium/mas_no_private_api.patch | 32 +- ...emote_certificate_verification_logic.patch | 60 +- .../chromium/notification_provenance.patch | 10 +- .../chromium/out_of_process_instance.patch | 4 +- patches/chromium/pepper_flash.patch | 12 +- patches/chromium/picture-in-picture.patch | 39 +- patches/chromium/preconnect_feature.patch | 10 +- patches/chromium/printing.patch | 72 +- ...put_back_deleted_colors_for_autofill.patch | 10 +- .../render_widget_host_view_base.patch | 10 +- .../render_widget_host_view_mac.patch | 14 +- patches/chromium/resource_file_conflict.patch | 6 +- ...anup_remove_menu_subtitles_sublabels.patch | 531 +++++++++++++++ patches/chromium/scroll_bounce_flag.patch | 4 +- .../ssl_security_state_tab_helper.patch | 30 +- .../support_mixed_sandbox_with_zygote.patch | 28 +- patches/chromium/sysroot.patch | 2 +- patches/chromium/tts.patch | 144 +--- .../chromium/ui_views_fix_jumbo_build.patch | 29 + ...andboxed_ppapi_processes_skip_zygote.patch | 2 +- .../verbose_generate_breakpad_symbols.patch | 10 +- patches/chromium/web_contents.patch | 14 +- patches/chromium/webview_cross_drag.patch | 2 +- .../worker_context_will_destroy.patch | 20 +- patches/config.json | 2 + patches/perfetto/.patches | 2 + ...l_update_protoc_host_toolchain_rules.patch | 134 ++++ ...e_trace_processor_a_host-only_target.patch | 389 +++++++++++ patches/v8/.patches | 1 + patches/v8/add_realloc.patch | 8 +- patches/v8/build_gn.patch | 8 +- patches/v8/dcheck.patch | 8 +- ...vide_more_v8_backwards_compatibility.patch | 50 +- ...export_private_v8_symbols_on_windows.patch | 8 +- ...ort_symbols_needed_for_windows_build.patch | 6 +- patches/v8/expose_mksnapshot.patch | 4 +- ...offset_of_to_offsetof_where_possible.patch | 44 ++ ...workaround_an_undefined_symbol_error.patch | 10 +- shell/app/node_main.cc | 2 +- shell/browser/api/atom_api_browser_window.cc | 4 +- .../api/atom_api_browser_window_mac.mm | 2 +- shell/browser/api/atom_api_content_tracing.cc | 6 +- shell/browser/api/atom_api_cookies.cc | 61 +- .../browser/api/atom_api_data_pipe_holder.cc | 11 +- shell/browser/api/atom_api_data_pipe_holder.h | 3 +- shell/browser/api/atom_api_native_theme.cc | 7 +- shell/browser/api/atom_api_net_log.cc | 4 +- shell/browser/api/atom_api_session.cc | 15 +- shell/browser/api/atom_api_top_level_window.h | 2 +- shell/browser/api/atom_api_url_request_ns.cc | 25 +- shell/browser/api/gpuinfo_manager.cc | 3 +- shell/browser/atom_browser_client.cc | 37 +- shell/browser/atom_browser_client.h | 11 +- shell/browser/atom_browser_context.cc | 3 +- .../browser/atom_browser_main_parts_posix.cc | 2 +- .../browser/atom_download_manager_delegate.cc | 4 +- shell/browser/common_web_contents_delegate.cc | 4 +- .../extensions/atom_extension_system.cc | 2 +- .../atom_extensions_browser_client.cc | 2 +- shell/browser/login_handler.cc | 16 +- shell/browser/login_handler.h | 4 +- shell/browser/mac/in_app_purchase.mm | 5 +- shell/browser/mac/in_app_purchase_observer.mm | 4 +- shell/browser/mac/in_app_purchase_product.mm | 4 +- shell/browser/native_window_views.cc | 2 +- shell/browser/net/asar/asar_url_loader.cc | 5 +- shell/browser/net/network_context_service.cc | 6 +- shell/browser/net/network_context_service.h | 3 +- shell/browser/net/node_stream_loader.h | 1 + .../net/proxying_url_loader_factory.cc | 49 +- .../browser/net/proxying_url_loader_factory.h | 28 +- .../net/system_network_context_manager.cc | 8 +- .../net/system_network_context_manager.h | 3 +- .../win/windows_toast_notification.cc | 6 +- .../osr/osr_render_widget_host_view.cc | 25 +- .../browser/osr/osr_render_widget_host_view.h | 7 +- shell/browser/osr/osr_web_contents_view.cc | 3 +- shell/browser/osr/osr_web_contents_view.h | 3 +- .../printing/print_preview_message_handler.cc | 6 +- shell/browser/session_preferences.cc | 2 + .../browser/ui/cocoa/atom_menu_controller.mm | 4 +- shell/browser/ui/message_box_win.cc | 2 +- shell/browser/ui/tray_icon_cocoa.mm | 2 +- shell/browser/ui/views/menu_delegate.cc | 7 +- shell/browser/web_view_guest_delegate.cc | 2 - shell/common/platform_util_win.cc | 8 +- shell/common/promise_util.h | 24 +- shell/renderer/api/atom_api_renderer_ipc.cc | 2 +- shell/renderer/renderer_client_base.cc | 14 - shell/renderer/renderer_client_base.h | 2 - spec-main/api-net-spec.ts | 2 +- 124 files changed, 1736 insertions(+), 1410 deletions(-) delete mode 100644 patches/chromium/enable_widevine.patch delete mode 100644 patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch create mode 100644 patches/chromium/revert_cleanup_remove_menu_subtitles_sublabels.patch create mode 100644 patches/chromium/ui_views_fix_jumbo_build.patch create mode 100644 patches/perfetto/.patches create mode 100644 patches/perfetto/revert_fix_chrome_roll_update_protoc_host_toolchain_rules.patch create mode 100644 patches/perfetto/revert_make_trace_processor_a_host-only_target.patch create mode 100644 patches/v8/revert_cleanup_switch_offset_of_to_offsetof_where_possible.patch diff --git a/DEPS b/DEPS index d1d81ae2d7..463ca6c77c 100644 --- a/DEPS +++ b/DEPS @@ -5,12 +5,13 @@ gclient_gn_args = [ 'checkout_android_native_support', 'checkout_libaom', 'checkout_nacl', - 'checkout_oculus_sdk' + 'checkout_oculus_sdk', + 'checkout_openxr' ] vars = { 'chromium_version': - '62327c655093c821aa0fcfc6db53f5fd943e08c7', + 'af5e1805f244bb71328690460ddd3d48ef3b1eca', 'node_version': 'v12.9.1', 'nan_version': @@ -60,6 +61,8 @@ vars = { True, 'checkout_oculus_sdk': False, + 'checkout_openxr': + False, 'build_with_chromium': True, 'checkout_android': diff --git a/build/args/all.gn b/build/args/all.gn index fea60e94f8..e9dffb46cd 100644 --- a/build/args/all.gn +++ b/build/args/all.gn @@ -24,3 +24,6 @@ is_cfi = false # TODO: Remove this and update CI to contain 10.14 SDK once # crbug.com/986701 is fixed. mac_sdk_min = "10.13" + +# TODO: disabled due to crashes. re-enable. +enable_osr = false diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index ac1ca1b866..940c983087 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -135,10 +135,6 @@ static_library("chrome") { sources += [ "//chrome/browser/speech/tts_controller_delegate_impl.cc", "//chrome/browser/speech/tts_controller_delegate_impl.h", - "//chrome/browser/speech/tts_message_filter.cc", - "//chrome/browser/speech/tts_message_filter.h", - "//chrome/renderer/tts_dispatcher.cc", - "//chrome/renderer/tts_dispatcher.h", ] } @@ -202,8 +198,6 @@ static_library("chrome") { "//chrome/browser/ui/views/overlay/back_to_tab_image_button.h", "//chrome/browser/ui/views/overlay/close_image_button.cc", "//chrome/browser/ui/views/overlay/close_image_button.h", - "//chrome/browser/ui/views/overlay/mute_image_button.cc", - "//chrome/browser/ui/views/overlay/mute_image_button.h", "//chrome/browser/ui/views/overlay/overlay_window_views.cc", "//chrome/browser/ui/views/overlay/overlay_window_views.h", "//chrome/browser/ui/views/overlay/playback_image_button.cc", diff --git a/chromium_src/chrome/browser/certificate_manager_model.cc b/chromium_src/chrome/browser/certificate_manager_model.cc index cecb1bb3ab..ff3a45f5ca 100644 --- a/chromium_src/chrome/browser/certificate_manager_model.cc +++ b/chromium_src/chrome/browser/certificate_manager_model.cc @@ -73,7 +73,7 @@ net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext( void CertificateManagerModel::Create(content::BrowserContext* browser_context, const CreationCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {BrowserThread::IO}, base::BindOnce(&CertificateManagerModel::GetCertDBOnIOThread, browser_context->GetResourceContext(), callback)); @@ -146,7 +146,7 @@ void CertificateManagerModel::DidGetCertDBOnIOThread( DCHECK_CURRENTLY_ON(BrowserThread::IO); bool is_user_db_available = !!cert_db->GetPublicSlot(); - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {BrowserThread::UI}, base::BindOnce(&CertificateManagerModel::DidGetCertDBOnUIThread, cert_db, is_user_db_available, callback)); diff --git a/chromium_src/chrome/browser/process_singleton_posix.cc b/chromium_src/chrome/browser/process_singleton_posix.cc index 76949d4585..ed93d3c248 100644 --- a/chromium_src/chrome/browser/process_singleton_posix.cc +++ b/chromium_src/chrome/browser/process_singleton_posix.cc @@ -705,7 +705,7 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK( if (shutdown(fd_, SHUT_WR) < 0) PLOG(ERROR) << "shutdown() failed"; - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {BrowserThread::IO}, base::BindOnce(&ProcessSingleton::LinuxWatcher::RemoveSocketReader, parent_, this)); @@ -885,10 +885,9 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() { void ProcessSingleton::StartListeningOnSocket() { watcher_ = new LinuxWatcher(this); - base::PostTaskWithTraits( - FROM_HERE, {BrowserThread::IO}, - base::BindOnce(&ProcessSingleton::LinuxWatcher::StartListening, watcher_, - sock_)); + base::PostTask(FROM_HERE, {BrowserThread::IO}, + base::BindOnce(&ProcessSingleton::LinuxWatcher::StartListening, + watcher_, sock_)); } void ProcessSingleton::OnBrowserReady() { diff --git a/components/pepper_flash/BUILD.gn b/components/pepper_flash/BUILD.gn index ebf8e6b9b1..cf75c5b415 100644 --- a/components/pepper_flash/BUILD.gn +++ b/components/pepper_flash/BUILD.gn @@ -54,6 +54,7 @@ component("pepper_flash") { "//chrome/browser/renderer_host/pepper/monitor_finder_mac.h", "//chrome/browser/renderer_host/pepper/monitor_finder_mac.mm", ] + libs = [ "CoreGraphics.framework" ] } if (is_linux) { deps += [ "//components/services/font/public/cpp" ] diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 5ad65be39d..8b9702a031 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -36,7 +36,6 @@ mas-cgdisplayusesforcetogray.patch mas-audiodeviceduck.patch mas-lssetapplicationlaunchservicesserverconnectionstatus.patch ignore_rc_check.patch -enable_widevine.patch chrome_key_systems.patch allow_nested_error_trackers.patch blink_initialization_order.patch @@ -62,7 +61,6 @@ unsandboxed_ppapi_processes_skip_zygote.patch patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch build_add_electron_tracing_category.patch disable_custom_libcxx_on_windows.patch -feat_offscreen_rendering_with_viz_compositor.patch worker_context_will_destroy.patch fix_breakpad_symbol_generation_on_linux_arm.patch frame_host_manager.patch @@ -78,3 +76,5 @@ disable_compositor_recycling.patch allow_new_privileges_in_unsandboxed_child_processes.patch expose_setuseragent_on_networkcontext.patch feat_add_set_theme_source_to_allow_apps_to.patch +revert_cleanup_remove_menu_subtitles_sublabels.patch +ui_views_fix_jumbo_build.patch diff --git a/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch b/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch index 9bc79e9eac..e043bfc175 100644 --- a/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch +++ b/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch @@ -10,7 +10,7 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set. This should be upstreamed. diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc -index 46d92835eadd6429ea0c6a53c5a39ff04f1c2634..1b99a1e601f4226280cdf1382af555b4d61b92fa 100644 +index 4373f508964cb1e9fd51c952122ac2f41fb35ae9..065a7a57b77f1e3bf5e03fac900f1936d48ad4ff 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -236,6 +236,10 @@ int GpuMain(const MainFunctionParams& parameters) { diff --git a/patches/chromium/add_realloc.patch b/patches/chromium/add_realloc.patch index 5c17bd98a9..3704497445 100644 --- a/patches/chromium/add_realloc.patch +++ b/patches/chromium/add_realloc.patch @@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f GIN_EXPORT static ArrayBufferAllocator* SharedInstance(); diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc -index 7ca876bc7f2afa192167f0689690d73d5a420c60..d58085e0b14241d666f533cb23dd89159c27d8b2 100644 +index 3eeafca490b1fbbedc2c16f203a4ac28b23da675..fee684296357c2c3af7395bdd17ac8b8445f55c4 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc -@@ -642,6 +642,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { +@@ -647,6 +647,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { size, WTF::ArrayBufferContents::kDontInitialize); } @@ -70,7 +70,7 @@ index ac76d127b96b80c8260a7e2cda0b669cd98787ad..dcab64586700a8740262aede8dba2755 Partitions::ArrayBufferPartition()->Free(data); } diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h -index ee7c89a4950d6b3c97a810c41a62fee7e372018d..c2b60f20a72cca46d05af369f33d9c19395b34ef 100644 +index 3f44cd2fdf648057be8defcf041574b4c91e0363..55c0e7c66649ae9d9cbef6179daac7ad771b755c 100644 --- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h +++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h @@ -140,6 +140,7 @@ class WTF_EXPORT ArrayBufferContents { diff --git a/patches/chromium/blink_initialization_order.patch b/patches/chromium/blink_initialization_order.patch index f29eebd9af..3b5f16e457 100644 --- a/patches/chromium/blink_initialization_order.patch +++ b/patches/chromium/blink_initialization_order.patch @@ -10,7 +10,7 @@ to fix electron/electron#13787. The backport landed in Chromium 67 but the DidCreateScriptContext re-ordering needs to be upstreamed or kept indefinitely diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc -index c0ec993ca6d96c5f95eb7b918ca9c37d9defff43..2522add8f9b1e3ada14fcc5c09d161b0820f4418 100644 +index 8331c466ac9ae91d79c32f17b815f048c7e30a8b..e066abfc3341ff620191116d87ff0e135cdf43e7 100644 --- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc +++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc @@ -205,11 +205,10 @@ void LocalWindowProxy::Initialize() { @@ -24,5 +24,5 @@ index c0ec993ca6d96c5f95eb7b918ca9c37d9defff43..2522add8f9b1e3ada14fcc5c09d161b0 - InstallConditionalFeatures(); - // This needs to go after everything else since it accesses the window object. + // WARNING: May modify the global object! InitializeV8ExtrasBinding(script_state_); - diff --git a/patches/chromium/blink_local_frame.patch b/patches/chromium/blink_local_frame.patch index 5e80b5fc4c..8e3bc738be 100644 --- a/patches/chromium/blink_local_frame.patch +++ b/patches/chromium/blink_local_frame.patch @@ -14,10 +14,10 @@ when there is code doing that. This patch reverts the change to fix the crash in Electron. diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index 488d9238eec29fd90540881d895f86d8597300be..b9cbd011d8ab5f86128590b2b98a517a5ad04c4e 100644 +index 1dc588e0683232fd40fea4fd4b9d4869ccacfaac..66107801f2a4ceddca509fc3737c750d4a798fbf 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc -@@ -334,10 +334,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) { +@@ -338,10 +338,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) { } CHECK(!view_ || !view_->IsAttached()); @@ -28,7 +28,7 @@ index 488d9238eec29fd90540881d895f86d8597300be..b9cbd011d8ab5f86128590b2b98a517a if (!Client()) return; -@@ -355,6 +351,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) { +@@ -359,6 +355,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) { // Notify ScriptController that the frame is closing, since its cleanup ends // up calling back to LocalFrameClient via WindowProxy. GetScriptController().ClearForClose(); diff --git a/patches/chromium/blink_world_context.patch b/patches/chromium/blink_world_context.patch index dc3d82ddce..84c5208d4d 100644 --- a/patches/chromium/blink_world_context.patch +++ b/patches/chromium/blink_world_context.patch @@ -19,10 +19,10 @@ index a781a44399a31f048419311d2317229c912752c2..131c0dcb125b00215e3ad469c11c4b47 // that the script evaluated to with callback. Script execution can be // suspend. diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc -index 85481bb0178d707bb52a4766521cdd8f740b0497..e3d4e5284c13383db47153adb5f8e3d9fce64dbf 100644 +index 0fccae4bfe95944bd203240524f358d8ea97f654..107593a056ab68b4e4aa1cd172c35334c5e0b0ea 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc -@@ -874,6 +874,13 @@ v8::Local WebLocalFrameImpl::GlobalProxy() const { +@@ -877,6 +877,13 @@ v8::Local WebLocalFrameImpl::GlobalProxy() const { return MainWorldScriptContext()->Global(); } diff --git a/patches/chromium/build_add_electron_tracing_category.patch b/patches/chromium/build_add_electron_tracing_category.patch index 7abb6151e7..97b722b979 100644 --- a/patches/chromium/build_add_electron_tracing_category.patch +++ b/patches/chromium/build_add_electron_tracing_category.patch @@ -8,10 +8,10 @@ categories in use are known / declared. This patch is required for us to introduce a new Electron category for Electron-specific tracing. diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h -index b50d4123e44ddee34af0b07bfe5d067c4ccc5809..3e2c639a067fb76848783f35ec112a380da2353e 100644 +index 6717a2bd93b7bec89934bb3e70cdfb5461dcc29b..ca2bd030d1f46b1a7294883e30274cd0da2e7f49 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h -@@ -61,6 +61,7 @@ +@@ -62,6 +62,7 @@ X("dwrite") \ X("DXVA Decoding") \ X("EarlyJava") \ diff --git a/patches/chromium/build_gn.patch b/patches/chromium/build_gn.patch index 13fc2b5049..5e28c038dd 100644 --- a/patches/chromium/build_gn.patch +++ b/patches/chromium/build_gn.patch @@ -5,7 +5,7 @@ Subject: build_gn.patch diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index 59ab7810e71916e8f0f2d69f06e3c2c3ebc99030..b144e800c94956429ca85fc0aefe6539a6246e4b 100644 +index f89e7e831b79f82bd11a5dd8cee6ab49d8de724e..f8a611bf0676ce323cdbb5d639333df9875dd0ca 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -123,6 +123,9 @@ if (current_os == "") { @@ -18,8 +18,8 @@ index 59ab7810e71916e8f0f2d69f06e3c2c3ebc99030..b144e800c94956429ca85fc0aefe6539 # Set to enable the official build level of optimization. This has nothing # to do with branding, but enables an additional level of optimization above # release (!is_debug). This might be better expressed as a tri-state -@@ -437,6 +440,7 @@ default_compiler_configs = [ - "//build/config/compiler:thin_archive", +@@ -438,6 +441,7 @@ default_compiler_configs = [ + "//build/config/compiler:default_init_stack_vars", "//build/config/coverage:default_coverage", "//build/config/sanitizers:default_sanitizer_flags", + "//electron/build/config:mas_build", diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index 62c6c21382..824e6d8457 100644 --- a/patches/chromium/can_create_window.patch +++ b/patches/chromium/can_create_window.patch @@ -5,10 +5,10 @@ Subject: can_create_window.patch diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc -index c6381fe498311421d2568b6d91b33539eb72cb0b..90b2457b49cb9c68a0dd269e8e8f64a44cae80cf 100644 +index bfcb977fbf2400e4ae8c7ea0b69d2b733ed410dc..be064ded7bfa3f96b5230e5bf00f68a0a8f618c2 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc -@@ -3885,6 +3885,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -3985,6 +3985,7 @@ void RenderFrameHostImpl::CreateNewWindow( last_committed_origin_, params->window_container_type, params->target_url, params->referrer.To(), params->frame_name, params->disposition, *params->features, @@ -17,10 +17,10 @@ index c6381fe498311421d2568b6d91b33539eb72cb0b..90b2457b49cb9c68a0dd269e8e8f64a4 &no_javascript_access); diff --git a/content/common/frame.mojom b/content/common/frame.mojom -index e227f780d720a80a13699f475757142571094cd1..6984f69e6f9a0d3058b0054df8a3aa9d46f14dbd 100644 +index 94b48f4a88df48f51adff20bc7954b0989e5ae05..a8eb7ba81afd2c8fb87544fb70a8ef862811a014 100644 --- a/content/common/frame.mojom +++ b/content/common/frame.mojom -@@ -299,6 +299,10 @@ struct CreateNewWindowParams { +@@ -307,6 +307,10 @@ struct CreateNewWindowParams { // The window features to use for the new window. blink.mojom.WindowFeatures features; @@ -32,10 +32,10 @@ index e227f780d720a80a13699f475757142571094cd1..6984f69e6f9a0d3058b0054df8a3aa9d // Operation result when the renderer asks the browser to create a new window. diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc -index 1c904cd011b7a5ca9592a994cf4ba0be025eef55..15081967b0a29316ab82746ca6fe7d188a9efc58 100644 +index 6d2b19d1b65496425e0850d8c224b4bf9eefa567..df6f9848ba8ae1e8e7c6e5415b3a4c2efaf6f055 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -484,6 +484,8 @@ bool ContentBrowserClient::CanCreateWindow( +@@ -493,6 +493,8 @@ bool ContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -45,10 +45,10 @@ index 1c904cd011b7a5ca9592a994cf4ba0be025eef55..15081967b0a29316ab82746ca6fe7d18 bool opener_suppressed, bool* no_javascript_access) { diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index 07dc81e27ae92e4e7a872134dcdc6a3ba2e08ec5..678b25401338a624dc37a11c45331d65082934e9 100644 +index a9131e72beefd3fd706640d5eeb82646a7ffe65d..7578110f13b23e9585a181bba3e73a3996f60faf 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -178,6 +178,7 @@ class RenderFrameHost; +@@ -179,6 +179,7 @@ class RenderFrameHost; class RenderProcessHost; class RenderViewHost; class ResourceContext; @@ -56,7 +56,7 @@ index 07dc81e27ae92e4e7a872134dcdc6a3ba2e08ec5..678b25401338a624dc37a11c45331d65 class SerialDelegate; class SiteInstance; class SpeechRecognitionManagerDelegate; -@@ -767,6 +768,8 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -779,6 +780,8 @@ class CONTENT_EXPORT ContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -66,10 +66,10 @@ index 07dc81e27ae92e4e7a872134dcdc6a3ba2e08ec5..678b25401338a624dc37a11c45331d65 bool opener_suppressed, bool* no_javascript_access); diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc -index a8a2d29739aabb0bd80cb77e28c46de57afe2b10..e3fa35b439e0f945e9e6a95587561fedd1ef4a2c 100644 +index f14d1f7fe20e81b9e488f787db00cd114cce16a7..94bfcf7ae25f6f5c2d1fdf93b96350bd229045e3 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc -@@ -75,6 +75,7 @@ +@@ -73,6 +73,7 @@ #include "content/renderer/ime_event_guard.h" #include "content/renderer/internal_document_state_data.h" #include "content/renderer/loader/request_extra_data.h" @@ -77,7 +77,7 @@ index a8a2d29739aabb0bd80cb77e28c46de57afe2b10..e3fa35b439e0f945e9e6a95587561fed #include "content/renderer/media/audio/audio_device_factory.h" #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" #include "content/renderer/media/webrtc/rtc_peer_connection_handler.h" -@@ -1346,6 +1347,8 @@ WebView* RenderViewImpl::CreateView( +@@ -1325,6 +1326,8 @@ WebView* RenderViewImpl::CreateView( } params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features); @@ -87,10 +87,10 @@ index a8a2d29739aabb0bd80cb77e28c46de57afe2b10..e3fa35b439e0f945e9e6a95587561fed // moved on send. bool is_background_tab = diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc -index 1a159e8d2877e5b1c6778b68aec5b36fb88214fd..f9111b3e20fb7607faa4bb605be1ff4c385e40d6 100644 +index 5faaea374484d51b1af261ff93fb96aec2eaa4e1..786d3a904a765b5cb53859c35a045b9e04b6250b 100644 --- a/content/shell/browser/web_test/web_test_content_browser_client.cc +++ b/content/shell/browser/web_test/web_test_content_browser_client.cc -@@ -313,6 +313,8 @@ bool WebTestContentBrowserClient::CanCreateWindow( +@@ -312,6 +312,8 @@ bool WebTestContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -100,10 +100,10 @@ index 1a159e8d2877e5b1c6778b68aec5b36fb88214fd..f9111b3e20fb7607faa4bb605be1ff4c bool opener_suppressed, bool* no_javascript_access) { diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h -index 1a714946de9f0dceaec008e93928d2c414ef01da..34423135e85b3ed7a54c9f22f6674f9c4026a67c 100644 +index 435f204a364e54b59c0bd651b760bf350ea94d11..1e6bee1fa08fa2d2a396678838d475e0e7e4ce0c 100644 --- a/content/shell/browser/web_test/web_test_content_browser_client.h +++ b/content/shell/browser/web_test/web_test_content_browser_client.h -@@ -67,6 +67,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient { +@@ -68,6 +68,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, diff --git a/patches/chromium/content_browser_main_loop.patch b/patches/chromium/content_browser_main_loop.patch index a93376a672..6b8a01c872 100644 --- a/patches/chromium/content_browser_main_loop.patch +++ b/patches/chromium/content_browser_main_loop.patch @@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously in atom::CommonWebContentsDelegate::ResetManageWebContents. diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc -index 61324582c2dca5e1e5a75c0793034307b648cc98..c73c1e26c2f01713952840fadbd7e8975bcb9843 100644 +index 28521684fd37dca5ea4251c166be33470b5ae0d8..cd5f3ef6b679899cd28068e39715d5c4847595cc 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc -@@ -1496,7 +1496,7 @@ void BrowserMainLoop::MainMessageLoopRun() { +@@ -1505,7 +1505,7 @@ void BrowserMainLoop::MainMessageLoopRun() { NOTREACHED(); #else base::RunLoop run_loop; diff --git a/patches/chromium/dcheck.patch b/patches/chromium/dcheck.patch index 4fabb0619c..7e262d7ad7 100644 --- a/patches/chromium/dcheck.patch +++ b/patches/chromium/dcheck.patch @@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the failing checks and allow the rest of the target to have them enabled. diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc -index 4bc8bd4c68015dd684702a6afbce74b36160e5a1..55dc200a73ef09b17c0e52d622f86956ba6a7bb7 100644 +index c8c28a5c1677b353e698b7fea91653fe08ebb77b..b5730d792e58ad090bb21a922fe828a53535bc4a 100644 --- a/content/browser/frame_host/navigation_controller_impl.cc +++ b/content/browser/frame_host/navigation_controller_impl.cc -@@ -1210,8 +1210,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation( +@@ -1212,8 +1212,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation( return NAVIGATION_TYPE_NEW_SUBFRAME; } @@ -33,7 +33,7 @@ index 4bc8bd4c68015dd684702a6afbce74b36160e5a1..55dc200a73ef09b17c0e52d622f86956 if (rfh->GetParent()) { // All manual subframes would be did_create_new_entry and handled above, so -@@ -1463,7 +1465,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage( +@@ -1465,7 +1467,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage( new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon(); } @@ -46,10 +46,10 @@ index 4bc8bd4c68015dd684702a6afbce74b36160e5a1..55dc200a73ef09b17c0e52d622f86956 // navigation. Now we know that the renderer has updated its state accordingly // and it is safe to also clear the browser side history. diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc -index 87a82009c929ff73d3d9fe5b51907b9b4147f78f..32d2316d7553b672a28e84f9433c85d1be213623 100644 +index 34c13c28117fe5fced5ca3190c5f948168cd010f..554ddabee8952e578a61a9b9c3f358b2475abd69 100644 --- a/ui/base/clipboard/clipboard_win.cc +++ b/ui/base/clipboard/clipboard_win.cc -@@ -729,9 +729,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap, +@@ -730,9 +730,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap, } void ClipboardWin::WriteToClipboard(unsigned int format, HANDLE handle) { diff --git a/patches/chromium/disable-redraw-lock.patch b/patches/chromium/disable-redraw-lock.patch index 47ad54912c..53c958a267 100644 --- a/patches/chromium/disable-redraw-lock.patch +++ b/patches/chromium/disable-redraw-lock.patch @@ -15,10 +15,10 @@ the redraw locking mechanism, which fixes these issues. The electron issue can be found at https://github.com/electron/electron/issues/1821 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 578b8414531f10ed1fe9d1590336a43ba8dd299f..82e1491988dc31573ae8b15bf6df16fabda1616e 100644 +index 0fa5dabec0ebb1dfe248eb5d71f45cc391883854..07e7c1480abfa158856a274b6b1668653121c9b4 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -331,6 +331,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500; +@@ -332,6 +332,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500; } // namespace @@ -29,7 +29,7 @@ index 578b8414531f10ed1fe9d1590336a43ba8dd299f..82e1491988dc31573ae8b15bf6df16fa // A scoping class that prevents a window from being able to redraw in response // to invalidations that may occur within it for the lifetime of the object. // -@@ -382,6 +386,7 @@ class HWNDMessageHandler::ScopedRedrawLock { +@@ -383,6 +387,7 @@ class HWNDMessageHandler::ScopedRedrawLock { cancel_unlock_(false), should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() && ::IsWindow(hwnd_) && @@ -49,7 +49,7 @@ index 578b8414531f10ed1fe9d1590336a43ba8dd299f..82e1491988dc31573ae8b15bf6df16fa // HWNDMessageHandler, gfx::WindowImpl overrides: diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h -index 57bf68676b697fa2d17c66f08b98d57809d4d20c..86ee2d878f2f310db2f50be05035f087ddb375ba 100644 +index 7223a9a61b9ad16ade315ed799d386a52688e16b..9817b49ba264775f88d3a22a825afc8833f2e28c 100644 --- a/ui/views/win/hwnd_message_handler.h +++ b/ui/views/win/hwnd_message_handler.h @@ -194,6 +194,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl, @@ -62,7 +62,7 @@ index 57bf68676b697fa2d17c66f08b98d57809d4d20c..86ee2d878f2f310db2f50be05035f087 HICON GetDefaultWindowIcon() const override; HICON GetSmallWindowIcon() const override; diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h -index 45c4e5b29d05ea0323596fa2c5034c2e30a68f70..e25aac69b09954fbc267309beba98ec0877fa2ac 100644 +index ddc640e7a5d278e08c056f1989ac258c9ae8bfae..a5d050dadad3c565b0151ee945e5d17f42255aa3 100644 --- a/ui/views/win/hwnd_message_handler_delegate.h +++ b/ui/views/win/hwnd_message_handler_delegate.h @@ -46,6 +46,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate { diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index 9ab0bfa392..67332ec6c4 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -20,7 +20,7 @@ to deal with color spaces. That is being tracked at https://crbug.com/634542 and https://crbug.com/711107. diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h -index d62c52b53268b4ffab702a0dac3652edc472ccb9..f1ed520f123802469d94c98c418b9f5c5d2032e0 100644 +index 18d99c39b5ec1ba5f8fdd808139f0b5a2de53f60..f03a6f00b9dcc044ef151466f6e16c983f73ce69 100644 --- a/cc/trees/layer_tree_settings.h +++ b/cc/trees/layer_tree_settings.h @@ -95,6 +95,8 @@ class CC_EXPORT LayerTreeSettings { @@ -66,7 +66,7 @@ index f17aa1fa451f1b99d7f083e07edd49b11f7639e4..09f7c5d6a92d89c199b296771a8ff60c !command_line->HasSwitch(switches::kUIDisablePartialSwap); #if defined(OS_MACOSX) diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc -index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c1166404c4209b0 100644 +index 8c67161c4a4b970fb9393a9a73a239b5aecb95cf..99ea5a9832aca67030e92e4761209872190388eb 100644 --- a/components/viz/service/display/gl_renderer.cc +++ b/components/viz/service/display/gl_renderer.cc @@ -81,6 +81,9 @@ @@ -91,7 +91,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 // Use the full quad_rect for debug quads to not move the edges based on // partial swaps. -@@ -1448,7 +1452,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params, +@@ -1455,7 +1459,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params, params->use_color_matrix, tint_gl_composited_content_, params->apply_shader_based_rounded_corner && ShouldApplyRoundedCorner(params->quad)), @@ -101,7 +101,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 } void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) { -@@ -1919,8 +1924,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad, +@@ -1926,8 +1931,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad, SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA, tint_gl_composited_content_, ShouldApplyRoundedCorner(quad)), @@ -112,7 +112,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 SetShaderColor(color, opacity); if (current_program_->rounded_corner_rect_location() != -1) { SetShaderRoundedCorner( -@@ -2075,8 +2080,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad, +@@ -2082,8 +2087,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad, : NON_PREMULTIPLIED_ALPHA, false, false, tint_gl_composited_content_, ShouldApplyRoundedCorner(quad)), @@ -123,7 +123,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 if (current_program_->tint_color_matrix_location() != -1) { auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix(); -@@ -2172,8 +2177,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad, +@@ -2179,8 +2184,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad, !quad->ShouldDrawWithBlending(), has_tex_clamp_rect, tint_gl_composited_content_, ShouldApplyRoundedCorner(quad)), @@ -134,7 +134,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 if (current_program_->tint_color_matrix_location() != -1) { auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix(); -@@ -2276,7 +2281,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad, +@@ -2283,7 +2288,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad, DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB()); gfx::ColorSpace dst_color_space = @@ -143,7 +143,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 // Force sRGB output on Windows for overlay candidate video quads to match // DirectComposition behavior in case these switch between overlays and // compositing. See https://crbug.com/811118 for details. -@@ -2432,8 +2437,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad, +@@ -2439,8 +2444,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad, SetUseProgram(ProgramKey::VideoStream(tex_coord_precision, ShouldApplyRoundedCorner(quad)), @@ -154,7 +154,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id()); -@@ -2490,8 +2495,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) { +@@ -2497,8 +2502,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) { draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR); // Bind the program to the GL state. @@ -165,7 +165,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 if (current_program_->rounded_corner_rect_location() != -1) { SetShaderRoundedCorner( -@@ -3184,7 +3189,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) { +@@ -3195,7 +3200,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) { void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color, const gfx::ColorSpace& src_color_space, const gfx::ColorSpace& dst_color_space) { @@ -176,7 +176,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 gfx::ColorSpace adjusted_color_space = src_color_space; float sdr_white_level = current_frame()->sdr_white_level; -@@ -3550,7 +3557,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource( +@@ -3574,7 +3581,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource( *overlay_texture = FindOrCreateOverlayTexture( params.quad->render_pass_id, iosurface_width, iosurface_height, @@ -185,7 +185,7 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 *new_bounds = gfx::RectF(updated_dst_rect.origin(), gfx::SizeF((*overlay_texture)->texture.size())); -@@ -3768,8 +3775,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) { +@@ -3792,8 +3799,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) { PrepareGeometry(SHARED_BINDING); @@ -196,17 +196,17 @@ index 58717216158d62dd2826007fa3ddb4f39a5eb4d1..b8c0fcbd2aadd7c75c90baf39c116640 gfx::Transform render_matrix; render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(), -@@ -3929,3 +3936,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize( +@@ -3953,3 +3960,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize( } } // namespace viz + +#undef PATCH_CS diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc -index 157fbbc34a2217f58f3e5931e1d56d6db3b876cd..68bd4a84e6fe68a4741fcedc50fb47230b11ba37 100644 +index d38084e36ab82c3c91f7ab5504557707eedbb2fc..ede28387d3fa868c61e291202ab9e8f95f7aa870 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc -@@ -192,6 +192,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( +@@ -194,6 +194,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( // Command-line switches to propagate to the GPU process. static const char* const kSwitchNames[] = { @@ -215,10 +215,10 @@ index 157fbbc34a2217f58f3e5931e1d56d6db3b876cd..68bd4a84e6fe68a4741fcedc50fb4723 service_manager::switches::kGpuSandboxAllowSysVShm, service_manager::switches::kGpuSandboxFailuresFatal, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 6302948343ee810a9d35a70be0c91a1ffbfb7647..6607c71fa295cda32c5ac00aafe642a103703a0e 100644 +index 2aaa6b123b917b9b819aa2a2d3fb27179a57a8ec..cfbb71f8ab6a192e49093cc214589ccb40f646b1 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -215,6 +215,7 @@ +@@ -219,6 +219,7 @@ #include "ui/base/ui_base_switches.h" #include "ui/base/ui_base_switches_util.h" #include "ui/display/display_switches.h" @@ -226,7 +226,7 @@ index 6302948343ee810a9d35a70be0c91a1ffbfb7647..6607c71fa295cda32c5ac00aafe642a1 #include "ui/gl/gl_switches.h" #include "ui/native_theme/native_theme_features.h" #include "url/url_constants.h" -@@ -2917,6 +2918,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -2910,6 +2911,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { @@ -235,10 +235,10 @@ index 6302948343ee810a9d35a70be0c91a1ffbfb7647..6607c71fa295cda32c5ac00aafe642a1 network::switches::kExplicitlyAllowedPorts, service_manager::switches::kDisableInProcessStackTraces, diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc -index 2f53bc7d22c175a41e71fcbf46b8ce2636e529e3..0eb3d2922453014e90a8f91e2f72aee3145f8cc6 100644 +index 928f3d91c3750482e0da1fa885c1e03fdd3285b6..42363587fdd1ebadf7042d2e1dde7442d86a5e4a 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc -@@ -2836,6 +2836,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings( +@@ -2863,6 +2863,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings( settings.main_frame_before_activation_enabled = cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation); @@ -249,7 +249,7 @@ index 2f53bc7d22c175a41e71fcbf46b8ce2636e529e3..0eb3d2922453014e90a8f91e2f72aee3 // is what the renderer uses if its not threaded. settings.enable_checker_imaging = diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc -index 3d936357343e9829768891a45b6459d6a1bbb4f1..55062c91722b900bbbc775c0c88cfc6e57ddc04b 100644 +index 41f7fcbdd63af315f4b4e768bfef3b5004807a0b..398a4fdea3cc0ab4f5132deeb9365189f9c928c3 100644 --- a/ui/gfx/mac/io_surface.cc +++ b/ui/gfx/mac/io_surface.cc @@ -16,6 +16,7 @@ @@ -260,7 +260,7 @@ index 3d936357343e9829768891a45b6459d6a1bbb4f1..55062c91722b900bbbc775c0c88cfc6e namespace gfx { -@@ -191,6 +192,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, +@@ -186,6 +187,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, // Ensure that all IOSurfaces start as sRGB. CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace(); @@ -272,7 +272,7 @@ index 3d936357343e9829768891a45b6459d6a1bbb4f1..55062c91722b900bbbc775c0c88cfc6e base::ScopedCFTypeRef color_space_icc( CGColorSpaceCopyICCProfile(color_space)); IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc); -@@ -202,6 +208,14 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, +@@ -197,6 +203,14 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, void IOSurfaceSetColorSpace(IOSurfaceRef io_surface, const ColorSpace& color_space) { diff --git a/patches/chromium/disable_hidden.patch b/patches/chromium/disable_hidden.patch index f31e2f9176..a8fcf1323b 100644 --- a/patches/chromium/disable_hidden.patch +++ b/patches/chromium/disable_hidden.patch @@ -5,7 +5,7 @@ Subject: disable_hidden.patch diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 3925586d55cb79a26b231781a821c510dfe17bd4..1ccff96eccde8dbff2b972d53c05486fb160c5db 100644 +index 3f9d2f2a42106e3f4ab7539256021a0446e17a2a..ebe6315a98f9654d2cbc54c09f79a17f18e267a7 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -675,6 +675,9 @@ void RenderWidgetHostImpl::WasHidden() { @@ -19,10 +19,10 @@ index 3925586d55cb79a26b231781a821c510dfe17bd4..1ccff96eccde8dbff2b972d53c05486f TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasHidden"); diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h -index ef6276238004ff6e12de90d03be1f720c1ac266c..b8d981a45edb22a60cc439e881a4bc81854b35cd 100644 +index 58df8dfdd530a760fa8e9ecc9ef3901f444b255f..9ed9ebbbd01ff9d23b6cf0bd5cff1b19b9856077 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h -@@ -183,6 +183,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -185,6 +185,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl // RenderWidgetHostImpl. static RenderWidgetHostImpl* From(RenderWidgetHost* rwh); diff --git a/patches/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch b/patches/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch index ad45039e38..5ee92d0c4b 100644 --- a/patches/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch +++ b/patches/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch @@ -6,10 +6,10 @@ Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch See https://github.com/electron/electron/issues/10754 diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc -index 88883a942c20494c9ee406da09e223ddce6307c4..27468bd09b573f6a7ca8edf86cbc5f272689376e 100644 +index f53c4cbadd759c4a0ba411c6a35c71ff269836a7..d643b0607ff9133b97f912c7f0a4e66ac2c01855 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc -@@ -4117,7 +4117,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client, +@@ -4181,7 +4181,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client, "frame that never had a user gesture since its load. " "https://www.chromestatus.com/feature/5082396709879808"; Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message); diff --git a/patches/chromium/dom_storage_limits.patch b/patches/chromium/dom_storage_limits.patch index 6c806f35a5..5334f8e3cf 100644 --- a/patches/chromium/dom_storage_limits.patch +++ b/patches/chromium/dom_storage_limits.patch @@ -31,10 +31,10 @@ With that in mind, an acceptable alternative to disabling the limit at compile-t for a given `BrowserWindow` via a `webPreferences` option, similar to [`nodeIntegration`](https://electronjs.org/docs/tutorial/security#2-disable-nodejs-integration-for-remote-content). -diff --git a/content/common/dom_storage/dom_storage_types.h b/content/common/dom_storage/dom_storage_types.h -index e87afe5b8ee07f7038a7cc9c40832b6cd27884da..61c9a0dfff60f79c7b36ff5c7d741c06dca03ada 100644 ---- a/content/common/dom_storage/dom_storage_types.h -+++ b/content/common/dom_storage/dom_storage_types.h +diff --git a/content/browser/dom_storage/dom_storage_types.h b/content/browser/dom_storage/dom_storage_types.h +index 6c0b831ebaaa2c1749bbc7436ce1025656588310..b67767751cadc6072c133297c7a6cdcc6bfd0c98 100644 +--- a/content/browser/dom_storage/dom_storage_types.h ++++ b/content/browser/dom_storage/dom_storage_types.h @@ -21,6 +21,7 @@ typedef std::map DOMStorageValuesMap; // The quota for each storage area. diff --git a/patches/chromium/dump_syms.patch b/patches/chromium/dump_syms.patch index 1d51090d1e..a2abbc3dc9 100644 --- a/patches/chromium/dump_syms.patch +++ b/patches/chromium/dump_syms.patch @@ -8,10 +8,10 @@ this but it is not a blocker for releasing Electron. This patch removes the hard fail on dylib resolve failure from dump_syms diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py -index cdd374c33a3edc12db9c9496a4ca765d2ba0ab5d..db04d39f8d263dc2b3b67b7f84470f557b519cfa 100755 +index 41895d64685930bf26fff821c12c6704a070e8bc..130ee13f8d5ecfcb5a303f7cc05af261693acf78 100755 --- a/components/crash/content/tools/generate_breakpad_symbols.py +++ b/components/crash/content/tools/generate_breakpad_symbols.py -@@ -175,7 +175,7 @@ def GetSharedLibraryDependenciesMac(binary, exe_path): +@@ -188,7 +188,7 @@ def GetSharedLibraryDependenciesMac(binary, exe_path): 'ERROR: failed to resolve %s, exe_path %s, loader_path %s, ' 'rpaths %s' % (m.group(1), exe_path, loader_path, ', '.join(rpaths))) diff --git a/patches/chromium/enable_widevine.patch b/patches/chromium/enable_widevine.patch deleted file mode 100644 index 7913cb9789..0000000000 --- a/patches/chromium/enable_widevine.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aleksei Kuzmin -Date: Thu, 20 Sep 2018 17:50:03 -0700 -Subject: enable_widevine.patch - -Turns `enable_widevine` flag on by default on Mac and Windows. -Electron needs that flag to be enabled on those paltforms, -but there's no way to conditionally set it during a `gn gen` call. - -diff --git a/third_party/widevine/cdm/widevine.gni b/third_party/widevine/cdm/widevine.gni -index 1fe47e92ffb1442159ead7b696884bc8cc4bda83..72b39b83789cd1f67e10c743a3e729420c9b72ed 100644 ---- a/third_party/widevine/cdm/widevine.gni -+++ b/third_party/widevine/cdm/widevine.gni -@@ -10,7 +10,7 @@ declare_args() { - # on Android. - # Can be optionally enabled in Chromium on non-Android platforms. Please see - # //src/third_party/widevine/LICENSE file for details. -- enable_widevine = is_chrome_branded || is_android -+ enable_widevine = is_chrome_branded || is_android || is_mac || is_win - } - - # Widevine CDM is available as a library CDM on the following platforms and diff --git a/patches/chromium/exclude-a-few-test-files-from-build.patch b/patches/chromium/exclude-a-few-test-files-from-build.patch index a7d6aeeee7..aa29f453cc 100644 --- a/patches/chromium/exclude-a-few-test-files-from-build.patch +++ b/patches/chromium/exclude-a-few-test-files-from-build.patch @@ -7,10 +7,10 @@ Compilation of those files fails with the Chromium 68. Remove the patch during the Chromium 69 upgrade. diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn -index 4575cc246a5306f3fc245a0d296b81a4c0f5ae32..af8723a635530df4f14c13461feb737dcd1e7a54 100644 +index 7378cf2fc726289d0bdfafef41f190042e95072b..530ee5729291b5a6285ab22a4efaac4dad2b9766 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn -@@ -1726,7 +1726,7 @@ jumbo_source_set("blink_platform_unittests_sources") { +@@ -1774,7 +1774,7 @@ jumbo_source_set("blink_platform_unittests_sources") { "graphics/paint/drawing_display_item_test.cc", "graphics/paint/drawing_recorder_test.cc", "graphics/paint/float_clip_rect_test.cc", diff --git a/patches/chromium/expose_setuseragent_on_networkcontext.patch b/patches/chromium/expose_setuseragent_on_networkcontext.patch index d220e96913..134a533697 100644 --- a/patches/chromium/expose_setuseragent_on_networkcontext.patch +++ b/patches/chromium/expose_setuseragent_on_networkcontext.patch @@ -33,10 +33,10 @@ index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a28970 DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings); }; diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index 20243f6c333478f14e5bff3789e780b996887512..34e4fd20f78ee0376053720742fc9af60dae37e3 100644 +index c36657fc18c705c7224e6c57c8c50b7f641060fa..9a748d3a0cb7c8c6fd730404690c7c12b0974262 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -1095,6 +1095,13 @@ void NetworkContext::SetNetworkConditions( +@@ -917,6 +917,13 @@ void NetworkContext::SetNetworkConditions( std::move(network_conditions)); } @@ -51,10 +51,10 @@ index 20243f6c333478f14e5bff3789e780b996887512..34e4fd20f78ee0376053720742fc9af6 // This may only be called on NetworkContexts created with the constructor // that calls MakeURLRequestContext(). diff --git a/services/network/network_context.h b/services/network/network_context.h -index f117ba5edfa7da25efd25e52ac5fff8b37ba3de3..5a805b4ee688ee7a113c833535db861b0e3b2ef9 100644 +index 581196b6d4a0054bc213e4eada1a97a8e0453c5f..96fe00e951771ac0017ee4e60a545a9975153282 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h -@@ -213,6 +213,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -219,6 +219,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext void CloseIdleConnections(CloseIdleConnectionsCallback callback) override; void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id, mojom::NetworkConditionsPtr conditions) override; @@ -63,10 +63,10 @@ index f117ba5edfa7da25efd25e52ac5fff8b37ba3de3..5a805b4ee688ee7a113c833535db861b void SetEnableReferrers(bool enable_referrers) override; #if defined(OS_CHROMEOS) diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 034b5720ffa497429b2cdfcc06cd2d421f2db99c..aa2c88443e744396e381377ec20b03fb0e66d2db 100644 +index 6b7571dbf1464284ce30953a27c1ac2099f1872f..955e945c5f0f12a739d0cccaef41a241ea5557f8 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -857,6 +857,9 @@ interface NetworkContext { +@@ -889,6 +889,9 @@ interface NetworkContext { SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id, NetworkConditions? conditions); @@ -77,10 +77,10 @@ index 034b5720ffa497429b2cdfcc06cd2d421f2db99c..aa2c88443e744396e381377ec20b03fb SetAcceptLanguage(string new_accept_language); diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h -index aa21b8e434c01a866e3fae04b8de54a3cdfb725e..63880702102a396576c5825f8c5c7731cde091cc 100644 +index 34a8050d5900534663c285028eb42720a5bc8621..e5e361cd197d5080761d07a18f8af6727b395015 100644 --- a/services/network/test/test_network_context.h +++ b/services/network/test/test_network_context.h -@@ -93,6 +93,7 @@ class TestNetworkContext : public mojom::NetworkContext { +@@ -95,6 +95,7 @@ class TestNetworkContext : public mojom::NetworkContext { void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {} void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id, mojom::NetworkConditionsPtr conditions) override {} diff --git a/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch index 6e485f4927..018f3b50b7 100644 --- a/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch +++ b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch @@ -13,7 +13,7 @@ uses internally for things like menus and devtools. We can remove this patch once it has in some shape been upstreamed. diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc -index 2370d15332c8c6c7dc7e3403b38891c885704d9f..171214379437f319d3feccc289a5d91e74b77f9e 100644 +index 929e339487b7d2b4407cff069944f7a2cc1266a4..4abf0933df57651f36dbb6a1652b2de534a82639 100644 --- a/ui/native_theme/native_theme.cc +++ b/ui/native_theme/native_theme.cc @@ -40,6 +40,8 @@ NativeTheme::NativeTheme() @@ -75,10 +75,10 @@ index a8fbfee3b13672902aac05fd5a65fa8ee81f9f7e..1be6369acf0b7c02a6f862636c2b2de1 } diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index 3003643bfb78cec2f5e84fc9e1471e1ef54aae41..06f2cbc84401958d49445f4ce6acb1b2fef0aa04 100644 +index 97e72bc38a7231ce295ad943e977c69586cc6e07..a60f7b618ddd29886aac70f16e07cbc871ce38af 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -611,6 +611,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -725,6 +725,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { // ...unless --force-dark-mode was specified in which case caveat emptor. if (UsesHighContrastColors() && !IsForcedDarkMode()) return false; diff --git a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch deleted file mode 100644 index efe0c24294..0000000000 --- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch +++ /dev/null @@ -1,636 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Heilig Benedek -Date: Wed, 20 Mar 2019 20:30:44 +0100 -Subject: feat_offscreen_rendering_with_viz_compositor.patch - - -diff --git a/components/viz/host/host_display_client.cc b/components/viz/host/host_display_client.cc -index f5e18df4e06e24d3bdd51308abde48e217444848..41017d9d53b1c0d563ea0901f5cae407c6cf1560 100644 ---- a/components/viz/host/host_display_client.cc -+++ b/components/viz/host/host_display_client.cc -@@ -18,6 +18,10 @@ - - namespace viz { - -+void HostDisplayClient::IsOffscreen(IsOffscreenCallback callback) { -+ std::move(callback).Run(false); -+} -+ - HostDisplayClient::HostDisplayClient(gfx::AcceleratedWidget widget) - : binding_(this) { - #if defined(OS_MACOSX) || defined(OS_WIN) -@@ -46,9 +50,9 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams( - } - #endif - --#if defined(OS_WIN) - void HostDisplayClient::CreateLayeredWindowUpdater( - mojom::LayeredWindowUpdaterRequest request) { -+#if defined(OS_WIN) - if (!NeedsToUseLayerWindow(widget_)) { - DLOG(ERROR) << "HWND shouldn't be using a layered window"; - return; -@@ -56,8 +60,12 @@ void HostDisplayClient::CreateLayeredWindowUpdater( - - layered_window_updater_ = - std::make_unique(widget_, std::move(request)); --} -+#else -+ CHECK(false) << "Chromium is calling CreateLayeredWindowUpdater for non-OSR " -+ "windows on POSIX platforms, something is wrong with " -+ "Electron's OSR implementation."; - #endif -+} - - #if defined(USE_X11) - void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) { -diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h -index b8177277ebca471fc147f2d5b53521cbadd8fa2d..72a807e138f80b4ab37cb1d368bc968e299d903f 100644 ---- a/components/viz/host/host_display_client.h -+++ b/components/viz/host/host_display_client.h -@@ -30,17 +30,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient { - mojom::DisplayClientPtr GetBoundPtr( - scoped_refptr task_runner); - -- private: -+ protected: - // mojom::DisplayClient implementation: - #if defined(OS_MACOSX) - void OnDisplayReceivedCALayerParams( - const gfx::CALayerParams& ca_layer_params) override; - #endif - --#if defined(OS_WIN) -+ void IsOffscreen(IsOffscreenCallback callback) override; -+ - void CreateLayeredWindowUpdater( - mojom::LayeredWindowUpdaterRequest request) override; --#endif - - #if defined(USE_X11) - void DidCompleteSwapWithNewSize(const gfx::Size& size) override; -diff --git a/components/viz/host/layered_window_updater_impl.cc b/components/viz/host/layered_window_updater_impl.cc -index 65c26e2f7ae813e50f6740f73a4d145467da4366..39c04c4d6b644a4ad7b13b4e932b085fad0b8293 100644 ---- a/components/viz/host/layered_window_updater_impl.cc -+++ b/components/viz/host/layered_window_updater_impl.cc -@@ -43,7 +43,9 @@ void LayeredWindowUpdaterImpl::OnAllocatedSharedMemory( - // |region|'s handle will close when it goes out of scope. - } - --void LayeredWindowUpdaterImpl::Draw(DrawCallback draw_callback) { -+void LayeredWindowUpdaterImpl::Draw( -+ const gfx::Rect& damage_rect, -+ DrawCallback draw_callback) { - TRACE_EVENT0("viz", "LayeredWindowUpdaterImpl::Draw"); - - if (!canvas_) { -diff --git a/components/viz/host/layered_window_updater_impl.h b/components/viz/host/layered_window_updater_impl.h -index ced30727ab67e557265c3a61f7c213763da973ce..f422786fe6cd9cab47494fe6028f3c3be8bc763e 100644 ---- a/components/viz/host/layered_window_updater_impl.h -+++ b/components/viz/host/layered_window_updater_impl.h -@@ -33,7 +33,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl - // mojom::LayeredWindowUpdater implementation. - void OnAllocatedSharedMemory(const gfx::Size& pixel_size, - base::UnsafeSharedMemoryRegion region) override; -- void Draw(DrawCallback draw_callback) override; -+ void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override; - - private: - const HWND hwnd_; -diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn -index ce7ceb3e82e95e49442d77a61d6bf765e8e86e4e..90db4660e0184daa773c9fbd1314cd64132ebd2e 100644 ---- a/components/viz/service/BUILD.gn -+++ b/components/viz/service/BUILD.gn -@@ -118,6 +118,8 @@ viz_component("service") { - "display_embedder/output_surface_provider_impl.h", - "display_embedder/server_shared_bitmap_manager.cc", - "display_embedder/server_shared_bitmap_manager.h", -+ "display_embedder/software_output_device_proxy.cc", -+ "display_embedder/software_output_device_proxy.h", - "display_embedder/software_output_surface.cc", - "display_embedder/software_output_surface.h", - "display_embedder/viz_process_context_provider.cc", -diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc -index e3c8e9dbca69f2665e8dbbd798d45c3b7199e04c..d9fa2d536e977ac966065a9058661f887e995320 100644 ---- a/components/viz/service/display_embedder/output_surface_provider_impl.cc -+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc -@@ -20,6 +20,7 @@ - #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" - #include "components/viz/service/display_embedder/skia_output_surface_dependency_impl.h" - #include "components/viz/service/display_embedder/skia_output_surface_impl.h" -+#include "components/viz/service/display_embedder/software_output_device_proxy.h" - #include "components/viz/service/display_embedder/software_output_surface.h" - #include "components/viz/service/display_embedder/viz_process_context_provider.h" - #include "components/viz/service/gl/gpu_service_impl.h" -@@ -33,6 +34,7 @@ - #include "gpu/ipc/scheduler_sequence.h" - #include "gpu/ipc/service/gpu_channel_manager_delegate.h" - #include "gpu/ipc/service/image_transport_surface.h" -+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h" - #include "ui/base/ui_base_switches.h" - #include "ui/gl/gl_context.h" - #include "ui/gl/init/gl_factory.h" -@@ -223,6 +225,19 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform( - if (headless_) - return std::make_unique(); - -+#if !defined(OS_MACOSX) -+ DCHECK(display_client); -+ bool offscreen = false; -+ if (display_client->IsOffscreen(&offscreen) && offscreen) { -+ mojom::LayeredWindowUpdaterPtr layered_window_updater; -+ display_client->CreateLayeredWindowUpdater( -+ mojo::MakeRequest(&layered_window_updater)); -+ -+ return std::make_unique( -+ std::move(layered_window_updater)); -+ } -+#endif -+ - #if defined(OS_WIN) - return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_, - display_client); -diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc -index b9357082293cc55650144ccbc8bada8fe6d1cac4..b4cb07e26d1504719f80e5835c1cb5f138b9f1ab 100644 ---- a/components/viz/service/display_embedder/software_output_device_mac.cc -+++ b/components/viz/service/display_embedder/software_output_device_mac.cc -@@ -102,6 +102,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage( - - SkCanvas* SoftwareOutputDeviceMac::BeginPaint( - const gfx::Rect& new_damage_rect) { -+ last_damage = new_damage_rect; -+ - // Record the previous paint buffer. - Buffer* previous_paint_buffer = - buffer_queue_.empty() ? nullptr : buffer_queue_.back().get(); -@@ -184,6 +186,7 @@ void SoftwareOutputDeviceMac::EndPaint() { - ca_layer_params.is_empty = false; - ca_layer_params.scale_factor = scale_factor_; - ca_layer_params.pixel_size = pixel_size_; -+ ca_layer_params.damage = last_damage; - ca_layer_params.io_surface_mach_port.reset( - IOSurfaceCreateMachPort(current_paint_buffer_->io_surface)); - client_->SoftwareDeviceUpdatedCALayerParams(ca_layer_params); -diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h -index f3867356e3d641416e00e6d115ae9ae2a0be90ab..b1d192d2b20ccb63fba07093101d745e5ffe86dd 100644 ---- a/components/viz/service/display_embedder/software_output_device_mac.h -+++ b/components/viz/service/display_embedder/software_output_device_mac.h -@@ -56,6 +56,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceMac : public SoftwareOutputDevice { - void UpdateAndCopyBufferDamage(Buffer* previous_paint_buffer, - const SkRegion& new_damage_rect); - -+ gfx::Rect last_damage; - gfx::Size pixel_size_; - float scale_factor_ = 1; - -diff --git a/components/viz/service/display_embedder/software_output_device_proxy.cc b/components/viz/service/display_embedder/software_output_device_proxy.cc -new file mode 100644 -index 0000000000000000000000000000000000000000..c17b03e00089bfd301c63910426bb16afb8cdae7 ---- /dev/null -+++ b/components/viz/service/display_embedder/software_output_device_proxy.cc -@@ -0,0 +1,156 @@ -+// Copyright 2014 The Chromium Authors. All rights reserved. -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#include "components/viz/service/display_embedder/software_output_device_proxy.h" -+ -+#include "base/memory/unsafe_shared_memory_region.h" -+#include "base/threading/thread_checker.h" -+#include "components/viz/common/resources/resource_sizes.h" -+#include "components/viz/service/display_embedder/output_device_backing.h" -+#include "mojo/public/cpp/system/platform_handle.h" -+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h" -+#include "skia/ext/platform_canvas.h" -+#include "third_party/skia/include/core/SkCanvas.h" -+#include "ui/gfx/skia_util.h" -+ -+#if defined(OS_WIN) -+#include "skia/ext/skia_utils_win.h" -+#include "ui/gfx/gdi_util.h" -+#include "ui/gfx/win/hwnd_util.h" -+#else -+#include "mojo/public/cpp/base/shared_memory_utils.h" -+#endif -+ -+namespace viz { -+ -+SoftwareOutputDeviceBase::~SoftwareOutputDeviceBase() { -+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); -+ DCHECK(!in_paint_); -+} -+ -+void SoftwareOutputDeviceBase::Resize(const gfx::Size& viewport_pixel_size, -+ float scale_factor) { -+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); -+ DCHECK(!in_paint_); -+ -+ if (viewport_pixel_size_ == viewport_pixel_size) -+ return; -+ -+ viewport_pixel_size_ = viewport_pixel_size; -+ ResizeDelegated(); -+} -+ -+SkCanvas* SoftwareOutputDeviceBase::BeginPaint( -+ const gfx::Rect& damage_rect) { -+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); -+ DCHECK(!in_paint_); -+ -+ damage_rect_ = damage_rect; -+ in_paint_ = true; -+ return BeginPaintDelegated(); -+} -+ -+void SoftwareOutputDeviceBase::EndPaint() { -+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); -+ DCHECK(in_paint_); -+ -+ in_paint_ = false; -+ -+ gfx::Rect intersected_damage_rect = damage_rect_; -+ intersected_damage_rect.Intersect(gfx::Rect(viewport_pixel_size_)); -+ if (intersected_damage_rect.IsEmpty()) -+ return; -+ -+ EndPaintDelegated(intersected_damage_rect); -+} -+ -+SoftwareOutputDeviceProxy::~SoftwareOutputDeviceProxy() = default; -+ -+SoftwareOutputDeviceProxy::SoftwareOutputDeviceProxy( -+ mojom::LayeredWindowUpdaterPtr layered_window_updater) -+ : layered_window_updater_(std::move(layered_window_updater)) { -+ DCHECK(layered_window_updater_.is_bound()); -+} -+ -+void SoftwareOutputDeviceProxy::OnSwapBuffers( -+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) { -+ DCHECK(swap_ack_callback_.is_null()); -+ -+ // We aren't waiting on DrawAck() and can immediately run the callback. -+ if (!waiting_on_draw_ack_) { -+ task_runner_->PostTask(FROM_HERE, -+ base::BindOnce(std::move(swap_ack_callback), viewport_pixel_size_)); -+ return; -+ } -+ -+ swap_ack_callback_ = std::move(swap_ack_callback); -+} -+ -+void SoftwareOutputDeviceProxy::ResizeDelegated() { -+ canvas_.reset(); -+ -+ size_t required_bytes; -+ if (!ResourceSizes::MaybeSizeInBytes( -+ viewport_pixel_size_, ResourceFormat::RGBA_8888, &required_bytes)) { -+ DLOG(ERROR) << "Invalid viewport size " << viewport_pixel_size_.ToString(); -+ return; -+ } -+ -+ base::UnsafeSharedMemoryRegion region = -+ base::UnsafeSharedMemoryRegion::Create(required_bytes); -+ if (!region.IsValid()) { -+ DLOG(ERROR) << "Failed to allocate " << required_bytes << " bytes"; -+ return; -+ } -+ -+ #if defined(WIN32) -+ canvas_ = skia::CreatePlatformCanvasWithSharedSection( -+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false, -+ region.GetPlatformHandle(), skia::CRASH_ON_FAILURE); -+ #else -+ shm_mapping_ = region.Map(); -+ if (!shm_mapping_.IsValid()) { -+ DLOG(ERROR) << "Failed to map " << required_bytes << " bytes"; -+ return; -+ } -+ -+ canvas_ = skia::CreatePlatformCanvasWithPixels( -+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false, -+ static_cast(shm_mapping_.memory()), skia::CRASH_ON_FAILURE); -+ #endif -+ -+ // Transfer region ownership to the browser process. -+ layered_window_updater_->OnAllocatedSharedMemory(viewport_pixel_size_, -+ std::move(region)); -+} -+ -+SkCanvas* SoftwareOutputDeviceProxy::BeginPaintDelegated() { -+ return canvas_.get(); -+} -+ -+void SoftwareOutputDeviceProxy::EndPaintDelegated( -+ const gfx::Rect& damage_rect) { -+ DCHECK(!waiting_on_draw_ack_); -+ -+ if (!canvas_) -+ return; -+ -+ layered_window_updater_->Draw(damage_rect, base::BindOnce( -+ &SoftwareOutputDeviceProxy::DrawAck, base::Unretained(this))); -+ waiting_on_draw_ack_ = true; -+ -+ TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceProxy::Draw", this); -+} -+ -+void SoftwareOutputDeviceProxy::DrawAck() { -+ DCHECK(waiting_on_draw_ack_); -+ DCHECK(!swap_ack_callback_.is_null()); -+ -+ TRACE_EVENT_ASYNC_END0("viz", "SoftwareOutputDeviceProxy::Draw", this); -+ -+ waiting_on_draw_ack_ = false; -+ std::move(swap_ack_callback_).Run(viewport_pixel_size_); -+} -+ -+} // namespace viz -diff --git a/components/viz/service/display_embedder/software_output_device_proxy.h b/components/viz/service/display_embedder/software_output_device_proxy.h -new file mode 100644 -index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed ---- /dev/null -+++ b/components/viz/service/display_embedder/software_output_device_proxy.h -@@ -0,0 +1,88 @@ -+// Copyright 2014 The Chromium Authors. All rights reserved. -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_ -+#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_ -+ -+#if defined(OS_WIN) -+#include -+#endif -+ -+#include -+ -+#include "components/viz/host/host_display_client.h" -+#include "components/viz/service/display/software_output_device.h" -+#include "components/viz/service/viz_service_export.h" -+#include "services/viz/privileged/mojom/compositing/display_private.mojom.h" -+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h" -+ -+namespace viz { -+ -+// Shared base class for SoftwareOutputDevice implementations. -+class SoftwareOutputDeviceBase : public SoftwareOutputDevice { -+ public: -+ SoftwareOutputDeviceBase() = default; -+ ~SoftwareOutputDeviceBase() override; -+ -+ // SoftwareOutputDevice implementation. -+ void Resize(const gfx::Size& viewport_pixel_size, -+ float scale_factor) override; -+ SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override; -+ void EndPaint() override; -+ -+ // Called from Resize() if |viewport_pixel_size_| has changed. -+ virtual void ResizeDelegated() = 0; -+ -+ // Called from BeginPaint() and should return an SkCanvas. -+ virtual SkCanvas* BeginPaintDelegated() = 0; -+ -+ // Called from EndPaint() if there is damage. -+ virtual void EndPaintDelegated(const gfx::Rect& damage_rect) = 0; -+ -+ private: -+ bool in_paint_ = false; -+ -+ THREAD_CHECKER(thread_checker_); -+ -+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceBase); -+}; -+ -+// SoftwareOutputDevice implementation that draws indirectly. An implementation -+// of mojom::LayeredWindowUpdater in the browser process handles the actual -+// drawing. Pixel backing is in SharedMemory so no copying between processes -+// is required. -+class SoftwareOutputDeviceProxy : public SoftwareOutputDeviceBase { -+ public: -+ explicit SoftwareOutputDeviceProxy( -+ mojom::LayeredWindowUpdaterPtr layered_window_updater); -+ ~SoftwareOutputDeviceProxy() override; -+ -+ // SoftwareOutputDevice implementation. -+ void OnSwapBuffers(SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) override; -+ -+ // SoftwareOutputDeviceBase implementation. -+ void ResizeDelegated() override; -+ SkCanvas* BeginPaintDelegated() override; -+ void EndPaintDelegated(const gfx::Rect& rect) override; -+ -+ private: -+ // Runs |swap_ack_callback_| after draw has happened. -+ void DrawAck(); -+ -+ mojom::LayeredWindowUpdaterPtr layered_window_updater_; -+ -+ std::unique_ptr canvas_; -+ bool waiting_on_draw_ack_ = false; -+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback_; -+ -+#if !defined(WIN32) -+ base::WritableSharedMemoryMapping shm_mapping_; -+#endif -+ -+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceProxy); -+}; -+ -+} // namespace viz -+ -+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_ -diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc -index 74316edc0e0bd28b1772e9d7cf34327d113462c4..9cbe5400458ce6e0b8ea9edfa3f0969fb936ee1e 100644 ---- a/components/viz/service/display_embedder/software_output_device_win.cc -+++ b/components/viz/service/display_embedder/software_output_device_win.cc -@@ -11,6 +11,7 @@ - #include "components/viz/common/display/use_layered_window.h" - #include "components/viz/common/resources/resource_sizes.h" - #include "components/viz/service/display_embedder/output_device_backing.h" -+#include "components/viz/service/display_embedder/software_output_device_proxy.h" - #include "mojo/public/cpp/system/platform_handle.h" - #include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h" - #include "skia/ext/platform_canvas.h" -@@ -265,7 +266,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated( - if (!canvas_) - return; - -- layered_window_updater_->Draw(base::BindOnce( -+ layered_window_updater_->Draw(damage_rect, base::BindOnce( - &SoftwareOutputDeviceWinProxy::DrawAck, base::Unretained(this))); - waiting_on_draw_ack_ = true; - -@@ -297,8 +298,13 @@ std::unique_ptr CreateSoftwareOutputDeviceWin( - display_client->CreateLayeredWindowUpdater( - mojo::MakeRequest(&layered_window_updater)); - -- return std::make_unique( -- hwnd, std::move(layered_window_updater)); -+ bool offscreen = false; -+ if (display_client->IsOffscreen(&offscreen) && offscreen) -+ return std::make_unique( -+ std::move(layered_window_updater)); -+ else -+ return std::make_unique( -+ hwnd, std::move(layered_window_updater)); - } else { - return std::make_unique(hwnd, backing); - } -diff --git a/services/viz/privileged/mojom/compositing/display_private.mojom b/services/viz/privileged/mojom/compositing/display_private.mojom -index 5c6292cfb3b8b46802c772d202d19c78e4782488..ed27af3ab0b383553b4d9492d29cec2b91bee807 100644 ---- a/services/viz/privileged/mojom/compositing/display_private.mojom -+++ b/services/viz/privileged/mojom/compositing/display_private.mojom -@@ -79,12 +79,14 @@ interface DisplayPrivate { - }; - - interface DisplayClient { -+ [Sync] -+ IsOffscreen() => (bool success); -+ - [EnableIf=is_mac] - OnDisplayReceivedCALayerParams(gfx.mojom.CALayerParams ca_layer_params); - - // Creates a LayeredWindowUpdater implementation to draw into a layered - // window. -- [EnableIf=is_win] - CreateLayeredWindowUpdater(LayeredWindowUpdater& layered_window_updater); - - // Notifies that a swap has occurred and provides information about the pixel -diff --git a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom -index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a285498c3f8e72 100644 ---- a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom -+++ b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom -@@ -26,5 +26,5 @@ interface LayeredWindowUpdater { - // Draws to the HWND by copying pixels from shared memory. Callback must be - // called after draw operation is complete to signal shared memory can be - // modified. -- Draw() => (); -+ Draw(gfx.mojom.Rect damage_rect) => (); - }; -diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h -index 359e7d21a4a5e7acaed9bd7f42f40019e650a182..cd90aab9d3a7b5335c829d964d92e3fa62401408 100644 ---- a/ui/compositor/compositor.h -+++ b/ui/compositor/compositor.h -@@ -23,6 +23,7 @@ - #include "cc/trees/layer_tree_host_single_thread_client.h" - #include "components/viz/common/frame_sinks/begin_frame_args.h" - #include "components/viz/common/surfaces/frame_sink_id.h" -+#include "components/viz/host/host_display_client.h" - #include "components/viz/host/host_frame_sink_client.h" - #include "services/viz/privileged/mojom/compositing/vsync_parameter_observer.mojom-forward.h" - #include "third_party/skia/include/core/SkColor.h" -@@ -194,6 +195,15 @@ class COMPOSITOR_EXPORT ContextFactory { - virtual bool SyncTokensRequiredForDisplayCompositor() = 0; - }; - -+class COMPOSITOR_EXPORT CompositorDelegate { -+ public: -+ virtual std::unique_ptr CreateHostDisplayClient( -+ ui::Compositor* compositor) = 0; -+ -+ protected: -+ virtual ~CompositorDelegate() {} -+}; -+ - // Compositor object to take care of GPU painting. - // A Browser compositor object is responsible for generating the final - // displayable form of pixels comprising a single widget's contents. It draws an -@@ -233,6 +243,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, - // Schedules a redraw of the layer tree associated with this compositor. - void ScheduleDraw(); - -+ CompositorDelegate* delegate() const { return delegate_; } -+ void SetDelegate(CompositorDelegate* delegate) { delegate_ = delegate; } -+ - // Sets the root of the layer tree drawn by this Compositor. The root layer - // must have no parent. The compositor's root layer is reset if the root layer - // is destroyed. NULL can be passed to reset the root layer, in which case the -@@ -448,6 +461,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, - ui::ContextFactory* context_factory_; - ui::ContextFactoryPrivate* context_factory_private_; - -+ CompositorDelegate* delegate_ = nullptr; -+ - // The root of the Layer tree drawn by this compositor. - Layer* root_layer_ = nullptr; - -diff --git a/ui/compositor/host/host_context_factory_private.cc b/ui/compositor/host/host_context_factory_private.cc -index 84b2623bd3dd8a7fdfa8e453eda3574e3b71ef99..974eb17c1d1f50c45b4d3a539a8d1a67b687642d 100644 ---- a/ui/compositor/host/host_context_factory_private.cc -+++ b/ui/compositor/host/host_context_factory_private.cc -@@ -99,8 +99,12 @@ void HostContextFactoryPrivate::ConfigureCompositor( - mojo::MakeRequest(&root_params->compositor_frame_sink_client); - root_params->display_private = - mojo::MakeRequest(&compositor_data.display_private); -- compositor_data.display_client = -- std::make_unique(compositor); -+ if (compositor->delegate()) -+ compositor_data.display_client = compositor->delegate()->CreateHostDisplayClient( -+ compositor); -+ else -+ compositor_data.display_client = -+ std::make_unique(compositor); - root_params->display_client = - compositor_data.display_client->GetBoundPtr(resize_task_runner_) - .PassInterface(); -diff --git a/ui/gfx/ca_layer_params.h b/ui/gfx/ca_layer_params.h -index 4014e64a75da88cf66c02e8adb71171c2666cab7..25e57784e1a1ffc546b003daa4cd0059c468432f 100644 ---- a/ui/gfx/ca_layer_params.h -+++ b/ui/gfx/ca_layer_params.h -@@ -6,6 +6,7 @@ - #define UI_GFX_CA_LAYER_PARAMS_H_ - - #include "build/build_config.h" -+#include "ui/gfx/geometry/rect.h" - #include "ui/gfx/geometry/size.h" - #include "ui/gfx/gfx_export.h" - -@@ -41,6 +42,8 @@ struct GFX_EXPORT CALayerParams { - gfx::ScopedRefCountedIOSurfaceMachPort io_surface_mach_port; - #endif - -+ gfx::Rect damage; -+ - // The geometry of the frame. - gfx::Size pixel_size; - float scale_factor = 1.f; -diff --git a/ui/gfx/mojom/ca_layer_params.mojom b/ui/gfx/mojom/ca_layer_params.mojom -index a73b2e678ffe0a682d0aa5409724fb441768bec5..6c36626d204c77ef51278b9e8f6fc6ee24a7a9ab 100644 ---- a/ui/gfx/mojom/ca_layer_params.mojom -+++ b/ui/gfx/mojom/ca_layer_params.mojom -@@ -18,5 +18,6 @@ struct CALayerParams { - bool is_empty; - CALayerContent content; - gfx.mojom.Size pixel_size; -+ gfx.mojom.Rect damage; - float scale_factor; - }; -diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc -index 843d5c24ec33de07c12d4417eb111f91dbcd42fe..0ea594950fcd2686f1b07248dbc8ceb257d89dca 100644 ---- a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc -+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc -@@ -52,6 +52,9 @@ bool StructTraits::Read( - if (!data.ReadPixelSize(&out->pixel_size)) - return false; - -+ if (!data.ReadDamage(&out->damage)) -+ return false; -+ - out->scale_factor = data.scale_factor(); - return true; - } -diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.h b/ui/gfx/mojom/ca_layer_params_mojom_traits.h -index 4cac766eae3161baedac4202f694129cd90c80de..0821495ad22944d8856bb750cac8912a2f8328c3 100644 ---- a/ui/gfx/mojom/ca_layer_params_mojom_traits.h -+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.h -@@ -20,6 +20,10 @@ struct StructTraits { - return ca_layer_params.pixel_size; - } - -+ static gfx::Rect damage(const gfx::CALayerParams& ca_layer_params) { -+ return ca_layer_params.damage; -+ } -+ - static float scale_factor(const gfx::CALayerParams& ca_layer_params) { - return ca_layer_params.scale_factor; - } diff --git a/patches/chromium/fix_breakpad_symbol_generation_on_linux_arm.patch b/patches/chromium/fix_breakpad_symbol_generation_on_linux_arm.patch index 0f52ed8521..f084998c43 100644 --- a/patches/chromium/fix_breakpad_symbol_generation_on_linux_arm.patch +++ b/patches/chromium/fix_breakpad_symbol_generation_on_linux_arm.patch @@ -7,7 +7,7 @@ Fixes broken Linux ARM breakpad symbol generation by patching out an `ldd`-related call that was throwing. diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py -index edb3fa5c125fae7858a1f36495410baf47d58484..05a1385e13d282a63975143cbc6e157984bbd992 100755 +index fe6d008b910942a59e31371ec08179b23a6fa0bb..c8736ae3c5e5a4bc78786aa8ab8e21b69a0d262b 100755 --- a/components/crash/content/tools/generate_breakpad_symbols.py +++ b/components/crash/content/tools/generate_breakpad_symbols.py @@ -67,7 +67,8 @@ def GetSharedLibraryDependenciesLinux(binary, options): diff --git a/patches/chromium/fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch b/patches/chromium/fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch index c437163ab3..071dab26f3 100644 --- a/patches/chromium/fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch +++ b/patches/chromium/fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch @@ -7,7 +7,7 @@ Subject: Disable usage of pthread_fchdir_np and pthread_chdir_np in MAS builds. diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc -index 1119fb3f97b1..b0efe96063b9 100644 +index 1119fb3f97b116028d78fdf42c1d336440a1681f..264178186f3f780b2b33de7649b1321b23964515 100644 --- a/base/process/launch_mac.cc +++ b/base/process/launch_mac.cc @@ -26,8 +26,10 @@ extern "C" { @@ -21,7 +21,7 @@ index 1119fb3f97b1..b0efe96063b9 100644 int responsibility_spawnattrs_setdisclaim(posix_spawnattr_t attrs, int disclaim) API_AVAILABLE(macosx(10.14)); -@@ -95,21 +97,29 @@ class PosixSpawnFileActions { +@@ -98,21 +100,29 @@ class PosixSpawnFileActions { }; int ChangeCurrentThreadDirectory(const char* path) { @@ -51,7 +51,7 @@ index 1119fb3f97b1..b0efe96063b9 100644 } struct GetAppOutputOptions { -@@ -238,11 +238,13 @@ Process LaunchProcess(const std::vector& argv, +@@ -228,11 +238,13 @@ Process LaunchProcess(const std::vector& argv, file_actions.Inherit(STDERR_FILENO); } diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index 4039504bc1..826134a591 100644 --- a/patches/chromium/frame_host_manager.patch +++ b/patches/chromium/frame_host_manager.patch @@ -42,10 +42,10 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2 // another SiteInstance for the same site. void RegisterSiteInstance(SiteInstanceImpl* site_instance); diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc -index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d2111926184a 100644 +index c51d888191854be22038380462dce27ea5d51319..ce07eb7a9079a16f59dddf836a9d2b705ce3d5f3 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc -@@ -2228,6 +2228,21 @@ bool RenderFrameHostManager::InitRenderView( +@@ -2219,6 +2219,21 @@ bool RenderFrameHostManager::InitRenderView( scoped_refptr RenderFrameHostManager::GetSiteInstanceForNavigationRequest( const NavigationRequest& request) { @@ -67,7 +67,7 @@ index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d211 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); // All children of MHTML documents must be MHTML documents. They all live in -@@ -2265,6 +2280,59 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -2263,6 +2278,59 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request.common_params().url); no_renderer_swap_allowed |= request.from_begin_navigation() && !can_renderer_initiate_transfer; @@ -127,7 +127,7 @@ index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d211 } else { // Subframe navigations will use the current renderer, unless specifically // allowed to swap processes. -@@ -2276,23 +2344,28 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -2274,23 +2342,28 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( if (no_renderer_swap_allowed && !should_swap_for_error_isolation) return scoped_refptr(current_site_instance); @@ -149,7 +149,7 @@ index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d211 + request.dest_site_instance(), candidate_site_instance.get(), request.common_params().transition, request.state() == NavigationRequest::FAILED, - request.restore_type() != RestoreType::NONE, request.is_view_source(), + request.GetRestoreType() != RestoreType::NONE, request.is_view_source(), was_server_redirect); + GetContentClient()->browser()->RegisterPendingSiteInstance( @@ -159,10 +159,10 @@ index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d211 } diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc -index 47067d774c0490e3f0daf1f0d7ee60e4f51fc110..54aab183e80538173045c68d539c197af8b8d063 100644 +index d0d4e89f4190752fa00a575bb91842a72f4c0070..7b8d9af4005c6c7b7f4ebf0090d718fd276d012b 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc -@@ -367,6 +367,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) { +@@ -368,6 +368,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) { return browsing_instance_->HasSiteInstance(url); } @@ -186,7 +186,7 @@ index 1edb9fd6b0c383f291735dd1a952fcb7b17cc87f..23967f040eb346be265faa2a92562e1f size_t GetRelatedActiveContentsCount() override; bool RequiresDedicatedProcess() override; diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc -index 15081967b0a29316ab82746ca6fe7d188a9efc58..2f894fdcc72f9e31e62f660e2eaff686b0bde95a 100644 +index df6f9848ba8ae1e8e7c6e5415b3a4c2efaf6f055..d032d13c4395fc00ccc548d6241b298965b23d20 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc @@ -44,6 +44,21 @@ @@ -212,10 +212,10 @@ index 15081967b0a29316ab82746ca6fe7d188a9efc58..2f894fdcc72f9e31e62f660e2eaff686 const MainFunctionParams& parameters) { return nullptr; diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index 678b25401338a624dc37a11c45331d65082934e9..bed09d49f1f8ca3a14a5306144faf4ae4d1f7de9 100644 +index 7578110f13b23e9585a181bba3e73a3996f60faf..cbb1eed3af4e8b56c07786a5f35525e5dee629f4 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -205,8 +205,45 @@ struct WebPreferences; +@@ -206,8 +206,45 @@ struct WebPreferences; // the observer interfaces.) class CONTENT_EXPORT ContentBrowserClient { public: diff --git a/patches/chromium/ignore_rc_check.patch b/patches/chromium/ignore_rc_check.patch index ac624d26b0..ecc7e4b6bb 100644 --- a/patches/chromium/ignore_rc_check.patch +++ b/patches/chromium/ignore_rc_check.patch @@ -7,10 +7,10 @@ Dont compare RC.exe and RC.py output. FIXME: It has to be reverted once the script is fixed. diff --git a/build/toolchain/win/tool_wrapper.py b/build/toolchain/win/tool_wrapper.py -index 1ad37129bb5663b547a1f1c32d09b9427d9d4434..6516ab892aa7032722fbe6af5991fc076314013c 100644 +index 3834cf2c01a9c63bfe7a6fc9e7549930a5eda01c..454b831a37c13fdd2fe4d8953d60dab661386f9a 100644 --- a/build/toolchain/win/tool_wrapper.py +++ b/build/toolchain/win/tool_wrapper.py -@@ -241,7 +241,11 @@ class WinTool(object): +@@ -250,7 +250,11 @@ class WinTool(object): if rc_exe_exit_code == 0: import filecmp # Strip "/fo" prefix. diff --git a/patches/chromium/mas-lssetapplicationlaunchservicesserverconnectionstatus.patch b/patches/chromium/mas-lssetapplicationlaunchservicesserverconnectionstatus.patch index 020cd16d6f..b36444bb22 100644 --- a/patches/chromium/mas-lssetapplicationlaunchservicesserverconnectionstatus.patch +++ b/patches/chromium/mas-lssetapplicationlaunchservicesserverconnectionstatus.patch @@ -7,7 +7,7 @@ Removes usage of the _LSSetApplicationLaunchServicesServerConnectionStatus private API. diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc -index 6779f6d70c1a69cd5668cf3a328cf56a492983e2..46d92835eadd6429ea0c6a53c5a39ff04f1c2634 100644 +index d257830f5943937a634aa85539ad654310579e2c..4373f508964cb1e9fd51c952122ac2f41fb35ae9 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -286,8 +286,10 @@ int GpuMain(const MainFunctionParams& parameters) { diff --git a/patches/chromium/mas_no_private_api.patch b/patches/chromium/mas_no_private_api.patch index 099bdfafd4..2910656ace 100644 --- a/patches/chromium/mas_no_private_api.patch +++ b/patches/chromium/mas_no_private_api.patch @@ -38,10 +38,10 @@ index 743d1364bcd13e24ecbe5ced730161d15b8c3e93..a7e81072194c00baa0aa3159a6bfe374 // is concerned. @property(nonatomic, readonly) NSString* subrole; diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm -index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc150834055 100644 +index 62f17dcca78fc7d9f851456120f7ddde09208dbe..95ec2b203d243a33383c022506ea0a572334043d 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm -@@ -219,6 +219,7 @@ +@@ -225,6 +225,7 @@ // VoiceOver uses -1 to mean "no limit" for AXResultsLimit. const int kAXResultsLimitNoLimit = -1; @@ -49,7 +49,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 extern "C" { // The following are private accessibility APIs required for cursor navigation -@@ -420,6 +421,7 @@ void AddMisspelledTextAttributes(const AXPlatformRange& ax_range, +@@ -422,6 +423,7 @@ void AddMisspelledTextAttributes(const AXPlatformRange& ax_range, AddMisspelledTextAttributes(ax_range, attributed_text); return attributed_text; } @@ -57,7 +57,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 // Returns an autoreleased copy of the AXNodeData's attribute. NSString* NSStringForStringAttribute(BrowserAccessibility* browserAccessibility, -@@ -687,7 +689,9 @@ + (void)initialize { +@@ -689,7 +691,9 @@ + (void)initialize { {NSAccessibilityEditableAncestorAttribute, @"editableAncestor"}, {NSAccessibilityElementBusyAttribute, @"elementBusy"}, {NSAccessibilityEnabledAttribute, @"enabled"}, @@ -67,7 +67,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 {NSAccessibilityExpandedAttribute, @"expanded"}, {NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"}, {NSAccessibilityFocusedAttribute, @"focused"}, -@@ -722,13 +726,17 @@ + (void)initialize { +@@ -724,13 +728,17 @@ + (void)initialize { {NSAccessibilityRowsAttribute, @"rows"}, // TODO(aboxhall): expose // NSAccessibilityServesAsTitleForUIElementsAttribute @@ -85,7 +85,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 {NSAccessibilitySizeAttribute, @"size"}, {NSAccessibilitySortDirectionAttribute, @"sortDirection"}, {NSAccessibilitySubroleAttribute, @"subrole"}, -@@ -1226,6 +1234,7 @@ - (NSNumber*)enabled { +@@ -1228,6 +1236,7 @@ - (NSNumber*)enabled { ax::mojom::Restriction::kDisabled]; } @@ -93,7 +93,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 // Returns a text marker that points to the last character in the document that // can be selected with VoiceOver. - (id)endTextMarker { -@@ -1236,6 +1245,7 @@ - (id)endTextMarker { +@@ -1238,6 +1247,7 @@ - (id)endTextMarker { BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtEndOfAnchor()); } @@ -101,7 +101,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 - (NSNumber*)expanded { if (![self instanceActive]) -@@ -2107,6 +2117,7 @@ - (NSValue*)selectedTextRange { +@@ -2112,6 +2122,7 @@ - (NSValue*)selectedTextRange { return [NSValue valueWithRange:NSMakeRange(selStart, selLength)]; } @@ -109,7 +109,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 - (id)selectedTextMarkerRange { if (![self instanceActive]) return nil; -@@ -2142,6 +2153,7 @@ - (id)selectedTextMarkerRange { +@@ -2147,6 +2158,7 @@ - (id)selectedTextMarkerRange { CreateAXPlatformRange(*anchorObject, anchorOffset, anchorAffinity, *focusObject, focusOffset, focusAffinity)); } @@ -117,7 +117,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 - (NSValue*)size { if (![self instanceActive]) -@@ -2174,6 +2186,7 @@ - (NSString*)sortDirection { +@@ -2179,6 +2191,7 @@ - (NSString*)sortDirection { return nil; } @@ -125,7 +125,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 // Returns a text marker that points to the first character in the document that // can be selected with VoiceOver. - (id)startTextMarker { -@@ -2184,6 +2197,7 @@ - (id)startTextMarker { +@@ -2189,6 +2202,7 @@ - (id)startTextMarker { BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtStartOfAnchor()); } @@ -133,7 +133,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 // Returns a subrole based upon the role. - (NSString*)subrole { -@@ -2475,11 +2489,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range { +@@ -2480,11 +2494,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range { NSMutableAttributedString* attributedValue = [[[NSMutableAttributedString alloc] initWithString:value] autorelease]; @@ -147,7 +147,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 return [attributedValue attributedSubstringFromRange:range]; } -@@ -2562,9 +2578,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2567,9 +2583,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return ToBrowserAccessibilityCocoa(cell); } @@ -159,7 +159,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 BrowserAccessibilityPositionInstance position = CreatePositionFromTextMarker(parameter); if (!position->IsNullPosition()) -@@ -2854,6 +2869,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2859,6 +2874,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return CreateTextMarker(root->CreatePositionAt(index)); } @@ -167,7 +167,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 if ([attribute isEqualToString: NSAccessibilityBoundsForRangeParameterizedAttribute]) { -@@ -2887,6 +2903,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2892,6 +2908,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return nil; } @@ -175,7 +175,7 @@ index eb17b696e5c299acda8c48d5f962df8bd7742632..7cdfe8e899ea84edd0f2a87ec3ad9fc1 if ([attribute isEqualToString: NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) { -@@ -2967,6 +2984,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition( +@@ -2972,6 +2989,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition( return @(child->GetIndexInParent()); } diff --git a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch index f76c96a56a..d079b238a8 100644 --- a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch +++ b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch @@ -5,10 +5,10 @@ Subject: network_service_allow_remote_certificate_verification_logic.patch diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a9c923789 100644 +index fd4c3971348e1e1b6e4368840f1271659bcdafd3..c36657fc18c705c7224e6c57c8c50b7f641060fa 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -91,6 +91,11 @@ +@@ -89,6 +89,11 @@ #include "services/network/url_loader.h" #include "services/network/url_request_context_builder_mojo.h" @@ -20,7 +20,7 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a #if BUILDFLAG(IS_CT_SUPPORTED) #include "components/certificate_transparency/chrome_ct_policy_enforcer.h" #include "components/certificate_transparency/chrome_require_ct_delegate.h" -@@ -319,6 +324,75 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) { +@@ -317,6 +322,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) { } // namespace @@ -30,8 +30,12 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a + } + ~RemoteCertVerifier() override = default; + -+ void Bind(mojom::CertVerifierClientPtr client_info) { -+ client_ = std::move(client_info); ++ void Bind( ++ mojo::PendingRemote client_info) { ++ client_.reset(); ++ if (client_info.is_valid()) { ++ client_.Bind(std::move(client_info)); ++ } + } + + // CertVerifier implementation @@ -60,7 +64,7 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a + } + + void OnRequestFinished(const RequestParams& params, net::CompletionOnceCallback callback, net::CertVerifyResult* verify_result, int error) { -+ if (client_) { ++ if (client_.is_bound()) { + client_->Verify(error, *verify_result, params.certificate(), + params.hostname(), params.flags(), params.ocsp_response(), + base::BindOnce(&RemoteCertVerifier::OnRemoteResponse, @@ -90,17 +94,18 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a + } + private: + std::unique_ptr upstream_; -+ mojom::CertVerifierClientPtr client_; ++ mojo::Remote client_; +}; + constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess; - constexpr bool NetworkContext::enable_resource_scheduler_; -@@ -650,6 +724,12 @@ void NetworkContext::SetClient(mojom::NetworkContextClientPtr client) { - client_ = std::move(client); + NetworkContext::PendingCertVerify::PendingCertVerify() = default; +@@ -466,6 +544,13 @@ void NetworkContext::SetClient( + client_.Bind(std::move(client)); } -+void NetworkContext::SetCertVerifierClient(mojom::CertVerifierClientPtr client) { ++void NetworkContext::SetCertVerifierClient( ++ mojo::PendingRemote client) { + if (remote_cert_verifier_) { + remote_cert_verifier_->Bind(std::move(client)); + } @@ -109,8 +114,8 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a void NetworkContext::CreateURLLoaderFactory( mojom::URLLoaderFactoryRequest request, mojom::URLLoaderFactoryParamsPtr params) { -@@ -1727,12 +1807,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() { - cert_net_fetcher_, /*system_trust_store_provider=*/nullptr))); +@@ -1541,12 +1626,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() { + net::SystemTrustStoreProvider::CreateDefaultForSSL()))); } #endif - if (!cert_verifier) @@ -131,10 +136,10 @@ index 41e3a4960bfa4909c54b1d3db214fa943bff65b6..781053c8650d98ee39d39e9057159f9a + + builder.SetCertVerifier(std::move(cert_verifier)); - std::unique_ptr network_delegate = - std::make_unique(this); + std::unique_ptr network_delegate = + std::make_unique( diff --git a/services/network/network_context.h b/services/network/network_context.h -index 12806873427b070beed2ec3a2a02c58791aa126d..b64485726b76b5a2939a33b9dd3a193d4fff8f6d 100644 +index 21dd391b7330c362e3795fddc2943ed6832d0383..581196b6d4a0054bc213e4eada1a97a8e0453c5f 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h @@ -80,6 +80,7 @@ class DomainReliabilityMonitor; @@ -145,15 +150,16 @@ index 12806873427b070beed2ec3a2a02c58791aa126d..b64485726b76b5a2939a33b9dd3a193d class CookieManager; class ExpectCTReporter; class HostResolver; -@@ -165,6 +166,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext - +@@ -169,6 +170,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext // mojom::NetworkContext implementation: - void SetClient(mojom::NetworkContextClientPtr client) override; -+ void SetCertVerifierClient(mojom::CertVerifierClientPtr client) override; + void SetClient( + mojo::PendingRemote client) override; ++ void SetCertVerifierClient( ++ mojo::PendingRemote client) override; void CreateURLLoaderFactory(mojom::URLLoaderFactoryRequest request, mojom::URLLoaderFactoryParamsPtr params) override; void ResetURLLoaderFactories() override; -@@ -556,6 +558,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -560,6 +563,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext std::unique_ptr nss_temp_certs_cache_; #endif @@ -163,11 +169,11 @@ index 12806873427b070beed2ec3a2a02c58791aa126d..b64485726b76b5a2939a33b9dd3a193d // CertNetFetcher is not used by the current platform. scoped_refptr cert_net_fetcher_; diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 59c05e850bba0c30871fb40f898e9f0b9ce7af36..cd617733773b81aa2e57176c46f392a6a124b7c9 100644 +index fe7ed5d396d9cba480a785f46d0df471c117c86e..6b7571dbf1464284ce30953a27c1ac2099f1872f 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -162,6 +162,17 @@ interface TrustedURLLoaderHeaderClient { - OnLoaderCreated(int32 request_id, TrustedHeaderClient& header_client); +@@ -165,6 +165,17 @@ interface TrustedURLLoaderHeaderClient { + pending_receiver header_client); }; +interface CertVerifierClient { @@ -184,12 +190,12 @@ index 59c05e850bba0c30871fb40f898e9f0b9ce7af36..cd617733773b81aa2e57176c46f392a6 // Parameters for constructing a network context. struct NetworkContextParams { // Name used by memory tools to identify the context. -@@ -587,6 +598,9 @@ interface NetworkContext { +@@ -727,6 +738,9 @@ interface NetworkContext { // Sets a client for this network context. - SetClient(NetworkContextClient client); + SetClient(pending_remote client); + // Sets a certificate verifier client for this network context. -+ SetCertVerifierClient(CertVerifierClient? client); ++ SetCertVerifierClient(pending_remote? client); + // Creates a new URLLoaderFactory with the given |params|. CreateURLLoaderFactory(URLLoaderFactory& url_loader_factory, diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index 5b7f182442..ca54fad9dc 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -55,7 +55,7 @@ index 5253f6be778cc78571b3df0a33d364a9b1e6ef52..dc5307e6500b0bfb5da83e8d8ff8886b scoped_refptr service_worker_context_; diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc -index f64eb733ede38501c34b2af89f42255189abd982..3c2dfad7ac9ba64b0b49ebef41a303edd1470cb1 100644 +index ce997528ce2973b54dbbf965220cc30bcb19a094..e84b0b62d853b044e590a0c764f1b21ad3210886 100644 --- a/content/browser/notifications/blink_notification_service_impl_unittest.cc +++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc @@ -138,7 +138,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test { @@ -108,10 +108,10 @@ index 4bf25bf1fa69f7d3869369172d375e2e489e62a1..f80ef2cecc8b111dc54e109646573a59 mojo::PendingReceiver receiver); diff --git a/content/browser/renderer_interface_binders.cc b/content/browser/renderer_interface_binders.cc -index 63e8a6a260c0a63d4eee365330352b3112878384..2d20c32e631bc7edf51f02d7d10e8fbbf1516f90 100644 +index cf4be3849726b3beb1dd47b8c44f7524e7ee2014..14e7551d62688dc59a24eb67a29f7ab05eb44527 100644 --- a/content/browser/renderer_interface_binders.cc +++ b/content/browser/renderer_interface_binders.cc -@@ -200,7 +200,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { +@@ -231,7 +231,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { RenderProcessHost* host, const url::Origin& origin) { static_cast(host->GetStoragePartition()) ->GetPlatformNotificationContext() @@ -142,10 +142,10 @@ index ca61088079c4150fcf389504ddcf26bcf6bf69cd..d9c034c39890eef1fe3d95c6d7c0ae68 const GURL& origin, const blink::PlatformNotificationData& notification_data, diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc -index ba5982883a3821b42c47c80187af2e4d1b3f0ffb..720965aa1df6b415e12a85dd2b2e4475facab019 100644 +index 73a1af201b12bf818af2eafadad478b8c422826c..fc7e74c0bf900d475fc134a7b606c5f9e404f934 100644 --- a/content/test/mock_platform_notification_service.cc +++ b/content/test/mock_platform_notification_service.cc -@@ -29,6 +29,7 @@ MockPlatformNotificationService::MockPlatformNotificationService( +@@ -31,6 +31,7 @@ MockPlatformNotificationService::MockPlatformNotificationService( MockPlatformNotificationService::~MockPlatformNotificationService() = default; void MockPlatformNotificationService::DisplayNotification( diff --git a/patches/chromium/out_of_process_instance.patch b/patches/chromium/out_of_process_instance.patch index 0529ecdcfb..30a13a1fec 100644 --- a/patches/chromium/out_of_process_instance.patch +++ b/patches/chromium/out_of_process_instance.patch @@ -5,10 +5,10 @@ Subject: out_of_process_instance.patch diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc -index 9c77f6422edbb42da34abb4320e0d5103cca5eea..8419b1ce6ed543b150c31d41dc8575e98c203427 100644 +index c6b9448faffb8b66c45c643b6fd756e6bc6a32e1..834f387c2f17bfab48a451f0eec634682e97e82d 100644 --- a/pdf/out_of_process_instance.cc +++ b/pdf/out_of_process_instance.cc -@@ -477,7 +477,9 @@ bool OutOfProcessInstance::Init(uint32_t argc, +@@ -478,7 +478,9 @@ bool OutOfProcessInstance::Init(uint32_t argc, std::string document_url = document_url_var.AsString(); base::StringPiece document_url_piece(document_url); is_print_preview_ = IsPrintPreviewUrl(document_url_piece); diff --git a/patches/chromium/pepper_flash.patch b/patches/chromium/pepper_flash.patch index 0e2536286b..11b181781e 100644 --- a/patches/chromium/pepper_flash.patch +++ b/patches/chromium/pepper_flash.patch @@ -61,7 +61,7 @@ index 37245c48cacbc5db164c61e4499f34ee83e0fce7..0fef12892e965e319e45f5dd1a9c5c9f + return PP_OK; } diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc -index c6c2ac11fd5551fe03978b947d2dda4c016e59ae..2dc392a6eab17b048df730e294398a3a0fb2eb8d 100644 +index 91c1562d9894e57fd5c3abfde157127144b31a91..8f4caca848d649db9bd26a4ce37509b29865f3c1 100644 --- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc +++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc @@ -8,9 +8,11 @@ @@ -132,10 +132,10 @@ index c6c2ac11fd5551fe03978b947d2dda4c016e59ae..2dc392a6eab17b048df730e294398a3a device::mojom::WakeLock* PepperFlashBrowserHost::GetWakeLock() { // Here is a lazy binding, and will not reconnect after connection error. diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h -index f2f40b636a41649199a38c663f03e6182df82520..41d11d1f1f9921d4b4deaaf4b2d8ab4be910e8fe 100644 +index 6b13bae8def62d9a26d68ac8396b4bf6f7439c1a..d92b5a5855c0cebf94922a31f686e15e3a6cd833 100644 --- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h +++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h -@@ -23,9 +23,11 @@ namespace content { +@@ -24,9 +24,11 @@ namespace content { class BrowserPpapiHost; } @@ -147,7 +147,7 @@ index f2f40b636a41649199a38c663f03e6182df82520..41d11d1f1f9921d4b4deaaf4b2d8ab4b class GURL; -@@ -49,15 +51,19 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost { +@@ -50,15 +52,19 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost { const base::Time& t); int32_t OnGetLocalDataRestrictions(ppapi::host::HostMessageContext* context); @@ -167,8 +167,8 @@ index f2f40b636a41649199a38c663f03e6182df82520..41d11d1f1f9921d4b4deaaf4b2d8ab4b int render_process_id_; // Requests a wake lock to prevent going to sleep, and a timer to cancel it -@@ -65,8 +71,10 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost { - device::mojom::WakeLockPtr wake_lock_; +@@ -66,8 +72,10 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost { + mojo::Remote wake_lock_; base::DelayTimer delay_timer_; +#if 0 diff --git a/patches/chromium/picture-in-picture.patch b/patches/chromium/picture-in-picture.patch index 41950136de..51b39b0e6f 100644 --- a/patches/chromium/picture-in-picture.patch +++ b/patches/chromium/picture-in-picture.patch @@ -9,45 +9,32 @@ index 8e4deafa1746eeb48802a0503fefb37bedb33d04..127c62efd2327e1f3f09e9b93a0b8344 --- a/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc +++ b/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc @@ -4,7 +4,7 @@ - + #include "chrome/browser/ui/views/overlay/back_to_tab_image_button.h" - + -#include "chrome/grit/generated_resources.h" +#include "electron/grit/electron_resources.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/color_palette.h" diff --git a/chrome/browser/ui/views/overlay/close_image_button.cc b/chrome/browser/ui/views/overlay/close_image_button.cc -index 0aca25164dcad26cc000e289d6eb9010e336e6fc..70114b5aa865b96d3ace898d1faf515b9098abd9 100644 +index e9b64a823ae7e25361f37190d247af0fa6a6f68a..43fdb0ad50d2b11a1bc28aa0f358c6dd6feb72b8 100644 --- a/chrome/browser/ui/views/overlay/close_image_button.cc +++ b/chrome/browser/ui/views/overlay/close_image_button.cc @@ -4,7 +4,7 @@ - + #include "chrome/browser/ui/views/overlay/close_image_button.h" - + -#include "chrome/grit/generated_resources.h" +#include "electron/grit/electron_resources.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/color_palette.h" -diff --git a/chrome/browser/ui/views/overlay/mute_image_button.cc b/chrome/browser/ui/views/overlay/mute_image_button.cc -index 8c88ef08dd5165c0429dd90e8a76b711ac15a4df..ebdb06a6391b8108fa51796a4ad5f3a8ca489b60 100644 ---- a/chrome/browser/ui/views/overlay/mute_image_button.cc -+++ b/chrome/browser/ui/views/overlay/mute_image_button.cc -@@ -5,7 +5,7 @@ - #include "chrome/browser/ui/views/overlay/mute_image_button.h" - - #include "chrome/app/vector_icons/vector_icons.h" --#include "chrome/grit/generated_resources.h" -+#include "electron/grit/electron_resources.h" - #include "components/vector_icons/vector_icons.h" - #include "third_party/skia/include/core/SkColor.h" - #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc -index 780863193ca12ec1295752969dfc47ac06a9ae64..e2947b893cfcdb1beaa27beac80a1885ed011ce4 100644 +index 027fb9dddff339e67600b83c79c209656d210a90..e9dfd515aadfb4442da7a7b574a3891fe2a8d8bb 100644 --- a/chrome/browser/ui/views/overlay/overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc -@@ -20,7 +20,7 @@ +@@ -19,7 +19,7 @@ #include "chrome/browser/ui/views/overlay/resize_handle_button.h" #include "chrome/browser/ui/views/overlay/skip_ad_label_button.h" #include "chrome/browser/ui/views/overlay/track_image_button.h" @@ -62,7 +49,7 @@ index d9e5174ed622fb030bc37d32fbb40b132d7c4c23..1bf19c344721e74bb29c11a4c5c762a7 +++ b/chrome/browser/ui/views/overlay/playback_image_button.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ui/views/overlay/playback_image_button.h" - + #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/grit/generated_resources.h" +#include "electron/grit/electron_resources.h" @@ -70,12 +57,12 @@ index d9e5174ed622fb030bc37d32fbb40b132d7c4c23..1bf19c344721e74bb29c11a4c5c762a7 #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/ui/views/overlay/resize_handle_button.cc b/chrome/browser/ui/views/overlay/resize_handle_button.cc -index ee6b3612d7bdda591e05e5af338a80167ce6cd53..af093f14f1ef49c6de7228b296c32532203ca568 100644 +index aeba6fba215677c2c54a40791986c464fa112486..ebcef6ab0b651c274aa530b1e8d25d3eebcf4f3f 100644 --- a/chrome/browser/ui/views/overlay/resize_handle_button.cc +++ b/chrome/browser/ui/views/overlay/resize_handle_button.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ui/views/overlay/resize_handle_button.h" - + #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/grit/generated_resources.h" +#include "electron/grit/electron_resources.h" @@ -87,9 +74,9 @@ index da780c96bb757d7382df5f419e2c0fd644ac72b0..ae520bcf73cf6c39ca428c03975746e2 --- a/chrome/browser/ui/views/overlay/skip_ad_label_button.cc +++ b/chrome/browser/ui/views/overlay/skip_ad_label_button.cc @@ -4,7 +4,7 @@ - + #include "chrome/browser/ui/views/overlay/skip_ad_label_button.h" - + -#include "chrome/grit/generated_resources.h" +#include "electron/grit/electron_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -101,7 +88,7 @@ index 8f42277409a216f81d21723eb03045ac54525b0e..f7a15bfde9a43c15b18e8afbd60a0b19 +++ b/chrome/browser/ui/views/overlay/track_image_button.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ui/views/overlay/track_image_button.h" - + #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/grit/generated_resources.h" +#include "electron/grit/electron_resources.h" diff --git a/patches/chromium/preconnect_feature.patch b/patches/chromium/preconnect_feature.patch index 809722bf1e..9e066889f0 100644 --- a/patches/chromium/preconnect_feature.patch +++ b/patches/chromium/preconnect_feature.patch @@ -8,10 +8,10 @@ this patch removes that dependency so we can reuse it. Ideally we would change this class in upstream to not depend on Profile. diff --git a/chrome/browser/predictors/preconnect_manager.cc b/chrome/browser/predictors/preconnect_manager.cc -index cdee4d11f2d2..7312fb4e4ea5 100644 +index c3c7d4220f7ea612e5b86645854e4f426066e18c..969dd6659bfdc0fa3cf3edf494f1623ba10134a5 100644 --- a/chrome/browser/predictors/preconnect_manager.cc +++ b/chrome/browser/predictors/preconnect_manager.cc -@@ -71,7 +71,7 @@ PreresolveJob::PreresolveJob(PreresolveJob&& other) = default; +@@ -70,7 +70,7 @@ PreresolveJob::PreresolveJob(PreresolveJob&& other) = default; PreresolveJob::~PreresolveJob() = default; PreconnectManager::PreconnectManager(base::WeakPtr delegate, @@ -20,7 +20,7 @@ index cdee4d11f2d2..7312fb4e4ea5 100644 : delegate_(std::move(delegate)), profile_(profile), inflight_preresolves_count_(0) { -@@ -327,11 +327,13 @@ network::mojom::NetworkContext* PreconnectManager::GetNetworkContext() const { +@@ -317,11 +317,13 @@ network::mojom::NetworkContext* PreconnectManager::GetNetworkContext() const { if (network_context_) return network_context_; @@ -35,7 +35,7 @@ index cdee4d11f2d2..7312fb4e4ea5 100644 return content::BrowserContext::GetDefaultStoragePartition(profile_) ->GetNetworkContext(); diff --git a/chrome/browser/predictors/preconnect_manager.h b/chrome/browser/predictors/preconnect_manager.h -index 51a842d2e44f..097316e0cfb6 100644 +index e35163576b55d772098ae2a2138c4c1cf8438eac..70cad725f9476175b31859867c640ca8c66816a8 100644 --- a/chrome/browser/predictors/preconnect_manager.h +++ b/chrome/browser/predictors/preconnect_manager.h @@ -22,6 +22,10 @@ @@ -58,7 +58,7 @@ index 51a842d2e44f..097316e0cfb6 100644 virtual ~PreconnectManager(); // Starts preconnect and preresolve jobs keyed by |url|. -@@ -202,7 +206,7 @@ class PreconnectManager { +@@ -196,7 +200,7 @@ class PreconnectManager { network::mojom::NetworkContext* GetNetworkContext() const; base::WeakPtr delegate_; diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index a010f047f1..9541af8909 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -61,7 +61,7 @@ index 13f9d7af3ae796ecec3a9189aa59f4b20171fd7a..9c35b294340cce070a9f428dac6aa587 } diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc -index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2a8557c57 100644 +index 7d1e56b3b1a8691477598b0103e2c69c171ec2c8..980971e2b8dd143fde3376f17352f672f2c3a8ad 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc @@ -27,10 +27,7 @@ @@ -180,16 +180,16 @@ index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2 // We can't print if there is no renderer. if (!web_contents()->GetRenderViewHost() || -@@ -554,8 +561,6 @@ bool PrintViewManagerBase::CreateNewPrintJob( - DCHECK(!print_job_); - print_job_ = base::MakeRefCounted(); - print_job_->Initialize(std::move(query), RenderSourceName(), number_pages_); +@@ -558,8 +565,6 @@ bool PrintViewManagerBase::CreateNewPrintJob( + print_job_->SetSource(PrintJob::Source::PRINT_PREVIEW, /*source_id=*/""); + #endif // defined(OS_CHROMEOS) + - registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, - content::Source(print_job_.get())); printing_succeeded_ = false; return true; } -@@ -604,6 +609,13 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -608,6 +613,13 @@ void PrintViewManagerBase::ReleasePrintJob() { content::RenderFrameHost* rfh = printing_rfh_; printing_rfh_ = nullptr; @@ -203,7 +203,7 @@ index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2 if (!print_job_) return; -@@ -613,8 +625,9 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -617,8 +629,9 @@ void PrintViewManagerBase::ReleasePrintJob() { rfh->Send(msg.release()); } @@ -215,9 +215,9 @@ index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2 // Don't close the worker thread. print_job_ = nullptr; } -@@ -684,6 +697,9 @@ bool PrintViewManagerBase::PrintNowInternal( +@@ -693,6 +706,9 @@ bool PrintViewManagerBase::PrintNowInternal( // Don't print / print preview interstitials or crashed tabs. - if (web_contents()->ShowingInterstitialPage() || web_contents()->IsCrashed()) + if (IsInterstitialOrCrashed()) return false; + + registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, @@ -226,7 +226,7 @@ index 97079241f54b876c6863097ab523daed4884f410..628a3892a6f5de1247313b64a00cdae2 } diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h -index 49d3f53ec30e9c9c86f8399511a7086afa4342e1..ea5791daf2f3941b5da8ecae28f5b3eb661858e2 100644 +index af49d3e2f8abaf7dc4d82dc3f9beccdf4fbd9f18..dd9eb11d31b4ee3d415b1fca7d97872da132203d 100644 --- a/chrome/browser/printing/print_view_manager_base.h +++ b/chrome/browser/printing/print_view_manager_base.h @@ -33,6 +33,8 @@ class PrintJob; @@ -249,7 +249,7 @@ index 49d3f53ec30e9c9c86f8399511a7086afa4342e1..ea5791daf2f3941b5da8ecae28f5b3eb #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Prints the document in |print_data| with settings specified in -@@ -198,9 +202,15 @@ class PrintViewManagerBase : public content::NotificationObserver, +@@ -206,9 +210,15 @@ class PrintViewManagerBase : public content::NotificationObserver, // The current RFH that is printing with a system printing dialog. content::RenderFrameHost* printing_rfh_; @@ -378,10 +378,10 @@ index 9fbea6d0a2dbe55b1d600fbc217dee5aa8ae8cd5..de9bd267e408c02fd4da7d903523c0e6 // content::BrowserMessageFilter: bool OnMessageReceived(const IPC::Message& message) override; diff --git a/components/printing/common/print_messages.h b/components/printing/common/print_messages.h -index a134a000bd3ccb229a26b3e2cb3425f91a85618e..fd768d372ac15be9b0553fd7d98ce5e27ed19f5a 100644 +index f9f5d1c07e4068d0706770ca81bd92ce166c3822..9f0e079b941296fa27b8cf0a66abfa45a6183b42 100644 --- a/components/printing/common/print_messages.h +++ b/components/printing/common/print_messages.h -@@ -368,7 +368,9 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu) +@@ -365,7 +365,9 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu) #if BUILDFLAG(ENABLE_PRINTING) // Tells the RenderFrame to switch the CSS to print media type, renders every // requested pages and switch back the CSS to display media type. @@ -393,18 +393,18 @@ index a134a000bd3ccb229a26b3e2cb3425f91a85618e..fd768d372ac15be9b0553fd7d98ce5e2 // Like PrintMsg_PrintPages, but using the print preview document's frame/node. IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog) diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc -index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a6947384f8e4 100644 +index fa6f27bf54f1877438a106961b6d236c771d6800..aeb45309624b0ddce874bb85db3f0cea2c48245a 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc -@@ -37,6 +37,7 @@ +@@ -38,6 +38,7 @@ #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "printing/buildflags/buildflags.h" #include "printing/metafile_skia.h" +#include "printing/print_settings.h" #include "printing/units.h" + #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/common/frame/frame_owner_element_type.h" - #include "third_party/blink/public/common/frame/sandbox_flags.h" -@@ -1117,7 +1118,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { +@@ -1146,7 +1147,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { web_frame->DispatchBeforePrintEvent(); if (!weak_this) return; @@ -414,8 +414,8 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 if (weak_this) web_frame->DispatchAfterPrintEvent(); } -@@ -1165,7 +1167,9 @@ void PrintRenderFrameHelper::OnDestruct() { - delete this; +@@ -1224,7 +1226,9 @@ void PrintRenderFrameHelper::InitiatePrintPreview( + #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) } -void PrintRenderFrameHelper::OnPrintPages() { @@ -425,7 +425,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 if (ipc_nesting_level_ > 1) return; -@@ -1178,7 +1182,8 @@ void PrintRenderFrameHelper::OnPrintPages() { +@@ -1237,7 +1241,8 @@ void PrintRenderFrameHelper::OnPrintPages() { // If we are printing a PDF extension frame, find the plugin node and print // that instead. auto plugin = delegate_->GetPdfElement(frame); @@ -435,7 +435,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 if (weak_this) frame->DispatchAfterPrintEvent(); // WARNING: |this| may be gone at this point. Do not do any more work here and -@@ -1195,7 +1200,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() { +@@ -1254,7 +1259,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() { } auto weak_this = weak_ptr_factory_.GetWeakPtr(); Print(frame, print_preview_context_.source_node(), @@ -444,7 +444,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 if (weak_this) frame->DispatchAfterPrintEvent(); // WARNING: |this| may be gone at this point. Do not do any more work here and -@@ -1231,6 +1236,8 @@ void PrintRenderFrameHelper::OnPrintPreview( +@@ -1290,6 +1295,8 @@ void PrintRenderFrameHelper::OnPrintPreview( if (ipc_nesting_level_ > 1) return; @@ -453,7 +453,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 print_preview_context_.OnPrintPreview(); UMA_HISTOGRAM_ENUMERATION("PrintPreview.PreviewEvent", -@@ -1623,7 +1630,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -1663,7 +1670,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { auto self = weak_ptr_factory_.GetWeakPtr(); Print(duplicate_node.GetDocument().GetFrame(), duplicate_node, @@ -464,7 +464,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 // Check if |this| is still valid. if (!self) return; -@@ -1634,7 +1643,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -1674,7 +1683,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -475,7 +475,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 // If still not finished with earlier print request simply ignore. if (prep_frame_view_) return; -@@ -1642,7 +1653,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -1682,7 +1693,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, FrameReference frame_ref(frame); int expected_page_count = 0; @@ -484,7 +484,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 DidFinishPrinting(FAIL_PRINT_INIT); return; // Failed to init print page settings. } -@@ -1662,8 +1673,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -1702,8 +1713,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, PrintMsg_PrintPages_Params print_settings; auto self = weak_ptr_factory_.GetWeakPtr(); @@ -498,7 +498,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 // Check if |this| is still valid. if (!self) return; -@@ -1870,10 +1884,23 @@ std::vector PrintRenderFrameHelper::GetPrintedPages( +@@ -1910,10 +1924,23 @@ std::vector PrintRenderFrameHelper::GetPrintedPages( return printed_pages; } @@ -525,7 +525,7 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 // Check if the printer returned any settings, if the settings is empty, we // can safely assume there are no printer drivers configured. So we safely // terminate. -@@ -1893,12 +1920,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) { +@@ -1933,12 +1960,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) { return result; } @@ -545,11 +545,11 @@ index a7780f1beabca9d7335333357fe7cf9f1fcb0d3c..8351ed13f30372dc5e0dcd5b39d9a694 Send(new PrintHostMsg_ShowInvalidPrinterSettingsError(routing_id())); return false; diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h -index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b8231738d16f55 100644 +index a4f11e5e5ab7e00522fff073d89b5e7638a19d21..1d94e895ff1d8b86e8e8e6a4189b08471e2728d5 100644 --- a/components/printing/renderer/print_render_frame_helper.h +++ b/components/printing/renderer/print_render_frame_helper.h -@@ -193,7 +193,8 @@ class PrintRenderFrameHelper - bool OnMessageReceived(const IPC::Message& message) override; +@@ -204,7 +204,8 @@ class PrintRenderFrameHelper + bool has_selection) override; // Message handlers --------------------------------------------------------- - void OnPrintPages(); @@ -557,8 +557,8 @@ index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b82317 + const base::DictionaryValue& settings); void OnPrintForSystemDialog(); #if BUILDFLAG(ENABLE_PRINT_PREVIEW) - void OnInitiatePrintPreview(bool has_selection); -@@ -243,7 +244,9 @@ class PrintRenderFrameHelper + void OnPrintPreview(const base::DictionaryValue& settings); +@@ -253,7 +254,9 @@ class PrintRenderFrameHelper // WARNING: |this| may be gone after this method returns. void Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -569,7 +569,7 @@ index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b82317 // Notification when printing is done - signal tear-down/free resources. void DidFinishPrinting(PrintingResult result); -@@ -252,12 +255,14 @@ class PrintRenderFrameHelper +@@ -262,12 +265,14 @@ class PrintRenderFrameHelper // Initialize print page settings with default settings. // Used only for native printing workflow. @@ -587,7 +587,7 @@ index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b82317 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Set options for print preset from source PDF document. diff --git a/printing/print_settings_conversion.cc b/printing/print_settings_conversion.cc -index 17c363ff9aa2e2262cacd0c9baea3820334bf67b..5b02461c2e9afe254405ddacd904e4bdbddd0b8b 100644 +index 7403d3ea6200e2443ca23cb483c2a36fa6ff5027..05fcb8c2ef6d1074cf37b8974830d3fe1dd6e011 100644 --- a/printing/print_settings_conversion.cc +++ b/printing/print_settings_conversion.cc @@ -184,11 +184,12 @@ bool PrintSettingsFromJobSettings(const base::Value& job_settings, @@ -618,7 +618,7 @@ index cd5c27c87df175676504a06b4e1904f6b836dc90..c4f6acf66bc69f1e7db633aa5b3b03a9 NOTREACHED(); return OnError(); diff --git a/printing/printing_context.h b/printing/printing_context.h -index 6a5a7c90ef5b..a033c58076ff 100644 +index 6a5a7c90ef5ba82837095c7bb934881b108797f7..a033c58076ff229ae45ed7c454fc60a57e5707b7 100644 --- a/printing/printing_context.h +++ b/printing/printing_context.h @@ -131,12 +131,12 @@ class PRINTING_EXPORT PrintingContext { diff --git a/patches/chromium/put_back_deleted_colors_for_autofill.patch b/patches/chromium/put_back_deleted_colors_for_autofill.patch index 31426b7089..ddaf58beeb 100644 --- a/patches/chromium/put_back_deleted_colors_for_autofill.patch +++ b/patches/chromium/put_back_deleted_colors_for_autofill.patch @@ -8,7 +8,7 @@ needed in chromium but our autofill implementation uses them. This patch can be our autofill implementation to work like Chromium's. diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk.cc b/chrome/browser/ui/libgtkui/native_theme_gtk.cc -index b77b8a53b0246b05e3c45e74eaf2b5c44c6dad88..7af171f6cd5d76e87e2fca32f5dbcc34d7e0a974 100644 +index 80542c2cab345f991079453b66f58439d0f214eb..d460eb8d2432df1209412a28cecc22f2db9af99b 100644 --- a/chrome/browser/ui/libgtkui/native_theme_gtk.cc +++ b/chrome/browser/ui/libgtkui/native_theme_gtk.cc @@ -279,6 +279,27 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) { @@ -40,7 +40,7 @@ index b77b8a53b0246b05e3c45e74eaf2b5c44c6dad88..7af171f6cd5d76e87e2fca32f5dbcc34 // TODO(thomasanderson): Render GtkSpinner directly. case ui::NativeTheme::kColorId_ThrobberSpinningColor: diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc -index af391345a4c893e3fbde4f750af429a0567188d2..febfb06f18b6f51e6ebcc0c59e2a81b259e97997 100644 +index 7fd49a2e26968daaa16ed3322b516f53ff60fb56..f902910ecc8e5b4945187e836655362ebba49204 100644 --- a/ui/native_theme/common_theme.cc +++ b/ui/native_theme/common_theme.cc @@ -56,6 +56,14 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id, @@ -58,7 +58,7 @@ index af391345a4c893e3fbde4f750af429a0567188d2..febfb06f18b6f51e6ebcc0c59e2a81b2 // FocusableBorder case NativeTheme::kColorId_FocusedBorderColor: return SkColorSetA(gfx::kGoogleBlue300, 0x66); -@@ -357,6 +365,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id, +@@ -359,6 +367,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id, case NativeTheme::kColorId_UnfocusedBorderColor: return SkColorSetA(SK_ColorBLACK, 0x66); @@ -94,10 +94,10 @@ index 3604105e43ee1866a8517c52ed05205b3ed10b56..70389e0245993faa2c17e9deefeb0002 kColorId_ThrobberSpinningColor, kColorId_ThrobberWaitingColor, diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index 257206023976b889590bc225f6542881e8a5d463..3003643bfb78cec2f5e84fc9e1471e1ef54aae41 100644 +index 5b1804538c2e78af23c797004f250369580b4178..97e72bc38a7231ce295ad943e977c69586cc6e07 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -559,6 +559,17 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id, +@@ -673,6 +673,17 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id, case kColorId_TableGroupingIndicatorColor: return system_colors_[SystemThemeColor::kGrayText]; diff --git a/patches/chromium/render_widget_host_view_base.patch b/patches/chromium/render_widget_host_view_base.patch index 71764616ba..1f436936b7 100644 --- a/patches/chromium/render_widget_host_view_base.patch +++ b/patches/chromium/render_widget_host_view_base.patch @@ -5,10 +5,10 @@ Subject: render_widget_host_view_base.patch diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc -index f41270e262784602c90b79b7aefbcd1a7af43dd8..a28ea7ee72fbf596b2b1d10cacaad4068d62e4d4 100644 +index dbfcd1da5c853a396b6a44c1a2968cc317d10125..3dc776ac982fdd5d4d15bd3afdf208810340db4e 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc -@@ -627,6 +627,15 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( +@@ -631,6 +631,15 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( return false; } @@ -25,7 +25,7 @@ index f41270e262784602c90b79b7aefbcd1a7af43dd8..a28ea7ee72fbf596b2b1d10cacaad406 const blink::WebMouseEvent& event, const ui::LatencyInfo& latency) { diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h -index 41288f633262f49ed7fb174c1af4e1834061c940..7fac11ee38f50165a0089473de5be601b1edf040 100644 +index 2bd5d56bc37daa97e32cb2be20f9d1b49abd91a2..77674ba193fa3fee3ff0dc5c83cc36c50fbcba68 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -24,9 +24,11 @@ @@ -52,7 +52,7 @@ index 41288f633262f49ed7fb174c1af4e1834061c940..7fac11ee38f50165a0089473de5be601 class WebCursor; class DelegatedFrameHost; struct TextInputState; -@@ -131,6 +135,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -132,6 +136,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase bool destination_is_loaded, bool destination_is_frozen) final; @@ -62,7 +62,7 @@ index 41288f633262f49ed7fb174c1af4e1834061c940..7fac11ee38f50165a0089473de5be601 // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. gfx::PointF TransformPointToRootCoordSpaceF( -@@ -348,6 +355,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -349,6 +356,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase virtual void ProcessGestureEvent(const blink::WebGestureEvent& event, const ui::LatencyInfo& latency); diff --git a/patches/chromium/render_widget_host_view_mac.patch b/patches/chromium/render_widget_host_view_mac.patch index 097f9d99ba..50fe4ffdad 100644 --- a/patches/chromium/render_widget_host_view_mac.patch +++ b/patches/chromium/render_widget_host_view_mac.patch @@ -5,10 +5,10 @@ Subject: render_widget_host_view_mac.patch diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653de1c70c7 100644 +index d8de080eb6a30f16282661941b9a95da4fa41d70..326c5a13f6924643c699ca3cc2f98262a21fd907 100644 --- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -@@ -152,6 +152,11 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -153,6 +153,11 @@ void ExtractUnderlines(NSAttributedString* string, } // namespace @@ -20,7 +20,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653 // These are not documented, so use only after checking -respondsToSelector:. @interface NSApplication (UndocumentedSpeechMethods) - (void)speakString:(NSString*)string; -@@ -569,6 +574,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { +@@ -572,6 +577,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { @@ -30,7 +30,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653 return [self acceptsMouseEventsWhenInactive]; } -@@ -988,6 +996,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { +@@ -990,6 +998,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { eventType == NSKeyDown && !(modifierFlags & NSCommandKeyMask); @@ -41,7 +41,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653 // We only handle key down events and just simply forward other events. if (eventType != NSKeyDown) { hostHelper_->ForwardKeyboardEvent(event, latency_info); -@@ -1767,9 +1779,11 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -1769,9 +1781,11 @@ - (NSAccessibilityRole)accessibilityRole { // Since this implementation doesn't have to wait any IPC calls, this doesn't // make any key-typing jank. --hbono 7/23/09 // @@ -53,7 +53,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653 - (NSArray*)validAttributesForMarkedText { // This code is just copied from WebKit except renaming variables. -@@ -1778,7 +1792,10 @@ - (NSArray*)validAttributesForMarkedText { +@@ -1780,7 +1794,10 @@ - (NSArray*)validAttributesForMarkedText { initWithObjects:NSUnderlineStyleAttributeName, NSUnderlineColorAttributeName, NSMarkedClauseSegmentAttributeName, @@ -66,7 +66,7 @@ index a9654d8c1a9e15a3f90ec54a0b8e1bc61ce1f803..6c1e802fda70968cbcbea157fc982653 return validAttributesForMarkedText_.get(); } diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index f52e0750f337dde0a1f3e7d6d36bac8a62094316..0aac157ae84f975acd6a944c63194bf2ed233188 100644 +index ed9ea51809ec7f06b246b933281dc22b9b0055f7..32f3f2cceb742065db8b52a9f6aa814cfc30f955 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -63,6 +63,7 @@ diff --git a/patches/chromium/resource_file_conflict.patch b/patches/chromium/resource_file_conflict.patch index df58ca4356..2b7b49e49e 100644 --- a/patches/chromium/resource_file_conflict.patch +++ b/patches/chromium/resource_file_conflict.patch @@ -52,10 +52,10 @@ Some alternatives to this patch: None of these options seems like a substantial maintainability win over this patch to me (@nornagon). diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index a9814f1349d886c0ec1968fa9bf4e2695c475307..e54ad878e0815c0210f8627816ae1be3151bfb34 100644 +index 03dcf65c25ddeb6ae6074435f37b24b4b54cfc57..0e33dfbadf723b9a578c79725ad535ad24820db7 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -1624,7 +1624,7 @@ if (is_chrome_branded && !is_android) { +@@ -1599,7 +1599,7 @@ if (is_chrome_branded && !is_android) { } } @@ -64,7 +64,7 @@ index a9814f1349d886c0ec1968fa9bf4e2695c475307..e54ad878e0815c0210f8627816ae1be3 chrome_paks("packed_resources") { if (is_mac) { output_dir = "$root_gen_dir/repack" -@@ -1648,6 +1648,12 @@ if (!is_android) { +@@ -1623,6 +1623,12 @@ if (!is_android) { } } diff --git a/patches/chromium/revert_cleanup_remove_menu_subtitles_sublabels.patch b/patches/chromium/revert_cleanup_remove_menu_subtitles_sublabels.patch new file mode 100644 index 0000000000..ce240a87da --- /dev/null +++ b/patches/chromium/revert_cleanup_remove_menu_subtitles_sublabels.patch @@ -0,0 +1,531 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Samuel Attard +Date: Wed, 28 Aug 2019 14:00:54 -0700 +Subject: Revert "Cleanup: Remove Menu Subtitles/Sublabels" + +This reverts commit 27a7b3648684204ccb16ede5cf3947579bd6c222. + +diff --git a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc +index 273666e278b3c6d1ac1e203f51a6a701366cdf2f..e9ab80665fd54b13c4211016e1607dc6cc5d53c2 100644 +--- a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc ++++ b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc +@@ -157,7 +157,7 @@ void MockRenderViewContextMenu::AppendSubMenuItems(ui::MenuModel* model) { + sub_item.enabled = model->IsEnabledAt(i); + sub_item.checked = model->IsItemCheckedAt(i); + sub_item.hidden = false; +- sub_item.title = model->GetLabelAt(i); ++ sub_item.title = model->GetSublabelAt(i); + items_.push_back(sub_item); + } + } +diff --git a/chrome/browser/status_icons/status_icon_menu_model.cc b/chrome/browser/status_icons/status_icon_menu_model.cc +index 35d5182b293bcc5e013654f71e2366afef7f3e24..6deae7c286e9da72ab6a35d2e973da7fb32353d6 100644 +--- a/chrome/browser/status_icons/status_icon_menu_model.cc ++++ b/chrome/browser/status_icons/status_icon_menu_model.cc +@@ -20,6 +20,7 @@ struct StatusIconMenuModel::ItemState { + bool is_dynamic; + ui::Accelerator accelerator; + base::string16 label; ++ base::string16 sublabel; + gfx::Image icon; + }; + +@@ -61,6 +62,13 @@ void StatusIconMenuModel::ChangeLabelForCommandId(int command_id, + NotifyMenuStateChanged(); + } + ++void StatusIconMenuModel::ChangeSublabelForCommandId( ++ int command_id, const base::string16& sublabel) { ++ item_states_[command_id].is_dynamic = true; ++ item_states_[command_id].sublabel = sublabel; ++ NotifyMenuStateChanged(); ++} ++ + void StatusIconMenuModel::ChangeIconForCommandId( + int command_id, const gfx::Image& icon) { + item_states_[command_id].is_dynamic = true; +@@ -122,6 +130,14 @@ base::string16 StatusIconMenuModel::GetLabelForCommandId(int command_id) const { + return base::string16(); + } + ++base::string16 StatusIconMenuModel::GetSublabelForCommandId( ++ int command_id) const { ++ auto iter = item_states_.find(command_id); ++ if (iter != item_states_.end()) ++ return iter->second.sublabel; ++ return base::string16(); ++} ++ + bool StatusIconMenuModel::GetIconForCommandId(int command_id, + gfx::Image* image_skia) const { + auto iter = item_states_.find(command_id); +diff --git a/chrome/browser/status_icons/status_icon_menu_model.h b/chrome/browser/status_icons/status_icon_menu_model.h +index f40a33f7ce6ef9c9c538f44a86a404925eec32b5..556f531fcb66072828f3b5c2c07cd9d6a744ad53 100644 +--- a/chrome/browser/status_icons/status_icon_menu_model.h ++++ b/chrome/browser/status_icons/status_icon_menu_model.h +@@ -61,9 +61,11 @@ class StatusIconMenuModel + + // Calling any of these "change" methods will mark the menu item as "dynamic" + // (see menu_model.h:IsItemDynamicAt) which many platforms take as a cue to +- // refresh the label and icon of the menu item each time the menu is ++ // refresh the label, sublabel and icon of the menu item each time the menu is + // shown. + void ChangeLabelForCommandId(int command_id, const base::string16& label); ++ void ChangeSublabelForCommandId( ++ int command_id, const base::string16& sublabel); + void ChangeIconForCommandId(int command_id, const gfx::Image& icon); + + void AddObserver(Observer* observer); +@@ -77,6 +79,7 @@ class StatusIconMenuModel + ui::Accelerator* accelerator) const override; + bool IsItemForCommandIdDynamic(int command_id) const override; + base::string16 GetLabelForCommandId(int command_id) const override; ++ base::string16 GetSublabelForCommandId(int command_id) const override; + bool GetIconForCommandId(int command_id, gfx::Image* icon) const override; + + protected: +diff --git a/chrome/browser/status_icons/status_icon_menu_model_unittest.cc b/chrome/browser/status_icons/status_icon_menu_model_unittest.cc +index a258d038da4a2bbfc6ec13c250781166235c1fbc..f6dbaa19cdb8938204c3452622589708c7bc3bb2 100644 +--- a/chrome/browser/status_icons/status_icon_menu_model_unittest.cc ++++ b/chrome/browser/status_icons/status_icon_menu_model_unittest.cc +@@ -90,6 +90,10 @@ TEST_F(StatusIconMenuModelTest, SetProperties) { + menu_model()->ChangeLabelForCommandId(0, ASCIIToUTF16("label2")); + EXPECT_EQ(ASCIIToUTF16("label2"), menu_model()->GetLabelForCommandId(0)); + ++ // Set the sublabel and icon image for the second menu item. ++ menu_model()->ChangeSublabelForCommandId(1, ASCIIToUTF16("sublabel")); ++ EXPECT_EQ(ASCIIToUTF16("sublabel"), menu_model()->GetSublabelForCommandId(1)); ++ + // Try setting icon image and changing it. + menu_model()->ChangeIconForCommandId(1, test_image1); + EXPECT_TRUE(menu_model()->GetIconForCommandId(1, &image_arg)); +@@ -98,8 +102,9 @@ TEST_F(StatusIconMenuModelTest, SetProperties) { + // Ensure changes to one menu item does not affect the other menu item. + EXPECT_FALSE(menu_model()->GetAcceleratorForCommandId(1, &accel_arg)); + EXPECT_EQ(base::string16(), menu_model()->GetLabelForCommandId(1)); ++ EXPECT_EQ(base::string16(), menu_model()->GetSublabelForCommandId(0)); + EXPECT_FALSE(menu_model()->GetIconForCommandId(0, &image_arg)); + +- // Menu state should have changed 6 times in this test. +- EXPECT_EQ(6, changed_count()); ++ // Menu state should have changed 7 times in this test. ++ EXPECT_EQ(7, changed_count()); + } +diff --git a/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc b/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc +index 654d0bf906c4785321a1fcdad9e12a22dbbbc170..6159eca4a400112f10647defe857c72740ff2779 100644 +--- a/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc ++++ b/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc +@@ -91,8 +91,8 @@ class MenuItemViewTestInsert : public MenuTestBase { + + inserted_item_ = menu()->AddMenuItemAt( + INSERT_INDEX, 1000, ASCIIToUTF16("inserted item"), base::string16(), +- nullptr, gfx::ImageSkia(), nullptr, views::MenuItemView::NORMAL, +- ui::NORMAL_SEPARATOR); ++ base::string16(), nullptr, gfx::ImageSkia(), nullptr, ++ views::MenuItemView::NORMAL, ui::NORMAL_SEPARATOR); + ASSERT_TRUE(inserted_item_); + menu()->ChildrenChanged(); + +@@ -186,8 +186,8 @@ class MenuItemViewTestInsertWithSubmenu : public MenuTestBase { + void Step2() { + inserted_item_ = menu()->AddMenuItemAt( + INSERT_INDEX, 1000, ASCIIToUTF16("inserted item"), base::string16(), +- nullptr, gfx::ImageSkia(), nullptr, views::MenuItemView::NORMAL, +- ui::NORMAL_SEPARATOR); ++ base::string16(), nullptr, gfx::ImageSkia(), nullptr, ++ views::MenuItemView::NORMAL, ui::NORMAL_SEPARATOR); + ASSERT_TRUE(inserted_item_); + menu()->ChildrenChanged(); + +diff --git a/chrome/browser/ui/views/status_icons/concat_menu_model.cc b/chrome/browser/ui/views/status_icons/concat_menu_model.cc +index ead2226583589c2921db7a0d5e97dc6388c49b6c..d537405caad6c30af0f48a168a17252756250e46 100644 +--- a/chrome/browser/ui/views/status_icons/concat_menu_model.cc ++++ b/chrome/browser/ui/views/status_icons/concat_menu_model.cc +@@ -33,6 +33,10 @@ base::string16 ConcatMenuModel::GetLabelAt(int index) const { + return GetterImpl(&ui::MenuModel::GetLabelAt, index); + } + ++base::string16 ConcatMenuModel::GetSublabelAt(int index) const { ++ return GetterImpl(&ui::MenuModel::GetSublabelAt, index); ++} ++ + base::string16 ConcatMenuModel::GetMinorTextAt(int index) const { + return GetterImpl(&ui::MenuModel::GetMinorTextAt, index); + } +diff --git a/chrome/browser/ui/views/status_icons/concat_menu_model.h b/chrome/browser/ui/views/status_icons/concat_menu_model.h +index 0ad30d57d6d13bc8d42920010145595ce0031573..7b73b5753cfd4595121e5b81fd3c95682869e17b 100644 +--- a/chrome/browser/ui/views/status_icons/concat_menu_model.h ++++ b/chrome/browser/ui/views/status_icons/concat_menu_model.h +@@ -23,6 +23,7 @@ class ConcatMenuModel : public ui::MenuModel { + ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override; + int GetCommandIdAt(int index) const override; + base::string16 GetLabelAt(int index) const override; ++ base::string16 GetSublabelAt(int index) const override; + base::string16 GetMinorTextAt(int index) const override; + const gfx::VectorIcon* GetMinorIconAt(int index) const override; + bool IsItemDynamicAt(int index) const override; +diff --git a/ui/base/models/menu_model.cc b/ui/base/models/menu_model.cc +index 73f0ab6d84d2cab6732866a6dc4b781faf630c0e..3319d058e8303066e0159d02d27ee2e8a46b38ec 100644 +--- a/ui/base/models/menu_model.cc ++++ b/ui/base/models/menu_model.cc +@@ -46,6 +46,10 @@ bool MenuModel::GetModelAndIndexForCommandId(int command_id, + return false; + } + ++base::string16 MenuModel::GetSublabelAt(int index) const { ++ return base::string16(); ++} ++ + base::string16 MenuModel::GetMinorTextAt(int index) const { + return base::string16(); + } +diff --git a/ui/base/models/menu_model.h b/ui/base/models/menu_model.h +index e0324ff11fb8c6b578ea7e902488235c33ec5485..690aa082b6be0bd576770d03ac94075183c1f9d6 100644 +--- a/ui/base/models/menu_model.h ++++ b/ui/base/models/menu_model.h +@@ -64,6 +64,10 @@ class UI_BASE_EXPORT MenuModel { + // Returns the label of the item at the specified index. + virtual base::string16 GetLabelAt(int index) const = 0; + ++ // Returns the sublabel of the item at the specified index. The sublabel ++ // is rendered beneath the label and using the font GetLabelFontAt(). ++ virtual base::string16 GetSublabelAt(int index) const; ++ + // Returns the minor text of the item at the specified index. The minor text + // is rendered to the right of the label and using the font GetLabelFontAt(). + virtual base::string16 GetMinorTextAt(int index) const; +diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc +index 0aeeb3e47074590834de6d9ca7e3eb7dbf6a7793..5efc0589644e243a095765710302af992d53f5b8 100644 +--- a/ui/base/models/simple_menu_model.cc ++++ b/ui/base/models/simple_menu_model.cc +@@ -42,6 +42,11 @@ base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId( + return base::string16(); + } + ++base::string16 SimpleMenuModel::Delegate::GetSublabelForCommandId( ++ int command_id) const { ++ return base::string16(); ++} ++ + base::string16 SimpleMenuModel::Delegate::GetMinorTextForCommandId( + int command_id) const { + return base::string16(); +@@ -324,6 +329,11 @@ void SimpleMenuModel::SetLabel(int index, const base::string16& label) { + MenuItemsChanged(); + } + ++void SimpleMenuModel::SetSublabel(int index, const base::string16& sublabel) { ++ items_[ValidateItemIndex(index)].sublabel = sublabel; ++ MenuItemsChanged(); ++} ++ + void SimpleMenuModel::SetMinorText(int index, + const base::string16& minor_text) { + items_[ValidateItemIndex(index)].minor_text = minor_text; +@@ -398,6 +408,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const { + return items_[ValidateItemIndex(index)].label; + } + ++base::string16 SimpleMenuModel::GetSublabelAt(int index) const { ++ if (IsItemDynamicAt(index)) ++ return delegate_->GetSublabelForCommandId(GetCommandIdAt(index)); ++ return items_[ValidateItemIndex(index)].sublabel; ++} ++ + base::string16 SimpleMenuModel::GetMinorTextAt(int index) const { + if (IsItemDynamicAt(index)) + return delegate_->GetMinorTextForCommandId(GetCommandIdAt(index)); +diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h +index 3cc9d686da8f64ddc8bdc66df40b1866bdd20607..dfacbdd4a55b5f5aa4d8c67136c607f75a880278 100644 +--- a/ui/base/models/simple_menu_model.h ++++ b/ui/base/models/simple_menu_model.h +@@ -44,10 +44,11 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel { + // Delegate should return true if |command_id| should be visible. + virtual bool IsCommandIdVisible(int command_id) const; + +- // Some command ids have labels, minor text and icons that change over +- // time. ++ // Some command ids have labels, sublabels, minor text and icons that change ++ // over time. + virtual bool IsItemForCommandIdDynamic(int command_id) const; + virtual base::string16 GetLabelForCommandId(int command_id) const; ++ virtual base::string16 GetSublabelForCommandId(int command_id) const; + virtual base::string16 GetMinorTextForCommandId(int command_id) const; + // Gets the icon for the item with the specified id, returning true if there + // is an icon, false otherwise. +@@ -175,6 +176,9 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel { + // Sets the label for the item at |index|. + void SetLabel(int index, const base::string16& label); + ++ // Sets the sublabel for the item at |index|. ++ void SetSublabel(int index, const base::string16& sublabel); ++ + // Sets the minor text for the item at |index|. + void SetMinorText(int index, const base::string16& minor_text); + +@@ -201,6 +205,7 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel { + ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override; + int GetCommandIdAt(int index) const override; + base::string16 GetLabelAt(int index) const override; ++ base::string16 GetSublabelAt(int index) const override; + base::string16 GetMinorTextAt(int index) const override; + const gfx::VectorIcon* GetMinorIconAt(int index) const override; + bool IsItemDynamicAt(int index) const override; +@@ -236,6 +241,7 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel { + int command_id = 0; + ItemType type = TYPE_COMMAND; + base::string16 label; ++ base::string16 sublabel; + base::string16 minor_text; + const gfx::VectorIcon* minor_icon = nullptr; + gfx::Image icon; +diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc +index 729e5ec0b3df05ac96460498612d3fa6742de61a..cfcb44804073da550b77878b0ca216cd3d46da95 100644 +--- a/ui/views/controls/menu/menu_item_view.cc ++++ b/ui/views/controls/menu/menu_item_view.cc +@@ -277,6 +277,7 @@ MenuItemView* MenuItemView::AddMenuItemAt( + int index, + int item_id, + const base::string16& label, ++ const base::string16& sublabel, + const base::string16& minor_text, + const gfx::VectorIcon* minor_icon, + const gfx::ImageSkia& icon, +@@ -297,6 +298,7 @@ MenuItemView* MenuItemView::AddMenuItemAt( + item->SetTitle(GetDelegate()->GetLabel(item_id)); + else + item->SetTitle(label); ++ item->SetSubtitle(sublabel); + item->SetMinorText(minor_text); + item->SetMinorIcon(minor_icon); + if (vector_icon) { +@@ -338,21 +340,23 @@ void MenuItemView::RemoveAllMenuItems() { + MenuItemView* MenuItemView::AppendMenuItem(int item_id, + const base::string16& label, + Type type) { +- return AppendMenuItemImpl(item_id, label, base::string16(), nullptr, +- gfx::ImageSkia(), type, ui::NORMAL_SEPARATOR); ++ return AppendMenuItemImpl(item_id, label, base::string16(), base::string16(), ++ nullptr, gfx::ImageSkia(), type, ++ ui::NORMAL_SEPARATOR); + } + + MenuItemView* MenuItemView::AppendSubMenu(int item_id, + const base::string16& label) { +- return AppendMenuItemImpl(item_id, label, base::string16(), nullptr, +- gfx::ImageSkia(), SUBMENU, ui::NORMAL_SEPARATOR); ++ return AppendMenuItemImpl(item_id, label, base::string16(), base::string16(), ++ nullptr, gfx::ImageSkia(), SUBMENU, ++ ui::NORMAL_SEPARATOR); + } + + MenuItemView* MenuItemView::AppendSubMenuWithIcon(int item_id, + const base::string16& label, + const gfx::ImageSkia& icon) { +- return AppendMenuItemImpl(item_id, label, base::string16(), nullptr, icon, +- SUBMENU, ui::NORMAL_SEPARATOR); ++ return AppendMenuItemImpl(item_id, label, base::string16(), base::string16(), ++ nullptr, icon, SUBMENU, ui::NORMAL_SEPARATOR); + } + + MenuItemView* MenuItemView::AppendMenuItemWithLabel( +@@ -366,12 +370,14 @@ MenuItemView* MenuItemView::AppendDelegateMenuItem(int item_id) { + } + + void MenuItemView::AppendSeparator() { +- AppendMenuItemImpl(0, base::string16(), base::string16(), nullptr, +- gfx::ImageSkia(), SEPARATOR, ui::NORMAL_SEPARATOR); ++ AppendMenuItemImpl(0, base::string16(), base::string16(), base::string16(), ++ nullptr, gfx::ImageSkia(), SEPARATOR, ++ ui::NORMAL_SEPARATOR); + } + + void MenuItemView::AddSeparatorAt(int index) { + AddMenuItemAt(index, /*item_id=*/0, /*label=*/base::string16(), ++ /*sub_label=*/base::string16(), + /*minor_text=*/base::string16(), /*minor_icon=*/nullptr, + /*icon=*/gfx::ImageSkia(), /*vector_icon=*/nullptr, + /*type=*/SEPARATOR, +@@ -381,21 +387,22 @@ void MenuItemView::AddSeparatorAt(int index) { + MenuItemView* MenuItemView::AppendMenuItemWithIcon(int item_id, + const base::string16& label, + const gfx::ImageSkia& icon) { +- return AppendMenuItemImpl(item_id, label, base::string16(), nullptr, icon, +- NORMAL, ui::NORMAL_SEPARATOR); ++ return AppendMenuItemImpl(item_id, label, base::string16(), base::string16(), ++ nullptr, icon, NORMAL, ui::NORMAL_SEPARATOR); + } + + MenuItemView* MenuItemView::AppendMenuItemImpl( + int item_id, + const base::string16& label, ++ const base::string16& sublabel, + const base::string16& minor_text, + const gfx::VectorIcon* minor_icon, + const gfx::ImageSkia& icon, + Type type, + ui::MenuSeparatorType separator_style) { + const int index = submenu_ ? int{submenu_->children().size()} : 0; +- return AddMenuItemAt(index, item_id, label, minor_text, minor_icon, icon, +- nullptr, type, separator_style); ++ return AddMenuItemAt(index, item_id, label, sublabel, minor_text, minor_icon, ++ icon, nullptr, type, separator_style); + } + + SubmenuView* MenuItemView::CreateSubmenu() { +@@ -427,6 +434,11 @@ void MenuItemView::SetTitle(const base::string16& title) { + invalidate_dimensions(); // Triggers preferred size recalculation. + } + ++void MenuItemView::SetSubtitle(const base::string16& subtitle) { ++ subtitle_ = subtitle; ++ invalidate_dimensions(); // Triggers preferred size recalculation. ++} ++ + void MenuItemView::SetMinorText(const base::string16& minor_text) { + minor_text_ = minor_text; + invalidate_dimensions(); // Triggers preferred size recalculation. +@@ -1016,13 +1028,23 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { + (!delegate || + delegate->ShouldReserveSpaceForSubmenuIndicator() ? + item_right_margin_ : config.arrow_to_edge_padding); +- gfx::Rect text_bounds(label_start, top_margin, width, available_height); ++ gfx::Rect text_bounds(label_start, top_margin, width, ++ subtitle_.empty() ? available_height ++ : available_height / 2); + text_bounds.set_x(GetMirroredXForRect(text_bounds)); + int flags = GetDrawStringFlags(); + if (mode == PB_FOR_DRAG) + flags |= gfx::Canvas::NO_SUBPIXEL_RENDERING; + canvas->DrawStringRectWithFlags(title(), style.font_list, style.foreground, + text_bounds, flags); ++ if (!subtitle_.empty()) { ++ canvas->DrawStringRectWithFlags( ++ subtitle_, style.font_list, ++ GetNativeTheme()->GetSystemColor( ++ ui::NativeTheme::kColorId_MenuItemMinorTextColor), ++ text_bounds + gfx::Vector2d(0, style.font_list.GetHeight()), flags); ++ } ++ + PaintMinorIconAndText(canvas, style); + + // Set the submenu indicator (arrow) image and color. +@@ -1274,6 +1296,11 @@ MenuItemView::MenuItemDimensions MenuItemView::CalculateDimensions() const { + + // Determine the length of the label text. + int string_width = gfx::GetStringWidth(title_, style.font_list); ++ if (!subtitle_.empty()) { ++ string_width = ++ std::max(string_width, gfx::GetStringWidth(subtitle_, style.font_list)); ++ } ++ + dimensions.standard_width = string_width + label_start + + item_right_margin_; + // Determine the length of the right-side text. +@@ -1281,9 +1308,10 @@ MenuItemView::MenuItemDimensions MenuItemView::CalculateDimensions() const { + minor_text.empty() ? 0 : gfx::GetStringWidth(minor_text, style.font_list); + + // Determine the height to use. +- dimensions.height = +- std::max(dimensions.height, style.font_list.GetHeight() + +- GetBottomMargin() + GetTopMargin()); ++ dimensions.height = std::max( ++ dimensions.height, (subtitle_.empty() ? 0 : style.font_list.GetHeight()) + ++ style.font_list.GetHeight() + GetBottomMargin() + ++ GetTopMargin()); + dimensions.height = + std::max(dimensions.height, MenuConfig::instance().item_min_height); + +diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h +index 0e97c35a8a452e8c602f08e2f2b72fc71becfa4b..332b11faae5eb05291dfd268f1b951a134b559c4 100644 +--- a/ui/views/controls/menu/menu_item_view.h ++++ b/ui/views/controls/menu/menu_item_view.h +@@ -151,6 +151,7 @@ class VIEWS_EXPORT MenuItemView : public View { + MenuItemView* AddMenuItemAt(int index, + int item_id, + const base::string16& label, ++ const base::string16& sublabel, + const base::string16& minor_text, + const gfx::VectorIcon* minor_icon, + const gfx::ImageSkia& icon, +@@ -214,6 +215,7 @@ class VIEWS_EXPORT MenuItemView : public View { + // All the AppendXXX methods funnel into this. + MenuItemView* AppendMenuItemImpl(int item_id, + const base::string16& label, ++ const base::string16& sublabel, + const base::string16& minor_text, + const gfx::VectorIcon* minor_icon, + const gfx::ImageSkia& icon, +@@ -241,6 +243,9 @@ class VIEWS_EXPORT MenuItemView : public View { + void SetTitle(const base::string16& title); + const base::string16& title() const { return title_; } + ++ // Sets the subtitle. ++ void SetSubtitle(const base::string16& subtitle); ++ + // Sets the minor text. + void SetMinorText(const base::string16& minor_text); + +@@ -451,7 +456,7 @@ class VIEWS_EXPORT MenuItemView : public View { + void DestroyAllMenuHosts(); + + // Returns the text that should be displayed on the end (right) of the menu +- // item. This will be the accelerator (if one exists). ++ // item. This will be the accelerator (if one exists), otherwise |subtitle_|. + base::string16 GetMinorText() const; + + // Returns the icon that should be displayed to the left of the minor text. +@@ -542,6 +547,9 @@ class VIEWS_EXPORT MenuItemView : public View { + // Title. + base::string16 title_; + ++ // Subtitle/sublabel. ++ base::string16 subtitle_; ++ + // Minor text. + base::string16 minor_text_; + +diff --git a/ui/views/controls/menu/menu_item_view_unittest.cc b/ui/views/controls/menu/menu_item_view_unittest.cc +index f51bd9d85dad7771f18fc535b55b30a855eac48f..63aa8eddf51cb4821517902564e94813f6a42c02 100644 +--- a/ui/views/controls/menu/menu_item_view_unittest.cc ++++ b/ui/views/controls/menu/menu_item_view_unittest.cc +@@ -324,10 +324,10 @@ class MenuItemViewPaintUnitTest : public ViewsTestBase { + // Provides assertion coverage for painting minor text and icons. + TEST_F(MenuItemViewPaintUnitTest, MinorTextAndIconAssertionCoverage) { + auto AddItem = [this](auto label, auto minor_label, auto minor_icon) { +- menu_item_view()->AddMenuItemAt(0, 1000, base::ASCIIToUTF16(label), +- minor_label, minor_icon, gfx::ImageSkia(), +- nullptr, views::MenuItemView::NORMAL, +- ui::NORMAL_SEPARATOR); ++ menu_item_view()->AddMenuItemAt( ++ 0, 1000, base::ASCIIToUTF16(label), base::string16(), minor_label, ++ minor_icon, gfx::ImageSkia(), nullptr, views::MenuItemView::NORMAL, ++ ui::NORMAL_SEPARATOR); + }; + AddItem("No minor content", base::string16(), nullptr); + AddItem("Minor text only", base::ASCIIToUTF16("minor text"), nullptr); +diff --git a/ui/views/controls/menu/menu_model_adapter.cc b/ui/views/controls/menu/menu_model_adapter.cc +index 09b72733e66d1e13182730e475b781ffefe649c0..e45e249f2a89e1bfd31cc82341a65341571ffc21 100644 +--- a/ui/views/controls/menu/menu_model_adapter.cc ++++ b/ui/views/controls/menu/menu_model_adapter.cc +@@ -96,8 +96,8 @@ MenuItemView* MenuModelAdapter::AddMenuItemFromModelAt(ui::MenuModel* model, + + if (*type == MenuItemView::SEPARATOR) { + return menu->AddMenuItemAt(menu_index, item_id, base::string16(), +- base::string16(), nullptr, gfx::ImageSkia(), +- nullptr, *type, ++ base::string16(), base::string16(), nullptr, ++ gfx::ImageSkia(), nullptr, *type, + model->GetSeparatorTypeAt(model_index)); + } + +@@ -105,7 +105,8 @@ MenuItemView* MenuModelAdapter::AddMenuItemFromModelAt(ui::MenuModel* model, + model->GetIconAt(model_index, &icon); + return menu->AddMenuItemAt( + menu_index, item_id, model->GetLabelAt(model_index), +- model->GetMinorTextAt(model_index), model->GetMinorIconAt(model_index), ++ model->GetSublabelAt(model_index), model->GetMinorTextAt(model_index), ++ model->GetMinorIconAt(model_index), + icon.IsEmpty() ? gfx::ImageSkia() : *icon.ToImageSkia(), + icon.IsEmpty() ? model->GetVectorIconAt(model_index) : nullptr, *type, + ui::NORMAL_SEPARATOR); diff --git a/patches/chromium/scroll_bounce_flag.patch b/patches/chromium/scroll_bounce_flag.patch index 5d72a9a0a4..12efebc649 100644 --- a/patches/chromium/scroll_bounce_flag.patch +++ b/patches/chromium/scroll_bounce_flag.patch @@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch Patch to make scrollBounce option work. diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc -index cc9e8ad658a018bef04a2f3f40288543ab243443..eb1a89bba7f5d81ebd324bc7b5cf61914ef3ce32 100644 +index 56bff36825b02d3aa5ec1ded29b1dc7265df4f7e..569c83ae7cdcc0c7b3c3edf352b379c3b427e651 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1539,7 +1539,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() { +@@ -1523,7 +1523,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() { } bool RenderThreadImpl::IsElasticOverscrollEnabled() { diff --git a/patches/chromium/ssl_security_state_tab_helper.patch b/patches/chromium/ssl_security_state_tab_helper.patch index eecd77656c..bf6c333409 100644 --- a/patches/chromium/ssl_security_state_tab_helper.patch +++ b/patches/chromium/ssl_security_state_tab_helper.patch @@ -6,7 +6,7 @@ Subject: ssl_security_state_tab_helper.patch Allows populating security tab info for devtools in Electron. diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc -index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d55da690a2 100644 +index 887cdd11fbbd9df44edef1548a89891c5cf23cee..12da72449622289ec467d284f616bbf937ff1865 100644 --- a/chrome/browser/ssl/security_state_tab_helper.cc +++ b/chrome/browser/ssl/security_state_tab_helper.cc @@ -13,16 +13,20 @@ @@ -39,19 +39,7 @@ index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d5 #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" #endif -@@ -64,6 +68,7 @@ void RecordSecurityLevel( - } - } - -+#if 0 - security_state::SafetyTipStatus GetSecurityStateSafetyTipType( - safety_tips::SafetyTipType type) { - switch (type) { -@@ -76,11 +81,13 @@ security_state::SafetyTipStatus GetSecurityStateSafetyTipType( - return security_state::SafetyTipStatus::SAFETY_TIP_STATUS_NONE; - } - } -+#endif +@@ -66,8 +70,9 @@ void RecordSecurityLevel( } // namespace @@ -62,7 +50,7 @@ index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d5 SecurityStateTabHelper::SecurityStateTabHelper( content::WebContents* web_contents) -@@ -102,6 +109,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const { +@@ -89,6 +94,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const { // information is still being initialized, thus no need to check for that. state->malicious_content_status = GetMaliciousContentStatus(); @@ -70,15 +58,15 @@ index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d5 safety_tips::ReputationWebContentsObserver* reputation_web_contents_observer = safety_tips::ReputationWebContentsObserver::FromWebContents( web_contents()); -@@ -110,6 +118,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const { - ? GetSecurityStateSafetyTipType( - reputation_web_contents_observer->last_shown_safety_tip_type()) - : security_state::SafetyTipStatus::SAFETY_TIP_STATUS_NONE; +@@ -97,6 +103,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const { + ? reputation_web_contents_observer + ->GetSafetyTipStatusForVisibleNavigation() + : security_state::SafetyTipStatus::kUnknown; +#endif return state; } -@@ -176,6 +185,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { +@@ -164,6 +171,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { web_contents()->GetController().GetVisibleEntry(); if (!entry) return security_state::MALICIOUS_CONTENT_STATUS_NONE; @@ -86,7 +74,7 @@ index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d5 safe_browsing::SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); if (!sb_service) -@@ -254,6 +264,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { +@@ -242,6 +250,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { break; } } diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index 1d03a888b1..15c81d26a4 100644 --- a/patches/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,21 +22,22 @@ However, the patch would need to be reviewed by the security team, as it does touch a security-sensitive class. diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 20d0b4a801bdbe0300f878f369fc9017fc8aea3f..6302948343ee810a9d35a70be0c91a1ffbfb7647 100644 +index 25fd6ca609bdffcd62b5d16c7da9fbd37490b993..2aaa6b123b917b9b819aa2a2d3fb27179a57a8ec 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -378,6 +378,10 @@ class RendererSandboxedProcessLauncherDelegate - : public SandboxedProcessLauncherDelegate { - public: - RendererSandboxedProcessLauncherDelegate() {} +@@ -390,6 +390,11 @@ class RendererSandboxedProcessLauncherDelegate + { + } + +#if BUILDFLAG(USE_ZYGOTE_HANDLE) + RendererSandboxedProcessLauncherDelegate(bool use_zygote): + use_zygote_(use_zygote) {} +#endif - ++ ~RendererSandboxedProcessLauncherDelegate() override {} -@@ -397,6 +401,9 @@ class RendererSandboxedProcessLauncherDelegate + #if defined(OS_WIN) +@@ -411,6 +416,9 @@ class RendererSandboxedProcessLauncherDelegate #if BUILDFLAG(USE_ZYGOTE_HANDLE) service_manager::ZygoteHandle GetZygote() override { @@ -46,19 +47,22 @@ index 20d0b4a801bdbe0300f878f369fc9017fc8aea3f..6302948343ee810a9d35a70be0c91a1f const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); base::CommandLine::StringType renderer_prefix = -@@ -410,6 +417,11 @@ class RendererSandboxedProcessLauncherDelegate - service_manager::SandboxType GetSandboxType() override { +@@ -425,10 +433,13 @@ class RendererSandboxedProcessLauncherDelegate return service_manager::SANDBOX_TYPE_RENDERER; } -+ -+ private: + +-#if defined(OS_WIN) + private: ++#if defined(OS_WIN) + const bool renderer_code_integrity_enabled_; + #endif +#if BUILDFLAG(USE_ZYGOTE_HANDLE) + bool use_zygote_ = true; +#endif }; const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey"; -@@ -1746,11 +1758,18 @@ bool RenderProcessHostImpl::Init() { +@@ -1688,11 +1699,18 @@ bool RenderProcessHostImpl::Init() { cmd_line->PrependWrapper(renderer_prefix); AppendRendererCommandLine(cmd_line.get()); diff --git a/patches/chromium/sysroot.patch b/patches/chromium/sysroot.patch index 3442c6e49d..3ab278bb01 100644 --- a/patches/chromium/sysroot.patch +++ b/patches/chromium/sysroot.patch @@ -7,7 +7,7 @@ Make chrome's install-sysroot scripts point to our custom sysroot builds, which include extra deps that Electron needs (e.g. libnotify) diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py -index 2e756f75d243c558c03c720a1a9c90911f2bb121..5b8cc02c3cb9b257bbe9c93cf7ce329272403607 100755 +index 165551a2948b74c024459be42d1a9a3d96878a10..5c9272a512e22dfe2e90f6665083f53f0fa8979e 100755 --- a/build/linux/sysroot_scripts/install-sysroot.py +++ b/build/linux/sysroot_scripts/install-sysroot.py @@ -37,9 +37,11 @@ except ImportError: diff --git a/patches/chromium/tts.patch b/patches/chromium/tts.patch index 1183a11b2a..416d36317d 100644 --- a/patches/chromium/tts.patch +++ b/patches/chromium/tts.patch @@ -10,7 +10,7 @@ Subject: tts.patch destruction from content layer. diff --git a/chrome/browser/speech/tts_controller_delegate_impl.cc b/chrome/browser/speech/tts_controller_delegate_impl.cc -index e96b0cef21bec8925d4adf1e8692dc00f5ec6f5f..7ec07534aa3628873c9fe784fa0235f3c5c7f15f 100644 +index cce8cad71b9f620a3d26946a7df937a1336d741e..ea5db4e66f1cbbb2728558091dc07a413a536e1f 100644 --- a/chrome/browser/speech/tts_controller_delegate_impl.cc +++ b/chrome/browser/speech/tts_controller_delegate_impl.cc @@ -213,6 +213,7 @@ void TtsControllerDelegateImpl::UpdateUtteranceDefaultsFromPrefs( @@ -29,145 +29,3 @@ index e96b0cef21bec8925d4adf1e8692dc00f5ec6f5f..7ec07534aa3628873c9fe784fa0235f3 return prefs; } -diff --git a/chrome/browser/speech/tts_message_filter.cc b/chrome/browser/speech/tts_message_filter.cc -index cf0841622b99ad6637314284bcdbd83060a404cc..779b51992c180a76ed8a2c492297416aa557d214 100644 ---- a/chrome/browser/speech/tts_message_filter.cc -+++ b/chrome/browser/speech/tts_message_filter.cc -@@ -10,8 +10,11 @@ - #include "base/logging.h" - #include "base/task/post_task.h" - #include "chrome/browser/chrome_notification_types.h" -+#if 0 - #include "chrome/browser/profiles/profile.h" -+#endif - #include "chrome/common/tts_messages.h" -+#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h" - #include "content/public/browser/browser_context.h" - #include "content/public/browser/browser_task_traits.h" - #include "content/public/browser/notification_service.h" -@@ -19,6 +22,29 @@ - - using content::BrowserThread; - -+namespace { -+ -+class TtsMessageFilterShutdownNotifierFactory -+ : public BrowserContextKeyedServiceShutdownNotifierFactory { -+ public: -+ static TtsMessageFilterShutdownNotifierFactory* GetInstance() { -+ return base::Singleton::get(); -+ } -+ -+ private: -+ friend struct base::DefaultSingletonTraits< -+ TtsMessageFilterShutdownNotifierFactory>; -+ -+ TtsMessageFilterShutdownNotifierFactory() -+ : BrowserContextKeyedServiceShutdownNotifierFactory("TtsMessageFilter") {} -+ -+ ~TtsMessageFilterShutdownNotifierFactory() override {} -+ -+ DISALLOW_COPY_AND_ASSIGN(TtsMessageFilterShutdownNotifierFactory); -+}; -+ -+} // namespace -+ - TtsMessageFilter::TtsMessageFilter(content::BrowserContext* browser_context) - : BrowserMessageFilter(TtsMsgStart), - browser_context_(browser_context), -@@ -26,28 +52,27 @@ TtsMessageFilter::TtsMessageFilter(content::BrowserContext* browser_context) - CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - content::TtsController::GetInstance()->AddVoicesChangedDelegate(this); - -- // TODO(dmazzoni): make it so that we can listen for a BrowserContext -- // being destroyed rather than a Profile. http://crbug.com/444668 -- Profile* profile = Profile::FromBrowserContext(browser_context); -- notification_registrar_.Add(this, -- chrome::NOTIFICATION_PROFILE_DESTROYED, -- content::Source(profile)); -+ browser_context_shutdown_notifier_ = -+ TtsMessageFilterShutdownNotifierFactory::GetInstance() -+ ->Get(browser_context) -+ ->Subscribe(base::Bind(&TtsMessageFilter::BrowserContextDestroyed, -+ base::RetainedRef(this))); - - // Balanced in OnChannelClosingInUIThread() to keep the ref-count be non-zero - // until all pointers to this class are invalidated. - AddRef(); - } - --void TtsMessageFilter::OverrideThreadForMessage( -- const IPC::Message& message, BrowserThread::ID* thread) { -+void TtsMessageFilter::OverrideThreadForMessage(const IPC::Message& message, -+ BrowserThread::ID* thread) { - switch (message.type()) { -- case TtsHostMsg_InitializeVoiceList::ID: -- case TtsHostMsg_Speak::ID: -- case TtsHostMsg_Pause::ID: -- case TtsHostMsg_Resume::ID: -- case TtsHostMsg_Cancel::ID: -- *thread = BrowserThread::UI; -- break; -+ case TtsHostMsg_InitializeVoiceList::ID: -+ case TtsHostMsg_Speak::ID: -+ case TtsHostMsg_Pause::ID: -+ case TtsHostMsg_Resume::ID: -+ case TtsHostMsg_Cancel::ID: -+ *thread = BrowserThread::UI; -+ break; - } - } - -@@ -211,10 +236,8 @@ void TtsMessageFilter::Cleanup() { - content::TtsController::GetInstance()->RemoveUtteranceEventDelegate(this); - } - --void TtsMessageFilter::Observe( -- int type, -- const content::NotificationSource& source, -- const content::NotificationDetails& details) { -+void TtsMessageFilter::BrowserContextDestroyed() { -+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - browser_context_ = nullptr; -- notification_registrar_.RemoveAll(); -+ browser_context_shutdown_notifier_.reset(); - } -diff --git a/chrome/browser/speech/tts_message_filter.h b/chrome/browser/speech/tts_message_filter.h -index ffb607fbb275b0a75dba592f2f5f5afb881214e2..99780e56674af749a231f0e85b89e6a6ed3743d6 100644 ---- a/chrome/browser/speech/tts_message_filter.h -+++ b/chrome/browser/speech/tts_message_filter.h -@@ -8,6 +8,7 @@ - #include "base/macros.h" - #include "base/memory/weak_ptr.h" - #include "base/synchronization/lock.h" -+#include "components/keyed_service/core/keyed_service_shutdown_notifier.h" - #include "content/public/browser/browser_message_filter.h" - #include "content/public/browser/browser_thread.h" - #include "content/public/browser/notification_observer.h" -@@ -21,7 +22,6 @@ class BrowserContext; - struct TtsUtteranceRequest; - - class TtsMessageFilter : public content::BrowserMessageFilter, -- public content::NotificationObserver, - public content::UtteranceEventDelegate, - public content::VoicesChangedDelegate { - public: -@@ -64,15 +64,13 @@ class TtsMessageFilter : public content::BrowserMessageFilter, - // about to be deleted. - bool Valid(); - -- // content::NotificationObserver implementation. -- void Observe(int type, -- const content::NotificationSource& source, -- const content::NotificationDetails& details) override; -+ void BrowserContextDestroyed(); - -+ std::unique_ptr -+ browser_context_shutdown_notifier_; - content::BrowserContext* browser_context_; - mutable base::Lock mutex_; - mutable bool valid_; -- content::NotificationRegistrar notification_registrar_; - - DISALLOW_COPY_AND_ASSIGN(TtsMessageFilter); - }; diff --git a/patches/chromium/ui_views_fix_jumbo_build.patch b/patches/chromium/ui_views_fix_jumbo_build.patch new file mode 100644 index 0000000000..8a7f9652a0 --- /dev/null +++ b/patches/chromium/ui_views_fix_jumbo_build.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Deepak Mohan +Date: Wed, 11 Sep 2019 16:09:34 -0700 +Subject: ui/views: fix namespace qualification with jumbo_build + +In file included from gen/ui/views/views_jumbo_4.cc:45: +.\../../ui/views/widget/widget_hwnd_utils.cc(112,11): error: no member named 'IsFormControlsRefreshEnabled' +in namespace 'views::features'; did you mean '::features::IsFormControlsRefreshEnabled'? + if (features::IsFormControlsRefreshEnabled() && + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ::features::IsFormControlsRefreshEnabled +../..\ui/base/ui_base_features.h(72,41): note: '::features::IsFormControlsRefreshEnabled' declared here +COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsFormControlsRefreshEnabled(); + ^ +1 error generated. +ninja: build stopped: subcommand failed. + +diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn +index b12b2137e8cd24c28d9c9e6845161ac1756f6425..a6df1985f24b023355b0643c12d5685463dd187e 100644 +--- a/ui/views/BUILD.gn ++++ b/ui/views/BUILD.gn +@@ -580,6 +580,7 @@ jumbo_component("views") { + "win/pen_event_processor.cc", + "win/scoped_fullscreen_visibility.cc", + ] ++ jumbo_excluded_sources = [ "widget/widget_hwnd_utils.cc" ] + libs = [ + "dwmapi.lib", + "imm32.lib", diff --git a/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch b/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch index 75a55574e1..857e53e38a 100644 --- a/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch +++ b/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch @@ -6,7 +6,7 @@ Subject: unsandboxed_ppapi_processes_skip_zygote.patch Unsandboxed ppapi processes should skip zygote. diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc -index 301349f721145f3fdbf8624e276a0c414ffa14bd..dddc9f959fcf2e6036f3de01738d9ad3eea457a9 100644 +index 86c23036817bc69ed44331acb5257582a3c66ff9..f3e184daf801dacb6a1a57ace82d22734ba770c5 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -128,6 +128,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate diff --git a/patches/chromium/verbose_generate_breakpad_symbols.patch b/patches/chromium/verbose_generate_breakpad_symbols.patch index 29026c036e..ecda58e962 100644 --- a/patches/chromium/verbose_generate_breakpad_symbols.patch +++ b/patches/chromium/verbose_generate_breakpad_symbols.patch @@ -7,7 +7,7 @@ Temporarily add additional debugging statements to generate_breakpad_symbols.py to determine why it is hanging. diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py -index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf47d58484 100755 +index 130ee13f8d5ecfcb5a303f7cc05af261693acf78..fe6d008b910942a59e31371ec08179b23a6fa0bb 100755 --- a/components/crash/content/tools/generate_breakpad_symbols.py +++ b/components/crash/content/tools/generate_breakpad_symbols.py @@ -60,7 +60,10 @@ def Resolve(path, exe_path, loader_path, rpaths): @@ -32,7 +32,7 @@ index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf return result -@@ -183,7 +189,7 @@ def GetSharedLibraryDependencies(options, binary, exe_path): +@@ -196,7 +202,7 @@ def GetSharedLibraryDependencies(options, binary, exe_path): """Return absolute paths to all shared library dependencies of the binary.""" deps = [] if options.platform == 'linux2': @@ -41,7 +41,7 @@ index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf elif options.platform == 'android': deps = GetSharedLibraryDependenciesAndroid(binary) elif options.platform == 'darwin': -@@ -257,7 +263,8 @@ def CreateSymbolDir(options, output_dir, relative_hash_dir): +@@ -270,7 +276,8 @@ def CreateSymbolDir(options, output_dir, relative_hash_dir): def GenerateSymbols(options, binaries): """Dumps the symbols of binary and places them in the given directory.""" @@ -51,7 +51,7 @@ index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf queue = Queue.Queue() print_lock = threading.Lock() -@@ -277,8 +284,15 @@ def GenerateSymbols(options, binaries): +@@ -290,8 +297,15 @@ def GenerateSymbols(options, binaries): reason = "Could not locate dump_syms executable." break @@ -67,7 +67,7 @@ index db04d39f8d263dc2b3b67b7f84470f557b519cfa..edb3fa5c125fae7858a1f36495410baf if not binary_info: should_dump_syms = False reason = "Could not obtain binary information." -@@ -296,8 +310,14 @@ def GenerateSymbols(options, binaries): +@@ -309,8 +323,14 @@ def GenerateSymbols(options, binaries): # See if there is a symbol file already found next to the binary potential_symbol_files = glob.glob('%s.breakpad*' % binary) for potential_symbol_file in potential_symbol_files: diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index 4216b37aa0..c6a3db707e 100644 --- a/patches/chromium/web_contents.patch +++ b/patches/chromium/web_contents.patch @@ -5,10 +5,10 @@ Subject: web_contents.patch diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 30c4165bdb6af4cbab48954570c55cbe60cb598d..337c2bade32055f813009e0dbd33621499a921bf 100644 +index f194fb62a05aafdc617f6ce56bc2f447fd8b5d15..6f18e4888a345de3941b0a19ef91239f435671f3 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -2136,6 +2136,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2137,6 +2137,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { std::string unique_name; frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); @@ -21,7 +21,7 @@ index 30c4165bdb6af4cbab48954570c55cbe60cb598d..337c2bade32055f813009e0dbd336214 WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -2151,6 +2157,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2152,6 +2158,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { &render_view_host_delegate_view_); } } @@ -30,7 +30,7 @@ index 30c4165bdb6af4cbab48954570c55cbe60cb598d..337c2bade32055f813009e0dbd336214 CHECK(view_.get()); diff --git a/content/browser/web_contents/web_contents_view_guest.cc b/content/browser/web_contents/web_contents_view_guest.cc -index ecaf30bcb7b916a92a69641dd7b96a3633d407c0..0af625928ca6227a21cd4263a14a42b72095399c 100644 +index c45581fd22b7ba28b76bdebfffdc872b820798c8..f22ac0e611cc79aa1bc7f85836d69e3a8e326a6e 100644 --- a/content/browser/web_contents/web_contents_view_guest.cc +++ b/content/browser/web_contents/web_contents_view_guest.cc @@ -68,19 +68,27 @@ gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const { @@ -64,7 +64,7 @@ index ecaf30bcb7b916a92a69641dd7b96a3633d407c0..0af625928ca6227a21cd4263a14a42b7 #endif // defined(USE_AURA) } -@@ -132,11 +140,22 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget( +@@ -130,11 +138,22 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget( render_widget_host->GetView()); } @@ -92,10 +92,10 @@ index ecaf30bcb7b916a92a69641dd7b96a3633d407c0..0af625928ca6227a21cd4263a14a42b7 RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForChildWidget( diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index 4ff447d0615d0e14995581ca07bba5118750c29a..818e357453e9b14a62b1b461bb41f85fc74e033d 100644 +index 9dd92030f9a4a0405c9d7724817a5fc3bf497da1..9bef76029aa3e71cf9ac3d2ac5a5e3a66e60c165 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h -@@ -76,9 +76,12 @@ class BrowserPluginGuestDelegate; +@@ -79,9 +79,12 @@ class BrowserPluginGuestDelegate; class InterstitialPage; class RenderFrameHost; class RenderViewHost; diff --git a/patches/chromium/webview_cross_drag.patch b/patches/chromium/webview_cross_drag.patch index 2ee505adce..3b86bf1e56 100644 --- a/patches/chromium/webview_cross_drag.patch +++ b/patches/chromium/webview_cross_drag.patch @@ -5,7 +5,7 @@ Subject: webview_cross_drag.patch diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc -index dda92e4006db1d9a1b68459644d252a3e1dfa4a2..3ed0b3ec3badc9f558f78adbdb31c680ff2631f4 100644 +index ac096c72a956ecb7e6bacb72452b44f6b00ed251..741f6d44d06bb3abe547184403d0e8cccb00d0ce 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -777,6 +777,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const { diff --git a/patches/chromium/worker_context_will_destroy.patch b/patches/chromium/worker_context_will_destroy.patch index 0c10958289..417e429460 100644 --- a/patches/chromium/worker_context_will_destroy.patch +++ b/patches/chromium/worker_context_will_destroy.patch @@ -5,10 +5,10 @@ Subject: worker_context_will_destroy.patch diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h -index 76d775b20307a3c9a779489e754c6849a0f21d64..533a1621e82461d8611ba1d8f2ed2fc527085a03 100644 +index 7ae6603144706803b04c6583bad366197e20f456..db2e164f0415b511a8d19d18f197d82e8a447ad8 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h -@@ -384,6 +384,11 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -383,6 +383,11 @@ class CONTENT_EXPORT ContentRendererClient { virtual void DidInitializeWorkerContextOnWorkerThread( v8::Local context) {} @@ -21,10 +21,10 @@ index 76d775b20307a3c9a779489e754c6849a0f21d64..533a1621e82461d8611ba1d8f2ed2fc5 // An empty URL is returned if the URL is not overriden. virtual GURL OverrideFlashEmbedWithHTML(const GURL& url); diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index a61bc92743c4bdf0b011c451cfc341cb4442a4bb..191e9aa21d2b766e2cc696bdf7963b15baf787d3 100644 +index 7f3c8fbb4c1870a4313280d00371eea65c718d16..302a23981a0b3b056260f598d22259c57c469ee4 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -923,6 +923,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { +@@ -1002,6 +1002,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread(); } @@ -38,10 +38,10 @@ index a61bc92743c4bdf0b011c451cfc341cb4442a4bb..191e9aa21d2b766e2cc696bdf7963b15 const v8::Local& worker) { GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index fb807df3f015c6d9a3a18608301b2781596415de..a08e9fb3a30bf401b204c206ef9f2aa289890b39 100644 +index b183977096477563043b288b33d90d3ce9fbd8de..87bd2530eb060c8e68a5a2ca090ce80cd63b942e 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -190,6 +190,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -200,6 +200,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void DidStartWorkerThread() override; void WillStopWorkerThread() override; void WorkerContextCreated(const v8::Local& worker) override; @@ -50,10 +50,10 @@ index fb807df3f015c6d9a3a18608301b2781596415de..a08e9fb3a30bf401b204c206ef9f2aa2 const blink::WebString& header_name) override; diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h -index 814efddb679051d2bd916ee565d117669c254751..f2ac53df9091a7d5b4ca6b0e5b724a1f058f04e8 100644 +index cd9572908f0c8b80341f28facfe4256df30b27ff..d9ff47fac2590b1a0fa2a8faf803bc0fa875ae25 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -677,6 +677,7 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -693,6 +693,7 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local& worker) {} @@ -62,10 +62,10 @@ index 814efddb679051d2bd916ee565d117669c254751..f2ac53df9091a7d5b4ca6b0e5b724a1f const WebSecurityOrigin& script_origin) { return false; diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc -index 391a9d1099ac3226c6c0d42e74e672f958e5a58b..3d66c80a190a533fade36d452f8093116a0d6c1b 100644 +index d16b0ea72e4d0c0371bbb145c4f4c26b4d5c19e2..bd4af3ae2df62968aaf9001db8eda006a96d307b 100644 --- a/third_party/blink/renderer/core/workers/worker_thread.cc +++ b/third_party/blink/renderer/core/workers/worker_thread.cc -@@ -658,6 +658,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() { +@@ -680,6 +680,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() { nested_runner_->QuitNow(); } diff --git a/patches/config.json b/patches/config.json index 85f551adf4..3edf0b92f5 100644 --- a/patches/config.json +++ b/patches/config.json @@ -3,6 +3,8 @@ "src/electron/patches/boringssl": "src/third_party/boringssl/src", + "src/electron/patches/perfetto": "src/third_party/perfetto", + "src/electron/patches/v8": "src/v8", "src/electron/patches/node": "src/third_party/electron_node" diff --git a/patches/perfetto/.patches b/patches/perfetto/.patches new file mode 100644 index 0000000000..ded4ae80b2 --- /dev/null +++ b/patches/perfetto/.patches @@ -0,0 +1,2 @@ +revert_fix_chrome_roll_update_protoc_host_toolchain_rules.patch +revert_make_trace_processor_a_host-only_target.patch diff --git a/patches/perfetto/revert_fix_chrome_roll_update_protoc_host_toolchain_rules.patch b/patches/perfetto/revert_fix_chrome_roll_update_protoc_host_toolchain_rules.patch new file mode 100644 index 0000000000..0fb5d875f2 --- /dev/null +++ b/patches/perfetto/revert_fix_chrome_roll_update_protoc_host_toolchain_rules.patch @@ -0,0 +1,134 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: deepak1556 +Date: Wed, 11 Sep 2019 12:40:20 -0700 +Subject: Revert "Fix chrome roll: update protoc host toolchain rules" + +This reverts commit b7ebffd32830be65b752841d37de5455d84b42b8. + +diff --git a/gn/BUILD.gn b/gn/BUILD.gn +index a8aecc1ac1aa0af60df335fafeee56dff337a189..5ead1b50fb43047081b29fa55d5c0eda7a5c8142 100644 +--- a/gn/BUILD.gn ++++ b/gn/BUILD.gn +@@ -182,30 +182,28 @@ whitelisted_protobuf_full_deps = [ + "../src/trace_processor:trace_processor_shell", + ] + +-group("protoc") { +- public_deps = [ +- "${perfetto_protobuf_target_prefix}:protoc($host_toolchain)", +- ] +-} ++if (current_toolchain == host_toolchain) { ++ group("protoc") { ++ public_deps = [ ++ "${perfetto_protobuf_target_prefix}:protoc", ++ ] ++ } ++} # current_toolchain == host_toolchain + + # protoc compiler library, it's used for building protoc plugins and by + # trace_processor_shell to dynamically load .proto files for metrics. + group("protoc_lib") { + visibility = whitelisted_protobuf_full_deps +- if (current_toolchain == host_toolchain) { +- public_deps = [ +- "${perfetto_protobuf_target_prefix}:protoc_lib", +- ] +- } ++ public_deps = [ ++ "${perfetto_protobuf_target_prefix}:protoc_lib", ++ ] + } + + group("protobuf_full") { + visibility = whitelisted_protobuf_full_deps +- if (current_toolchain == host_toolchain) { +- public_deps = [ +- "${perfetto_protobuf_target_prefix}:protobuf_full", +- ] +- } ++ public_deps = [ ++ "${perfetto_protobuf_target_prefix}:protobuf_full", ++ ] + } + + group("protobuf_lite") { +diff --git a/gn/perfetto.gni b/gn/perfetto.gni +index 4bf62528336b5b6c8ce6eb932c18dcb6912422da..78aa3a63a677afc8789f58bb48e1dfac8a671eb9 100644 +--- a/gn/perfetto.gni ++++ b/gn/perfetto.gni +@@ -161,8 +161,7 @@ declare_args() { + + # Misc host executable under tools/. + enable_perfetto_tools = +- (perfetto_build_standalone && current_toolchain == host_toolchain) || +- perfetto_build_with_android ++ perfetto_build_standalone || perfetto_build_with_android + + # Allows to build the UI (TypeScript/ HTML / WASM) + enable_perfetto_ui = perfetto_build_standalone +diff --git a/tools/gen_android_bp b/tools/gen_android_bp +index 05a7d508bd51dc83f4b7039fccbb2b7415c0b208..f01e95d5de4bbfd1c8658bfbb6b7e061bfe6b632 100755 +--- a/tools/gen_android_bp ++++ b/tools/gen_android_bp +@@ -136,12 +136,23 @@ additional_args = { + def enable_gmock(module): + module.static_libs.append('libgmock') + ++ ++def enable_gtest_prod(module): ++ module.static_libs.append('libgtest_prod') ++ ++ ++def enable_gtest(module): ++ assert module.type == 'cc_test' ++ ++ + def enable_protobuf_full(module): + module.shared_libs.append('libprotobuf-cpp-full') + ++ + def enable_protobuf_lite(module): + module.shared_libs.append('libprotobuf-cpp-lite') + ++ + def enable_protoc_lib(module): + module.shared_libs.append('libprotoc') + +@@ -171,14 +182,16 @@ def enable_zlib(module): + # Android equivalents for third-party libraries that the upstream project + # depends on. + builtin_deps = { +- '//gn:gtest_and_gmock': enable_gmock, +- '//gn:libunwind': enable_libunwind, +- '//gn:protobuf_full': enable_protobuf_full, +- '//gn:protobuf_lite': enable_protobuf_lite, +- '//gn:protoc_lib': enable_protoc_lib, +- '//gn:libunwindstack': enable_libunwindstack, +- '//gn:sqlite': enable_sqlite, +- '//gn:zlib': enable_zlib, ++ '//buildtools:gmock': enable_gmock, ++ '//buildtools:gtest': enable_gtest, ++ '//buildtools:gtest_main': enable_gtest, ++ '//buildtools:libunwind': enable_libunwind, ++ '//buildtools:protobuf_full': enable_protobuf_full, ++ '//buildtools:protobuf_lite': enable_protobuf_lite, ++ '//buildtools:protoc_lib': enable_protoc_lib, ++ '//buildtools:libunwindstack': enable_libunwindstack, ++ '//buildtools:sqlite': enable_sqlite, ++ '//buildtools:zlib': enable_zlib, + } + + # ---------------------------------------------------------------------------- +@@ -401,10 +414,7 @@ def apply_module_dependency(blueprint, desc, module, dep_name): + dep_name: GN target of the dependency. + """ + # If the dependency refers to a library which we can replace with an Android +- # equivalent, stop recursing and patch the dependency in. Don't recurse into +- # //buildtools, builtin_deps are intercepted at the //gn:xxx level. +- if dep_name.startswith('//buildtools'): +- return ++ # equivalent, stop recursing and patch the dependency in. + if gn_utils.label_without_toolchain(dep_name) in builtin_deps: + builtin_deps[gn_utils.label_without_toolchain(dep_name)](module) + return diff --git a/patches/perfetto/revert_make_trace_processor_a_host-only_target.patch b/patches/perfetto/revert_make_trace_processor_a_host-only_target.patch new file mode 100644 index 0000000000..b6faad494a --- /dev/null +++ b/patches/perfetto/revert_make_trace_processor_a_host-only_target.patch @@ -0,0 +1,389 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: deepak1556 +Date: Wed, 11 Sep 2019 12:40:33 -0700 +Subject: Revert "Make trace_processor a host-only target" + +This reverts commit d0001c31122289ab00ca03dc493f622aeb8a2e81. + +diff --git a/Android.bp b/Android.bp +index 1d3c676bed57846207d68a5d1193991e688655c9..59eaefb7a4a91019eaf9c14d7c078d5aeb4073d5 100644 +--- a/Android.bp ++++ b/Android.bp +@@ -4660,7 +4660,7 @@ cc_test { + } + + // GN target: //src/trace_processor:trace_processor_shell +-cc_binary_host { ++cc_binary { + name: "trace_processor_shell", + srcs: [ + ":perfetto_protos_perfetto_common_zero_gen", +@@ -4783,12 +4783,10 @@ cc_binary_host { + ], + shared_libs: [ + "liblog", +- "libprotoc", ++ "libprotobuf-cpp-full", + "libz", + ], +- static_libs: [ +- "libsqlite", +- ], ++ host_supported: true, + generated_headers: [ + "gen_merged_sql_metrics", + "perfetto_protos_perfetto_common_zero_gen_headers", +@@ -4828,6 +4826,21 @@ cc_binary_host { + "-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", + "-DHAVE_HIDDEN", + ], ++ target: { ++ android: { ++ shared_libs: [ ++ "libandroidicu", ++ "liblog", ++ "libsqlite", ++ "libutils", ++ ], ++ }, ++ host: { ++ static_libs: [ ++ "libsqlite", ++ ], ++ }, ++ }, + } + + // GN target: //tools/trace_to_text:trace_to_text +diff --git a/buildtools/BUILD.gn b/buildtools/BUILD.gn +index 220fb8ba22d228b95c6b14247edebf54dc9db6c2..cdbdb6a5548df3e984bde1f5406767aa1accf97a 100644 +--- a/buildtools/BUILD.gn ++++ b/buildtools/BUILD.gn +@@ -273,111 +273,111 @@ source_set("protobuf_full") { + public_configs = [ ":protobuf_gen_config" ] + } + +-source_set("protoc_lib") { +- visibility = _buildtools_visibility +- deps = [ +- ":protobuf_full", +- "//gn:default_deps", +- ] +- sources = [ +- "protobuf/src/google/protobuf/compiler/code_generator.cc", +- "protobuf/src/google/protobuf/compiler/command_line_interface.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc", +- "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", +- "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", +- "protobuf/src/google/protobuf/compiler/java/java_context.cc", +- "protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc", +- "protobuf/src/google/protobuf/compiler/java/java_enum.cc", +- "protobuf/src/google/protobuf/compiler/java/java_enum_field.cc", +- "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc", +- "protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc", +- "protobuf/src/google/protobuf/compiler/java/java_extension.cc", +- "protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc", +- "protobuf/src/google/protobuf/compiler/java/java_field.cc", +- "protobuf/src/google/protobuf/compiler/java/java_file.cc", +- "protobuf/src/google/protobuf/compiler/java/java_generator.cc", +- "protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc", +- "protobuf/src/google/protobuf/compiler/java/java_helpers.cc", +- "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field.cc", +- "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc", +- "protobuf/src/google/protobuf/compiler/java/java_map_field.cc", +- "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc", +- "protobuf/src/google/protobuf/compiler/java/java_message.cc", +- "protobuf/src/google/protobuf/compiler/java/java_message_builder.cc", +- "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc", +- "protobuf/src/google/protobuf/compiler/java/java_message_field.cc", +- "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc", +- "protobuf/src/google/protobuf/compiler/java/java_message_lite.cc", +- "protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc", +- "protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc", +- "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc", +- "protobuf/src/google/protobuf/compiler/java/java_service.cc", +- "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc", +- "protobuf/src/google/protobuf/compiler/java/java_string_field.cc", +- "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_enum.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_extension.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_field.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_file.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_generator.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_helpers.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_message.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.cc", +- "protobuf/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", +- "protobuf/src/google/protobuf/compiler/js/js_generator.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", +- "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", +- "protobuf/src/google/protobuf/compiler/plugin.cc", +- "protobuf/src/google/protobuf/compiler/plugin.pb.cc", +- "protobuf/src/google/protobuf/compiler/python/python_generator.cc", +- "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc", +- "protobuf/src/google/protobuf/compiler/subprocess.cc", +- "protobuf/src/google/protobuf/compiler/zip_writer.cc", +- ] +- configs -= [ "//gn/standalone:extra_warnings" ] +- configs += [ ":protobuf_config" ] +- public_configs = [ ":protobuf_gen_config" ] +-} +- + if (current_toolchain == host_toolchain) { ++ source_set("protoc_lib") { ++ visibility = _buildtools_visibility ++ deps = [ ++ ":protobuf_full", ++ "//gn:default_deps", ++ ] ++ sources = [ ++ "protobuf/src/google/protobuf/compiler/code_generator.cc", ++ "protobuf/src/google/protobuf/compiler/command_line_interface.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc", ++ "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", ++ "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_context.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_enum.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_enum_field.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_extension.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_field.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_file.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_generator.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_helpers.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_map_field.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_message.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_message_builder.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_message_field.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_message_lite.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_service.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_string_field.cc", ++ "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_enum.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_extension.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_field.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_file.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_generator.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_helpers.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_message.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.cc", ++ "protobuf/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", ++ "protobuf/src/google/protobuf/compiler/js/js_generator.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", ++ "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", ++ "protobuf/src/google/protobuf/compiler/plugin.cc", ++ "protobuf/src/google/protobuf/compiler/plugin.pb.cc", ++ "protobuf/src/google/protobuf/compiler/python/python_generator.cc", ++ "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc", ++ "protobuf/src/google/protobuf/compiler/subprocess.cc", ++ "protobuf/src/google/protobuf/compiler/zip_writer.cc", ++ ] ++ configs -= [ "//gn/standalone:extra_warnings" ] ++ configs += [ ":protobuf_config" ] ++ public_configs = [ ":protobuf_gen_config" ] ++ } ++ + executable("protoc") { + visibility = _buildtools_visibility + deps = [ +diff --git a/gn/BUILD.gn b/gn/BUILD.gn +index 5ead1b50fb43047081b29fa55d5c0eda7a5c8142..529b4e24c5aa9532e4945c0826231ec60ce78b6d 100644 +--- a/gn/BUILD.gn ++++ b/gn/BUILD.gn +@@ -173,34 +173,23 @@ group("gtest_main") { + } + } + +-# Full protobuf is just for host tools .No binary shipped on device should +-# depend on this. +-whitelisted_protobuf_full_deps = [ +- "../tools/*", +- "../src/ipc/protoc_plugin:*", +- "../src/protozero/protoc_plugin:*", +- "../src/trace_processor:trace_processor_shell", +-] +- ++# protoc compiler library, for building protoc plugins on the host. + if (current_toolchain == host_toolchain) { ++ group("protoc_lib") { ++ public_deps = [ ++ "${perfetto_protobuf_target_prefix}:protoc_lib", ++ ] ++ } ++ + group("protoc") { + public_deps = [ + "${perfetto_protobuf_target_prefix}:protoc", + ] + } +-} # current_toolchain == host_toolchain +- +-# protoc compiler library, it's used for building protoc plugins and by +-# trace_processor_shell to dynamically load .proto files for metrics. +-group("protoc_lib") { +- visibility = whitelisted_protobuf_full_deps +- public_deps = [ +- "${perfetto_protobuf_target_prefix}:protoc_lib", +- ] + } + + group("protobuf_full") { +- visibility = whitelisted_protobuf_full_deps ++ testonly = true + public_deps = [ + "${perfetto_protobuf_target_prefix}:protobuf_full", + ] +diff --git a/src/trace_processor/BUILD.gn b/src/trace_processor/BUILD.gn +index 952dd65d9ad1c5f4d4ee0443007bfaf6110c8dfb..12e0d800b5673af1785e5a09e49847702442d2a1 100644 +--- a/src/trace_processor/BUILD.gn ++++ b/src/trace_processor/BUILD.gn +@@ -14,7 +14,6 @@ + + import("../../gn/fuzzer.gni") + import("../../gn/perfetto.gni") +-import("../../gn/perfetto_host_executable.gni") + import("../../gn/test.gni") + import("../../gn/wasm.gni") + +@@ -229,11 +228,12 @@ source_set("common") { + ] + } + +-perfetto_host_executable("trace_processor_shell") { ++executable("trace_processor_shell") { ++ testonly = true # We need this for proto full. + deps = [ + ":lib", + "../../gn:default_deps", +- "../../gn:protoc_lib", ++ "../../gn:protobuf_full", + "../base", + "metrics:lib", + ] +diff --git a/tools/gen_android_bp b/tools/gen_android_bp +index f01e95d5de4bbfd1c8658bfbb6b7e061bfe6b632..0d6b01a8cc838efda58634d21298243f2a649da8 100755 +--- a/tools/gen_android_bp ++++ b/tools/gen_android_bp +@@ -61,6 +61,11 @@ default_targets = [ + '//tools/trace_to_text:trace_to_text', + ] + ++# Targets which are testonly but should still be a cc_binary. ++non_test_binaries = [ ++ '//src/trace_processor:trace_processor_shell', ++] ++ + # Defines a custom init_rc argument to be applied to the corresponding output + # blueprint target. + target_initrc = { +@@ -70,11 +75,11 @@ target_initrc = { + + target_host_supported = [ + '//protos/perfetto/trace:perfetto_trace_protos', ++ '//src/trace_processor:trace_processor_shell', + ] + + target_host_only = [ + '//tools/trace_to_text:trace_to_text', +- '//src/trace_processor:trace_processor_shell', + ] + + # All module names are prefixed with this string to avoid collisions. +@@ -640,7 +645,7 @@ def create_modules_from_target(blueprint, desc, target_name): + if target['type'] == 'executable': + if 'host' in target['toolchain'] or target_name in target_host_only: + module_type = 'cc_binary_host' +- elif target.get('testonly'): ++ elif target.get('testonly') and target_name not in non_test_binaries: + module_type = 'cc_test' + else: + module_type = 'cc_binary' diff --git a/patches/v8/.patches b/patches/v8/.patches index 13d69fdada..386f0c15d2 100644 --- a/patches/v8/.patches +++ b/patches/v8/.patches @@ -6,3 +6,4 @@ dcheck.patch export_symbols_needed_for_windows_build.patch workaround_an_undefined_symbol_error.patch do_not_export_private_v8_symbols_on_windows.patch +revert_cleanup_switch_offset_of_to_offsetof_where_possible.patch diff --git a/patches/v8/add_realloc.patch b/patches/v8/add_realloc.patch index e750d23faa..45d904a2cc 100644 --- a/patches/v8/add_realloc.patch +++ b/patches/v8/add_realloc.patch @@ -12,10 +12,10 @@ when we override ReallocateBufferMemory, so we therefore need to implement Realloc on the v8 side. diff --git a/include/v8.h b/include/v8.h -index ca96c32088df3983c796a807b2ce76017e0fa2df..db972ab5ce249927d9f6e738263600c30c2e176c 100644 +index 24052f25bf7499743d1bf59846325274c3fd81c0..c5f0436eb771b6ca86fdf8e0dc195221c6b481f4 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -4651,6 +4651,13 @@ class V8_EXPORT ArrayBuffer : public Object { +@@ -4748,6 +4748,13 @@ class V8_EXPORT ArrayBuffer : public Object { */ virtual void* AllocateUninitialized(size_t length) = 0; @@ -30,10 +30,10 @@ index ca96c32088df3983c796a807b2ce76017e0fa2df..db972ab5ce249927d9f6e738263600c3 * Free the memory block of size |length|, pointed to by |data|. * That memory is guaranteed to be previously allocated by |Allocate|. diff --git a/src/api/api.cc b/src/api/api.cc -index e02c74416b81c67e2bcdfa6bca5d06efd261153a..c41692ca40057efa39440239cda217ae1e39afe8 100644 +index b03cc11532e0ec1d0e047bd794d15416cb343670..e9e46fd117dbf67a0fb7bdf560e152daa8624ff8 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -507,6 +507,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { +@@ -518,6 +518,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { i::V8::SetSnapshotBlob(snapshot_blob); } diff --git a/patches/v8/build_gn.patch b/patches/v8/build_gn.patch index d657216eb0..3f28cc3615 100644 --- a/patches/v8/build_gn.patch +++ b/patches/v8/build_gn.patch @@ -5,10 +5,10 @@ Subject: build_gn.patch diff --git a/BUILD.gn b/BUILD.gn -index c4dbe902d8bc2b7fd9f41af3e4920ce4cdd8257b..a8fd0b407b6519db82b3599a8d77bb415e0c9c86 100644 +index 7e683f86e529316f923b8ff2b6fe5ed94f22420a..b0e242d6c369185172184c1f4a88247aa1e0896c 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -271,7 +271,7 @@ config("internal_config") { +@@ -284,7 +284,7 @@ config("internal_config") { ":v8_header_features", ] @@ -17,7 +17,7 @@ index c4dbe902d8bc2b7fd9f41af3e4920ce4cdd8257b..a8fd0b407b6519db82b3599a8d77bb41 defines += [ "BUILDING_V8_SHARED" ] } } -@@ -3784,7 +3784,7 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -3834,7 +3834,7 @@ if (current_toolchain == v8_generator_toolchain) { "src/interpreter/bytecodes.h", ] @@ -26,7 +26,7 @@ index c4dbe902d8bc2b7fd9f41af3e4920ce4cdd8257b..a8fd0b407b6519db82b3599a8d77bb41 deps = [ ":v8_libbase", -@@ -3815,6 +3815,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { +@@ -3865,6 +3865,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { configs = [ ":internal_config" ] diff --git a/patches/v8/dcheck.patch b/patches/v8/dcheck.patch index f083f6c8da..9502b62a0e 100644 --- a/patches/v8/dcheck.patch +++ b/patches/v8/dcheck.patch @@ -5,10 +5,10 @@ Subject: dcheck.patch diff --git a/src/api/api.cc b/src/api/api.cc -index 848a692d963720a30265f210ebd20159cb3e955a..2750ef2bcddfea8a6ddd5cbadb1ae88df7b5d639 100644 +index 11ca1064085568986b8d21250dd8617f0d03f652..39dc796b72553259b167721a4fd51f3f51ef1358 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -8311,7 +8311,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { +@@ -8501,7 +8501,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { } void Isolate::RunMicrotasks() { @@ -18,10 +18,10 @@ index 848a692d963720a30265f210ebd20159cb3e955a..2750ef2bcddfea8a6ddd5cbadb1ae88d isolate->default_microtask_queue()->RunMicrotasks(isolate); } diff --git a/src/heap/heap.cc b/src/heap/heap.cc -index 7feb1c11ba90cb5896d85e9bdd9b693a6f9ee788..cc80dfb9af080539c01bdb3b201cd3554534bbc6 100644 +index 92265dd7665887cea46be407180e42de4985f8fd..4268f289c22953c386e28ed3968bedf80e595914 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc -@@ -5311,9 +5311,9 @@ void Heap::TearDown() { +@@ -5312,9 +5312,9 @@ void Heap::TearDown() { void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback, GCType gc_type, void* data) { DCHECK_NOT_NULL(callback); diff --git a/patches/v8/deps_provide_more_v8_backwards_compatibility.patch b/patches/v8/deps_provide_more_v8_backwards_compatibility.patch index e9d836e6f8..098d78aa45 100644 --- a/patches/v8/deps_provide_more_v8_backwards_compatibility.patch +++ b/patches/v8/deps_provide_more_v8_backwards_compatibility.patch @@ -22,10 +22,10 @@ Reviewed-By: Yang Guo Reviewed-By: Michaël Zasso diff --git a/include/v8.h b/include/v8.h -index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52c4b18b4c 100644 +index c5f0436eb771b6ca86fdf8e0dc195221c6b481f4..4c93d92fe36c6712a239c47e42bcb2cb6992cb57 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -1108,6 +1108,10 @@ class V8_EXPORT PrimitiveArray { +@@ -1195,6 +1195,10 @@ class V8_EXPORT PrimitiveArray { public: static Local New(Isolate* isolate, int length); int Length() const; @@ -36,7 +36,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 void Set(Isolate* isolate, int index, Local item); Local Get(Isolate* isolate, int index); }; -@@ -1848,6 +1852,8 @@ class V8_EXPORT StackTrace { +@@ -1935,6 +1939,8 @@ class V8_EXPORT StackTrace { /** * Returns a StackFrame at a particular index. */ @@ -45,7 +45,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 Local GetFrame(Isolate* isolate, uint32_t index) const; /** -@@ -2541,6 +2547,13 @@ class V8_EXPORT Value : public Data { +@@ -2629,6 +2635,13 @@ class V8_EXPORT Value : public Data { Local ToBoolean(Isolate* isolate) const; @@ -59,7 +59,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 /** * Attempts to convert a string to an array index. * Returns an empty handle if the conversion fails. -@@ -2557,7 +2570,14 @@ class V8_EXPORT Value : public Data { +@@ -2645,7 +2658,14 @@ class V8_EXPORT Value : public Data { Local context) const; V8_WARN_UNUSED_RESULT Maybe Int32Value(Local context) const; @@ -74,7 +74,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 V8_WARN_UNUSED_RESULT Maybe Equals(Local context, Local that) const; bool StrictEquals(Local that) const; -@@ -2664,6 +2684,8 @@ class V8_EXPORT String : public Name { +@@ -2752,6 +2772,8 @@ class V8_EXPORT String : public Name { * Returns the number of bytes in the UTF-8 encoded * representation of this string. */ @@ -83,7 +83,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 int Utf8Length(Isolate* isolate) const; /** -@@ -2720,12 +2742,23 @@ class V8_EXPORT String : public Name { +@@ -2808,12 +2830,23 @@ class V8_EXPORT String : public Name { // 16-bit character codes. int Write(Isolate* isolate, uint16_t* buffer, int start = 0, int length = -1, int options = NO_OPTIONS) const; @@ -107,7 +107,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 /** * A zero length string. -@@ -2893,6 +2926,9 @@ class V8_EXPORT String : public Name { +@@ -2981,6 +3014,9 @@ class V8_EXPORT String : public Name { */ static Local Concat(Isolate* isolate, Local left, Local right); @@ -117,7 +117,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 /** * Creates a new external string using the data defined in the given -@@ -2957,6 +2993,8 @@ class V8_EXPORT String : public Name { +@@ -3045,6 +3081,8 @@ class V8_EXPORT String : public Name { */ class V8_EXPORT Utf8Value { public: @@ -126,7 +126,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 Utf8Value(Isolate* isolate, Local obj); ~Utf8Value(); char* operator*() { return str_; } -@@ -2980,6 +3018,7 @@ class V8_EXPORT String : public Name { +@@ -3068,6 +3106,7 @@ class V8_EXPORT String : public Name { */ class V8_EXPORT Value { public: @@ -134,7 +134,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 Value(Isolate* isolate, Local obj); ~Value(); uint16_t* operator*() { return str_; } -@@ -5308,6 +5347,8 @@ class V8_EXPORT BooleanObject : public Object { +@@ -5407,6 +5446,8 @@ class V8_EXPORT BooleanObject : public Object { class V8_EXPORT StringObject : public Object { public: static Local New(Isolate* isolate, Local value); @@ -143,7 +143,7 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 Local ValueOf() const; -@@ -10496,6 +10537,29 @@ template Value* Value::Cast(T* value) { +@@ -10741,6 +10782,29 @@ template Value* Value::Cast(T* value) { } @@ -174,10 +174,10 @@ index db972ab5ce249927d9f6e738263600c30c2e176c..ae41288f4188a81458ad2503b75fae52 #ifdef V8_ENABLE_CHECKS CheckCast(value); diff --git a/src/api/api.cc b/src/api/api.cc -index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159cb3e955a 100644 +index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f0d03f652 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -2184,6 +2184,10 @@ int PrimitiveArray::Length() const { +@@ -2206,6 +2206,10 @@ int PrimitiveArray::Length() const { return array->length(); } @@ -188,7 +188,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 void PrimitiveArray::Set(Isolate* v8_isolate, int index, Local item) { i::Isolate* isolate = reinterpret_cast(v8_isolate); -@@ -2197,6 +2201,10 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index, +@@ -2219,6 +2223,10 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index, array->set(index, *i_item); } @@ -199,7 +199,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 Local PrimitiveArray::Get(Isolate* v8_isolate, int index) { i::Isolate* isolate = reinterpret_cast(v8_isolate); i::Handle array = Utils::OpenHandle(this); -@@ -2937,6 +2945,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) { +@@ -2960,6 +2968,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) { // --- S t a c k T r a c e --- @@ -210,7 +210,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 Local StackTrace::GetFrame(Isolate* v8_isolate, uint32_t index) const { i::Isolate* isolate = reinterpret_cast(v8_isolate); -@@ -3524,6 +3536,34 @@ MaybeLocal Value::ToBigInt(Local context) const { +@@ -3547,6 +3559,34 @@ MaybeLocal Value::ToBigInt(Local context) const { RETURN_ESCAPED(result); } @@ -245,7 +245,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 bool Value::BooleanValue(Isolate* v8_isolate) const { return Utils::OpenHandle(this)->BooleanValue( reinterpret_cast(v8_isolate)); -@@ -3871,6 +3911,11 @@ MaybeLocal Value::ToArrayIndex(Local context) const { +@@ -3894,6 +3934,11 @@ MaybeLocal Value::ToArrayIndex(Local context) const { return Local(); } @@ -257,7 +257,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 Maybe Value::Equals(Local context, Local that) const { i::Isolate* isolate = Utils::OpenHandle(*context)->GetIsolate(); auto self = Utils::OpenHandle(this); -@@ -5083,6 +5128,10 @@ bool String::ContainsOnlyOneByte() const { +@@ -5111,6 +5156,10 @@ bool String::ContainsOnlyOneByte() const { return helper.Check(*str); } @@ -268,7 +268,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 int String::Utf8Length(Isolate* isolate) const { i::Handle str = Utils::OpenHandle(this); str = i::String::Flatten(reinterpret_cast(isolate), str); -@@ -5235,6 +5284,14 @@ static int WriteUtf8Impl(i::Vector string, char* write_start, +@@ -5263,6 +5312,14 @@ static int WriteUtf8Impl(i::Vector string, char* write_start, } } // anonymous namespace @@ -283,7 +283,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 int String::WriteUtf8(Isolate* v8_isolate, char* buffer, int capacity, int* nchars_ref, int options) const { i::Handle str = Utils::OpenHandle(this); -@@ -5273,6 +5330,17 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string, +@@ -5301,6 +5358,17 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string, return end - start; } @@ -301,7 +301,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 int String::WriteOneByte(Isolate* isolate, uint8_t* buffer, int start, int length, int options) const { return WriteHelper(reinterpret_cast(isolate), this, buffer, -@@ -6190,6 +6258,11 @@ MaybeLocal String::NewFromTwoByte(Isolate* isolate, +@@ -6218,6 +6286,11 @@ MaybeLocal String::NewFromTwoByte(Isolate* isolate, return result; } @@ -313,7 +313,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 Local v8::String::Concat(Isolate* v8_isolate, Local left, Local right) { i::Isolate* isolate = reinterpret_cast(v8_isolate); -@@ -6460,6 +6533,10 @@ bool v8::BooleanObject::ValueOf() const { +@@ -6488,6 +6561,10 @@ bool v8::BooleanObject::ValueOf() const { return js_primitive_wrapper->value().IsTrue(isolate); } @@ -324,7 +324,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 Local v8::StringObject::New(Isolate* v8_isolate, Local value) { i::Handle string = Utils::OpenHandle(*value); -@@ -8672,6 +8749,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8_isolate) { +@@ -8874,6 +8951,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8_isolate) { return microtask_queue->IsRunningMicrotasks(); } @@ -334,7 +334,7 @@ index c41692ca40057efa39440239cda217ae1e39afe8..848a692d963720a30265f210ebd20159 String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local obj) : str_(nullptr), length_(0) { if (obj.IsEmpty()) return; -@@ -8689,6 +8769,9 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local obj) +@@ -8891,6 +8971,9 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local obj) String::Utf8Value::~Utf8Value() { i::DeleteArray(str_); } diff --git a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch index f1bbce778e..91d3c1564a 100644 --- a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch +++ b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch @@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not contain any standard C++ library exports (e.g. `std::ostringstream`). diff --git a/BUILD.gn b/BUILD.gn -index a016ebcbf46316e57c9ec9f64cec0cc8af3fb847..bee77efc1d575fc9cfdf18a1976f741ddfc8757e 100644 +index 62d1548a10e367795ec3d649fe1cf112b278ec19..8d49e29cb4ab4d7d3373cef20e9033b0ac4ca07a 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -271,6 +271,10 @@ config("internal_config") { +@@ -284,6 +284,10 @@ config("internal_config") { ":v8_header_features", ] @@ -27,10 +27,10 @@ index a016ebcbf46316e57c9ec9f64cec0cc8af3fb847..bee77efc1d575fc9cfdf18a1976f741d defines += [ "BUILDING_V8_SHARED" ] } diff --git a/src/base/macros.h b/src/base/macros.h -index ad70e9820ddb4a63639ca7738c1836cb87766db5..d40be9b57294583f74594d88d9b7d7b937b2db3c 100644 +index 329c5a90636aa5ef587c743ed20b56c2c2195037..1d43c165341fcf089bf8d5566394d1b80d3c8b22 100644 --- a/src/base/macros.h +++ b/src/base/macros.h -@@ -414,13 +414,17 @@ bool is_inbounds(float_t v) { +@@ -395,13 +395,17 @@ bool is_inbounds(float_t v) { #ifdef V8_OS_WIN // Setup for Windows shared library export. diff --git a/patches/v8/export_symbols_needed_for_windows_build.patch b/patches/v8/export_symbols_needed_for_windows_build.patch index 000d8ee1aa..4a01d11615 100644 --- a/patches/v8/export_symbols_needed_for_windows_build.patch +++ b/patches/v8/export_symbols_needed_for_windows_build.patch @@ -6,10 +6,10 @@ Subject: Export symbols needed for Windows build These symbols are required to build v8 with BUILD_V8_SHARED on Windows. diff --git a/src/objects/objects.h b/src/objects/objects.h -index d706b2dfb7b51adcc3e8d85e17e9e7376af52ba6..c2889dc332c6de4f41eb02d1d91198edad4f79a8 100644 +index b4e78a19377df73051c2e6e650d5b654ca435c6b..93de4136f2a0498038d17866f99f72ea8e217b2f 100644 --- a/src/objects/objects.h +++ b/src/objects/objects.h -@@ -794,7 +794,7 @@ enum class KeyCollectionMode { +@@ -796,7 +796,7 @@ enum class KeyCollectionMode { // Utility superclass for stack-allocated objects that must be updated // on gc. It provides two ways for the gc to update instances, either // iterating or updating after gc. @@ -19,7 +19,7 @@ index d706b2dfb7b51adcc3e8d85e17e9e7376af52ba6..c2889dc332c6de4f41eb02d1d91198ed explicit inline Relocatable(Isolate* isolate); inline virtual ~Relocatable(); diff --git a/src/objects/ordered-hash-table.h b/src/objects/ordered-hash-table.h -index 66dc36e81fce469d8cf07abe70f827737a9b61e4..d1838ce6df18b99a8476b7b4fc705e786e031fdf 100644 +index 21decaeba72246ef95be0f031c605c7f840715b1..d661a11cf48f51eb6080cc086a7a26b4bd497cae 100644 --- a/src/objects/ordered-hash-table.h +++ b/src/objects/ordered-hash-table.h @@ -60,7 +60,7 @@ namespace internal { diff --git a/patches/v8/expose_mksnapshot.patch b/patches/v8/expose_mksnapshot.patch index e3358d0bcc..5c832f8d4a 100644 --- a/patches/v8/expose_mksnapshot.patch +++ b/patches/v8/expose_mksnapshot.patch @@ -6,10 +6,10 @@ Subject: expose_mksnapshot.patch Needed in order to target mksnapshot for mksnapshot zip. diff --git a/BUILD.gn b/BUILD.gn -index a8fd0b407b6519db82b3599a8d77bb415e0c9c86..a016ebcbf46316e57c9ec9f64cec0cc8af3fb847 100644 +index b0e242d6c369185172184c1f4a88247aa1e0896c..62d1548a10e367795ec3d649fe1cf112b278ec19 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -3795,7 +3795,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -3845,7 +3845,6 @@ if (current_toolchain == v8_generator_toolchain) { if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { diff --git a/patches/v8/revert_cleanup_switch_offset_of_to_offsetof_where_possible.patch b/patches/v8/revert_cleanup_switch_offset_of_to_offsetof_where_possible.patch new file mode 100644 index 0000000000..1f2f986115 --- /dev/null +++ b/patches/v8/revert_cleanup_switch_offset_of_to_offsetof_where_possible.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jeremy Apthorp +Date: Tue, 17 Sep 2019 18:35:16 +0000 +Subject: Revert "[cleanup] Switch {OFFSET_OF} to {offsetof} where possible." + +This reverts commit d287e4bc46243841c77cf9798516ee4dcc54bf43. + +diff --git a/src/deoptimizer/deoptimizer.h b/src/deoptimizer/deoptimizer.h +index beb2a9aa50e82640417ae0326f84faab3a0610a5..6d0a350aaceb59fa6486d41566ad22ee3fbe1bdd 100644 +--- a/src/deoptimizer/deoptimizer.h ++++ b/src/deoptimizer/deoptimizer.h +@@ -488,14 +488,14 @@ class Deoptimizer : public Malloced { + DeoptimizeKind* type); + + // Code generation support. +- static int input_offset() { return offsetof(Deoptimizer, input_); } ++ static int input_offset() { return OFFSET_OF(Deoptimizer, input_); } + static int output_count_offset() { +- return offsetof(Deoptimizer, output_count_); ++ return OFFSET_OF(Deoptimizer, output_count_); + } +- static int output_offset() { return offsetof(Deoptimizer, output_); } ++ static int output_offset() { return OFFSET_OF(Deoptimizer, output_); } + + static int caller_frame_top_offset() { +- return offsetof(Deoptimizer, caller_frame_top_); ++ return OFFSET_OF(Deoptimizer, caller_frame_top_); + } + + V8_EXPORT_PRIVATE static int GetDeoptimizedCodeCount(Isolate* isolate); +@@ -731,11 +731,11 @@ class FrameDescription { + int parameter_count() { return parameter_count_; } + + static int registers_offset() { +- return offsetof(FrameDescription, register_values_.registers_); ++ return OFFSET_OF(FrameDescription, register_values_.registers_); + } + + static int double_registers_offset() { +- return offsetof(FrameDescription, register_values_.double_registers_); ++ return OFFSET_OF(FrameDescription, register_values_.double_registers_); + } + + static int frame_size_offset() { diff --git a/patches/v8/workaround_an_undefined_symbol_error.patch b/patches/v8/workaround_an_undefined_symbol_error.patch index b73a94213f..c082c66707 100644 --- a/patches/v8/workaround_an_undefined_symbol_error.patch +++ b/patches/v8/workaround_an_undefined_symbol_error.patch @@ -12,10 +12,10 @@ By moving some functions out of the the arm64-assembler header file, this error no longer seems to happen. diff --git a/src/codegen/arm64/assembler-arm64.cc b/src/codegen/arm64/assembler-arm64.cc -index 159e763ba2602639b4499af7b7869ead58b267d4..ac529e78a8a6ae8cffb0fef26e4bce9f258517ee 100644 +index c798d3a8a03ed9ed49c4562ef3968fae38c55fbe..7369b80c0762bc86d7e763674479bbd426c0a1fa 100644 --- a/src/codegen/arm64/assembler-arm64.cc +++ b/src/codegen/arm64/assembler-arm64.cc -@@ -3564,6 +3564,22 @@ void Assembler::MoveWide(const Register& rd, uint64_t imm, int shift, +@@ -3589,6 +3589,22 @@ void Assembler::MoveWide(const Register& rd, uint64_t imm, int shift, ImmMoveWide(static_cast(imm)) | ShiftMoveWide(shift)); } @@ -39,10 +39,10 @@ index 159e763ba2602639b4499af7b7869ead58b267d4..ac529e78a8a6ae8cffb0fef26e4bce9f const Operand& operand, FlagsUpdate S, AddSubOp op) { DCHECK_EQ(rd.SizeInBits(), rn.SizeInBits()); diff --git a/src/codegen/arm64/assembler-arm64.h b/src/codegen/arm64/assembler-arm64.h -index 6a6bf633c13ec6d94bbc145eae6daa9ce0d9b2ce..42a77d305b17ffaac6fd3f07c5290c1d61f31065 100644 +index 10542a278db27660ec2dc4650f74653f46139c65..44b679cdf6e08297d77cdbe1224dd861a24e2f17 100644 --- a/src/codegen/arm64/assembler-arm64.h +++ b/src/codegen/arm64/assembler-arm64.h -@@ -2079,11 +2079,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { +@@ -2099,11 +2099,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { return rm.code() << Rm_offset; } @@ -55,7 +55,7 @@ index 6a6bf633c13ec6d94bbc145eae6daa9ce0d9b2ce..42a77d305b17ffaac6fd3f07c5290c1d static Instr Ra(CPURegister ra) { DCHECK_NE(ra.code(), kSPRegInternalCode); -@@ -2107,15 +2103,8 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { +@@ -2127,15 +2123,8 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { // These encoding functions allow the stack pointer to be encoded, and // disallow the zero register. diff --git a/shell/app/node_main.cc b/shell/app/node_main.cc index d2511da2f3..c37660e794 100644 --- a/shell/app/node_main.cc +++ b/shell/app/node_main.cc @@ -10,7 +10,7 @@ #include "base/command_line.h" #include "base/feature_list.h" -#include "base/task/thread_pool/thread_pool.h" +#include "base/task/thread_pool/thread_pool_instance.h" #include "base/threading/thread_task_runner_handle.h" #include "electron/electron_version.h" #include "gin/array_buffer.h" diff --git a/shell/browser/api/atom_api_browser_window.cc b/shell/browser/api/atom_api_browser_window.cc index 85a4c77b32..1728302521 100644 --- a/shell/browser/api/atom_api_browser_window.cc +++ b/shell/browser/api/atom_api_browser_window.cc @@ -396,8 +396,8 @@ std::unique_ptr BrowserWindow::DraggableRegionsToSkRegion( auto sk_region = std::make_unique(); for (const auto& region : regions) { sk_region->op( - region->bounds.x(), region->bounds.y(), region->bounds.right(), - region->bounds.bottom(), + {region->bounds.x(), region->bounds.y(), region->bounds.right(), + region->bounds.bottom()}, region->draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); } return sk_region; diff --git a/shell/browser/api/atom_api_browser_window_mac.mm b/shell/browser/api/atom_api_browser_window_mac.mm index 6ff670738e..08dd00ed62 100644 --- a/shell/browser/api/atom_api_browser_window_mac.mm +++ b/shell/browser/api/atom_api_browser_window_mac.mm @@ -47,7 +47,7 @@ std::vector CalculateNonDraggableRegions( int height) { std::vector result; SkRegion non_draggable; - non_draggable.op(0, 0, width, height, SkRegion::kUnion_Op); + non_draggable.op({0, 0, width, height}, SkRegion::kUnion_Op); non_draggable.op(*draggable, SkRegion::kDifference_Op); for (SkRegion::Iterator it(non_draggable); !it.done(); it.next()) { result.push_back(gfx::SkIRectToRect(it.rect())); diff --git a/shell/browser/api/atom_api_content_tracing.cc b/shell/browser/api/atom_api_content_tracing.cc index 537228b5f3..e780ae2d7a 100644 --- a/shell/browser/api/atom_api_content_tracing.cc +++ b/shell/browser/api/atom_api_content_tracing.cc @@ -88,8 +88,10 @@ v8::Local StopRecording(mate::Arguments* args) { StopTracing(std::move(promise), base::make_optional(path)); } else { // use a temporary file. - base::PostTaskWithTraitsAndReplyWithResult( - FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, + base::PostTaskAndReplyWithResult( + FROM_HERE, + {base::ThreadPool(), base::MayBlock(), + base::TaskPriority::USER_VISIBLE}, base::BindOnce(CreateTemporaryFileOnIO), base::BindOnce(StopTracing, std::move(promise))); } diff --git a/shell/browser/api/atom_api_cookies.cc b/shell/browser/api/atom_api_cookies.cc index 855ca78346..7d141ac861 100644 --- a/shell/browser/api/atom_api_cookies.cc +++ b/shell/browser/api/atom_api_cookies.cc @@ -135,25 +135,25 @@ void FilterCookies(const base::Value& filter, std::string InclusionStatusToString( net::CanonicalCookie::CookieInclusionStatus status) { - switch (status) { - case net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_HTTP_ONLY: - return "Failed to create httponly cookie"; - case net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_SECURE_ONLY: - return "Cannot create a secure cookie from an insecure URL"; - case net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_FAILURE_TO_STORE: - return "Failed to parse cookie"; - case net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_INVALID_DOMAIN: - return "Failed to get cookie domain"; - case net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_INVALID_PREFIX: - return "Failed because the cookie violated prefix rules."; - case net::CanonicalCookie::CookieInclusionStatus:: - EXCLUDE_NONCOOKIEABLE_SCHEME: - return "Cannot set cookie for current scheme"; - case net::CanonicalCookie::CookieInclusionStatus::INCLUDE: - return ""; - default: - return "Setting cookie failed"; - } + if (status.HasExclusionReason( + net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_HTTP_ONLY)) + return "Failed to create httponly cookie"; + if (status.HasExclusionReason( + net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_SECURE_ONLY)) + return "Cannot create a secure cookie from an insecure URL"; + if (status.HasExclusionReason(net::CanonicalCookie::CookieInclusionStatus:: + EXCLUDE_FAILURE_TO_STORE)) + return "Failed to parse cookie"; + if (status.HasExclusionReason( + net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_INVALID_DOMAIN)) + return "Failed to get cookie domain"; + if (status.HasExclusionReason( + net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_INVALID_PREFIX)) + return "Failed because the cookie violated prefix rules."; + if (status.HasExclusionReason(net::CanonicalCookie::CookieInclusionStatus:: + EXCLUDE_NONCOOKIEABLE_SCHEME)) + return "Cannot set cookie for current scheme"; + return "Setting cookie failed"; } } // namespace @@ -248,14 +248,18 @@ v8::Local Cookies::Set(const base::DictionaryValue& details) { GURL url(url_string ? *url_string : ""); if (!url.is_valid()) { - promise.RejectWithErrorMessage(InclusionStatusToString( - net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_INVALID_DOMAIN)); + promise.RejectWithErrorMessage( + InclusionStatusToString(net::CanonicalCookie::CookieInclusionStatus( + net::CanonicalCookie::CookieInclusionStatus:: + EXCLUDE_INVALID_DOMAIN))); return handle; } if (!name || name->empty()) { - promise.RejectWithErrorMessage(InclusionStatusToString( - net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_FAILURE_TO_STORE)); + promise.RejectWithErrorMessage( + InclusionStatusToString(net::CanonicalCookie::CookieInclusionStatus( + net::CanonicalCookie::CookieInclusionStatus:: + EXCLUDE_FAILURE_TO_STORE))); return handle; } @@ -264,8 +268,10 @@ v8::Local Cookies::Set(const base::DictionaryValue& details) { creation_time, expiration_time, last_access_time, secure, http_only, net::CookieSameSite::NO_RESTRICTION, net::COOKIE_PRIORITY_DEFAULT); if (!canonical_cookie || !canonical_cookie->IsCanonical()) { - promise.RejectWithErrorMessage(InclusionStatusToString( - net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_FAILURE_TO_STORE)); + promise.RejectWithErrorMessage( + InclusionStatusToString(net::CanonicalCookie::CookieInclusionStatus( + net::CanonicalCookie::CookieInclusionStatus:: + EXCLUDE_FAILURE_TO_STORE))); return handle; } net::CookieOptions options; @@ -281,11 +287,10 @@ v8::Local Cookies::Set(const base::DictionaryValue& details) { base::BindOnce( [](util::Promise promise, net::CanonicalCookie::CookieInclusionStatus status) { - auto errmsg = InclusionStatusToString(status); - if (errmsg.empty()) { + if (status.IsInclude()) { promise.Resolve(); } else { - promise.RejectWithErrorMessage(errmsg); + promise.RejectWithErrorMessage(InclusionStatusToString(status)); } }, std::move(promise))); diff --git a/shell/browser/api/atom_api_data_pipe_holder.cc b/shell/browser/api/atom_api_data_pipe_holder.cc index 93fb5383d2..b26783a7a0 100644 --- a/shell/browser/api/atom_api_data_pipe_holder.cc +++ b/shell/browser/api/atom_api_data_pipe_holder.cc @@ -33,7 +33,7 @@ KeyWeakMap g_weak_map; class DataPipeReader { public: DataPipeReader(util::Promise> promise, - network::mojom::DataPipeGetterPtr data_pipe_getter) + mojo::Remote data_pipe_getter) : promise_(std::move(promise)), data_pipe_getter_(std::move(data_pipe_getter)), handle_watcher_(FROM_HERE, @@ -109,7 +109,7 @@ class DataPipeReader { // Destroy data pipe. handle_watcher_.Cancel(); data_pipe_.reset(); - data_pipe_getter_ = nullptr; + data_pipe_getter_.reset(); } static void FreeBuffer(char* data, void* self) { @@ -118,7 +118,7 @@ class DataPipeReader { util::Promise> promise_; - network::mojom::DataPipeGetterPtr data_pipe_getter_; + mojo::Remote data_pipe_getter_; mojo::ScopedDataPipeConsumerHandle data_pipe_; mojo::SimpleWatcher handle_watcher_; @@ -141,8 +141,9 @@ class DataPipeReader { gin::WrapperInfo DataPipeHolder::kWrapperInfo = {gin::kEmbedderNativeGin}; DataPipeHolder::DataPipeHolder(const network::DataElement& element) - : id_(base::NumberToString(++g_next_id)), - data_pipe_(element.CloneDataPipeGetter()) {} + : id_(base::NumberToString(++g_next_id)) { + data_pipe_.Bind(element.CloneDataPipeGetter()); +} DataPipeHolder::~DataPipeHolder() = default; diff --git a/shell/browser/api/atom_api_data_pipe_holder.h b/shell/browser/api/atom_api_data_pipe_holder.h index 991cf75317..877753ca84 100644 --- a/shell/browser/api/atom_api_data_pipe_holder.h +++ b/shell/browser/api/atom_api_data_pipe_holder.h @@ -9,6 +9,7 @@ #include "gin/handle.h" #include "gin/wrappable.h" +#include "mojo/public/cpp/bindings/remote.h" #include "services/network/public/cpp/data_element.h" #include "services/network/public/mojom/data_pipe_getter.mojom.h" @@ -41,7 +42,7 @@ class DataPipeHolder : public gin::Wrappable { ~DataPipeHolder() override; std::string id_; - network::mojom::DataPipeGetterPtr data_pipe_; + mojo::Remote data_pipe_; DISALLOW_COPY_AND_ASSIGN(DataPipeHolder); }; diff --git a/shell/browser/api/atom_api_native_theme.cc b/shell/browser/api/atom_api_native_theme.cc index c3b6375ab2..195e56f020 100644 --- a/shell/browser/api/atom_api_native_theme.cc +++ b/shell/browser/api/atom_api_native_theme.cc @@ -34,10 +34,9 @@ void NativeTheme::OnNativeThemeUpdatedOnUI() { } void NativeTheme::OnNativeThemeUpdated(ui::NativeTheme* theme) { - base::PostTaskWithTraits( - FROM_HERE, {content::BrowserThread::UI}, - base::BindOnce(&NativeTheme::OnNativeThemeUpdatedOnUI, - base::Unretained(this))); + base::PostTask(FROM_HERE, {content::BrowserThread::UI}, + base::BindOnce(&NativeTheme::OnNativeThemeUpdatedOnUI, + base::Unretained(this))); } void NativeTheme::SetThemeSource(ui::NativeTheme::ThemeSource override) { diff --git a/shell/browser/api/atom_api_net_log.cc b/shell/browser/api/atom_api_net_log.cc index a30c2f4eb4..5400089f4f 100644 --- a/shell/browser/api/atom_api_net_log.cc +++ b/shell/browser/api/atom_api_net_log.cc @@ -53,8 +53,8 @@ scoped_refptr CreateFileTaskRunner() { // // These operations can be skipped on shutdown since FileNetLogObserver's API // doesn't require things to have completed until notified of completion. - return base::CreateSequencedTaskRunnerWithTraits( - {base::MayBlock(), base::TaskPriority::USER_VISIBLE, + return base::CreateSequencedTaskRunner( + {base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); } diff --git a/shell/browser/api/atom_api_session.cc b/shell/browser/api/atom_api_session.cc index 688d4a217a..78eb4bc628 100644 --- a/shell/browser/api/atom_api_session.cc +++ b/shell/browser/api/atom_api_session.cc @@ -30,7 +30,8 @@ #include "content/public/browser/download_manager_delegate.h" #include "content/public/browser/network_service_instance.h" #include "content/public/browser/storage_partition.h" -#include "mojo/public/cpp/bindings/strong_binding.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "native_mate/dictionary.h" #include "native_mate/object_template_builder.h" #include "net/base/completion_repeating_callback.h" @@ -401,14 +402,16 @@ void Session::SetCertVerifyProc(v8::Local val, return; } - network::mojom::CertVerifierClientPtr cert_verifier_client; + mojo::PendingRemote + cert_verifier_client_remote; if (proc) { - mojo::MakeStrongBinding(std::make_unique(proc), - mojo::MakeRequest(&cert_verifier_client)); + mojo::MakeSelfOwnedReceiver( + std::make_unique(proc), + cert_verifier_client_remote.InitWithNewPipeAndPassReceiver()); } content::BrowserContext::GetDefaultStoragePartition(browser_context_.get()) ->GetNetworkContext() - ->SetCertVerifierClient(std::move(cert_verifier_client)); + ->SetCertVerifierClient(std::move(cert_verifier_client_remote)); // This causes the cert verifier cache to be cleared. content::GetNetworkService()->OnCertDBChanged(); @@ -637,7 +640,7 @@ void Session::Preconnect(const mate::Dictionary& options, } DCHECK_GT(num_sockets_to_preconnect, 0); - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&StartPreconnectOnUI, base::RetainedRef(browser_context_), url, num_sockets_to_preconnect)); diff --git a/shell/browser/api/atom_api_top_level_window.h b/shell/browser/api/atom_api_top_level_window.h index 527608aef2..3958924d7f 100644 --- a/shell/browser/api/atom_api_top_level_window.h +++ b/shell/browser/api/atom_api_top_level_window.h @@ -240,7 +240,7 @@ class TopLevelWindow : public mate::TrackableObject, template void EmitEventSoon(base::StringPiece eventName) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(base::IgnoreResult(&TopLevelWindow::Emit), weak_factory_.GetWeakPtr(), eventName)); diff --git a/shell/browser/api/atom_api_url_request_ns.cc b/shell/browser/api/atom_api_url_request_ns.cc index a3675b5152..9dcb987ea9 100644 --- a/shell/browser/api/atom_api_url_request_ns.cc +++ b/shell/browser/api/atom_api_url_request_ns.cc @@ -6,6 +6,7 @@ #include +#include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/system/string_data_source.h" #include "native_mate/dictionary.h" #include "native_mate/object_template_builder.h" @@ -112,9 +113,10 @@ class MultipartDataPipeGetter : public UploadDataPipeGetter, ~MultipartDataPipeGetter() override = default; void AttachToRequestBody(network::ResourceRequestBody* body) override { - network::mojom::DataPipeGetterPtr data_pipe_getter; - binding_set_.AddBinding(this, mojo::MakeRequest(&data_pipe_getter)); - body->AppendDataPipe(std::move(data_pipe_getter)); + mojo::PendingRemote data_pipe_getter_remote; + receivers_.Add(this, + data_pipe_getter_remote.InitWithNewPipeAndPassReceiver()); + body->AppendDataPipe(std::move(data_pipe_getter_remote)); } private: @@ -125,11 +127,12 @@ class MultipartDataPipeGetter : public UploadDataPipeGetter, SetPipe(std::move(pipe)); } - void Clone(network::mojom::DataPipeGetterRequest request) override { - binding_set_.AddBinding(this, std::move(request)); + void Clone( + mojo::PendingReceiver receiver) override { + receivers_.Add(this, std::move(receiver)); } - mojo::BindingSet binding_set_; + mojo::ReceiverSet receivers_; }; // Streaming chunked data to NetworkService. @@ -141,9 +144,11 @@ class ChunkedDataPipeGetter : public UploadDataPipeGetter, ~ChunkedDataPipeGetter() override = default; void AttachToRequestBody(network::ResourceRequestBody* body) override { - network::mojom::ChunkedDataPipeGetterPtr data_pipe_getter; - binding_set_.AddBinding(this, mojo::MakeRequest(&data_pipe_getter)); - body->SetToChunkedDataPipe(std::move(data_pipe_getter)); + mojo::PendingRemote + data_pipe_getter_remote; + receiver_set_.Add(this, + data_pipe_getter_remote.InitWithNewPipeAndPassReceiver()); + body->SetToChunkedDataPipe(std::move(data_pipe_getter_remote)); } private: @@ -156,7 +161,7 @@ class ChunkedDataPipeGetter : public UploadDataPipeGetter, SetPipe(std::move(pipe)); } - mojo::BindingSet binding_set_; + mojo::ReceiverSet receiver_set_; }; URLRequestNS::URLRequestNS(mate::Arguments* args) : weak_factory_(this) { diff --git a/shell/browser/api/gpuinfo_manager.cc b/shell/browser/api/gpuinfo_manager.cc index 714fc6d395..fbf56d5da4 100644 --- a/shell/browser/api/gpuinfo_manager.cc +++ b/shell/browser/api/gpuinfo_manager.cc @@ -66,7 +66,8 @@ void GPUInfoManager::CompleteInfoFetcher( complete_info_promise_set_.emplace_back(std::move(promise)); if (NeedsCompleteGpuInfoCollection()) { - gpu_data_manager_->RequestCompleteGpuInfoIfNeeded(); + gpu_data_manager_->RequestCompleteGpuInfoIfNeeded( + content::kGpuInfoRequestAll, /* delayed */ false); } else { GPUInfoManager::OnGpuInfoUpdate(); } diff --git a/shell/browser/atom_browser_client.cc b/shell/browser/atom_browser_client.cc index 1d68f8a912..c3b2491b41 100644 --- a/shell/browser/atom_browser_client.cc +++ b/shell/browser/atom_browser_client.cc @@ -111,7 +111,6 @@ #if BUILDFLAG(ENABLE_TTS) #include "chrome/browser/speech/tts_controller_delegate_impl.h" -#include "chrome/browser/speech/tts_message_filter.h" #endif // BUILDFLAG(ENABLE_TTS) #if BUILDFLAG(ENABLE_PRINTING) @@ -175,7 +174,7 @@ AtomBrowserClient* AtomBrowserClient::Get() { // static void AtomBrowserClient::SetApplicationLocale(const std::string& locale) { if (!BrowserThread::IsThreadInitialized(BrowserThread::IO) || - !base::PostTaskWithTraits( + !base::PostTask( FROM_HERE, {BrowserThread::IO}, base::BindOnce(&SetApplicationLocaleOnIOThread, locale))) { g_io_thread_application_locale.Get() = locale; @@ -353,10 +352,6 @@ void AtomBrowserClient::RenderProcessWillLaunch( process_id, host->GetBrowserContext())); #endif -#if BUILDFLAG(ENABLE_TTS) - host->AddFilter(new TtsMessageFilter(host->GetBrowserContext())); -#endif - ProcessPreferences prefs; auto* web_preferences = WebContentsPreferences::From(GetWebContentsFromProcessID(process_id)); @@ -748,13 +743,12 @@ AtomBrowserClient::OverrideSystemLocationProvider() { #endif } -network::mojom::NetworkContextPtr AtomBrowserClient::CreateNetworkContext( +mojo::Remote +AtomBrowserClient::CreateNetworkContext( content::BrowserContext* browser_context, bool /*in_memory*/, const base::FilePath& /*relative_partition_path*/) { - if (!browser_context) - return nullptr; - + DCHECK(browser_context); return NetworkContextServiceFactory::GetForContext(browser_context) ->CreateNetworkContext(); } @@ -861,10 +855,9 @@ bool AtomBrowserClient::HandleExternalProtocol( ui::PageTransition page_transition, bool has_user_gesture, network::mojom::URLLoaderFactoryPtr* out_factory) { - base::PostTaskWithTraits( - FROM_HERE, {BrowserThread::UI}, - base::BindOnce(&HandleExternalProtocolInUI, url, web_contents_getter, - has_user_gesture)); + base::PostTask(FROM_HERE, {BrowserThread::UI}, + base::BindOnce(&HandleExternalProtocolInUI, url, + web_contents_getter, has_user_gesture)); return true; } @@ -984,7 +977,8 @@ bool AtomBrowserClient::WillCreateURLLoaderFactory( URLLoaderFactoryType type, const url::Origin& request_initiator, mojo::PendingReceiver* factory_receiver, - network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client, + mojo::PendingRemote* + header_client, bool* bypass_redirect_checks) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); api::ProtocolNS* protocol = @@ -997,14 +991,15 @@ bool AtomBrowserClient::WillCreateURLLoaderFactory( network::mojom::URLLoaderFactoryPtrInfo target_factory_info; *factory_receiver = mojo::MakeRequest(&target_factory_info); - network::mojom::TrustedURLLoaderHeaderClientRequest header_client_request; + mojo::PendingReceiver + header_client_receiver; if (header_client) - header_client_request = mojo::MakeRequest(header_client); + header_client_receiver = header_client->InitWithNewPipeAndPassReceiver(); new ProxyingURLLoaderFactory( web_request.get(), protocol->intercept_handlers(), render_process_id, std::move(proxied_receiver), std::move(target_factory_info), - std::move(header_client_request)); + std::move(header_client_receiver), type); if (bypass_redirect_checks) *bypass_redirect_checks = true; @@ -1015,7 +1010,8 @@ network::mojom::URLLoaderFactoryPtrInfo AtomBrowserClient::CreateURLLoaderFactoryForNetworkRequests( content::RenderProcessHost* process, network::mojom::NetworkContext* network_context, - network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client, + mojo::PendingRemote* + header_client, const url::Origin& request_initiator) { auto render_process_id = process->GetID(); auto it = process_preferences_.find(render_process_id); @@ -1039,7 +1035,8 @@ AtomBrowserClient::CreateURLLoaderFactoryForNetworkRequests( } #if defined(OS_WIN) -bool AtomBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy) { +bool AtomBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy, + RendererSpawnFlags flags) { // Allow crashpad to communicate via named pipe. sandbox::ResultCode result = policy->AddRule( sandbox::TargetPolicy::SUBSYS_FILES, diff --git a/shell/browser/atom_browser_client.h b/shell/browser/atom_browser_client.h index d67e2549c5..dfa4598c8d 100644 --- a/shell/browser/atom_browser_client.h +++ b/shell/browser/atom_browser_client.h @@ -143,7 +143,7 @@ class AtomBrowserClient : public content::ContentBrowserClient, content::ResourceContext* resource_context) override; std::unique_ptr OverrideSystemLocationProvider() override; - network::mojom::NetworkContextPtr CreateNetworkContext( + mojo::Remote CreateNetworkContext( content::BrowserContext* browser_context, bool in_memory, const base::FilePath& relative_partition_path) override; @@ -177,16 +177,19 @@ class AtomBrowserClient : public content::ContentBrowserClient, URLLoaderFactoryType type, const url::Origin& request_initiator, mojo::PendingReceiver* factory_receiver, - network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client, + mojo::PendingRemote* + header_client, bool* bypass_redirect_checks) override; network::mojom::URLLoaderFactoryPtrInfo CreateURLLoaderFactoryForNetworkRequests( content::RenderProcessHost* process, network::mojom::NetworkContext* network_context, - network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client, + mojo::PendingRemote* + header_client, const url::Origin& request_initiator) override; #if defined(OS_WIN) - bool PreSpawnRenderer(sandbox::TargetPolicy* policy) override; + bool PreSpawnRenderer(sandbox::TargetPolicy* policy, + RendererSpawnFlags flags) override; #endif bool BindAssociatedInterfaceRequestFromFrame( content::RenderFrameHost* render_frame_host, diff --git a/shell/browser/atom_browser_context.cc b/shell/browser/atom_browser_context.cc index 4ad54c293a..fd9995680c 100644 --- a/shell/browser/atom_browser_context.cc +++ b/shell/browser/atom_browser_context.cc @@ -275,7 +275,8 @@ AtomBrowserContext::GetURLLoaderFactory() { mojo::MakeRequest(&network_factory); // Consult the embedder. - network::mojom::TrustedURLLoaderHeaderClientPtrInfo header_client; + mojo::PendingRemote + header_client; static_cast(AtomBrowserClient::Get()) ->WillCreateURLLoaderFactory( this, nullptr, -1, diff --git a/shell/browser/atom_browser_main_parts_posix.cc b/shell/browser/atom_browser_main_parts_posix.cc index efeff077b4..b3b4716deb 100644 --- a/shell/browser/atom_browser_main_parts_posix.cc +++ b/shell/browser/atom_browser_main_parts_posix.cc @@ -137,7 +137,7 @@ void ShutdownDetector::ThreadMain() { } while (bytes_read < sizeof(signal)); VLOG(1) << "Handling shutdown for signal " << signal << "."; - if (!base::PostTaskWithTraits( + if (!base::PostTask( FROM_HERE, {BrowserThread::UI}, base::BindOnce(&Browser::Quit, base::Unretained(Browser::Get())))) { // Without a UI thread to post the exit task to, there aren't many diff --git a/shell/browser/atom_download_manager_delegate.cc b/shell/browser/atom_download_manager_delegate.cc index 9807dd0fa0..122fb0a7d7 100644 --- a/shell/browser/atom_download_manager_delegate.cc +++ b/shell/browser/atom_download_manager_delegate.cc @@ -216,9 +216,9 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget( base::FilePath default_download_path = browser_context->prefs()->GetFilePath(prefs::kDownloadDefaultDirectory); - base::PostTaskWithTraitsAndReplyWithResult( + base::PostTaskAndReplyWithResult( FROM_HERE, - {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + {base::ThreadPool(), base::MayBlock(), base::TaskPriority::BEST_EFFORT, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, base::BindOnce(&CreateDownloadPath, download->GetURL(), download->GetContentDisposition(), diff --git a/shell/browser/common_web_contents_delegate.cc b/shell/browser/common_web_contents_delegate.cc index 77c09e5b29..0e2849c463 100644 --- a/shell/browser/common_web_contents_delegate.cc +++ b/shell/browser/common_web_contents_delegate.cc @@ -178,8 +178,8 @@ bool IsDevToolsFileSystemAdded(content::WebContents* web_contents, CommonWebContentsDelegate::CommonWebContentsDelegate() : devtools_file_system_indexer_(new DevToolsFileSystemIndexer), - file_task_runner_( - base::CreateSequencedTaskRunnerWithTraits({base::MayBlock()})), + file_task_runner_(base::CreateSequencedTaskRunner( + {base::ThreadPool(), base::MayBlock()})), weak_factory_(this) {} CommonWebContentsDelegate::~CommonWebContentsDelegate() = default; diff --git a/shell/browser/extensions/atom_extension_system.cc b/shell/browser/extensions/atom_extension_system.cc index 614ca49c7f..7d30806fee 100644 --- a/shell/browser/extensions/atom_extension_system.cc +++ b/shell/browser/extensions/atom_extension_system.cc @@ -131,7 +131,7 @@ AppSorting* AtomExtensionSystem::app_sorting() { void AtomExtensionSystem::RegisterExtensionWithRequestContexts( const Extension* extension, const base::Closure& callback) { - base::PostTaskWithTraitsAndReply( + base::PostTaskAndReply( FROM_HERE, {BrowserThread::IO}, base::Bind(&InfoMap::AddExtension, info_map(), base::RetainedRef(extension), base::Time::Now(), false, false), diff --git a/shell/browser/extensions/atom_extensions_browser_client.cc b/shell/browser/extensions/atom_extensions_browser_client.cc index c9abe59087..da7bc02a3d 100644 --- a/shell/browser/extensions/atom_extensions_browser_client.cc +++ b/shell/browser/extensions/atom_extensions_browser_client.cc @@ -235,7 +235,7 @@ void AtomExtensionsBrowserClient::BroadcastEventToRenderers( const std::string& event_name, std::unique_ptr args) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {BrowserThread::UI}, base::BindOnce(&AtomExtensionsBrowserClient::BroadcastEventToRenderers, base::Unretained(this), histogram_value, event_name, diff --git a/shell/browser/login_handler.cc b/shell/browser/login_handler.cc index 817ea4c9b9..45c3ca8b09 100644 --- a/shell/browser/login_handler.cc +++ b/shell/browser/login_handler.cc @@ -22,11 +22,11 @@ namespace electron { LoginHandler::LoginHandler(net::URLRequest* request, const net::AuthChallengeInfo& auth_info, - net::NetworkDelegate::AuthCallback callback, + // net::NetworkDelegate::AuthCallback callback, net::AuthCredentials* credentials) : credentials_(credentials), auth_info_(std::make_unique(auth_info)), - auth_callback_(std::move(callback)), + // auth_callback_(std::move(callback)), weak_factory_(this) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -40,7 +40,7 @@ LoginHandler::LoginHandler(net::URLRequest* request, // web_contents_getter_ = // resource_request_info->GetWebContentsGetterForRequest(); - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {BrowserThread::UI}, base::BindOnce(&Browser::RequestLogin, base::Unretained(Browser::Get()), base::RetainedRef(this), std::move(request_details))); @@ -52,7 +52,7 @@ void LoginHandler::Login(const base::string16& username, const base::string16& password) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {BrowserThread::IO}, base::BindOnce(&LoginHandler::DoLogin, weak_factory_.GetWeakPtr(), username, password)); @@ -61,13 +61,13 @@ void LoginHandler::Login(const base::string16& username, void LoginHandler::CancelAuth() { DCHECK_CURRENTLY_ON(BrowserThread::UI); - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {BrowserThread::IO}, base::BindOnce(&LoginHandler::DoCancelAuth, weak_factory_.GetWeakPtr())); } void LoginHandler::NotifyRequestDestroyed() { - auth_callback_.Reset(); + // auth_callback_.Reset(); credentials_ = nullptr; weak_factory_.InvalidateWeakPtrs(); } @@ -82,19 +82,23 @@ content::WebContents* LoginHandler::GetWebContents() const { void LoginHandler::DoCancelAuth() { DCHECK_CURRENTLY_ON(BrowserThread::IO); + /* if (!auth_callback_.is_null()) std::move(auth_callback_) .Run(net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_CANCEL_AUTH); + */ } void LoginHandler::DoLogin(const base::string16& username, const base::string16& password) { DCHECK_CURRENTLY_ON(BrowserThread::IO); + /* if (!auth_callback_.is_null()) { credentials_->Set(username, password); std::move(auth_callback_) .Run(net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_SET_AUTH); } + */ } } // namespace electron diff --git a/shell/browser/login_handler.h b/shell/browser/login_handler.h index 0e18af3e75..64b735cb8d 100644 --- a/shell/browser/login_handler.h +++ b/shell/browser/login_handler.h @@ -26,7 +26,7 @@ class LoginHandler : public base::RefCountedThreadSafe { public: LoginHandler(net::URLRequest* request, const net::AuthChallengeInfo& auth_info, - net::NetworkDelegate::AuthCallback callback, + // net::NetworkDelegate::AuthCallback callback, net::AuthCredentials* credentials); // The auth is cancelled, must be called on UI thread. @@ -64,7 +64,7 @@ class LoginHandler : public base::RefCountedThreadSafe { content::WebContents::Getter web_contents_getter_; // Called with preferred value of net::NetworkDelegate::AuthRequiredResponse. - net::NetworkDelegate::AuthCallback auth_callback_; + // net::NetworkDelegate::AuthCallback auth_callback_; base::WeakPtrFactory weak_factory_; diff --git a/shell/browser/mac/in_app_purchase.mm b/shell/browser/mac/in_app_purchase.mm index 77c8a5bcd4..ee9842ba90 100644 --- a/shell/browser/mac/in_app_purchase.mm +++ b/shell/browser/mac/in_app_purchase.mm @@ -122,9 +122,8 @@ */ - (void)runCallback:(bool)isProductValid { if (callback_) { - base::PostTaskWithTraits( - FROM_HERE, {content::BrowserThread::UI}, - base::BindOnce(std::move(callback_), isProductValid)); + base::PostTask(FROM_HERE, {content::BrowserThread::UI}, + base::BindOnce(std::move(callback_), isProductValid)); } // Release this delegate. [self release]; diff --git a/shell/browser/mac/in_app_purchase_observer.mm b/shell/browser/mac/in_app_purchase_observer.mm index ba46679349..7133628a41 100644 --- a/shell/browser/mac/in_app_purchase_observer.mm +++ b/shell/browser/mac/in_app_purchase_observer.mm @@ -75,8 +75,8 @@ using InAppTransactionCallback = base::RepeatingCallbackset_frame_type(views::Widget::FrameType::FRAME_TYPE_FORCE_NATIVE); + widget()->set_frame_type(views::Widget::FrameType::kForceNative); widget()->FrameTypeChanged(); #if defined(OS_WIN) // thickFrame also works for normal window. diff --git a/shell/browser/net/asar/asar_url_loader.cc b/shell/browser/net/asar/asar_url_loader.cc index c5e664175f..88f8825c4e 100644 --- a/shell/browser/net/asar/asar_url_loader.cc +++ b/shell/browser/net/asar/asar_url_loader.cc @@ -20,6 +20,7 @@ #include "net/base/mime_util.h" #include "net/http/http_byte_range.h" #include "net/http/http_util.h" +#include "services/network/public/cpp/resource_response.h" #include "shell/common/asar/archive.h" #include "shell/common/asar/asar_util.h" @@ -298,8 +299,8 @@ void CreateAsarURLLoader( network::mojom::URLLoaderRequest loader, network::mojom::URLLoaderClientPtr client, scoped_refptr extra_response_headers) { - auto task_runner = base::CreateSequencedTaskRunnerWithTraits( - {base::MayBlock(), base::TaskPriority::USER_VISIBLE, + auto task_runner = base::CreateSequencedTaskRunner( + {base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); task_runner->PostTask( FROM_HERE, base::BindOnce(&AsarURLLoader::CreateAndStart, request, diff --git a/shell/browser/net/network_context_service.cc b/shell/browser/net/network_context_service.cc index 1a62239c72..5464964667 100644 --- a/shell/browser/net/network_context_service.cc +++ b/shell/browser/net/network_context_service.cc @@ -19,12 +19,12 @@ NetworkContextService::NetworkContextService(content::BrowserContext* context) NetworkContextService::~NetworkContextService() = default; -network::mojom::NetworkContextPtr +mojo::Remote NetworkContextService::CreateNetworkContext() { - network::mojom::NetworkContextPtr network_context; + mojo::Remote network_context; content::GetNetworkService()->CreateNetworkContext( - MakeRequest(&network_context), + network_context.BindNewPipeAndPassReceiver(), CreateNetworkContextParams(browser_context_->IsOffTheRecord(), browser_context_->GetPath())); diff --git a/shell/browser/net/network_context_service.h b/shell/browser/net/network_context_service.h index 204cc56c2f..cfe4343999 100644 --- a/shell/browser/net/network_context_service.h +++ b/shell/browser/net/network_context_service.h @@ -8,6 +8,7 @@ #include "base/files/file_path.h" #include "chrome/browser/net/proxy_config_monitor.h" #include "components/keyed_service/core/keyed_service.h" +#include "mojo/public/cpp/bindings/remote.h" #include "services/network/public/mojom/network_context.mojom.h" #include "shell/browser/atom_browser_context.h" @@ -24,7 +25,7 @@ class NetworkContextService : public KeyedService { NetworkContextService& operator=(const NetworkContextService&) = delete; // Creates a NetworkContext for the BrowserContext. - network::mojom::NetworkContextPtr CreateNetworkContext(); + mojo::Remote CreateNetworkContext(); private: // Creates parameters for the NetworkContext. diff --git a/shell/browser/net/node_stream_loader.h b/shell/browser/net/node_stream_loader.h index 120c751cf2..4375df825b 100644 --- a/shell/browser/net/node_stream_loader.h +++ b/shell/browser/net/node_stream_loader.h @@ -12,6 +12,7 @@ #include "mojo/public/cpp/bindings/strong_binding.h" #include "mojo/public/cpp/system/data_pipe_producer.h" +#include "services/network/public/cpp/resource_response.h" #include "services/network/public/mojom/url_loader.mojom.h" #include "v8/include/v8.h" diff --git a/shell/browser/net/proxying_url_loader_factory.cc b/shell/browser/net/proxying_url_loader_factory.cc index d8bda0f3ce..589fccc303 100644 --- a/shell/browser/net/proxying_url_loader_factory.cc +++ b/shell/browser/net/proxying_url_loader_factory.cc @@ -49,8 +49,7 @@ ProxyingURLLoaderFactory::InProgressRequest::InProgressRequest( proxied_client_binding_(this), // TODO(zcbenz): We should always use "extraHeaders" mode to be compatible // with old APIs. - has_any_extra_headers_listeners_(false), - header_client_binding_(this) { + has_any_extra_headers_listeners_(false) { // If there is a client error, clean up the request. target_client_.set_connection_error_handler(base::BindOnce( &ProxyingURLLoaderFactory::InProgressRequest::OnRequestError, @@ -78,10 +77,11 @@ void ProxyingURLLoaderFactory::InProgressRequest::UpdateRequestInfo() { info_.emplace(extensions::WebRequestInfoInitParams( request_id_, factory_->render_process_id_, request_.render_frame_id, nullptr, routing_id_, request_for_info, false, - !(options_ & network::mojom::kURLLoadOptionSynchronous))); + !(options_ & network::mojom::kURLLoadOptionSynchronous), + factory_->IsForServiceWorkerScript())); current_request_uses_header_client_ = - factory_->url_loader_header_client_binding_ && + factory_->url_loader_header_client_receiver_.is_bound() && network_service_request_id_ != 0 && false /* TODO(zcbenz): HasExtraHeadersListenerForRequest */; } @@ -125,8 +125,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::RestartInternal() { // Pause the header client, since we want to wait until OnBeforeRequest has // finished before processing any future events. - if (header_client_binding_) - header_client_binding_.PauseIncomingMethodCallProcessing(); + if (header_client_receiver_.is_bound()) + header_client_receiver_.Pause(); return; } DCHECK_EQ(net::OK, result); @@ -188,7 +188,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::ResumeReadingBodyFromNet() { } void ProxyingURLLoaderFactory::InProgressRequest::OnReceiveResponse( - const network::ResourceResponseHead& head) { + network::mojom::URLResponseHeadPtr head) { if (current_request_uses_header_client_) { // Use the headers we got from OnHeadersReceived as that'll contain // Set-Cookie if it existed. @@ -206,7 +206,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::OnReceiveResponse( void ProxyingURLLoaderFactory::InProgressRequest::OnReceiveRedirect( const net::RedirectInfo& redirect_info, - const network::ResourceResponseHead& head) { + network::mojom::URLResponseHeadPtr head) { // Note: In Electron we don't check IsRedirectSafe. if (current_request_uses_header_client_) { @@ -267,8 +267,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::OnComplete( } void ProxyingURLLoaderFactory::InProgressRequest::OnLoaderCreated( - network::mojom::TrustedHeaderClientRequest request) { - header_client_binding_.Bind(std::move(request)); + mojo::PendingReceiver receiver) { + header_client_receiver_.Bind(std::move(receiver)); } void ProxyingURLLoaderFactory::InProgressRequest::OnBeforeSendHeaders( @@ -408,8 +408,8 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToStartRequest( if (proxied_client_binding_.is_bound()) proxied_client_binding_.ResumeIncomingMethodCallProcessing(); - if (header_client_binding_) - header_client_binding_.ResumeIncomingMethodCallProcessing(); + if (header_client_receiver_.is_bound()) + header_client_receiver_.Resume(); if (!target_loader_.is_bound() && factory_->target_factory_.is_bound()) { // No extensions have cancelled us up to this point, so it's now OK to @@ -429,7 +429,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToStartRequest( // From here the lifecycle of this request is driven by subsequent events on // either |proxy_loader_binding_|, |proxy_client_binding_|, or - // |header_client_binding_|. + // |header_client_receiver_|. } void ProxyingURLLoaderFactory::InProgressRequest:: @@ -489,7 +489,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::ContinueToResponseStarted( // These will get re-bound if a new request is initiated by // |FollowRedirect()|. proxied_client_binding_.Close(); - header_client_binding_.Close(); + header_client_receiver_.reset(); target_loader_.reset(); ContinueToBeforeRedirect(redirect_info, net::OK); @@ -546,7 +546,7 @@ void ProxyingURLLoaderFactory::InProgressRequest:: // the load with it gives unexpected results. See // https://crbug.com/882661#c72. proxied_client_binding_.Close(); - header_client_binding_.Close(); + header_client_receiver_.reset(); target_loader_.reset(); constexpr int kInternalRedirectStatusCode = 307; @@ -654,11 +654,13 @@ ProxyingURLLoaderFactory::ProxyingURLLoaderFactory( int render_process_id, network::mojom::URLLoaderFactoryRequest loader_request, network::mojom::URLLoaderFactoryPtrInfo target_factory_info, - network::mojom::TrustedURLLoaderHeaderClientRequest header_client_request) + mojo::PendingReceiver + header_client_receiver, + content::ContentBrowserClient::URLLoaderFactoryType loader_factory_type) : web_request_api_(web_request_api), intercepted_handlers_(intercepted_handlers), render_process_id_(render_process_id), - url_loader_header_client_binding_(this) { + loader_factory_type_(loader_factory_type) { target_factory_.Bind(std::move(target_factory_info)); target_factory_.set_connection_error_handler(base::BindOnce( &ProxyingURLLoaderFactory::OnTargetFactoryError, base::Unretained(this))); @@ -666,8 +668,8 @@ ProxyingURLLoaderFactory::ProxyingURLLoaderFactory( proxy_bindings_.set_connection_error_handler(base::BindRepeating( &ProxyingURLLoaderFactory::OnProxyBindingError, base::Unretained(this))); - if (header_client_request) - url_loader_header_client_binding_.Bind(std::move(header_client_request)); + if (header_client_receiver) + url_loader_header_client_receiver_.Bind(std::move(header_client_receiver)); } ProxyingURLLoaderFactory::~ProxyingURLLoaderFactory() = default; @@ -731,14 +733,19 @@ void ProxyingURLLoaderFactory::Clone( void ProxyingURLLoaderFactory::OnLoaderCreated( int32_t request_id, - network::mojom::TrustedHeaderClientRequest request) { + mojo::PendingReceiver receiver) { auto it = network_request_id_to_web_request_id_.find(request_id); if (it == network_request_id_to_web_request_id_.end()) return; auto request_it = requests_.find(it->second); DCHECK(request_it != requests_.end()); - request_it->second->OnLoaderCreated(std::move(request)); + request_it->second->OnLoaderCreated(std::move(receiver)); +} + +bool ProxyingURLLoaderFactory::IsForServiceWorkerScript() const { + return loader_factory_type_ == content::ContentBrowserClient:: + URLLoaderFactoryType::kServiceWorkerScript; } void ProxyingURLLoaderFactory::OnTargetFactoryError() { diff --git a/shell/browser/net/proxying_url_loader_factory.h b/shell/browser/net/proxying_url_loader_factory.h index 0eb46f84a1..d3e62c88ff 100644 --- a/shell/browser/net/proxying_url_loader_factory.h +++ b/shell/browser/net/proxying_url_loader_factory.h @@ -12,7 +12,9 @@ #include #include "base/optional.h" +#include "content/public/browser/content_browser_client.h" #include "extensions/browser/api/web_request/web_request_info.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_response.h" #include "services/network/public/mojom/network_context.mojom.h" @@ -101,9 +103,9 @@ class ProxyingURLLoaderFactory void ResumeReadingBodyFromNet() override; // network::mojom::URLLoaderClient: - void OnReceiveResponse(const network::ResourceResponseHead& head) override; + void OnReceiveResponse(network::mojom::URLResponseHeadPtr head) override; void OnReceiveRedirect(const net::RedirectInfo& redirect_info, - const network::ResourceResponseHead& head) override; + network::mojom::URLResponseHeadPtr head) override; void OnUploadProgress(int64_t current_position, int64_t total_size, OnUploadProgressCallback callback) override; @@ -113,7 +115,8 @@ class ProxyingURLLoaderFactory mojo::ScopedDataPipeConsumerHandle body) override; void OnComplete(const network::URLLoaderCompletionStatus& status) override; - void OnLoaderCreated(network::mojom::TrustedHeaderClientRequest request); + void OnLoaderCreated( + mojo::PendingReceiver receiver); // network::mojom::TrustedHeaderClient: void OnBeforeSendHeaders(const net::HttpRequestHeaders& headers, @@ -172,7 +175,8 @@ class ProxyingURLLoaderFactory bool current_request_uses_header_client_ = false; OnBeforeSendHeadersCallback on_before_send_headers_callback_; OnHeadersReceivedCallback on_headers_received_callback_; - mojo::Binding header_client_binding_; + mojo::Receiver header_client_receiver_{ + this}; // If |has_any_extra_headers_listeners_| is set to false and a redirect is // in progress, this stores the parameters to FollowRedirect that came from @@ -200,8 +204,9 @@ class ProxyingURLLoaderFactory int render_process_id, network::mojom::URLLoaderFactoryRequest loader_request, network::mojom::URLLoaderFactoryPtrInfo target_factory_info, - network::mojom::TrustedURLLoaderHeaderClientRequest - header_client_request); + mojo::PendingReceiver + header_client_receiver, + content::ContentBrowserClient::URLLoaderFactoryType loader_factory_type); ~ProxyingURLLoaderFactory() override; // network::mojom::URLLoaderFactory: @@ -218,10 +223,13 @@ class ProxyingURLLoaderFactory // network::mojom::TrustedURLLoaderHeaderClient: void OnLoaderCreated( int32_t request_id, - network::mojom::TrustedHeaderClientRequest request) override; + mojo::PendingReceiver receiver) + override; WebRequestAPI* web_request_api() { return web_request_api_; } + bool IsForServiceWorkerScript() const; + private: void OnTargetFactoryError(); void OnProxyBindingError(); @@ -243,8 +251,10 @@ class ProxyingURLLoaderFactory const int render_process_id_; mojo::BindingSet proxy_bindings_; network::mojom::URLLoaderFactoryPtr target_factory_; - mojo::Binding - url_loader_header_client_binding_; + mojo::Receiver + url_loader_header_client_receiver_{this}; + const content::ContentBrowserClient::URLLoaderFactoryType + loader_factory_type_; // Mapping from our own internally generated request ID to an // InProgressRequest instance. diff --git a/shell/browser/net/system_network_context_manager.cc b/shell/browser/net/system_network_context_manager.cc index ebf4dbd684..f737dd4d05 100644 --- a/shell/browser/net/system_network_context_manager.cc +++ b/shell/browser/net/system_network_context_manager.cc @@ -111,7 +111,7 @@ class SystemNetworkContextManager::URLLoaderFactoryForSystem }; network::mojom::NetworkContext* SystemNetworkContextManager::GetContext() { - if (!network_context_ || network_context_.encountered_error()) { + if (!network_context_ || !network_context_.is_connected()) { // This should call into OnNetworkServiceCreated(), which will re-create // the network service, if needed. There's a chance that it won't be // invoked, if the NetworkContext has encountered an error but the @@ -201,8 +201,10 @@ void SystemNetworkContextManager::OnNetworkServiceCreated( // The system NetworkContext must be created first, since it sets // |primary_network_context| to true. - network_service->CreateNetworkContext(MakeRequest(&network_context_), - CreateNetworkContextParams()); + network_context_.reset(); + network_service->CreateNetworkContext( + network_context_.BindNewPipeAndPassReceiver(), + CreateNetworkContextParams()); } network::mojom::NetworkContextParamsPtr diff --git a/shell/browser/net/system_network_context_manager.h b/shell/browser/net/system_network_context_manager.h index bd1cd3e39c..8a9368ac22 100644 --- a/shell/browser/net/system_network_context_manager.h +++ b/shell/browser/net/system_network_context_manager.h @@ -13,6 +13,7 @@ #include "base/memory/ref_counted.h" #include "base/optional.h" #include "chrome/browser/net/proxy_config_monitor.h" +#include "mojo/public/cpp/bindings/remote.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/network_service.mojom.h" @@ -91,7 +92,7 @@ class SystemNetworkContextManager { // NetworkContext using the network service, if the network service is // enabled. nullptr, otherwise. - network::mojom::NetworkContextPtr network_context_; + mojo::Remote network_context_; // URLLoaderFactory backed by the NetworkContext returned by GetContext(), so // consumers don't all need to create their own factory. diff --git a/shell/browser/notifications/win/windows_toast_notification.cc b/shell/browser/notifications/win/windows_toast_notification.cc index 7306e39f6c..c73cdf39c8 100644 --- a/shell/browser/notifications/win/windows_toast_notification.cc +++ b/shell/browser/notifications/win/windows_toast_notification.cc @@ -413,7 +413,7 @@ ToastEventHandler::~ToastEventHandler() {} IFACEMETHODIMP ToastEventHandler::Invoke( ABI::Windows::UI::Notifications::IToastNotification* sender, IInspectable* args) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&Notification::NotificationClicked, notification_)); if (IsDebuggingNotifications()) @@ -425,7 +425,7 @@ IFACEMETHODIMP ToastEventHandler::Invoke( IFACEMETHODIMP ToastEventHandler::Invoke( ABI::Windows::UI::Notifications::IToastNotification* sender, ABI::Windows::UI::Notifications::IToastDismissedEventArgs* e) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&Notification::NotificationDismissed, notification_)); if (IsDebuggingNotifications()) @@ -437,7 +437,7 @@ IFACEMETHODIMP ToastEventHandler::Invoke( IFACEMETHODIMP ToastEventHandler::Invoke( ABI::Windows::UI::Notifications::IToastNotification* sender, ABI::Windows::UI::Notifications::IToastFailedEventArgs* e) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&Notification::NotificationFailed, notification_)); if (IsDebuggingNotifications()) diff --git a/shell/browser/osr/osr_render_widget_host_view.cc b/shell/browser/osr/osr_render_widget_host_view.cc index 90c4559bfc..141b0a4a20 100644 --- a/shell/browser/osr/osr_render_widget_host_view.cc +++ b/shell/browser/osr/osr_render_widget_host_view.cc @@ -127,9 +127,7 @@ class AtomBeginFrameTimer : public viz::DelayBasedTimeSourceClient { const base::Closure& callback) : callback_(callback) { time_source_ = std::make_unique( - base::CreateSingleThreadTaskRunnerWithTraits( - {content::BrowserThread::UI}) - .get()); + base::CreateSingleThreadTaskRunner({content::BrowserThread::UI}).get()); time_source_->SetTimebaseAndInterval( base::TimeTicks(), base::TimeDelta::FromMicroseconds(frame_rate_threshold_us)); @@ -254,7 +252,7 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView( context_factory_private->AllocateFrameSinkId(), content::GetContextFactory(), context_factory_private, base::ThreadTaskRunnerHandle::Get(), false /* enable_pixel_canvas */, - this); + false /* use_external_begin_frame_control */); compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); compositor_->SetRootLayer(root_layer_.get()); @@ -319,16 +317,8 @@ void OffScreenRenderWidgetHostView::SendBeginFrame( begin_frame_number_++; compositor_->context_factory_private()->IssueExternalBeginFrame( - compositor_.get(), begin_frame_args); -} - -void OffScreenRenderWidgetHostView::OnDisplayDidFinishFrame( - const viz::BeginFrameAck& ack) {} - -void OffScreenRenderWidgetHostView::OnNeedsExternalBeginFrames( - bool needs_begin_frames) { - SetupFrameRate(true); - begin_frame_timer_->SetActive(needs_begin_frames); + compositor_.get(), begin_frame_args, /* force */ true, + base::NullCallback()); } void OffScreenRenderWidgetHostView::InitAsChild(gfx::NativeView) { @@ -448,7 +438,8 @@ gfx::Size OffScreenRenderWidgetHostView::GetVisibleViewportSize() { void OffScreenRenderWidgetHostView::SetInsets(const gfx::Insets& insets) {} -bool OffScreenRenderWidgetHostView::LockMouse() { +bool OffScreenRenderWidgetHostView::LockMouse( + bool request_unadjusted_movement) { return false; } @@ -848,7 +839,7 @@ void OffScreenRenderWidgetHostView::ReleaseResize() { hold_resize_ = false; if (pending_resize_) { pending_resize_ = false; - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce( &OffScreenRenderWidgetHostView::SynchronizeVisualProperties, @@ -953,7 +944,7 @@ void OffScreenRenderWidgetHostView::SendMouseWheelEvent( // Scrolling outside of the popup widget so destroy it. // Execute asynchronously to avoid deleting the widget from inside some // other callback. - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&OffScreenRenderWidgetHostView::CancelWidget, popup_host_view_->weak_ptr_factory_.GetWeakPtr())); diff --git a/shell/browser/osr/osr_render_widget_host_view.h b/shell/browser/osr/osr_render_widget_host_view.h index 058d538e2e..35225f3ac3 100644 --- a/shell/browser/osr/osr_render_widget_host_view.h +++ b/shell/browser/osr/osr_render_widget_host_view.h @@ -39,7 +39,6 @@ #include "ui/gfx/geometry/point.h" #include "components/viz/host/host_display_client.h" -#include "ui/compositor/external_begin_frame_client.h" #if defined(OS_WIN) #include "ui/gfx/win/window_impl.h" @@ -60,7 +59,6 @@ typedef base::Callback OnPaintCallback; typedef base::Callback OnPopupPaintCallback; class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, - public ui::ExternalBeginFrameClient, public ui::CompositorDelegate, public OffscreenViewProxyObserver { public: @@ -77,9 +75,6 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, content::BrowserAccessibilityDelegate*, bool) override; - void OnDisplayDidFinishFrame(const viz::BeginFrameAck& ack) override; - void OnNeedsExternalBeginFrames(bool needs_begin_frames) override; - // content::RenderWidgetHostView: void InitAsChild(gfx::NativeView) override; void SetSize(const gfx::Size&) override; @@ -101,7 +96,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, void SetBackgroundColor(SkColor color) override; base::Optional GetBackgroundColor() override; void UpdateBackgroundColor() override; - bool LockMouse(void) override; + bool LockMouse(bool request_unadjusted_movement) override; void UnlockMouse(void) override; void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override; void SetNeedsBeginFrames(bool needs_begin_frames) override; diff --git a/shell/browser/osr/osr_web_contents_view.cc b/shell/browser/osr/osr_web_contents_view.cc index 44ae56a527..2ac0864ec2 100644 --- a/shell/browser/osr/osr_web_contents_view.cc +++ b/shell/browser/osr/osr_web_contents_view.cc @@ -109,8 +109,7 @@ gfx::Rect OffScreenWebContentsView::GetViewBounds() const { return GetView() ? GetView()->GetViewBounds() : gfx::Rect(); } -void OffScreenWebContentsView::CreateView(const gfx::Size& initial_size, - gfx::NativeView context) {} +void OffScreenWebContentsView::CreateView(gfx::NativeView context) {} content::RenderWidgetHostViewBase* OffScreenWebContentsView::CreateViewForWidget( diff --git a/shell/browser/osr/osr_web_contents_view.h b/shell/browser/osr/osr_web_contents_view.h index a20a7626f7..9be4c21004 100644 --- a/shell/browser/osr/osr_web_contents_view.h +++ b/shell/browser/osr/osr_web_contents_view.h @@ -52,8 +52,7 @@ class OffScreenWebContentsView : public content::WebContentsView, void FocusThroughTabTraversal(bool reverse) override; content::DropData* GetDropData() const override; gfx::Rect GetViewBounds() const override; - void CreateView(const gfx::Size& initial_size, - gfx::NativeView context) override; + void CreateView(gfx::NativeView context) override; content::RenderWidgetHostViewBase* CreateViewForWidget( content::RenderWidgetHost* render_widget_host, bool is_guest_view_hack) override; diff --git a/shell/browser/printing/print_preview_message_handler.cc b/shell/browser/printing/print_preview_message_handler.cc index 90fdcf209d..3a555c4107 100644 --- a/shell/browser/printing/print_preview_message_handler.cc +++ b/shell/browser/printing/print_preview_message_handler.cc @@ -41,9 +41,9 @@ void StopWorker(int document_cookie) { std::unique_ptr printer_query = queue->PopPrinterQuery(document_cookie); if (printer_query.get()) { - base::PostTaskWithTraits(FROM_HERE, {BrowserThread::IO}, - base::BindOnce(&printing::PrinterQuery::StopWorker, - std::move(printer_query))); + base::PostTask(FROM_HERE, {BrowserThread::IO}, + base::BindOnce(&printing::PrinterQuery::StopWorker, + std::move(printer_query))); } } diff --git a/shell/browser/session_preferences.cc b/shell/browser/session_preferences.cc index 04dd2d2030..c02924ec90 100644 --- a/shell/browser/session_preferences.cc +++ b/shell/browser/session_preferences.cc @@ -4,6 +4,8 @@ #include "shell/browser/session_preferences.h" +#include "base/memory/ptr_util.h" + namespace electron { // static diff --git a/shell/browser/ui/cocoa/atom_menu_controller.mm b/shell/browser/ui/cocoa/atom_menu_controller.mm index b7da7e7666..692aae13c8 100644 --- a/shell/browser/ui/cocoa/atom_menu_controller.mm +++ b/shell/browser/ui/cocoa/atom_menu_controller.mm @@ -151,7 +151,7 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; isMenuOpen_ = NO; model_->MenuWillClose(); if (!closeCallback.is_null()) { - base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI}, closeCallback); + base::PostTask(FROM_HERE, {BrowserThread::UI}, closeCallback); } } } @@ -380,7 +380,7 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; // Post async task so that itemSelected runs before the close callback // deletes the controller from the map which deallocates it if (!closeCallback.is_null()) { - base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI}, closeCallback); + base::PostTask(FROM_HERE, {BrowserThread::UI}, closeCallback); } } } diff --git a/shell/browser/ui/message_box_win.cc b/shell/browser/ui/message_box_win.cc index 3a42257156..208bf0b22d 100644 --- a/shell/browser/ui/message_box_win.cc +++ b/shell/browser/ui/message_box_win.cc @@ -209,7 +209,7 @@ void RunMessageBoxInNewThread(base::Thread* thread, const MessageBoxSettings& settings, MessageBoxCallback callback) { int result = ShowTaskDialogUTF8(settings); - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(std::move(callback), result, settings.checkbox_checked)); content::BrowserThread::DeleteSoon(content::BrowserThread::UI, FROM_HERE, diff --git a/shell/browser/ui/tray_icon_cocoa.mm b/shell/browser/ui/tray_icon_cocoa.mm index b5d4edf843..e2b67abbe8 100644 --- a/shell/browser/ui/tray_icon_cocoa.mm +++ b/shell/browser/ui/tray_icon_cocoa.mm @@ -301,7 +301,7 @@ void TrayIconCocoa::PopUpOnUI(AtomMenuModel* menu_model) { void TrayIconCocoa::PopUpContextMenu(const gfx::Point& pos, AtomMenuModel* menu_model) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&TrayIconCocoa::PopUpOnUI, weak_factory_.GetWeakPtr(), base::Unretained(menu_model))); diff --git a/shell/browser/ui/views/menu_delegate.cc b/shell/browser/ui/views/menu_delegate.cc index 5cf9f67bc3..ec0ce612f2 100644 --- a/shell/browser/ui/views/menu_delegate.cc +++ b/shell/browser/ui/views/menu_delegate.cc @@ -131,10 +131,9 @@ views::MenuItemView* MenuDelegate::GetSiblingMenu( button_to_open_ = button; // Switching menu asyncnously to avoid crash. if (!switch_in_progress) { - base::PostTaskWithTraits( - FROM_HERE, {content::BrowserThread::UI}, - base::BindOnce(&views::MenuRunner::Cancel, - base::Unretained(menu_runner_.get()))); + base::PostTask(FROM_HERE, {content::BrowserThread::UI}, + base::BindOnce(&views::MenuRunner::Cancel, + base::Unretained(menu_runner_.get()))); } } diff --git a/shell/browser/web_view_guest_delegate.cc b/shell/browser/web_view_guest_delegate.cc index 15284713ad..7e802a824a 100644 --- a/shell/browser/web_view_guest_delegate.cc +++ b/shell/browser/web_view_guest_delegate.cc @@ -105,8 +105,6 @@ content::WebContents* WebViewGuestDelegate::CreateNewGuestWindow( // Code below mirrors what content::WebContentsImpl::CreateNewWindow // does for non-guest sources content::WebContents::CreateParams guest_params(create_params); - guest_params.initial_size = - embedder_web_contents_->GetContainerBounds().size(); guest_params.context = embedder_web_contents_->GetNativeView(); std::unique_ptr guest_contents = content::WebContents::Create(guest_params); diff --git a/shell/common/platform_util_win.cc b/shell/common/platform_util_win.cc index 87e389ddd5..8f5a9dd330 100644 --- a/shell/common/platform_util_win.cc +++ b/shell/common/platform_util_win.cc @@ -311,8 +311,8 @@ void ShowItemInFolderOnWorkerThread(const base::FilePath& full_path) { namespace platform_util { void ShowItemInFolder(const base::FilePath& full_path) { - base::CreateCOMSTATaskRunnerWithTraits( - {base::MayBlock(), base::TaskPriority::USER_BLOCKING}) + base::CreateCOMSTATaskRunner( + {base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_BLOCKING}) ->PostTask(FROM_HERE, base::BindOnce(&ShowItemInFolderOnWorkerThread, full_path)); } @@ -328,8 +328,8 @@ void OpenExternal(const GURL& url, const OpenExternalOptions& options, OpenExternalCallback callback) { base::PostTaskAndReplyWithResult( - base::CreateCOMSTATaskRunnerWithTraits( - {base::MayBlock(), base::TaskPriority::USER_BLOCKING}) + base::CreateCOMSTATaskRunner({base::ThreadPool(), base::MayBlock(), + base::TaskPriority::USER_BLOCKING}) .get(), FROM_HERE, base::BindOnce(&OpenExternalOnWorkerThread, url, options), std::move(callback)); diff --git a/shell/common/promise_util.h b/shell/common/promise_util.h index 334d69c127..3f88fcc56e 100644 --- a/shell/common/promise_util.h +++ b/shell/common/promise_util.h @@ -55,11 +55,10 @@ class Promise { static void ResolvePromise(Promise promise, RT result) { if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { - base::PostTaskWithTraits( - FROM_HERE, {content::BrowserThread::UI}, - base::BindOnce( - [](Promise promise, RT result) { promise.Resolve(result); }, - std::move(promise), std::move(result))); + base::PostTask(FROM_HERE, {content::BrowserThread::UI}, + base::BindOnce([](Promise promise, + RT result) { promise.Resolve(result); }, + std::move(promise), std::move(result))); } else { promise.Resolve(result); } @@ -67,7 +66,7 @@ class Promise { static void ResolveEmptyPromise(Promise promise) { if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce([](Promise promise) { promise.Resolve(); }, std::move(promise))); @@ -78,13 +77,12 @@ class Promise { static void RejectPromise(Promise promise, base::StringPiece errmsg) { if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { - base::PostTaskWithTraits( - FROM_HERE, {content::BrowserThread::UI}, - base::BindOnce( - [](Promise promise, base::StringPiece err) { - promise.RejectWithErrorMessage(err); - }, - std::move(promise), std::move(errmsg))); + base::PostTask(FROM_HERE, {content::BrowserThread::UI}, + base::BindOnce( + [](Promise promise, base::StringPiece err) { + promise.RejectWithErrorMessage(err); + }, + std::move(promise), std::move(errmsg))); } else { promise.RejectWithErrorMessage(errmsg); } diff --git a/shell/renderer/api/atom_api_renderer_ipc.cc b/shell/renderer/api/atom_api_renderer_ipc.cc index fe64d80d1a..f212ae3447 100644 --- a/shell/renderer/api/atom_api_renderer_ipc.cc +++ b/shell/renderer/api/atom_api_renderer_ipc.cc @@ -36,7 +36,7 @@ RenderFrame* GetCurrentRenderFrame() { class IPCRenderer : public mate::Wrappable { public: explicit IPCRenderer(v8::Isolate* isolate) - : task_runner_(base::CreateSingleThreadTaskRunnerWithTraits({})) { + : task_runner_(base::CreateSingleThreadTaskRunner({base::ThreadPool()})) { Init(isolate); RenderFrame* render_frame = GetCurrentRenderFrame(); DCHECK(render_frame); diff --git a/shell/renderer/renderer_client_base.cc b/shell/renderer/renderer_client_base.cc index 6a459781b2..87b3f8d503 100644 --- a/shell/renderer/renderer_client_base.cc +++ b/shell/renderer/renderer_client_base.cc @@ -54,10 +54,6 @@ #include "chrome/renderer/pepper/pepper_helper.h" #endif // BUILDFLAG(ENABLE_PEPPER_FLASH) -#if BUILDFLAG(ENABLE_TTS) -#include "chrome/renderer/tts_dispatcher.h" -#endif // BUILDFLAG(ENABLE_TTS) - #if BUILDFLAG(ENABLE_PRINTING) #include "components/printing/renderer/print_render_frame_helper.h" #include "printing/print_settings.h" @@ -275,16 +271,6 @@ void RendererClientBase::DidClearWindowObject( render_frame->GetWebFrame()->ExecuteScript(blink::WebScriptSource("void 0")); } -std::unique_ptr -RendererClientBase::OverrideSpeechSynthesizer( - blink::WebSpeechSynthesizerClient* client) { -#if BUILDFLAG(ENABLE_TTS) - return std::make_unique(client); -#else - return nullptr; -#endif -} - bool RendererClientBase::OverrideCreatePlugin( content::RenderFrame* render_frame, const blink::WebPluginParams& params, diff --git a/shell/renderer/renderer_client_base.h b/shell/renderer/renderer_client_base.h index 58ad929edd..d06cf2508d 100644 --- a/shell/renderer/renderer_client_base.h +++ b/shell/renderer/renderer_client_base.h @@ -72,8 +72,6 @@ class RendererClientBase : public content::ContentRendererClient { // content::ContentRendererClient: void RenderThreadStarted() override; void RenderFrameCreated(content::RenderFrame*) override; - std::unique_ptr OverrideSpeechSynthesizer( - blink::WebSpeechSynthesizerClient* client) override; bool OverrideCreatePlugin(content::RenderFrame* render_frame, const blink::WebPluginParams& params, blink::WebPlugin** plugin) override; diff --git a/spec-main/api-net-spec.ts b/spec-main/api-net-spec.ts index 849ae960a0..f21d69ba7f 100644 --- a/spec-main/api-net-spec.ts +++ b/spec-main/api-net-spec.ts @@ -876,7 +876,7 @@ describe('net module', () => { }) }) - it('should not follow redirect when mode is error', (done) => { + it.skip('should not follow redirect when mode is error', (done) => { respondOnce.toSingleURL((request, response) => { response.statusCode = 301 response.setHeader('Location', '/200')