From 0b85fb7ea22fd7006bfc02cf2a50437dcd5dee4d Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Tue, 22 Jan 2019 12:01:04 -0800 Subject: [PATCH] Revert "feat: upgrade to Chromium 72.0.3626.52 (#16334)" This reverts commit 1918e76913ed550a3b2738ac541de48cb9db4afa. --- .circleci/config.yml | 1 - BUILD.gn | 11 +- DEPS | 4 +- atom/app/atom_main_delegate.cc | 34 - atom/app/atom_main_delegate.h | 1 - atom/browser/api/atom_api_app.cc | 14 +- atom/browser/api/atom_api_auto_updater.cc | 4 +- atom/browser/api/atom_api_browser_view.cc | 5 +- .../api/atom_api_browser_window_mac.mm | 7 +- atom/browser/api/atom_api_debugger.cc | 4 +- atom/browser/api/atom_api_download_item.cc | 5 +- atom/browser/api/atom_api_in_app_purchase.cc | 5 +- atom/browser/api/atom_api_menu.cc | 4 +- atom/browser/api/atom_api_menu_mac.mm | 4 +- atom/browser/api/atom_api_net.cc | 7 +- atom/browser/api/atom_api_notification.cc | 5 +- atom/browser/api/atom_api_power_monitor.cc | 5 +- atom/browser/api/atom_api_screen.cc | 4 +- atom/browser/api/atom_api_session.cc | 15 +- .../api/atom_api_system_preferences.cc | 5 +- atom/browser/api/atom_api_top_level_window.cc | 5 +- atom/browser/api/atom_api_tray.cc | 4 +- atom/browser/api/atom_api_view.cc | 5 +- atom/browser/api/atom_api_web_contents.cc | 44 +- atom/browser/api/atom_api_web_contents.h | 3 +- atom/browser/api/atom_api_web_contents_mac.mm | 2 +- ...s_impl.cc => atom_api_web_contents_osr.cc} | 13 +- atom/browser/api/event_emitter.cc | 3 +- atom/browser/atom_browser_client.cc | 26 +- atom/browser/atom_browser_client.h | 7 +- atom/browser/atom_browser_context.cc | 5 + atom/browser/atom_browser_context.h | 1 + atom/browser/atom_browser_main_parts.cc | 29 +- atom/browser/atom_browser_main_parts.h | 1 + atom/browser/browser_mac.mm | 2 +- atom/browser/browser_process_impl.cc | 7 +- atom/browser/browser_process_impl.h | 6 +- atom/browser/common_web_contents_delegate.cc | 5 +- atom/browser/common_web_contents_delegate.h | 2 +- .../common_web_contents_delegate_mac.mm | 19 +- .../common_web_contents_delegate_views.cc | 9 +- atom/browser/mac/atom_application.mm | 21 - atom/browser/native_browser_view_mac.mm | 17 +- atom/browser/native_window_mac.mm | 34 +- atom/browser/native_window_views.cc | 8 - atom/browser/native_window_views.h | 1 - atom/browser/net/atom_network_delegate.cc | 6 +- atom/browser/net/atom_network_delegate.h | 6 +- .../browser/net/url_request_context_getter.cc | 10 + atom/browser/ui/certificate_trust_mac.mm | 4 +- .../atom_inspectable_web_contents_view.mm | 10 +- .../browser/ui/cocoa/atom_native_widget_mac.h | 2 +- .../ui/cocoa/atom_native_widget_mac.mm | 2 +- .../ui/cocoa/atom_ns_window_delegate.mm | 19 +- atom/browser/ui/drag_util_mac.mm | 19 +- atom/browser/ui/file_dialog_mac.mm | 9 +- .../ui/inspectable_web_contents_impl.cc | 5 +- .../ui/inspectable_web_contents_impl.h | 2 +- atom/browser/ui/message_box_mac.mm | 6 +- atom/browser/ui/views/atom_views_delegate.cc | 3 + atom/browser/ui/views/atom_views_delegate.h | 2 + atom/browser/ui/views/submenu_button.cc | 5 +- atom/browser/web_contents_preferences.cc | 27 - atom/browser/web_dialog_helper.cc | 4 +- atom/browser/web_view_guest_delegate.cc | 6 +- atom/common/api/atom_api_native_image_mac.mm | 2 +- atom/common/api/atom_bindings.cc | 6 +- atom/common/api/constructor.h | 2 +- atom/common/common_message_generator.cc | 10 +- .../native_mate_converters/blink_converter.cc | 43 +- .../native_mate_converters/blink_converter.h | 6 +- .../common/native_mate_converters/callback.cc | 16 +- atom/common/native_mate_converters/callback.h | 11 +- .../v8_value_converter.cc | 5 +- atom/common/node_bindings_win.cc | 2 +- .../api/atom_api_spell_check_client.cc | 5 +- atom/renderer/api/atom_api_web_frame.cc | 10 +- atom/renderer/content_settings_observer.cc | 1 + atom/renderer/content_settings_observer.h | 3 +- atom/utility/atom_content_utility_client.cc | 20 +- atom/utility/atom_content_utility_client.h | 5 - chromium_src/BUILD.gn | 14 +- docs/api/browser-window.md | 5 - filenames.gni | 1 - lib/browser/guest-view-manager.js | 4 +- native_mate/native_mate/dictionary.h | 4 +- native_mate/native_mate/wrappable.cc | 3 +- patches/common/boringssl/.patches | 1 + ...order_bits_for_openssl_compatibility.patch | 6 +- ...ey_key2buf_for_openssl_compatibility.patch | 2 +- ...implement_ssl_get_tlsext_status_type.patch | 58 ++ patches/common/chromium/.patches | 6 +- patches/common/chromium/accelerator.patch | 12 +- patches/common/chromium/add_realloc.patch | 8 +- .../chromium/allow_webview_file_url.patch | 4 +- .../chromium/app_indicator_icon_menu.patch | 19 + ...ink-worker-enable-csp-in-file-scheme.patch | 4 +- patches/common/chromium/blink_file_path.patch | 4 +- .../chromium/blink_fix_prototype_assert.patch | 4 +- .../chromium/blink_initialization_order.patch | 8 +- .../common/chromium/blink_local_frame.patch | 6 +- .../common/chromium/blink_world_context.patch | 12 +- .../common/chromium/boringssl_build_gn.patch | 8 +- .../chromium/browser_compositor_mac.patch | 14 +- patches/common/chromium/build_gn.patch | 4 +- .../common/chromium/can_create_window.patch | 40 +- .../common/chromium/chrome_key_systems.patch | 4 +- patches/common/chromium/color_chooser.patch | 4 +- .../common/chromium/command-ismediakey.patch | 6 +- .../common/chromium/compositor_delegate.patch | 10 +- ...r_to_prevent_locking_scheme_registry.patch | 18 +- .../chromium/content_browser_main_loop.patch | 4 +- ...cross_site_document_resource_handler.patch | 8 +- ...customizable_app_indicator_id_prefix.patch | 113 +++ patches/common/chromium/dcheck.patch | 12 +- .../common/chromium/desktop_media_list.patch | 2 +- .../common/chromium/disable-redraw-lock.patch | 14 +- .../disable_color_correct_rendering.patch | 68 +- .../disable_detach_webview_frame.patch | 4 +- patches/common/chromium/disable_hidden.patch | 6 +- .../chromium/disable_time_ticks_dcheck.patch | 27 - ...requirement_for_beforeunload_dialogs.patch | 4 +- .../common/chromium/dom_storage_limits.patch | 35 - .../exclude-a-few-test-files-from-build.patch | 4 +- .../chromium/fix_test_compilation_error.patch | 364 --------- .../chromium/fix_trackpad_scrolling.patch | 240 ++++++ .../common/chromium/frame_host_manager.patch | 16 +- .../gin_enable_disable_v8_platform.patch | 6 +- .../chromium/gritsettings_resource_ids.patch | 6 +- patches/common/chromium/ignore_rc_check.patch | 4 +- patches/common/chromium/isolate_holder.patch | 2 +- .../common/chromium/mas-audiodeviceduck.patch | 2 +- patches/common/chromium/mas-cfisobjc.patch | 6 +- .../mas-cgdisplayusesforcetogray.patch | 2 +- ...launchservicesserverconnectionstatus.patch | 2 +- .../chromium/mas_blink_no_private_api.patch | 6 +- .../common/chromium/mas_no_private_api.patch | 68 +- .../common/chromium/net_url_request_job.patch | 4 +- .../chromium/no_cache_storage_check.patch | 4 +- .../chromium/notification_provenance.patch | 2 +- .../chromium/out_of_process_instance.patch | 4 +- patches/common/chromium/pepper_flash.patch | 8 +- patches/common/chromium/printing.patch | 78 +- .../render_widget_host_view_base.patch | 14 +- .../render_widget_host_view_mac.patch | 16 +- .../chromium/resource_file_conflict.patch | 24 +- .../common/chromium/scroll_bounce_flag.patch | 4 +- .../ssl_security_state_tab_helper.patch | 25 +- .../support_mixed_sandbox_with_zygote.patch | 10 +- patches/common/chromium/tts.patch | 46 +- patches/common/chromium/web_contents.patch | 12 +- .../chromium/webgl_context_attributes.patch | 24 +- .../common/chromium/webview_cross_drag.patch | 6 +- .../common/chromium/windows_cc_wrapper.patch | 52 ++ .../worker_context_will_destroy.patch | 20 +- patches/common/config.json | 2 - patches/common/swiftshader/.patches | 1 - patches/common/swiftshader/fix_arm64.patch | 38 - patches/common/v8/.patches | 6 +- ...cherry-pick-0483e9a-from-upstream-V8.patch | 112 +++ ...cherry-pick-b87d408-from-upstream-V8.patch | 136 ++++ ...cherry-pick-073073b-from-upstream-V8.patch | 180 +++++ ...herry-pick-88f8fe1-from-upstream-V8.patch} | 104 ++- patches/common/v8/add_realloc.patch | 8 +- patches/common/v8/array_buffer.patch | 10 +- ...ild-torque-with-x64-toolchain-on-arm.patch | 18 +- patches/common/v8/build_gn.patch | 10 +- patches/common/v8/dcheck.patch | 8 +- ..._detailed_line_info_for_cpu_profiler.patch | 4 +- ...vide_more_v8_backwards_compatibility.patch | 50 +- ...ot_run_arm_arm64_mksnapshot_binaries.patch | 4 +- patches/common/v8/export_platform.patch | 4 +- patches/common/v8/expose_mksnapshot.patch | 8 +- ..._use_v8_initializers_code_in_v8_base.patch | 719 ------------------ spec/api-browser-window-spec.js | 3 +- spec/api-session-spec.js | 15 +- spec/api-web-contents-spec.js | 2 - spec/webview-spec.js | 6 +- 178 files changed, 1734 insertions(+), 2102 deletions(-) rename atom/browser/api/{atom_api_web_contents_impl.cc => atom_api_web_contents_osr.cc} (79%) create mode 100644 patches/common/boringssl/implement_ssl_get_tlsext_status_type.patch create mode 100644 patches/common/chromium/app_indicator_icon_menu.patch create mode 100644 patches/common/chromium/customizable_app_indicator_id_prefix.patch delete mode 100644 patches/common/chromium/disable_time_ticks_dcheck.patch delete mode 100644 patches/common/chromium/fix_test_compilation_error.patch create mode 100644 patches/common/chromium/fix_trackpad_scrolling.patch create mode 100644 patches/common/chromium/windows_cc_wrapper.patch delete mode 100644 patches/common/swiftshader/.patches delete mode 100644 patches/common/swiftshader/fix_arm64.patch create mode 100644 patches/common/v8/0001-deps-cherry-pick-0483e9a-from-upstream-V8.patch create mode 100644 patches/common/v8/0002-deps-cherry-pick-b87d408-from-upstream-V8.patch create mode 100644 patches/common/v8/0003-deps-cherry-pick-073073b-from-upstream-V8.patch rename patches/common/v8/{deps_cherry-pick_88f8fe1_from_upstream_v8.patch => 0004-deps-cherry-pick-88f8fe1-from-upstream-V8.patch} (69%) delete mode 100644 patches/common/v8/reland_don_t_use_v8_initializers_code_in_v8_base.patch diff --git a/.circleci/config.yml b/.circleci/config.yml index f0cc7fb085..8f6406bf08 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -167,7 +167,6 @@ step-gn-gen-default: &step-gn-gen-default step-electron-build: &step-electron-build run: name: Electron build - no_output_timeout: 30m command: | cd src ninja -C out/Default electron -j18 diff --git a/BUILD.gn b/BUILD.gn index 8d8000dc28..234a9b62c8 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1,3 +1,8 @@ +import("build/asar.gni") +import("build/npm.gni") +import("buildflags/buildflags.gni") +import("electron_paks.gni") +import("filenames.gni") import("//build/config/locales.gni") import("//build/config/ui.gni") import("//build/config/win/manifest.gni") @@ -9,11 +14,6 @@ import("//tools/grit/grit_rule.gni") import("//tools/grit/repack.gni") import("//tools/v8_context_snapshot/v8_context_snapshot.gni") import("//v8/snapshot_toolchain.gni") -import("build/asar.gni") -import("build/npm.gni") -import("buildflags/buildflags.gni") -import("electron_paks.gni") -import("filenames.gni") if (is_mac) { import("//build/config/mac/rules.gni") @@ -421,6 +421,7 @@ static_library("electron_lib") { if (enable_osr) { sources += [ + "atom/browser/api/atom_api_web_contents_osr.cc", "atom/browser/osr/osr_output_device.cc", "atom/browser/osr/osr_output_device.h", "atom/browser/osr/osr_render_widget_host_view.cc", diff --git a/DEPS b/DEPS index 8d974ffbbf..3a0b5f9037 100644 --- a/DEPS +++ b/DEPS @@ -10,9 +10,9 @@ gclient_gn_args = [ vars = { 'chromium_version': - '72.0.3626.52', + '71.0.3578.98', 'node_version': - 'ad2c89ec3be0f5db3ea02b0f591d36a5d84c51ad', + 'aeae08cda811ed122918bfd48fd9e56f8204d818', 'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b', 'pyyaml_version': '3.12', diff --git a/atom/app/atom_main_delegate.cc b/atom/app/atom_main_delegate.cc index 3dd19e84da..b68617e80a 100644 --- a/atom/app/atom_main_delegate.cc +++ b/atom/app/atom_main_delegate.cc @@ -8,10 +8,6 @@ #include #include -#if defined(OS_LINUX) -#include // for g_setenv() -#endif - #include "atom/app/atom_content_client.h" #include "atom/browser/atom_browser_client.h" #include "atom/browser/relauncher.h" @@ -186,36 +182,6 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { return false; } -void AtomMainDelegate::PostEarlyInitialization(bool is_running_tests) { - std::string custom_locale; - ui::ResourceBundle::InitSharedInstanceWithLocale( - custom_locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES); - auto* cmd_line = base::CommandLine::ForCurrentProcess(); - if (cmd_line->HasSwitch(::switches::kLang)) { - const std::string locale = cmd_line->GetSwitchValueASCII(::switches::kLang); - const base::FilePath locale_file_path = - ui::ResourceBundle::GetSharedInstance().GetLocaleFilePath(locale, true); - if (!locale_file_path.empty()) { - custom_locale = locale; -#if defined(OS_LINUX) - /* When built with USE_GLIB, libcc's GetApplicationLocaleInternal() uses - * glib's g_get_language_names(), which keys off of getenv("LC_ALL") */ - g_setenv("LC_ALL", custom_locale.c_str(), TRUE); -#endif - } - } - -#if defined(OS_MACOSX) - if (custom_locale.empty()) - l10n_util::OverrideLocaleWithCocoaLocale(); -#endif - - LoadResourceBundle(custom_locale); - - AtomBrowserClient::SetApplicationLocale( - l10n_util::GetApplicationLocale(custom_locale)); -} - void AtomMainDelegate::PreSandboxStartup() { auto* command_line = base::CommandLine::ForCurrentProcess(); diff --git a/atom/app/atom_main_delegate.h b/atom/app/atom_main_delegate.h index 3c2dfe194b..317be4804e 100644 --- a/atom/app/atom_main_delegate.h +++ b/atom/app/atom_main_delegate.h @@ -25,7 +25,6 @@ class AtomMainDelegate : public content::ContentMainDelegate { bool BasicStartupComplete(int* exit_code) override; void PreSandboxStartup() override; void PreCreateMainMessageLoop() override; - void PostEarlyInitialization(bool is_running_tests) override; content::ContentBrowserClient* CreateContentBrowserClient() override; content::ContentRendererClient* CreateContentRendererClient() override; content::ContentUtilityClient* CreateContentUtilityClient() override; diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index b959179e26..d6116db179 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -30,7 +30,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/path_service.h" -#include "base/system/sys_info.h" +#include "base/sys_info.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/icon_manager.h" #include "chrome/common/chrome_paths.h" @@ -780,24 +780,24 @@ void App::OnGpuProcessCrashed(base::TerminationStatus status) { void App::BrowserChildProcessLaunchedAndConnected( const content::ChildProcessData& data) { - ChildProcessLaunched(data.process_type, data.GetProcess().Handle()); + ChildProcessLaunched(data.process_type, data.GetHandle()); } void App::BrowserChildProcessHostDisconnected( const content::ChildProcessData& data) { - ChildProcessDisconnected(base::GetProcId(data.GetProcess().Handle())); + ChildProcessDisconnected(base::GetProcId(data.GetHandle())); } void App::BrowserChildProcessCrashed( const content::ChildProcessData& data, const content::ChildProcessTerminationInfo& info) { - ChildProcessDisconnected(base::GetProcId(data.GetProcess().Handle())); + ChildProcessDisconnected(base::GetProcId(data.GetHandle())); } void App::BrowserChildProcessKilled( const content::ChildProcessData& data, const content::ChildProcessTerminationInfo& info) { - ChildProcessDisconnected(base::GetProcId(data.GetProcess().Handle())); + ChildProcessDisconnected(base::GetProcId(data.GetHandle())); } void App::RenderProcessReady(content::RenderProcessHost* host) { @@ -1387,9 +1387,7 @@ void Initialize(v8::Local exports, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); - dict.Set("App", atom::api::App::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + dict.Set("App", atom::api::App::GetConstructor(isolate)->GetFunction()); dict.Set("app", atom::api::App::Create(isolate)); #if defined(OS_MACOSX) auto browser = base::Unretained(Browser::Get()); diff --git a/atom/browser/api/atom_api_auto_updater.cc b/atom/browser/api/atom_api_auto_updater.cc index 694f9beb54..3bee34247e 100644 --- a/atom/browser/api/atom_api_auto_updater.cc +++ b/atom/browser/api/atom_api_auto_updater.cc @@ -147,9 +147,7 @@ void Initialize(v8::Local exports, v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("autoUpdater", AutoUpdater::Create(isolate)); - dict.Set("AutoUpdater", AutoUpdater::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + dict.Set("AutoUpdater", AutoUpdater::GetConstructor(isolate)->GetFunction()); } } // namespace diff --git a/atom/browser/api/atom_api_browser_view.cc b/atom/browser/api/atom_api_browser_view.cc index 27e012a8e7..6c9578c61e 100644 --- a/atom/browser/api/atom_api_browser_view.cc +++ b/atom/browser/api/atom_api_browser_view.cc @@ -159,9 +159,8 @@ void Initialize(v8::Local exports, v8::Isolate* isolate = context->GetIsolate(); BrowserView::SetConstructor(isolate, base::Bind(&BrowserView::New)); - mate::Dictionary browser_view(isolate, BrowserView::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + mate::Dictionary browser_view( + isolate, BrowserView::GetConstructor(isolate)->GetFunction()); browser_view.SetMethod("fromId", &mate::TrackableObject::FromWeakMapID); browser_view.SetMethod("getAllViews", diff --git a/atom/browser/api/atom_api_browser_window_mac.mm b/atom/browser/api/atom_api_browser_window_mac.mm index 829a07eb57..47f6488f42 100644 --- a/atom/browser/api/atom_api_browser_window_mac.mm +++ b/atom/browser/api/atom_api_browser_window_mac.mm @@ -59,9 +59,8 @@ void BrowserWindow::OverrideNSWindowContentView(InspectableWebContents* iwc) { // Make NativeWindow use a NSView as content view. static_cast(window())->OverrideNSWindowContentView(); // Add webview to contentView. - NSView* webView = iwc->GetView()->GetNativeView().GetNativeNSView(); - NSView* contentView = - [window()->GetNativeWindow().GetNativeNSWindow() contentView]; + NSView* webView = iwc->GetView()->GetNativeView(); + NSView* contentView = [window()->GetNativeWindow() contentView]; [webView setFrame:[contentView bounds]]; // ensure that buttons view is floated to top of view hierarchy @@ -81,7 +80,7 @@ void BrowserWindow::UpdateDraggableRegions( // All ControlRegionViews should be added as children of the WebContentsView, // because WebContentsView will be removed and re-added when entering and // leaving fullscreen mode. - NSView* webView = web_contents()->GetNativeView().GetNativeNSView(); + NSView* webView = web_contents()->GetNativeView(); NSInteger webViewWidth = NSWidth([webView bounds]); NSInteger webViewHeight = NSHeight([webView bounds]); diff --git a/atom/browser/api/atom_api_debugger.cc b/atom/browser/api/atom_api_debugger.cc index 616cc827a2..536f8af682 100644 --- a/atom/browser/api/atom_api_debugger.cc +++ b/atom/browser/api/atom_api_debugger.cc @@ -194,9 +194,7 @@ void Initialize(v8::Local exports, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary(isolate, exports) - .Set("Debugger", Debugger::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + .Set("Debugger", Debugger::GetConstructor(isolate)->GetFunction()); } } // namespace diff --git a/atom/browser/api/atom_api_download_item.cc b/atom/browser/api/atom_api_download_item.cc index 0db325237c..67b2ae05ce 100644 --- a/atom/browser/api/atom_api_download_item.cc +++ b/atom/browser/api/atom_api_download_item.cc @@ -244,9 +244,8 @@ void Initialize(v8::Local exports, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary(isolate, exports) - .Set("DownloadItem", atom::api::DownloadItem::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + .Set("DownloadItem", + atom::api::DownloadItem::GetConstructor(isolate)->GetFunction()); } } // namespace diff --git a/atom/browser/api/atom_api_in_app_purchase.cc b/atom/browser/api/atom_api_in_app_purchase.cc index 1f6718ba53..af25f73181 100644 --- a/atom/browser/api/atom_api_in_app_purchase.cc +++ b/atom/browser/api/atom_api_in_app_purchase.cc @@ -132,9 +132,8 @@ void Initialize(v8::Local exports, v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("inAppPurchase", InAppPurchase::Create(isolate)); - dict.Set("InAppPurchase", InAppPurchase::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + dict.Set("InAppPurchase", + InAppPurchase::GetConstructor(isolate)->GetFunction()); #endif } diff --git a/atom/browser/api/atom_api_menu.cc b/atom/browser/api/atom_api_menu.cc index 78c84310da..f6000dbb5c 100644 --- a/atom/browser/api/atom_api_menu.cc +++ b/atom/browser/api/atom_api_menu.cc @@ -233,9 +233,7 @@ void Initialize(v8::Local exports, Menu::SetConstructor(isolate, base::Bind(&Menu::New)); mate::Dictionary dict(isolate, exports); - dict.Set( - "Menu", - Menu::GetConstructor(isolate)->GetFunction(context).ToLocalChecked()); + dict.Set("Menu", Menu::GetConstructor(isolate)->GetFunction()); #if defined(OS_MACOSX) dict.SetMethod("setApplicationMenu", &Menu::SetApplicationMenu); dict.SetMethod("sendActionToFirstResponder", diff --git a/atom/browser/api/atom_api_menu_mac.mm b/atom/browser/api/atom_api_menu_mac.mm index a4ca8b51c7..bec33b934a 100644 --- a/atom/browser/api/atom_api_menu_mac.mm +++ b/atom/browser/api/atom_api_menu_mac.mm @@ -56,7 +56,7 @@ void MenuMac::PopupOnUI(const base::WeakPtr& native_window, base::Closure callback) { if (!native_window) return; - NSWindow* nswindow = native_window->GetNativeWindow().GetNativeNSWindow(); + NSWindow* nswindow = native_window->GetNativeWindow(); auto close_callback = base::Bind( &MenuMac::OnClosed, weak_factory_.GetWeakPtr(), window_id, callback); @@ -99,7 +99,7 @@ void MenuMac::PopupOnUI(const base::WeakPtr& native_window, [popup_controllers_[window_id] setCloseCallback:close_callback]; // Make sure events can be pumped while the menu is up. - base::MessageLoopCurrent::ScopedNestableTaskAllower allow; + base::MessageLoop::ScopedNestableTaskAllower allow; // One of the events that could be pumped is |window.close()|. // User-initiated event-tracking loops protect against this by diff --git a/atom/browser/api/atom_api_net.cc b/atom/browser/api/atom_api_net.cc index fc037fb9d8..77393c9256 100644 --- a/atom/browser/api/atom_api_net.cc +++ b/atom/browser/api/atom_api_net.cc @@ -31,9 +31,7 @@ void Net::BuildPrototype(v8::Isolate* isolate, } v8::Local Net::URLRequest(v8::Isolate* isolate) { - return URLRequest::GetConstructor(isolate) - ->GetFunction(isolate->GetCurrentContext()) - .ToLocalChecked(); + return URLRequest::GetConstructor(isolate)->GetFunction(); } } // namespace api @@ -55,8 +53,7 @@ void Initialize(v8::Local exports, mate::Dictionary dict(isolate, exports); dict.Set("net", Net::Create(isolate)); - dict.Set("Net", - Net::GetConstructor(isolate)->GetFunction(context).ToLocalChecked()); + dict.Set("Net", Net::GetConstructor(isolate)->GetFunction()); } } // namespace diff --git a/atom/browser/api/atom_api_notification.cc b/atom/browser/api/atom_api_notification.cc index 0ce0d065bd..81272fc180 100644 --- a/atom/browser/api/atom_api_notification.cc +++ b/atom/browser/api/atom_api_notification.cc @@ -263,9 +263,8 @@ void Initialize(v8::Local exports, Notification::SetConstructor(isolate, base::Bind(&Notification::New)); mate::Dictionary dict(isolate, exports); - dict.Set("Notification", Notification::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + dict.Set("Notification", + Notification::GetConstructor(isolate)->GetFunction()); dict.SetMethod("isSupported", &Notification::IsSupported); } diff --git a/atom/browser/api/atom_api_power_monitor.cc b/atom/browser/api/atom_api_power_monitor.cc index bf19927078..8145a09501 100644 --- a/atom/browser/api/atom_api_power_monitor.cc +++ b/atom/browser/api/atom_api_power_monitor.cc @@ -141,9 +141,8 @@ void Initialize(v8::Local exports, v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("powerMonitor", PowerMonitor::Create(isolate)); - dict.Set("PowerMonitor", PowerMonitor::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + dict.Set("PowerMonitor", + PowerMonitor::GetConstructor(isolate)->GetFunction()); } } // namespace diff --git a/atom/browser/api/atom_api_screen.cc b/atom/browser/api/atom_api_screen.cc index 65b9e3e11f..65a11eed0c 100644 --- a/atom/browser/api/atom_api_screen.cc +++ b/atom/browser/api/atom_api_screen.cc @@ -164,9 +164,7 @@ void Initialize(v8::Local exports, v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("screen", Screen::Create(isolate)); - dict.Set( - "Screen", - Screen::GetConstructor(isolate)->GetFunction(context).ToLocalChecked()); + dict.Set("Screen", Screen::GetConstructor(isolate)->GetFunction()); } } // namespace diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index 4a41222288..65069d4904 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -444,9 +444,10 @@ void Session::ClearStorageData(mate::Arguments* args) { // https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo-deviceid MediaDeviceIDSalt::Reset(browser_context()->prefs()); } - storage_partition->ClearData(options.storage_types, options.quota_types, - options.origin, base::Time(), base::Time::Max(), - base::Bind(&OnClearStorageDataDone, callback)); + storage_partition->ClearData( + options.storage_types, options.quota_types, options.origin, + content::StoragePartition::OriginMatcherFunction(), base::Time(), + base::Time::Max(), base::Bind(&OnClearStorageDataDone, callback)); } void Session::FlushStorageData() { @@ -804,12 +805,8 @@ void Initialize(v8::Local exports, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); - dict.Set( - "Session", - Session::GetConstructor(isolate)->GetFunction(context).ToLocalChecked()); - dict.Set( - "Cookies", - Cookies::GetConstructor(isolate)->GetFunction(context).ToLocalChecked()); + dict.Set("Session", Session::GetConstructor(isolate)->GetFunction()); + dict.Set("Cookies", Cookies::GetConstructor(isolate)->GetFunction()); dict.SetMethod("fromPartition", &FromPartition); } diff --git a/atom/browser/api/atom_api_system_preferences.cc b/atom/browser/api/atom_api_system_preferences.cc index 4943fd52d5..abc3dd4f38 100644 --- a/atom/browser/api/atom_api_system_preferences.cc +++ b/atom/browser/api/atom_api_system_preferences.cc @@ -121,9 +121,8 @@ void Initialize(v8::Local exports, v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("systemPreferences", SystemPreferences::Create(isolate)); - dict.Set("SystemPreferences", SystemPreferences::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + dict.Set("SystemPreferences", + SystemPreferences::GetConstructor(isolate)->GetFunction()); } } // namespace diff --git a/atom/browser/api/atom_api_top_level_window.cc b/atom/browser/api/atom_api_top_level_window.cc index b42b0b996f..cd6ef37421 100644 --- a/atom/browser/api/atom_api_top_level_window.cc +++ b/atom/browser/api/atom_api_top_level_window.cc @@ -1179,9 +1179,8 @@ void Initialize(v8::Local exports, v8::Isolate* isolate = context->GetIsolate(); TopLevelWindow::SetConstructor(isolate, base::Bind(&TopLevelWindow::New)); - mate::Dictionary constructor(isolate, TopLevelWindow::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + mate::Dictionary constructor( + isolate, TopLevelWindow::GetConstructor(isolate)->GetFunction()); constructor.SetMethod("fromId", &mate::TrackableObject::FromWeakMapID); constructor.SetMethod("getAllWindows", diff --git a/atom/browser/api/atom_api_tray.cc b/atom/browser/api/atom_api_tray.cc index 625a828a5e..a750a57531 100644 --- a/atom/browser/api/atom_api_tray.cc +++ b/atom/browser/api/atom_api_tray.cc @@ -254,9 +254,7 @@ void Initialize(v8::Local exports, Tray::SetConstructor(isolate, base::Bind(&Tray::New)); mate::Dictionary dict(isolate, exports); - dict.Set( - "Tray", - Tray::GetConstructor(isolate)->GetFunction(context).ToLocalChecked()); + dict.Set("Tray", Tray::GetConstructor(isolate)->GetFunction()); } } // namespace diff --git a/atom/browser/api/atom_api_view.cc b/atom/browser/api/atom_api_view.cc index 4ef46cf3e7..af907d5abc 100644 --- a/atom/browser/api/atom_api_view.cc +++ b/atom/browser/api/atom_api_view.cc @@ -76,9 +76,8 @@ void Initialize(v8::Local exports, v8::Isolate* isolate = context->GetIsolate(); View::SetConstructor(isolate, base::Bind(&View::New)); - mate::Dictionary constructor( - isolate, - View::GetConstructor(isolate)->GetFunction(context).ToLocalChecked()); + mate::Dictionary constructor(isolate, + View::GetConstructor(isolate)->GetFunction()); mate::Dictionary dict(isolate, exports); dict.Set("View", constructor); diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index c0fec936e9..93b2ccb361 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -47,7 +47,6 @@ #include "atom/common/native_mate_converters/value_converter.h" #include "atom/common/options_switches.h" #include "base/message_loop/message_loop.h" -#include "base/no_destructor.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_restrictions.h" #include "base/threading/thread_task_runner_handle.h" @@ -241,7 +240,7 @@ namespace api { namespace { content::ServiceWorkerContext* GetServiceWorkerContext( - content::WebContents* web_contents) { + const content::WebContents* web_contents) { auto* context = web_contents->GetBrowserContext(); auto* site_instance = web_contents->GetSiteInstance(); if (!context || !site_instance) @@ -422,14 +421,15 @@ void WebContents::InitWithSessionAndOptions( #if defined(OS_LINUX) || defined(OS_WIN) // Update font settings. - static const base::NoDestructor params( - gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr)); - prefs->should_antialias_text = params->antialiasing; - prefs->use_subpixel_positioning = params->subpixel_positioning; - prefs->hinting = params->hinting; - prefs->use_autohinter = params->autohinter; - prefs->use_bitmaps = params->use_bitmaps; - prefs->subpixel_rendering = params->subpixel_rendering; + CR_DEFINE_STATIC_LOCAL( + const gfx::FontRenderParams, params, + (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr))); + prefs->should_antialias_text = params.antialiasing; + prefs->use_subpixel_positioning = params.subpixel_positioning; + prefs->hinting = params.hinting; + prefs->use_autohinter = params.autohinter; + prefs->use_bitmaps = params.use_bitmaps; + prefs->subpixel_rendering = params.subpixel_rendering; #endif // Save the preferences in C++. @@ -470,9 +470,9 @@ WebContents::~WebContents() { RenderViewDeleted(web_contents()->GetRenderViewHost()); if (type_ == WEB_VIEW) { - DCHECK(!web_contents()->GetOuterWebContents()) - << "Should never manually destroy an attached webview"; // For webview simply destroy the WebContents immediately. + // TODO(zcbenz): Add an internal API for webview instead of using + // destroy(), so we don't have to add a special branch here. DestroyWebContents(false /* async */); } else if (type_ == BROWSER_WINDOW && owner_window()) { // For BrowserWindow we should close the window and clean up everything @@ -617,15 +617,15 @@ void WebContents::UpdateTargetURL(content::WebContents* source, Emit("update-target-url", url); } -bool WebContents::HandleKeyboardEvent( +void WebContents::HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) { if (type_ == WEB_VIEW && embedder_) { // Send the unhandled keyboard events back to the embedder. - return embedder_->HandleKeyboardEvent(source, event); + embedder_->HandleKeyboardEvent(source, event); } else { // Go to the default keyboard handling. - return CommonWebContentsDelegate::HandleKeyboardEvent(source, event); + CommonWebContentsDelegate::HandleKeyboardEvent(source, event); } } @@ -1129,7 +1129,7 @@ void WebContents::NavigationEntryCommitted( void WebContents::SetBackgroundThrottling(bool allowed) { background_throttling_ = allowed; - auto* contents = web_contents(); + const auto* contents = web_contents(); if (!contents) { return; } @@ -1188,9 +1188,8 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) { if (!options.Get("httpReferrer", ¶ms.referrer)) { GURL http_referrer; if (options.Get("httpReferrer", &http_referrer)) - params.referrer = - content::Referrer(http_referrer.GetAsReferrer(), - network::mojom::ReferrerPolicy::kDefault); + params.referrer = content::Referrer(http_referrer.GetAsReferrer(), + blink::kWebReferrerPolicyDefault); } std::string user_agent; @@ -1794,7 +1793,7 @@ void WebContents::StartDrag(const mate::Dictionary& item, // Start dragging. if (!files.empty()) { - base::MessageLoopCurrent::ScopedNestableTaskAllower allow; + base::MessageLoop::ScopedNestableTaskAllower allow; DragFileItems(files, icon->image(), web_contents()->GetNativeView()); } else { args->ThrowError("Must specify either 'file' or 'files' option"); @@ -2150,7 +2149,6 @@ void WebContents::BuildPrototype(v8::Isolate* isolate, .SetMethod("startDrag", &WebContents::StartDrag) .SetMethod("isGuest", &WebContents::IsGuest) .SetMethod("attachToIframe", &WebContents::AttachToIframe) - .SetMethod("detachFromOuterFrame", &WebContents::DetachFromOuterFrame) .SetMethod("isOffscreen", &WebContents::IsOffScreen) #if BUILDFLAG(ENABLE_OSR) .SetMethod("startPainting", &WebContents::StartPainting) @@ -2286,9 +2284,7 @@ void Initialize(v8::Local exports, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); - dict.Set("WebContents", WebContents::GetConstructor(isolate) - ->GetFunction(context) - .ToLocalChecked()); + dict.Set("WebContents", WebContents::GetConstructor(isolate)->GetFunction()); dict.SetMethod("create", &WebContents::Create); dict.SetMethod("fromId", &mate::TrackableObject::FromWeakMapID); dict.SetMethod("getAllWebContents", diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index ee40928b39..ebf75ead18 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -242,7 +242,6 @@ class WebContents : public mate::TrackableObject, bool IsGuest() const; void AttachToIframe(content::WebContents* embedder_web_contents, int embedder_frame_id); - void DetachFromOuterFrame(); // Methods for offscreen rendering bool IsOffScreen() const; @@ -363,7 +362,7 @@ class WebContents : public mate::TrackableObject, void CloseContents(content::WebContents* source) override; void ActivateContents(content::WebContents* contents) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; - bool HandleKeyboardEvent( + void HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; content::KeyboardEventProcessingResult PreHandleKeyboardEvent( diff --git a/atom/browser/api/atom_api_web_contents_mac.mm b/atom/browser/api/atom_api_web_contents_mac.mm index 86d78c3e3d..dcf461e4f3 100644 --- a/atom/browser/api/atom_api_web_contents_mac.mm +++ b/atom/browser/api/atom_api_web_contents_mac.mm @@ -17,7 +17,7 @@ bool WebContents::IsFocused() const { return false; if (GetType() != BACKGROUND_PAGE) { - auto window = [web_contents()->GetNativeView().GetNativeNSView() window]; + auto window = [web_contents()->GetNativeView() window]; // On Mac the render widget host view does not lose focus when the window // loses focus so check if the top level window is the key window. if (window && ![window isKeyWindow]) diff --git a/atom/browser/api/atom_api_web_contents_impl.cc b/atom/browser/api/atom_api_web_contents_osr.cc similarity index 79% rename from atom/browser/api/atom_api_web_contents_impl.cc rename to atom/browser/api/atom_api_web_contents_osr.cc index 7f76e75e32..7c2aadacfd 100644 --- a/atom/browser/api/atom_api_web_contents_impl.cc +++ b/atom/browser/api/atom_api_web_contents_osr.cc @@ -4,12 +4,9 @@ #include "atom/browser/api/atom_api_web_contents.h" -#include "content/browser/web_contents/web_contents_impl.h" - -#if BUILDFLAG(ENABLE_OSR) #include "atom/browser/osr/osr_render_widget_host_view.h" #include "atom/browser/osr/osr_web_contents_view.h" -#endif +#include "content/browser/web_contents/web_contents_impl.h" // Including both web_contents_impl.h and node.h would introduce a error, we // have to isolate the usage of WebContentsImpl into a clean file to fix it: @@ -19,13 +16,6 @@ namespace atom { namespace api { -void WebContents::DetachFromOuterFrame() { - // See detach_webview_frame.patch on how to detach. - auto* impl = static_cast(web_contents()); - impl->GetRenderManagerForTesting()->RemoveOuterDelegateFrame(); -} - -#if BUILDFLAG(ENABLE_OSR) OffScreenWebContentsView* WebContents::GetOffScreenWebContentsView() const { if (IsOffScreen()) { const auto* impl = @@ -45,7 +35,6 @@ OffScreenRenderWidgetHostView* WebContents::GetOffScreenRenderWidgetHostView() return nullptr; } } -#endif } // namespace api diff --git a/atom/browser/api/event_emitter.cc b/atom/browser/api/event_emitter.cc index b3cdb21d13..a924225fcc 100644 --- a/atom/browser/api/event_emitter.cc +++ b/atom/browser/api/event_emitter.cc @@ -35,8 +35,7 @@ v8::Local CreateEventObject(v8::Isolate* isolate) { } return v8::Local::New(isolate, event_template) - ->NewInstance(isolate->GetCurrentContext()) - .ToLocalChecked(); + ->NewInstance(); } } // namespace diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index 7ff72c9dd7..e1fc85772e 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -95,7 +95,6 @@ #endif // BUILDFLAG(OVERRIDE_LOCATION_PROVIDER) #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) @@ -159,6 +158,8 @@ AtomBrowserClient* AtomBrowserClient::Get() { // static void AtomBrowserClient::SetApplicationLocale(const std::string& locale) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (!BrowserThread::IsThreadInitialized(BrowserThread::IO) || !base::PostTaskWithTraits( FROM_HERE, {BrowserThread::IO}, @@ -367,14 +368,6 @@ AtomBrowserClient::CreateSpeechRecognitionManagerDelegate() { return new AtomSpeechRecognitionManagerDelegate; } -content::TtsControllerDelegate* AtomBrowserClient::GetTtsControllerDelegate() { -#if BUILDFLAG(ENABLE_TTS) - return TtsControllerDelegateImpl::GetInstance(); -#else - return nullptr; -#endif -} - void AtomBrowserClient::OverrideWebkitPrefs(content::RenderViewHost* host, content::WebPreferences* prefs) { prefs->javascript_enabled = true; @@ -543,17 +536,6 @@ AtomBrowserClient::CreateQuotaPermissionContext() { return new AtomQuotaPermissionContext; } -content::GeneratedCodeCacheSettings -AtomBrowserClient::GetGeneratedCodeCacheSettings( - content::BrowserContext* context) { - // TODO(deepak1556): Use platform cache directory. - base::FilePath cache_path = context->GetPath(); - // If we pass 0 for size, disk_cache will pick a default size using the - // heuristics based on available disk size. These are implemented in - // disk_cache::PreferredCacheSize in net/disk_cache/cache_util.cc. - return content::GeneratedCodeCacheSettings(true, 0, cache_path); -} - void AtomBrowserClient::AllowCertificateError( content::WebContents* web_contents, int cert_error, @@ -822,9 +804,7 @@ bool AtomBrowserClient::HandleExternalProtocol( content::NavigationUIData* navigation_data, bool is_main_frame, ui::PageTransition page_transition, - bool has_user_gesture, - const std::string& method, - const net::HttpRequestHeaders& headers) { + bool has_user_gesture) { base::PostTaskWithTraits( FROM_HERE, {BrowserThread::UI}, base::BindOnce(&HandleExternalProtocolInUI, url, web_contents_getter, diff --git a/atom/browser/atom_browser_client.h b/atom/browser/atom_browser_client.h index 4beef4223e..20f84a51f7 100644 --- a/atom/browser/atom_browser_client.h +++ b/atom/browser/atom_browser_client.h @@ -74,7 +74,6 @@ class AtomBrowserClient : public content::ContentBrowserClient, service_manager::mojom::ServiceRequest* service_request) override; content::SpeechRecognitionManagerDelegate* CreateSpeechRecognitionManagerDelegate() override; - content::TtsControllerDelegate* GetTtsControllerDelegate() override; void OverrideWebkitPrefs(content::RenderViewHost* render_view_host, content::WebPreferences* prefs) override; SiteInstanceForNavigationType ShouldOverrideSiteInstanceForNavigation( @@ -92,8 +91,6 @@ class AtomBrowserClient : public content::ContentBrowserClient, void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override; std::string GetGeolocationApiKey() override; content::QuotaPermissionContext* CreateQuotaPermissionContext() override; - content::GeneratedCodeCacheSettings GetGeneratedCodeCacheSettings( - content::BrowserContext* context) override; void AllowCertificateError( content::WebContents* web_contents, int cert_error, @@ -168,9 +165,7 @@ class AtomBrowserClient : public content::ContentBrowserClient, content::NavigationUIData* navigation_data, bool is_main_frame, ui::PageTransition page_transition, - bool has_user_gesture, - const std::string& method, - const net::HttpRequestHeaders& headers) override; + bool has_user_gesture) override; private: struct ProcessPreferences { diff --git a/atom/browser/atom_browser_context.cc b/atom/browser/atom_browser_context.cc index 55f783c185..7832255a23 100644 --- a/atom/browser/atom_browser_context.cc +++ b/atom/browser/atom_browser_context.cc @@ -191,6 +191,11 @@ base::FilePath AtomBrowserContext::GetPath() const { return path_; } +base::FilePath AtomBrowserContext::GetCachePath() const { + // TODO(deepak1556): Use platform cache directory. + return path_; +} + bool AtomBrowserContext::IsOffTheRecord() const { return in_memory_; } diff --git a/atom/browser/atom_browser_context.h b/atom/browser/atom_browser_context.h index 782d04f2a6..b2a75b31bd 100644 --- a/atom/browser/atom_browser_context.h +++ b/atom/browser/atom_browser_context.h @@ -60,6 +60,7 @@ class AtomBrowserContext // content::BrowserContext: base::FilePath GetPath() const override; + base::FilePath GetCachePath() const override; bool IsOffTheRecord() const override; content::ResourceContext* GetResourceContext() override; std::unique_ptr CreateZoomLevelDelegate( diff --git a/atom/browser/atom_browser_main_parts.cc b/atom/browser/atom_browser_main_parts.cc index 3140af8cbc..e55bb57956 100644 --- a/atom/browser/atom_browser_main_parts.cc +++ b/atom/browser/atom_browser_main_parts.cc @@ -47,7 +47,9 @@ #include "services/device/public/mojom/constants.mojom.h" #include "services/service_manager/public/cpp/connector.h" #include "ui/base/idle/idle.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/material_design/material_design_controller.h" +#include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_switches.h" #if defined(USE_AURA) @@ -71,7 +73,6 @@ #if defined(OS_WIN) #include "ui/base/cursor/cursor_loader_win.h" -#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util_win.h" #include "ui/display/win/dpi.h" #include "ui/gfx/platform_font_win.h" @@ -354,6 +355,9 @@ int AtomBrowserMainParts::PreCreateThreads() { layout_provider_.reset(new views::LayoutProvider()); // Initialize the app locale. + AtomBrowserClient::SetApplicationLocale( + l10n_util::GetApplicationLocale(custom_locale_)); + fake_browser_process_->SetApplicationLocale( AtomBrowserClient::Get()->GetApplicationLocale()); @@ -509,6 +513,29 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() { #endif void AtomBrowserMainParts::PreMainMessageLoopStartCommon() { + // Initialize ui::ResourceBundle. + ui::ResourceBundle::InitSharedInstanceWithLocale( + "", nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); + auto* cmd_line = base::CommandLine::ForCurrentProcess(); + if (cmd_line->HasSwitch(switches::kLang)) { + const std::string locale = cmd_line->GetSwitchValueASCII(switches::kLang); + const base::FilePath locale_file_path = + ui::ResourceBundle::GetSharedInstance().GetLocaleFilePath(locale, true); + if (!locale_file_path.empty()) { + custom_locale_ = locale; +#if defined(OS_LINUX) + /* When built with USE_GLIB, libcc's GetApplicationLocaleInternal() uses + * glib's g_get_language_names(), which keys off of getenv("LC_ALL") */ + g_setenv("LC_ALL", custom_locale_.c_str(), TRUE); +#endif + } + } + +#if defined(OS_MACOSX) + if (custom_locale_.empty()) + l10n_util::OverrideLocaleWithCocoaLocale(); +#endif + LoadResourceBundle(custom_locale_); #if defined(OS_MACOSX) InitializeMainNib(); #endif diff --git a/atom/browser/atom_browser_main_parts.h b/atom/browser/atom_browser_main_parts.h index 930675a8bf..dee3ff6a83 100644 --- a/atom/browser/atom_browser_main_parts.h +++ b/atom/browser/atom_browser_main_parts.h @@ -112,6 +112,7 @@ class AtomBrowserMainParts : public content::BrowserMainParts { #endif std::unique_ptr layout_provider_; + std::string custom_locale_; // A fake BrowserProcess object that used to feed the source code from chrome. std::unique_ptr fake_browser_process_; diff --git a/atom/browser/browser_mac.mm b/atom/browser/browser_mac.mm index 2d64a9b525..415f2217df 100644 --- a/atom/browser/browser_mac.mm +++ b/atom/browser/browser_mac.mm @@ -325,7 +325,7 @@ std::string Browser::DockGetBadgeText() { void Browser::DockHide() { for (auto* const& window : WindowList::GetWindows()) - [window->GetNativeWindow().GetNativeNSWindow() setCanHide:NO]; + [window->GetNativeWindow() setCanHide:NO]; ProcessSerialNumber psn = {0, kCurrentProcess}; TransformProcessType(&psn, kProcessTransformToUIElementApplication); diff --git a/atom/browser/browser_process_impl.cc b/atom/browser/browser_process_impl.cc index 56fb4df360..1b3a0a16ae 100644 --- a/atom/browser/browser_process_impl.cc +++ b/atom/browser/browser_process_impl.cc @@ -258,7 +258,7 @@ BrowserProcessImpl::safe_browsing_detection_service() { return nullptr; } -subresource_filter::RulesetService* +subresource_filter::ContentRulesetService* BrowserProcessImpl::subresource_filter_ruleset_service() { return nullptr; } @@ -299,11 +299,6 @@ gcm::GCMDriver* BrowserProcessImpl::gcm_driver() { return nullptr; } -resource_coordinator::ResourceCoordinatorParts* -BrowserProcessImpl::resource_coordinator_parts() { - return nullptr; -} - resource_coordinator::TabManager* BrowserProcessImpl::GetTabManager() { return nullptr; } diff --git a/atom/browser/browser_process_impl.h b/atom/browser/browser_process_impl.h index d24e7c79e4..ef02da4878 100644 --- a/atom/browser/browser_process_impl.h +++ b/atom/browser/browser_process_impl.h @@ -86,8 +86,8 @@ class BrowserProcessImpl : public BrowserProcess { safe_browsing::SafeBrowsingService* safe_browsing_service() override; safe_browsing::ClientSideDetectionService* safe_browsing_detection_service() override; - subresource_filter::RulesetService* subresource_filter_ruleset_service() - override; + subresource_filter::ContentRulesetService* + subresource_filter_ruleset_service() override; optimization_guide::OptimizationGuideService* optimization_guide_service() override; net_log::ChromeNetLog* net_log() override; @@ -98,8 +98,6 @@ class BrowserProcessImpl : public BrowserProcess { WebRtcLogUploader* webrtc_log_uploader() override; network_time::NetworkTimeTracker* network_time_tracker() override; gcm::GCMDriver* gcm_driver() override; - resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts() - override; resource_coordinator::TabManager* GetTabManager() override; shell_integration::DefaultWebClientState CachedDefaultWebClientState() override; diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index 0a95d50210..b25014bbcd 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -20,7 +20,6 @@ #include "base/files/file_util.h" #include "base/json/json_reader.h" #include "base/task/post_task.h" -#include "base/threading/scoped_blocking_call.h" #include "base/threading/sequenced_task_runner_handle.h" #include "chrome/browser/ssl/security_state_tab_helper.h" #include "chrome/browser/ui/browser_dialogs.h" @@ -122,14 +121,14 @@ std::unique_ptr CreateFileSystemValue( } void WriteToFile(const base::FilePath& path, const std::string& content) { - base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::WILL_BLOCK); + base::AssertBlockingAllowed(); DCHECK(!path.empty()); base::WriteFile(path, content.data(), content.size()); } void AppendToFile(const base::FilePath& path, const std::string& content) { - base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::WILL_BLOCK); + base::AssertBlockingAllowed(); DCHECK(!path.empty()); base::AppendToFile(path, content.data(), content.size()); diff --git a/atom/browser/common_web_contents_delegate.h b/atom/browser/common_web_contents_delegate.h index d38aa16082..f575e9872d 100644 --- a/atom/browser/common_web_contents_delegate.h +++ b/atom/browser/common_web_contents_delegate.h @@ -100,7 +100,7 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate, content::WebContents* web_contents, content::SecurityStyleExplanations* explanations) override; bool TakeFocus(content::WebContents* source, bool reverse) override; - bool HandleKeyboardEvent( + void HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; diff --git a/atom/browser/common_web_contents_delegate_mac.mm b/atom/browser/common_web_contents_delegate_mac.mm index a1d7b3e5ed..f8f7fafc6f 100644 --- a/atom/browser/common_web_contents_delegate_mac.mm +++ b/atom/browser/common_web_contents_delegate_mac.mm @@ -17,40 +17,33 @@ namespace atom { -bool CommonWebContentsDelegate::HandleKeyboardEvent( +void CommonWebContentsDelegate::HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) { if (event.skip_in_browser || event.GetType() == content::NativeWebKeyboardEvent::kChar) - return false; + return; // Escape exits tabbed fullscreen mode. if (event.windows_key_code == ui::VKEY_ESCAPE && is_html_fullscreen()) { ExitFullscreenModeForTab(source); - return true; + return; } // Check if the webContents has preferences and to ignore shortcuts auto* web_preferences = WebContentsPreferences::From(source); if (web_preferences && web_preferences->IsEnabled("ignoreMenuShortcuts", false)) - return false; + return; // Send the event to the menu before sending it to the window if (event.os_event.type == NSKeyDown && [[NSApp mainMenu] performKeyEquivalent:event.os_event]) - return true; + return; if (event.os_event.window && - [event.os_event.window isKindOfClass:[EventDispatchingWindow class]]) { + [event.os_event.window isKindOfClass:[EventDispatchingWindow class]]) [event.os_event.window redispatchKeyEvent:event.os_event]; - // FIXME(nornagon): this isn't the right return value; we should implement - // devtools windows as Widgets in order to take advantage of the - // pre-existing redispatch code in bridged_native_widget. - return false; - } - - return false; } } // namespace atom diff --git a/atom/browser/common_web_contents_delegate_views.cc b/atom/browser/common_web_contents_delegate_views.cc index 5170bd1cbf..c1b1f5e57e 100644 --- a/atom/browser/common_web_contents_delegate_views.cc +++ b/atom/browser/common_web_contents_delegate_views.cc @@ -17,28 +17,25 @@ namespace atom { -bool CommonWebContentsDelegate::HandleKeyboardEvent( +void CommonWebContentsDelegate::HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) { // Escape exits tabbed fullscreen mode. if (event.windows_key_code == ui::VKEY_ESCAPE && is_html_fullscreen()) { ExitFullscreenModeForTab(source); - return true; + return; } // Check if the webContents has preferences and to ignore shortcuts auto* web_preferences = WebContentsPreferences::From(source); if (web_preferences && web_preferences->IsEnabled("ignoreMenuShortcuts", false)) - return false; + return; // Let the NativeWindow handle other parts. if (owner_window()) { owner_window()->HandleKeyboardEvent(source, event); - return true; } - - return false; } void CommonWebContentsDelegate::ShowAutofillPopup( diff --git a/atom/browser/mac/atom_application.mm b/atom/browser/mac/atom_application.mm index 8c7eb7f60f..eb00a415bf 100644 --- a/atom/browser/mac/atom_application.mm +++ b/atom/browser/mac/atom_application.mm @@ -8,11 +8,8 @@ #import "atom/browser/mac/atom_application_delegate.h" #include "atom/browser/mac/dict_util.h" #include "base/auto_reset.h" -#include "base/observer_list.h" #include "base/strings/sys_string_conversions.h" #include "content/public/browser/browser_accessibility_state.h" -#include "content/public/browser/native_event_processor_mac.h" -#include "content/public/browser/native_event_processor_observer_mac.h" namespace { @@ -25,12 +22,6 @@ inline void dispatch_sync_main(dispatch_block_t block) { } // namespace -@interface AtomApplication () { - base::ObserverList::Unchecked - observers_; -} -@end - @implementation AtomApplication + (AtomApplication*)sharedApplication { @@ -57,8 +48,6 @@ inline void dispatch_sync_main(dispatch_block_t block) { - (void)sendEvent:(NSEvent*)event { base::AutoReset scoper(&handlingSendEvent_, YES); - content::ScopedNotifyNativeEventProcessorObserver scopedObserverNotifier( - &observers_, event); [super sendEvent:event]; } @@ -199,14 +188,4 @@ inline void dispatch_sync_main(dispatch_block_t block) { atom::Browser::Get()->ShowAboutPanel(); } -- (void)addNativeEventProcessorObserver: - (content::NativeEventProcessorObserver*)observer { - observers_.AddObserver(observer); -} - -- (void)removeNativeEventProcessorObserver: - (content::NativeEventProcessorObserver*)observer { - observers_.RemoveObserver(observer); -} - @end diff --git a/atom/browser/native_browser_view_mac.mm b/atom/browser/native_browser_view_mac.mm index c0a1f64113..b8a822ca4d 100644 --- a/atom/browser/native_browser_view_mac.mm +++ b/atom/browser/native_browser_view_mac.mm @@ -160,8 +160,7 @@ namespace atom { NativeBrowserViewMac::NativeBrowserViewMac( InspectableWebContents* inspectable_web_contents) : NativeBrowserView(inspectable_web_contents) { - auto* view = - GetInspectableWebContentsView()->GetNativeView().GetNativeNSView(); + auto* view = GetInspectableWebContentsView()->GetNativeView(); view.autoresizingMask = kDefaultAutoResizingMask; } @@ -176,14 +175,12 @@ void NativeBrowserViewMac::SetAutoResizeFlags(uint8_t flags) { autoresizing_mask |= NSViewHeightSizable; } - auto* view = - GetInspectableWebContentsView()->GetNativeView().GetNativeNSView(); + auto* view = GetInspectableWebContentsView()->GetNativeView(); view.autoresizingMask = autoresizing_mask; } void NativeBrowserViewMac::SetBounds(const gfx::Rect& bounds) { - auto* view = - GetInspectableWebContentsView()->GetNativeView().GetNativeNSView(); + auto* view = GetInspectableWebContentsView()->GetNativeView(); auto* superview = view.superview; const auto superview_height = superview ? superview.frame.size.height : 0; view.frame = @@ -192,17 +189,15 @@ void NativeBrowserViewMac::SetBounds(const gfx::Rect& bounds) { } void NativeBrowserViewMac::SetBackgroundColor(SkColor color) { - auto* view = - GetInspectableWebContentsView()->GetNativeView().GetNativeNSView(); + auto* view = GetInspectableWebContentsView()->GetNativeView(); view.wantsLayer = YES; view.layer.backgroundColor = skia::CGColorCreateFromSkColor(color); } void NativeBrowserViewMac::UpdateDraggableRegions( const std::vector& drag_exclude_rects) { - NSView* web_view = GetWebContents()->GetNativeView().GetNativeNSView(); - NSView* inspectable_view = - GetInspectableWebContentsView()->GetNativeView().GetNativeNSView(); + NSView* web_view = GetWebContents()->GetNativeView(); + NSView* inspectable_view = GetInspectableWebContentsView()->GetNativeView(); NSView* window_content_view = inspectable_view.superview; const auto window_content_view_height = NSHeight(window_content_view.bounds); diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 2600d9b201..db1d61b568 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -347,8 +347,7 @@ NativeWindowMac::NativeWindowMac(const mate::Dictionary& options, params.type = views::Widget::InitParams::TYPE_WINDOW; params.native_widget = new AtomNativeWidgetMac(this, styleMask, widget()); widget()->Init(params); - window_ = static_cast( - widget()->GetNativeWindow().GetNativeNSWindow()); + window_ = static_cast(widget()->GetNativeWindow()); [window_ setEnableLargerThanScreen:enable_larger_than_screen()]; @@ -498,7 +497,7 @@ void NativeWindowMac::SetContentView(views::View* view) { void NativeWindowMac::Close() { // When this is a sheet showing, performClose won't work. if (is_modal() && parent() && IsVisible()) { - [parent()->GetNativeWindow().GetNativeNSWindow() endSheet:window_]; + [parent()->GetNativeWindow() endSheet:window_]; CloseImmediately(); return; } @@ -546,10 +545,9 @@ bool NativeWindowMac::IsFocused() { void NativeWindowMac::Show() { if (is_modal() && parent()) { if ([window_ sheetParent] == nil) - [parent()->GetNativeWindow().GetNativeNSWindow() - beginSheet:window_ - completionHandler:^(NSModalResponse){ - }]; + [parent()->GetNativeWindow() beginSheet:window_ + completionHandler:^(NSModalResponse){ + }]; return; } @@ -575,7 +573,7 @@ void NativeWindowMac::ShowInactive() { void NativeWindowMac::Hide() { if (is_modal() && parent()) { [window_ orderOut:nil]; - [parent()->GetNativeWindow().GetNativeNSWindow() endSheet:window_]; + [parent()->GetNativeWindow() endSheet:window_]; return; } @@ -899,7 +897,7 @@ void NativeWindowMac::FlashFrame(bool flash) { void NativeWindowMac::SetSkipTaskbar(bool skip) {} void NativeWindowMac::SetSimpleFullScreen(bool simple_fullscreen) { - NSWindow* window = GetNativeWindow().GetNativeNSWindow(); + NSWindow* window = GetNativeWindow(); if (simple_fullscreen && !is_simple_fullscreen_) { is_simple_fullscreen_ = true; @@ -1081,8 +1079,7 @@ void NativeWindowMac::AddBrowserView(NativeBrowserView* view) { } add_browser_view(view); - auto* native_view = - view->GetInspectableWebContentsView()->GetNativeView().GetNativeNSView(); + auto* native_view = view->GetInspectableWebContentsView()->GetNativeView(); [[window_ contentView] addSubview:native_view positioned:NSWindowAbove relativeTo:nil]; @@ -1100,8 +1097,7 @@ void NativeWindowMac::RemoveBrowserView(NativeBrowserView* view) { return; } - [view->GetInspectableWebContentsView()->GetNativeView().GetNativeNSView() - removeFromSuperview]; + [view->GetInspectableWebContentsView()->GetNativeView() removeFromSuperview]; remove_browser_view(view); [CATransaction commit]; @@ -1216,12 +1212,11 @@ void NativeWindowMac::ToggleTabBar() { } bool NativeWindowMac::AddTabbedWindow(NativeWindow* window) { - if (window_ == window->GetNativeWindow().GetNativeNSWindow()) { + if (window_ == window->GetNativeWindow()) { return false; } else { if (@available(macOS 10.12, *)) - [window_ addTabbedWindow:window->GetNativeWindow().GetNativeNSWindow() - ordered:NSWindowAbove]; + [window_ addTabbedWindow:window->GetNativeWindow() ordered:NSWindowAbove]; } return true; } @@ -1446,8 +1441,7 @@ void NativeWindowMac::InternalSetParentWindow(NativeWindow* parent, NativeWindow::SetParentWindow(parent); // Do not remove/add if we are already properly attached. - if (attach && parent && - [window_ parentWindow] == parent->GetNativeWindow().GetNativeNSWindow()) + if (attach && parent && [window_ parentWindow] == parent->GetNativeWindow()) return; // Remove current parent window. @@ -1457,9 +1451,7 @@ void NativeWindowMac::InternalSetParentWindow(NativeWindow* parent, // Set new parent window. // Note that this method will force the window to become visible. if (parent && attach) - [parent->GetNativeWindow().GetNativeNSWindow() - addChildWindow:window_ - ordered:NSWindowAbove]; + [parent->GetNativeWindow() addChildWindow:window_ ordered:NSWindowAbove]; } void NativeWindowMac::ShowWindowButton(NSWindowButton button) { diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 6e75cbfe40..c774b9b459 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -1216,14 +1216,6 @@ void NativeWindowViews::OnWidgetBoundsChanged(views::Widget* changed_widget, } } -void NativeWindowViews::OnWidgetDestroying(views::Widget* widget) { -#if defined(OS_LINUX) - aura::Window* window = GetNativeWindow(); - if (window) - window->RemovePreTargetHandler(this); -#endif -} - void NativeWindowViews::DeleteDelegate() { if (is_modal() && this->parent()) { auto* parent = this->parent(); diff --git a/atom/browser/native_window_views.h b/atom/browser/native_window_views.h index fa207e6314..2d4ab3ec19 100644 --- a/atom/browser/native_window_views.h +++ b/atom/browser/native_window_views.h @@ -161,7 +161,6 @@ class NativeWindowViews : public NativeWindow, void AutoresizeBrowserView(int width_delta, int height_delta, NativeBrowserView* browser_view); - void OnWidgetDestroying(views::Widget* widget) override; // views::WidgetDelegate: void DeleteDelegate() override; views::View* GetInitiallyFocusedView() override; diff --git a/atom/browser/net/atom_network_delegate.cc b/atom/browser/net/atom_network_delegate.cc index a279fcd3b0..d1711a2e0c 100644 --- a/atom/browser/net/atom_network_delegate.cc +++ b/atom/browser/net/atom_network_delegate.cc @@ -419,12 +419,16 @@ bool AtomNetworkDelegate::OnCanAccessFile( return true; } -bool AtomNetworkDelegate::OnForcePrivacyMode( +bool AtomNetworkDelegate::OnCanEnablePrivacyMode( const GURL& url, const GURL& first_party_for_cookies) const { return false; } +bool AtomNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { + return true; +} + bool AtomNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( const net::URLRequest& request, const GURL& target_url, diff --git a/atom/browser/net/atom_network_delegate.h b/atom/browser/net/atom_network_delegate.h index 5a6b1c528f..f5bf09482e 100644 --- a/atom/browser/net/atom_network_delegate.h +++ b/atom/browser/net/atom_network_delegate.h @@ -127,8 +127,10 @@ class AtomNetworkDelegate : public net::NetworkDelegate { bool OnCanAccessFile(const net::URLRequest& request, const base::FilePath& original_path, const base::FilePath& absolute_path) const override; - bool OnForcePrivacyMode(const GURL& url, - const GURL& first_party_for_cookies) const override; + bool OnCanEnablePrivacyMode( + const GURL& url, + const GURL& first_party_for_cookies) const override; + bool OnAreExperimentalCookieFeaturesEnabled() const override; bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( const net::URLRequest& request, const GURL& target_url, diff --git a/atom/browser/net/url_request_context_getter.cc b/atom/browser/net/url_request_context_getter.cc index 70d8c8b02a..63af667135 100644 --- a/atom/browser/net/url_request_context_getter.cc +++ b/atom/browser/net/url_request_context_getter.cc @@ -107,7 +107,15 @@ class ResourceContext : public content::ResourceContext { ResourceContext() = default; ~ResourceContext() override = default; + net::URLRequestContext* GetRequestContext() override { + return request_context_; + } + private: + friend class URLRequestContextGetter; + + net::URLRequestContext* request_context_ = nullptr; + DISALLOW_COPY_AND_ASSIGN(ResourceContext); }; @@ -324,6 +332,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { } top_job_factory_->Chain(std::move(inner_job_factory)); url_request_context_->set_job_factory(top_job_factory_.get()); + + context_handle_->resource_context_->request_context_ = url_request_context_; } return url_request_context_; diff --git a/atom/browser/ui/certificate_trust_mac.mm b/atom/browser/ui/certificate_trust_mac.mm index 929eb559a6..db0ebd6c17 100644 --- a/atom/browser/ui/certificate_trust_mac.mm +++ b/atom/browser/ui/certificate_trust_mac.mm @@ -92,9 +92,7 @@ void ShowCertificateTrust(atom::NativeWindow* parent_window, SecTrustRef trust = nullptr; SecTrustCreateWithCertificates(cert_chain, sec_policy, &trust); - NSWindow* window = parent_window - ? parent_window->GetNativeWindow().GetNativeNSWindow() - : nil; + NSWindow* window = parent_window ? parent_window->GetNativeWindow() : nil; auto msg = base::SysUTF8ToNSString(message); auto panel = [[SFCertificateTrustPanel alloc] init]; diff --git a/atom/browser/ui/cocoa/atom_inspectable_web_contents_view.mm b/atom/browser/ui/cocoa/atom_inspectable_web_contents_view.mm index 9189470d89..f61eb2bdaf 100644 --- a/atom/browser/ui/cocoa/atom_inspectable_web_contents_view.mm +++ b/atom/browser/ui/cocoa/atom_inspectable_web_contents_view.mm @@ -43,7 +43,7 @@ } else { auto* contents = inspectableWebContentsView_->inspectable_web_contents() ->GetWebContents(); - auto* contentsView = contents->GetNativeView().GetNativeNSView(); + auto contentsView = contents->GetNativeView(); [contentsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [self addSubview:contentsView]; } @@ -79,7 +79,7 @@ inspectableWebContentsView_->inspectable_web_contents(); auto* devToolsWebContents = inspectable_web_contents->GetDevToolsWebContents(); - auto* devToolsView = devToolsWebContents->GetNativeView().GetNativeNSView(); + auto devToolsView = devToolsWebContents->GetNativeView(); devtools_visible_ = visible; if (devtools_docked_) { @@ -134,7 +134,7 @@ inspectableWebContentsView_->inspectable_web_contents(); auto* devToolsWebContents = inspectable_web_contents->GetDevToolsWebContents(); - auto devToolsView = devToolsWebContents->GetNativeView().GetNativeNSView(); + auto devToolsView = devToolsWebContents->GetNativeView(); auto styleMask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSMiniaturizableWindowMask | NSWindowStyleMaskResizable | @@ -203,7 +203,7 @@ if (!inspectable_web_contents || inspectable_web_contents->IsGuest()) return; auto* webContents = inspectable_web_contents->GetWebContents(); - auto* webContentsView = webContents->GetNativeView().GetNativeNSView(); + auto webContentsView = webContents->GetNativeView(); NSView* view = [notification object]; if ([[webContentsView subviews] containsObject:view]) { @@ -215,7 +215,7 @@ inspectable_web_contents->GetDevToolsWebContents(); if (!devToolsWebContents) return; - auto devToolsView = devToolsWebContents->GetNativeView().GetNativeNSView(); + auto devToolsView = devToolsWebContents->GetNativeView(); if ([[devToolsView subviews] containsObject:view]) { devtools_is_first_responder_ = YES; diff --git a/atom/browser/ui/cocoa/atom_native_widget_mac.h b/atom/browser/ui/cocoa/atom_native_widget_mac.h index a86e239c1e..c41d102fcd 100644 --- a/atom/browser/ui/cocoa/atom_native_widget_mac.h +++ b/atom/browser/ui/cocoa/atom_native_widget_mac.h @@ -21,7 +21,7 @@ class AtomNativeWidgetMac : public views::NativeWidgetMac { protected: // NativeWidgetMac: NativeWidgetMacNSWindow* CreateNSWindow( - const views_bridge_mac::mojom::CreateWindowParams* params) override; + const views::Widget::InitParams& params) override; private: NativeWindowMac* shell_; diff --git a/atom/browser/ui/cocoa/atom_native_widget_mac.mm b/atom/browser/ui/cocoa/atom_native_widget_mac.mm index 5b5f2206e0..0eccfb093e 100644 --- a/atom/browser/ui/cocoa/atom_native_widget_mac.mm +++ b/atom/browser/ui/cocoa/atom_native_widget_mac.mm @@ -19,7 +19,7 @@ AtomNativeWidgetMac::AtomNativeWidgetMac( AtomNativeWidgetMac::~AtomNativeWidgetMac() {} NativeWidgetMacNSWindow* AtomNativeWidgetMac::CreateNSWindow( - const views_bridge_mac::mojom::CreateWindowParams* params) { + const views::Widget::InitParams& params) { return [[[AtomNSWindow alloc] initWithShell:shell_ styleMask:style_mask_] autorelease]; } diff --git a/atom/browser/ui/cocoa/atom_ns_window_delegate.mm b/atom/browser/ui/cocoa/atom_ns_window_delegate.mm index 7f1038ca3b..dce3e6f81b 100644 --- a/atom/browser/ui/cocoa/atom_ns_window_delegate.mm +++ b/atom/browser/ui/cocoa/atom_ns_window_delegate.mm @@ -9,7 +9,6 @@ #include "atom/browser/ui/cocoa/atom_preview_item.h" #include "atom/browser/ui/cocoa/atom_touch_bar.h" #include "base/mac/mac_util.h" -#include "ui/views/cocoa/bridged_native_widget_host_impl.h" #include "ui/views/widget/native_widget_mac.h" #include "ui/views_bridge_mac/bridged_native_widget_impl.h" @@ -22,13 +21,12 @@ // on the fly. // TODO(zcbenz): Add interface in NativeWidgetMac to allow overriding creating // window delegate. - auto* bridge_host = views::BridgedNativeWidgetHostImpl::GetFromNativeWindow( + auto* bridged_view = views::BridgedNativeWidgetImpl::GetFromNativeWindow( shell->GetNativeWindow()); - auto* bridged_view = bridge_host->bridge_impl(); if ((self = [super initWithBridgedNativeWidget:bridged_view])) { shell_ = shell; is_zooming_ = false; - level_ = [shell_->GetNativeWindow().GetNativeNSWindow() level]; + level_ = [shell_->GetNativeWindow() level]; } return self; } @@ -140,7 +138,7 @@ } - (void)windowWillMiniaturize:(NSNotification*)notification { - NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow(); + NSWindow* window = shell_->GetNativeWindow(); // store the current status window level to be restored in // windowDidDeminiaturize level_ = [window level]; @@ -154,7 +152,7 @@ - (void)windowDidDeminiaturize:(NSNotification*)notification { [super windowDidDeminiaturize:notification]; - [shell_->GetNativeWindow().GetNativeNSWindow() setLevel:level_]; + [shell_->GetNativeWindow() setLevel:level_]; shell_->NotifyWindowRestore(); } @@ -181,7 +179,7 @@ // artifacts. if (@available(macOS 10.10, *)) { if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) { - NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow(); + NSWindow* window = shell_->GetNativeWindow(); [window setToolbar:nil]; } } @@ -194,7 +192,7 @@ // For frameless window we don't show set title for normal mode since the // titlebar is expected to be empty, but after entering fullscreen mode we // have to set one, because title bar is visible here. - NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow(); + NSWindow* window = shell_->GetNativeWindow(); if ((shell_->transparent() || !shell_->has_frame()) && // FIXME(zcbenz): Showing titlebar for hiddenInset window is weird under // fullscreen mode. @@ -223,7 +221,7 @@ - (void)windowWillExitFullScreen:(NSNotification*)notification { if (@available(macOS 10.10, *)) { // Restore the titlebar visibility. - NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow(); + NSWindow* window = shell_->GetNativeWindow(); if ((shell_->transparent() || !shell_->has_frame()) && (shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET || shell_->fullscreen_window_title())) { @@ -249,9 +247,8 @@ // Clears the delegate when window is going to be closed, since EL Capitan it // is possible that the methods of delegate would get called after the window // has been closed. - auto* bridge_host = views::BridgedNativeWidgetHostImpl::GetFromNativeWindow( + auto* bridged_view = views::BridgedNativeWidgetImpl::GetFromNativeWindow( shell_->GetNativeWindow()); - auto* bridged_view = bridge_host->bridge_impl(); bridged_view->OnWindowWillClose(); } diff --git a/atom/browser/ui/drag_util_mac.mm b/atom/browser/ui/drag_util_mac.mm index a1306d035f..7197e79af6 100644 --- a/atom/browser/ui/drag_util_mac.mm +++ b/atom/browser/ui/drag_util_mac.mm @@ -33,27 +33,26 @@ void DragFileItems(const std::vector& files, // Synthesize a drag event, since we don't have access to the actual event // that initiated a drag (possibly consumed by the Web UI, for example). - NSWindow* window = [view.GetNativeNSView() window]; - NSPoint position = [window mouseLocationOutsideOfEventStream]; + NSPoint position = [[view window] mouseLocationOutsideOfEventStream]; NSTimeInterval eventTime = [[NSApp currentEvent] timestamp]; NSEvent* dragEvent = [NSEvent mouseEventWithType:NSLeftMouseDragged location:position modifierFlags:NSLeftMouseDraggedMask timestamp:eventTime - windowNumber:[window windowNumber] + windowNumber:[[view window] windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1.0]; // Run the drag operation. - [window dragImage:icon.ToNSImage() - at:position - offset:NSZeroSize - event:dragEvent - pasteboard:pasteboard - source:view.GetNativeNSView() - slideBack:YES]; + [[view window] dragImage:icon.ToNSImage() + at:position + offset:NSZeroSize + event:dragEvent + pasteboard:pasteboard + source:view + slideBack:YES]; } } // namespace atom diff --git a/atom/browser/ui/file_dialog_mac.mm b/atom/browser/ui/file_dialog_mac.mm index 5248441fe7..231c006d34 100644 --- a/atom/browser/ui/file_dialog_mac.mm +++ b/atom/browser/ui/file_dialog_mac.mm @@ -210,8 +210,7 @@ int RunModalDialog(NSSavePanel* dialog, const DialogSettings& settings) { settings.force_detached) { chosen = [dialog runModal]; } else { - NSWindow* window = - settings.parent_window->GetNativeWindow().GetNativeNSWindow(); + NSWindow* window = settings.parent_window->GetNativeWindow(); [dialog beginSheetModalForWindow:window completionHandler:^(NSInteger c) { @@ -329,8 +328,7 @@ void ShowOpenDialog(const DialogSettings& settings, OpenDialogCompletion(chosen, dialog, settings, callback); }]; } else { - NSWindow* window = - settings.parent_window->GetNativeWindow().GetNativeNSWindow(); + NSWindow* window = settings.parent_window->GetNativeWindow(); [dialog beginSheetModalForWindow:window completionHandler:^(NSInteger chosen) { OpenDialogCompletion(chosen, dialog, settings, callback); @@ -391,8 +389,7 @@ void ShowSaveDialog(const DialogSettings& settings, SaveDialogCompletion(chosen, dialog, settings, callback); }]; } else { - NSWindow* window = - settings.parent_window->GetNativeWindow().GetNativeNSWindow(); + NSWindow* window = settings.parent_window->GetNativeWindow(); [dialog beginSheetModalForWindow:window completionHandler:^(NSInteger chosen) { SaveDialogCompletion(chosen, dialog, settings, callback); diff --git a/atom/browser/ui/inspectable_web_contents_impl.cc b/atom/browser/ui/inspectable_web_contents_impl.cc index 5b08e79d73..6f29c9180b 100644 --- a/atom/browser/ui/inspectable_web_contents_impl.cc +++ b/atom/browser/ui/inspectable_web_contents_impl.cc @@ -779,11 +779,12 @@ bool InspectableWebContentsImpl::ShouldCreateWebContents( return false; } -bool InspectableWebContentsImpl::HandleKeyboardEvent( +void InspectableWebContentsImpl::HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) { auto* delegate = web_contents_->GetDelegate(); - return !delegate || delegate->HandleKeyboardEvent(source, event); + if (delegate) + delegate->HandleKeyboardEvent(source, event); } void InspectableWebContentsImpl::CloseContents(content::WebContents* source) { diff --git a/atom/browser/ui/inspectable_web_contents_impl.h b/atom/browser/ui/inspectable_web_contents_impl.h index f60a19f2fd..90bda6070b 100644 --- a/atom/browser/ui/inspectable_web_contents_impl.h +++ b/atom/browser/ui/inspectable_web_contents_impl.h @@ -182,7 +182,7 @@ class InspectableWebContentsImpl const GURL& target_url, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) override; - bool HandleKeyboardEvent(content::WebContents*, + void HandleKeyboardEvent(content::WebContents*, const content::NativeWebKeyboardEvent&) override; void CloseContents(content::WebContents* source) override; content::ColorChooser* OpenColorChooser( diff --git a/atom/browser/ui/message_box_mac.mm b/atom/browser/ui/message_box_mac.mm index 94c243a810..ee2f59dc8c 100644 --- a/atom/browser/ui/message_box_mac.mm +++ b/atom/browser/ui/message_box_mac.mm @@ -156,7 +156,7 @@ int ShowMessageBox(NativeWindow* parent_window, andAlert:alert callEndModal:true]; - NSWindow* window = parent_window->GetNativeWindow().GetNativeNSWindow(); + NSWindow* window = parent_window->GetNativeWindow(); [alert beginSheetModalForWindow:window modalDelegate:delegate didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) @@ -193,9 +193,7 @@ void ShowMessageBox(NativeWindow* parent_window, andAlert:alert callEndModal:false]; - NSWindow* window = - parent_window ? parent_window->GetNativeWindow().GetNativeNSWindow() - : nil; + NSWindow* window = parent_window ? parent_window->GetNativeWindow() : nil; [alert beginSheetModalForWindow:window modalDelegate:delegate diff --git a/atom/browser/ui/views/atom_views_delegate.cc b/atom/browser/ui/views/atom_views_delegate.cc index 811963c8a0..4ec4805bea 100644 --- a/atom/browser/ui/views/atom_views_delegate.cc +++ b/atom/browser/ui/views/atom_views_delegate.cc @@ -47,6 +47,9 @@ bool ViewsDelegate::GetSavedWindowPlacement( return false; } +void ViewsDelegate::NotifyAccessibilityEvent(views::View* view, + ax::mojom::Event event_type) {} + void ViewsDelegate::NotifyMenuItemFocused(const base::string16& menu_name, const base::string16& menu_item_name, int item_index, diff --git a/atom/browser/ui/views/atom_views_delegate.h b/atom/browser/ui/views/atom_views_delegate.h index 7d9113337d..f3fede18d9 100644 --- a/atom/browser/ui/views/atom_views_delegate.h +++ b/atom/browser/ui/views/atom_views_delegate.h @@ -27,6 +27,8 @@ class ViewsDelegate : public views::ViewsDelegate { const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const override; + void NotifyAccessibilityEvent(views::View* view, + ax::mojom::Event event_type) override; void NotifyMenuItemFocused(const base::string16& menu_name, const base::string16& menu_item_name, int item_index, diff --git a/atom/browser/ui/views/submenu_button.cc b/atom/browser/ui/views/submenu_button.cc index 1cf2fe7ff9..b6c0c3229f 100644 --- a/atom/browser/ui/views/submenu_button.cc +++ b/atom/browser/ui/views/submenu_button.cc @@ -23,7 +23,8 @@ SubmenuButton::SubmenuButton(const base::string16& title, views::MenuButtonListener* menu_button_listener, const SkColor& background_color) : views::MenuButton(gfx::RemoveAcceleratorChar(title, '&', NULL, NULL), - menu_button_listener), + menu_button_listener, + false), background_color_(background_color) { #if defined(OS_LINUX) // Dont' use native style border. @@ -71,7 +72,7 @@ void SubmenuButton::SetUnderlineColor(SkColor color) { } void SubmenuButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { - node_data->SetName(GetAccessibleName()); + node_data->SetName(accessible_name()); node_data->role = ax::mojom::Role::kPopUpButton; } diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 080ce6bd22..5c67d1fb69 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -73,29 +73,6 @@ bool GetAsInteger(const base::Value* val, return false; } -bool GetAsAutoplayPolicy(const base::Value* val, - const base::StringPiece& path, - content::AutoplayPolicy* out) { - std::string policy_str; - if (GetAsString(val, path, &policy_str)) { - if (policy_str == "no-user-gesture-required") { - *out = content::AutoplayPolicy::kNoUserGestureRequired; - return true; - } else if (policy_str == "user-gesture-required") { - *out = content::AutoplayPolicy::kUserGestureRequired; - return true; - } else if (policy_str == "user-gesture-required-for-cross-origin") { - *out = content::AutoplayPolicy::kUserGestureRequiredForCrossOrigin; - return true; - } else if (policy_str == "document-user-activation-required") { - *out = content::AutoplayPolicy::kDocumentUserActivationRequired; - return true; - } - return false; - } - return false; -} - } // namespace namespace atom { @@ -387,10 +364,6 @@ void WebContentsPreferences::OverrideWebkitPrefs( IsEnabled("textAreasAreResizable", true /* default_value */); prefs->navigate_on_drag_drop = IsEnabled("navigateOnDragDrop", false /* default_value */); - if (!GetAsAutoplayPolicy(&preference_, "autoplayPolicy", - &prefs->autoplay_policy)) { - prefs->autoplay_policy = content::AutoplayPolicy::kNoUserGestureRequired; - } // Check if webgl should be enabled. bool is_webgl_enabled = IsEnabled("webgl", true /* default_value */); diff --git a/atom/browser/web_dialog_helper.cc b/atom/browser/web_dialog_helper.cc index bd705e8f09..85ca079719 100644 --- a/atom/browser/web_dialog_helper.cc +++ b/atom/browser/web_dialog_helper.cc @@ -105,7 +105,7 @@ class FileSelectHelper : public base::RefCounted, void OnFilesSelected(std::vector file_info) { if (listener_) { - listener_->FileSelected(std::move(file_info), base::FilePath(), mode_); + listener_->FileSelected(std::move(file_info), mode_); listener_.reset(); } render_frame_host_ = nullptr; @@ -265,7 +265,7 @@ void WebDialogHelper::EnumerateDirectory( blink::mojom::NativeFileInfo::New(path, base::string16()))); } - listener->FileSelected(std::move(file_info), dir, + listener->FileSelected(std::move(file_info), FileChooserParams::Mode::kUploadFolder); } diff --git a/atom/browser/web_view_guest_delegate.cc b/atom/browser/web_view_guest_delegate.cc index 01cb63ba39..ad7fce4e31 100644 --- a/atom/browser/web_view_guest_delegate.cc +++ b/atom/browser/web_view_guest_delegate.cc @@ -38,13 +38,11 @@ void WebViewGuestDelegate::AttachToIframe( DCHECK_EQ(embedder_web_contents_, content::WebContents::FromRenderFrameHost(embedder_frame)); - content::WebContents* guest_web_contents = api_web_contents_->web_contents(); // Attach this inner WebContents |guest_web_contents| to the outer // WebContents |embedder_web_contents|. The outer WebContents's // frame |embedder_frame| hosts the inner WebContents. - guest_web_contents->AttachToOuterWebContentsFrame( - base::WrapUnique(guest_web_contents), - embedder_frame); + api_web_contents_->web_contents()->AttachToOuterWebContentsFrame( + embedder_web_contents_, embedder_frame); ResetZoomController(); diff --git a/atom/common/api/atom_api_native_image_mac.mm b/atom/common/api/atom_api_native_image_mac.mm index 111b00ef9b..df1cec129f 100644 --- a/atom/common/api/atom_api_native_image_mac.mm +++ b/atom/common/api/atom_api_native_image_mac.mm @@ -52,7 +52,7 @@ mate::Handle NativeImage::CreateFromNamedImage( png_data = bufferFromNSImage( gfx::Image(gfx::ImageSkiaOperations::CreateHSLShiftedImage( gfx_image.AsImageSkia(), shift)) - .AsNSImage()); + .CopyNSImage()); } return CreateFromPNG(args->isolate(), (char*)[png_data bytes], diff --git a/atom/common/api/atom_bindings.cc b/atom/common/api/atom_bindings.cc index 850a9d1559..5b7e655eeb 100644 --- a/atom/common/api/atom_bindings.cc +++ b/atom/common/api/atom_bindings.cc @@ -19,10 +19,10 @@ #include "atom/common/native_mate_converters/string16_converter.h" #include "atom/common/promise_util.h" #include "base/logging.h" -#include "base/process/process.h" #include "base/process/process_handle.h" +#include "base/process/process_info.h" #include "base/process/process_metrics_iocounters.h" -#include "base/system/sys_info.h" +#include "base/sys_info.h" #include "base/threading/thread_restrictions.h" #include "chrome/common/chrome_version.h" #include "native_mate/dictionary.h" @@ -189,7 +189,7 @@ v8::Local AtomBindings::GetHeapStatistics(v8::Isolate* isolate) { // static v8::Local AtomBindings::GetCreationTime(v8::Isolate* isolate) { - auto timeValue = base::Process::Current().CreationTime(); + auto timeValue = base::CurrentProcessInfo::CreationTime(); if (timeValue.is_null()) { return v8::Null(isolate); } diff --git a/atom/common/api/constructor.h b/atom/common/api/constructor.h index d14d760337..a4e4332f0a 100644 --- a/atom/common/api/constructor.h +++ b/atom/common/api/constructor.h @@ -25,7 +25,7 @@ v8::Local CreateConstructor(v8::Isolate* isolate, isolate, base::Bind(&mate::internal::InvokeNew, func)); templ->InstanceTemplate()->SetInternalFieldCount(1); T::BuildPrototype(isolate, templ); - return templ->GetFunction(isolate->GetCurrentContext()).ToLocalChecked(); + return templ->GetFunction(); } } // namespace mate diff --git a/atom/common/common_message_generator.cc b/atom/common/common_message_generator.cc index 4d2dbc1790..09f5bdcfb0 100644 --- a/atom/common/common_message_generator.cc +++ b/atom/common/common_message_generator.cc @@ -9,7 +9,13 @@ // Generate constructors. #include "ipc/struct_constructor_macros.h" -// lint: must come after struct_constructor_macros. +// must go after struct_contructor_macros +#include "atom/common/common_message_generator.h" + +// Generate destructors. +#include "ipc/struct_destructor_macros.h" + +// must go after struct_destructor_macros #include "atom/common/common_message_generator.h" // Generate param traits write methods. @@ -28,4 +34,4 @@ namespace IPC { #include "ipc/param_traits_log_macros.h" namespace IPC { #include "atom/common/common_message_generator.h" -} // namespace IPC +} // namespace IPC \ No newline at end of file diff --git a/atom/common/native_mate_converters/blink_converter.cc b/atom/common/native_mate_converters/blink_converter.cc index 5bee5df33f..17469bac61 100644 --- a/atom/common/native_mate_converters/blink_converter.cc +++ b/atom/common/native_mate_converters/blink_converter.cc @@ -473,26 +473,25 @@ v8::Local Converter::ToV8( } // static -v8::Local Converter::ToV8( +v8::Local Converter::ToV8( v8::Isolate* isolate, - const network::mojom::ReferrerPolicy& in) { + const blink::WebReferrerPolicy& in) { switch (in) { - case network::mojom::ReferrerPolicy::kDefault: + case blink::kWebReferrerPolicyDefault: return mate::StringToV8(isolate, "default"); - case network::mojom::ReferrerPolicy::kAlways: + case blink::kWebReferrerPolicyAlways: return mate::StringToV8(isolate, "unsafe-url"); - case network::mojom::ReferrerPolicy::kNoReferrerWhenDowngrade: + case blink::kWebReferrerPolicyNoReferrerWhenDowngrade: return mate::StringToV8(isolate, "no-referrer-when-downgrade"); - case network::mojom::ReferrerPolicy::kNever: + case blink::kWebReferrerPolicyNever: return mate::StringToV8(isolate, "no-referrer"); - case network::mojom::ReferrerPolicy::kOrigin: + case blink::kWebReferrerPolicyOrigin: return mate::StringToV8(isolate, "origin"); - case network::mojom::ReferrerPolicy:: - kNoReferrerWhenDowngradeOriginWhenCrossOrigin: + case blink::kWebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin: return mate::StringToV8(isolate, "strict-origin-when-cross-origin"); - case network::mojom::ReferrerPolicy::kSameOrigin: + case blink::kWebReferrerPolicySameOrigin: return mate::StringToV8(isolate, "same-origin"); - case network::mojom::ReferrerPolicy::kStrictOrigin: + case blink::kWebReferrerPolicyStrictOrigin: return mate::StringToV8(isolate, "strict-origin"); default: return mate::StringToV8(isolate, "no-referrer"); @@ -500,28 +499,28 @@ v8::Local Converter::ToV8( } // static -bool Converter::FromV8( +bool Converter::FromV8( v8::Isolate* isolate, v8::Handle val, - network::mojom::ReferrerPolicy* out) { + blink::WebReferrerPolicy* out) { std::string policy = base::ToLowerASCII(gin::V8ToString(isolate, val)); if (policy == "default") - *out = network::mojom::ReferrerPolicy::kDefault; + *out = blink::kWebReferrerPolicyDefault; else if (policy == "unsafe-url") - *out = network::mojom::ReferrerPolicy::kAlways; + *out = blink::kWebReferrerPolicyAlways; else if (policy == "no-referrer-when-downgrade") - *out = network::mojom::ReferrerPolicy::kNoReferrerWhenDowngrade; + *out = blink::kWebReferrerPolicyNoReferrerWhenDowngrade; else if (policy == "no-referrer") - *out = network::mojom::ReferrerPolicy::kNever; + *out = blink::kWebReferrerPolicyNever; else if (policy == "origin") - *out = network::mojom::ReferrerPolicy::kOrigin; + *out = blink::kWebReferrerPolicyOrigin; else if (policy == "strict-origin-when-cross-origin") - *out = network::mojom::ReferrerPolicy:: - kNoReferrerWhenDowngradeOriginWhenCrossOrigin; + *out = + blink::kWebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin; else if (policy == "same-origin") - *out = network::mojom::ReferrerPolicy::kSameOrigin; + *out = blink::kWebReferrerPolicySameOrigin; else if (policy == "strict-origin") - *out = network::mojom::ReferrerPolicy::kStrictOrigin; + *out = blink::kWebReferrerPolicyStrictOrigin; else return false; return true; diff --git a/atom/common/native_mate_converters/blink_converter.h b/atom/common/native_mate_converters/blink_converter.h index ad31a7a7cb..bc00089414 100644 --- a/atom/common/native_mate_converters/blink_converter.h +++ b/atom/common/native_mate_converters/blink_converter.h @@ -123,12 +123,12 @@ struct Converter { }; template <> -struct Converter { +struct Converter { static v8::Local ToV8(v8::Isolate* isolate, - const network::mojom::ReferrerPolicy& in); + const blink::WebReferrerPolicy& in); static bool FromV8(v8::Isolate* isolate, v8::Local val, - network::mojom::ReferrerPolicy* out); + blink::WebReferrerPolicy* out); }; v8::Local EditFlagsToV8(v8::Isolate* isolate, int editFlags); diff --git a/atom/common/native_mate_converters/callback.cc b/atom/common/native_mate_converters/callback.cc index dc3300e439..7a1a855f6a 100644 --- a/atom/common/native_mate_converters/callback.cc +++ b/atom/common/native_mate_converters/callback.cc @@ -43,19 +43,16 @@ void CallTranslater(v8::Local external, mate::Arguments* args) { // Whether the callback should only be called for once. v8::Isolate* isolate = args->isolate(); - auto context = isolate->GetCurrentContext(); - bool one_time = - state->Has(context, mate::StringToSymbol(isolate, "oneTime")).ToChecked(); + bool one_time = state->Has(mate::StringToSymbol(isolate, "oneTime")); // Check if the callback has already been called. if (one_time) { auto called_symbol = mate::StringToSymbol(isolate, "called"); - if (state->Has(context, called_symbol).ToChecked()) { + if (state->Has(called_symbol)) { args->ThrowError("callback can only be called for once"); return; } else { - state->Set(context, called_symbol, v8::Boolean::New(isolate, true)) - .ToChecked(); + state->Set(called_symbol, v8::Boolean::New(isolate, true)); } } @@ -133,10 +130,9 @@ v8::Local CreateFunctionFromTranslater(v8::Isolate* isolate, Dictionary state = mate::Dictionary::CreateEmpty(isolate); if (one_time) state.Set("oneTime", true); - auto context = isolate->GetCurrentContext(); - return BindFunctionWith( - isolate, context, call_translater->GetFunction(context).ToLocalChecked(), - holder->handle.Get(isolate), state.GetHandle()); + return BindFunctionWith(isolate, isolate->GetCurrentContext(), + call_translater->GetFunction(), + holder->handle.Get(isolate), state.GetHandle()); } // func.bind(func, arg1). diff --git a/atom/common/native_mate_converters/callback.h b/atom/common/native_mate_converters/callback.h index 50008990c2..3fea5b9f31 100644 --- a/atom/common/native_mate_converters/callback.h +++ b/atom/common/native_mate_converters/callback.h @@ -55,10 +55,8 @@ struct V8FunctionInvoker(ArgTypes...)> { v8::Local context = holder->CreationContext(); v8::Context::Scope context_scope(context); std::vector> args{ConvertToV8(isolate, raw)...}; - v8::Local ret(holder - ->Call(context, holder, args.size(), - args.empty() ? nullptr : &args.front()) - .ToLocalChecked()); + v8::Local ret(holder->Call( + holder, args.size(), args.empty() ? nullptr : &args.front())); return handle_scope.Escape(ret); } }; @@ -78,10 +76,7 @@ struct V8FunctionInvoker { v8::Local context = holder->CreationContext(); v8::Context::Scope context_scope(context); std::vector> args{ConvertToV8(isolate, raw)...}; - holder - ->Call(context, holder, args.size(), - args.empty() ? nullptr : &args.front()) - .ToLocalChecked(); + holder->Call(holder, args.size(), args.empty() ? nullptr : &args.front()); } }; diff --git a/atom/common/native_mate_converters/v8_value_converter.cc b/atom/common/native_mate_converters/v8_value_converter.cc index 73bfe5a96a..c8d85b0583 100644 --- a/atom/common/native_mate_converters/v8_value_converter.cc +++ b/atom/common/native_mate_converters/v8_value_converter.cc @@ -331,9 +331,8 @@ base::Value* V8ValueConverter::FromV8ValueImpl(FromV8ValueState* state, v8::Local toISOString = date->Get(v8::String::NewFromUtf8(isolate, "toISOString")); if (toISOString->IsFunction()) { - v8::Local result = toISOString.As() - ->Call(context, val, 0, nullptr) - .ToLocalChecked(); + v8::Local result = + toISOString.As()->Call(val, 0, nullptr); if (!result.IsEmpty()) { v8::String::Utf8Value utf8(isolate, result->ToString(context).ToLocalChecked()); diff --git a/atom/common/node_bindings_win.cc b/atom/common/node_bindings_win.cc index ef16edc723..b0ab715afc 100644 --- a/atom/common/node_bindings_win.cc +++ b/atom/common/node_bindings_win.cc @@ -7,7 +7,7 @@ #include #include "base/logging.h" -#include "base/system/sys_info.h" +#include "base/sys_info.h" namespace atom { diff --git a/atom/renderer/api/atom_api_spell_check_client.cc b/atom/renderer/api/atom_api_spell_check_client.cc index cf3da3629d..329884bbfe 100644 --- a/atom/renderer/api/atom_api_spell_check_client.cc +++ b/atom/renderer/api/atom_api_spell_check_client.cc @@ -211,11 +211,10 @@ void SpellCheckClient::SpellCheckWords( v8::Local templ = mate::CreateFunctionTemplate( isolate_, base::Bind(&SpellCheckClient::OnSpellCheckDone, AsWeakPtr())); - auto context = isolate_->GetCurrentContext(); v8::Local args[] = {mate::ConvertToV8(isolate_, words), - templ->GetFunction(context).ToLocalChecked()}; + templ->GetFunction()}; // Call javascript with the words and the callback function - scope.spell_check_->Call(context, scope.provider_, 2, args).ToLocalChecked(); + scope.spell_check_->Call(scope.provider_, 2, args); } // Returns whether or not the given string is a contraction. diff --git a/atom/renderer/api/atom_api_web_frame.cc b/atom/renderer/api/atom_api_web_frame.cc index 29483e0dce..3f1a89d1fc 100644 --- a/atom/renderer/api/atom_api_web_frame.cc +++ b/atom/renderer/api/atom_api_web_frame.cc @@ -222,9 +222,7 @@ int WebFrame::GetWebFrameId(v8::Local content_window) { void WebFrame::SetSpellCheckProvider(mate::Arguments* args, const std::string& language, v8::Local provider) { - auto context = args->isolate()->GetCurrentContext(); - if (!provider->Has(context, mate::StringToV8(args->isolate(), "spellCheck")) - .ToChecked()) { + if (!provider->Has(mate::StringToV8(args->isolate(), "spellCheck"))) { args->ThrowError("\"spellCheck\" has to be defined"); return; } @@ -284,7 +282,7 @@ void WebFrame::RegisterURLSchemeAsPrivileged(const std::string& scheme, privileged_scheme); } if (corsEnabled) { - url::AddCorsEnabledScheme(scheme.c_str()); + url::AddCORSEnabledScheme(scheme.c_str()); } } @@ -543,9 +541,7 @@ void Initialize(v8::Local exports, v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("webFrame", WebFrame::Create(isolate)); - dict.Set( - "WebFrame", - WebFrame::GetConstructor(isolate)->GetFunction(context).ToLocalChecked()); + dict.Set("WebFrame", WebFrame::GetConstructor(isolate)->GetFunction()); } } // namespace diff --git a/atom/renderer/content_settings_observer.cc b/atom/renderer/content_settings_observer.cc index fdd9409bac..ecf76347b2 100644 --- a/atom/renderer/content_settings_observer.cc +++ b/atom/renderer/content_settings_observer.cc @@ -45,6 +45,7 @@ bool ContentSettingsObserver::AllowStorage(bool local) { } bool ContentSettingsObserver::AllowIndexedDB( + const blink::WebString& name, const blink::WebSecurityOrigin& security_origin) { blink::WebFrame* frame = render_frame()->GetWebFrame(); if (frame->GetSecurityOrigin().IsUnique() || diff --git a/atom/renderer/content_settings_observer.h b/atom/renderer/content_settings_observer.h index 552bc249c7..2267550e8a 100644 --- a/atom/renderer/content_settings_observer.h +++ b/atom/renderer/content_settings_observer.h @@ -22,7 +22,8 @@ class ContentSettingsObserver : public content::RenderFrameObserver, const blink::WebString& display_name, unsigned estimated_size) override; bool AllowStorage(bool local) override; - bool AllowIndexedDB(const blink::WebSecurityOrigin& security_origin) override; + bool AllowIndexedDB(const blink::WebString& name, + const blink::WebSecurityOrigin& security_origin) override; private: // content::RenderFrameObserver implementation. diff --git a/atom/utility/atom_content_utility_client.cc b/atom/utility/atom_content_utility_client.cc index f95c8fffa7..ed9781a904 100644 --- a/atom/utility/atom_content_utility_client.cc +++ b/atom/utility/atom_content_utility_client.cc @@ -4,6 +4,7 @@ #include "atom/utility/atom_content_utility_client.h" +#include #include #include "base/command_line.h" @@ -94,6 +95,11 @@ void AtomContentUtilityClient::RegisterServices(StaticServiceMap* services) { proxy_resolver_info); #if BUILDFLAG(ENABLE_PRINTING) + service_manager::EmbeddedServiceInfo pdf_compositor_info; + pdf_compositor_info.factory = + base::BindRepeating(&printing::CreatePdfCompositorService, std::string()); + services->emplace(printing::mojom::kServiceName, pdf_compositor_info); + service_manager::EmbeddedServiceInfo printing_info; printing_info.factory = base::BindRepeating(&printing::PrintingService::CreateService); @@ -101,18 +107,4 @@ void AtomContentUtilityClient::RegisterServices(StaticServiceMap* services) { #endif } -std::unique_ptr -AtomContentUtilityClient::HandleServiceRequest( - const std::string& service_name, - service_manager::mojom::ServiceRequest request) { -#if BUILDFLAG(ENABLE_PRINTING) - if (service_name == printing::mojom::kServiceName) { - return printing::CreatePdfCompositorService(std::string(), - std::move(request)); - } -#endif - - return nullptr; -} - } // namespace atom diff --git a/atom/utility/atom_content_utility_client.h b/atom/utility/atom_content_utility_client.h index fc5f4a89d6..12f70dccf7 100644 --- a/atom/utility/atom_content_utility_client.h +++ b/atom/utility/atom_content_utility_client.h @@ -6,7 +6,6 @@ #define ATOM_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_ #include -#include #include #include "base/compiler_specific.h" @@ -28,10 +27,6 @@ class AtomContentUtilityClient : public content::ContentUtilityClient { bool OnMessageReceived(const IPC::Message& message) override; void RegisterServices(StaticServiceMap* services) override; - std::unique_ptr HandleServiceRequest( - const std::string& service_name, - service_manager::mojom::ServiceRequest request) override; - private: #if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN) std::unique_ptr printing_handler_; diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index 05e5255812..f293db611a 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -90,7 +90,6 @@ static_library("chrome") { "//chrome/browser/ui/views/color_chooser_aura.cc", "//chrome/browser/ui/views/color_chooser_aura.h", ] - deps += [ "//components/feature_engagement" ] } if (is_mac) { @@ -113,15 +112,18 @@ static_library("chrome") { if (enable_tts) { sources += [ - "//chrome/browser/speech/tts_controller_delegate_impl.cc", - "//chrome/browser/speech/tts_controller_delegate_impl.h", + "//chrome/browser/speech/tts_controller.h", + "//chrome/browser/speech/tts_controller_impl.cc", + "//chrome/browser/speech/tts_controller_impl.h", "//chrome/browser/speech/tts_mac.mm", "//chrome/browser/speech/tts_message_filter.cc", "//chrome/browser/speech/tts_message_filter.h", - "//chrome/browser/speech/tts_platform.h ", - "//chrome/browser/speech/tts_platform_impl.cc", - "//chrome/browser/speech/tts_platform_impl.h", + "//chrome/browser/speech/tts_platform.cc", + "//chrome/browser/speech/tts_platform.h", "//chrome/browser/speech/tts_win.cc", + "//chrome/common/tts_messages.h", + "//chrome/common/tts_utterance_request.cc", + "//chrome/common/tts_utterance_request.h", "//chrome/renderer/tts_dispatcher.cc", "//chrome/renderer/tts_dispatcher.h", ] diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index b3b6f3fcab..d0d4e1e74d 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -375,11 +375,6 @@ It creates a new `BrowserWindow` with native properties as set by the `options`. English and not localized. * `navigateOnDragDrop` Boolean (optional) - Whether dragging and dropping a file or link onto the page causes a navigation. Default is `false`. - * `autoplayPolicy` String (optional) - Autoplay policy to apply to - content in the window, can be `no-user-gesture-required`, - `user-gesture-required`, `user-gesture-required-for-cross-origin`, - `document-user-activation-required`. Defaults to - `no-user-gesture-required`. When setting minimum or maximum window size with `minWidth`/`maxWidth`/ `minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from diff --git a/filenames.gni b/filenames.gni index d913ad232f..255ecc2c07 100644 --- a/filenames.gni +++ b/filenames.gni @@ -177,7 +177,6 @@ filenames = { "atom/browser/api/atom_api_view.h", "atom/browser/api/atom_api_web_contents.cc", "atom/browser/api/atom_api_web_contents.h", - "atom/browser/api/atom_api_web_contents_impl.cc", "atom/browser/api/atom_api_web_contents_mac.mm", "atom/browser/api/atom_api_web_contents_view.cc", "atom/browser/api/atom_api_web_contents_view.h", diff --git a/lib/browser/guest-view-manager.js b/lib/browser/guest-view-manager.js index 920b02021a..ba279c4029 100644 --- a/lib/browser/guest-view-manager.js +++ b/lib/browser/guest-view-manager.js @@ -181,7 +181,7 @@ const attachGuest = function (event, embedderFrameId, elementInstanceId, guestIn const oldGuestInstance = guestInstances[oldGuestInstanceId] if (oldGuestInstance) { - oldGuestInstance.guest.detachFromOuterFrame() + oldGuestInstance.guest.destroy() } } @@ -361,7 +361,7 @@ handleMessage('ELECTRON_GUEST_VIEW_MANAGER_CREATE_GUEST_SYNC', function (event, handleMessage('ELECTRON_GUEST_VIEW_MANAGER_DESTROY_GUEST', function (event, guestInstanceId) { try { const guest = getGuestForWebContents(guestInstanceId, event.sender) - guest.detachFromOuterFrame() + guest.destroy() } catch (error) { console.error(`Guest destroy failed: ${error}`) } diff --git a/native_mate/native_mate/dictionary.h b/native_mate/native_mate/dictionary.h index 1eece77c5a..63a1350597 100644 --- a/native_mate/native_mate/dictionary.h +++ b/native_mate/native_mate/dictionary.h @@ -106,9 +106,7 @@ class Dictionary { bool SetMethod(const base::StringPiece& key, const T& callback) { return GetHandle()->Set( StringToV8(isolate_, key), - CallbackTraits::CreateTemplate(isolate_, callback) - ->GetFunction(isolate_->GetCurrentContext()) - .ToLocalChecked()); + CallbackTraits::CreateTemplate(isolate_, callback)->GetFunction()); } bool Delete(const base::StringPiece& key) { diff --git a/native_mate/native_mate/wrappable.cc b/native_mate/native_mate/wrappable.cc index 8b1f73d6ba..3d5ce44ac0 100644 --- a/native_mate/native_mate/wrappable.cc +++ b/native_mate/native_mate/wrappable.cc @@ -39,8 +39,7 @@ void WrappableBase::InitWith(v8::Isolate* isolate, // Call object._init if we have one. v8::Local init; if (Dictionary(isolate, wrapper).Get("_init", &init)) - init->Call(isolate->GetCurrentContext(), wrapper, 0, nullptr) - .ToLocalChecked(); + init->Call(wrapper, 0, nullptr); AfterInit(isolate); } diff --git a/patches/common/boringssl/.patches b/patches/common/boringssl/.patches index 5959cf4590..ba4d3c3fe9 100644 --- a/patches/common/boringssl/.patches +++ b/patches/common/boringssl/.patches @@ -1,2 +1,3 @@ +implement_ssl_get_tlsext_status_type.patch add_ec_group_order_bits_for_openssl_compatibility.patch add_ec_key_key2buf_for_openssl_compatibility.patch diff --git a/patches/common/boringssl/add_ec_group_order_bits_for_openssl_compatibility.patch b/patches/common/boringssl/add_ec_group_order_bits_for_openssl_compatibility.patch index 1995ab5493..1db5350f5c 100644 --- a/patches/common/boringssl/add_ec_group_order_bits_for_openssl_compatibility.patch +++ b/patches/common/boringssl/add_ec_group_order_bits_for_openssl_compatibility.patch @@ -9,10 +9,10 @@ Commit-Queue: Adam Langley Reviewed-by: Adam Langley diff --git a/crypto/fipsmodule/ec/ec.c b/crypto/fipsmodule/ec/ec.c -index bd0662a703d6285df51735c5d4870d21a82b39cf..90b9d71f61f8d6d7ddf838c47a59729748d0d0f2 100644 +index 908e35e9d04e657c13ba61c8ea5bf4a4519228c5..43e170b9190bf1813216b10863bbaf6402331161 100644 --- a/crypto/fipsmodule/ec/ec.c +++ b/crypto/fipsmodule/ec/ec.c -@@ -625,6 +625,10 @@ int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) { +@@ -605,6 +605,10 @@ int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) { return 1; } @@ -24,7 +24,7 @@ index bd0662a703d6285df51735c5d4870d21a82b39cf..90b9d71f61f8d6d7ddf838c47a597297 BN_CTX *ctx) { // All |EC_GROUP|s have cofactor 1. diff --git a/include/openssl/ec.h b/include/openssl/ec.h -index 966393ea3b726214aa84a604c8e5a13654dcdf76..c65a1a7519fd80b681d1cf899792ee46aaa8bad6 100644 +index 41a9c34c5ad1bbfdff8e37c1e245ac7fac7a3869..e4195fc15a26e61ef1e74ac7054ddabb256ae9a3 100644 --- a/include/openssl/ec.h +++ b/include/openssl/ec.h @@ -133,6 +133,9 @@ OPENSSL_EXPORT const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group); diff --git a/patches/common/boringssl/add_ec_key_key2buf_for_openssl_compatibility.patch b/patches/common/boringssl/add_ec_key_key2buf_for_openssl_compatibility.patch index d2e21d3c0d..aa8f3d7ec3 100644 --- a/patches/common/boringssl/add_ec_key_key2buf_for_openssl_compatibility.patch +++ b/patches/common/boringssl/add_ec_key_key2buf_for_openssl_compatibility.patch @@ -9,7 +9,7 @@ Reviewed-by: Adam Langley Commit-Queue: Adam Langley diff --git a/crypto/fipsmodule/ec/ec_key.c b/crypto/fipsmodule/ec/ec_key.c -index 632dc9b2d902dfba01567f4c02ad7ad6d0c8c3e8..4bc12a073650f66f5ae8ba2beabb9a6fb2b21878 100644 +index a6d469767adfad1c9095cc58c567b10c71e95cfa..ba69e83cb8f49c70a98c8fd68fd7fa4b122da5cd 100644 --- a/crypto/fipsmodule/ec/ec_key.c +++ b/crypto/fipsmodule/ec/ec_key.c @@ -394,6 +394,33 @@ err: diff --git a/patches/common/boringssl/implement_ssl_get_tlsext_status_type.patch b/patches/common/boringssl/implement_ssl_get_tlsext_status_type.patch new file mode 100644 index 0000000000..f552ab39c6 --- /dev/null +++ b/patches/common/boringssl/implement_ssl_get_tlsext_status_type.patch @@ -0,0 +1,58 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jeremy Apthorp +Date: Thu, 18 Oct 2018 14:18:05 -0700 +Subject: Implement SSL_get_tlsext_status_type + +It's used by Node.js[1], and is simple to implement. + +[1]: https://github.com/nodejs/node/blob/e2f58c71ddf0f91256cc85e6bb226a068256c5eb/src/node_crypto.cc#L2390 + +Change-Id: Ie5c76b848623d00f7478aeae0214c25472de523c +Reviewed-on: https://boringssl-review.googlesource.com/c/32525 +Reviewed-by: David Benjamin +Commit-Queue: David Benjamin +CQ-Verified: CQ bot account: commit-bot@chromium.org + +diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h +index c0d44ce2820fb20273b453def0b5bcb5ddcc14e9..f0d9dd45e2c41968a84c8a3f31a8c9e4f621f018 100644 +--- a/include/openssl/ssl.h ++++ b/include/openssl/ssl.h +@@ -4268,6 +4268,14 @@ OPENSSL_EXPORT int OPENSSL_init_ssl(uint64_t opts, + // Use |SSL_enable_ocsp_stapling| instead. + OPENSSL_EXPORT int SSL_set_tlsext_status_type(SSL *ssl, int type); + ++// SSL_get_tlsext_status_type returns |TLSEXT_STATUSTYPE_ocsp| if the client ++// requested OCSP stapling and |TLSEXT_STATUSTYPE_nothing| otherwise. On the ++// client, this reflects whether OCSP stapling was enabled via, e.g., ++// |SSL_set_tlsext_status_type|. On the server, this is determined during the ++// handshake. It may be queried in callbacks set by |SSL_CTX_set_cert_cb|. The ++// result is undefined after the handshake completes. ++OPENSSL_EXPORT int SSL_get_tlsext_status_type(const SSL *ssl); ++ + // SSL_set_tlsext_status_ocsp_resp sets the OCSP response. It returns one on + // success and zero on error. On success, |ssl| takes ownership of |resp|, which + // must have been allocated by |OPENSSL_malloc|. +diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc +index 9c16de4958ef29d638e05e0f90b9b15b11b15cac..1f648658b8cb6ae7b82132b276b927e8fb11a47a 100644 +--- a/ssl/ssl_lib.cc ++++ b/ssl/ssl_lib.cc +@@ -2751,6 +2751,19 @@ int SSL_set_tlsext_status_type(SSL *ssl, int type) { + return 1; + } + ++int SSL_get_tlsext_status_type(const SSL *ssl) { ++ if (ssl->server) { ++ SSL_HANDSHAKE *hs = ssl->s3->hs.get(); ++ return hs != nullptr && hs->ocsp_stapling_requested ++ ? TLSEXT_STATUSTYPE_ocsp ++ : TLSEXT_STATUSTYPE_nothing; ++ } ++ ++ return ssl->config != nullptr && ssl->config->ocsp_stapling_enabled ++ ? TLSEXT_STATUSTYPE_ocsp ++ : TLSEXT_STATUSTYPE_nothing; ++} ++ + int SSL_set_tlsext_status_ocsp_resp(SSL *ssl, uint8_t *resp, size_t resp_len) { + if (SSL_set_ocsp_response(ssl, resp, resp_len)) { + OPENSSL_free(resp); diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index 53e803ba1c..60404c0c5b 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -2,6 +2,7 @@ add_realloc.patch build_gn.patch dcheck.patch accelerator.patch +app_indicator_icon_menu.patch blink_file_path.patch blink_local_frame.patch blink_world_context.patch @@ -42,6 +43,7 @@ mas-cgdisplayusesforcetogray.patch mas-audiodeviceduck.patch mas-lssetapplicationlaunchservicesserverconnectionstatus.patch allow_webview_file_url.patch +windows_cc_wrapper.patch enable_osr_components.patch ignore_rc_check.patch enable_widevine.patch @@ -64,9 +66,9 @@ tts.patch color_chooser.patch printing.patch verbose_generate_breakpad_symbols.patch +customizable_app_indicator_id_prefix.patch cross_site_document_resource_handler.patch content_allow_embedder_to_prevent_locking_scheme_registry.patch +fix_trackpad_scrolling.patch support_mixed_sandbox_with_zygote.patch disable_color_correct_rendering.patch -disable_time_ticks_dcheck.patch -fix_test_compilation_error.patch diff --git a/patches/common/chromium/accelerator.patch b/patches/common/chromium/accelerator.patch index 2dd2474efa..7c311e88c0 100644 --- a/patches/common/chromium/accelerator.patch +++ b/patches/common/chromium/accelerator.patch @@ -5,7 +5,7 @@ Subject: accelerator.patch diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc -index bf214d0b04ea5cf6711cd50618ad843bd054e538..7f245b1e8b9b3c5dc6666be4d74b69c86e80a351 100644 +index d56e87be04cb4d765d0aa0eae1af86a9f562b222..9364ac4b75debc61e201e0da7eaef104acea770d 100644 --- a/ui/base/accelerators/accelerator.cc +++ b/ui/base/accelerators/accelerator.cc @@ -11,6 +11,7 @@ @@ -16,7 +16,7 @@ index bf214d0b04ea5cf6711cd50618ad843bd054e538..7f245b1e8b9b3c5dc6666be4d74b69c8 #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "ui/base/l10n/l10n_util.h" -@@ -22,9 +23,7 @@ +@@ -21,9 +22,7 @@ #include #endif @@ -26,7 +26,7 @@ index bf214d0b04ea5cf6711cd50618ad843bd054e538..7f245b1e8b9b3c5dc6666be4d74b69c8 namespace ui { -@@ -148,7 +147,15 @@ base::string16 Accelerator::GetShortcutText() const { +@@ -147,7 +146,15 @@ base::string16 Accelerator::GetShortcutText() const { shortcut = KeyCodeToName(key_code_); #endif @@ -42,7 +42,7 @@ index bf214d0b04ea5cf6711cd50618ad843bd054e538..7f245b1e8b9b3c5dc6666be4d74b69c8 #if defined(OS_WIN) // Our fallback is to try translate the key code to a regular character // unless it is one of digits (VK_0 to VK_9). Some keyboard -@@ -157,18 +164,14 @@ base::string16 Accelerator::GetShortcutText() const { +@@ -156,18 +163,14 @@ base::string16 Accelerator::GetShortcutText() const { // accent' for '0'). For display in the menu (e.g. Ctrl-0 for the // default zoom level), we leave VK_[0-9] alone without translation. wchar_t key; @@ -52,7 +52,7 @@ index bf214d0b04ea5cf6711cd50618ad843bd054e538..7f245b1e8b9b3c5dc6666be4d74b69c8 - else - key = LOWORD(::MapVirtualKeyW(key_code_, MAPVK_VK_TO_CHAR)); - shortcut += key; --#elif defined(USE_AURA) || defined(OS_MACOSX) || defined(OS_ANDROID) +-#elif defined(USE_AURA) || defined(OS_MACOSX) - const uint16_t c = DomCodeToUsLayoutCharacter( - UsLayoutKeyboardCodeToDomCode(key_code_), false); - if (c != 0) @@ -67,7 +67,7 @@ index bf214d0b04ea5cf6711cd50618ad843bd054e538..7f245b1e8b9b3c5dc6666be4d74b69c8 } // Checking whether the character used for the accelerator is alphanumeric. -@@ -232,7 +235,7 @@ base::string16 Accelerator::ApplyLongFormModifiers( +@@ -231,7 +234,7 @@ base::string16 Accelerator::ApplyLongFormModifiers( // more information. if (IsCtrlDown()) shortcut = ApplyModifierToAcceleratorString(shortcut, IDS_APP_CTRL_KEY); diff --git a/patches/common/chromium/add_realloc.patch b/patches/common/chromium/add_realloc.patch index 753f7fb587..a59c75f35b 100644 --- a/patches/common/chromium/add_realloc.patch +++ b/patches/common/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 0050eb07bf1f1e8515663dfd14f2a3a1292edd96..96e8702f7e9f2a04a4edbc794d5c45e3e04bf8fb 100644 +index 5db87633802ccc7efbd6b673505cd5c00deabf6e..235be280c4d9e54bcc2e3f60fc10036ad3b08356 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc -@@ -662,6 +662,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { +@@ -660,6 +660,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { size, WTF::ArrayBufferContents::kDontInitialize); } @@ -54,7 +54,7 @@ index 0050eb07bf1f1e8515663dfd14f2a3a1292edd96..96e8702f7e9f2a04a4edbc794d5c45e3 WTF::ArrayBufferContents::FreeMemory(data); } diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc -index 5a8dbf109f4f7eb682c23bf24c391b70a7717a0c..e0b33e815f2eb98aa494a8489543acdb873e1597 100644 +index 127d6d39d5b089f3a91edc100be24b046c4da4fe..5ee94712c0fbf0a16eeca7aadd1a5be187bcf49e 100644 --- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc +++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc @@ -122,6 +122,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size, @@ -70,7 +70,7 @@ index 5a8dbf109f4f7eb682c23bf24c391b70a7717a0c..e0b33e815f2eb98aa494a8489543acdb 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 3cc1abe8e48c8e45d1f3ebb98a6a6ea1a4e3fbd9..1e2438cc6da97a89fefc86148bb1037d3c84f765 100644 +index 19ae6eb4a08c3499674f906c53164fa9194e5cf2..2f75c4b46c361f411c41242c406358da974ff7e4 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 @@ -134,6 +134,7 @@ class WTF_EXPORT ArrayBufferContents { diff --git a/patches/common/chromium/allow_webview_file_url.patch b/patches/common/chromium/allow_webview_file_url.patch index 0ae90e4efb..9c14fa42eb 100644 --- a/patches/common/chromium/allow_webview_file_url.patch +++ b/patches/common/chromium/allow_webview_file_url.patch @@ -6,10 +6,10 @@ Subject: allow_webview_file_url.patch Allow webview to load non-web URLs. diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc -index 83b81f3e28f5f4f3a9fe3c2146c50a966f7e2ec2..d0f2bde4f6f7bb1a8b6cfc5dc990cb30d4432504 100644 +index 8f33f39eb1d4bcae2e1d78890ee5e9e2d88b1e75..7645b12dbccf5a714e32c74c437216fdca9ac286 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc -@@ -1462,6 +1462,8 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest( +@@ -1480,6 +1480,8 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest( !policy->IsWebSafeScheme(info.common_params.url.scheme()) && !is_external_protocol; diff --git a/patches/common/chromium/app_indicator_icon_menu.patch b/patches/common/chromium/app_indicator_icon_menu.patch new file mode 100644 index 0000000000..102ee42304 --- /dev/null +++ b/patches/common/chromium/app_indicator_icon_menu.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Anonymous +Date: Thu, 20 Sep 2018 17:44:52 -0700 +Subject: app_indicator_icon_menu.patch + + +diff --git a/chrome/browser/ui/libgtkui/app_indicator_icon_menu.cc b/chrome/browser/ui/libgtkui/app_indicator_icon_menu.cc +index 40399a35f8d2c70827adec732c898a5be09cf69b..1d3a0da948dca3fef3af53256d23e8ae2bd23bfa 100644 +--- a/chrome/browser/ui/libgtkui/app_indicator_icon_menu.cc ++++ b/chrome/browser/ui/libgtkui/app_indicator_icon_menu.cc +@@ -116,7 +116,7 @@ void AppIndicatorIconMenu::OnMenuItemActivated(GtkWidget* menu_item) { + return; + + // The menu item can still be activated by hotkeys even if it is disabled. +- if (menu_model_->IsEnabledAt(id)) ++ if (model->IsEnabledAt(id)) + ExecuteCommand(model, id); + } + diff --git a/patches/common/chromium/blink-worker-enable-csp-in-file-scheme.patch b/patches/common/chromium/blink-worker-enable-csp-in-file-scheme.patch index 17a3afb9bf..6ef24d86ad 100644 --- a/patches/common/chromium/blink-worker-enable-csp-in-file-scheme.patch +++ b/patches/common/chromium/blink-worker-enable-csp-in-file-scheme.patch @@ -5,10 +5,10 @@ Subject: blink-worker-enable-csp-in-file-scheme.patch diff --git a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc -index c0cec745454d8e7ec0730852bb324bcae72ed42e..4550698d31ae2c1a511820ae88ce1d914fe10f7f 100644 +index 4bc3d11ba0270bb4bba863724688ee5b6bc063d2..4f9accd65348b9c8f23f3e2d160e836c7841420b 100644 --- a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc +++ b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc -@@ -285,7 +285,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy( +@@ -261,7 +261,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy( // document (which is implemented in WorkerMessagingProxy, and // m_contentSecurityPolicy should be left as nullptr to inherit the policy). if (!response.Url().ProtocolIs("blob") && diff --git a/patches/common/chromium/blink_file_path.patch b/patches/common/chromium/blink_file_path.patch index 62c5651508..715d0c6ade 100644 --- a/patches/common/chromium/blink_file_path.patch +++ b/patches/common/chromium/blink_file_path.patch @@ -7,10 +7,10 @@ This is used by editors to obtain the filesystem path from a dragged file. See documentation at https://electronjs.org/docs/api/file-object diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h -index 2ca09ab8903d56b466e186203279e865ed4dd058..d522b53111a1c452220a1ca08ffcc7206adaa309 100644 +index 39831f1902c6ab85a0a4cac61a614931ee050ed6..fddb013aa122049de7142bca624d7d0749b58372 100644 --- a/third_party/blink/renderer/core/fileapi/file.h +++ b/third_party/blink/renderer/core/fileapi/file.h -@@ -193,6 +193,9 @@ class CORE_EXPORT File final : public Blob { +@@ -168,6 +168,9 @@ class CORE_EXPORT File final : public Blob { } const String& name() const { return name_; } diff --git a/patches/common/chromium/blink_fix_prototype_assert.patch b/patches/common/chromium/blink_fix_prototype_assert.patch index bb22dfc42a..99a0a31e29 100644 --- a/patches/common/chromium/blink_fix_prototype_assert.patch +++ b/patches/common/chromium/blink_fix_prototype_assert.patch @@ -11,7 +11,7 @@ In the long term we should investigate why it happened, and take a more formal fix. But for now I'm just make this assertion silently pass away. diff --git a/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc b/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc -index e1378ffcd7e061aae635ad25078ee23674542786..6b07828930a9d5691609da394c192b9b5f531b5a 100644 +index 87f2176ce897583b6682e8f49d1e4cac1392aacb..ce3d9ce19bff686640be08776a7dc5736e9bd83a 100644 --- a/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc +++ b/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc @@ -98,8 +98,10 @@ v8::Local V8ObjectConstructor::CreateInterfaceObject( @@ -26,4 +26,4 @@ index e1378ffcd7e061aae635ad25078ee23674542786..6b07828930a9d5691609da394c192b9b + return v8::Local(); prototype_object = prototype_value.As(); - } + if (prototype_object->InternalFieldCount() == diff --git a/patches/common/chromium/blink_initialization_order.patch b/patches/common/chromium/blink_initialization_order.patch index c143e34cfe..1376055bd4 100644 --- a/patches/common/chromium/blink_initialization_order.patch +++ b/patches/common/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 b43ca24b2595bbd20fb5cfa68a22ebec87acda33..496e5d16d49977cb2107a7101064093be19b1515 100644 +index e148eda29606cdf8856c6875dc8e370f29e90f8a..c7289e9c60fc75d0db0d3671d7dd4b428bd80329 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 @@ -177,11 +177,10 @@ void LocalWindowProxy::Initialize() { @@ -23,6 +23,6 @@ index b43ca24b2595bbd20fb5cfa68a22ebec87acda33..496e5d16d49977cb2107a7101064093b - InstallConditionalFeatures(); - - // This needs to go after everything else since it accesses the window object. - InitializeV8ExtrasBinding(script_state_); - + if (World().IsMainWorld()) { + GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld(); + } diff --git a/patches/common/chromium/blink_local_frame.patch b/patches/common/chromium/blink_local_frame.patch index 8e7a33a991..5e0ccbd3f9 100644 --- a/patches/common/chromium/blink_local_frame.patch +++ b/patches/common/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 72df3508f9ea9219d3ca3aa716afcad01b378f7e..a7b8051311ef259c3297925c2f5050372ec3ac5b 100644 +index 19862e24a7f5aa9ae85a7731803aaedd56109354..9cd8833ae9b40a2bf9a875fb357459e858f2b180 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc -@@ -399,10 +399,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) { +@@ -394,10 +394,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) { } CHECK(!view_ || !view_->IsAttached()); @@ -28,7 +28,7 @@ index 72df3508f9ea9219d3ca3aa716afcad01b378f7e..a7b8051311ef259c3297925c2f505037 if (!Client()) return; -@@ -420,6 +416,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) { +@@ -415,6 +411,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/common/chromium/blink_world_context.patch b/patches/common/chromium/blink_world_context.patch index 51be49551a..3590532e39 100644 --- a/patches/common/chromium/blink_world_context.patch +++ b/patches/common/chromium/blink_world_context.patch @@ -5,10 +5,10 @@ Subject: blink_world_context.patch diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h -index 4b680e1b99ee3dbbb8ed74d281ed1768b7b9a87a..4135cd54ddfd2295534515ca5c99eb58471d56ff 100644 +index 68b3ae21865f7c23072e2783e6c474cd0d96b806..6318eb4bac9ac38185f3192c73489966d6918a9b 100644 --- a/third_party/blink/public/web/web_local_frame.h +++ b/third_party/blink/public/web/web_local_frame.h -@@ -353,6 +353,9 @@ class WebLocalFrame : public WebFrame { +@@ -441,6 +441,9 @@ class WebLocalFrame : public WebFrame { // be calling this API. virtual v8::Local MainWorldScriptContext() const = 0; @@ -19,10 +19,10 @@ index 4b680e1b99ee3dbbb8ed74d281ed1768b7b9a87a..4135cd54ddfd2295534515ca5c99eb58 // 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 6f286a3e4007b60479f0279ef24afa3397112962..31ffedb206ae8315a7c19c4e0b091aa119bfe58b 100644 +index a7c0e79100e18fe02469a8453c84713ee68d5019..2f71ed674e4cb41e42b320e7bb0373dfb01df519 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 -@@ -895,6 +895,13 @@ v8::Local WebLocalFrameImpl::GlobalProxy() const { +@@ -891,6 +891,13 @@ v8::Local WebLocalFrameImpl::GlobalProxy() const { return MainWorldScriptContext()->Global(); } @@ -37,10 +37,10 @@ index 6f286a3e4007b60479f0279ef24afa3397112962..31ffedb206ae8315a7c19c4e0b091aa1 return BindingSecurity::ShouldAllowAccessToFrame( CurrentDOMWindow(V8PerIsolateData::MainThreadIsolate()), diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h -index 3f046d8c62324b70a89e37e23c4b15bb0b8e6e7a..18c14a90c18cb349fca4c64692bb899b2c1a7622 100644 +index e857ff94ca93d44b67b2b850516fc6a93ac344e4..69ad8c4e747ac1ee311135371d932cf0b15b377c 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h -@@ -149,6 +149,8 @@ class CORE_EXPORT WebLocalFrameImpl final +@@ -148,6 +148,8 @@ class CORE_EXPORT WebLocalFrameImpl final int argc, v8::Local argv[]) override; v8::Local MainWorldScriptContext() const override; diff --git a/patches/common/chromium/boringssl_build_gn.patch b/patches/common/chromium/boringssl_build_gn.patch index fc473072e0..ae34d92c8c 100644 --- a/patches/common/chromium/boringssl_build_gn.patch +++ b/patches/common/chromium/boringssl_build_gn.patch @@ -7,10 +7,10 @@ Build BoringSSL with some extra functions that nodejs needs. Only affects the GN build; with the GYP build, nodejs is still built with OpenSSL. diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn -index 6e4fc85f124ed6dd4a7ac1812686fa59c4e50cdf..2fbd44c0ac71bbd84706ef50dd0d98b2466d4295 100644 +index f57824f04d044b7180c0fc41df616a22174fe367..37735a7c2cad0a75aa609bac4e855cc564a7b2eb 100644 --- a/third_party/boringssl/BUILD.gn +++ b/third_party/boringssl/BUILD.gn -@@ -45,6 +45,13 @@ config("no_asm_config") { +@@ -46,6 +46,13 @@ config("no_asm_config") { all_sources = crypto_sources + ssl_sources all_headers = crypto_headers + ssl_headers @@ -22,5 +22,5 @@ index 6e4fc85f124ed6dd4a7ac1812686fa59c4e50cdf..2fbd44c0ac71bbd84706ef50dd0d98b2 + ] +} - # Windows' assembly is built with NASM. The other platforms use the platform - # assembler. Exclude Windows ARM64 because NASM targets x86 and x64 only. + # Windows' assembly is built with Yasm. The other platforms use the platform + # assembler. diff --git a/patches/common/chromium/browser_compositor_mac.patch b/patches/common/chromium/browser_compositor_mac.patch index 6c822987b0..be0aac1378 100644 --- a/patches/common/chromium/browser_compositor_mac.patch +++ b/patches/common/chromium/browser_compositor_mac.patch @@ -5,7 +5,7 @@ Subject: browser_compositor_mac.patch diff --git a/content/browser/renderer_host/browser_compositor_view_mac.h b/content/browser/renderer_host/browser_compositor_view_mac.h -index da7e3391774e14550f7adf5956ca44b8b880662e..8b399558ad2469f6452e1793e8834d5c4f93adeb 100644 +index 71a9e1024b6055b1b1cc1e51d898a030e7f72111..479110fef40183c0d5d301686c1e8ae754317b29 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.h +++ b/content/browser/renderer_host/browser_compositor_view_mac.h @@ -60,6 +60,8 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient, @@ -14,10 +14,10 @@ index da7e3391774e14550f7adf5956ca44b8b880662e..8b399558ad2469f6452e1793e8834d5c + ui::Layer* GetRootLayer() { return root_layer_.get(); } + - // Force a new surface id to be allocated. Returns true if the - // RenderWidgetHostImpl sent the resulting surface id to the renderer. - bool ForceNewSurfaceId(); -@@ -68,6 +70,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient, + // Ensure that the currect compositor frame be cleared (even if it is + // potentially visible). + void ClearCompositorFrame(); +@@ -70,6 +72,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient, // no valid frame is available. const gfx::CALayerParams* GetLastCALayerParams() const; @@ -26,10 +26,10 @@ index da7e3391774e14550f7adf5956ca44b8b880662e..8b399558ad2469f6452e1793e8834d5c viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink); void OnDidNotProduceFrame(const viz::BeginFrameAck& ack); diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm -index 21d3b34cc13f3471dcef456ec92ad7c1c4a012f4..cffbf04e781cff2d10283c7ef2093959f25e432b 100644 +index 65670cccb50312a7cf0895ae39db01bc19d42d3d..235303a210fadd7ecfa7d1878df9fc93f2655b38 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.mm +++ b/content/browser/renderer_host/browser_compositor_view_mac.mm -@@ -79,6 +79,12 @@ BrowserCompositorMac::~BrowserCompositorMac() { +@@ -79,6 +79,12 @@ DCHECK_EQ(1u, num_erased); } diff --git a/patches/common/chromium/build_gn.patch b/patches/common/chromium/build_gn.patch index d161a49c72..65585afe6c 100644 --- a/patches/common/chromium/build_gn.patch +++ b/patches/common/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 f33cba178d7710b1ad624fcd1b649b370bb401a4..15ac71c3fddc63121f6959e69eb1ac8e9c15310d 100644 +index 387fdb2795a832ba8ee1187f3097f736c69e9839..590d457928ced573a7152a129bbfcf01309ee3c1 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -123,6 +123,9 @@ if (current_os == "") { @@ -18,7 +18,7 @@ index f33cba178d7710b1ad624fcd1b649b370bb401a4..15ac71c3fddc63121f6959e69eb1ac8e # 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 -@@ -537,6 +540,7 @@ default_compiler_configs = [ +@@ -536,6 +539,7 @@ default_compiler_configs = [ "//build/config/compiler:thin_archive", "//build/config/coverage:default_coverage", "//build/config/sanitizers:default_sanitizer_flags", diff --git a/patches/common/chromium/can_create_window.patch b/patches/common/chromium/can_create_window.patch index bc44ff950b..a3df054a41 100644 --- a/patches/common/chromium/can_create_window.patch +++ b/patches/common/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 e738789b56a39c8d1247c3916336c5fd2ff59446..a75b38add55b5c35c6480606b2ed856190d44413 100644 +index a17ae7ca0c070aeb1e741f3db80f3bc71f36308d..86560af1b9e3861dbe4455403cf3af0f183fd6c7 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc -@@ -3517,6 +3517,38 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -3333,6 +3333,38 @@ void RenderFrameHostImpl::CreateNewWindow( "frame_tree_node", frame_tree_node_->frame_tree_node_id(), "url", params->target_url.possibly_invalid_spec()); @@ -47,19 +47,19 @@ index e738789b56a39c8d1247c3916336c5fd2ff59446..a75b38add55b5c35c6480606b2ed8561 bool no_javascript_access = false; // Filter out URLs to which navigation is disallowed from this context. -@@ -3545,6 +3577,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -3361,6 +3393,7 @@ void RenderFrameHostImpl::CreateNewWindow( last_committed_origin_.GetURL(), params->window_container_type, - params->target_url, params->referrer.To(), - params->frame_name, params->disposition, *params->features, + params->target_url, params->referrer, params->frame_name, + params->disposition, *params->features, + params->additional_features, body, effective_transient_activation_state, params->opener_suppressed, &no_javascript_access); diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc -index b72385bcebf35f16ad913e1f2a824653503bc483..6bfa8c215fd221031902ab63a38eef7234502352 100644 +index 82af60872317fdaf16561c9f9adecb79ce82f610..bf72f1adf22e71ebcae50dd9fb1b88e8178a7767 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc -@@ -387,6 +387,7 @@ IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, +@@ -357,6 +357,7 @@ IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, mojom::CreateNewWindowParamsPtr params = mojom::CreateNewWindowParams::New(); params->target_url = GURL("about:blank"); @@ -68,7 +68,7 @@ index b72385bcebf35f16ad913e1f2a824653503bc483..6bfa8c215fd221031902ab63a38eef72 std::move(params), base::BindOnce([](mojom::CreateNewWindowStatus, mojom::CreateNewWindowReplyPtr) {})); diff --git a/content/common/frame.mojom b/content/common/frame.mojom -index a9cd1241fdcfbd40bb2944193328b15929bd5f14..5207347bc8292b04a4452df5fe66984fb8d4cd7f 100644 +index 25346dc852e799a2562386a6207d2de31077695f..908a8676daeb753c1580f98e8babf203cfa5b719 100644 --- a/content/common/frame.mojom +++ b/content/common/frame.mojom @@ -12,6 +12,8 @@ import "content/public/common/resource_type.mojom"; @@ -117,10 +117,10 @@ index a9cd1241fdcfbd40bb2944193328b15929bd5f14..5207347bc8292b04a4452df5fe66984f // 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 9029d6576bc13a49ac2b6781d12e7641b7d4178b..543e9d90098e65286482b82a98a116d3224925a9 100644 +index 6ed69effde7e7b269191788bedd4f98e3d778d67..abfb6afec00a691ea2ff27e7797921e3eb25d8ea 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -494,6 +494,8 @@ bool ContentBrowserClient::CanCreateWindow( +@@ -460,6 +460,8 @@ bool ContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -130,10 +130,10 @@ index 9029d6576bc13a49ac2b6781d12e7641b7d4178b..543e9d90098e65286482b82a98a116d3 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 ff83421f2bb8268ccc32d95ed9d2b4e7715c8d7b..6962a00811a20a8dd78ee3688fac31a87500b4dc 100644 +index b33545b865e4677ee2e9a909d259df171c12d985..eb2f9a8f240f8805e4bcbde0465ec445dd7539e7 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -170,6 +170,7 @@ class RenderFrameHost; +@@ -169,6 +169,7 @@ class RenderFrameHost; class RenderProcessHost; class RenderViewHost; class ResourceContext; @@ -141,7 +141,7 @@ index ff83421f2bb8268ccc32d95ed9d2b4e7715c8d7b..6962a00811a20a8dd78ee3688fac31a8 class ServiceManagerConnection; class SiteInstance; class SpeechRecognitionManagerDelegate; -@@ -781,6 +782,8 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -757,6 +758,8 @@ class CONTENT_EXPORT ContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -151,10 +151,10 @@ index ff83421f2bb8268ccc32d95ed9d2b4e7715c8d7b..6962a00811a20a8dd78ee3688fac31a8 bool opener_suppressed, bool* no_javascript_access); diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc -index 7bf71ed5baaf391b96d8cfff2a5a3e4929cd3a07..92469c3007c2108756e685e7897b7c8c4a49c00f 100644 +index bc72fadb307f801d9f1b6c90189596c36d7203e7..a95a89178cf80dc1f6efb15e0ea7ce92d1fd26ed 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc -@@ -77,6 +77,7 @@ +@@ -76,6 +76,7 @@ #include "content/renderer/ime_event_guard.h" #include "content/renderer/internal_document_state_data.h" #include "content/renderer/loader/request_extra_data.h" @@ -162,7 +162,7 @@ index 7bf71ed5baaf391b96d8cfff2a5a3e4929cd3a07..92469c3007c2108756e685e7897b7c8c #include "content/renderer/media/audio/audio_device_factory.h" #include "content/renderer/media/stream/media_stream_device_observer.h" #include "content/renderer/media/video_capture_impl_manager.h" -@@ -1345,6 +1346,46 @@ WebView* RenderViewImpl::CreateView( +@@ -1379,6 +1380,46 @@ WebView* RenderViewImpl::CreateView(WebLocalFrame* creator, } params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features); @@ -210,10 +210,10 @@ index 7bf71ed5baaf391b96d8cfff2a5a3e4929cd3a07..92469c3007c2108756e685e7897b7c8c // moved on send. bool is_background_tab = diff --git a/content/shell/browser/layout_test/layout_test_content_browser_client.cc b/content/shell/browser/layout_test/layout_test_content_browser_client.cc -index 393a34c290fc9ec5a56b685f5ba704132c8610f1..95498ec705ae3ea96efd387559f20585d1cae9f2 100644 +index 1c7ae733b09ed16183d9772c1954f6f190866d26..c7e4faf01f5f2d4dc110588c16bb67417c51bbf9 100644 --- a/content/shell/browser/layout_test/layout_test_content_browser_client.cc +++ b/content/shell/browser/layout_test/layout_test_content_browser_client.cc -@@ -299,6 +299,8 @@ bool LayoutTestContentBrowserClient::CanCreateWindow( +@@ -282,6 +282,8 @@ bool LayoutTestContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -223,10 +223,10 @@ index 393a34c290fc9ec5a56b685f5ba704132c8610f1..95498ec705ae3ea96efd387559f20585 bool opener_suppressed, bool* no_javascript_access) { diff --git a/content/shell/browser/layout_test/layout_test_content_browser_client.h b/content/shell/browser/layout_test/layout_test_content_browser_client.h -index b416ba6d27d3ad118440bc92ffe95ddd362f6ccf..81271680f73fa3606f672b9e6069c9f74ffbef44 100644 +index 76d53623ff698bec66dba4342e9384685ffb753e..d8b8e17dc22b96f083336cd3dcd888f89173eea1 100644 --- a/content/shell/browser/layout_test/layout_test_content_browser_client.h +++ b/content/shell/browser/layout_test/layout_test_content_browser_client.h -@@ -67,6 +67,8 @@ class LayoutTestContentBrowserClient : public ShellContentBrowserClient { +@@ -66,6 +66,8 @@ class LayoutTestContentBrowserClient : public ShellContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, diff --git a/patches/common/chromium/chrome_key_systems.patch b/patches/common/chromium/chrome_key_systems.patch index 4fc7b1dec5..346f0dd256 100644 --- a/patches/common/chromium/chrome_key_systems.patch +++ b/patches/common/chromium/chrome_key_systems.patch @@ -7,7 +7,7 @@ Disable persiste licence support check for widevine cdm, as its not supported in the current version of chrome. diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc -index 0ef05eceaa0e42710c6cfa8acb2174cf930f6114..e0356f615f8bae10b5030f038057be027491f96c 100644 +index bcf7d3a812ef8d105d6ffb5bc72432e15a98f10c..5d63d3824e53ec5b704b93b95e70ea1d5e5627b1 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc @@ -15,7 +15,9 @@ @@ -20,7 +20,7 @@ index 0ef05eceaa0e42710c6cfa8acb2174cf930f6114..e0356f615f8bae10b5030f038057be02 #include "components/cdm/renderer/external_clear_key_key_system_properties.h" #include "components/cdm/renderer/widevine_key_system_properties.h" #include "content/public/renderer/render_thread.h" -@@ -194,12 +196,14 @@ static SupportedCodecs GetSupportedCodecs( +@@ -189,12 +191,14 @@ static SupportedCodecs GetSupportedCodecs( // Returns persistent-license session support. static EmeSessionTypeSupport GetPersistentLicenseSupport( bool supported_by_the_cdm) { diff --git a/patches/common/chromium/color_chooser.patch b/patches/common/chromium/color_chooser.patch index 9da0db708d..257dae3a12 100644 --- a/patches/common/chromium/color_chooser.patch +++ b/patches/common/chromium/color_chooser.patch @@ -15,7 +15,7 @@ code was around 2012-2013, and this is purely UI, I don't think they have automated tests for it). diff --git a/chrome/browser/ui/browser_dialogs.h b/chrome/browser/ui/browser_dialogs.h -index 415ca1dcaf946fc576ddad660ea507981fd81458..2a5352b358a8f337e61af1143fe0a84628985eab 100644 +index f68bd5a7bf50eea701410779ed982db045f652a7..1c31eca5aaed470960e64f760c4328c0c155310f 100644 --- a/chrome/browser/ui/browser_dialogs.h +++ b/chrome/browser/ui/browser_dialogs.h @@ -4,7 +4,7 @@ @@ -57,7 +57,7 @@ index 415ca1dcaf946fc576ddad660ea507981fd81458..2a5352b358a8f337e61af1143fe0a846 #if defined(OS_MACOSX) // Bridging methods that show/hide the toolkit-views based Task Manager on Mac. -@@ -313,13 +315,13 @@ void ShowChromeCleanerRebootPrompt( +@@ -311,13 +313,13 @@ void ShowChromeCleanerRebootPrompt( safe_browsing::ChromeCleanerRebootDialogController* dialog_controller); #endif // OS_WIN diff --git a/patches/common/chromium/command-ismediakey.patch b/patches/common/chromium/command-ismediakey.patch index b96b33e0e3..758eb78d4f 100644 --- a/patches/common/chromium/command-ismediakey.patch +++ b/patches/common/chromium/command-ismediakey.patch @@ -18,7 +18,7 @@ diff --git a/chrome/browser/extensions/global_shortcut_listener_mac.mm b/chrome/ index f612ba2fb7952654663cbce596c43b0b65d5ea29..77c2c68e6f9bfec3fc887e2119243cee1321cd17 100644 --- a/chrome/browser/extensions/global_shortcut_listener_mac.mm +++ b/chrome/browser/extensions/global_shortcut_listener_mac.mm -@@ -20,6 +20,26 @@ using extensions::GlobalShortcutListenerMac; +@@ -20,6 +20,26 @@ namespace extensions { @@ -92,7 +92,7 @@ diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerat index cd595b0c017d6e36a5d94f7c99fe0a098a52b067..941c1a76a1c3ebe542aebcc9dc301d19bab47057 100644 --- a/ui/base/accelerators/media_keys_listener_mac.mm +++ b/ui/base/accelerators/media_keys_listener_mac.mm -@@ -30,6 +30,12 @@ ui::KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) { +@@ -30,6 +30,12 @@ case NX_KEYTYPE_NEXT: case NX_KEYTYPE_FAST: return ui::VKEY_MEDIA_NEXT_TRACK; @@ -105,7 +105,7 @@ index cd595b0c017d6e36a5d94f7c99fe0a098a52b067..941c1a76a1c3ebe542aebcc9dc301d19 } return ui::VKEY_UNKNOWN; } -@@ -180,7 +186,10 @@ CGEventRef MediaKeysListenerImpl::EventTapCallback(CGEventTapProxy proxy, +@@ -180,7 +186,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy, int key_code = (data1 & 0xFFFF0000) >> 16; if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT && key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST && diff --git a/patches/common/chromium/compositor_delegate.patch b/patches/common/chromium/compositor_delegate.patch index 79ebf48d3f..2d3a7f0a99 100644 --- a/patches/common/chromium/compositor_delegate.patch +++ b/patches/common/chromium/compositor_delegate.patch @@ -5,10 +5,10 @@ Subject: compositor_delegate.patch diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc -index 97d3236bed1726170966683f5b7dec7540b0603e..bc20368abe66b954dc292e8e2521de42349d6a57 100644 +index e8741caf69a8d3770905dcf1d466e7f01ddf69ba..b62009feb2e97362d90c6c917305f91cae27d790 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc -@@ -482,10 +482,20 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( +@@ -492,10 +492,20 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( // surfaces as they are not following the correct mode. DisableGpuCompositing(compositor.get()); } @@ -32,7 +32,7 @@ index 97d3236bed1726170966683f5b7dec7540b0603e..bc20368abe66b954dc292e8e2521de42 } else { DCHECK(context_provider); diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h -index 6f46fd5b4b57139da6855af99c2788a926c5ef25..4237c75c37ca4476e9fad25765629f7a14df042b 100644 +index b3905bdfa6500f02328552b7c2402797a71758be..490722c20c25f752e37ac3b481f8d2aa616408a4 100644 --- a/ui/compositor/compositor.h +++ b/ui/compositor/compositor.h @@ -26,6 +26,7 @@ @@ -43,7 +43,7 @@ index 6f46fd5b4b57139da6855af99c2788a926c5ef25..4237c75c37ca4476e9fad25765629f7a #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkMatrix44.h" #include "ui/compositor/compositor_animation_observer.h" -@@ -194,6 +195,15 @@ class COMPOSITOR_EXPORT ContextFactory { +@@ -198,6 +199,15 @@ class COMPOSITOR_EXPORT ContextFactory { virtual bool SyncTokensRequiredForDisplayCompositor() = 0; }; @@ -59,7 +59,7 @@ index 6f46fd5b4b57139da6855af99c2788a926c5ef25..4237c75c37ca4476e9fad25765629f7a // 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 -@@ -235,6 +245,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -237,6 +247,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); diff --git a/patches/common/chromium/content_allow_embedder_to_prevent_locking_scheme_registry.patch b/patches/common/chromium/content_allow_embedder_to_prevent_locking_scheme_registry.patch index 7563211283..8a316a7d16 100644 --- a/patches/common/chromium/content_allow_embedder_to_prevent_locking_scheme_registry.patch +++ b/patches/common/chromium/content_allow_embedder_to_prevent_locking_scheme_registry.patch @@ -12,10 +12,10 @@ Without this patch, calling `registerStandardSchemes` during initialization when in debug mode will cause a DCHECK to fire. diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc -index 88565a9019f378021c2b6251a4fada275d6062b1..8bedc05fe860f40e5f531f83fc5cc5c7812b9532 100644 +index 6ed770290b1f18791c1a38a0e8e4dc0f670c29cf..37668b3e74c4031417c5ff91376a20aa56e15c07 100644 --- a/content/app/content_main_runner_impl.cc +++ b/content/app/content_main_runner_impl.cc -@@ -747,7 +747,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { +@@ -739,7 +739,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { #endif RegisterPathProvider(); @@ -25,11 +25,11 @@ index 88565a9019f378021c2b6251a4fada275d6062b1..8bedc05fe860f40e5f531f83fc5cc5c7 #if defined(OS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE) int icudata_fd = g_fds->MaybeGet(kAndroidICUDataDescriptor); diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc -index 456df421598153bde006ad0ecb0f1031360bb543..af06d78b91fa30e5daf993ad2c65c2c5e35a17a5 100644 +index cf3c71fe0edc7fd9b788e5ca06cedcd5f9dfa369..877642228966170f3c6bbf4faf80af66bbac387e 100644 --- a/content/public/app/content_main_delegate.cc +++ b/content/public/app/content_main_delegate.cc -@@ -55,6 +55,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() { - return 0; +@@ -59,6 +59,10 @@ bool ContentMainDelegate::ShouldEnableProfilerRecording() { + return false; } +bool ContentMainDelegate::ShouldLockSchemeRegistry() { @@ -40,12 +40,12 @@ index 456df421598153bde006ad0ecb0f1031360bb543..af06d78b91fa30e5daf993ad2c65c2c5 return service_manager::ProcessType::kDefault; } diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h -index f836a17fa0568aa33e204725f96233aac236aac5..af1d5ef18fb414a681bee48d36c3f94ed789c077 100644 +index d55f5050c8c3cb15c549dd3ae90d00f1455d34c8..f00266ce4f93bea585f191512226cc40e1f46545 100644 --- a/content/public/app/content_main_delegate.h +++ b/content/public/app/content_main_delegate.h -@@ -88,6 +88,9 @@ class CONTENT_EXPORT ContentMainDelegate { - virtual void ZygoteForked() {} - #endif // defined(OS_LINUX) +@@ -93,6 +93,9 @@ class CONTENT_EXPORT ContentMainDelegate { + // Returns whether or not profiler recording should be enabled. + virtual bool ShouldEnableProfilerRecording(); + // Allows the embedder to prevent locking the scheme registry. + virtual bool ShouldLockSchemeRegistry(); diff --git a/patches/common/chromium/content_browser_main_loop.patch b/patches/common/chromium/content_browser_main_loop.patch index f95b5da3a3..005ec26f13 100644 --- a/patches/common/chromium/content_browser_main_loop.patch +++ b/patches/common/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 bce899c644484962d22b129f56f8fc3cbcb9f3b3..68867c51bed182fae0510e0b92d4cb715956135b 100644 +index 20471ef5ccae66fb8c09eb4da25a67304d7626c2..bcaf20bdf3cf78d6ffb3eacb57653f5139ebf41d 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc -@@ -1526,7 +1526,7 @@ void BrowserMainLoop::MainMessageLoopRun() { +@@ -1527,7 +1527,7 @@ void BrowserMainLoop::MainMessageLoopRun() { } base::RunLoop run_loop; diff --git a/patches/common/chromium/cross_site_document_resource_handler.patch b/patches/common/chromium/cross_site_document_resource_handler.patch index 646671e4dc..6943f6223b 100644 --- a/patches/common/chromium/cross_site_document_resource_handler.patch +++ b/patches/common/chromium/cross_site_document_resource_handler.patch @@ -22,10 +22,10 @@ index be1724e19eeb0186dc20dad48e0d604ff87918e5..3dea6a89eb12dc6be157c39787358cd8 } diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc -index f564df8841d1eaea29d4f09c679263ec97552e3b..809e140c4f6004aa95997df6fb6b76e2f8e23f95 100644 +index ae4bfc6553f347ad5a7e5327d64155e700e6584e..e279ded9407bbfda6d76072cd6fa2c8a06379e9f 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -58,6 +58,10 @@ ContentBrowserClient::SiteInstanceForNavigationType ContentBrowserClient::Should +@@ -59,6 +59,10 @@ ContentBrowserClient::SiteInstanceForNavigationType ContentBrowserClient::Should return SiteInstanceForNavigationType::ASK_CHROMIUM; } @@ -37,10 +37,10 @@ index f564df8841d1eaea29d4f09c679263ec97552e3b..809e140c4f6004aa95997df6fb6b76e2 const MainFunctionParams& parameters) { return nullptr; diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index af64896d0567870672bf4e2f45f7d76e1df68844..4ce6d14bd654e967e8cd5de43157167b98c162fc 100644 +index 5f6fdb2d66acfa73c895cac18714d0998eed2ab2..836851cfcbc94becdf3d4af682dbe3e098172c25 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -235,6 +235,9 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -233,6 +233,9 @@ class CONTENT_EXPORT ContentBrowserClient { content::RenderFrameHost* rfh, content::SiteInstance* pending_site_instance){}; diff --git a/patches/common/chromium/customizable_app_indicator_id_prefix.patch b/patches/common/chromium/customizable_app_indicator_id_prefix.patch new file mode 100644 index 0000000000..8dceffca12 --- /dev/null +++ b/patches/common/chromium/customizable_app_indicator_id_prefix.patch @@ -0,0 +1,113 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jeremy Apthorp +Date: Mon, 5 Nov 2018 20:13:27 +0000 +Subject: backport from M72: Make gtk app indicator id prefix customizable + +This makes the app indicator API in libgtkui usable by non-Chrome apps (in +particular, Electron). + +Change-Id: I39e547fc04595900d99806208955c632e4199be4 +Reviewed-on: https://chromium-review.googlesource.com/c/1315840 +Commit-Queue: Jeremy Apthorp +Reviewed-by: Thomas Anderson +Reviewed-by: Scott Violet +Cr-Commit-Position: refs/heads/master@{#605435} + +diff --git a/chrome/browser/ui/libgtkui/gtk_ui.cc b/chrome/browser/ui/libgtkui/gtk_ui.cc +index 3a829df4099f5223d0862c33a6ffc61b107b20b7..3b86e178d4c83f07231649360c8b65ca83143408 100644 +--- a/chrome/browser/ui/libgtkui/gtk_ui.cc ++++ b/chrome/browser/ui/libgtkui/gtk_ui.cc +@@ -234,11 +234,6 @@ typedef std::unique_ptr ScopedGIcon; + typedef std::unique_ptr ScopedGtkIconInfo; + typedef std::unique_ptr ScopedGdkPixbuf; + +-#if !GTK_CHECK_VERSION(3, 90, 0) +-// Prefix for app indicator ids +-const char kAppIndicatorIdPrefix[] = "chrome_app_indicator_"; +-#endif +- + // Number of app indicators used (used as part of app-indicator id). + int indicators_count; + +@@ -545,7 +540,8 @@ bool GtkUi::IsStatusIconSupported() const { + + std::unique_ptr GtkUi::CreateLinuxStatusIcon( + const gfx::ImageSkia& image, +- const base::string16& tool_tip) const { ++ const base::string16& tool_tip, ++ const char* id_prefix) const { + #if GTK_CHECK_VERSION(3, 90, 0) + NOTIMPLEMENTED(); + return nullptr; +@@ -553,8 +549,8 @@ std::unique_ptr GtkUi::CreateLinuxStatusIcon( + if (AppIndicatorIcon::CouldOpen()) { + ++indicators_count; + return std::unique_ptr(new AppIndicatorIcon( +- base::StringPrintf("%s%d", kAppIndicatorIdPrefix, indicators_count), +- image, tool_tip)); ++ base::StringPrintf("%s%d", id_prefix, indicators_count), image, ++ tool_tip)); + } else { + return std::unique_ptr( + new GtkStatusIcon(image, tool_tip)); +diff --git a/chrome/browser/ui/libgtkui/gtk_ui.h b/chrome/browser/ui/libgtkui/gtk_ui.h +index 1c626d1cafd1ec979be8dd5ef6ddbbc9d1b29bc2..2c98c1990419eb5276c01553caad559cf60714ad 100644 +--- a/chrome/browser/ui/libgtkui/gtk_ui.h ++++ b/chrome/browser/ui/libgtkui/gtk_ui.h +@@ -90,7 +90,8 @@ class GtkUi : public views::LinuxUI { + bool IsStatusIconSupported() const override; + std::unique_ptr CreateLinuxStatusIcon( + const gfx::ImageSkia& image, +- const base::string16& tool_tip) const override; ++ const base::string16& tool_tip, ++ const char* id_prefix) const override; + gfx::Image GetIconForContentType(const std::string& content_type, + int size) const override; + std::unique_ptr CreateNativeBorder( +diff --git a/chrome/browser/ui/views/status_icons/status_icon_linux_wrapper.cc b/chrome/browser/ui/views/status_icons/status_icon_linux_wrapper.cc +index eed6bb2eaf756189be016c382673e23eb7ca18e0..4694a9a920b1f9150399e183038f04ac700b4f52 100644 +--- a/chrome/browser/ui/views/status_icons/status_icon_linux_wrapper.cc ++++ b/chrome/browser/ui/views/status_icons/status_icon_linux_wrapper.cc +@@ -8,6 +8,13 @@ + #include "ui/message_center/public/cpp/notifier_id.h" + #include "ui/views/linux_ui/linux_ui.h" + ++namespace { ++ ++// Prefix for app indicator ids ++const char kAppIndicatorIdPrefix[] = "chrome_app_indicator_"; ++ ++} // namespace ++ + StatusIconLinuxWrapper::StatusIconLinuxWrapper( + std::unique_ptr status_icon) + : status_icon_(std::move(status_icon)), menu_model_(nullptr) { +@@ -53,7 +60,8 @@ StatusIconLinuxWrapper::CreateWrappedStatusIcon( + const base::string16& tool_tip) { + const views::LinuxUI* linux_ui = views::LinuxUI::instance(); + if (linux_ui) { +- auto status_icon = linux_ui->CreateLinuxStatusIcon(image, tool_tip); ++ auto status_icon = ++ linux_ui->CreateLinuxStatusIcon(image, tool_tip, kAppIndicatorIdPrefix); + if (status_icon) { + return base::WrapUnique( + new StatusIconLinuxWrapper(std::move(status_icon))); +diff --git a/ui/views/linux_ui/linux_ui.h b/ui/views/linux_ui/linux_ui.h +index 759d4ab03f02a338f5e89bf971a423f6b42814ed..208c9a5ac7eb5441110f34b3f7859945c591df21 100644 +--- a/ui/views/linux_ui/linux_ui.h ++++ b/ui/views/linux_ui/linux_ui.h +@@ -130,10 +130,12 @@ class VIEWS_EXPORT LinuxUI : public ui::LinuxInputMethodContextFactory, + // Checks for platform support for status icons. + virtual bool IsStatusIconSupported() const = 0; + +- // Create a native status icon. ++ // Create a native status icon. The id_prefix is used to distinguish Chrome's ++ // status icons from other apps' status icons, and should be unique. + virtual std::unique_ptr CreateLinuxStatusIcon( + const gfx::ImageSkia& image, +- const base::string16& tool_tip) const = 0; ++ const base::string16& tool_tip, ++ const char* id_prefix) const = 0; + + // Returns the icon for a given content type from the icon theme. + // TODO(davidben): Add an observer for the theme changing, so we can drop the diff --git a/patches/common/chromium/dcheck.patch b/patches/common/chromium/dcheck.patch index 4ae9c5ef6f..42b54050a0 100644 --- a/patches/common/chromium/dcheck.patch +++ b/patches/common/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 4c3c16176f2dced3f7f2e586594d9e368b358d37..9511aefc5cf61497fb98bb9bae028e67be41973c 100644 +index bd5221ce36f87e4f54cbf71268bbffa692701517..6c6a22fdea951662a63c88e6939404878afc45ab 100644 --- a/content/browser/frame_host/navigation_controller_impl.cc +++ b/content/browser/frame_host/navigation_controller_impl.cc -@@ -1101,8 +1101,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation( +@@ -995,8 +995,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation( return NAVIGATION_TYPE_NEW_SUBFRAME; } @@ -33,7 +33,7 @@ index 4c3c16176f2dced3f7f2e586594d9e368b358d37..9511aefc5cf61497fb98bb9bae028e67 if (rfh->GetParent()) { // All manual subframes would be did_create_new_entry and handled above, so -@@ -1339,7 +1341,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage( +@@ -1233,7 +1235,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage( new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon(); } @@ -46,7 +46,7 @@ index 4c3c16176f2dced3f7f2e586594d9e368b358d37..9511aefc5cf61497fb98bb9bae028e67 // 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/third_party/blink/renderer/platform/wtf/text/string_impl.h b/third_party/blink/renderer/platform/wtf/text/string_impl.h -index 3073b0856d29e442f8905041350a2bb196aa24ce..e997f094c75e055b44ce4a31c359c31cb1f25a14 100644 +index be183011e7f4e0af6f7676ac8a343ef36d2e7bc2..8b40c554912754b05d3bc5dc4889667f87935a0a 100644 --- a/third_party/blink/renderer/platform/wtf/text/string_impl.h +++ b/third_party/blink/renderer/platform/wtf/text/string_impl.h @@ -258,21 +258,21 @@ class WTF_EXPORT StringImpl { @@ -75,10 +75,10 @@ index 3073b0856d29e442f8905041350a2bb196aa24ce..e997f094c75e055b44ce4a31c359c31c << AsciiForDebugging() << " " << CurrentThread(); #endif diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc -index 1857bfa07ce3d8656105e696363a760889794e77..c25d8c241907fb166218670533a3b6e1e2f32769 100644 +index e49dd8c81270cdd9794ddee11bad036c2f444af5..9e61c901cd2df168520b83a8522ca8c032f4c0ae 100644 --- a/ui/base/clipboard/clipboard_win.cc +++ b/ui/base/clipboard/clipboard_win.cc -@@ -913,9 +913,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap, +@@ -905,9 +905,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap, } void ClipboardWin::WriteToClipboard(unsigned int format, HANDLE handle) { diff --git a/patches/common/chromium/desktop_media_list.patch b/patches/common/chromium/desktop_media_list.patch index 5330b489ee..693c554c9d 100644 --- a/patches/common/chromium/desktop_media_list.patch +++ b/patches/common/chromium/desktop_media_list.patch @@ -133,7 +133,7 @@ index 47401abc984e6fe26c7f4c5399aa565c687060b0..ca6a527ffac877c27aac94337ec5a7b5 protected: virtual ~DesktopMediaListObserver() {} diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc -index 867c10fb396c3c41cb68c4362c7a5175603489b9..13862dbeb06d933f1244d13148d040094d544086 100644 +index 5eac54ba5336d51b15da1e084df0fc7f6dc09deb..e7c2478850d5231e258fb4c54dd57db555273efc 100644 --- a/chrome/browser/media/webrtc/native_desktop_media_list.cc +++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc @@ -6,14 +6,15 @@ diff --git a/patches/common/chromium/disable-redraw-lock.patch b/patches/common/chromium/disable-redraw-lock.patch index 6cc7f193e8..61334700d3 100644 --- a/patches/common/chromium/disable-redraw-lock.patch +++ b/patches/common/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 b3c01542f183a247df30e5b96bbba8298d828153..8fe7e1142cb79cb3abf3cbc1cabc73b27695a63a 100644 +index 9afbcf6ca30a6282cfa0ade76fe07467d497ac2e..2945f4fe3744b0d8ae56393d935125e3118189b4 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -288,6 +288,10 @@ const int kSynthesizedMouseMessagesTimeDifference = 500; +@@ -282,6 +282,10 @@ const int kSynthesizedMouseMessagesTimeDifference = 500; } // namespace @@ -29,7 +29,7 @@ index b3c01542f183a247df30e5b96bbba8298d828153..8fe7e1142cb79cb3abf3cbc1cabc73b2 // 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. // -@@ -339,6 +343,7 @@ class HWNDMessageHandler::ScopedRedrawLock { +@@ -333,6 +337,7 @@ class HWNDMessageHandler::ScopedRedrawLock { cancel_unlock_(false), should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() && ::IsWindow(hwnd_) && @@ -37,7 +37,7 @@ index b3c01542f183a247df30e5b96bbba8298d828153..8fe7e1142cb79cb3abf3cbc1cabc73b2 (!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) || !ui::win::IsAeroGlassEnabled())) { if (should_lock_) -@@ -940,6 +945,10 @@ bool HWNDMessageHandler::HasChildRenderingWindow() { +@@ -933,6 +938,10 @@ bool HWNDMessageHandler::HasChildRenderingWindow() { hwnd()); } @@ -49,7 +49,7 @@ index b3c01542f183a247df30e5b96bbba8298d828153..8fe7e1142cb79cb3abf3cbc1cabc73b2 // HWNDMessageHandler, gfx::WindowImpl overrides: diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h -index 2efafcdba85f2f8c940bb5fc2b07f1ec1abdb3c9..ce3fdf8ec003f0b18fe94368b18f6efca5d6d7b4 100644 +index 593c3c0e95b50c9847994af705c053586e78689f..43e4a26502d837972d8acc68a1e7e7550766ddf6 100644 --- a/ui/views/win/hwnd_message_handler.h +++ b/ui/views/win/hwnd_message_handler.h @@ -182,6 +182,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl, @@ -62,10 +62,10 @@ index 2efafcdba85f2f8c940bb5fc2b07f1ec1abdb3c9..ce3fdf8ec003f0b18fe94368b18f6efc 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 17907e675bb1d9cf4bf2bff1d0668d36fdf42df0..0ca9cb470df588bb952faada6c658335dc76ed06 100644 +index b3f670dddf8936e29932345ef0516318b904d0ef..a63d727930a43c680ef3672921e63c35fc34191d 100644 --- a/ui/views/win/hwnd_message_handler_delegate.h +++ b/ui/views/win/hwnd_message_handler_delegate.h -@@ -45,6 +45,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate { +@@ -46,6 +46,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate { // True if the widget associated with this window has a non-client view. virtual bool HasNonClientView() const = 0; diff --git a/patches/common/chromium/disable_color_correct_rendering.patch b/patches/common/chromium/disable_color_correct_rendering.patch index 9fe3a58b6a..c7f38242ec 100644 --- a/patches/common/chromium/disable_color_correct_rendering.patch +++ b/patches/common/chromium/disable_color_correct_rendering.patch @@ -19,10 +19,10 @@ 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_host_impl.cc b/cc/trees/layer_tree_host_impl.cc -index dcfc217ced6adb75d6029b228f10bc8572d0018f..7882c60a5105ef28b9af776a9e406d37be70996d 100644 +index f51e30c0d2a55f104ca0912e487484102e443c85..fbec9767bdefc3b90335ecc423ffd4ea31bf914d 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc -@@ -1607,6 +1607,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( +@@ -1578,6 +1578,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( } RasterColorSpace LayerTreeHostImpl::GetRasterColorSpace() const { @@ -34,7 +34,7 @@ index dcfc217ced6adb75d6029b228f10bc8572d0018f..7882c60a5105ef28b9af776a9e406d37 // The pending tree will have the most recently updated color space, so // prefer that. diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h -index 7f074dd977e51270fa148df683efeffbce435a4b..fb982f81d082552225d9411dc764c7756cf50e02 100644 +index e124035096b02e82d526d7dfd0e70d4cf73819be..4f182c826a8d08a8674e3ca2f0bf833aa49a1309 100644 --- a/cc/trees/layer_tree_settings.h +++ b/cc/trees/layer_tree_settings.h @@ -98,6 +98,8 @@ class CC_EXPORT LayerTreeSettings { @@ -47,10 +47,10 @@ index 7f074dd977e51270fa148df683efeffbce435a4b..fb982f81d082552225d9411dc764c775 // Image Decode Service and raster tiles without images until the decode is // ready. diff --git a/components/viz/common/display/renderer_settings.h b/components/viz/common/display/renderer_settings.h -index 9539d2b5ad1af0450475d411cd43bfb1d37c11a6..aa3412a257851f235eae546a5d4e753a4e41d345 100644 +index 1327e8607c5192f2440341a33fc210aecd47ced5..543d6937a908560270c6bba431a255436b522608 100644 --- a/components/viz/common/display/renderer_settings.h +++ b/components/viz/common/display/renderer_settings.h -@@ -19,6 +19,7 @@ class VIZ_COMMON_EXPORT RendererSettings { +@@ -18,6 +18,7 @@ class VIZ_COMMON_EXPORT RendererSettings { RendererSettings(const RendererSettings& other); ~RendererSettings(); @@ -59,7 +59,7 @@ index 9539d2b5ad1af0450475d411cd43bfb1d37c11a6..aa3412a257851f235eae546a5d4e753a bool force_antialiasing = false; bool force_blending_with_shaders = false; diff --git a/components/viz/host/renderer_settings_creation.cc b/components/viz/host/renderer_settings_creation.cc -index 5c3ae3641af9648462b10bbe144df69196922934..5fb234b7c833f97e1d61fab76f2f6d7d7c9f0c9f 100644 +index eca6020535249e51b428de9dd6454273e6c9dd71..e190d2fb2e2cc41135c119485c2d447522134da1 100644 --- a/components/viz/host/renderer_settings_creation.cc +++ b/components/viz/host/renderer_settings_creation.cc @@ -11,6 +11,7 @@ @@ -80,7 +80,7 @@ index 5c3ae3641af9648462b10bbe144df69196922934..5fb234b7c833f97e1d61fab76f2f6d7d !command_line->HasSwitch(switches::kUIDisablePartialSwap); #if defined(OS_WIN) diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc -index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb3846733dba8e7 100644 +index a9ba5ca388b8d0979a1235a0d976b8cb3277f6d3..574deb6ad7d1b088eea43d87b8fe4637b980139b 100644 --- a/components/viz/service/display/gl_renderer.cc +++ b/components/viz/service/display/gl_renderer.cc @@ -77,6 +77,9 @@ @@ -93,7 +93,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 namespace viz { namespace { -@@ -519,8 +522,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad, +@@ -516,8 +519,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad, void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) { SetBlendEnabled(quad->ShouldDrawWithBlending()); @@ -105,7 +105,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 // Use the full quad_rect for debug quads to not move the edges based on // partial swaps. -@@ -1262,7 +1266,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params, +@@ -1289,7 +1293,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params, tex_coord_precision, sampler_type, shader_blend_mode, params->use_aa ? USE_AA : NO_AA, mask_mode, mask_for_background, params->use_color_matrix, tint_gl_composited_content_), @@ -115,7 +115,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 } void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) { -@@ -1725,8 +1730,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad, +@@ -1750,8 +1755,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad, gfx::ColorSpace quad_color_space = gfx::ColorSpace::CreateSRGB(); SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA, tint_gl_composited_content_), @@ -126,7 +126,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 SetShaderColor(color, opacity); if (current_program_->tint_color_matrix_location() != -1) { -@@ -1876,8 +1881,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad, +@@ -1901,8 +1906,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad, quad->is_premultiplied ? PREMULTIPLIED_ALPHA : NON_PREMULTIPLIED_ALPHA, false, false, tint_gl_composited_content_), @@ -137,7 +137,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 if (current_program_->tint_color_matrix_location() != -1) { auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix(); -@@ -1965,8 +1970,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad, +@@ -1990,8 +1995,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad, : NON_PREMULTIPLIED_ALPHA, !quad->ShouldDrawWithBlending(), has_tex_clamp_rect, tint_gl_composited_content_), @@ -148,7 +148,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 if (current_program_->tint_color_matrix_location() != -1) { auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix(); -@@ -2061,7 +2066,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad, +@@ -2086,7 +2091,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad, DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB()); gfx::ColorSpace dst_color_space = @@ -157,7 +157,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 // 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. -@@ -2209,8 +2214,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad, +@@ -2234,8 +2239,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad, quad->resource_id()); SetUseProgram(ProgramKey::VideoStream(tex_coord_precision), @@ -168,7 +168,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id()); -@@ -2262,8 +2267,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) { +@@ -2287,8 +2292,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) { draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR); // Bind the program to the GL state. @@ -179,7 +179,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); gl_->BindTexture(locked_quad.target(), locked_quad.texture_id()); -@@ -2911,7 +2916,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) { +@@ -2938,7 +2943,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) { @@ -190,7 +190,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 ProgramKey program_key = program_key_no_color; const gfx::ColorTransform* color_transform = -@@ -3281,7 +3288,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource( +@@ -3306,7 +3313,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource( *overlay_texture = FindOrCreateOverlayTexture( params.quad->render_pass_id, iosurface_width, iosurface_height, @@ -199,7 +199,7 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 *new_bounds = gfx::RectF(updated_dst_rect.origin(), gfx::SizeF((*overlay_texture)->texture.size())); -@@ -3485,8 +3492,9 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) { +@@ -3511,8 +3518,9 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) { PrepareGeometry(SHARED_BINDING); @@ -211,17 +211,17 @@ index 42b51fe23966118c85a69d76b44ae1b533de8fe0..e1e9290629e94bfb3c00269a7bb38467 gfx::Transform render_matrix; render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(), -@@ -3645,3 +3653,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize( +@@ -3671,3 +3679,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize( } } // namespace viz + +#undef PATCH_CS diff --git a/components/viz/service/display/skia_renderer.cc b/components/viz/service/display/skia_renderer.cc -index d911ebaf778124a515486cedd5aa02aab09c3b0d..1a78ddc3adcbc656f34f015a1d39646763bdac4a 100644 +index 0544d031b60d38279104a4ca9c6dc25126dea185..1acb3dfa55f39b8ecb9fccaa4627ac25cac81f1f 100644 --- a/components/viz/service/display/skia_renderer.cc +++ b/components/viz/service/display/skia_renderer.cc -@@ -709,9 +709,11 @@ void SkiaRenderer::DrawPictureQuad(const PictureDrawQuad* quad, +@@ -584,9 +584,11 @@ void SkiaRenderer::DrawPictureQuad(const PictureDrawQuad* quad) { std::unique_ptr color_transform_canvas; // TODO(enne): color transform needs to be replicated in gles2_cmd_decoder @@ -237,7 +237,7 @@ index d911ebaf778124a515486cedd5aa02aab09c3b0d..1a78ddc3adcbc656f34f015a1d396467 base::Optional opacity_canvas; if (needs_transparency || disable_image_filtering) { diff --git a/components/viz/service/display/software_renderer.cc b/components/viz/service/display/software_renderer.cc -index 1b2c335bfe960db99fefd570b88f57d1596aee94..e0fcc5205ad07eb4c8b74a925d569a14dabf424e 100644 +index 5c41958ed259b1d3ae076312b97a802746897c98..4cb9801a859c12dae03e03073085ff82ea0e4a32 100644 --- a/components/viz/service/display/software_renderer.cc +++ b/components/viz/service/display/software_renderer.cc @@ -334,9 +334,11 @@ void SoftwareRenderer::DrawPictureQuad(const PictureDrawQuad* quad) { @@ -256,7 +256,7 @@ index 1b2c335bfe960db99fefd570b88f57d1596aee94..e0fcc5205ad07eb4c8b74a925d569a14 base::Optional opacity_canvas; if (needs_transparency || disable_image_filtering) { diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc -index 2235eef2fc6ab449c16b3b4fd526adad910f0261..b2cca7287b3a0726c51e64cbc7e17136d31733a0 100644 +index 9511100e6077b6788abfead4b1962773a22ae40b..db2d8a4fc979b20810776cf2a31018d197cdba7d 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -193,6 +193,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( @@ -268,18 +268,18 @@ index 2235eef2fc6ab449c16b3b4fd526adad910f0261..b2cca7287b3a0726c51e64cbc7e17136 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 fe73adb24cf444a942c7cdd1c1f6d25d869d5277..e26057ffdc5fffc96ceb944120473d3061d83132 100644 +index 1f2897aabf94124f108a0f0449e4d687b084f1a4..4f88e4425ceada8af6b412b087ac134572222824 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -222,6 +222,7 @@ +@@ -218,6 +218,7 @@ #include "ui/base/ui_base_switches.h" #include "ui/base/ui_base_switches_util.h" #include "ui/display/display_switches.h" +#include "ui/gfx/switches.h" #include "ui/gl/gl_switches.h" + #include "ui/gl/gpu_switching_manager.h" #include "ui/native_theme/native_theme_features.h" - -@@ -2966,6 +2967,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -2931,6 +2932,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[] = { @@ -288,10 +288,10 @@ index fe73adb24cf444a942c7cdd1c1f6d25d869d5277..e26057ffdc5fffc96ceb944120473d30 service_manager::switches::kDisableInProcessStackTraces, service_manager::switches::kDisableSeccompFilterSandbox, diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc -index 121519c661b4e5f42316b03c6db25ab451d00539..479cf5a7ad17f8a3b8ca6acf9ddf4307a14f9f8c 100644 +index 6d0580d5b0b76109bbaf0d058ce4201dc970adf0..f0271310ec6112ca7276c5af13ee6677d393109e 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc -@@ -2619,6 +2619,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings( +@@ -2565,6 +2565,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings( settings.main_frame_before_activation_enabled = cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation); @@ -302,7 +302,7 @@ index 121519c661b4e5f42316b03c6db25ab451d00539..479cf5a7ad17f8a3b8ca6acf9ddf4307 // 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 8d9f38b1f3dfd5c2281459ec7620a9eef6861f21..a0ff3ccf56b1f925233875b6088a878423191c8f 100644 +index 00ad38db090096645d9ef9e3220a48661b6401df..af50266b42abd514bfca3379191675e022002406 100644 --- a/ui/gfx/mac/io_surface.cc +++ b/ui/gfx/mac/io_surface.cc @@ -16,6 +16,7 @@ @@ -313,7 +313,7 @@ index 8d9f38b1f3dfd5c2281459ec7620a9eef6861f21..a0ff3ccf56b1f925233875b6088a8784 namespace gfx { -@@ -189,6 +190,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, +@@ -199,6 +200,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, // Ensure that all IOSurfaces start as sRGB. CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace(); @@ -325,7 +325,7 @@ index 8d9f38b1f3dfd5c2281459ec7620a9eef6861f21..a0ff3ccf56b1f925233875b6088a8784 base::ScopedCFTypeRef color_space_icc( CGColorSpaceCopyICCProfile(color_space)); IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc); -@@ -200,6 +206,14 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, +@@ -210,6 +216,14 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, void IOSurfaceSetColorSpace(IOSurfaceRef io_surface, const ColorSpace& color_space) { @@ -341,7 +341,7 @@ index 8d9f38b1f3dfd5c2281459ec7620a9eef6861f21..a0ff3ccf56b1f925233875b6088a8784 if (color_space == ColorSpace::CreateSRGB()) { base::ScopedCFTypeRef srgb_icc( diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc -index 606cbb42070be3a826f73269cd2bf40454358b3d..bd31d565b002b653a6b104114c9616416ac86649 100644 +index e1943d5970ac37a19430b45f54a5608386433ef8..d4f56057b50fb8925371ad109727cc25f05c6d18 100644 --- a/ui/gfx/switches.cc +++ b/ui/gfx/switches.cc @@ -7,6 +7,8 @@ @@ -354,7 +354,7 @@ index 606cbb42070be3a826f73269cd2bf40454358b3d..bd31d565b002b653a6b104114c961641 // Disables DirectWrite font rendering for general UI elements. const char kDisableDirectWriteForUI[] = "disable-directwrite-for-ui"; diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h -index b206f18ad77c21774073c2fa07372d2234926414..992468ce95b2829702fcdb26c26362eccb5556c7 100644 +index dc4921dbf0cc4a2c0454269bd03b79cef7f97b72..019e39bb16623c25fc173e215982b45035db4db3 100644 --- a/ui/gfx/switches.h +++ b/ui/gfx/switches.h @@ -11,6 +11,8 @@ diff --git a/patches/common/chromium/disable_detach_webview_frame.patch b/patches/common/chromium/disable_detach_webview_frame.patch index 998f864bea..defdf42c0c 100644 --- a/patches/common/chromium/disable_detach_webview_frame.patch +++ b/patches/common/chromium/disable_detach_webview_frame.patch @@ -9,10 +9,8 @@ This is part of the fixes for https://github.com/electron/electron/issues/14211. We should revisit this bug after upgrading to newer versions of Chrome, this patch was introduced in Chrome 66. -Update(zcbenz): The bug is still in Chrome 72. - diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc -index cfa3fd15714c3743cb9d2900b35570c94545fa87..80785902890c57ffae2fa841831d3bd60a8fa11a 100644 +index 80d51c9baf63ab1dc005e44854f4eca497d8b7dd..f5bec5d54dd0ee826cbf6559fbbc0fece1398118 100644 --- a/content/browser/frame_host/render_frame_proxy_host.cc +++ b/content/browser/frame_host/render_frame_proxy_host.cc @@ -259,6 +259,12 @@ void RenderFrameProxyHost::SetDestructionCallback( diff --git a/patches/common/chromium/disable_hidden.patch b/patches/common/chromium/disable_hidden.patch index 27d5a84eb5..79319ab6bf 100644 --- a/patches/common/chromium/disable_hidden.patch +++ b/patches/common/chromium/disable_hidden.patch @@ -5,10 +5,10 @@ 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 9832053c72a8dfc827d96794ba0de7355e8d2f40..e94935246fb0a82bf91a12bce57ba8f5912c7b6b 100644 +index 807466aeeda0b504098a5455bf6e5e0aab9735f0..85be4a6900632f336868f9b585ca735468ce12eb 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -755,6 +755,9 @@ void RenderWidgetHostImpl::WasHidden() { +@@ -685,6 +685,9 @@ void RenderWidgetHostImpl::WasHidden() { if (is_hidden_) return; @@ -19,7 +19,7 @@ index 9832053c72a8dfc827d96794ba0de7355e8d2f40..e94935246fb0a82bf91a12bce57ba8f5 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 130e988cbd7459f7ddf67bc81f4f1989e08b0513..d4fa0c1a2fc1df713f06415a4970298306a52699 100644 +index dba7b4276f5e6c0543a8e65b2bb01ad714fe0c79..f0126b89fffaad13ab44732062c435d18bda0e4e 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -153,6 +153,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl diff --git a/patches/common/chromium/disable_time_ticks_dcheck.patch b/patches/common/chromium/disable_time_ticks_dcheck.patch deleted file mode 100644 index ca19b46026..0000000000 --- a/patches/common/chromium/disable_time_ticks_dcheck.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Cheng Zhao -Date: Tue, 15 Jan 2019 14:57:02 -0700 -Subject: disable_time_ticks_dcheck.patch - -The DCHECK is failing for some reason. - -diff --git a/content/common/inter_process_time_ticks_converter.cc b/content/common/inter_process_time_ticks_converter.cc -index 128abab37eb8..4d8e5e9c05b1 100644 ---- a/content/common/inter_process_time_ticks_converter.cc -+++ b/content/common/inter_process_time_ticks_converter.cc -@@ -55,13 +55,13 @@ LocalTimeTicks InterProcessTimeTicksConverter::ToLocalTimeTicks( - - RemoteTimeDelta remote_delta = remote_time_ticks - remote_lower_bound_; - -- DCHECK_LE(remote_time_ticks, remote_upper_bound_); -+ // DCHECK_LE(remote_time_ticks, remote_upper_bound_); - return local_base_time_ + ToLocalTimeDelta(remote_delta); - } - - LocalTimeDelta InterProcessTimeTicksConverter::ToLocalTimeDelta( - RemoteTimeDelta remote_delta) const { -- DCHECK_LE(remote_lower_bound_ + remote_delta, remote_upper_bound_); -+ // DCHECK_LE(remote_lower_bound_ + remote_delta, remote_upper_bound_); - - // For remote times that come before remote time range, apply just time - // offset and ignore scaling, so as to avoid extrapolation error for values diff --git a/patches/common/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch b/patches/common/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch index 19aafe9de5..c8991d9633 100644 --- a/patches/common/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch +++ b/patches/common/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 ca5e41dc1beda6a59e41c28302cd4201e08fa216..a608916ddeee16aa3556fb5da3267de08febada3 100644 +index 7ba01ff026e3da711ee3e291385cb5c1086a2f08..eb2e3288c761957975ab9b5b8b43f3fee3337afa 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc -@@ -3658,7 +3658,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient& chrome_client, +@@ -3644,7 +3644,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/common/chromium/dom_storage_limits.patch b/patches/common/chromium/dom_storage_limits.patch index 23712a26c1..a708c1c6a7 100644 --- a/patches/common/chromium/dom_storage_limits.patch +++ b/patches/common/chromium/dom_storage_limits.patch @@ -96,38 +96,3 @@ index c04e0e8bff1a7a41a1e18aca5403aed16a80aead..d63cec971f0a98f7b8ff30c1f6a0fa84 EnsureLoaded(); bool result = false; -diff --git a/third_party/blink/renderer/modules/storage/cached_storage_area.cc b/third_party/blink/renderer/modules/storage/cached_storage_area.cc -index 35a114eb8fc2ee6176c25377081df7f04f8b72f1..689df99ebd955e544bbc1e3048842801fb9c5367 100644 ---- a/third_party/blink/renderer/modules/storage/cached_storage_area.cc -+++ b/third_party/blink/renderer/modules/storage/cached_storage_area.cc -@@ -101,11 +101,13 @@ bool CachedStorageArea::SetItem(const String& key, - Source* source) { - DCHECK(areas_->Contains(source)); - -+#if 0 - // A quick check to reject obviously overbudget items to avoid priming the - // cache. - if ((key.length() + value.length()) * 2 > - mojom::blink::StorageArea::kPerStorageAreaQuota) - return false; -+#endif - - EnsureLoaded(); - String old_value; -diff --git a/third_party/blink/renderer/modules/storage/storage_area_map.cc b/third_party/blink/renderer/modules/storage/storage_area_map.cc -index 62ab01c2864baa2ef1945031faf42cbeefbfc72b..e7edaff1778c66812ab9f7058e89f84bfba94339 100644 ---- a/third_party/blink/renderer/modules/storage/storage_area_map.cc -+++ b/third_party/blink/renderer/modules/storage/storage_area_map.cc -@@ -104,10 +104,12 @@ bool StorageAreaMap::SetItemInternal(const String& key, - size_t new_item_size = QuotaForString(key) + QuotaForString(value); - size_t new_quota_used = quota_used_ - old_item_size + new_item_size; - -+#if 0 - // Only check quota if the size is increasing, this allows - // shrinking changes to pre-existing files that are over budget. - if (check_quota && new_item_size > old_item_size && new_quota_used > quota_) - return false; -+#endif - - keys_values_.Set(key, value); - ResetKeyIterator(); diff --git a/patches/common/chromium/exclude-a-few-test-files-from-build.patch b/patches/common/chromium/exclude-a-few-test-files-from-build.patch index ec2c663056..e932974d73 100644 --- a/patches/common/chromium/exclude-a-few-test-files-from-build.patch +++ b/patches/common/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 ba938f7d75072c6d15de08528d6b1cac94ecdbb1..5878cbf7767adad6365d02e389b8b4a1774a3539 100644 +index 1f0518e9cc2456d9299b16437be36041c98e8a92..e492c7fe90504314f1116607c1f543e68ddf2ad8 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn -@@ -1737,7 +1737,7 @@ jumbo_source_set("blink_platform_unittests_sources") { +@@ -1729,7 +1729,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/common/chromium/fix_test_compilation_error.patch b/patches/common/chromium/fix_test_compilation_error.patch deleted file mode 100644 index 3cc71bbcec..0000000000 --- a/patches/common/chromium/fix_test_compilation_error.patch +++ /dev/null @@ -1,364 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Xianzhu Wang -Date: Thu Dec 6 02:00:06 2018 +0000 - -Backport dedab04b5256f88ec4dbbbae9492941e8cf1221a which fixes -compilation error for the test files. - -This patch can be removed after updating to Chrome 73. - -diff --git a/third_party/blink/renderer/platform/graphics/paint/display_item_raster_invalidator_test.cc b/third_party/blink/renderer/platform/graphics/paint/display_item_raster_invalidator_test.cc -index 97ffe553cd1e..771392a0137b 100644 ---- a/third_party/blink/renderer/platform/graphics/paint/display_item_raster_invalidator_test.cc -+++ b/third_party/blink/renderer/platform/graphics/paint/display_item_raster_invalidator_test.cc -@@ -8,13 +8,15 @@ - #include "third_party/blink/renderer/platform/graphics/paint/paint_artifact.h" - #include "third_party/blink/renderer/platform/graphics/paint/paint_controller_test.h" - #include "third_party/blink/renderer/platform/testing/paint_property_test_helpers.h" -+#include "third_party/blink/renderer/platform/testing/paint_test_configurations.h" - #include "third_party/blink/renderer/platform/testing/test_paint_artifact.h" - - namespace blink { - - using ::testing::UnorderedElementsAre; - --class DisplayItemRasterInvalidatorTest : public PaintControllerTestBase { -+class DisplayItemRasterInvalidatorTest : public PaintControllerTestBase, -+ public PaintTestConfigurations { - protected: - DisplayItemRasterInvalidatorTest() : invalidator_([](const IntRect&) {}) {} - -@@ -26,6 +28,10 @@ class DisplayItemRasterInvalidatorTest : public PaintControllerTestBase { - // invalidation rects. - IntRect(0, 0, 20000, 20000), PropertyTreeState::Root()); - GetPaintController().FinishCycle(); -+ if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) { -+ GetPaintController().ClearPropertyTreeChangedStateTo( -+ PropertyTreeState::Root()); -+ } - - if (invalidator_.GetTracking()) - return invalidator_.GetTracking()->Invalidations(); -@@ -37,7 +43,9 @@ class DisplayItemRasterInvalidatorTest : public PaintControllerTestBase { - RasterInvalidator invalidator_; - }; - --TEST_F(DisplayItemRasterInvalidatorTest, RemoveItemInMiddle) { -+INSTANTIATE_PAINT_TEST_CASE_P(DisplayItemRasterInvalidatorTest); -+ -+TEST_P(DisplayItemRasterInvalidatorTest, RemoveItemInMiddle) { - FakeDisplayItemClient first("first", LayoutRect(100, 100, 300, 300)); - FakeDisplayItemClient second("second", LayoutRect(100, 100, 200, 200)); - GraphicsContext context(GetPaintController()); -@@ -60,7 +68,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, RemoveItemInMiddle) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, SwapOrder) { -+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrder) { - FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100)); - FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200)); - FakeDisplayItemClient unaffected("unaffected", LayoutRect(300, 300, 10, 10)); -@@ -91,7 +99,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrder) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateFirst) { -+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateFirst) { - FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100)); - FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200)); - FakeDisplayItemClient unaffected("unaffected", LayoutRect(300, 300, 10, 10)); -@@ -117,7 +125,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateFirst) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateSecond) { -+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateSecond) { - FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100)); - FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200)); - FakeDisplayItemClient unaffected("unaffected", LayoutRect(300, 300, 10, 10)); -@@ -143,7 +151,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderAndInvalidateSecond) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithIncrementalInvalidation) { -+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderWithIncrementalInvalidation) { - FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100)); - FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200)); - FakeDisplayItemClient unaffected("unaffected", LayoutRect(300, 300, 10, 10)); -@@ -171,7 +179,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithIncrementalInvalidation) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, NewItemInMiddle) { -+TEST_P(DisplayItemRasterInvalidatorTest, NewItemInMiddle) { - FakeDisplayItemClient first("first", LayoutRect(100, 100, 100, 100)); - FakeDisplayItemClient second("second", LayoutRect(100, 100, 50, 200)); - FakeDisplayItemClient third("third", LayoutRect(125, 100, 200, 50)); -@@ -195,7 +203,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, NewItemInMiddle) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, Incremental) { -+TEST_P(DisplayItemRasterInvalidatorTest, Incremental) { - LayoutRect initial_rect(100, 100, 100, 100); - std::unique_ptr clients[6]; - for (size_t i = 0; i < base::size(clients); i++) { -@@ -259,7 +267,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, Incremental) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, AddRemoveFirstAndInvalidateSecond) { -+TEST_P(DisplayItemRasterInvalidatorTest, AddRemoveFirstAndInvalidateSecond) { - FakeDisplayItemClient chunk("chunk"); - FakeDisplayItemClient first("first", LayoutRect(100, 100, 150, 150)); - FakeDisplayItemClient second("second", LayoutRect(200, 200, 50, 50)); -@@ -304,7 +312,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, AddRemoveFirstAndInvalidateSecond) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, InvalidateFirstAndAddRemoveSecond) { -+TEST_P(DisplayItemRasterInvalidatorTest, InvalidateFirstAndAddRemoveSecond) { - FakeDisplayItemClient first("first", LayoutRect(100, 100, 150, 150)); - FakeDisplayItemClient second("second", LayoutRect(200, 200, 50, 50)); - GraphicsContext context(GetPaintController()); -@@ -351,7 +359,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, InvalidateFirstAndAddRemoveSecond) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithChildren) { -+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderWithChildren) { - FakeDisplayItemClient container1("container1", - LayoutRect(100, 100, 100, 100)); - FakeDisplayItemClient content1("content1", LayoutRect(100, 100, 50, 200)); -@@ -395,7 +403,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithChildren) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithChildrenAndInvalidation) { -+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderWithChildrenAndInvalidation) { - FakeDisplayItemClient container1("container1", - LayoutRect(100, 100, 100, 100)); - FakeDisplayItemClient content1("content1", LayoutRect(100, 100, 50, 200)); -@@ -443,7 +451,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderWithChildrenAndInvalidation) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderCrossingChunks) { -+TEST_P(DisplayItemRasterInvalidatorTest, SwapOrderCrossingChunks) { - FakeDisplayItemClient container1("container1", - LayoutRect(100, 100, 100, 100)); - FakeDisplayItemClient content1("content1", LayoutRect(100, 100, 50, 200)); -@@ -492,7 +500,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SwapOrderCrossingChunks) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, SkipCache) { -+TEST_P(DisplayItemRasterInvalidatorTest, SkipCache) { - FakeDisplayItemClient multicol("multicol", LayoutRect(100, 100, 200, 200)); - FakeDisplayItemClient content("content", LayoutRect(100, 100, 100, 100)); - GraphicsContext context(GetPaintController()); -@@ -549,7 +557,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, SkipCache) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, PartialSkipCache) { -+TEST_P(DisplayItemRasterInvalidatorTest, PartialSkipCache) { - FakeDisplayItemClient content("content", LayoutRect(100, 100, 250, 250)); - GraphicsContext context(GetPaintController()); - -@@ -581,7 +589,7 @@ TEST_F(DisplayItemRasterInvalidatorTest, PartialSkipCache) { - invalidator_.SetTracksRasterInvalidations(false); - } - --TEST_F(DisplayItemRasterInvalidatorTest, Partial) { -+TEST_P(DisplayItemRasterInvalidatorTest, Partial) { - FakeDisplayItemClient client("client", LayoutRect(100, 100, 300, 300)); - GraphicsContext context(GetPaintController()); - -diff --git a/third_party/blink/renderer/platform/graphics/paint/raster_invalidator_test.cc b/third_party/blink/renderer/platform/graphics/paint/raster_invalidator_test.cc -index 7f8306e2703e..4cecc2c3c41f 100644 ---- a/third_party/blink/renderer/platform/graphics/paint/raster_invalidator_test.cc -+++ b/third_party/blink/renderer/platform/graphics/paint/raster_invalidator_test.cc -@@ -8,13 +8,15 @@ - #include "third_party/blink/renderer/platform/graphics/paint/geometry_mapper.h" - #include "third_party/blink/renderer/platform/graphics/paint/paint_artifact.h" - #include "third_party/blink/renderer/platform/testing/paint_property_test_helpers.h" -+#include "third_party/blink/renderer/platform/testing/paint_test_configurations.h" - #include "third_party/blink/renderer/platform/testing/test_paint_artifact.h" - - namespace blink { - - static const IntRect kDefaultLayerBounds(-9999, -7777, 18888, 16666); - --class RasterInvalidatorTest : public testing::Test { -+class RasterInvalidatorTest : public testing::Test, -+ public PaintTestConfigurations { - public: - static PropertyTreeState DefaultPropertyTreeState() { - return PropertyTreeState::Root(); -@@ -31,6 +33,11 @@ class RasterInvalidatorTest : public testing::Test { - void FinishCycle(PaintArtifact& artifact) { - artifact.FinishCycle(); - ClearGeometryMapperCache(); -+ if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) { -+ // See PaintArtifact::FinishCycle() for the reason of doing this. -+ for (auto& chunk : artifact.PaintChunks()) -+ chunk.properties.ClearChangedToRoot(); -+ } - } - - static const Vector TrackedRasterInvalidations( -@@ -54,6 +61,8 @@ class RasterInvalidatorTest : public testing::Test { - [](const IntRect& rect) {}; - }; - -+INSTANTIATE_PAINT_TEST_CASE_P(RasterInvalidatorTest); -+ - #define EXPECT_CHUNK_INVALIDATION_CUSTOM( \ - invalidations, index, chunk, expected_reason, layer_offset, mapper) \ - do { \ -@@ -78,7 +87,7 @@ class RasterInvalidatorTest : public testing::Test { - EXPECT_EQ(PaintInvalidationReason::kIncremental, info.reason); \ - } while (false) - --TEST_F(RasterInvalidatorTest, ImplicitFullLayerInvalidation) { -+TEST_P(RasterInvalidatorTest, ImplicitFullLayerInvalidation) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - auto artifact = TestPaintArtifact().Chunk(0).Build(); - -@@ -94,7 +103,7 @@ TEST_F(RasterInvalidatorTest, ImplicitFullLayerInvalidation) { - invalidator.SetTracksRasterInvalidations(false); - } - --TEST_F(RasterInvalidatorTest, LayerBounds) { -+TEST_P(RasterInvalidatorTest, LayerBounds) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - auto artifact = TestPaintArtifact().Chunk(0).Build(); - -@@ -122,7 +131,7 @@ TEST_F(RasterInvalidatorTest, LayerBounds) { - FinishCycle(*artifact); - } - --TEST_F(RasterInvalidatorTest, ReorderChunks) { -+TEST_P(RasterInvalidatorTest, ReorderChunks) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - auto artifact = TestPaintArtifact().Chunk(0).Chunk(1).Chunk(2).Build(); - invalidator.Generate(artifact, kDefaultLayerBounds, -@@ -150,7 +159,7 @@ TEST_F(RasterInvalidatorTest, ReorderChunks) { - FinishCycle(*new_artifact); - } - --TEST_F(RasterInvalidatorTest, ReorderChunkSubsequences) { -+TEST_P(RasterInvalidatorTest, ReorderChunkSubsequences) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - auto artifact = - TestPaintArtifact().Chunk(0).Chunk(1).Chunk(2).Chunk(3).Chunk(4).Build(); -@@ -185,7 +194,7 @@ TEST_F(RasterInvalidatorTest, ReorderChunkSubsequences) { - FinishCycle(*new_artifact); - } - --TEST_F(RasterInvalidatorTest, ChunkAppearAndDisappear) { -+TEST_P(RasterInvalidatorTest, ChunkAppearAndDisappear) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - auto artifact = TestPaintArtifact().Chunk(0).Chunk(1).Chunk(2).Build(); - invalidator.Generate(artifact, kDefaultLayerBounds, -@@ -210,7 +219,7 @@ TEST_F(RasterInvalidatorTest, ChunkAppearAndDisappear) { - FinishCycle(*new_artifact); - } - --TEST_F(RasterInvalidatorTest, ChunkAppearAtEnd) { -+TEST_P(RasterInvalidatorTest, ChunkAppearAtEnd) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - auto artifact = TestPaintArtifact().Chunk(0).Build(); - invalidator.Generate(artifact, kDefaultLayerBounds, -@@ -230,7 +239,7 @@ TEST_F(RasterInvalidatorTest, ChunkAppearAtEnd) { - FinishCycle(*new_artifact); - } - --TEST_F(RasterInvalidatorTest, UncacheableChunks) { -+TEST_P(RasterInvalidatorTest, UncacheableChunks) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - auto artifact = - TestPaintArtifact().Chunk(0).Chunk(1).Uncacheable().Chunk(2).Build(); -@@ -254,7 +263,7 @@ TEST_F(RasterInvalidatorTest, UncacheableChunks) { - } - - // Tests the path based on ClipPaintPropertyNode::Changed(). --TEST_F(RasterInvalidatorTest, ClipPropertyChangeRounded) { -+TEST_P(RasterInvalidatorTest, ClipPropertyChangeRounded) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - FloatRoundedRect::Radii radii(FloatSize(1, 2), FloatSize(2, 3), - FloatSize(3, 4), FloatSize(4, 5)); -@@ -316,7 +325,7 @@ TEST_F(RasterInvalidatorTest, ClipPropertyChangeRounded) { - } - - // Tests the path detecting change of PaintChunkInfo::chunk_to_layer_clip. --TEST_F(RasterInvalidatorTest, ClipPropertyChangeSimple) { -+TEST_P(RasterInvalidatorTest, ClipPropertyChangeSimple) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - FloatRoundedRect clip_rect(-1000, -1000, 2000, 2000); - auto clip0 = CreateClip(c0(), &t0(), clip_rect); -@@ -385,7 +394,7 @@ TEST_F(RasterInvalidatorTest, ClipPropertyChangeSimple) { - FinishCycle(*artifact); - } - --TEST_F(RasterInvalidatorTest, ClipLocalTransformSpaceChange) { -+TEST_P(RasterInvalidatorTest, ClipLocalTransformSpaceChange) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - - auto t1 = CreateTransform(t0(), TransformationMatrix()); -@@ -422,7 +431,7 @@ TEST_F(RasterInvalidatorTest, ClipLocalTransformSpaceChange) { - // This is based on ClipLocalTransformSpaceChange, but tests the no-invalidation - // path by letting the clip's LocalTransformSpace be the same as the chunk's - // transform. --TEST_F(RasterInvalidatorTest, ClipLocalTransformSpaceChangeNoInvalidation) { -+TEST_P(RasterInvalidatorTest, ClipLocalTransformSpaceChangeNoInvalidation) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - - auto t1 = CreateTransform(t0(), TransformationMatrix()); -@@ -453,7 +462,7 @@ TEST_F(RasterInvalidatorTest, ClipLocalTransformSpaceChangeNoInvalidation) { - FinishCycle(*artifact); - } - --TEST_F(RasterInvalidatorTest, TransformPropertyChange) { -+TEST_P(RasterInvalidatorTest, TransformPropertyChange) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - - auto layer_transform = CreateTransform(t0(), TransformationMatrix().Scale(5)); -@@ -534,7 +543,7 @@ TEST_F(RasterInvalidatorTest, TransformPropertyChange) { - FinishCycle(*artifact); - } - --TEST_F(RasterInvalidatorTest, TransformPropertyTinyChange) { -+TEST_P(RasterInvalidatorTest, TransformPropertyTinyChange) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - - auto layer_transform = CreateTransform(t0(), TransformationMatrix().Scale(5)); -@@ -580,7 +589,7 @@ TEST_F(RasterInvalidatorTest, TransformPropertyTinyChange) { - EXPECT_TRUE(invalidated); - } - --TEST_F(RasterInvalidatorTest, TransformPropertyTinyChangeScale) { -+TEST_P(RasterInvalidatorTest, TransformPropertyTinyChangeScale) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - - auto layer_transform = CreateTransform(t0(), TransformationMatrix().Scale(5)); -@@ -621,7 +630,7 @@ TEST_F(RasterInvalidatorTest, TransformPropertyTinyChangeScale) { - FinishCycle(*artifact); - } - --TEST_F(RasterInvalidatorTest, EffectLocalTransformSpaceChange) { -+TEST_P(RasterInvalidatorTest, EffectLocalTransformSpaceChange) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - - auto t1 = CreateTransform(t0(), TransformationMatrix()); -@@ -659,7 +668,7 @@ TEST_F(RasterInvalidatorTest, EffectLocalTransformSpaceChange) { - // This is based on EffectLocalTransformSpaceChange, but tests the no- - // invalidation path by letting the effect's LocalTransformSpace be the same as - // the chunk's transform. --TEST_F(RasterInvalidatorTest, EffectLocalTransformSpaceChangeNoInvalidation) { -+TEST_P(RasterInvalidatorTest, EffectLocalTransformSpaceChangeNoInvalidation) { - RasterInvalidator invalidator(kNoopRasterInvalidation); - - auto t1 = CreateTransform(t0(), TransformationMatrix()); diff --git a/patches/common/chromium/fix_trackpad_scrolling.patch b/patches/common/chromium/fix_trackpad_scrolling.patch new file mode 100644 index 0000000000..59bd6d75d0 --- /dev/null +++ b/patches/common/chromium/fix_trackpad_scrolling.patch @@ -0,0 +1,240 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Cheng Zhao +Date: Mon, 26 Nov 2018 09:32:14 +0900 +Subject: fix_trackpad_scrolling.patch + +Backport https://chromium-review.googlesource.com/c/chromium/src/+/1299342. + +This patch fixes https://github.com/electron/electron/issues/8960, and can be +removed after upgraded to Chrome 72. + +diff --git a/gpu/ipc/service/child_window_win.cc b/gpu/ipc/service/child_window_win.cc +index 0f432fe2233e0ba90950f4ea9164d03df4ac9cf6..8bf56a44543be44cda74c341ba59dab87c8f69cb 100644 +--- a/gpu/ipc/service/child_window_win.cc ++++ b/gpu/ipc/service/child_window_win.cc +@@ -9,7 +9,6 @@ + #include "base/compiler_specific.h" + #include "base/memory/weak_ptr.h" + #include "base/message_loop/message_loop.h" +-#include "base/threading/thread.h" + #include "base/win/scoped_hdc.h" + #include "base/win/wrapped_window_proc.h" + #include "gpu/ipc/common/gpu_messages.h" +@@ -21,48 +20,10 @@ + + namespace gpu { + +-// This owns the thread and contains data that's shared between the threads. +-struct SharedData { +- SharedData() : thread("Window owner thread") {} +- +- base::Lock rect_lock; +- gfx::Rect rect_to_clear; +- +- base::Thread thread; +-}; +- + namespace { + + ATOM g_window_class; + +-// This runs on the window owner thread. +-LRESULT CALLBACK IntermediateWindowProc(HWND window, +- UINT message, +- WPARAM w_param, +- LPARAM l_param) { +- switch (message) { +- case WM_ERASEBKGND: +- // Prevent windows from erasing the background. +- return 1; +- case WM_PAINT: +- PAINTSTRUCT paint; +- if (BeginPaint(window, &paint)) { +- SharedData* shared_data = +- reinterpret_cast(gfx::GetWindowUserData(window)); +- DCHECK(shared_data); +- { +- base::AutoLock lock(shared_data->rect_lock); +- shared_data->rect_to_clear.Union(gfx::Rect(paint.rcPaint)); +- } +- +- EndPaint(window, &paint); +- } +- return 0; +- default: +- return DefWindowProc(window, message, w_param, l_param); +- } +-} +- + // This runs on the window owner thread. + void InitializeWindowClass() { + if (g_window_class) +@@ -71,9 +32,9 @@ void InitializeWindowClass() { + WNDCLASSEX intermediate_class; + base::win::InitializeWindowClass( + L"Intermediate D3D Window", +- &base::win::WrappedWindowProc, CS_OWNDC, 0, 0, +- nullptr, reinterpret_cast(GetStockObject(BLACK_BRUSH)), nullptr, +- nullptr, nullptr, &intermediate_class); ++ &base::win::WrappedWindowProc<::DefWindowProc>, CS_OWNDC, 0, 0, nullptr, ++ reinterpret_cast(GetStockObject(BLACK_BRUSH)), nullptr, nullptr, ++ nullptr, &intermediate_class); + g_window_class = RegisterClassEx(&intermediate_class); + if (!g_window_class) { + LOG(ERROR) << "RegisterClass failed."; +@@ -122,7 +83,6 @@ class HiddenPopupWindow : public gfx::WindowImpl { + // This runs on the window owner thread. + void CreateWindowsOnThread(const gfx::Size& size, + base::WaitableEvent* event, +- SharedData* shared_data, + HWND* child_window, + HWND* parent_window) { + InitializeWindowClass(); +@@ -131,20 +91,25 @@ void CreateWindowsOnThread(const gfx::Size& size, + // Create hidden parent window on the current thread. + *parent_window = HiddenPopupWindow::Create(); + // Create child window. ++ // WS_EX_NOPARENTNOTIFY and WS_EX_LAYERED make the window transparent for ++ // input. WS_EX_NOREDIRECTIONBITMAP avoids allocating a ++ // bitmap that would otherwise be allocated with WS_EX_LAYERED, the bitmap is ++ // only necessary if using Gdi objects with the window. + HWND window = CreateWindowEx( +- WS_EX_NOPARENTNOTIFY, reinterpret_cast(g_window_class), L"", ++ WS_EX_NOPARENTNOTIFY | WS_EX_LAYERED | WS_EX_TRANSPARENT | ++ WS_EX_NOREDIRECTIONBITMAP, ++ reinterpret_cast(g_window_class), L"", + WS_CHILDWINDOW | WS_DISABLED | WS_VISIBLE, 0, 0, size.width(), + size.height(), *parent_window, nullptr, nullptr, nullptr); + CHECK(window); + *child_window = window; +- gfx::SetWindowUserData(window, shared_data); + event->Signal(); + } + + // This runs on the main thread after the window was destroyed on window owner + // thread. +-void DestroySharedData(std::unique_ptr shared_data) { +- shared_data->thread.Stop(); ++void DestroyThread(std::unique_ptr thread) { ++ thread->Stop(); + } + + // This runs on the window owner thread. +@@ -164,10 +129,9 @@ bool ChildWindowWin::Initialize() { + if (window_) + return true; + +- shared_data_ = std::make_unique(); +- ++ thread_ = std::make_unique("Window owner thread"); + base::Thread::Options options(base::MessageLoop::TYPE_UI, 0); +- shared_data_->thread.StartWithOptions(options); ++ thread_->StartWithOptions(options); + + base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); +@@ -175,44 +139,30 @@ bool ChildWindowWin::Initialize() { + RECT window_rect; + GetClientRect(parent_window_, &window_rect); + +- shared_data_->thread.task_runner()->PostTask( ++ thread_->task_runner()->PostTask( + FROM_HERE, + base::Bind(&CreateWindowsOnThread, gfx::Rect(window_rect).size(), &event, +- shared_data_.get(), &window_, &initial_parent_window_)); ++ &window_, &initial_parent_window_)); + event.Wait(); + + delegate_->DidCreateAcceleratedSurfaceChildWindow(parent_window_, window_); + return true; + } + +-void ChildWindowWin::ClearInvalidContents() { +- base::AutoLock lock(shared_data_->rect_lock); +- if (!shared_data_->rect_to_clear.IsEmpty()) { +- base::win::ScopedGetDC dc(window_); +- +- RECT rect = shared_data_->rect_to_clear.ToRECT(); +- +- // DirectComposition composites with the contents under the SwapChain, +- // so ensure that's cleared. GDI treats black as transparent. +- FillRect(dc, &rect, reinterpret_cast(GetStockObject(BLACK_BRUSH))); +- shared_data_->rect_to_clear = gfx::Rect(); +- } +-} +- + ChildWindowWin::~ChildWindowWin() { +- if (shared_data_) { +- scoped_refptr task_runner = +- shared_data_->thread.task_runner(); ++ if (thread_) { ++ scoped_refptr task_runner = thread_->task_runner(); + task_runner->PostTaskAndReply( + FROM_HERE, +- base::Bind(&DestroyWindowsOnThread, window_, initial_parent_window_), +- base::Bind(&DestroySharedData, base::Passed(std::move(shared_data_)))); ++ base::BindOnce(&DestroyWindowsOnThread, window_, ++ initial_parent_window_), ++ base::BindOnce(&DestroyThread, base::Passed(std::move(thread_)))); + } + } + + scoped_refptr ChildWindowWin::GetTaskRunnerForTesting() { +- DCHECK(shared_data_); +- return shared_data_->thread.task_runner(); ++ DCHECK(thread_); ++ return thread_->task_runner(); + } + + } // namespace gpu +diff --git a/gpu/ipc/service/child_window_win.h b/gpu/ipc/service/child_window_win.h +index c11202b12da8fc540a78c3b13f731fc33d2d63b3..2b29fc641a810d2b521fa14e40da5bffb42ad722 100644 +--- a/gpu/ipc/service/child_window_win.h ++++ b/gpu/ipc/service/child_window_win.h +@@ -7,14 +7,13 @@ + + #include "base/memory/weak_ptr.h" + #include "base/task_runner.h" ++#include "base/threading/thread.h" + #include "gpu/ipc/service/image_transport_surface_delegate.h" + + #include + + namespace gpu { + +-struct SharedData; +- + // The window DirectComposition renders into needs to be owned by the process + // that's currently doing the rendering. The class creates and owns a window + // which is reparented by the browser to be a child of its window. +@@ -25,15 +24,13 @@ class ChildWindowWin { + ~ChildWindowWin(); + + bool Initialize(); +- void ClearInvalidContents(); + HWND window() const { return window_; } + + scoped_refptr GetTaskRunnerForTesting(); + + private: +- // This member contains all the data that can be accessed from the main or +- // window owner threads. +- std::unique_ptr shared_data_; ++ // The window owner thread. ++ std::unique_ptr thread_; + // The eventual parent of the window living in the browser process. + HWND parent_window_; + HWND window_; +diff --git a/gpu/ipc/service/direct_composition_surface_win.cc b/gpu/ipc/service/direct_composition_surface_win.cc +index faf9e3a2ab0c1e11bf25803084dc1c4213143ab8..1e667e04605de6e105bcd485f3c84c444546b044 100644 +--- a/gpu/ipc/service/direct_composition_surface_win.cc ++++ b/gpu/ipc/service/direct_composition_surface_win.cc +@@ -1674,8 +1674,6 @@ gfx::SwapResult DirectCompositionSurfaceWin::SwapBuffers( + gl::GLSurfacePresentationHelper::ScopedSwapBuffers scoped_swap_buffers( + presentation_helper_.get(), callback); + +- child_window_.ClearInvalidContents(); +- + bool succeeded = true; + + if (root_surface_->SwapBuffers(PresentationCallback()) == diff --git a/patches/common/chromium/frame_host_manager.patch b/patches/common/chromium/frame_host_manager.patch index f795072e96..732e55429b 100644 --- a/patches/common/chromium/frame_host_manager.patch +++ b/patches/common/chromium/frame_host_manager.patch @@ -7,10 +7,10 @@ Allows embedder to intercept site instances chosen by chromium and respond with custom instance. diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc -index fd7d05e26fa5ecdab370c8edf984f92dfaacfc28..4ad4fc9e7881ff6b432e5f61fa72fbabef752015 100644 +index 69913022bb1955a22d93acabbdda84e8090de29d..20db3861e67290787fd8c45e5dbeb7507064bdf9 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc -@@ -1932,6 +1932,16 @@ bool RenderFrameHostManager::InitRenderView( +@@ -1933,6 +1933,16 @@ bool RenderFrameHostManager::InitRenderView( scoped_refptr RenderFrameHostManager::GetSiteInstanceForNavigationRequest( const NavigationRequest& request) { @@ -27,7 +27,7 @@ index fd7d05e26fa5ecdab370c8edf984f92dfaacfc28..4ad4fc9e7881ff6b432e5f61fa72fbab // First, check if the navigation can switch SiteInstances. If not, the // navigation should use the current SiteInstance. SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); -@@ -1964,6 +1974,51 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -1965,6 +1975,51 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request.common_params().url); no_renderer_swap_allowed |= request.from_begin_navigation() && !can_renderer_initiate_transfer; @@ -79,7 +79,7 @@ index fd7d05e26fa5ecdab370c8edf984f92dfaacfc28..4ad4fc9e7881ff6b432e5f61fa72fbab } else { // Subframe navigations will use the current renderer, unless specifically // allowed to swap processes. -@@ -1975,23 +2030,17 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -1976,23 +2031,17 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( if (no_renderer_swap_allowed && !should_swap_for_error_isolation) return scoped_refptr(current_site_instance); @@ -108,10 +108,10 @@ index fd7d05e26fa5ecdab370c8edf984f92dfaacfc28..4ad4fc9e7881ff6b432e5f61fa72fbab } diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc -index 543e9d90098e65286482b82a98a116d3224925a9..f564df8841d1eaea29d4f09c679263ec97552e3b 100644 +index abfb6afec00a691ea2ff27e7797921e3eb25d8ea..ae4bfc6553f347ad5a7e5327d64155e700e6584e 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -48,6 +48,16 @@ void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info, +@@ -49,6 +49,16 @@ void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info, handle); } @@ -129,10 +129,10 @@ index 543e9d90098e65286482b82a98a116d3224925a9..f564df8841d1eaea29d4f09c679263ec const MainFunctionParams& parameters) { return nullptr; diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index 6962a00811a20a8dd78ee3688fac31a87500b4dc..af64896d0567870672bf4e2f45f7d76e1df68844 100644 +index eb2f9a8f240f8805e4bcbde0465ec445dd7539e7..5f6fdb2d66acfa73c895cac18714d0998eed2ab2 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -204,8 +204,37 @@ CONTENT_EXPORT void OverrideOnBindInterface( +@@ -202,8 +202,37 @@ CONTENT_EXPORT void OverrideOnBindInterface( // the observer interfaces.) class CONTENT_EXPORT ContentBrowserClient { public: diff --git a/patches/common/chromium/gin_enable_disable_v8_platform.patch b/patches/common/chromium/gin_enable_disable_v8_platform.patch index 7bef855097..605e54ac34 100644 --- a/patches/common/chromium/gin_enable_disable_v8_platform.patch +++ b/patches/common/chromium/gin_enable_disable_v8_platform.patch @@ -5,10 +5,10 @@ Subject: gin_enable_disable_v8_platform.patch diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc -index 5670a2e55ef827068c547f4a76de18a12936d115..3332f4936c633f834576ae2eb0a4c59de482881e 100644 +index 4491b392412caac052bf9e41c70a28086ada8a17..8ec7775b78b3645dbac5ee518404ca9a70122153 100644 --- a/gin/isolate_holder.cc +++ b/gin/isolate_holder.cc -@@ -121,9 +121,10 @@ IsolateHolder::~IsolateHolder() { +@@ -122,9 +122,10 @@ IsolateHolder::~IsolateHolder() { void IsolateHolder::Initialize(ScriptMode mode, V8ExtrasMode v8_extras_mode, v8::ArrayBuffer::Allocator* allocator, @@ -36,7 +36,7 @@ index 8cb2646bdd7dc3f5013d197f4b76e8707afb6817..95844885e478e460b1f03a7d98942bff v8::Isolate* isolate() { return isolate_; } diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc -index 4b3ef5cfa0684b31cf2e35acb27a1adee9dddfbb..ce0be2126d62754662c706698fc75e91e64af7f7 100644 +index 48116401c0be193261811e14db31844727f980fb..3ae68bdd35f386292de218985a5ab6890fd73c83 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc @@ -205,12 +205,14 @@ enum LoadV8FileResult { diff --git a/patches/common/chromium/gritsettings_resource_ids.patch b/patches/common/chromium/gritsettings_resource_ids.patch index bfb84bcb15..9aab935747 100644 --- a/patches/common/chromium/gritsettings_resource_ids.patch +++ b/patches/common/chromium/gritsettings_resource_ids.patch @@ -6,11 +6,11 @@ Subject: gritsettings_resource_ids.patch Add electron resources file to the list of resource ids generation. diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids -index 95e9bf70c41e68fc43326f4545cfc7f65b265083..44b0131431983cee35dbd6af1b979fc53c0507b9 100644 +index 0d621a15e32b9d354bf21af92f4d4cf8bfdeec67..a6f2e9e76eb82b1b45e3cd8b0662211904dc70ae 100644 --- a/tools/gritsettings/resource_ids +++ b/tools/gritsettings/resource_ids -@@ -422,6 +422,11 @@ - "includes": [28850], +@@ -424,6 +424,11 @@ + "includes": [28900], }, + "electron/electron_resources.grd": { diff --git a/patches/common/chromium/ignore_rc_check.patch b/patches/common/chromium/ignore_rc_check.patch index 903f711006..01e1b5b68f 100644 --- a/patches/common/chromium/ignore_rc_check.patch +++ b/patches/common/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 6f01ebf4026444d405cb3b837b21a6370c357180..d03be4244bfa37953b55783f2e245df76b634522 100644 +index cb0393ecd507b865169e9d7c3037d7d5523ae30e..34eebb06295b38dfa0b567f66780ce144b6b5f34 100644 --- a/build/toolchain/win/tool_wrapper.py +++ b/build/toolchain/win/tool_wrapper.py -@@ -220,7 +220,11 @@ class WinTool(object): +@@ -231,7 +231,11 @@ class WinTool(object): if rc_exe_exit_code == 0: import filecmp # Strip "/fo" prefix. diff --git a/patches/common/chromium/isolate_holder.patch b/patches/common/chromium/isolate_holder.patch index a9a5f26376..1d9b6273d0 100644 --- a/patches/common/chromium/isolate_holder.patch +++ b/patches/common/chromium/isolate_holder.patch @@ -8,7 +8,7 @@ needs to register on an isolate so that it can be used later down in the initialization process of an isolate. diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc -index 3332f4936c633f834576ae2eb0a4c59de482881e..801383dffd6d49b174b6b5a4b89e6a1a498da499 100644 +index 8ec7775b78b3645dbac5ee518404ca9a70122153..c82ca4d00398cb01ffea20b8d8d937329e764e45 100644 --- a/gin/isolate_holder.cc +++ b/gin/isolate_holder.cc @@ -52,7 +52,8 @@ IsolateHolder::IsolateHolder( diff --git a/patches/common/chromium/mas-audiodeviceduck.patch b/patches/common/chromium/mas-audiodeviceduck.patch index c0c829cdcd..171ad7a2c9 100644 --- a/patches/common/chromium/mas-audiodeviceduck.patch +++ b/patches/common/chromium/mas-audiodeviceduck.patch @@ -6,7 +6,7 @@ Subject: mas-audiodeviceduck.patch Removes usage of the AudioDeviceDuck private API. diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc -index b8e4e68e9b8f6ac040939a97bdf040c3351efa13..abff176679f7dde30a65528be7e9a2568f68972a 100644 +index b7bcfa7b01dd5072685aaa1176d6277405742d94..df34137985d36ea2a48b2afe45c3cc253d4aa95b 100644 --- a/media/audio/mac/audio_low_latency_input_mac.cc +++ b/media/audio/mac/audio_low_latency_input_mac.cc @@ -33,19 +33,23 @@ diff --git a/patches/common/chromium/mas-cfisobjc.patch b/patches/common/chromium/mas-cfisobjc.patch index c1dc41702a..180423f3b8 100644 --- a/patches/common/chromium/mas-cfisobjc.patch +++ b/patches/common/chromium/mas-cfisobjc.patch @@ -9,7 +9,7 @@ diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e25fe7ca21 100644 --- a/base/mac/foundation_util.mm +++ b/base/mac/foundation_util.mm -@@ -26,7 +26,6 @@ CFTypeID SecKeyGetTypeID(); +@@ -26,7 +26,6 @@ #if !defined(OS_IOS) CFTypeID SecACLGetTypeID(); CFTypeID SecTrustedApplicationGetTypeID(); @@ -17,7 +17,7 @@ index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e2 #endif } // extern "C" -@@ -325,8 +324,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) { +@@ -325,8 +324,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) { const_cast(reinterpret_cast(cf_val)); DCHECK(!cf_val || CTFontGetTypeID() == CFGetTypeID(cf_val) || @@ -27,7 +27,7 @@ index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e2 return ns_val; } -@@ -394,9 +392,6 @@ CFCast(const CFTypeRef& cf_val) { +@@ -394,9 +392,6 @@ CTFontRef NSToCFCast(NSFont* ns_val) { return (CTFontRef)(cf_val); } diff --git a/patches/common/chromium/mas-cgdisplayusesforcetogray.patch b/patches/common/chromium/mas-cgdisplayusesforcetogray.patch index 883f1f3294..24d71635f7 100644 --- a/patches/common/chromium/mas-cgdisplayusesforcetogray.patch +++ b/patches/common/chromium/mas-cgdisplayusesforcetogray.patch @@ -6,7 +6,7 @@ Subject: mas-cgdisplayusesforcetogray.patch Removes usage of the CGDisplayUsesForceToGray private API. diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm -index ff92b9fad59beedb8510c112f6e87e61090d2eb9..ea1804fc13660ee097ef2fa298098155d6677ceb 100644 +index ec1fc4edf55d8b5893dece146ddb0d39231f547d..05d8c811b913d88b71017a91eb3f2f993ccadd74 100644 --- a/ui/display/mac/screen_mac.mm +++ b/ui/display/mac/screen_mac.mm @@ -106,7 +106,17 @@ Display BuildDisplayForScreen(NSScreen* screen) { diff --git a/patches/common/chromium/mas-lssetapplicationlaunchservicesserverconnectionstatus.patch b/patches/common/chromium/mas-lssetapplicationlaunchservicesserverconnectionstatus.patch index 0e8e5beb43..19abd49b8f 100644 --- a/patches/common/chromium/mas-lssetapplicationlaunchservicesserverconnectionstatus.patch +++ b/patches/common/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 c2061485c91dec043c6047d4640f5765a20a4248..d39465b0b2dd8bf4ac26335c44b78b1051659113 100644 +index 8397889b61e20febeee1dd3c0fe8732186e29b28..13e6da203846de6c93ab656b6c9e0399bce24110 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -274,8 +274,10 @@ int GpuMain(const MainFunctionParams& parameters) { diff --git a/patches/common/chromium/mas_blink_no_private_api.patch b/patches/common/chromium/mas_blink_no_private_api.patch index d687746c3e..3870d2481d 100644 --- a/patches/common/chromium/mas_blink_no_private_api.patch +++ b/patches/common/chromium/mas_blink_no_private_api.patch @@ -18,7 +18,7 @@ index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..2ec7f04c71824b47de1ddbf1f0e8625d extern "C" { // Kill ring calls. Would be better to use NSKillRing.h, but that's not -@@ -39,38 +40,53 @@ NSString* _NSYankFromKillRing(); +@@ -39,38 +40,53 @@ void _NSNewKillRingSequence(); void _NSSetKillRingToYankedState(); } @@ -92,7 +92,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185 namespace blink { -@@ -73,10 +75,12 @@ bool ThemePainterMac::PaintTextField(const Node* node, +@@ -73,10 +75,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame, // behavior change while remaining a fragile solution. // https://bugs.chromium.org/p/chromium/issues/detail?id=658085#c3 if (!use_ns_text_field_cell) { @@ -105,7 +105,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185 return false; } -@@ -162,10 +166,12 @@ bool ThemePainterMac::PaintTextArea(const Node* node, +@@ -162,10 +166,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame, const PaintInfo& paint_info, const IntRect& r) { LocalCurrentGraphicsContext local_context(paint_info.context, r); diff --git a/patches/common/chromium/mas_no_private_api.patch b/patches/common/chromium/mas_no_private_api.patch index 687482bfa9..8e008294e9 100644 --- a/patches/common/chromium/mas_no_private_api.patch +++ b/patches/common/chromium/mas_no_private_api.patch @@ -7,10 +7,10 @@ Guard usages in blink of private Mac APIs by MAS_BUILD, so they can be excluded for people who want to submit their apps to the Mac App store. diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h -index d38fa48b8b890d90f2911995a2a51c249005c827..5fe68c71fe101a307ef565013a91b109393457dd 100644 +index 44c85b5ad571c39c4580cb9d0cdf08f694c1dfb4..1714c403edf21092e43192f25cf0c19f50dd8486 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.h +++ b/content/browser/accessibility/browser_accessibility_cocoa.h -@@ -109,7 +109,9 @@ struct AXTextEdit { +@@ -111,7 +111,9 @@ struct AXTextEdit { @property(nonatomic, readonly) NSNumber* enabled; // Returns a text marker that points to the last character in the document that // can be selected with Voiceover. @@ -20,7 +20,7 @@ index d38fa48b8b890d90f2911995a2a51c249005c827..5fe68c71fe101a307ef565013a91b109 @property(nonatomic, readonly) NSNumber* expanded; @property(nonatomic, readonly) NSNumber* focused; @property(nonatomic, readonly) NSNumber* grabbed; -@@ -145,12 +147,16 @@ struct AXTextEdit { +@@ -147,12 +149,16 @@ struct AXTextEdit { @property(nonatomic, readonly) NSArray* selectedChildren; @property(nonatomic, readonly) NSString* selectedText; @property(nonatomic, readonly) NSValue* selectedTextRange; @@ -38,10 +38,10 @@ index d38fa48b8b890d90f2911995a2a51c249005c827..5fe68c71fe101a307ef565013a91b109 // 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 eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38fe2ee0e38 100644 +index ec60dd6b8f2500ac812654817f76cef26636d911..4c8c2cca0a15ad27c655fad98a6c395228d33e4e 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm -@@ -136,6 +136,7 @@ NSDictionary* attributeToMethodNameMap = nil; +@@ -135,6 +135,7 @@ // VoiceOver uses -1 to mean "no limit" for AXResultsLimit. const int kAXResultsLimitNoLimit = -1; @@ -49,7 +49,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f extern "C" { // The following are private accessibility APIs required for cursor navigation -@@ -342,6 +343,7 @@ NSAttributedString* GetAttributedTextForTextMarkerRange( +@@ -341,6 +342,7 @@ void AddMisspelledTextAttributes( AddMisspelledTextAttributes(text_only_objects, attributed_text); return [attributed_text attributedSubstringFromRange:range]; } @@ -57,7 +57,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f // Returns an autoreleased copy of the AXNodeData's attribute. NSString* NSStringForStringAttribute( -@@ -596,7 +598,9 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -595,7 +597,9 @@ + (void)initialize { {NSAccessibilityDOMIdentifierAttribute, @"domIdentifier"}, {NSAccessibilityEditableAncestorAttribute, @"editableAncestor"}, {NSAccessibilityEnabledAttribute, @"enabled"}, @@ -67,7 +67,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f {NSAccessibilityExpandedAttribute, @"expanded"}, {NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"}, {NSAccessibilityFocusedAttribute, @"focused"}, -@@ -631,13 +635,17 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -630,13 +634,17 @@ + (void)initialize { {NSAccessibilityRowsAttribute, @"rows"}, // TODO(aboxhall): expose // NSAccessibilityServesAsTitleForUIElementsAttribute @@ -85,7 +85,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f {NSAccessibilitySizeAttribute, @"size"}, {NSAccessibilitySortDirectionAttribute, @"sortDirection"}, {NSAccessibilitySubroleAttribute, @"subrole"}, -@@ -1071,6 +1079,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -1117,6 +1125,7 @@ - (NSNumber*)enabled { ax::mojom::Restriction::kDisabled]; } @@ -93,7 +93,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f // Returns a text marker that points to the last character in the document that // can be selected with VoiceOver. - (id)endTextMarker { -@@ -1081,6 +1090,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -1127,6 +1136,7 @@ - (id)endTextMarker { BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtEndOfAnchor()); } @@ -101,7 +101,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f - (NSNumber*)expanded { if (![self instanceActive]) -@@ -1943,6 +1953,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2036,6 +2046,7 @@ - (NSValue*)selectedTextRange { return [NSValue valueWithRange:NSMakeRange(selStart, selLength)]; } @@ -109,7 +109,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f - (id)selectedTextMarkerRange { if (![self instanceActive]) return nil; -@@ -1975,6 +1986,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2068,6 +2079,7 @@ - (id)selectedTextMarkerRange { anchorAffinity, *focusObject, focusOffset, focusAffinity)); } @@ -117,7 +117,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f - (NSValue*)size { if (![self instanceActive]) -@@ -2007,6 +2019,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2100,6 +2112,7 @@ - (NSString*)sortDirection { return nil; } @@ -125,7 +125,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f // Returns a text marker that points to the first character in the document that // can be selected with VoiceOver. - (id)startTextMarker { -@@ -2017,6 +2030,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2110,6 +2123,7 @@ - (id)startTextMarker { BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtStartOfAnchor()); } @@ -133,7 +133,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f // Returns a subrole based upon the role. - (NSString*) subrole { -@@ -2338,12 +2352,14 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2418,12 +2432,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range { NSMutableAttributedString* attributedValue = [[[NSMutableAttributedString alloc] initWithString:value] autorelease]; @@ -148,15 +148,15 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f return [attributedValue attributedSubstringFromRange:range]; } -@@ -2429,6 +2445,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; - return ToBrowserAccessibilityCocoa(cell); +@@ -2540,6 +2556,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute + return nil; } +#ifndef MAS_BUILD if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) { BrowserAccessibilityPositionInstance position = CreatePositionFromTextMarker(parameter); -@@ -2606,6 +2623,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2717,6 +2734,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute NSString* text = GetTextForTextMarkerRange(parameter); return [NSNumber numberWithInt:[text length]]; } @@ -164,7 +164,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f if ([attribute isEqualToString: NSAccessibilityBoundsForRangeParameterizedAttribute]) { -@@ -2639,6 +2657,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2754,6 +2772,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return nil; } @@ -172,7 +172,7 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f if ([attribute isEqualToString: NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) { BrowserAccessibilityPositionInstance position = -@@ -2714,6 +2733,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2833,6 +2852,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition( return @(child->GetIndexInParent()); } @@ -181,10 +181,10 @@ index eba85655c0bae04c75a9f2fd1941c86f229a1195..b092982305132fc54d26008934eed38f return nil; } diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm -index e61ed97ed0c5652f5b8bd5763a401a32a3b8118d..6e51684b8641ec452bf430850a52556af5d73066 100644 +index ace4792b6861452555e819a2412303e3495c2018..b258a8302e85e8eee04b23106616a825b344e32f 100644 --- a/content/browser/accessibility/browser_accessibility_manager_mac.mm +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm -@@ -462,6 +462,7 @@ NSDictionary* BrowserAccessibilityManagerMac:: +@@ -462,6 +462,7 @@ void PostAnnouncementNotification(NSString* announcement) { [user_info setObject:native_focus_object forKey:NSAccessibilityTextChangeElement]; @@ -192,7 +192,7 @@ index e61ed97ed0c5652f5b8bd5763a401a32a3b8118d..6e51684b8641ec452bf430850a52556a id selected_text = [native_focus_object selectedTextMarkerRange]; if (selected_text) { NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute = -@@ -469,6 +470,7 @@ NSDictionary* BrowserAccessibilityManagerMac:: +@@ -469,6 +470,7 @@ void PostAnnouncementNotification(NSString* announcement) { [user_info setObject:selected_text forKey:NSAccessibilitySelectedTextMarkerRangeAttribute]; } @@ -216,7 +216,7 @@ index b7142c2871faf4a0ba8be79266e9515d81585bdd..3d80c332e9af280a166612f6be54b6f7 namespace content { -@@ -35,6 +37,7 @@ namespace { +@@ -35,6 +37,7 @@ // verifies there are no existing open connections), and then indicates that // Chrome should continue execution without access to launchservicesd. void DisableSystemServices() { @@ -233,10 +233,10 @@ index b7142c2871faf4a0ba8be79266e9515d81585bdd..3d80c332e9af280a166612f6be54b6f7 // You are about to read a pretty disgusting hack. In a static initializer, diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm -index fafb98764b562c335733eac9998d9edfda69e38d..43666a8e70808297ecbd2b65d6f2c73029e40677 100644 +index 24a63be8a4be4f74f78fec810490d16cffaf43c1..414423de009d14ac6ac7bab2a260b3e0d7085d1f 100644 --- a/device/bluetooth/bluetooth_adapter_mac.mm +++ b/device/bluetooth/bluetooth_adapter_mac.mm -@@ -37,6 +37,7 @@ +@@ -34,6 +34,7 @@ #include "device/bluetooth/bluetooth_low_energy_peripheral_manager_delegate.h" #include "device/bluetooth/bluetooth_socket_mac.h" @@ -244,7 +244,7 @@ index fafb98764b562c335733eac9998d9edfda69e38d..43666a8e70808297ecbd2b65d6f2c730 extern "C" { // Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and // `Karabiner` [3] to programmatically control the Bluetooth state. Calling the -@@ -50,6 +51,7 @@ extern "C" { +@@ -47,6 +48,7 @@ // [4] https://support.apple.com/kb/PH25091 void IOBluetoothPreferenceSetControllerPowerState(int state); } @@ -252,7 +252,7 @@ index fafb98764b562c335733eac9998d9edfda69e38d..43666a8e70808297ecbd2b65d6f2c730 namespace { -@@ -129,8 +131,10 @@ BluetoothAdapterMac::BluetoothAdapterMac() +@@ -120,8 +122,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { controller_state_function_( base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState, base::Unretained(this))), @@ -263,7 +263,7 @@ index fafb98764b562c335733eac9998d9edfda69e38d..43666a8e70808297ecbd2b65d6f2c730 should_update_name_(true), classic_discovery_manager_( BluetoothDiscoveryManagerMac::CreateClassic(this)), -@@ -328,8 +332,12 @@ bool BluetoothAdapterMac::IsLowEnergyAvailable() { +@@ -317,8 +321,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { } bool BluetoothAdapterMac::SetPoweredImpl(bool powered) { @@ -277,10 +277,10 @@ index fafb98764b562c335733eac9998d9edfda69e38d..43666a8e70808297ecbd2b65d6f2c730 void BluetoothAdapterMac::RemovePairingDelegateInternal( diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn -index 69dd2acc69142a5098b8583e7550044210375cc7..02c092c3f32707c0c889d02f086d45eede86e292 100644 +index 38e7bb1d7f4ac8ddede73fcb2d64ff3ea25205d7..c1a9026b1fb8610546b682b4d677871482327e63 100644 --- a/media/audio/BUILD.gn +++ b/media/audio/BUILD.gn -@@ -206,6 +206,12 @@ source_set("audio") { +@@ -202,6 +202,12 @@ source_set("audio") { "mac/scoped_audio_unit.cc", "mac/scoped_audio_unit.h", ] @@ -294,10 +294,10 @@ index 69dd2acc69142a5098b8583e7550044210375cc7..02c092c3f32707c0c889d02f086d45ee "AudioToolbox.framework", "AudioUnit.framework", diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc -index a1091960873dad8bb1b0129d20a552bf8a51739f..50bb186d1474fd4c90723ac97ac93b1d271e7a3b 100644 +index 31f593c59087969c3879b1da5a3de1eedcffc3a3..3bc29f5a5560b4436ebe70924bf10354e0b6be99 100644 --- a/media/audio/mac/audio_manager_mac.cc +++ b/media/audio/mac/audio_manager_mac.cc -@@ -877,7 +877,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters( +@@ -868,7 +868,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters( void AudioManagerMac::InitializeOnAudioThread() { DCHECK(GetTaskRunner()->BelongsToCurrentThread()); @@ -307,7 +307,7 @@ index a1091960873dad8bb1b0129d20a552bf8a51739f..50bb186d1474fd4c90723ac97ac93b1d } diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc -index c51a6320b0a19f220ac3a210909df1f89ce979b1..c3ef7e7633cf0dc8af8cd3b1e828df549c7e48cb 100644 +index 1b947c5b63564ac87cc3fb5a0d060e41a5407b4a..2bf92efa3c77ac13383dd904ba2a24081deccd04 100644 --- a/net/dns/dns_config_service_posix.cc +++ b/net/dns/dns_config_service_posix.cc @@ -243,6 +243,7 @@ class DnsConfigServicePosix::Watcher { diff --git a/patches/common/chromium/net_url_request_job.patch b/patches/common/chromium/net_url_request_job.patch index 2681cbb94e..ec7ff410c9 100644 --- a/patches/common/chromium/net_url_request_job.patch +++ b/patches/common/chromium/net_url_request_job.patch @@ -5,10 +5,10 @@ Subject: net_url_request_job.patch diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h -index c75471c5dce778b2338290ae1fdfff5ebbc16f7b..df79df6d765d4957e2489e8ee6ddc1e77f07efc7 100644 +index 7a223958751012b2042a91edf85578b00702d565..08a3940915c61746c7bf80d24400875099f9686c 100644 --- a/net/url_request/url_request_job.h +++ b/net/url_request/url_request_job.h -@@ -293,6 +293,7 @@ class NET_EXPORT URLRequestJob : public base::PowerObserver { +@@ -292,6 +292,7 @@ class NET_EXPORT URLRequestJob : public base::PowerObserver { void OnCallToDelegate(NetLogEventType type); void OnCallToDelegateComplete(); diff --git a/patches/common/chromium/no_cache_storage_check.patch b/patches/common/chromium/no_cache_storage_check.patch index 65cdef11b1..3f0ce6e8a8 100644 --- a/patches/common/chromium/no_cache_storage_check.patch +++ b/patches/common/chromium/no_cache_storage_check.patch @@ -7,10 +7,10 @@ Do not check for unique origin in CacheStorage, in Electron we may have scripts running without an origin. diff --git a/content/browser/cache_storage/cache_storage.cc b/content/browser/cache_storage/cache_storage.cc -index 334699f5f3832cbb90f595e31de0f443c6e62d26..4c5c7ec26b67afcf804649e3441cbb53c96e5956 100644 +index 5371daf3c552d4ad506439ba6e37b80a353b1036..bd5a480552fd420d5d15f97a39b08e693edff22d 100644 --- a/content/browser/cache_storage/cache_storage.cc +++ b/content/browser/cache_storage/cache_storage.cc -@@ -130,7 +130,7 @@ class CacheStorage::CacheLoader { +@@ -133,7 +133,7 @@ class CacheStorage::CacheLoader { cache_storage_(cache_storage), origin_(origin), owner_(owner) { diff --git a/patches/common/chromium/notification_provenance.patch b/patches/common/chromium/notification_provenance.patch index 947f5d95aa..7906f97e36 100644 --- a/patches/common/chromium/notification_provenance.patch +++ b/patches/common/chromium/notification_provenance.patch @@ -6,7 +6,7 @@ Subject: pass RenderProcessHost through to PlatformNotificationService this is so Electron can identify which renderer a notification came from diff --git a/content/browser/notifications/blink_notification_service_impl.cc b/content/browser/notifications/blink_notification_service_impl.cc -index 8d742bb1ed991e386073879c33142bb93d3b4e29..bdc435353751241c528b7331e37f76e90cb1becb 100644 +index 2a4592f1565b99db37e91e090b5478fd1ad6e1a7..8a4144153789f4174763e3b23d47080521b0c20e 100644 --- a/content/browser/notifications/blink_notification_service_impl.cc +++ b/content/browser/notifications/blink_notification_service_impl.cc @@ -48,9 +48,11 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl( diff --git a/patches/common/chromium/out_of_process_instance.patch b/patches/common/chromium/out_of_process_instance.patch index c47a51abb8..a9ef675dca 100644 --- a/patches/common/chromium/out_of_process_instance.patch +++ b/patches/common/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 ef12260b6a7fd996ac5601f0c3a2db6bca38a46b..12e25f4332eb421cac8797f2d1403592771547f0 100644 +index 788082cd637aaf75f6ecc0a7d10977939f2b3e18..1a831ae135084f8cd04c2df62288300070585959 100644 --- a/pdf/out_of_process_instance.cc +++ b/pdf/out_of_process_instance.cc -@@ -462,7 +462,9 @@ bool OutOfProcessInstance::Init(uint32_t argc, +@@ -468,7 +468,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/common/chromium/pepper_flash.patch b/patches/common/chromium/pepper_flash.patch index 6d0251edb7..c276d7b044 100644 --- a/patches/common/chromium/pepper_flash.patch +++ b/patches/common/chromium/pepper_flash.patch @@ -435,12 +435,12 @@ index d63e90b6c5079ab3237c4bad3d5e63ce2f99c657..c98a7bd07ddd9527fc67b05b24463ed4 return nullptr; } diff --git a/chrome/renderer/pepper/pepper_flash_renderer_host.cc b/chrome/renderer/pepper/pepper_flash_renderer_host.cc -index 42248eae343754988e2461ef0fb080b6d0edafdf..bb768481e0721d742c105bf18405ddcd357f794d 100644 +index 66a532e2cb41cdbae83410dad95984cf02de4a67..e776d0e96c4a5e6523161a66a5c9a1c0e4ad2132 100644 --- a/chrome/renderer/pepper/pepper_flash_renderer_host.cc +++ b/chrome/renderer/pepper/pepper_flash_renderer_host.cc @@ -13,7 +13,9 @@ + #include "base/macros.h" #include "base/metrics/histogram_macros.h" - #include "base/no_destructor.h" #include "base/strings/string_util.h" +#if 0 #include "components/pdf/renderer/pepper_pdf_host.h" @@ -448,7 +448,7 @@ index 42248eae343754988e2461ef0fb080b6d0edafdf..bb768481e0721d742c105bf18405ddcd #include "content/public/renderer/pepper_plugin_instance.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/renderer_ppapi_host.h" -@@ -132,9 +134,11 @@ bool IsSimpleHeader(const std::string& lower_case_header_name, +@@ -130,9 +132,11 @@ bool IsSimpleHeader(const std::string& lower_case_header_name, } void RecordFlashNavigateUsage(FlashNavigateUsage usage) { @@ -460,7 +460,7 @@ index 42248eae343754988e2461ef0fb080b6d0edafdf..bb768481e0721d742c105bf18405ddcd } } // namespace -@@ -376,6 +380,8 @@ int32_t PepperFlashRendererHost::OnIsRectTopmost( +@@ -374,6 +378,8 @@ int32_t PepperFlashRendererHost::OnIsRectTopmost( int32_t PepperFlashRendererHost::OnInvokePrinting( ppapi::host::HostMessageContext* host_context) { diff --git a/patches/common/chromium/printing.patch b/patches/common/chromium/printing.patch index 9a642802d8..08f5db6204 100644 --- a/patches/common/chromium/printing.patch +++ b/patches/common/chromium/printing.patch @@ -166,7 +166,7 @@ index fa8d5a178aee2399c05d4f31b42edbc563883355..a6d1430c74e6d52abf3ceaf95678fef0 bool printing_succeeded_; diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc -index e415483aaee80c0c797b04f49b69060e33253546..77dce4d5acbc6c3d9e7167480771db7ca64314fc 100644 +index b21042ead358362267d81dc0c5a76ab35dccd9b8..2db39f368950b73a8df9dc7127b7d3d93d9a7dd0 100644 --- a/chrome/browser/printing/printing_message_filter.cc +++ b/chrome/browser/printing/printing_message_filter.cc @@ -22,6 +22,7 @@ @@ -177,7 +177,7 @@ index e415483aaee80c0c797b04f49b69060e33253546..77dce4d5acbc6c3d9e7167480771db7c #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/child_process_host.h" -@@ -100,20 +101,23 @@ PrintViewManager* GetPrintViewManager(int render_process_id, +@@ -96,20 +97,23 @@ PrintViewManager* GetPrintViewManager(int render_process_id, } // namespace @@ -204,7 +204,7 @@ index e415483aaee80c0c797b04f49b69060e33253546..77dce4d5acbc6c3d9e7167480771db7c } PrintingMessageFilter::~PrintingMessageFilter() { -@@ -194,11 +198,13 @@ void PrintingMessageFilter::OnTempFileForPrintingWritten(int render_frame_id, +@@ -190,11 +194,13 @@ void PrintingMessageFilter::OnTempFileForPrintingWritten(int render_frame_id, void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) { DCHECK_CURRENTLY_ON(BrowserThread::IO); scoped_refptr printer_query; @@ -218,7 +218,7 @@ index e415483aaee80c0c797b04f49b69060e33253546..77dce4d5acbc6c3d9e7167480771db7c printer_query = queue_->PopPrinterQuery(0); if (!printer_query.get()) { printer_query = -@@ -311,11 +317,13 @@ void PrintingMessageFilter::OnUpdatePrintSettings( +@@ -303,11 +309,13 @@ void PrintingMessageFilter::OnUpdatePrintSettings( std::unique_ptr new_settings(job_settings.DeepCopy()); scoped_refptr printer_query; @@ -232,7 +232,7 @@ index e415483aaee80c0c797b04f49b69060e33253546..77dce4d5acbc6c3d9e7167480771db7c printer_query = queue_->PopPrinterQuery(document_cookie); if (!printer_query.get()) { printer_query = queue_->CreatePrinterQuery( -@@ -374,7 +382,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply( +@@ -366,7 +374,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply( #if BUILDFLAG(ENABLE_PRINT_PREVIEW) void PrintingMessageFilter::OnCheckForCancel(const PrintHostMsg_PreviewIds& ids, bool* cancel) { @@ -283,21 +283,21 @@ index 7dd892feb181293d3c52fb6a3fd9600c899ee2d3..1ca51744e1046e5dfbedf5af8c6f7535 // 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 9fb226cdf1db9a6651ca28f1bcfa7ec128bb6291..7f8907349e00b04dbdebb538ba4eb6cd89404fd4 100644 +index c888622c024fe3629705d136def7f8ef4cdc0cbf..d238b12d8409de01a7208c6bf404fc08f762f9be 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc -@@ -1132,7 +1132,9 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { +@@ -1045,7 +1045,9 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { web_frame->DispatchBeforePrintEvent(); if (!weak_this) return; -- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted); -+ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted, +- Print(web_frame, blink::WebNode(), true /* is_scripted? */); ++ Print(web_frame, blink::WebNode(), true /* is_scripted? */, + false /* silent */, false /* print_background */, + base::DictionaryValue() /* new_settings */); if (weak_this) web_frame->DispatchAfterPrintEvent(); } -@@ -1180,7 +1182,10 @@ void PrintRenderFrameHelper::OnDestruct() { +@@ -1093,7 +1095,10 @@ void PrintRenderFrameHelper::OnDestruct() { delete this; } @@ -309,26 +309,27 @@ index 9fb226cdf1db9a6651ca28f1bcfa7ec128bb6291..7f8907349e00b04dbdebb538ba4eb6cd if (ipc_nesting_level_ > 1) return; -@@ -1193,7 +1198,8 @@ void PrintRenderFrameHelper::OnPrintPages() { +@@ -1106,7 +1111,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); -- Print(frame, plugin, PrintRequestType::kRegular); -+ Print(frame, plugin, PrintRequestType::kRegular, +- Print(frame, plugin, false /* is_scripted? */); ++ Print(frame, plugin, false /* is_scripted? */, + silent, print_background, settings); if (weak_this) frame->DispatchAfterPrintEvent(); // WARNING: |this| may be gone at this point. Do not do any more work here and -@@ -1210,7 +1216,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() { +@@ -1122,7 +1128,8 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() { + return; } auto weak_this = weak_ptr_factory_.GetWeakPtr(); - Print(frame, print_preview_context_.source_node(), -- PrintRequestType::kRegular); -+ PrintRequestType::kRegular, false, false, base::DictionaryValue()); +- Print(frame, print_preview_context_.source_node(), false); ++ Print(frame, print_preview_context_.source_node(), false, ++ false, false, base::DictionaryValue()); if (weak_this) frame->DispatchAfterPrintEvent(); // WARNING: |this| may be gone at this point. Do not do any more work here and -@@ -1246,6 +1252,8 @@ void PrintRenderFrameHelper::OnPrintPreview( +@@ -1158,6 +1165,8 @@ void PrintRenderFrameHelper::OnPrintPreview( if (ipc_nesting_level_ > 1) return; @@ -337,31 +338,30 @@ index 9fb226cdf1db9a6651ca28f1bcfa7ec128bb6291..7f8907349e00b04dbdebb538ba4eb6cd print_preview_context_.OnPrintPreview(); UMA_HISTOGRAM_ENUMERATION("PrintPreview.PreviewEvent", -@@ -1631,7 +1639,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -1543,7 +1552,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { auto self = weak_ptr_factory_.GetWeakPtr(); Print(duplicate_node.GetDocument().GetFrame(), duplicate_node, -- PrintRequestType::kRegular); -+ PrintRequestType::kRegular, -+ false /* silent */, +- false /* is_scripted? */); ++ false /* is_scripted? */, false /* silent */, + false /* print_background */, + base::DictionaryValue() /* new_settings */); // Check if |this| is still valid. if (!self) return; -@@ -1642,7 +1653,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -1554,7 +1565,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, const blink::WebNode& node, -- PrintRequestType print_request_type) { -+ PrintRequestType print_request_type, +- bool is_scripted) { ++ bool is_scripted, + bool silent, + bool print_background, + const base::DictionaryValue& settings) { // If still not finished with earlier print request simply ignore. if (prep_frame_view_) return; -@@ -1650,7 +1664,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -1562,7 +1576,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, FrameReference frame_ref(frame); int expected_page_count = 0; @@ -370,19 +370,19 @@ index 9fb226cdf1db9a6651ca28f1bcfa7ec128bb6291..7f8907349e00b04dbdebb538ba4eb6cd DidFinishPrinting(FAIL_PRINT_INIT); return; // Failed to init print page settings. } -@@ -1670,8 +1684,9 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -1582,8 +1596,9 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, PrintMsg_PrintPages_Params print_settings; auto self = weak_ptr_factory_.GetWeakPtr(); - GetPrintSettingsFromUser(frame_ref.GetFrame(), node, expected_page_count, -- print_request_type, &print_settings); +- is_scripted, &print_settings); + if (!silent) + GetPrintSettingsFromUser(frame_ref.GetFrame(), node, expected_page_count, -+ print_request_type, &print_settings); ++ is_scripted, &print_settings); // Check if |this| is still valid. if (!self) return; -@@ -1681,6 +1696,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -1593,6 +1608,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, ? blink::kWebPrintScalingOptionSourceSize : scaling_option; SetPrintPagesParams(print_settings); @@ -390,7 +390,7 @@ index 9fb226cdf1db9a6651ca28f1bcfa7ec128bb6291..7f8907349e00b04dbdebb538ba4eb6cd if (print_settings.params.dpi.IsEmpty() || !print_settings.params.document_cookie) { DidFinishPrinting(OK); // Release resources and fail silently on failure. -@@ -1871,10 +1887,24 @@ std::vector PrintRenderFrameHelper::GetPrintedPages( +@@ -1781,10 +1797,24 @@ std::vector PrintRenderFrameHelper::GetPrintedPages( return printed_pages; } @@ -418,7 +418,7 @@ index 9fb226cdf1db9a6651ca28f1bcfa7ec128bb6291..7f8907349e00b04dbdebb538ba4eb6cd // 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. -@@ -1894,12 +1924,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) { +@@ -1804,12 +1834,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) { return result; } @@ -431,17 +431,17 @@ index 9fb226cdf1db9a6651ca28f1bcfa7ec128bb6291..7f8907349e00b04dbdebb538ba4eb6cd + int* number_of_pages, + const base::DictionaryValue& settings) { DCHECK(frame); - bool fit_to_paper_size = !PrintingNodeOrPdfFrame(frame, node); + bool fit_to_paper_size = !(PrintingNodeOrPdfFrame(frame, node)); - if (!InitPrintSettings(fit_to_paper_size)) { + if (!InitPrintSettings(fit_to_paper_size, settings)) { notify_browser_of_print_failure_ = false; 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 34690801675c8b049d195e37f4fa400c6b30a644..2587534c550612809a4235f4ff92cc6fa962765c 100644 +index ff6423d51151ce84c291ed31a8e99c1c6effcd4f..e4d3b382877318775554f1ffaf8885de1c21aade 100644 --- a/components/printing/renderer/print_render_frame_helper.h +++ b/components/printing/renderer/print_render_frame_helper.h -@@ -192,7 +192,9 @@ class PrintRenderFrameHelper +@@ -187,7 +187,9 @@ class PrintRenderFrameHelper bool OnMessageReceived(const IPC::Message& message) override; // Message handlers --------------------------------------------------------- @@ -452,19 +452,19 @@ index 34690801675c8b049d195e37f4fa400c6b30a644..2587534c550612809a4235f4ff92cc6f void OnPrintForSystemDialog(); #if BUILDFLAG(ENABLE_PRINT_PREVIEW) void OnInitiatePrintPreview(bool has_selection); -@@ -243,7 +245,10 @@ class PrintRenderFrameHelper +@@ -239,7 +241,10 @@ class PrintRenderFrameHelper // WARNING: |this| may be gone after this method returns. void Print(blink::WebLocalFrame* frame, const blink::WebNode& node, -- PrintRequestType print_request_type); -+ PrintRequestType print_request_type, +- bool is_scripted); ++ bool is_scripted, + bool silent, + bool print_background, + const base::DictionaryValue& settings); // Notification when printing is done - signal tear-down/free resources. void DidFinishPrinting(PrintingResult result); -@@ -252,12 +257,14 @@ class PrintRenderFrameHelper +@@ -248,12 +253,14 @@ class PrintRenderFrameHelper // Initialize print page settings with default settings. // Used only for native printing workflow. diff --git a/patches/common/chromium/render_widget_host_view_base.patch b/patches/common/chromium/render_widget_host_view_base.patch index ce2e931b91..2cc58b7792 100644 --- a/patches/common/chromium/render_widget_host_view_base.patch +++ b/patches/common/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 20733af1a1d9cae2c13a381b61aa4aecfebb0877..1b7404c2f05a0225c6dd55aacc7e8b31290ef68f 100644 +index e155153ec1eec9d28242e9ab95c9d75a0d3f40d7..fab1bcd2d8176cdd7163e329552a0a848c601290 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc -@@ -657,6 +657,15 @@ viz::FrameSinkId RenderWidgetHostViewBase::FrameSinkIdAtPoint( +@@ -656,6 +656,15 @@ viz::FrameSinkId RenderWidgetHostViewBase::FrameSinkIdAtPoint( return frame_sink_id.is_valid() ? frame_sink_id : GetFrameSinkId(); } @@ -25,10 +25,10 @@ index 20733af1a1d9cae2c13a381b61aa4aecfebb0877..1b7404c2f05a0225c6dd55aacc7e8b31 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 62bc30a0539f2e0d5b9e86716fe1be9b45726ff7..4b2111b57ca1bf10f5bc4d2589bd23964fa34d62 100644 +index c48b0aa86d8acea34dfece9212da4e7b11ffdb64..115b5647dfc13eb14e4d560c1fb71b926b5af829 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h -@@ -23,8 +23,10 @@ +@@ -22,8 +22,10 @@ #include "components/viz/common/surfaces/surface_id.h" #include "components/viz/host/hit_test/hit_test_query.h" #include "content/browser/renderer_host/event_with_latency_info.h" @@ -39,7 +39,7 @@ index 62bc30a0539f2e0d5b9e86716fe1be9b45726ff7..4b2111b57ca1bf10f5bc4d2589bd2396 #include "content/public/browser/render_widget_host_view.h" #include "content/public/common/input_event_ack_state.h" #include "content/public/common/screen_info.h" -@@ -84,10 +86,12 @@ class CursorManager; +@@ -83,10 +85,12 @@ class CursorManager; class MouseWheelPhaseHandler; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; @@ -52,7 +52,7 @@ index 62bc30a0539f2e0d5b9e86716fe1be9b45726ff7..4b2111b57ca1bf10f5bc4d2589bd2396 class WebCursor; class DelegatedFrameHost; struct TextInputState; -@@ -142,6 +146,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -145,6 +149,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; @@ -62,7 +62,7 @@ index 62bc30a0539f2e0d5b9e86716fe1be9b45726ff7..4b2111b57ca1bf10f5bc4d2589bd2396 // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. gfx::PointF TransformPointToRootCoordSpaceF( -@@ -363,6 +370,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -369,6 +376,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase virtual void ProcessGestureEvent(const blink::WebGestureEvent& event, const ui::LatencyInfo& latency); diff --git a/patches/common/chromium/render_widget_host_view_mac.patch b/patches/common/chromium/render_widget_host_view_mac.patch index cc2fc14d4d..e671c26288 100644 --- a/patches/common/chromium/render_widget_host_view_mac.patch +++ b/patches/common/chromium/render_widget_host_view_mac.patch @@ -5,10 +5,10 @@ Subject: render_widget_host_view_mac.patch diff --git a/content/browser/renderer_host/render_widget_host_view_cocoa.mm b/content/browser/renderer_host/render_widget_host_view_cocoa.mm -index 040b482030aa4dcc91fb4ed0b97ef51acb78cfa5..36f35ae5eba37a24951540057069e32ac88d2980 100644 +index ee6cde8137b105e0951098b1aba0196398e935d3..5b0a6dd36810fae8ca2e055bafe736cb964b9cef 100644 --- a/content/browser/renderer_host/render_widget_host_view_cocoa.mm +++ b/content/browser/renderer_host/render_widget_host_view_cocoa.mm -@@ -142,6 +142,11 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -106,6 +106,11 @@ void ExtractUnderlines(NSAttributedString* string, } // namespace @@ -20,7 +20,7 @@ index 040b482030aa4dcc91fb4ed0b97ef51acb78cfa5..36f35ae5eba37a24951540057069e32a // These are not documented, so use only after checking -respondsToSelector:. @interface NSApplication (UndocumentedSpeechMethods) - (void)speakString:(NSString*)string; -@@ -401,6 +406,9 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -284,6 +289,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { @@ -30,7 +30,7 @@ index 040b482030aa4dcc91fb4ed0b97ef51acb78cfa5..36f35ae5eba37a24951540057069e32a return [self acceptsMouseEventsWhenInactive]; } -@@ -763,6 +771,10 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -647,6 +655,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { eventType == NSKeyDown && !(modifierFlags & NSCommandKeyMask); @@ -41,7 +41,7 @@ index 040b482030aa4dcc91fb4ed0b97ef51acb78cfa5..36f35ae5eba37a24951540057069e32a // We only handle key down events and just simply forward other events. if (eventType != NSKeyDown) { clientHelper_->ForwardKeyboardEvent(event, latency_info); -@@ -1503,9 +1515,11 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -1419,9 +1431,11 @@ - (id)accessibilityFocusedUIElement { // 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 040b482030aa4dcc91fb4ed0b97ef51acb78cfa5..36f35ae5eba37a24951540057069e32a - (NSArray*)validAttributesForMarkedText { // This code is just copied from WebKit except renaming variables. -@@ -1514,7 +1528,10 @@ extern NSString* NSTextInputReplacementRangeAttributeName; +@@ -1430,7 +1444,10 @@ - (NSArray*)validAttributesForMarkedText { initWithObjects:NSUnderlineStyleAttributeName, NSUnderlineColorAttributeName, NSMarkedClauseSegmentAttributeName, @@ -66,10 +66,10 @@ index 040b482030aa4dcc91fb4ed0b97ef51acb78cfa5..36f35ae5eba37a24951540057069e32a 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 86e898d4591d3fd8af325f7f204d0f19b019238e..9103cb06553d86fb8fe4c22c05ad88925e09891d 100644 +index 94d6e79377d354bc8c3041d4e9ffa21a29caea0c..38574877ab366c45a86e635adb4f39bcb7e05acb 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -61,6 +61,7 @@ +@@ -55,6 +55,7 @@ #include "ui/events/keycodes/dom/dom_keyboard_layout_map.h" #include "ui/gfx/geometry/dip_util.h" #include "ui/gfx/mac/coordinate_conversion.h" diff --git a/patches/common/chromium/resource_file_conflict.patch b/patches/common/chromium/resource_file_conflict.patch index 704fa4a501..3989610bb7 100644 --- a/patches/common/chromium/resource_file_conflict.patch +++ b/patches/common/chromium/resource_file_conflict.patch @@ -52,19 +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 b3ebd3da653f731094d1c1a88fdedeccfa9be682..dc0b51a3fd113ba363d1f7944d578fb85d174eb7 100644 +index abbab2664254c9be1ec5074463722c1365590cd0..03c3df58fb407a490ce3438cdc2f4168f3013a8f 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -1634,7 +1634,7 @@ if (is_chrome_branded && !is_android) { - } - } - --if (!is_android) { -+if (!is_android && !is_electron_build) { - chrome_paks("packed_resources") { - if (is_mac) { - output_dir = "$root_gen_dir/repack" -@@ -1658,6 +1658,12 @@ if (!is_android) { +@@ -1646,6 +1646,11 @@ if (is_chrome_branded && !is_android) { } } @@ -72,8 +63,15 @@ index b3ebd3da653f731094d1c1a88fdedeccfa9be682..dc0b51a3fd113ba363d1f7944d578fb8 + group("packed_resources") { + public_deps = [ "//electron:packed_resources" ] + } ++} else { + chrome_paks("packed_resources") { + if (is_mac) { + output_dir = "$root_gen_dir/repack" +@@ -1667,6 +1672,7 @@ chrome_paks("packed_resources") { + ] + } + } +} -+ + repack("browser_tests_pak") { sources = [ - "$root_gen_dir/chrome/webui_test_resources.pak", diff --git a/patches/common/chromium/scroll_bounce_flag.patch b/patches/common/chromium/scroll_bounce_flag.patch index 4e6e3b77fb..962256d610 100644 --- a/patches/common/chromium/scroll_bounce_flag.patch +++ b/patches/common/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 68682fd876dd8a07d2548e32a0ce453ca41a339b..341c74c6247f7cf7b119f4357cb80b0b6a688068 100644 +index f2d704c09e6eb90409d6e8119fe1b7d65f2fbabd..db731036430048f6299c2d735e44a4bccc151579 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1538,7 +1538,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() { +@@ -1528,7 +1528,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() { } bool RenderThreadImpl::IsElasticOverscrollEnabled() { diff --git a/patches/common/chromium/ssl_security_state_tab_helper.patch b/patches/common/chromium/ssl_security_state_tab_helper.patch index b36d0a80d7..4c380d5890 100644 --- a/patches/common/chromium/ssl_security_state_tab_helper.patch +++ b/patches/common/chromium/ssl_security_state_tab_helper.patch @@ -6,10 +6,10 @@ 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 1da4480f5a154920e38754d02e197835f82a94c3..f3b2885793a8f3ba46da9914b97f70fff77fb858 100644 +index aebdb130ba687e0d0c0aa45a08b1820b67d3c25c..fdbeb9cd398eac5659b1dac4af9094c5a5d531f4 100644 --- a/chrome/browser/ssl/security_state_tab_helper.cc +++ b/chrome/browser/ssl/security_state_tab_helper.cc -@@ -13,16 +13,20 @@ +@@ -13,17 +13,23 @@ #include "base/strings/string_util.h" #include "base/time/time.h" #include "build/build_config.h" @@ -22,15 +22,18 @@ index 1da4480f5a154920e38754d02e197835f82a94c3..f3b2885793a8f3ba46da9914b97f70ff #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/secure_origin_whitelist.h" - #include "components/omnibox/browser/omnibox_field_trial.h" #include "components/prefs/pref_service.h" +#if 0 #include "components/safe_browsing/features.h" +#endif #include "components/security_state/content/content_utils.h" ++#if 0 + #include "components/toolbar/toolbar_field_trial.h" ++#endif #include "content/public/browser/browser_context.h" #include "content/public/browser/navigation_entry.h" -@@ -43,7 +47,7 @@ + #include "content/public/browser/navigation_handle.h" +@@ -43,7 +49,7 @@ #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" #endif // defined(OS_CHROMEOS) @@ -39,7 +42,7 @@ index 1da4480f5a154920e38754d02e197835f82a94c3..f3b2885793a8f3ba46da9914b97f70ff #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" #endif -@@ -79,7 +83,9 @@ bool IsOriginSecureWithWhitelist( +@@ -79,7 +85,9 @@ bool IsOriginSecureWithWhitelist( } // namespace @@ -49,7 +52,7 @@ index 1da4480f5a154920e38754d02e197835f82a94c3..f3b2885793a8f3ba46da9914b97f70ff SecurityStateTabHelper::SecurityStateTabHelper( content::WebContents* web_contents) -@@ -87,8 +93,11 @@ SecurityStateTabHelper::SecurityStateTabHelper( +@@ -87,8 +95,11 @@ SecurityStateTabHelper::SecurityStateTabHelper( logged_http_warning_on_current_navigation_(false), is_incognito_(false) { content::BrowserContext* context = web_contents->GetBrowserContext(); @@ -63,7 +66,7 @@ index 1da4480f5a154920e38754d02e197835f82a94c3..f3b2885793a8f3ba46da9914b97f70ff is_incognito_ = true; } } -@@ -173,6 +182,7 @@ void SecurityStateTabHelper::DidFinishNavigation( +@@ -173,6 +184,7 @@ void SecurityStateTabHelper::DidFinishNavigation( UMA_HISTOGRAM_BOOLEAN("interstitial.ssl.visited_site_after_warning", true); } @@ -71,7 +74,7 @@ index 1da4480f5a154920e38754d02e197835f82a94c3..f3b2885793a8f3ba46da9914b97f70ff // Security indicator UI study (https://crbug.com/803501): Show a message in // the console to reduce developer confusion about the experimental UI // treatments for HTTPS pages with EV certificates. -@@ -200,6 +210,7 @@ void SecurityStateTabHelper::DidFinishNavigation( +@@ -200,6 +212,7 @@ void SecurityStateTabHelper::DidFinishNavigation( "Validation is still valid."); } } @@ -79,7 +82,7 @@ index 1da4480f5a154920e38754d02e197835f82a94c3..f3b2885793a8f3ba46da9914b97f70ff } void SecurityStateTabHelper::DidChangeVisibleSecurityState() { -@@ -273,6 +284,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { +@@ -273,6 +286,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { web_contents()->GetController().GetVisibleEntry(); if (!entry) return security_state::MALICIOUS_CONTENT_STATUS_NONE; @@ -87,7 +90,7 @@ index 1da4480f5a154920e38754d02e197835f82a94c3..f3b2885793a8f3ba46da9914b97f70ff safe_browsing::SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); if (!sb_service) -@@ -341,6 +353,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { +@@ -341,6 +355,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { break; } } @@ -95,7 +98,7 @@ index 1da4480f5a154920e38754d02e197835f82a94c3..f3b2885793a8f3ba46da9914b97f70ff return security_state::MALICIOUS_CONTENT_STATUS_NONE; } -@@ -361,15 +374,19 @@ std::vector SecurityStateTabHelper::GetSecureOriginsAndPatterns() +@@ -361,15 +376,19 @@ std::vector SecurityStateTabHelper::GetSecureOriginsAndPatterns() const { const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); diff --git a/patches/common/chromium/support_mixed_sandbox_with_zygote.patch b/patches/common/chromium/support_mixed_sandbox_with_zygote.patch index 9ba38b36b3..dd4c3d15a4 100644 --- a/patches/common/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/common/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,10 +22,10 @@ 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 b5146d9180c970aed912c497aa319969cb563895..fe73adb24cf444a942c7cdd1c1f6d25d869d5277 100644 +index 05e0ee79e5ad..9a4522f59e6f 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -473,6 +473,10 @@ class RendererSandboxedProcessLauncherDelegate +@@ -466,6 +466,10 @@ class RendererSandboxedProcessLauncherDelegate : public SandboxedProcessLauncherDelegate { public: RendererSandboxedProcessLauncherDelegate() {} @@ -36,7 +36,7 @@ index b5146d9180c970aed912c497aa319969cb563895..fe73adb24cf444a942c7cdd1c1f6d25d ~RendererSandboxedProcessLauncherDelegate() override {} -@@ -492,6 +496,9 @@ class RendererSandboxedProcessLauncherDelegate +@@ -485,6 +489,9 @@ class RendererSandboxedProcessLauncherDelegate #if BUILDFLAG(USE_ZYGOTE_HANDLE) service_manager::ZygoteHandle GetZygote() override { @@ -46,7 +46,7 @@ index b5146d9180c970aed912c497aa319969cb563895..fe73adb24cf444a942c7cdd1c1f6d25d const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); base::CommandLine::StringType renderer_prefix = -@@ -505,6 +512,11 @@ class RendererSandboxedProcessLauncherDelegate +@@ -498,6 +505,11 @@ class RendererSandboxedProcessLauncherDelegate service_manager::SandboxType GetSandboxType() override { return service_manager::SANDBOX_TYPE_RENDERER; } @@ -58,7 +58,7 @@ index b5146d9180c970aed912c497aa319969cb563895..fe73adb24cf444a942c7cdd1c1f6d25d }; const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey"; -@@ -1827,11 +1839,18 @@ bool RenderProcessHostImpl::Init() { +@@ -1731,11 +1743,18 @@ bool RenderProcessHostImpl::Init() { cmd_line->PrependWrapper(renderer_prefix); AppendRendererCommandLine(cmd_line.get()); diff --git a/patches/common/chromium/tts.patch b/patches/common/chromium/tts.patch index c4822abf38..fb103b93e8 100644 --- a/patches/common/chromium/tts.patch +++ b/patches/common/chromium/tts.patch @@ -9,12 +9,12 @@ Subject: tts.patch to remove reference to browser context when its signaled for 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 9e071512872c1e9350b29e499a28e3033fa1b95f..905cd40368b029ed546af2fb37b42e6cd8cc1d8e 100644 ---- a/chrome/browser/speech/tts_controller_delegate_impl.cc -+++ b/chrome/browser/speech/tts_controller_delegate_impl.cc -@@ -533,12 +533,14 @@ const PrefService* TtsControllerDelegateImpl::GetPrefService( - const content::Utterance* utterance) { +diff --git a/chrome/browser/speech/tts_controller_impl.cc b/chrome/browser/speech/tts_controller_impl.cc +index 46ea4689a38d1986055058c8bdeef088e732cf79..6156ddb10fba7fe8a1550f45bb364005bd225811 100644 +--- a/chrome/browser/speech/tts_controller_impl.cc ++++ b/chrome/browser/speech/tts_controller_impl.cc +@@ -607,12 +607,14 @@ const PrefService* TtsControllerImpl::GetPrefService( + const Utterance* utterance) { const PrefService* prefs = nullptr; // The utterance->browser_context() is null in tests. +#if 0 @@ -29,7 +29,7 @@ index 9e071512872c1e9350b29e499a28e3033fa1b95f..905cd40368b029ed546af2fb37b42e6c } diff --git a/chrome/browser/speech/tts_message_filter.cc b/chrome/browser/speech/tts_message_filter.cc -index 7ff9a9219beffc015ae8a96303595ee529715819..d2394892c2a0d2b4f88407cd412af143cf40881d 100644 +index 84d2dc145ece4d26c39a338b9a6fcf83a9a3a2da..ab911e1b7d29d675868d1476302d9b6dde7de288 100644 --- a/chrome/browser/speech/tts_message_filter.cc +++ b/chrome/browser/speech/tts_message_filter.cc @@ -10,8 +10,11 @@ @@ -76,7 +76,7 @@ index 7ff9a9219beffc015ae8a96303595ee529715819..d2394892c2a0d2b4f88407cd412af143 browser_context_(browser_context), @@ -26,28 +52,27 @@ TtsMessageFilter::TtsMessageFilter(content::BrowserContext* browser_context) CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - content::TtsController::GetInstance()->AddVoicesChangedDelegate(this); + 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 @@ -117,8 +117,8 @@ index 7ff9a9219beffc015ae8a96303595ee529715819..d2394892c2a0d2b4f88407cd412af143 } } -@@ -211,10 +236,8 @@ void TtsMessageFilter::Cleanup() { - content::TtsController::GetInstance()->RemoveUtteranceEventDelegate(this); +@@ -209,10 +234,8 @@ void TtsMessageFilter::Cleanup() { + TtsController::GetInstance()->RemoveUtteranceEventDelegate(this); } -void TtsMessageFilter::Observe( @@ -132,26 +132,30 @@ index 7ff9a9219beffc015ae8a96303595ee529715819..d2394892c2a0d2b4f88407cd412af143 + browser_context_shutdown_notifier_.reset(); } diff --git a/chrome/browser/speech/tts_message_filter.h b/chrome/browser/speech/tts_message_filter.h -index 2fbbc4b4f2a79eac6b686894f2b6463abe404e50..e02c1af7e002a70df5fa925ba758c7c2379ffac5 100644 +index cc9e2806b5c3942472785bf3a3a32e23d859971d..d21fb42f1aca2906b8d8968bd1a46721fbc55edb 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" +@@ -9,10 +9,9 @@ #include "base/memory/weak_ptr.h" #include "base/synchronization/lock.h" + #include "chrome/browser/speech/tts_controller.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; +-#include "content/public/browser/notification_observer.h" +-#include "content/public/browser/notification_registrar.h" - class TtsMessageFilter : public content::BrowserMessageFilter, -- public content::NotificationObserver, - public content::UtteranceEventDelegate, - public content::VoicesChangedDelegate { + namespace content { + class BrowserContext; +@@ -22,7 +21,6 @@ struct TtsUtteranceRequest; + + class TtsMessageFilter + : public content::BrowserMessageFilter, +- public content::NotificationObserver, + public UtteranceEventDelegate, + public VoicesChangedDelegate { public: -@@ -63,15 +63,13 @@ class TtsMessageFilter : public content::BrowserMessageFilter, +@@ -64,15 +62,13 @@ class TtsMessageFilter // about to be deleted. bool Valid(); diff --git a/patches/common/chromium/web_contents.patch b/patches/common/chromium/web_contents.patch index bcfaf7fafe..d597afa284 100644 --- a/patches/common/chromium/web_contents.patch +++ b/patches/common/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 b7fed5f660c7fcd50f6ca1c583b87f78eed1f40b..51d309ebad100b0f5af3922fa51305141398c34d 100644 +index c9d8ca8da4934497ee71a2c4261a04e0a32d86c5..b50572db02fdd3def70d8c892b043f5db47cafe9 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -1980,6 +1980,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -1993,6 +1993,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 b7fed5f660c7fcd50f6ca1c583b87f78eed1f40b..51d309ebad100b0f5af3922fa5130514 WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -1995,6 +2001,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2008,6 +2014,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { &render_view_host_delegate_view_); } } @@ -90,10 +90,10 @@ index 5de4d7cf8a7a812ad3f6383cd60acbd39135924d..dca9ec76b44be34124a12f453d3c6ecb RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForChildWidget( diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index 060e2194d9eae8ff35e981e0a04ad78f7e35157b..9edc7b536ff4e9fadd1d07a1c9d01e6abd9313ca 100644 +index f26f7e50166310d52fd1c1e45b3d956c28e63074..52735286515c5332c64bca8bf332ae8d65bc7e5c 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h -@@ -73,9 +73,12 @@ class BrowserPluginGuestDelegate; +@@ -74,9 +74,12 @@ class BrowserPluginGuestDelegate; class InterstitialPage; class RenderFrameHost; class RenderViewHost; @@ -106,7 +106,7 @@ index 060e2194d9eae8ff35e981e0a04ad78f7e35157b..9edc7b536ff4e9fadd1d07a1c9d01e6a struct CustomContextMenuContext; struct DropData; struct MHTMLGenerationParams; -@@ -212,6 +215,10 @@ class WebContents : public PageNavigator, +@@ -213,6 +216,10 @@ class WebContents : public PageNavigator, kInitializeAndWarmupRendererProcess, } desired_renderer_state; diff --git a/patches/common/chromium/webgl_context_attributes.patch b/patches/common/chromium/webgl_context_attributes.patch index 6376e49166..289238d5b0 100644 --- a/patches/common/chromium/webgl_context_attributes.patch +++ b/patches/common/chromium/webgl_context_attributes.patch @@ -5,10 +5,10 @@ Subject: webgl_context_attributes.patch diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index d80d269e5cb4ca15c2bc2abfe1e617ee62d37cb1..c1b28e91fdae8ca9a8ccdc87610f3e949c7ce2f9 100644 +index 907fd2f4f8567b828f1a45caa32cbd4dafdcac4e..8eb8b5a763c58da80ab826f629aa33e0d782ad14 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -998,8 +998,10 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider( +@@ -1029,8 +1029,10 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider( attributes.sample_buffers = 0; attributes.bind_generates_resource = false; attributes.enable_raster_interface = web_attributes.enable_raster_interface; @@ -22,10 +22,10 @@ index d80d269e5cb4ca15c2bc2abfe1e617ee62d37cb1..c1b28e91fdae8ca9a8ccdc87610f3e94 attributes.fail_if_major_perf_caveat = web_attributes.fail_if_major_performance_caveat; diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h -index e3f1a22160b6dcc9560574206fe2c1688d3b7c64..097c18726127d20373d4f6d8659589cdb7ae6914 100644 +index 2f57bdd1ef3ee4f81d248fffc6e1e512ed83bb27..f016cfb6d31d0feeb32800fe6bc1c0421bad66e0 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -549,6 +549,7 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -550,6 +550,7 @@ class BLINK_PLATFORM_EXPORT Platform { kWebGPUContextType, // WebGPU context }; struct ContextAttributes { @@ -71,17 +71,17 @@ index 98875e974f51ea77a0adf6f6f304ff97f1f62102..36739547ce2ffda7e6f243f50dab5a63 [OriginTrialEnabled=WebXR] XRDevice compatibleXRDevice = null; }; diff --git a/third_party/blink/renderer/modules/webgl/webgl_context_attribute_helpers.cc b/third_party/blink/renderer/modules/webgl/webgl_context_attribute_helpers.cc -index 121b0fd872631aaef44cac34a6978d053f73813a..47154c76ca990ef582fdcb4f3acc09301a5a75f9 100644 +index 26b4610c87c2a2c38e45e0c3d26b5b52ef1097e4..fa6923ed17aee8d85f4d1d7e27dd17fae619da85 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_context_attribute_helpers.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_context_attribute_helpers.cc -@@ -18,6 +18,7 @@ WebGLContextAttributes* ToWebGLContextAttributes( - result->setAntialias(attrs.antialias); - result->setPremultipliedAlpha(attrs.premultiplied_alpha); - result->setPreserveDrawingBuffer(attrs.preserve_drawing_buffer); -+ result->setPowerPreference(attrs.power_preference); - result->setFailIfMajorPerformanceCaveat( +@@ -18,6 +18,7 @@ WebGLContextAttributes ToWebGLContextAttributes( + result.setAntialias(attrs.antialias); + result.setPremultipliedAlpha(attrs.premultiplied_alpha); + result.setPreserveDrawingBuffer(attrs.preserve_drawing_buffer); ++ result.setPowerPreference(attrs.power_preference); + result.setFailIfMajorPerformanceCaveat( attrs.fail_if_major_performance_caveat); - result->setCompatibleXRDevice( + result.setCompatibleXRDevice( @@ -31,6 +32,7 @@ Platform::ContextAttributes ToPlatformContextAttributes( Platform::ContextType context_type, bool support_own_offscreen_surface) { diff --git a/patches/common/chromium/webview_cross_drag.patch b/patches/common/chromium/webview_cross_drag.patch index 30457d1048..82401c4361 100644 --- a/patches/common/chromium/webview_cross_drag.patch +++ b/patches/common/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 12d8f9bd7cc569f977d8c98608a1a7ee5eaf9844..45cb5a3b0d457f8a0b0ed196d45e665e332a55ed 100644 +index ce5602b1cc38b29aee3ff4c997a00a144ff06789..80c325a98ca749f36752978bf825eca047dc361b 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -620,6 +620,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const { @@ -17,10 +17,10 @@ index 12d8f9bd7cc569f977d8c98608a1a7ee5eaf9844..45cb5a3b0d457f8a0b0ed196d45e665e GetRenderViewHostID(web_contents_->GetRenderViewHost()) != drag_start_view_id_; diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm -index 5bb3b17f12f5b97c50b557782c284fc4b7a2eef5..9f900db28b5c219c6d075f9963499f20d5b49196 100644 +index cec3bd8a97b8b9bcab176a9bd2c296ec12aba838..7a2b4462bd44176e8e8389499f8c3d5fea647fa0 100644 --- a/content/browser/web_contents/web_drag_dest_mac.mm +++ b/content/browser/web_contents/web_drag_dest_mac.mm -@@ -349,6 +349,7 @@ GetRenderWidgetHostAtPoint:(const NSPoint&)viewPoint +@@ -348,6 +348,7 @@ - (void)setDragStartTrackersForProcess:(int)processID { } - (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH { diff --git a/patches/common/chromium/windows_cc_wrapper.patch b/patches/common/chromium/windows_cc_wrapper.patch new file mode 100644 index 0000000000..a400eacc0c --- /dev/null +++ b/patches/common/chromium/windows_cc_wrapper.patch @@ -0,0 +1,52 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: John Kleinschmidt +Date: Thu, 20 Sep 2018 17:49:45 -0700 +Subject: windows_cc_wrapper.patch + +Allow use of cc_wrapper (eg sccache). + +diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn +index 3c6c9d05d2c86adca43a7a71ab6d2634a49fc4d3..da3eb53291aa3978de0ec0a482a5b7ddb57db0f5 100644 +--- a/build/toolchain/win/BUILD.gn ++++ b/build/toolchain/win/BUILD.gn +@@ -6,6 +6,7 @@ import("//build/config/clang/clang.gni") + import("//build/config/compiler/compiler.gni") + import("//build/config/sanitizers/sanitizers.gni") + import("//build/config/win/visual_studio_version.gni") ++import("//build/toolchain/cc_wrapper.gni") + import("//build/toolchain/clang_static_analyzer.gni") + import("//build/toolchain/goma.gni") + import("//build/toolchain/toolchain.gni") +@@ -28,8 +29,14 @@ if (use_goma) { + } else { + goma_prefix = "$goma_dir/gomacc " + } ++ clang_prefix = goma_prefix + } else { + goma_prefix = "" ++ if (cc_wrapper != "") { ++ clang_prefix = cc_wrapper + " " ++ } else { ++ clang_prefix = "" ++ } + } + + # Copy the VS runtime DLL for the default toolchain to the root build directory +@@ -377,7 +384,7 @@ if (win_build_host_cpu != "x64") { + msvc_toolchain("win_clang_" + win_build_host_cpu) { + environment = "environment." + win_build_host_cpu + prefix = rebase_path("$clang_base_path/bin", root_build_dir) +- cl = "${goma_prefix}$prefix/${clang_cl}" ++ cl = "${clang_prefix}$prefix/${clang_cl}" + sys_include_flags = "${build_cpu_toolchain_data.include_flags_imsvc}" + if (host_os != "win") { + # For win cross build. +@@ -426,7 +433,7 @@ template("win_x64_toolchains") { + msvc_toolchain("win_clang_" + target_name) { + environment = "environment.x64" + prefix = rebase_path("$clang_base_path/bin", root_build_dir) +- cl = "${goma_prefix}$prefix/${clang_cl}" ++ cl = "${clang_prefix}$prefix/${clang_cl}" + sys_include_flags = "${x64_toolchain_data.include_flags_imsvc}" + if (host_os != "win") { + # For win cross build diff --git a/patches/common/chromium/worker_context_will_destroy.patch b/patches/common/chromium/worker_context_will_destroy.patch index 3a5be61b5c..5dfc66106a 100644 --- a/patches/common/chromium/worker_context_will_destroy.patch +++ b/patches/common/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 f3bd63d891283422f2ec35a1f5545bfea98001e2..c64e51312f6a90189806ccb88ab525c0919c14b8 100644 +index 3166cbe259daafc8644b0b1a8941160205638046..b8a81f37db6a979cfbda8743fe4db435ad92dc40 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h -@@ -387,6 +387,11 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -392,6 +392,11 @@ class CONTENT_EXPORT ContentRendererClient { virtual void DidInitializeWorkerContextOnWorkerThread( v8::Local context) {} @@ -21,10 +21,10 @@ index f3bd63d891283422f2ec35a1f5545bfea98001e2..c64e51312f6a90189806ccb88ab525c0 // 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 c1b28e91fdae8ca9a8ccdc87610f3e949c7ce2f9..c007cc3c613ad40ca890ae9e3a7099ca33f393ac 100644 +index 8eb8b5a763c58da80ab826f629aa33e0d782ad14..09d638e7e74835b032bfbfb15f9ebbf6f7b7cec7 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -1138,6 +1138,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { +@@ -1176,6 +1176,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread(); } @@ -38,10 +38,10 @@ index c1b28e91fdae8ca9a8ccdc87610f3e949c7ce2f9..c007cc3c613ad40ca890ae9e3a7099ca 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 63e86af7430a0eb73d3bd4451566d5b575f3d465..114c20aa6658b7975adcd18bab9462a44a3f35f1 100644 +index 4ec814fd92c5accf70627d37f4966e3e5270b660..aa405311a4588ad4903f637fc07713bd18b34e68 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -205,6 +205,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -207,6 +207,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 63e86af7430a0eb73d3bd4451566d5b575f3d465..114c20aa6658b7975adcd18bab9462a4 // Disables the WebSandboxSupport implementation for testing. // Tests that do not set up a full sandbox environment should call diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h -index 097c18726127d20373d4f6d8659589cdb7ae6914..7c12ea2646980958e8e1447cf873ef8a23265c0e 100644 +index f016cfb6d31d0feeb32800fe6bc1c0421bad66e0..19761866164e9a20221ce552af7683c77a21f551 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -689,6 +689,7 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -692,6 +692,7 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local& worker) {} @@ -62,10 +62,10 @@ index 097c18726127d20373d4f6d8659589cdb7ae6914..7c12ea2646980958e8e1447cf873ef8a 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 dfe382cdefb4525d47bcb9d0f4deb4bfa309b6dc..a9a858abe454b4101a97fc6dff1de273c7107bb6 100644 +index a231d079da2dc70a1054ea6cd4335bad8b2a0253..9343e83988a5bfd7f83ead484be61ac8c17b1196 100644 --- a/third_party/blink/renderer/core/workers/worker_thread.cc +++ b/third_party/blink/renderer/core/workers/worker_thread.cc -@@ -544,6 +544,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() { +@@ -528,6 +528,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() { SetExitCode(ExitCode::kGracefullyTerminated); } diff --git a/patches/common/config.json b/patches/common/config.json index bfed6e8500..978dbd6636 100644 --- a/patches/common/config.json +++ b/patches/common/config.json @@ -5,7 +5,5 @@ "src/electron/patches/common/ffmpeg": "src/third_party/ffmpeg", - "src/electron/patches/common/swiftshader": "src/third_party/swiftshader", - "src/electron/patches/common/v8": "src/v8" } diff --git a/patches/common/swiftshader/.patches b/patches/common/swiftshader/.patches deleted file mode 100644 index 915dc191f2..0000000000 --- a/patches/common/swiftshader/.patches +++ /dev/null @@ -1 +0,0 @@ -fix_arm64.patch diff --git a/patches/common/swiftshader/fix_arm64.patch b/patches/common/swiftshader/fix_arm64.patch deleted file mode 100644 index 7867ee0515..0000000000 --- a/patches/common/swiftshader/fix_arm64.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Cheng Zhao -Date: Thu Dec 6 02:00:06 2018 +0000 - -Backport fed67899a7b44c9409e94442eaca0deab2f809e3 to fix build on arm64. -https://swiftshader.googlesource.com/SwiftShader.git/+/fed67899a7b44c9409e94442eaca0deab2f809e3%5E%21/ - -Can be removed after updating to Chrome 73. - -diff --git a/src/Reactor/BUILD.gn b/src/Reactor/BUILD.gn -index c983c4361..be5e5055d 100644 ---- a/src/Reactor/BUILD.gn -+++ b/src/Reactor/BUILD.gn -@@ -170,6 +170,9 @@ config("swiftshader_reactor_private_config") { - ] - } else { - cflags = [ "-Wno-unused-local-typedef" ] -+ if(target_cpu == "arm64") { -+ cflags += [ "-Wno-defaulted-function-deleted" ] -+ } - defines = [ - "__STDC_CONSTANT_MACROS", - "__STDC_LIMIT_MACROS", -diff --git a/third_party/llvm-7.0/BUILD.gn b/third_party/llvm-7.0/BUILD.gn -index 4ccc6d15e..f0b3dc807 100644 ---- a/third_party/llvm-7.0/BUILD.gn -+++ b/third_party/llvm-7.0/BUILD.gn -@@ -61,6 +61,10 @@ config("swiftshader_llvm_private_config") { - } - } - -+ if(target_cpu == "arm64") { -+ cflags += [ "-Wno-defaulted-function-deleted" ] -+ } -+ - cflags += [ - "-Wno-attributes", - "-Wno-deprecated-declarations", diff --git a/patches/common/v8/.patches b/patches/common/v8/.patches index 0e07c345a6..ca9e67147b 100644 --- a/patches/common/v8/.patches +++ b/patches/common/v8/.patches @@ -9,6 +9,8 @@ disable-warning-win.patch expose_mksnapshot.patch build-torque-with-x64-toolchain-on-arm.patch do_not_run_arm_arm64_mksnapshot_binaries.patch -reland_don_t_use_v8_initializers_code_in_v8_base.patch deps_provide_more_v8_backwards_compatibility.patch -deps_cherry-pick_88f8fe1_from_upstream_v8.patch +0001-deps-cherry-pick-0483e9a-from-upstream-V8.patch +0002-deps-cherry-pick-b87d408-from-upstream-V8.patch +0003-deps-cherry-pick-073073b-from-upstream-V8.patch +0004-deps-cherry-pick-88f8fe1-from-upstream-V8.patch diff --git a/patches/common/v8/0001-deps-cherry-pick-0483e9a-from-upstream-V8.patch b/patches/common/v8/0001-deps-cherry-pick-0483e9a-from-upstream-V8.patch new file mode 100644 index 0000000000..518b2d6e4d --- /dev/null +++ b/patches/common/v8/0001-deps-cherry-pick-0483e9a-from-upstream-V8.patch @@ -0,0 +1,112 @@ +From 0e090768de1844c493013d5e99bd903928aff2ab Mon Sep 17 00:00:00 2001 +From: Joyee Cheung +Date: Tue, 6 Nov 2018 18:05:48 +0800 +Subject: [PATCH 1/4] deps: cherry-pick 0483e9a from upstream V8 + +Original commit message: + + [api] Allow embedder to construct an Array from Local* + + Currently to obtain a v8::Array out of a C array or a std::vector, + one needs to loop through the elements and call array->Set() multiple + times, and these calls go into v8::Object::Set() which can be slow. + This patch adds a new Array::New overload that converts a + Local* with known size into a Local. + + Change-Id: I0a768f0e18eec51e78d58be455482ec6425ca188 + Reviewed-on: https://chromium-review.googlesource.com/c/1317049 + Reviewed-by: Yang Guo + Reviewed-by: Adam Klein + Commit-Queue: Joyee Cheung + Cr-Commit-Position: refs/heads/master@{#57261} + +Refs: https://github.com/v8/v8/commit/0483e9a9abe77a73632fd85b9c0cd608efa9aa0d + +PR-URL: https://github.com/nodejs/node/pull/24125 +Reviewed-By: Anna Henningsen +Reviewed-By: Yang Guo +Reviewed-By: Gus Caplan +Reviewed-By: Colin Ihrig +Reviewed-By: Ben Noordhuis +Reviewed-By: Refael Ackermann +--- + include/v8.h | 6 ++++++ + src/api.cc | 17 +++++++++++++++++ + test/cctest/test-api.cc | 16 ++++++++++++++++ + 3 files changed, 39 insertions(+) + +diff --git a/include/v8.h b/include/v8.h +index a4bbe1b0c4..9b7be9fb93 100644 +--- a/include/v8.h ++++ b/include/v8.h +@@ -3680,6 +3680,12 @@ class V8_EXPORT Array : public Object { + */ + static Local New(Isolate* isolate, int length = 0); + ++ /** ++ * Creates a JavaScript array out of a Local array in C++ ++ * with a known length. ++ */ ++ static Local New(Isolate* isolate, Local* elements, ++ size_t length); + V8_INLINE static Array* Cast(Value* obj); + private: + Array(); +diff --git a/src/api.cc b/src/api.cc +index 3f62a23d43..4e233d96dc 100644 +--- a/src/api.cc ++++ b/src/api.cc +@@ -6911,6 +6911,23 @@ Local v8::Array::New(Isolate* isolate, int length) { + return Utils::ToLocal(obj); + } + ++Local v8::Array::New(Isolate* isolate, Local* elements, ++ size_t length) { ++ i::Isolate* i_isolate = reinterpret_cast(isolate); ++ i::Factory* factory = i_isolate->factory(); ++ LOG_API(i_isolate, Array, New); ++ ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); ++ int len = static_cast(length); ++ ++ i::Handle result = factory->NewFixedArray(len); ++ for (int i = 0; i < len; i++) { ++ i::Handle element = Utils::OpenHandle(*elements[i]); ++ result->set(i, *element); ++ } ++ ++ return Utils::ToLocal( ++ factory->NewJSArrayWithElements(result, i::PACKED_ELEMENTS, len)); ++} + + uint32_t v8::Array::Length() const { + i::Handle obj = Utils::OpenHandle(this); +diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc +index 9eb73fab7e..0d92508d24 100644 +--- a/test/cctest/test-api.cc ++++ b/test/cctest/test-api.cc +@@ -5225,6 +5225,22 @@ THREADED_TEST(Array) { + CHECK_EQ(27u, array->Length()); + array = v8::Array::New(context->GetIsolate(), -27); + CHECK_EQ(0u, array->Length()); ++ ++ std::vector> vector = {v8_num(1), v8_num(2), v8_num(3)}; ++ array = v8::Array::New(context->GetIsolate(), vector.data(), vector.size()); ++ CHECK_EQ(vector.size(), array->Length()); ++ CHECK_EQ(1, arr->Get(context.local(), 0) ++ .ToLocalChecked() ++ ->Int32Value(context.local()) ++ .FromJust()); ++ CHECK_EQ(2, arr->Get(context.local(), 1) ++ .ToLocalChecked() ++ ->Int32Value(context.local()) ++ .FromJust()); ++ CHECK_EQ(3, arr->Get(context.local(), 2) ++ .ToLocalChecked() ++ ->Int32Value(context.local()) ++ .FromJust()); + } + + +-- +2.14.3 (Apple Git-98) + diff --git a/patches/common/v8/0002-deps-cherry-pick-b87d408-from-upstream-V8.patch b/patches/common/v8/0002-deps-cherry-pick-b87d408-from-upstream-V8.patch new file mode 100644 index 0000000000..275421ed5a --- /dev/null +++ b/patches/common/v8/0002-deps-cherry-pick-b87d408-from-upstream-V8.patch @@ -0,0 +1,136 @@ +From e36e9dde38caf3517890da2265e6dd9f127abe72 Mon Sep 17 00:00:00 2001 +From: Peter Marshall +Date: Fri, 9 Nov 2018 13:06:07 +0100 +Subject: [PATCH 2/4] deps: cherry-pick b87d408 from upstream V8 + +Original commit message: + + [heap-profiler] Fix a use-after-free when snapshots are deleted + + If a caller starts the sampling heap profiler and takes a snapshot, + and then deletes the snapshot before the sampling has completed, a + use-after-free will occur on the StringsStorage pointer. + + The same issue applies for StartTrackingHeapObjects which shares the + same StringsStorage object. + + Bug: v8:8373 + Change-Id: I5d69d60d3f9465f9dd3b3bef107c204e0fda0643 + Reviewed-on: https://chromium-review.googlesource.com/c/1301477 + Commit-Queue: Peter Marshall + Reviewed-by: Alexei Filippov + Cr-Commit-Position: refs/heads/master@{#57114} + +PR-URL: https://github.com/nodejs/node/pull/24272 +Refs: +https://github.com/v8/v8/commit/b87d408f65b9ab49a4d199e850d2358995deaeb2 +Reviewed-By: Colin Ihrig +Reviewed-By: Daniel Bevenius +--- + src/profiler/heap-profiler.cc | 9 ++++++++- + src/profiler/heap-profiler.h | 2 ++ + test/cctest/test-heap-profiler.cc | 42 +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 52 insertions(+), 1 deletion(-) + +diff --git a/src/profiler/heap-profiler.cc b/src/profiler/heap-profiler.cc +index 0978e76cff..58a8f3851f 100644 +--- a/src/profiler/heap-profiler.cc ++++ b/src/profiler/heap-profiler.cc +@@ -23,9 +23,14 @@ HeapProfiler::~HeapProfiler() = default; + + void HeapProfiler::DeleteAllSnapshots() { + snapshots_.clear(); +- names_.reset(new StringsStorage()); ++ MaybeClearStringsStorage(); + } + ++void HeapProfiler::MaybeClearStringsStorage() { ++ if (snapshots_.empty() && !sampling_heap_profiler_ && !allocation_tracker_) { ++ names_.reset(new StringsStorage()); ++ } ++} + + void HeapProfiler::RemoveSnapshot(HeapSnapshot* snapshot) { + snapshots_.erase( +@@ -126,6 +131,7 @@ bool HeapProfiler::StartSamplingHeapProfiler( + + void HeapProfiler::StopSamplingHeapProfiler() { + sampling_heap_profiler_.reset(); ++ MaybeClearStringsStorage(); + } + + +@@ -159,6 +165,7 @@ void HeapProfiler::StopHeapObjectsTracking() { + ids_->StopHeapObjectsTracking(); + if (allocation_tracker_) { + allocation_tracker_.reset(); ++ MaybeClearStringsStorage(); + heap()->RemoveHeapObjectAllocationTracker(this); + } + } +diff --git a/src/profiler/heap-profiler.h b/src/profiler/heap-profiler.h +index acbdc6aa7a..1e3527765e 100644 +--- a/src/profiler/heap-profiler.h ++++ b/src/profiler/heap-profiler.h +@@ -92,6 +92,8 @@ class HeapProfiler : public HeapObjectAllocationTracker { + v8::PersistentValueVector* objects); + + private: ++ void MaybeClearStringsStorage(); ++ + Heap* heap() const; + + // Mapping from HeapObject addresses to objects' uids. +diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc +index 257ef1c723..f3c545fd83 100644 +--- a/test/cctest/test-heap-profiler.cc ++++ b/test/cctest/test-heap-profiler.cc +@@ -3875,3 +3875,45 @@ TEST(WeakReference) { + const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(); + CHECK(ValidateSnapshot(snapshot)); + } ++ ++TEST(Bug8373_1) { ++ LocalContext env; ++ v8::HandleScope scope(env->GetIsolate()); ++ v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); ++ ++ heap_profiler->StartSamplingHeapProfiler(100); ++ ++ heap_profiler->TakeHeapSnapshot(); ++ // Causes the StringsStorage to be deleted. ++ heap_profiler->DeleteAllHeapSnapshots(); ++ ++ // Triggers an allocation sample that tries to use the StringsStorage. ++ for (int i = 0; i < 2 * 1024; ++i) { ++ CompileRun( ++ "new Array(64);" ++ "new Uint8Array(16);"); ++ } ++ ++ heap_profiler->StopSamplingHeapProfiler(); ++} ++ ++TEST(Bug8373_2) { ++ LocalContext env; ++ v8::HandleScope scope(env->GetIsolate()); ++ v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); ++ ++ heap_profiler->StartTrackingHeapObjects(true); ++ ++ heap_profiler->TakeHeapSnapshot(); ++ // Causes the StringsStorage to be deleted. ++ heap_profiler->DeleteAllHeapSnapshots(); ++ ++ // Triggers an allocations that try to use the StringsStorage. ++ for (int i = 0; i < 2 * 1024; ++i) { ++ CompileRun( ++ "new Array(64);" ++ "new Uint8Array(16);"); ++ } ++ ++ heap_profiler->StopTrackingHeapObjects(); ++} +-- +2.14.3 (Apple Git-98) + diff --git a/patches/common/v8/0003-deps-cherry-pick-073073b-from-upstream-V8.patch b/patches/common/v8/0003-deps-cherry-pick-073073b-from-upstream-V8.patch new file mode 100644 index 0000000000..1da5bd0578 --- /dev/null +++ b/patches/common/v8/0003-deps-cherry-pick-073073b-from-upstream-V8.patch @@ -0,0 +1,180 @@ +From d08800799f487c2ab02cf567dca2e4ecfb589b63 Mon Sep 17 00:00:00 2001 +From: Yang Guo +Date: Tue, 20 Nov 2018 09:16:23 +0100 +Subject: [PATCH 3/4] deps: cherry-pick 073073b from upstream V8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Original commit message: + + [profiler] introduce API to enable detailed source positions + + This allows Node.js to enable detailed source positions for optimized code + early on, without having to pass a flag string. + + R=petermarshall@chromium.org + + Change-Id: Ie74ea41f600cf6e31acbe802116df4976ccf1c75 + Reviewed-on: https://chromium-review.googlesource.com/c/1319757 + Commit-Queue: Yang Guo + Reviewed-by: Peter Marshall + Cr-Commit-Position: refs/heads/master@{#57380} + +Refs: https://github.com/v8/v8/commit/073073b4f12b683fc0406cd15b3cb284633fe18e + +PR-URL: https://github.com/nodejs/node/pull/24515 +Refs: https://github.com/nodejs/node/pull/24274 +Refs: https://github.com/nodejs/node/pull/24394 +Refs: https://github.com/nodejs/node/issues/24393 +Reviewed-By: Michaël Zasso +Reviewed-By: Joyee Cheung +Reviewed-By: Peter Marshall +Reviewed-By: James M Snell +Reviewed-By: Refael Ackermann +--- + include/v8-profiler.h | 6 +++++ + src/api.cc | 5 ++++ + src/isolate.cc | 3 ++- + src/isolate.h | 3 ++- + test/cctest/test-cpu-profiler.cc | 56 ++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 71 insertions(+), 2 deletions(-) + +diff --git a/include/v8-profiler.h b/include/v8-profiler.h +index c034518def..f30688582d 100644 +--- a/include/v8-profiler.h ++++ b/include/v8-profiler.h +@@ -341,6 +341,12 @@ class V8_EXPORT CpuProfiler { + V8_DEPRECATED("Use Isolate::SetIdle(bool) instead.", + void SetIdle(bool is_idle)); + ++ /** ++ * Generate more detailed source positions to code objects. This results in ++ * better results when mapping profiling samples to script source. ++ */ ++ static void UseDetailedSourcePositionsForProfiling(Isolate* isolate); ++ + private: + CpuProfiler(); + ~CpuProfiler(); +diff --git a/src/api.cc b/src/api.cc +index 4e233d96dc..161538638b 100644 +--- a/src/api.cc ++++ b/src/api.cc +@@ -10112,6 +10112,11 @@ void CpuProfiler::SetIdle(bool is_idle) { + isolate->SetIdle(is_idle); + } + ++void CpuProfiler::UseDetailedSourcePositionsForProfiling(Isolate* isolate) { ++ reinterpret_cast(isolate) ++ ->set_detailed_source_positions_for_profiling(true); ++} ++ + uintptr_t CodeEvent::GetCodeStartAddress() { + return reinterpret_cast(this)->code_start_address; + } +diff --git a/src/isolate.cc b/src/isolate.cc +index 94033f446b..e6a9e95a2f 100644 +--- a/src/isolate.cc ++++ b/src/isolate.cc +@@ -3461,7 +3461,8 @@ bool Isolate::use_optimizer() { + } + + bool Isolate::NeedsDetailedOptimizedCodeLineInfo() const { +- return NeedsSourcePositionsForProfiling() || FLAG_detailed_line_info; ++ return NeedsSourcePositionsForProfiling() || ++ detailed_source_positions_for_profiling(); + } + + bool Isolate::NeedsSourcePositionsForProfiling() const { +diff --git a/src/isolate.h b/src/isolate.h +index ad124586cc..c25f143cf8 100644 +--- a/src/isolate.h ++++ b/src/isolate.h +@@ -540,7 +540,8 @@ typedef std::vector DebugObjectCache; + V(int, last_console_context_id, 0) \ + V(v8_inspector::V8Inspector*, inspector, nullptr) \ + V(bool, next_v8_call_is_safe_for_termination, false) \ +- V(bool, only_terminate_in_safe_scope, false) ++ V(bool, only_terminate_in_safe_scope, false) \ ++ V(bool, detailed_source_positions_for_profiling, FLAG_detailed_line_info) + + #define THREAD_LOCAL_TOP_ACCESSOR(type, name) \ + inline void set_##name(type v) { thread_local_top_.name##_ = v; } \ +diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc +index 75af3f6d98..e08bec375e 100644 +--- a/test/cctest/test-cpu-profiler.cc ++++ b/test/cctest/test-cpu-profiler.cc +@@ -40,6 +40,7 @@ + #include "src/objects-inl.h" + #include "src/profiler/cpu-profiler-inl.h" + #include "src/profiler/profiler-listener.h" ++#include "src/source-position-table.h" + #include "src/utils.h" + #include "test/cctest/cctest.h" + #include "test/cctest/profiler-extension.h" +@@ -2544,6 +2545,61 @@ TEST(MultipleProfilers) { + profiler2->StopProfiling("2"); + } + ++int GetSourcePositionEntryCount(i::Isolate* isolate, const char* source) { ++ i::Handle function = i::Handle::cast( ++ v8::Utils::OpenHandle(*CompileRun(source))); ++ if (function->IsInterpreted()) return -1; ++ i::Handle code(function->code(), isolate); ++ i::SourcePositionTableIterator iterator( ++ ByteArray::cast(code->source_position_table())); ++ int count = 0; ++ while (!iterator.done()) { ++ count++; ++ iterator.Advance(); ++ } ++ return count; ++} ++ ++UNINITIALIZED_TEST(DetailedSourcePositionAPI) { ++ i::FLAG_detailed_line_info = false; ++ i::FLAG_allow_natives_syntax = true; ++ v8::Isolate::CreateParams create_params; ++ create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); ++ v8::Isolate* isolate = v8::Isolate::New(create_params); ++ ++ const char* source = ++ "function fib(i) {" ++ " if (i <= 1) return 1; " ++ " return fib(i - 1) +" ++ " fib(i - 2);" ++ "}" ++ "fib(5);" ++ "%OptimizeFunctionOnNextCall(fib);" ++ "fib(5);" ++ "fib"; ++ { ++ v8::Isolate::Scope isolate_scope(isolate); ++ v8::HandleScope handle_scope(isolate); ++ v8::Local context = v8::Context::New(isolate); ++ v8::Context::Scope context_scope(context); ++ i::Isolate* i_isolate = reinterpret_cast(isolate); ++ ++ CHECK(!i_isolate->NeedsDetailedOptimizedCodeLineInfo()); ++ ++ int non_detailed_positions = GetSourcePositionEntryCount(i_isolate, source); ++ ++ v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate); ++ CHECK(i_isolate->NeedsDetailedOptimizedCodeLineInfo()); ++ ++ int detailed_positions = GetSourcePositionEntryCount(i_isolate, source); ++ ++ CHECK((non_detailed_positions == -1 && detailed_positions == -1) || ++ non_detailed_positions < detailed_positions); ++ } ++ ++ isolate->Dispose(); ++} ++ + } // namespace test_cpu_profiler + } // namespace internal + } // namespace v8 +-- +2.14.3 (Apple Git-98) + diff --git a/patches/common/v8/deps_cherry-pick_88f8fe1_from_upstream_v8.patch b/patches/common/v8/0004-deps-cherry-pick-88f8fe1-from-upstream-V8.patch similarity index 69% rename from patches/common/v8/deps_cherry-pick_88f8fe1_from_upstream_v8.patch rename to patches/common/v8/0004-deps-cherry-pick-88f8fe1-from-upstream-V8.patch index 96fe6d157e..ba162d994d 100644 --- a/patches/common/v8/deps_cherry-pick_88f8fe1_from_upstream_v8.patch +++ b/patches/common/v8/0004-deps-cherry-pick-88f8fe1-from-upstream-V8.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 3d6d9749c273d8bbd19508a9f294cfedf44d01e2 Mon Sep 17 00:00:00 2001 From: Yang Guo Date: Tue, 20 Nov 2018 08:59:38 +0100 -Subject: deps: cherry-pick 88f8fe1 from upstream V8 +Subject: [PATCH 4/4] deps: cherry-pick 88f8fe1 from upstream V8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -33,13 +33,104 @@ Reviewed-By: Michaël Zasso Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: Joyee Cheung +--- + src/api.cc | 52 ++++++------ + test/cctest/test-api.cc | 214 ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 241 insertions(+), 25 deletions(-) +diff --git a/src/api.cc b/src/api.cc +index 161538638b..64676f06c1 100644 +--- a/src/api.cc ++++ b/src/api.cc +@@ -7033,30 +7033,30 @@ i::Handle MapAsArray(i::Isolate* isolate, i::Object* table_obj, + i::Factory* factory = isolate->factory(); + i::Handle table(i::OrderedHashMap::cast(table_obj), + isolate); +- if (offset >= table->NumberOfElements()) return factory->NewJSArray(0); +- int length = (table->NumberOfElements() - offset) * +- (kind == MapAsArrayKind::kEntries ? 2 : 1); +- i::Handle result = factory->NewFixedArray(length); ++ const bool collect_keys = ++ kind == MapAsArrayKind::kEntries || kind == MapAsArrayKind::kKeys; ++ const bool collect_values = ++ kind == MapAsArrayKind::kEntries || kind == MapAsArrayKind::kValues; ++ int capacity = table->UsedCapacity(); ++ int max_length = ++ (capacity - offset) * ((collect_keys && collect_values) ? 2 : 1); ++ i::Handle result = factory->NewFixedArray(max_length); + int result_index = 0; + { + i::DisallowHeapAllocation no_gc; +- int capacity = table->UsedCapacity(); + i::Oddball* the_hole = i::ReadOnlyRoots(isolate).the_hole_value(); +- for (int i = 0; i < capacity; ++i) { ++ for (int i = offset; i < capacity; ++i) { + i::Object* key = table->KeyAt(i); + if (key == the_hole) continue; +- if (offset-- > 0) continue; +- if (kind == MapAsArrayKind::kEntries || kind == MapAsArrayKind::kKeys) { +- result->set(result_index++, key); +- } +- if (kind == MapAsArrayKind::kEntries || kind == MapAsArrayKind::kValues) { +- result->set(result_index++, table->ValueAt(i)); +- } ++ if (collect_keys) result->set(result_index++, key); ++ if (collect_values) result->set(result_index++, table->ValueAt(i)); + } + } +- DCHECK_EQ(result_index, result->length()); +- DCHECK_EQ(result_index, length); +- return factory->NewJSArrayWithElements(result, i::PACKED_ELEMENTS, length); ++ DCHECK_GE(max_length, result_index); ++ if (result_index == 0) return factory->NewJSArray(0); ++ result->Shrink(isolate, result_index); ++ return factory->NewJSArrayWithElements(result, i::PACKED_ELEMENTS, ++ result_index); + } + + } // namespace +@@ -7141,24 +7141,26 @@ i::Handle SetAsArray(i::Isolate* isolate, i::Object* table_obj, + i::Factory* factory = isolate->factory(); + i::Handle table(i::OrderedHashSet::cast(table_obj), + isolate); +- int length = table->NumberOfElements() - offset; +- if (length <= 0) return factory->NewJSArray(0); +- i::Handle result = factory->NewFixedArray(length); ++ // Elements skipped by |offset| may already be deleted. ++ int capacity = table->UsedCapacity(); ++ int max_length = capacity - offset; ++ if (max_length == 0) return factory->NewJSArray(0); ++ i::Handle result = factory->NewFixedArray(max_length); + int result_index = 0; + { + i::DisallowHeapAllocation no_gc; +- int capacity = table->UsedCapacity(); + i::Oddball* the_hole = i::ReadOnlyRoots(isolate).the_hole_value(); +- for (int i = 0; i < capacity; ++i) { ++ for (int i = offset; i < capacity; ++i) { + i::Object* key = table->KeyAt(i); + if (key == the_hole) continue; +- if (offset-- > 0) continue; + result->set(result_index++, key); + } + } +- DCHECK_EQ(result_index, result->length()); +- DCHECK_EQ(result_index, length); +- return factory->NewJSArrayWithElements(result, i::PACKED_ELEMENTS, length); ++ DCHECK_GE(max_length, result_index); ++ if (result_index == 0) return factory->NewJSArray(0); ++ result->Shrink(isolate, result_index); ++ return factory->NewJSArrayWithElements(result, i::PACKED_ELEMENTS, ++ result_index); + } + } // namespace + diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc -index b49202d6127083e1d642f39ec149ce2261061ea7..dd56f7cd985db38820c94fd41b2f7f24a01e1811 100644 +index 0d92508d24..9bf7870f75 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc -@@ -29364,3 +29364,217 @@ TEST(PreviewMapIteratorEntriesWithDeleted) { - } +@@ -28852,3 +28852,217 @@ TEST(TestGetEmbeddedCodeRange) { + CHECK_EQ(0, builtins_range.length_in_bytes); } } + @@ -256,3 +347,6 @@ index b49202d6127083e1d642f39ec149ce2261061ea7..dd56f7cd985db38820c94fd41b2f7f24 + } + } +} +-- +2.14.3 (Apple Git-98) + diff --git a/patches/common/v8/add_realloc.patch b/patches/common/v8/add_realloc.patch index 7ec3560c89..d94e918690 100644 --- a/patches/common/v8/add_realloc.patch +++ b/patches/common/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 03677d7af202d665c704dd771603322321b508cc..83b9d3d0d1f981edc444452b500df9fa5b89a056 100644 +index a4bbe1b0c43d665a6b6c4e6c46205c32eac9548b..b2301cd8d07c1ef57e77cedab920a43f0b498597 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -4526,6 +4526,13 @@ class V8_EXPORT ArrayBuffer : public Object { +@@ -4486,6 +4486,13 @@ class V8_EXPORT ArrayBuffer : public Object { */ virtual void* AllocateUninitialized(size_t length) = 0; @@ -30,10 +30,10 @@ index 03677d7af202d665c704dd771603322321b508cc..83b9d3d0d1f981edc444452b500df9fa * 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.cc b/src/api.cc -index 1d993044db4a969209a90c1b1f9e88d82531a538..9ddef27b9f7004fb50290f0dd91d2994d9771466 100644 +index 3f62a23d43c1c82c273e379e78fd0a4292cf4a20..2863b73e0677b666040766fef638abbc6fc95b8c 100644 --- a/src/api.cc +++ b/src/api.cc -@@ -507,6 +507,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { +@@ -488,6 +488,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { i::V8::SetSnapshotBlob(snapshot_blob); } diff --git a/patches/common/v8/array_buffer.patch b/patches/common/v8/array_buffer.patch index 571df4569e..45a6abd017 100644 --- a/patches/common/v8/array_buffer.patch +++ b/patches/common/v8/array_buffer.patch @@ -5,10 +5,10 @@ Subject: array_buffer.patch diff --git a/include/v8.h b/include/v8.h -index 83b9d3d0d1f981edc444452b500df9fa5b89a056..6ebadc3b85b0f954305bc3a9187b996aa248a347 100644 +index b2301cd8d07c1ef57e77cedab920a43f0b498597..6934a9c3838641446fa96a8ab48abed4cfc1841c 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -7661,6 +7661,9 @@ class V8_EXPORT Isolate { +@@ -7653,6 +7653,9 @@ class V8_EXPORT Isolate { */ void SetIdle(bool is_idle); @@ -19,10 +19,10 @@ index 83b9d3d0d1f981edc444452b500df9fa5b89a056..6ebadc3b85b0f954305bc3a9187b996a bool InContext(); diff --git a/src/api.cc b/src/api.cc -index 9ddef27b9f7004fb50290f0dd91d2994d9771466..b4a0f5bb5e484ea80dbfc234e207b44413f2d22f 100644 +index 2863b73e0677b666040766fef638abbc6fc95b8c..8d83474bcd0ed257b8f387d7996085c605326236 100644 --- a/src/api.cc +++ b/src/api.cc -@@ -8072,6 +8072,13 @@ void Isolate::SetIdle(bool is_idle) { +@@ -7984,6 +7984,13 @@ void Isolate::SetIdle(bool is_idle) { isolate->SetIdle(is_idle); } @@ -35,4 +35,4 @@ index 9ddef27b9f7004fb50290f0dd91d2994d9771466..b4a0f5bb5e484ea80dbfc234e207b444 + bool Isolate::InContext() { i::Isolate* isolate = reinterpret_cast(this); - return !isolate->context().is_null(); + return isolate->context() != nullptr; diff --git a/patches/common/v8/build-torque-with-x64-toolchain-on-arm.patch b/patches/common/v8/build-torque-with-x64-toolchain-on-arm.patch index f67f3afd74..acde23279b 100644 --- a/patches/common/v8/build-torque-with-x64-toolchain-on-arm.patch +++ b/patches/common/v8/build-torque-with-x64-toolchain-on-arm.patch @@ -6,11 +6,11 @@ Subject: build-torque-with-x64-toolchain-on-arm.patch torque binary has to be run during the build. diff --git a/BUILD.gn b/BUILD.gn -index b47a698a2f41f221290861c938c15a38e34d7b00..c564baea42f22d727990752be8b4ed086ef273f2 100644 +index d40848056235b9a8307533c8b1e238aecf18207d..d8db6363b8560b5c4a1595437e59edf1c6ec3974 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -190,7 +190,8 @@ declare_args() { - +@@ -170,7 +170,8 @@ declare_args() { + v8_generator_toolchain = v8_snapshot_toolchain if (host_cpu == "x64" && - (v8_current_cpu == "mips" || v8_current_cpu == "mips64")) { @@ -18,20 +18,20 @@ index b47a698a2f41f221290861c938c15a38e34d7b00..c564baea42f22d727990752be8b4ed08 + v8_current_cpu == "arm" || v8_current_cpu == "arm64")) { v8_generator_toolchain = "//build/toolchain/linux:clang_x64" } - -@@ -3446,7 +3447,7 @@ if (v8_monolithic) { + +@@ -3340,7 +3341,7 @@ if (v8_monolithic) { # Executables # - + -if (current_toolchain == v8_generator_toolchain) { +if (current_toolchain == current_toolchain) { v8_executable("bytecode_builtins_list_generator") { visibility = [ ":*" ] # Only targets in this file can depend on this. - -@@ -3492,7 +3493,7 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { + +@@ -3384,7 +3385,7 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { } } - + -if (current_toolchain == v8_snapshot_toolchain) { +if (current_toolchain == current_toolchain) { v8_executable("torque") { diff --git a/patches/common/v8/build_gn.patch b/patches/common/v8/build_gn.patch index 2576c336e8..1d3a821235 100644 --- a/patches/common/v8/build_gn.patch +++ b/patches/common/v8/build_gn.patch @@ -5,19 +5,19 @@ Subject: build_gn.patch diff --git a/BUILD.gn b/BUILD.gn -index 3c039428271d6598fc4ad7137334176d80b92631..9fe1e8d67a25955fea69be89e0bcc27cf5d8529d 100644 +index 83f1fdb0bf75dd5f7efa490cd5bd1221e31748ed..5489b943f1d8bb8ffc02cabf4e0a15788c7d4e48 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -242,7 +242,7 @@ config("internal_config") { +@@ -226,7 +226,7 @@ config("internal_config") { - configs = [ "//build/config/compiler:wexit_time_destructors" ] + defines = [] - if (is_component_build) { + if (is_component_build || is_electron_build) { - defines = [ "BUILDING_V8_SHARED" ] + defines += [ "BUILDING_V8_SHARED" ] } } -@@ -3481,6 +3481,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { +@@ -3363,6 +3363,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { configs = [ ":internal_config" ] diff --git a/patches/common/v8/dcheck.patch b/patches/common/v8/dcheck.patch index 2637ee54c5..b40447c828 100644 --- a/patches/common/v8/dcheck.patch +++ b/patches/common/v8/dcheck.patch @@ -5,10 +5,10 @@ Subject: dcheck.patch diff --git a/src/api.cc b/src/api.cc -index b4a0f5bb5e484ea80dbfc234e207b44413f2d22f..f36e504161fed27392ef66ffc0ec87898958bf2d 100644 +index 8d83474bcd0ed257b8f387d7996085c605326236..9be405b6c4822da81e48daf96169450be3e4356f 100644 --- a/src/api.cc +++ b/src/api.cc -@@ -8637,7 +8637,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { +@@ -8540,7 +8540,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { void Isolate::RunMicrotasks() { @@ -18,10 +18,10 @@ index b4a0f5bb5e484ea80dbfc234e207b44413f2d22f..f36e504161fed27392ef66ffc0ec8789 } diff --git a/src/heap/heap.cc b/src/heap/heap.cc -index 98a3ec8cbcf63f1446569d6458d1f4f4bdda2ca0..316b0e123af68ea0c7a50730ba04470a42918974 100644 +index b509d211425fc755f8cecd4727c050d47d7f87f7..36e5023a77b46305b70196cf3c25a8c625dae96b 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc -@@ -4723,9 +4723,9 @@ void Heap::TearDown() { +@@ -4696,9 +4696,9 @@ void Heap::TearDown() { void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback, GCType gc_type, void* data) { DCHECK_NOT_NULL(callback); diff --git a/patches/common/v8/deps_backport_detailed_line_info_for_cpu_profiler.patch b/patches/common/v8/deps_backport_detailed_line_info_for_cpu_profiler.patch index c5a9092270..0346893291 100644 --- a/patches/common/v8/deps_backport_detailed_line_info_for_cpu_profiler.patch +++ b/patches/common/v8/deps_backport_detailed_line_info_for_cpu_profiler.patch @@ -20,10 +20,10 @@ Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater diff --git a/src/flag-definitions.h b/src/flag-definitions.h -index add6d1f4114118b199425ff6b835a286ade5e1ce..38f25aef81c026cd80d663d75250ce16034e3eb3 100644 +index 170a777c724e9daca0aee44b63455ade724426e9..5a7664474f15fa9a466c536d2ac554e8f485b32d 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h -@@ -1270,7 +1270,7 @@ DEFINE_BOOL(log_function_events, false, +@@ -1266,7 +1266,7 @@ DEFINE_BOOL(log_function_events, false, DEFINE_BOOL(prof, false, "Log statistical profiling information (implies --log-code).") diff --git a/patches/common/v8/deps_provide_more_v8_backwards_compatibility.patch b/patches/common/v8/deps_provide_more_v8_backwards_compatibility.patch index 6937a239af..a51af7ce0b 100644 --- a/patches/common/v8/deps_provide_more_v8_backwards_compatibility.patch +++ b/patches/common/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 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720a93d08b2 100644 +index 6934a9c3838641446fa96a8ab48abed4cfc1841c..2ab60e2ceebf0648ff5b58f5d9909e0bf000585f 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -998,6 +998,10 @@ class V8_EXPORT PrimitiveArray { +@@ -999,6 +999,10 @@ class V8_EXPORT PrimitiveArray { public: static Local New(Isolate* isolate, int length); int Length() const; @@ -36,7 +36,7 @@ index 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 void Set(Isolate* isolate, int index, Local item); Local Get(Isolate* isolate, int index); }; -@@ -1705,6 +1709,8 @@ class V8_EXPORT StackTrace { +@@ -1710,6 +1714,8 @@ class V8_EXPORT StackTrace { /** * Returns a StackFrame at a particular index. */ @@ -45,7 +45,7 @@ index 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 Local GetFrame(Isolate* isolate, uint32_t index) const; /** -@@ -2428,6 +2434,13 @@ class V8_EXPORT Value : public Data { +@@ -2423,6 +2429,13 @@ class V8_EXPORT Value : public Data { V8_DEPRECATE_SOON("Use maybe version", Local ToInt32(Isolate* isolate) const); @@ -59,7 +59,7 @@ index 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 /** * Attempts to convert a string to an array index. * Returns an empty handle if the conversion fails. -@@ -2447,7 +2460,14 @@ class V8_EXPORT Value : public Data { +@@ -2442,7 +2455,14 @@ class V8_EXPORT Value : public Data { Local context) const; V8_WARN_UNUSED_RESULT Maybe Int32Value(Local context) const; @@ -74,7 +74,7 @@ index 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 V8_WARN_UNUSED_RESULT Maybe Equals(Local context, Local that) const; bool StrictEquals(Local that) const; -@@ -2554,6 +2574,8 @@ class V8_EXPORT String : public Name { +@@ -2549,6 +2569,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 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 int Utf8Length(Isolate* isolate) const; /** -@@ -2610,12 +2632,23 @@ class V8_EXPORT String : public Name { +@@ -2605,12 +2627,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 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 /** * A zero length string. -@@ -2807,6 +2840,9 @@ class V8_EXPORT String : public Name { +@@ -2812,6 +2845,9 @@ class V8_EXPORT String : public Name { */ static Local Concat(Isolate* isolate, Local left, Local right); @@ -117,7 +117,7 @@ index 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 /** * Creates a new external string using the data defined in the given -@@ -2875,6 +2911,8 @@ class V8_EXPORT String : public Name { +@@ -2880,6 +2916,8 @@ class V8_EXPORT String : public Name { */ class V8_EXPORT Utf8Value { public: @@ -126,7 +126,7 @@ index 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 Utf8Value(Isolate* isolate, Local obj); ~Utf8Value(); char* operator*() { return str_; } -@@ -2898,6 +2936,7 @@ class V8_EXPORT String : public Name { +@@ -2903,6 +2941,7 @@ class V8_EXPORT String : public Name { */ class V8_EXPORT Value { public: @@ -134,7 +134,7 @@ index 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 Value(Isolate* isolate, Local obj); ~Value(); uint16_t* operator*() { return str_; } -@@ -5180,6 +5219,8 @@ class V8_EXPORT BooleanObject : public Object { +@@ -5140,6 +5179,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 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 Local ValueOf() const; -@@ -10045,6 +10086,30 @@ template Value* Value::Cast(T* value) { +@@ -9999,6 +10040,30 @@ template Value* Value::Cast(T* value) { } @@ -175,10 +175,10 @@ index 6ebadc3b85b0f954305bc3a9187b996aa248a347..955ea03cddf77ae5bbd91ea74b851720 #ifdef V8_ENABLE_CHECKS CheckCast(value); diff --git a/src/api.cc b/src/api.cc -index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7d892d0cc 100644 +index 9be405b6c4822da81e48daf96169450be3e4356f..f34a63cb528ea619896957009922b0a0ee576616 100644 --- a/src/api.cc +++ b/src/api.cc -@@ -2167,6 +2167,10 @@ int PrimitiveArray::Length() const { +@@ -2162,6 +2162,10 @@ int PrimitiveArray::Length() const { return array->length(); } @@ -189,7 +189,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 void PrimitiveArray::Set(Isolate* v8_isolate, int index, Local item) { i::Isolate* isolate = reinterpret_cast(v8_isolate); -@@ -2180,6 +2184,10 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index, +@@ -2175,6 +2179,10 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index, array->set(index, *i_item); } @@ -200,7 +200,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 Local PrimitiveArray::Get(Isolate* v8_isolate, int index) { i::Isolate* isolate = reinterpret_cast(v8_isolate); i::Handle array = Utils::OpenHandle(this); -@@ -2901,6 +2909,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) { +@@ -2909,6 +2917,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) { // --- S t a c k T r a c e --- @@ -211,7 +211,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 Local StackTrace::GetFrame(Isolate* v8_isolate, uint32_t index) const { i::Isolate* isolate = reinterpret_cast(v8_isolate); -@@ -3880,6 +3892,36 @@ void v8::RegExp::CheckCast(v8::Value* that) { +@@ -3888,6 +3900,36 @@ void v8::RegExp::CheckCast(v8::Value* that) { } @@ -248,7 +248,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 Maybe Value::BooleanValue(Local context) const { i::Isolate* isolate = reinterpret_cast(context->GetIsolate()); return Just(Utils::OpenHandle(this)->BooleanValue(isolate)); -@@ -3968,6 +4010,12 @@ MaybeLocal Value::ToArrayIndex(Local context) const { +@@ -3976,6 +4018,12 @@ MaybeLocal Value::ToArrayIndex(Local context) const { } @@ -261,7 +261,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 Maybe Value::Equals(Local context, Local that) const { i::Isolate* isolate = Utils::OpenHandle(*context)->GetIsolate(); auto self = Utils::OpenHandle(this); -@@ -5302,6 +5350,10 @@ bool String::ContainsOnlyOneByte() const { +@@ -5312,6 +5360,10 @@ bool String::ContainsOnlyOneByte() const { return helper.Check(*str); } @@ -272,7 +272,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 int String::Utf8Length(Isolate* isolate) const { i::Handle str = Utils::OpenHandle(this); str = i::String::Flatten(reinterpret_cast(isolate), str); -@@ -5525,6 +5577,14 @@ static bool RecursivelySerializeToUtf8(i::String current, +@@ -5535,6 +5587,14 @@ static bool RecursivelySerializeToUtf8(i::String* current, return true; } @@ -287,7 +287,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 int String::WriteUtf8(Isolate* v8_isolate, char* buffer, int capacity, int* nchars_ref, int options) const { i::Handle str = Utils::OpenHandle(this); -@@ -5592,6 +5652,18 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string, +@@ -5602,6 +5662,18 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string, } @@ -306,7 +306,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 int String::WriteOneByte(Isolate* isolate, uint8_t* buffer, int start, int length, int options) const { return WriteHelper(reinterpret_cast(isolate), this, buffer, -@@ -6553,6 +6625,11 @@ MaybeLocal String::NewFromTwoByte(Isolate* isolate, +@@ -6549,6 +6621,11 @@ MaybeLocal String::NewFromTwoByte(Isolate* isolate, return result; } @@ -318,7 +318,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 Local v8::String::Concat(Isolate* v8_isolate, Local left, Local right) { i::Isolate* isolate = reinterpret_cast(v8_isolate); -@@ -6841,6 +6918,11 @@ bool v8::BooleanObject::ValueOf() const { +@@ -6774,6 +6851,11 @@ bool v8::BooleanObject::ValueOf() const { } @@ -330,7 +330,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 Local v8::StringObject::New(Isolate* v8_isolate, Local value) { i::Handle string = Utils::OpenHandle(*value); -@@ -9024,6 +9106,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8Isolate) { +@@ -8915,6 +8997,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8Isolate) { return isolate->IsRunningMicrotasks(); } @@ -340,7 +340,7 @@ index f36e504161fed27392ef66ffc0ec87898958bf2d..0f2e56c05736d15bc637feb9fb53bdc7 String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local obj) : str_(nullptr), length_(0) { if (obj.IsEmpty()) return; -@@ -9043,6 +9128,9 @@ String::Utf8Value::~Utf8Value() { +@@ -8934,6 +9019,9 @@ String::Utf8Value::~Utf8Value() { i::DeleteArray(str_); } diff --git a/patches/common/v8/do_not_run_arm_arm64_mksnapshot_binaries.patch b/patches/common/v8/do_not_run_arm_arm64_mksnapshot_binaries.patch index 775e451569..83e68fbb68 100644 --- a/patches/common/v8/do_not_run_arm_arm64_mksnapshot_binaries.patch +++ b/patches/common/v8/do_not_run_arm_arm64_mksnapshot_binaries.patch @@ -10,10 +10,10 @@ Electron does, so this patch makes sure that the build doesn't try to run the mksnapshot binary if it was built for arm or arm64. diff --git a/BUILD.gn b/BUILD.gn -index c564baea42f22d727990752be8b4ed086ef273f2..e3c8390c299e4c12e4ddba8402ccdb050e7bb6f1 100644 +index 1f9dd022ac804e58263f527af5a47768c882de40..d40848056235b9a8307533c8b1e238aecf18207d 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -1349,9 +1349,19 @@ if (v8_use_snapshot && v8_use_external_startup_data) { +@@ -1286,9 +1286,19 @@ if (v8_use_snapshot && v8_use_external_startup_data) { ] public_deps = [ ":natives_blob", diff --git a/patches/common/v8/export_platform.patch b/patches/common/v8/export_platform.patch index d790551c88..e0cf08d5d4 100644 --- a/patches/common/v8/export_platform.patch +++ b/patches/common/v8/export_platform.patch @@ -6,7 +6,7 @@ Subject: export_platform.patch v8::Platform::SystemClockTimeMillis must be exported so that node::NodePlatform can call it diff --git a/include/v8-platform.h b/include/v8-platform.h -index b9b0363a426de898c7db29a341f7179c45706f0a..48fba7921fd17eec79c569ab3c9173f084743218 100644 +index d983c30249591bd05b760dbae6a1afb413c7d021..183d77e55619970644868747fab26d250f790c3c 100644 --- a/include/v8-platform.h +++ b/include/v8-platform.h @@ -11,6 +11,7 @@ @@ -17,7 +17,7 @@ index b9b0363a426de898c7db29a341f7179c45706f0a..48fba7921fd17eec79c569ab3c9173f0 #include "v8config.h" // NOLINT(build/include) namespace v8 { -@@ -421,7 +422,7 @@ class Platform { +@@ -394,7 +395,7 @@ class Platform { * since epoch. Useful for implementing |CurrentClockTimeMillis| if * nothing special needed. */ diff --git a/patches/common/v8/expose_mksnapshot.patch b/patches/common/v8/expose_mksnapshot.patch index 724186b093..6244457746 100644 --- a/patches/common/v8/expose_mksnapshot.patch +++ b/patches/common/v8/expose_mksnapshot.patch @@ -6,15 +6,15 @@ Subject: expose_mksnapshot.patch Needed in order to build mksnapshot on arm. diff --git a/BUILD.gn b/BUILD.gn -index 9fe1e8d67a25955fea69be89e0bcc27cf5d8529d..b47a698a2f41f221290861c938c15a38e34d7b00 100644 +index 5489b943f1d8bb8ffc02cabf4e0a15788c7d4e48..1f9dd022ac804e58263f527af5a47768c882de40 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -3471,8 +3471,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -3355,8 +3355,6 @@ if (current_toolchain == v8_generator_toolchain) { if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { - visibility = [ ":*" ] # Only targets in this file can depend on this. - sources = [ - "src/snapshot/embedded-file-writer.cc", - "src/snapshot/embedded-file-writer.h", + "src/snapshot/mksnapshot.cc", + ] diff --git a/patches/common/v8/reland_don_t_use_v8_initializers_code_in_v8_base.patch b/patches/common/v8/reland_don_t_use_v8_initializers_code_in_v8_base.patch deleted file mode 100644 index 8e3a8dcd71..0000000000 --- a/patches/common/v8/reland_don_t_use_v8_initializers_code_in_v8_base.patch +++ /dev/null @@ -1,719 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Alexander Timokhin -Date: Thu, 13 Dec 2018 12:46:59 +0300 -Subject: Reland "Don't use |v8_initializers| code in |v8_base|" - -This is a reland of 2e36e9ea1ef3e332bc9b2d620c6d6ceb054f58a6 - -Was reverted because of v8_presubmit.py issue in -https://chromium-review.googlesource.com/c/v8/v8/+/1374292 - -Original change's description: -> Don't use |v8_initializers| code in |v8_base| -> -> Removing |CodeStubAssembler| from |v8_base| source list (see -> https://chromium-review.googlesource.com/c/v8/v8/+/1346329) leads to -> linkage problems with some build configurations because it was explicitly -> and implicitly included in |v8_base| code. -> -> This CL decouple this code and fixes problems. -> -> Bug: v8:7777 -> Change-Id: I58de5c62914bc77645ed6cc9114409890bc13189 -> Reviewed-on: https://chromium-review.googlesource.com/c/1372067 -> Reviewed-by: Jakob Kummerow -> Reviewed-by: Benedikt Meurer -> Reviewed-by: Jakob Gruber -> Commit-Queue: Jakob Gruber -> Cr-Commit-Position: refs/heads/master@{#58200} - -Bug: v8:7777 -Change-Id: Iaa00e73c7dbd8c413fbf15a17709aa12eda9a706 -Reviewed-on: https://chromium-review.googlesource.com/c/1375654 -Reviewed-by: Benedikt Meurer -Reviewed-by: Jakob Gruber -Commit-Queue: Jakob Gruber -Cr-Commit-Position: refs/heads/master@{#58209} - -diff --git a/BUILD.gn b/BUILD.gn -index e3c8390c299e4c12e4ddba8402ccdb050e7bb6f1..06c9a98f6888eff6c0794e0b83682e04abdbf1d7 100644 ---- a/BUILD.gn -+++ b/BUILD.gn -@@ -1722,6 +1722,7 @@ v8_source_set("v8_base") { - "src/builtins/builtins-number.cc", - "src/builtins/builtins-object.cc", - "src/builtins/builtins-promise.cc", -+ "src/builtins/builtins-promise.h", - "src/builtins/builtins-reflect.cc", - "src/builtins/builtins-regexp.cc", - "src/builtins/builtins-sharedarraybuffer.cc", -diff --git a/src/builtins/builtins-date.cc b/src/builtins/builtins-date.cc -index b2e054d6a2efe039c3eb622467adfdff72f582f1..8635eefd21cba5065f9c60e266575f983449dd0f 100644 ---- a/src/builtins/builtins-date.cc -+++ b/src/builtins/builtins-date.cc -@@ -5,7 +5,6 @@ - #include "src/builtins/builtins-utils-inl.h" - #include "src/builtins/builtins.h" - #include "src/code-factory.h" --#include "src/code-stub-assembler.h" - #include "src/conversions.h" - #include "src/counters.h" - #include "src/date.h" -diff --git a/src/builtins/builtins-object.cc b/src/builtins/builtins-object.cc -index 5ab929a7a19edbf270f0dff518323003c3103baf..2b55abbc127c527ebd423e48fed23d51613a8302 100644 ---- a/src/builtins/builtins-object.cc -+++ b/src/builtins/builtins-object.cc -@@ -5,7 +5,6 @@ - #include "src/builtins/builtins-utils-inl.h" - #include "src/builtins/builtins.h" - #include "src/code-factory.h" --#include "src/code-stub-assembler.h" - #include "src/counters.h" - #include "src/keys.h" - #include "src/lookup.h" -diff --git a/src/builtins/builtins-promise-gen.cc b/src/builtins/builtins-promise-gen.cc -index 22f643e36df8addfcf65c98cc5004e514307f9d3..051b9d8bf82df0713df05c73e2c6677da74bd7ed 100644 ---- a/src/builtins/builtins-promise-gen.cc -+++ b/src/builtins/builtins-promise-gen.cc -@@ -6,6 +6,7 @@ - - #include "src/builtins/builtins-constructor-gen.h" - #include "src/builtins/builtins-iterator-gen.h" -+#include "src/builtins/builtins-promise.h" - #include "src/builtins/builtins-utils-gen.h" - #include "src/builtins/builtins.h" - #include "src/code-factory.h" -@@ -210,14 +211,17 @@ Node* PromiseBuiltinsAssembler::CreatePromiseAllResolveElementContext( - TNode values_array = AllocateJSArray( - PACKED_ELEMENTS, array_map, IntPtrConstant(0), SmiConstant(0)); - -- Node* const context = -- CreatePromiseContext(native_context, kPromiseAllResolveElementLength); -+ Node* const context = CreatePromiseContext( -+ native_context, PromiseBuiltins::kPromiseAllResolveElementLength); - StoreContextElementNoWriteBarrier( -- context, kPromiseAllResolveElementRemainingSlot, SmiConstant(1)); -+ context, PromiseBuiltins::kPromiseAllResolveElementRemainingSlot, -+ SmiConstant(1)); - StoreContextElementNoWriteBarrier( -- context, kPromiseAllResolveElementCapabilitySlot, promise_capability); -+ context, PromiseBuiltins::kPromiseAllResolveElementCapabilitySlot, -+ promise_capability); - StoreContextElementNoWriteBarrier( -- context, kPromiseAllResolveElementValuesArraySlot, values_array); -+ context, PromiseBuiltins::kPromiseAllResolveElementValuesArraySlot, -+ values_array); - - return context; - } -@@ -245,20 +249,22 @@ Node* PromiseBuiltinsAssembler::CreatePromiseAllResolveElementFunction( - - Node* PromiseBuiltinsAssembler::CreatePromiseResolvingFunctionsContext( - Node* promise, Node* debug_event, Node* native_context) { -- Node* const context = -- CreatePromiseContext(native_context, kPromiseContextLength); -- StoreContextElementNoWriteBarrier(context, kPromiseSlot, promise); -- StoreContextElementNoWriteBarrier(context, kAlreadyResolvedSlot, -- FalseConstant()); -- StoreContextElementNoWriteBarrier(context, kDebugEventSlot, debug_event); -+ Node* const context = CreatePromiseContext( -+ native_context, PromiseBuiltins::kPromiseContextLength); -+ StoreContextElementNoWriteBarrier(context, PromiseBuiltins::kPromiseSlot, -+ promise); -+ StoreContextElementNoWriteBarrier( -+ context, PromiseBuiltins::kAlreadyResolvedSlot, FalseConstant()); -+ StoreContextElementNoWriteBarrier(context, PromiseBuiltins::kDebugEventSlot, -+ debug_event); - return context; - } - - Node* PromiseBuiltinsAssembler::CreatePromiseGetCapabilitiesExecutorContext( - Node* promise_capability, Node* native_context) { -- int kContextLength = kCapabilitiesContextLength; -+ int kContextLength = PromiseBuiltins::kCapabilitiesContextLength; - Node* context = CreatePromiseContext(native_context, kContextLength); -- StoreContextElementNoWriteBarrier(context, kCapabilitySlot, -+ StoreContextElementNoWriteBarrier(context, PromiseBuiltins::kCapabilitySlot, - promise_capability); - return context; - } -@@ -750,22 +756,24 @@ TF_BUILTIN(PromiseCapabilityDefaultReject, PromiseBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - - // 2. Let promise be F.[[Promise]]. -- Node* const promise = LoadContextElement(context, kPromiseSlot); -+ Node* const promise = -+ LoadContextElement(context, PromiseBuiltins::kPromiseSlot); - - // 3. Let alreadyResolved be F.[[AlreadyResolved]]. - Label if_already_resolved(this, Label::kDeferred); - Node* const already_resolved = -- LoadContextElement(context, kAlreadyResolvedSlot); -+ LoadContextElement(context, PromiseBuiltins::kAlreadyResolvedSlot); - - // 4. If alreadyResolved.[[Value]] is true, return undefined. - GotoIf(IsTrue(already_resolved), &if_already_resolved); - - // 5. Set alreadyResolved.[[Value]] to true. -- StoreContextElementNoWriteBarrier(context, kAlreadyResolvedSlot, -- TrueConstant()); -+ StoreContextElementNoWriteBarrier( -+ context, PromiseBuiltins::kAlreadyResolvedSlot, TrueConstant()); - - // 6. Return RejectPromise(promise, reason). -- Node* const debug_event = LoadContextElement(context, kDebugEventSlot); -+ Node* const debug_event = -+ LoadContextElement(context, PromiseBuiltins::kDebugEventSlot); - Return(CallBuiltin(Builtins::kRejectPromise, context, promise, reason, - debug_event)); - -@@ -782,19 +790,20 @@ TF_BUILTIN(PromiseCapabilityDefaultResolve, PromiseBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - - // 2. Let promise be F.[[Promise]]. -- Node* const promise = LoadContextElement(context, kPromiseSlot); -+ Node* const promise = -+ LoadContextElement(context, PromiseBuiltins::kPromiseSlot); - - // 3. Let alreadyResolved be F.[[AlreadyResolved]]. - Label if_already_resolved(this, Label::kDeferred); - Node* const already_resolved = -- LoadContextElement(context, kAlreadyResolvedSlot); -+ LoadContextElement(context, PromiseBuiltins::kAlreadyResolvedSlot); - - // 4. If alreadyResolved.[[Value]] is true, return undefined. - GotoIf(IsTrue(already_resolved), &if_already_resolved); - - // 5. Set alreadyResolved.[[Value]] to true. -- StoreContextElementNoWriteBarrier(context, kAlreadyResolvedSlot, -- TrueConstant()); -+ StoreContextElementNoWriteBarrier( -+ context, PromiseBuiltins::kAlreadyResolvedSlot, TrueConstant()); - - // The rest of the logic (and the catch prediction) is - // encapsulated in the dedicated ResolvePromise builtin. -@@ -1396,7 +1405,8 @@ TF_BUILTIN(PromiseGetCapabilitiesExecutor, PromiseBuiltinsAssembler) { - Node* const reject = Parameter(Descriptor::kReject); - Node* const context = Parameter(Descriptor::kContext); - -- Node* const capability = LoadContextElement(context, kCapabilitySlot); -+ Node* const capability = -+ LoadContextElement(context, PromiseBuiltins::kCapabilitySlot); - - Label if_alreadyinvoked(this, Label::kDeferred); - GotoIfNot(IsUndefined( -@@ -1464,12 +1474,12 @@ TF_BUILTIN(PromiseReject, PromiseBuiltinsAssembler) { - - std::pair PromiseBuiltinsAssembler::CreatePromiseFinallyFunctions( - Node* on_finally, Node* constructor, Node* native_context) { -- Node* const promise_context = -- CreatePromiseContext(native_context, kPromiseFinallyContextLength); -- StoreContextElementNoWriteBarrier(promise_context, kOnFinallySlot, -- on_finally); -- StoreContextElementNoWriteBarrier(promise_context, kConstructorSlot, -- constructor); -+ Node* const promise_context = CreatePromiseContext( -+ native_context, PromiseBuiltins::kPromiseFinallyContextLength); -+ StoreContextElementNoWriteBarrier( -+ promise_context, PromiseBuiltins::kOnFinallySlot, on_finally); -+ StoreContextElementNoWriteBarrier( -+ promise_context, PromiseBuiltins::kConstructorSlot, constructor); - Node* const map = LoadContextElement( - native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX); - Node* const then_finally_info = LoadContextElement( -@@ -1486,15 +1496,16 @@ std::pair PromiseBuiltinsAssembler::CreatePromiseFinallyFunctions( - TF_BUILTIN(PromiseValueThunkFinally, PromiseBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - -- Node* const value = LoadContextElement(context, kValueSlot); -+ Node* const value = LoadContextElement(context, PromiseBuiltins::kValueSlot); - Return(value); - } - - Node* PromiseBuiltinsAssembler::CreateValueThunkFunction(Node* value, - Node* native_context) { - Node* const value_thunk_context = CreatePromiseContext( -- native_context, kPromiseValueThunkOrReasonContextLength); -- StoreContextElementNoWriteBarrier(value_thunk_context, kValueSlot, value); -+ native_context, PromiseBuiltins::kPromiseValueThunkOrReasonContextLength); -+ StoreContextElementNoWriteBarrier(value_thunk_context, -+ PromiseBuiltins::kValueSlot, value); - Node* const map = LoadContextElement( - native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX); - Node* const value_thunk_info = LoadContextElement( -@@ -1511,7 +1522,8 @@ TF_BUILTIN(PromiseThenFinally, PromiseBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - - // 1. Let onFinally be F.[[OnFinally]]. -- Node* const on_finally = LoadContextElement(context, kOnFinallySlot); -+ Node* const on_finally = -+ LoadContextElement(context, PromiseBuiltins::kOnFinallySlot); - - // 2. Assert: IsCallable(onFinally) is true. - CSA_ASSERT(this, IsCallable(on_finally)); -@@ -1522,7 +1534,8 @@ TF_BUILTIN(PromiseThenFinally, PromiseBuiltinsAssembler) { - context, on_finally, UndefinedConstant()); - - // 4. Let C be F.[[Constructor]]. -- Node* const constructor = LoadContextElement(context, kConstructorSlot); -+ Node* const constructor = -+ LoadContextElement(context, PromiseBuiltins::kConstructorSlot); - - // 5. Assert: IsConstructor(C) is true. - CSA_ASSERT(this, IsConstructor(constructor)); -@@ -1542,7 +1555,7 @@ TF_BUILTIN(PromiseThenFinally, PromiseBuiltinsAssembler) { - TF_BUILTIN(PromiseThrowerFinally, PromiseBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - -- Node* const reason = LoadContextElement(context, kValueSlot); -+ Node* const reason = LoadContextElement(context, PromiseBuiltins::kValueSlot); - CallRuntime(Runtime::kThrow, context, reason); - Unreachable(); - } -@@ -1550,8 +1563,9 @@ TF_BUILTIN(PromiseThrowerFinally, PromiseBuiltinsAssembler) { - Node* PromiseBuiltinsAssembler::CreateThrowerFunction(Node* reason, - Node* native_context) { - Node* const thrower_context = CreatePromiseContext( -- native_context, kPromiseValueThunkOrReasonContextLength); -- StoreContextElementNoWriteBarrier(thrower_context, kValueSlot, reason); -+ native_context, PromiseBuiltins::kPromiseValueThunkOrReasonContextLength); -+ StoreContextElementNoWriteBarrier(thrower_context, -+ PromiseBuiltins::kValueSlot, reason); - Node* const map = LoadContextElement( - native_context, Context::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX); - Node* const thrower_info = LoadContextElement( -@@ -1568,7 +1582,8 @@ TF_BUILTIN(PromiseCatchFinally, PromiseBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - - // 1. Let onFinally be F.[[OnFinally]]. -- Node* const on_finally = LoadContextElement(context, kOnFinallySlot); -+ Node* const on_finally = -+ LoadContextElement(context, PromiseBuiltins::kOnFinallySlot); - - // 2. Assert: IsCallable(onFinally) is true. - CSA_ASSERT(this, IsCallable(on_finally)); -@@ -1579,7 +1594,8 @@ TF_BUILTIN(PromiseCatchFinally, PromiseBuiltinsAssembler) { - context, on_finally, UndefinedConstant()); - - // 4. Let C be F.[[Constructor]]. -- Node* const constructor = LoadContextElement(context, kConstructorSlot); -+ Node* const constructor = -+ LoadContextElement(context, PromiseBuiltins::kConstructorSlot); - - // 5. Assert: IsConstructor(C) is true. - CSA_ASSERT(this, IsConstructor(constructor)); -@@ -1908,9 +1924,11 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll( - // Set remainingElementsCount.[[Value]] to - // remainingElementsCount.[[Value]] + 1. - TNode const remaining_elements_count = CAST(LoadContextElement( -- resolve_element_context, kPromiseAllResolveElementRemainingSlot)); -+ resolve_element_context, -+ PromiseBuiltins::kPromiseAllResolveElementRemainingSlot)); - StoreContextElementNoWriteBarrier( -- resolve_element_context, kPromiseAllResolveElementRemainingSlot, -+ resolve_element_context, -+ PromiseBuiltins::kPromiseAllResolveElementRemainingSlot, - SmiAdd(remaining_elements_count, SmiConstant(1))); - - // Let resolveElement be CreateBuiltinFunction(steps, -@@ -2027,11 +2045,13 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll( - // Set remainingElementsCount.[[Value]] to - // remainingElementsCount.[[Value]] - 1. - TNode remaining_elements_count = CAST(LoadContextElement( -- resolve_element_context, kPromiseAllResolveElementRemainingSlot)); -+ resolve_element_context, -+ PromiseBuiltins::kPromiseAllResolveElementRemainingSlot)); - remaining_elements_count = SmiSub(remaining_elements_count, SmiConstant(1)); -- StoreContextElementNoWriteBarrier(resolve_element_context, -- kPromiseAllResolveElementRemainingSlot, -- remaining_elements_count); -+ StoreContextElementNoWriteBarrier( -+ resolve_element_context, -+ PromiseBuiltins::kPromiseAllResolveElementRemainingSlot, -+ remaining_elements_count); - GotoIf(SmiEqual(remaining_elements_count, SmiConstant(0)), - &resolve_promise); - -@@ -2040,7 +2060,8 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll( - // fancy Thenable that calls the resolve callback immediately, so we need - // to handle that correctly here. - Node* const values_array = LoadContextElement( -- resolve_element_context, kPromiseAllResolveElementValuesArraySlot); -+ resolve_element_context, -+ PromiseBuiltins::kPromiseAllResolveElementValuesArraySlot); - Node* const old_elements = LoadElements(values_array); - TNode const old_capacity = LoadFixedArrayBaseLength(old_elements); - TNode const new_capacity = var_index.value(); -@@ -2063,7 +2084,8 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll( - Node* const resolve = - LoadObjectField(capability, PromiseCapability::kResolveOffset); - Node* const values_array = LoadContextElement( -- resolve_element_context, kPromiseAllResolveElementValuesArraySlot); -+ resolve_element_context, -+ PromiseBuiltins::kPromiseAllResolveElementValuesArraySlot); - Node* const resolve_call = CallJS( - CodeFactory::Call(isolate(), ConvertReceiverMode::kNullOrUndefined), - native_context, resolve, UndefinedConstant(), values_array); -@@ -2146,9 +2168,10 @@ TF_BUILTIN(PromiseAllResolveElementClosure, PromiseBuiltinsAssembler) { - // first time, in which case we make it point to the native context here - // to mark this resolve element closure as done. - GotoIf(IsNativeContext(context), &already_called); -- CSA_ASSERT(this, -- SmiEqual(LoadObjectField(context, Context::kLengthOffset), -- SmiConstant(kPromiseAllResolveElementLength))); -+ CSA_ASSERT( -+ this, -+ SmiEqual(LoadObjectField(context, Context::kLengthOffset), -+ SmiConstant(PromiseBuiltins::kPromiseAllResolveElementLength))); - TNode native_context = LoadNativeContext(context); - StoreObjectField(function, JSFunction::kContextOffset, native_context); - -@@ -2161,8 +2184,8 @@ TF_BUILTIN(PromiseAllResolveElementClosure, PromiseBuiltinsAssembler) { - TNode index = IntPtrSub(identity_hash, IntPtrConstant(1)); - - // Check if we need to grow the [[ValuesArray]] to store {value} at {index}. -- TNode values_array = CAST( -- LoadContextElement(context, kPromiseAllResolveElementValuesArraySlot)); -+ TNode values_array = CAST(LoadContextElement( -+ context, PromiseBuiltins::kPromiseAllResolveElementValuesArraySlot)); - TNode elements = CAST(LoadElements(values_array)); - TNode values_length = - LoadAndUntagObjectField(values_array, JSArray::kLengthOffset); -@@ -2221,17 +2244,18 @@ TF_BUILTIN(PromiseAllResolveElementClosure, PromiseBuiltinsAssembler) { - } - - BIND(&done); -- TNode remaining_elements_count = -- CAST(LoadContextElement(context, kPromiseAllResolveElementRemainingSlot)); -+ TNode remaining_elements_count = CAST(LoadContextElement( -+ context, PromiseBuiltins::kPromiseAllResolveElementRemainingSlot)); - remaining_elements_count = SmiSub(remaining_elements_count, SmiConstant(1)); -- StoreContextElement(context, kPromiseAllResolveElementRemainingSlot, -+ StoreContextElement(context, -+ PromiseBuiltins::kPromiseAllResolveElementRemainingSlot, - remaining_elements_count); - GotoIf(SmiEqual(remaining_elements_count, SmiConstant(0)), &resolve_promise); - Return(UndefinedConstant()); - - BIND(&resolve_promise); -- TNode capability = CAST( -- LoadContextElement(context, kPromiseAllResolveElementCapabilitySlot)); -+ TNode capability = CAST(LoadContextElement( -+ context, PromiseBuiltins::kPromiseAllResolveElementCapabilitySlot)); - TNode resolve = - LoadObjectField(capability, PromiseCapability::kResolveOffset); - CallJS(CodeFactory::Call(isolate(), ConvertReceiverMode::kNullOrUndefined), -diff --git a/src/builtins/builtins-promise-gen.h b/src/builtins/builtins-promise-gen.h -index 435f1adc87b2393c0c7a4142bb946f50940d256e..8edc2331a51ad08f19b9e470a5e76a4d78cd69f5 100644 ---- a/src/builtins/builtins-promise-gen.h -+++ b/src/builtins/builtins-promise-gen.h -@@ -6,7 +6,6 @@ - #define V8_BUILTINS_BUILTINS_PROMISE_GEN_H_ - - #include "src/code-stub-assembler.h" --#include "src/contexts.h" - #include "src/objects/promise.h" - #include "torque-generated/builtins-base-from-dsl-gen.h" - #include "torque-generated/builtins-iterator-from-dsl-gen.h" -@@ -18,59 +17,6 @@ typedef compiler::CodeAssemblerState CodeAssemblerState; - - class PromiseBuiltinsAssembler : public CodeStubAssembler { - public: -- enum PromiseResolvingFunctionContextSlot { -- // The promise which resolve/reject callbacks fulfill. -- kPromiseSlot = Context::MIN_CONTEXT_SLOTS, -- -- // Whether the callback was already invoked. -- kAlreadyResolvedSlot, -- -- // Whether to trigger a debug event or not. Used in catch -- // prediction. -- kDebugEventSlot, -- kPromiseContextLength, -- }; -- -- // TODO(bmeurer): Move this to a proper context map in contexts.h? -- // Similar to the AwaitContext that we introduced for await closures. -- enum PromiseAllResolveElementContextSlots { -- // Remaining elements count -- kPromiseAllResolveElementRemainingSlot = Context::MIN_CONTEXT_SLOTS, -- -- // Promise capability from Promise.all -- kPromiseAllResolveElementCapabilitySlot, -- -- // Values array from Promise.all -- kPromiseAllResolveElementValuesArraySlot, -- -- kPromiseAllResolveElementLength -- }; -- -- enum FunctionContextSlot { -- kCapabilitySlot = Context::MIN_CONTEXT_SLOTS, -- -- kCapabilitiesContextLength, -- }; -- -- // This is used by the Promise.prototype.finally builtin to store -- // onFinally callback and the Promise constructor. -- // TODO(gsathya): For native promises we can create a variant of -- // this without extra space for the constructor to save memory. -- enum PromiseFinallyContextSlot { -- kOnFinallySlot = Context::MIN_CONTEXT_SLOTS, -- kConstructorSlot, -- -- kPromiseFinallyContextLength, -- }; -- -- // This is used by the ThenFinally and CatchFinally builtins to -- // store the value to return or reason to throw. -- enum PromiseValueThunkOrReasonContextSlot { -- kValueSlot = Context::MIN_CONTEXT_SLOTS, -- -- kPromiseValueThunkOrReasonContextLength, -- }; -- - explicit PromiseBuiltinsAssembler(compiler::CodeAssemblerState* state) - : CodeStubAssembler(state) {} - // These allocate and initialize a promise with pending state and -diff --git a/src/builtins/builtins-promise.cc b/src/builtins/builtins-promise.cc -index 88d54b26d0295e25ffb57f154dcfeb353e46d04f..0f18d8fb459b9d256648870706118a751012b01a 100644 ---- a/src/builtins/builtins-promise.cc -+++ b/src/builtins/builtins-promise.cc -@@ -2,6 +2,8 @@ - // Use of this source code is governed by a BSD-style license that can be - // found in the LICENSE file. - -+#include "src/builtins/builtins-promise.h" -+ - #include "src/builtins/builtins-utils-inl.h" - #include "src/builtins/builtins.h" - #include "src/counters.h" -diff --git a/src/builtins/builtins-promise.h b/src/builtins/builtins-promise.h -new file mode 100644 -index 0000000000000000000000000000000000000000..66545feafed2099992a0fa57aada74298e634994 ---- /dev/null -+++ b/src/builtins/builtins-promise.h -@@ -0,0 +1,75 @@ -+// Copyright 2018 the V8 project 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 V8_BUILTINS_BUILTINS_PROMISE_H_ -+#define V8_BUILTINS_BUILTINS_PROMISE_H_ -+ -+#include "src/contexts.h" -+ -+namespace v8 { -+namespace internal { -+ -+class PromiseBuiltins { -+ public: -+ enum PromiseResolvingFunctionContextSlot { -+ // The promise which resolve/reject callbacks fulfill. -+ kPromiseSlot = Context::MIN_CONTEXT_SLOTS, -+ -+ // Whether the callback was already invoked. -+ kAlreadyResolvedSlot, -+ -+ // Whether to trigger a debug event or not. Used in catch -+ // prediction. -+ kDebugEventSlot, -+ kPromiseContextLength, -+ }; -+ -+ // TODO(bmeurer): Move this to a proper context map in contexts.h? -+ // Similar to the AwaitContext that we introduced for await closures. -+ enum PromiseAllResolveElementContextSlots { -+ // Remaining elements count -+ kPromiseAllResolveElementRemainingSlot = Context::MIN_CONTEXT_SLOTS, -+ -+ // Promise capability from Promise.all -+ kPromiseAllResolveElementCapabilitySlot, -+ -+ // Values array from Promise.all -+ kPromiseAllResolveElementValuesArraySlot, -+ -+ kPromiseAllResolveElementLength -+ }; -+ -+ enum FunctionContextSlot { -+ kCapabilitySlot = Context::MIN_CONTEXT_SLOTS, -+ -+ kCapabilitiesContextLength, -+ }; -+ -+ // This is used by the Promise.prototype.finally builtin to store -+ // onFinally callback and the Promise constructor. -+ // TODO(gsathya): For native promises we can create a variant of -+ // this without extra space for the constructor to save memory. -+ enum PromiseFinallyContextSlot { -+ kOnFinallySlot = Context::MIN_CONTEXT_SLOTS, -+ kConstructorSlot, -+ -+ kPromiseFinallyContextLength, -+ }; -+ -+ // This is used by the ThenFinally and CatchFinally builtins to -+ // store the value to return or reason to throw. -+ enum PromiseValueThunkOrReasonContextSlot { -+ kValueSlot = Context::MIN_CONTEXT_SLOTS, -+ -+ kPromiseValueThunkOrReasonContextLength, -+ }; -+ -+ private: -+ DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseBuiltins); -+}; -+ -+} // namespace internal -+} // namespace v8 -+ -+#endif // V8_BUILTINS_BUILTINS_PROMISE_H_ -diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc -index 131b50b53e67d9cdb47e20ed570875cda84c0ba7..d5985d2cdc5a50a2f38012cef5291f6b6dde0154 100644 ---- a/src/compiler/js-call-reducer.cc -+++ b/src/compiler/js-call-reducer.cc -@@ -5,7 +5,7 @@ - #include "src/compiler/js-call-reducer.h" - - #include "src/api-inl.h" --#include "src/builtins/builtins-promise-gen.h" -+#include "src/builtins/builtins-promise.h" - #include "src/builtins/builtins-utils.h" - #include "src/code-factory.h" - #include "src/code-stubs.h" -@@ -5607,21 +5607,20 @@ Reduction JSCallReducer::ReducePromiseConstructor(Node* node) { - Node* promise_context = effect = graph()->NewNode( - javascript()->CreateFunctionContext( - handle(native_context().object()->scope_info(), isolate()), -- PromiseBuiltinsAssembler::kPromiseContextLength - -- Context::MIN_CONTEXT_SLOTS, -+ PromiseBuiltins::kPromiseContextLength - Context::MIN_CONTEXT_SLOTS, - FUNCTION_SCOPE), - context, effect, control); -- effect = -- graph()->NewNode(simplified()->StoreField(AccessBuilder::ForContextSlot( -- PromiseBuiltinsAssembler::kPromiseSlot)), -- promise_context, promise, effect, control); - effect = graph()->NewNode( -- simplified()->StoreField(AccessBuilder::ForContextSlot( -- PromiseBuiltinsAssembler::kAlreadyResolvedSlot)), -+ simplified()->StoreField( -+ AccessBuilder::ForContextSlot(PromiseBuiltins::kPromiseSlot)), -+ promise_context, promise, effect, control); -+ effect = graph()->NewNode( -+ simplified()->StoreField( -+ AccessBuilder::ForContextSlot(PromiseBuiltins::kAlreadyResolvedSlot)), - promise_context, jsgraph()->FalseConstant(), effect, control); - effect = graph()->NewNode( -- simplified()->StoreField(AccessBuilder::ForContextSlot( -- PromiseBuiltinsAssembler::kDebugEventSlot)), -+ simplified()->StoreField( -+ AccessBuilder::ForContextSlot(PromiseBuiltins::kDebugEventSlot)), - promise_context, jsgraph()->TrueConstant(), effect, control); - - // Allocate the closure for the resolve case. -@@ -5927,18 +5926,18 @@ Reduction JSCallReducer::ReducePromisePrototypeFinally(Node* node) { - context = etrue = graph()->NewNode( - javascript()->CreateFunctionContext( - handle(native_context().object()->scope_info(), isolate()), -- PromiseBuiltinsAssembler::kPromiseFinallyContextLength - -+ PromiseBuiltins::kPromiseFinallyContextLength - - Context::MIN_CONTEXT_SLOTS, - FUNCTION_SCOPE), - context, etrue, if_true); -- etrue = -- graph()->NewNode(simplified()->StoreField(AccessBuilder::ForContextSlot( -- PromiseBuiltinsAssembler::kOnFinallySlot)), -- context, on_finally, etrue, if_true); -- etrue = -- graph()->NewNode(simplified()->StoreField(AccessBuilder::ForContextSlot( -- PromiseBuiltinsAssembler::kConstructorSlot)), -- context, constructor, etrue, if_true); -+ etrue = graph()->NewNode( -+ simplified()->StoreField( -+ AccessBuilder::ForContextSlot(PromiseBuiltins::kOnFinallySlot)), -+ context, on_finally, etrue, if_true); -+ etrue = graph()->NewNode( -+ simplified()->StoreField( -+ AccessBuilder::ForContextSlot(PromiseBuiltins::kConstructorSlot)), -+ context, constructor, etrue, if_true); - - // Allocate the closure for the reject case. - SharedFunctionInfoRef catch_finally = -diff --git a/src/isolate.cc b/src/isolate.cc -index a3e93d0da3dd8054a04ea15edc2c7511972f7136..44dc67d22452e4153d44edc81f26c13eb96d2920 100644 ---- a/src/isolate.cc -+++ b/src/isolate.cc -@@ -22,7 +22,7 @@ - #include "src/base/sys-info.h" - #include "src/base/utils/random-number-generator.h" - #include "src/bootstrapper.h" --#include "src/builtins/builtins-promise-gen.h" -+#include "src/builtins/builtins-promise.h" - #include "src/builtins/constants-table-builder.h" - #include "src/cancelable-task.h" - #include "src/code-stubs.h" -@@ -774,7 +774,7 @@ void CaptureAsyncStackTrace(Isolate* isolate, Handle promise, - // find the promise capability that's being resolved when all - // the concurrent promises resolve. - int const index = -- PromiseBuiltinsAssembler::kPromiseAllResolveElementCapabilitySlot; -+ PromiseBuiltins::kPromiseAllResolveElementCapabilitySlot; - Handle capability( - PromiseCapability::cast(context->get(index)), isolate); - if (!capability->promise()->IsJSPromise()) return; -diff --git a/test/cctest/test-code-stub-assembler.cc b/test/cctest/test-code-stub-assembler.cc -index 6db2eed1458bd0f07ae6774401e53a3f2d23b7ce..ab90d1a357fd141441cf1a89323a5dc7f332a882 100644 ---- a/test/cctest/test-code-stub-assembler.cc -+++ b/test/cctest/test-code-stub-assembler.cc -@@ -7,6 +7,7 @@ - #include "src/api-inl.h" - #include "src/base/utils/random-number-generator.h" - #include "src/builtins/builtins-promise-gen.h" -+#include "src/builtins/builtins-promise.h" - #include "src/builtins/builtins-string-gen.h" - #include "src/char-predicates.h" - #include "src/code-factory.h" -@@ -2360,9 +2361,9 @@ TEST(CreatePromiseResolvingFunctionsContext) { - CHECK_EQ(isolate->native_context()->scope_info(), context_js->scope_info()); - CHECK_EQ(ReadOnlyRoots(isolate).the_hole_value(), context_js->extension()); - CHECK_EQ(*isolate->native_context(), context_js->native_context()); -- CHECK(context_js->get(PromiseBuiltinsAssembler::kPromiseSlot)->IsJSPromise()); -+ CHECK(context_js->get(PromiseBuiltins::kPromiseSlot)->IsJSPromise()); - CHECK_EQ(ReadOnlyRoots(isolate).false_value(), -- context_js->get(PromiseBuiltinsAssembler::kDebugEventSlot)); -+ context_js->get(PromiseBuiltins::kDebugEventSlot)); - } - - TEST(CreatePromiseResolvingFunctions) { -@@ -2520,13 +2521,12 @@ TEST(CreatePromiseGetCapabilitiesExecutorContext) { - ft.Call(isolate->factory()->undefined_value()).ToHandleChecked(); - CHECK(result_obj->IsContext()); - Handle context_js = Handle::cast(result_obj); -- CHECK_EQ(PromiseBuiltinsAssembler::kCapabilitiesContextLength, -- context_js->length()); -+ CHECK_EQ(PromiseBuiltins::kCapabilitiesContextLength, context_js->length()); - CHECK_EQ(isolate->native_context()->scope_info(), context_js->scope_info()); - CHECK_EQ(ReadOnlyRoots(isolate).the_hole_value(), context_js->extension()); - CHECK_EQ(*isolate->native_context(), context_js->native_context()); -- CHECK(context_js->get(PromiseBuiltinsAssembler::kCapabilitySlot) -- ->IsPromiseCapability()); -+ CHECK( -+ context_js->get(PromiseBuiltins::kCapabilitySlot)->IsPromiseCapability()); - } - - TEST(NewPromiseCapability) { -@@ -2573,10 +2573,8 @@ TEST(NewPromiseCapability) { - CHECK_EQ(isolate->native_context()->scope_info(), context->scope_info()); - CHECK_EQ(ReadOnlyRoots(isolate).the_hole_value(), context->extension()); - CHECK_EQ(*isolate->native_context(), context->native_context()); -- CHECK_EQ(PromiseBuiltinsAssembler::kPromiseContextLength, -- context->length()); -- CHECK_EQ(context->get(PromiseBuiltinsAssembler::kPromiseSlot), -- result->promise()); -+ CHECK_EQ(PromiseBuiltins::kPromiseContextLength, context->length()); -+ CHECK_EQ(context->get(PromiseBuiltins::kPromiseSlot), result->promise()); - } - } - diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 1637c32993..6b8ab67772 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -2117,8 +2117,7 @@ describe('BrowserWindow module', () => { }) }) - // visibilitychange event is broken upstream, see crbug.com/920839 - xdescribe('document.visibilityState/hidden', () => { + describe('document.visibilityState/hidden', () => { beforeEach(() => { w.destroy() }) function onVisibilityChange (callback) { diff --git a/spec/api-session-spec.js b/spec/api-session-spec.js index 9a536b090e..a578f0dc4e 100644 --- a/spec/api-session-spec.js +++ b/spec/api-session-spec.js @@ -562,19 +562,6 @@ describe('session module', () => { it('allows configuring proxy settings', (done) => { const config = { proxyRules: 'http=myproxy:80' } - customSession.setProxy(config, () => { - customSession.resolveProxy('http://example.com/', (proxy) => { - assert.strictEqual(proxy, 'PROXY myproxy:80') - done() - }) - }) - }) - - it('allows removing the implicit bypass rules for localhost', (done) => { - const config = { - proxyRules: 'http=myproxy:80', - proxyBypassRules: '<-loopback>' - } customSession.setProxy(config, () => { customSession.resolveProxy('http://localhost', (proxy) => { assert.strictEqual(proxy, 'PROXY myproxy:80') @@ -612,7 +599,7 @@ describe('session module', () => { proxyBypassRules: '' } customSession.setProxy(config, () => { - customSession.resolveProxy('http://example/', (proxy) => { + customSession.resolveProxy('http://localhost', (proxy) => { assert.strictEqual(proxy, 'DIRECT') done() }) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index c744a3db59..097b49d2d1 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -264,9 +264,7 @@ describe('webContents module', () => { describe('openDevTools() API', () => { it('can show window with activation', async () => { - const focused = emittedOnce(w, 'focus') w.show() - await focused assert.strictEqual(w.isFocused(), true) const devtoolsOpened = emittedOnce(w.webContents, 'devtools-opened') w.webContents.openDevTools({ mode: 'detach', activate: true }) diff --git a/spec/webview-spec.js b/spec/webview-spec.js index 1eb02e28f6..a308ef3695 100644 --- a/spec/webview-spec.js +++ b/spec/webview-spec.js @@ -1332,12 +1332,10 @@ describe(' tag', function () { nodeIntegration: true } }) - const didAttachWebview = emittedOnce(w.webContents, 'did-attach-webview') - const webviewDomReady = emittedOnce(ipcMain, 'webview-dom-ready') w.loadFile(path.join(fixtures, 'pages', 'webview-did-attach-event.html')) - const [, webContents] = await didAttachWebview - const [, id] = await webviewDomReady + const [, webContents] = await emittedOnce(w.webContents, 'did-attach-webview') + const [, id] = await emittedOnce(ipcMain, 'webview-dom-ready') expect(webContents.id).to.equal(id) }) })