From a006cf681b84cac08229a545f39a158ddedef0da Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Tue, 30 Mar 2021 19:17:09 -0700 Subject: [PATCH] chore: bump chromium to 91.0.4448.0 (master) (#28009) * chore: bump chromium in DEPS to 91.0.4435.3 * build: add 'use_rts' definition Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2694187 * chore: update patches * chore: media_internal_resources becomes resources Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2699022 * chore: update patches * refactor: extensions::ViewType moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 * chore: might_have_observers has been removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2667839 * refactor: CertVerifier is not in the network namespace anymore Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2689805 * refactor: ExtensionUserScriptManager is now UserScriptManager Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2657617 * refactor: content::SiteInstance::GetSiteForURL was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2680274 * refactor: MenuItemType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 * refactor: extensions::ViewType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 * refacotr: grit::ResourceMap replaced with webui::ResourcePath Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2685601 * refactor: blink::MenuItem::Type was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 * refactor: CreateDataPipe deprecated form was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2698090 * refactor: DesktopMediaList::Type replaces content::DesktopMediaType_* Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2700637 * chore: wire up activation_time in OSR Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2638372 * chore: remove deleted file from chromium_src list * chore: fix lint * update patches * chore: bump chromium in DEPS to 91.0.4438.0 * chore: bump chromium in DEPS to 91.0.4439.0 * chore: bump chromium in DEPS to 91.0.4440.0 * chore: bump chromium in DEPS to 91.0.4441.0 * chore: bump chromium in DEPS to 91.0.4442.0 * chore: bump chromium in DEPS to 91.0.4443.0 * chore: bump chromium in DEPS to 91.0.4445.0 * chore: bump chromium in DEPS to 91.0.4446.0 * chore: update patches * fixup gn check * Merge branch 'master' into roller/chromium/master * update to xcode 12.4.0 Needed because of https://chromium.googlesource.com/chromium/src/+/8008deb41cc7ee54a1ef08e2b8afec8046285468 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * 2752932: Associate each AwProxyingURLLoaderFactory with a frame tree node id. https://chromium-review.googlesource.com/c/chromium/src/+/2752932 * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 * 2734095: Introduce StoragePartitionId type to wrap current string representation. https://chromium-review.googlesource.com/c/chromium/src/+/2734095 * chore: bump chromium in DEPS to 91.0.4448.0 * Update patches * 2743594: Remove WebSize from blink. https://chromium-review.googlesource.com/c/chromium/src/+/2743594 * 2725403: Add URLLoaderClient::OnReceiveEarlyHints() https://chromium-review.googlesource.com/c/chromium/src/+/2725403 * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 * 2721718: Move HostID to extensions::mojom::HostID https://chromium-review.googlesource.com/c/chromium/src/+/2721718 * 2733070: Rename observer to URLLoaderNetworkServiceObserver https://chromium-review.googlesource.com/c/chromium/src/+/2733070 * Use nogncheck for content/browser/site_instance_impl.h This is needed because //content/browser:browser is not a visible target * 2648046: Introduce alert notification helper .app https://chromium-review.googlesource.com/c/chromium/src/+/2648046 * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 * only include mac notifications on mac * add additional skipping of atk toolchain check * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * 2720306: [api] Remove deprecated [Shared]ArrayBuffer API https://chromium-review.googlesource.com/c/v8/v8/+/2720306 * Fixup 2721718: Move HostID to extensions::mojom::HostID * fixup 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer * Fixup 2752406: [LSC] Replace base::string16 with std::u16string in //ui * Fixup 2725403: Add URLLoaderClient::OnReceiveEarlyHints() * update node headers * chore: bump chromium in DEPS to 91.0.4449.0 * Revert "chore: bump chromium in DEPS to 91.0.4449.0" This reverts commit bccafa02896eef24b5561e9581d853057323d548. * 2693008: Fix loading non-system cursors on Windows on browser_tests https://chromium-review.googlesource.com/c/chromium/src/+/2693008 * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 * undo changes to WebContentsPreferences::GetPreloadPath to fix mac build * fix StrCat issue * incantations for WebContentsPreferences::GetPreloadPath wide strings * bump nan * fix GetAsString maybe? * windows build fixes * more windows build fix * SetAppUserModelID -> wstring * upgrade nan dep in tests * lint * wstrings are cross-platform * linter * only bind setAppUserModelId on windows * fix a messed up merge * well that was an odyssey * backport fcdf35e from v8 to fix nan crash * disable typedarrays-test.js * don't defer in NSWindow creation https://chromium-review.googlesource.com/c/chromium/src/+/2707696 * use PartitionAllocator for ArrayBuffers in the main process * fix patches * chore: omit some unnecessary conversions * refactor: make LoginItemSettings::path a wstring * refactor: make ShowTaskDialog take a wstr * Revert "refactor: make LoginItemSettings::path a wstring" This reverts commit 9127cff58b6740bcf5dffff420ffeb14b24a245f. Co-authored-by: Samuel Attard Co-authored-by: John Kleinschmidt Co-authored-by: John Kleinschmidt Co-authored-by: Jeremy Rose Co-authored-by: Jeremy Rose Co-authored-by: Charles Kerr --- .circleci/config.yml | 6 +- BUILD.gn | 3 + DEPS | 6 +- build/args/all.gn | 3 + chromium_src/BUILD.gn | 1 - .../browser/certificate_manager_model.cc | 2 +- .../browser/certificate_manager_model.h | 3 +- electron_paks.gni | 2 +- patches/boringssl/expose_aes-cfb.patch | 2 +- patches/chromium/.patches | 1 - patches/chromium/accelerator.patch | 14 +- ...client_precreatemessageloop_callback.patch | 6 +- .../add_didinstallconditionalfeatures.patch | 28 ++-- patches/chromium/add_realloc.patch | 8 +- ...rustedauthclient_to_urlloaderfactory.patch | 72 ++++----- ..._windows_to_have_different_web_prefs.patch | 8 +- ..._secondary_label_via_simplemenumodel.patch | 54 +++---- patches/chromium/blink_local_frame.patch | 8 +- patches/chromium/blink_world_context.patch | 10 +- patches/chromium/build_gn.patch | 4 +- patches/chromium/can_create_window.patch | 50 +++---- ..._v8_initialization_isolate_callbacks.patch | 2 +- ...screationoverridden_with_full_params.patch | 54 +++---- ...esources_not_chrome_for_spellchecker.patch | 6 +- patches/chromium/chrome_key_systems.patch | 6 +- .../chromium/content_browser_main_loop.patch | 4 +- patches/chromium/dcheck.patch | 10 +- ...ay_lock_the_protocol_scheme_registry.patch | 12 +- patches/chromium/desktop_media_list.patch | 33 +++-- patches/chromium/disable-redraw-lock.patch | 6 +- .../disable_color_correct_rendering.patch | 40 ++--- .../disable_compositor_recycling.patch | 4 +- patches/chromium/disable_hidden.patch | 16 +- patches/chromium/disable_unload_metrics.patch | 6 +- ...ll_getwebframe_-_view_when_get_blink.patch | 4 +- .../chromium/enable_reset_aspect_ratio.patch | 6 +- ...xpose_setuseragent_on_networkcontext.patch | 16 +- ...dd_set_theme_source_to_allow_apps_to.patch | 18 +-- ..._scheduler_throttling_per_renderview.patch | 26 ++-- ...screen_rendering_with_viz_compositor.patch | 24 +-- ...chdir_np_and_pthread_chdir_np_in_mas.patch | 2 +- ...out_profile_refs_in_accessibility_ui.patch | 10 +- ..._properly_honor_printing_page_ranges.patch | 6 +- ...ns_through_the_web_contents_delegate.patch | 4 +- ...fix_use_electron_generated_resources.patch | 2 +- patches/chromium/frame_host_manager.patch | 44 +++--- .../gin_enable_disable_v8_platform.patch | 2 +- ...gpu_notify_when_dxdiag_request_fails.patch | 4 +- .../chromium/gritsettings_resource_ids.patch | 4 +- patches/chromium/gtk_visibility.patch | 4 +- .../mas_disable_remote_accessibility.patch | 32 ++-- patches/chromium/mas_no_private_api.patch | 127 ++++++++-------- ..._of_webview_to_blinks_webprefs_logic.patch | 4 +- ...emote_certificate_verification_logic.patch | 32 ++-- .../chromium/notification_provenance.patch | 12 +- ..._version_py_script_to_work_on_mac_ci.patch | 26 ---- patches/chromium/picture-in-picture.patch | 16 +- patches/chromium/printing.patch | 72 ++++----- ...put_back_deleted_colors_for_autofill.patch | 52 +++---- ...r_changes_to_the_webcontentsobserver.patch | 18 +-- ..._some_deps_that_do_not_work_on_arm64.patch | 18 +-- .../render_widget_host_view_base.patch | 8 +- .../render_widget_host_view_mac.patch | 12 +- patches/chromium/resource_file_conflict.patch | 6 +- ...ove_contentrendererclient_shouldfork.patch | 18 +-- patches/chromium/scroll_bounce_flag.patch | 4 +- .../chromium/skip_atk_toolchain_check.patch | 12 ++ .../ssl_security_state_tab_helper.patch | 35 ++--- .../support_mixed_sandbox_with_zygote.patch | 60 ++++---- patches/chromium/ui_gtk_public_header.patch | 6 +- ...andboxed_ppapi_processes_skip_zygote.patch | 2 +- .../upload_list_add_loadsync_method.patch | 6 +- patches/chromium/web_contents.patch | 12 +- patches/chromium/webview_cross_drag.patch | 4 +- .../worker_context_will_destroy.patch | 18 +-- ...feat_add_hook_to_notify_script_ready.patch | 20 +-- ..._some_deps_that_do_not_work_on_arm64.patch | 16 +- patches/node/build_add_gn_build_files.patch | 8 +- patches/v8/.patches | 2 +- patches/v8/add_realloc.patch | 8 +- patches/v8/build_gn.patch | 8 +- ...disallow_copying_cppheapcreateparams.patch | 43 ------ patches/v8/dcheck.patch | 8 +- ...export_private_v8_symbols_on_windows.patch | 6 +- ...ort_symbols_needed_for_windows_build.patch | 6 +- patches/v8/expose_mksnapshot.patch | 4 +- ...of_shared_arraybuffer_backing_stores.patch | 137 ++++++++++++++++++ ...workaround_an_undefined_symbol_error.patch | 4 +- script/nan-spec-runner.js | 5 +- shell/app/electron_content_client.cc | 2 +- shell/app/electron_content_client.h | 2 +- shell/app/electron_crash_reporter_client.cc | 8 +- shell/app/node_main.cc | 2 +- shell/browser/api/content_tracing.idl | 26 ++++ shell/browser/api/electron_api_app.cc | 4 +- shell/browser/api/electron_api_base_window.cc | 6 +- .../api/electron_api_browser_window.cc | 2 +- .../browser/api/electron_api_browser_window.h | 2 +- .../api/electron_api_crash_reporter.cc | 2 +- .../api/electron_api_desktop_capturer.cc | 8 +- shell/browser/api/electron_api_menu.cc | 22 +-- shell/browser/api/electron_api_menu.h | 22 +-- .../browser/api/electron_api_notification.cc | 36 ++--- shell/browser/api/electron_api_notification.h | 56 +++---- shell/browser/api/electron_api_url_loader.cc | 2 +- .../browser/api/electron_api_web_contents.cc | 57 ++++---- shell/browser/api/electron_api_web_contents.h | 22 +-- .../api/electron_api_web_frame_main.cc | 2 +- .../browser/api/electron_api_web_frame_main.h | 2 +- shell/browser/browser.h | 25 ++-- shell/browser/browser_linux.cc | 4 +- shell/browser/browser_mac.mm | 14 +- shell/browser/browser_win.cc | 120 +++++++-------- shell/browser/electron_autofill_driver.cc | 4 +- shell/browser/electron_autofill_driver.h | 4 +- shell/browser/electron_browser_client.cc | 19 ++- shell/browser/electron_browser_client.h | 5 +- shell/browser/electron_browser_context.cc | 36 +---- shell/browser/electron_browser_context.h | 12 -- shell/browser/electron_browser_main_parts.cc | 9 +- .../electron_javascript_dialog_manager.cc | 14 +- .../electron_javascript_dialog_manager.h | 4 +- .../browser/extended_web_contents_observer.h | 3 +- .../electron_management_api_delegate.cc | 2 +- .../electron_management_api_delegate.h | 2 +- shell/browser/extensions/api/tabs/tabs_api.cc | 4 +- ...on_component_extension_resource_manager.cc | 8 +- ...ron_component_extension_resource_manager.h | 4 +- .../extensions/electron_extension_system.cc | 10 +- .../extensions/electron_extension_system.h | 4 +- shell/browser/file_select_helper.cc | 2 +- shell/browser/font_defaults.cc | 8 +- shell/browser/javascript_environment.cc | 85 ++++++++++- shell/browser/lib/bluetooth_chooser.cc | 2 +- shell/browser/lib/bluetooth_chooser.h | 6 +- shell/browser/login_handler.cc | 3 +- shell/browser/native_window.cc | 2 +- shell/browser/native_window.h | 5 +- shell/browser/native_window_observer.h | 3 +- shell/browser/native_window_views.cc | 2 +- shell/browser/native_window_views.h | 2 +- .../net/electron_url_loader_factory.cc | 4 +- shell/browser/net/network_context_service.cc | 5 +- shell/browser/net/network_context_service.h | 3 +- shell/browser/net/node_stream_loader.cc | 2 +- .../net/proxying_url_loader_factory.cc | 5 + .../browser/net/proxying_url_loader_factory.h | 2 + .../net/system_network_context_manager.cc | 6 +- shell/browser/net/url_pipe_loader.cc | 2 +- shell/browser/notifications/notification.h | 23 ++- .../win/notification_presenter_win.cc | 6 +- .../win/notification_presenter_win.h | 3 +- .../notifications/win/win32_notification.cc | 7 +- .../win/windows_toast_notification.cc | 15 +- .../osr/osr_render_widget_host_view.cc | 7 +- .../browser/osr/osr_render_widget_host_view.h | 2 +- shell/browser/osr/osr_web_contents_view.cc | 2 +- shell/browser/osr/osr_web_contents_view.h | 2 +- .../serial/serial_chooser_controller.h | 1 - shell/browser/ui/autofill_popup.cc | 8 +- shell/browser/ui/autofill_popup.h | 12 +- .../ui/cocoa/electron_menu_controller.h | 1 - .../ui/cocoa/electron_menu_controller.mm | 10 +- shell/browser/ui/cocoa/electron_ns_window.mm | 2 +- shell/browser/ui/electron_menu_model.cc | 18 +-- shell/browser/ui/electron_menu_model.h | 18 +-- shell/browser/ui/file_dialog_win.cc | 13 +- shell/browser/ui/gtk/app_indicator_icon.cc | 4 +- shell/browser/ui/gtk/app_indicator_icon.h | 4 +- shell/browser/ui/gtk/gtk_status_icon.cc | 4 +- shell/browser/ui/gtk/gtk_status_icon.h | 5 +- shell/browser/ui/gtk/status_icon.cc | 2 +- shell/browser/ui/gtk/status_icon.h | 2 +- shell/browser/ui/inspectable_web_contents.cc | 8 +- shell/browser/ui/inspectable_web_contents.h | 4 +- .../ui/inspectable_web_contents_view.h | 5 +- .../ui/inspectable_web_contents_view_mac.h | 2 +- .../ui/inspectable_web_contents_view_mac.mm | 2 +- shell/browser/ui/message_box.h | 3 +- shell/browser/ui/message_box_gtk.cc | 2 +- shell/browser/ui/message_box_mac.mm | 2 +- shell/browser/ui/message_box_win.cc | 66 +++++---- shell/browser/ui/tray_icon.h | 4 +- shell/browser/ui/tray_icon_gtk.cc | 2 +- shell/browser/ui/tray_icon_gtk.h | 4 +- shell/browser/ui/views/autofill_popup_view.h | 4 +- .../ui/views/electron_views_delegate.cc | 4 +- .../ui/views/electron_views_delegate.h | 4 +- shell/browser/ui/views/global_menu_bar_x11.cc | 3 +- .../inspectable_web_contents_view_views.cc | 4 +- .../inspectable_web_contents_view_views.h | 6 +- shell/browser/ui/views/menu_bar.cc | 6 +- shell/browser/ui/views/menu_bar.h | 6 +- shell/browser/ui/views/menu_delegate.cc | 2 +- shell/browser/ui/views/menu_delegate.h | 2 +- shell/browser/ui/views/submenu_button.cc | 10 +- shell/browser/ui/views/submenu_button.h | 12 +- shell/browser/ui/win/jump_list.cc | 2 +- shell/browser/ui/win/jump_list.h | 12 +- shell/browser/ui/win/notify_icon.cc | 8 +- shell/browser/ui/win/taskbar_host.cc | 8 +- shell/browser/web_contents_preferences.cc | 27 +++- shell/browser/web_dialog_helper.cc | 6 +- shell/common/api/electron_api_clipboard.cc | 32 ++-- shell/common/api/electron_api_clipboard.h | 18 +-- .../common/api/electron_api_clipboard_mac.mm | 4 +- shell/common/api/electron_api_native_image.cc | 2 +- .../api/electron_api_native_image_win.cc | 2 +- shell/common/api/electron_api_shell.cc | 2 +- shell/common/application_info.h | 3 +- shell/common/application_info_win.cc | 9 +- .../common/gin_converters/blink_converter.cc | 20 +-- shell/common/gin_converters/blink_converter.h | 7 - .../gin_converters/content_converter.cc | 69 +-------- .../common/gin_converters/content_converter.h | 6 +- .../gin_converters/file_path_converter.h | 1 + shell/common/gin_converters/std_converter.h | 28 ++++ shell/common/keyboard_util.cc | 2 +- shell/common/keyboard_util.h | 3 +- shell/common/language_util.h | 7 - shell/common/language_util_win.cc | 34 ++--- shell/common/node_bindings.cc | 2 +- shell/common/platform_util.h | 4 - shell/common/platform_util_win.cc | 6 +- shell/common/v8_value_converter.cc | 4 +- .../api/electron_api_spell_check_client.cc | 32 ++-- .../api/electron_api_spell_check_client.h | 8 +- shell/renderer/api/electron_api_web_frame.cc | 22 +-- shell/renderer/electron_autofill_agent.cc | 18 +-- shell/renderer/electron_autofill_agent.h | 6 +- .../renderer/electron_render_frame_observer.h | 1 - shell/renderer/renderer_client_base.cc | 2 +- spec/yarn.lock | 6 +- 233 files changed, 1586 insertions(+), 1469 deletions(-) delete mode 100644 patches/chromium/patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch delete mode 100644 patches/v8/chore_disallow_copying_cppheapcreateparams.patch create mode 100644 patches/v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch create mode 100644 shell/browser/api/content_tracing.idl diff --git a/.circleci/config.yml b/.circleci/config.yml index 09cfa6e6b41..8be8bc3bd08 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,17 +85,17 @@ machine-linux-2xlarge: &machine-linux-2xlarge machine-mac: &machine-mac macos: - xcode: "12.2.0" + xcode: "12.4.0" machine-mac-large: &machine-mac-large resource_class: large macos: - xcode: "12.2.0" + xcode: "12.4.0" machine-mac-large-arm: &machine-mac-large-arm resource_class: large macos: - xcode: "12.2.0" + xcode: "12.4.0" machine-mac-arm64: &machine-mac-arm64 resource_class: electronjs/macos-arm64 diff --git a/BUILD.gn b/BUILD.gn index ed353ff671e..c206e1e5775 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -622,6 +622,9 @@ source_set("electron_lib") { "//chrome/services/printing/public/mojom", "//components/printing/common:mojo_interfaces", ] + if (is_mac) { + deps += [ "//chrome/services/mac_notifications/public/mojom" ] + } } if (enable_electron_extensions) { diff --git a/DEPS b/DEPS index 1d07810b283..44430d264aa 100644 --- a/DEPS +++ b/DEPS @@ -14,11 +14,11 @@ gclient_gn_args = [ vars = { 'chromium_version': - '90.0.4415.0', + '91.0.4448.0', 'node_version': 'v14.16.0', 'nan_version': - '2c4ee8a32a299eada3cd6e468bbd0a473bfea96d', + 'v2.14.2', 'squirrel.mac_version': 'cdc0729c8bf8576bfef18629186e1e9ecf1b0d9f', @@ -48,6 +48,8 @@ vars = { # It's only needed to parse the native tests configurations. 'checkout_pyyaml': False, + 'use_rts': False, + 'mac_xcode_version': 'default', # To allow running hooks without parsing the DEPS tree diff --git a/build/args/all.gn b/build/args/all.gn index bb5869ec9d6..3f20f46f8ef 100644 --- a/build/args/all.gn +++ b/build/args/all.gn @@ -19,4 +19,7 @@ enable_basic_printing = true angle_enable_vulkan_validation_layers = false dawn_enable_vulkan_validation_layers = false +# This breaks native node modules +libcxx_abi_unstable = false + is_cfi = false diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index 4fdd2a0ead9..940ecee0381 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -44,7 +44,6 @@ static_library("chrome") { "//chrome/browser/predictors/resolve_host_client_impl.h", "//chrome/browser/ssl/security_state_tab_helper.cc", "//chrome/browser/ssl/security_state_tab_helper.h", - "//chrome/browser/ssl/tls_deprecation_config.cc", "//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc", "//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h", "//extensions/browser/app_window/size_constraints.cc", diff --git a/chromium_src/chrome/browser/certificate_manager_model.cc b/chromium_src/chrome/browser/certificate_manager_model.cc index 8a38b537085..4166c8b36d1 100644 --- a/chromium_src/chrome/browser/certificate_manager_model.cc +++ b/chromium_src/chrome/browser/certificate_manager_model.cc @@ -90,7 +90,7 @@ CertificateManagerModel::~CertificateManagerModel() = default; int CertificateManagerModel::ImportFromPKCS12( PK11SlotInfo* slot_info, const std::string& data, - const base::string16& password, + const std::u16string& password, bool is_extractable, net::ScopedCERTCertificateList* imported_certs) { return cert_db_->ImportFromPKCS12(slot_info, data, password, is_extractable, diff --git a/chromium_src/chrome/browser/certificate_manager_model.h b/chromium_src/chrome/browser/certificate_manager_model.h index b68a650e24b..14517ee8ebc 100644 --- a/chromium_src/chrome/browser/certificate_manager_model.h +++ b/chromium_src/chrome/browser/certificate_manager_model.h @@ -12,7 +12,6 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/strings/string16.h" #include "net/cert/nss_cert_database.h" namespace content { @@ -46,7 +45,7 @@ class CertificateManagerModel { // Returns a net error code on failure. int ImportFromPKCS12(PK11SlotInfo* slot_info, const std::string& data, - const base::string16& password, + const std::u16string& password, bool is_extractable, net::ScopedCERTCertificateList* imported_certs); diff --git a/electron_paks.gni b/electron_paks.gni index f6eb9aff89c..0257db3fa9b 100644 --- a/electron_paks.gni +++ b/electron_paks.gni @@ -73,7 +73,7 @@ template("electron_extra_paks") { "//components/resources", "//content:content_resources", "//content:dev_ui_content_resources", - "//content/browser/resources/media:media_internals_resources", + "//content/browser/resources/media:resources", "//content/browser/tracing:resources", "//content/browser/webrtc/resources", "//electron:resources", diff --git a/patches/boringssl/expose_aes-cfb.patch b/patches/boringssl/expose_aes-cfb.patch index 253dc726793..e517d269c22 100644 --- a/patches/boringssl/expose_aes-cfb.patch +++ b/patches/boringssl/expose_aes-cfb.patch @@ -57,7 +57,7 @@ index 53cb9d2dc8f1962a70dc12b648d27c32be8aca4b..84af06fc56e4aa72d4d48801d7c037ad callback(EVP_aes_192_ctr(), "aes-192-ctr", NULL, arg); callback(EVP_aes_256_ctr(), "aes-256-ctr", NULL, arg); diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h -index c6bec489b51ca2e71b7f81e64a8e59b534e2e91a..512a9003164e65bd4ab896ef75b173dab3a8d1db 100644 +index badd496293fb9748adacff10478ea702d1155c5f..8565934bac9a810281b04946cb9f38d7623320f7 100644 --- a/include/openssl/cipher.h +++ b/include/openssl/cipher.h @@ -430,6 +430,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void); diff --git a/patches/chromium/.patches b/patches/chromium/.patches index f5f957d3ee5..e4a5d7b50b9 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -50,7 +50,6 @@ fix_disable_usage_of_abort_report_np_in_mas_builds.patch fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch fix_disable_usage_of_setapplicationisdaemon_and.patch unsandboxed_ppapi_processes_skip_zygote.patch -patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch build_add_electron_tracing_category.patch worker_context_will_destroy.patch frame_host_manager.patch diff --git a/patches/chromium/accelerator.patch b/patches/chromium/accelerator.patch index 781b8b78085..593215e83cc 100644 --- a/patches/chromium/accelerator.patch +++ b/patches/chromium/accelerator.patch @@ -10,7 +10,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc 3. Ctrl-Shift-= should show as Ctrl-+ diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc -index 17e1739c12ee38864e735130792321adadb43f08..7b0bfec6f18e883eb7ad7e3bfe564163592f584e 100644 +index 1a2a154b743cd4ecccf1be9971f36896e982dc6e..f28a557ccc96c25fc4a93dca216e3184b88cbf8d 100644 --- a/ui/base/accelerators/accelerator.cc +++ b/ui/base/accelerators/accelerator.cc @@ -12,6 +12,7 @@ @@ -31,7 +31,7 @@ index 17e1739c12ee38864e735130792321adadb43f08..7b0bfec6f18e883eb7ad7e3bfe564163 #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ui/base/ui_base_features.h" -@@ -205,7 +204,15 @@ base::string16 Accelerator::GetShortcutText() const { +@@ -205,7 +204,15 @@ std::u16string Accelerator::GetShortcutText() const { shortcut = KeyCodeToName(); #endif @@ -41,13 +41,13 @@ index 17e1739c12ee38864e735130792321adadb43f08..7b0bfec6f18e883eb7ad7e3bfe564163 + UsLayoutKeyboardCodeToDomCode(key_code_), flags); + if (c != 0) { + shortcut = -+ static_cast( -+ base::ToUpperASCII(static_cast(c))); ++ static_cast( ++ base::ToUpperASCII(static_cast(c))); + } #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 -@@ -214,21 +221,14 @@ base::string16 Accelerator::GetShortcutText() const { +@@ -214,21 +221,14 @@ std::u16string 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; @@ -65,7 +65,7 @@ index 17e1739c12ee38864e735130792321adadb43f08..7b0bfec6f18e883eb7ad7e3bfe564163 - UsLayoutKeyboardCodeToDomCode(key_code_), false); - if (c != 0) - shortcut += -- static_cast(base::ToUpperASCII(c)); +- static_cast(base::ToUpperASCII(c)); + shortcut = key; + } #endif @@ -75,7 +75,7 @@ index 17e1739c12ee38864e735130792321adadb43f08..7b0bfec6f18e883eb7ad7e3bfe564163 } #if defined(OS_APPLE) -@@ -411,7 +411,7 @@ base::string16 Accelerator::ApplyLongFormModifiers( +@@ -411,7 +411,7 @@ std::u16string Accelerator::ApplyLongFormModifiers( // more information. if (IsCtrlDown()) shortcut = ApplyModifierToAcceleratorString(shortcut, IDS_APP_CTRL_KEY); diff --git a/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch b/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch index 58b1f5d929b..51602d55406 100644 --- a/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch +++ b/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch @@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set. This should be upstreamed. diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc -index 5bcbb68864ed193a519b34a37f1e50c29422235a..c33f108158538c49f9d4d27b8fa89852e829c787 100644 +index cc0f150d08c13e5d06c7da5df7323a3b2463785a..f66af5d6b1336fe5de22150855b4416832b8522a 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc -@@ -261,6 +261,10 @@ int GpuMain(const MainFunctionParams& parameters) { +@@ -267,6 +267,10 @@ int GpuMain(const MainFunctionParams& parameters) { // to the GpuProcessHost once the GpuServiceImpl has started. viz::GpuServiceImpl::InstallPreInitializeLogHandler(); @@ -24,7 +24,7 @@ index 5bcbb68864ed193a519b34a37f1e50c29422235a..c33f108158538c49f9d4d27b8fa89852 // We are experiencing what appear to be memory-stomp issues in the GPU // process. These issues seem to be impacting the task executor and listeners // registered to it. Create the task executor on the heap to guard against -@@ -398,7 +402,6 @@ int GpuMain(const MainFunctionParams& parameters) { +@@ -404,7 +408,6 @@ int GpuMain(const MainFunctionParams& parameters) { } #endif diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index 3c4f2fb2a83..5892ecda401 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -10,10 +10,10 @@ DidCreateScriptContext is called, not all JS APIs are available in the context, which can cause some preload scripts to trip. diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h -index 7d2ebf0d8a14fd89e32e35631428f43aed259c16..8efabb6b7825f6fab019d7f83e185a953bb589f1 100644 +index 5a733f2086ec10d3010da52a2758e1748d1178e1..d8c7ef2e3c03f5275c1ed58849ec892f811165ef 100644 --- a/content/public/renderer/render_frame_observer.h +++ b/content/public/renderer/render_frame_observer.h -@@ -126,6 +126,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, +@@ -128,6 +128,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, virtual void DidHandleOnloadEvents() {} virtual void DidCreateScriptContext(v8::Local context, int32_t world_id) {} @@ -23,10 +23,10 @@ index 7d2ebf0d8a14fd89e32e35631428f43aed259c16..8efabb6b7825f6fab019d7f83e185a95 int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index f1d33694d94b7a0c8f839b512b7680fc9493e5f2..49b0d9012c43661a4fb4b9b8b8a68c156c7a76b6 100644 +index e2425d04e1008be3db9e6e887a7de589c18673a5..be3779de84dbda14c3425c5115da78ab703e9cfb 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4543,6 +4543,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, +@@ -4577,6 +4577,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, observer.DidCreateScriptContext(context, world_id); } @@ -40,10 +40,10 @@ index f1d33694d94b7a0c8f839b512b7680fc9493e5f2..49b0d9012c43661a4fb4b9b8b8a68c15 int world_id) { for (auto& observer : observers_) diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h -index 64d7f76d2b1570ba8a4ad51362ad6932eb50c7cd..0fcd2204f09c512da27632dcbfd366ac330b1f0a 100644 +index 9ab20deefcc7339a783e9d922c55f42840cbbf8f..52e763e8cf62ea9c5e6025d2fedd66eb8c9c8470 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h -@@ -589,6 +589,8 @@ class CONTENT_EXPORT RenderFrameImpl +@@ -597,6 +597,8 @@ class CONTENT_EXPORT RenderFrameImpl blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override; void DidCreateScriptContext(v8::Local context, int world_id) override; @@ -53,10 +53,10 @@ index 64d7f76d2b1570ba8a4ad51362ad6932eb50c7cd..0fcd2204f09c512da27632dcbfd366ac int world_id) override; void DidChangeScrollOffset() override; diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h -index 609eb34fcde080491f9f6a1b10a71daf7c46e11e..e22da080595a7474e1277d5c7526a92461417357 100644 +index fd8b154d7a38a6444dd6ceea93b422918561d0f4..8deaf19c88fdeab5ccf7bf24a086094d255e5a1a 100644 --- a/third_party/blink/public/web/web_local_frame_client.h +++ b/third_party/blink/public/web/web_local_frame_client.h -@@ -567,6 +567,9 @@ class BLINK_EXPORT WebLocalFrameClient { +@@ -571,6 +571,9 @@ class BLINK_EXPORT WebLocalFrameClient { virtual void DidCreateScriptContext(v8::Local, int32_t world_id) {} @@ -79,7 +79,7 @@ index be5cf4457cd379d5abc119d209d2df6520ad1022..8a0baac5bb8cb403324fb8156be62b92 if (World().IsMainWorld()) { GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld(); diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h -index 9a526ac4808171693146870909e058f41fe56a50..a15e379ee951504fd77b27af61b318d266274b3d 100644 +index 20a509a57d8916f8fb522575e7a5dd9c2f8a9092..60193a0e5e369b09d59379415d06a74d268d0590 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client.h +++ b/third_party/blink/renderer/core/frame/local_frame_client.h @@ -294,6 +294,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient { @@ -92,10 +92,10 @@ index 9a526ac4808171693146870909e058f41fe56a50..a15e379ee951504fd77b27af61b318d2 int32_t world_id) = 0; virtual bool AllowScriptExtensions() = 0; diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc -index e7e9fa3faf605bea1bf90d31d699c5b2c5510502..03fdd09c6dc23f21f7f52ccf30ee8202e304f355 100644 +index 76a5edbafc727c8760c4cc12d9279fb96fde3740..205cbc9f1f629e10a92d2b86a65460fd115a2149 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc -@@ -273,6 +273,13 @@ void LocalFrameClientImpl::DidCreateScriptContext( +@@ -272,6 +272,13 @@ void LocalFrameClientImpl::DidCreateScriptContext( web_frame_->Client()->DidCreateScriptContext(context, world_id); } @@ -110,7 +110,7 @@ index e7e9fa3faf605bea1bf90d31d699c5b2c5510502..03fdd09c6dc23f21f7f52ccf30ee8202 v8::Local context, int32_t world_id) { diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h -index 28d83f87c1582c8df6209f5d0a9aef130f0a4bea..3822c88091dfc803c4c57256e04bbc3946f8a869 100644 +index 244a0028b7a6d14e3eb30041b36c9ef49b61018a..ea98189f0f03a9099d6963fe0fb3ae8fb0548c64 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h @@ -76,6 +76,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient { @@ -123,10 +123,10 @@ index 28d83f87c1582c8df6209f5d0a9aef130f0a4bea..3822c88091dfc803c4c57256e04bbc39 int32_t world_id) override; diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h -index 3e442a5ddf1dd775febd433e2adb4795a3e5edec..22b5d7fbc3f09ea677444adbd8cae2ecd205b037 100644 +index 10a75b729c365f04545888c92c811e2da6c59919..43ad2a74d904d74fd6c39a61aa73093e5296510e 100644 --- a/third_party/blink/renderer/core/loader/empty_clients.h +++ b/third_party/blink/renderer/core/loader/empty_clients.h -@@ -337,6 +337,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient { +@@ -344,6 +344,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient { void DidCreateScriptContext(v8::Local, int32_t world_id) override {} diff --git a/patches/chromium/add_realloc.patch b/patches/chromium/add_realloc.patch index b6a1875819a..e23563d5070 100644 --- a/patches/chromium/add_realloc.patch +++ b/patches/chromium/add_realloc.patch @@ -39,10 +39,10 @@ index 086371af29bd8c7520485125deddca411e8b978b..2c6886ddcc47019be4d552d4fddfc1c3 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 056108a5a6f795d3971e1e808bbefe1058e3c512..50965d4f30b6ae233dab18d0a86f520bf1df8b10 100644 +index 7f88acc40ec99f0ecd1b71270980ee6e0c3e203e..42cdbc706a33792859fece7741846c4cc922008a 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc -@@ -704,6 +704,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { +@@ -699,6 +699,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { return result; } @@ -54,10 +54,10 @@ index 056108a5a6f795d3971e1e808bbefe1058e3c512..50965d4f30b6ae233dab18d0a86f520b if (max_allocation_ != 0 && data) total_allocation_.fetch_sub(size, std::memory_order_relaxed); diff --git a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc -index 686806bcafa0939d29bbc6775748a115130feb96..20f7a9a594cf379b2dac6970bc8c02aebc3be360 100644 +index ec217020077613d72eee4b5c408bd5e9eda2ae47..7ab2fa4d00eca9d4896653e29c98654ff75d4306 100644 --- a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc +++ b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc -@@ -127,6 +127,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size, +@@ -149,6 +149,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size, return AllocateMemoryWithFlags(size, policy, base::PartitionAllocReturnNull); } diff --git a/patches/chromium/add_trustedauthclient_to_urlloaderfactory.patch b/patches/chromium/add_trustedauthclient_to_urlloaderfactory.patch index bc0b380e888..ba3316796d4 100644 --- a/patches/chromium/add_trustedauthclient_to_urlloaderfactory.patch +++ b/patches/chromium/add_trustedauthclient_to_urlloaderfactory.patch @@ -10,10 +10,10 @@ WebContents, and cancels the authentication if there's no WebContents available, which there isn't in the case of the 'net' module. diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 84ab373ac9472bba739ca98c52b1f97c71169e88..0bcc7e95109fea4ff1b25672ac007b926ae52984 100644 +index b35746e2850d7d724fcf3dc09ddbfea1ca56a746..491172c51c2d196573f2e835f7b81df30a33cf2f 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -222,6 +222,26 @@ struct CTPolicy { +@@ -192,6 +192,26 @@ struct CTPolicy { array excluded_legacy_spkis; }; @@ -40,7 +40,7 @@ index 84ab373ac9472bba739ca98c52b1f97c71169e88..0bcc7e95109fea4ff1b25672ac007b92 interface CertVerifierClient { Verify( int32 default_error, -@@ -653,6 +673,8 @@ struct URLLoaderFactoryParams { +@@ -606,6 +626,8 @@ struct URLLoaderFactoryParams { // impact because of the extra process hops, so use should be minimized. pending_remote? header_client; @@ -50,18 +50,18 @@ index 84ab373ac9472bba739ca98c52b1f97c71169e88..0bcc7e95109fea4ff1b25672ac007b92 // cookies) and to shard network resources, like the cache. If set, takes // precedence over ResourceRequest::TrustedParams::IsolationInfo field diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc -index a6ea05b42fce15d576c029afa086a3007282ee71..14c17ccbc0e184f03c4ca6a9833ae83db386a011 100644 +index 136c4ec48412354cbc3d77880dd34ec836694004..f484bb54c59866d13e532cd81ed28ad9f982549a 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc -@@ -462,6 +462,7 @@ URLLoader::URLLoader( +@@ -465,6 +465,7 @@ URLLoader::URLLoader( + scoped_refptr resource_scheduler_client, base::WeakPtr keepalive_statistics_recorder, - base::WeakPtr network_usage_accumulator, mojom::TrustedURLLoaderHeaderClient* url_loader_header_client, + mojom::TrustedURLLoaderAuthClient* url_loader_auth_client, mojom::OriginPolicyManager* origin_policy_manager, std::unique_ptr trust_token_helper_factory, const cors::OriginAccessList& origin_access_list, -@@ -529,6 +530,11 @@ URLLoader::URLLoader( +@@ -533,6 +534,11 @@ URLLoader::URLLoader( header_client_.set_disconnect_handler( base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this))); } @@ -73,24 +73,27 @@ index a6ea05b42fce15d576c029afa086a3007282ee71..14c17ccbc0e184f03c4ca6a9833ae83d if (want_raw_headers_) { options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse | mojom::kURLLoadOptionSendSSLInfoForCertificateError; -@@ -1187,7 +1193,7 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request, - // |this| may have been deleted. +@@ -1198,7 +1204,7 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request, return; } -- if (!network_context_client_) { -+ if (!network_context_client_ && !auth_client_) { + auto* url_loader_network_observer = GetURLLoaderNetworkServiceObserver(); +- if (!url_loader_network_observer) { ++ if (!url_loader_network_observer && !auth_client_) { OnAuthCredentials(base::nullopt); return; } -@@ -1203,11 +1209,19 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request, - if (url_request->response_headers()) - head->headers = url_request->response_headers(); - head->auth_challenge_info = auth_info; -- network_context_client_->OnAuthRequired( -- fetch_window_id_, factory_params_->process_id, render_frame_id_, -- request_id_, url_request_->url(), first_auth_attempt_, auth_info, -- std::move(head), +@@ -1210,10 +1216,22 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request, + + DCHECK(!auth_challenge_responder_receiver_.is_bound()); + +- url_loader_network_observer->OnAuthRequired( +- fetch_window_id_, request_id_, url_request_->url(), first_auth_attempt_, +- auth_info, url_request->response_headers(), - auth_challenge_responder_receiver_.BindNewPipeAndPassRemote()); ++ auto head = mojom::URLResponseHead::New(); ++ if (url_request->response_headers()) ++ head->headers = url_request->response_headers(); ++ head->auth_challenge_info = auth_info; + if (auth_client_) { + auth_client_->OnAuthRequired( + fetch_window_id_, factory_params_->process_id, render_frame_id_, @@ -98,28 +101,27 @@ index a6ea05b42fce15d576c029afa086a3007282ee71..14c17ccbc0e184f03c4ca6a9833ae83d + std::move(head), + auth_challenge_responder_receiver_.BindNewPipeAndPassRemote()); + } else { -+ network_context_client_->OnAuthRequired( -+ fetch_window_id_, factory_params_->process_id, render_frame_id_, -+ request_id_, url_request_->url(), first_auth_attempt_, auth_info, -+ std::move(head), ++ url_loader_network_observer->OnAuthRequired( ++ fetch_window_id_, request_id_, url_request_->url(), first_auth_attempt_, ++ auth_info, url_request->response_headers(), + auth_challenge_responder_receiver_.BindNewPipeAndPassRemote()); + } auth_challenge_responder_receiver_.set_disconnect_handler( base::BindOnce(&URLLoader::DeleteSelf, base::Unretained(this))); diff --git a/services/network/url_loader.h b/services/network/url_loader.h -index e35076146d1b2205c851f815de943eef47bcdbc6..fa2beab3a2358da8a089cee78a4294af81352d2a 100644 +index f8c6112335ea43912485e76ec48d28b8609fab83..25c17fc78a03ba6a0b1a399e22bbba827e2275fb 100644 --- a/services/network/url_loader.h +++ b/services/network/url_loader.h -@@ -130,6 +130,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader +@@ -128,6 +128,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader + scoped_refptr resource_scheduler_client, base::WeakPtr keepalive_statistics_recorder, - base::WeakPtr network_usage_accumulator, mojom::TrustedURLLoaderHeaderClient* url_loader_header_client, + mojom::TrustedURLLoaderAuthClient* url_loader_auth_client, mojom::OriginPolicyManager* origin_policy_manager, std::unique_ptr trust_token_helper_factory, -@@ -497,6 +498,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader +@@ -517,6 +518,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader base::Optional fetch_window_id_; mojo::Remote header_client_; @@ -128,30 +130,30 @@ index e35076146d1b2205c851f815de943eef47bcdbc6..fa2beab3a2358da8a089cee78a4294af std::unique_ptr file_opener_for_upload_; diff --git a/services/network/url_loader_factory.cc b/services/network/url_loader_factory.cc -index e72645de2bd9073966e3f220d3663f157d29650e..6b12fb88c25d506494e8d2b8cab950dedf89ce0c 100644 +index 766d343375c24c5746fb442370b544a8cf76d58f..627efb08ed0974f0c7672085e46996048af8c244 100644 --- a/services/network/url_loader_factory.cc +++ b/services/network/url_loader_factory.cc -@@ -77,6 +77,7 @@ URLLoaderFactory::URLLoaderFactory( +@@ -76,6 +76,7 @@ URLLoaderFactory::URLLoaderFactory( resource_scheduler_client_(std::move(resource_scheduler_client)), header_client_(std::move(params_->header_client)), coep_reporter_(std::move(params_->coep_reporter)), + auth_client_(std::move(params_->auth_client)), cors_url_loader_factory_(cors_url_loader_factory), cookie_observer_(std::move(params_->cookie_observer)), - auth_cert_observer_(std::move(params_->auth_cert_observer)) { -@@ -296,6 +297,7 @@ void URLLoaderFactory::CreateLoaderAndStart( + url_loader_network_service_observer_( +@@ -279,6 +280,7 @@ void URLLoaderFactory::CreateLoaderAndStart( + context_->require_network_isolation_key(), resource_scheduler_client_, std::move(keepalive_statistics_recorder), - std::move(network_usage_accumulator), header_client_.is_bound() ? header_client_.get() : nullptr, + auth_client_.is_bound() ? auth_client_.get() : nullptr, context_->origin_policy_manager(), std::move(trust_token_factory), context_->cors_origin_access_list(), std::move(cookie_observer), - std::move(auth_cert_observer)); + std::move(url_loader_network_observer), std::move(devtools_observer)); diff --git a/services/network/url_loader_factory.h b/services/network/url_loader_factory.h -index 14bf9839d142531e4e7f6dc6a461d97713d435ed..e5bca17b40fad7a553ef1b70fa6c4eacbb3cd1a9 100644 +index f0e423b245026a06161ab922c1aed44c9152e40a..ebce1dae5a0bceeff8e77595d4cb57166c1d236f 100644 --- a/services/network/url_loader_factory.h +++ b/services/network/url_loader_factory.h -@@ -74,6 +74,7 @@ class URLLoaderFactory : public mojom::URLLoaderFactory { +@@ -79,6 +79,7 @@ class URLLoaderFactory : public mojom::URLLoaderFactory { scoped_refptr resource_scheduler_client_; mojo::Remote header_client_; mojo::Remote coep_reporter_; diff --git a/patches/chromium/allow_in_process_windows_to_have_different_web_prefs.patch b/patches/chromium/allow_in_process_windows_to_have_different_web_prefs.patch index 8b4a8bc6f76..8fb7777f73d 100644 --- a/patches/chromium/allow_in_process_windows_to_have_different_web_prefs.patch +++ b/patches/chromium/allow_in_process_windows_to_have_different_web_prefs.patch @@ -84,7 +84,7 @@ index ba1ba323ec45296c33b5931652a001d6bd24dbe0..178cae9c389e48733fde982f4906d974 out->accelerated_video_decode_enabled = data.accelerated_video_decode_enabled(); diff --git a/third_party/blink/public/common/web_preferences/web_preferences.h b/third_party/blink/public/common/web_preferences/web_preferences.h -index ab727750abcb0253463e83c984bf1afd9e296021..fd2a58f20e0a725fb441dc8607e862717537bcf6 100644 +index 74ed4b91cdd4c0cc0244491dfbbdf8e69e54e6f5..6795a5307ff49bbe366041e28c54dd2d9976c7f8 100644 --- a/third_party/blink/public/common/web_preferences/web_preferences.h +++ b/third_party/blink/public/common/web_preferences/web_preferences.h @@ -9,6 +9,7 @@ @@ -92,10 +92,10 @@ index ab727750abcb0253463e83c984bf1afd9e296021..fd2a58f20e0a725fb441dc8607e86271 #include +#include "base/files/file_path.h" - #include "base/strings/string16.h" #include "base/time/time.h" #include "build/build_config.h" -@@ -161,6 +162,28 @@ struct BLINK_COMMON_EXPORT WebPreferences { + #include "net/nqe/effective_connection_type.h" +@@ -160,6 +161,28 @@ struct BLINK_COMMON_EXPORT WebPreferences { blink::mojom::V8CacheOptions v8_cache_options; bool record_whole_document; @@ -125,7 +125,7 @@ index ab727750abcb0253463e83c984bf1afd9e296021..fd2a58f20e0a725fb441dc8607e86271 // only controls whether or not the "document.cookie" field is properly // connected to the backing store, for instance if you wanted to be able to diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h -index 68d33ca3be294fc79f6d5d1a6ae6a8dfd427f4b1..e8a2c0f48f61f31a96290c02489378795a9e9f6a 100644 +index ae180b30284c17c7319925531440161f66b873c7..6ba055814a8385052d7798be56de53691dbe3343 100644 --- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h +++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h @@ -6,6 +6,7 @@ diff --git a/patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch b/patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch index ca0e3a8edc6..4cbb9775973 100644 --- a/patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch +++ b/patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch @@ -6,81 +6,81 @@ Subject: Allow setting secondary label via SimpleMenuModel Builds on https://chromium-review.googlesource.com/c/chromium/src/+/2208976 diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc -index 7db4ef95402087b875be983f230f3e73e1e8af59..129c5b06f7a40a49ff566759b6da0911aac3d044 100644 +index 016dab7776139c8ea7eab60569f3e5c5aeff8014..022225c4c02300667c58dc61165cc19d68eb4ca7 100644 --- a/ui/base/models/simple_menu_model.cc +++ b/ui/base/models/simple_menu_model.cc -@@ -53,6 +53,11 @@ base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId( - return base::string16(); +@@ -53,6 +53,11 @@ std::u16string SimpleMenuModel::Delegate::GetLabelForCommandId( + return std::u16string(); } -+base::string16 SimpleMenuModel::Delegate::GetSecondaryLabelForCommandId( ++std::u16string SimpleMenuModel::Delegate::GetSecondaryLabelForCommandId( + int command_id) const { -+ return base::string16(); ++ return std::u16string(); +} + ImageModel SimpleMenuModel::Delegate::GetIconForCommandId( int command_id) const { return ImageModel(); -@@ -295,6 +300,11 @@ void SimpleMenuModel::SetLabel(int index, const base::string16& label) { +@@ -295,6 +300,11 @@ void SimpleMenuModel::SetLabel(int index, const std::u16string& label) { MenuItemsChanged(); } -+void SimpleMenuModel::SetSecondaryLabel(int index, const base::string16& secondary_label) { ++void SimpleMenuModel::SetSecondaryLabel(int index, const std::u16string& secondary_label) { + items_[ValidateItemIndex(index)].secondary_label = secondary_label; + MenuItemsChanged(); +} + void SimpleMenuModel::SetMinorText(int index, - const base::string16& minor_text) { + const std::u16string& minor_text) { items_[ValidateItemIndex(index)].minor_text = minor_text; -@@ -377,6 +387,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const { +@@ -377,6 +387,12 @@ std::u16string SimpleMenuModel::GetLabelAt(int index) const { return items_[ValidateItemIndex(index)].label; } -+base::string16 SimpleMenuModel::GetSecondaryLabelAt(int index) const { ++std::u16string SimpleMenuModel::GetSecondaryLabelAt(int index) const { + if (IsItemDynamicAt(index)) + return delegate_->GetSecondaryLabelForCommandId(GetCommandIdAt(index)); + return items_[ValidateItemIndex(index)].secondary_label; +} + - base::string16 SimpleMenuModel::GetMinorTextAt(int index) const { + std::u16string SimpleMenuModel::GetMinorTextAt(int index) const { return items_[ValidateItemIndex(index)].minor_text; } diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h -index 7cefe1d152ef6df95bc431cb1d35147210b614b9..db13baf0000f917dc63aadd42d5168cdac9fb020 100644 +index 5ab6c93bb3599b72952bdc8226e6c473477b7315..1132ec877298d5d5812547ffa12a4be2f2708dc4 100644 --- a/ui/base/models/simple_menu_model.h +++ b/ui/base/models/simple_menu_model.h -@@ -51,6 +51,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel { +@@ -50,6 +50,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel { // Some command ids have labels and icons that change over time. virtual bool IsItemForCommandIdDynamic(int command_id) const; - virtual base::string16 GetLabelForCommandId(int command_id) const; -+ virtual base::string16 GetSecondaryLabelForCommandId(int command_id) const; + virtual std::u16string GetLabelForCommandId(int command_id) const; ++ virtual std::u16string GetSecondaryLabelForCommandId(int command_id) const; // Gets the icon for the item with the specified id. virtual ImageModel GetIconForCommandId(int command_id) const; -@@ -154,6 +155,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel { +@@ -153,6 +154,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel { // Sets the label for the item at |index|. - void SetLabel(int index, const base::string16& label); + void SetLabel(int index, const std::u16string& label); + // Sets the secondary_label for the item at |index|. -+ void SetSecondaryLabel(int index, const base::string16& secondary_label); ++ void SetSecondaryLabel(int index, const std::u16string& secondary_label); + // Sets the minor text for the item at |index|. - void SetMinorText(int index, const base::string16& minor_text); + void SetMinorText(int index, const std::u16string& minor_text); -@@ -186,6 +190,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel { +@@ -185,6 +189,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel { ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override; int GetCommandIdAt(int index) const override; - base::string16 GetLabelAt(int index) const override; -+ base::string16 GetSecondaryLabelAt(int index) const override; - base::string16 GetMinorTextAt(int index) const override; + std::u16string GetLabelAt(int index) const override; ++ std::u16string GetSecondaryLabelAt(int index) const override; + std::u16string GetMinorTextAt(int index) const override; ImageModel GetMinorIconAt(int index) const override; bool IsItemDynamicAt(int index) const override; -@@ -223,6 +228,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel { +@@ -222,6 +227,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel { int command_id = 0; ItemType type = TYPE_COMMAND; - base::string16 label; -+ base::string16 secondary_label; - base::string16 minor_text; + std::u16string label; ++ std::u16string secondary_label; + std::u16string minor_text; ImageModel minor_icon; ImageModel icon; diff --git a/patches/chromium/blink_local_frame.patch b/patches/chromium/blink_local_frame.patch index c897343b02e..92a272c95e6 100644 --- a/patches/chromium/blink_local_frame.patch +++ b/patches/chromium/blink_local_frame.patch @@ -15,10 +15,10 @@ Refs changes in: This patch reverts the changes to fix associated crashes in Electron. diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc -index 9305b576b06a8020583939f357cd42902302b543..d772a31a436bf8f0617d87b5fcf5bd960bf871d9 100644 +index f06a116b6a5b963308c1fd099bcbad5a72c2bce0..f2a2bfbdedfac3ba0c2100a447c22c56e5d88fbb 100644 --- a/third_party/blink/renderer/core/frame/frame.cc +++ b/third_party/blink/renderer/core/frame/frame.cc -@@ -135,14 +135,6 @@ bool Frame::Detach(FrameDetachType type) { +@@ -118,14 +118,6 @@ bool Frame::Detach(FrameDetachType type) { DCHECK(!IsDetached()); @@ -33,7 +33,7 @@ index 9305b576b06a8020583939f357cd42902302b543..d772a31a436bf8f0617d87b5fcf5bd96 if (type == FrameDetachType::kRemove) { if (provisional_frame_) { provisional_frame_->Detach(FrameDetachType::kRemove); -@@ -165,6 +157,14 @@ bool Frame::Detach(FrameDetachType type) { +@@ -148,6 +140,14 @@ bool Frame::Detach(FrameDetachType type) { GetWindowProxyManager()->ClearForSwap(); } @@ -49,7 +49,7 @@ index 9305b576b06a8020583939f357cd42902302b543..d772a31a436bf8f0617d87b5fcf5bd96 // its owning reference back to our owning LocalFrame. client_->Detached(type); diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index 3051ca0d16f64447aecb18e119c84e4a6cce9bac..7584828fda17f6b497ed9a87ff1cd6993aacf569 100644 +index 0d0e15a70e33fe2579a9c15bc52f28c918e8c4de..1a02ba1623cbdcf9853985512302a211589da198 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc @@ -672,10 +672,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { diff --git a/patches/chromium/blink_world_context.patch b/patches/chromium/blink_world_context.patch index 34875c8f394..10c2b1715f6 100644 --- a/patches/chromium/blink_world_context.patch +++ b/patches/chromium/blink_world_context.patch @@ -7,7 +7,7 @@ This exposes a method for obtaining a reference to an isolated world, which is otherwise not available in the Blink API. diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h -index 3e0f38d60b48817790edeca17c72b06cd07f412f..34133a5a1fcbfea0580683aea7655b7cb7a612d2 100644 +index 315c95a0ba24ea675d82f1d1b1840683c012de82..01709c0c3ed79dad8cacb1c7075d4dfba8dc6d84 100644 --- a/third_party/blink/public/web/web_local_frame.h +++ b/third_party/blink/public/web/web_local_frame.h @@ -368,6 +368,8 @@ class WebLocalFrame : public WebFrame { @@ -20,10 +20,10 @@ index 3e0f38d60b48817790edeca17c72b06cd07f412f..34133a5a1fcbfea0580683aea7655b7c // Executes script in the context of the current page and returns the value // that the script evaluated to with callback. Script execution can be 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 0513215ab03f4d55cca5144da1b3107343bc5c58..63aa333b5f16e3565b702ab1455736c0df972e17 100644 +index 88312a9f7742ab6b085f4deb42806cd7372497b2..f2fe0c14f7205a76f1efe09c710154b8efc2e213 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 -@@ -1038,6 +1038,13 @@ v8::Local WebLocalFrameImpl::GlobalProxy() const { +@@ -1037,6 +1037,13 @@ v8::Local WebLocalFrameImpl::GlobalProxy() const { return MainWorldScriptContext()->Global(); } @@ -38,10 +38,10 @@ index 0513215ab03f4d55cca5144da1b3107343bc5c58..63aa333b5f16e3565b702ab1455736c0 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 49893b427ff1d5f7c7784461c476b903433db980..bc39ee72865f406b93f33f87998a0a3145dbc3bc 100644 +index 44d642f4cf94000e42241ff5dafdabf4ed8fbafb..1000a606f1e5a7dea2705e0d35c9cfef8e48abfb 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 -@@ -165,6 +165,8 @@ class CORE_EXPORT WebLocalFrameImpl final +@@ -166,6 +166,8 @@ class CORE_EXPORT WebLocalFrameImpl final v8::Local MainWorldScriptContext() const override; int32_t GetScriptContextWorldId( v8::Local script_context) const override; diff --git a/patches/chromium/build_gn.patch b/patches/chromium/build_gn.patch index 1664fe1daf6..beb3a02f520 100644 --- a/patches/chromium/build_gn.patch +++ b/patches/chromium/build_gn.patch @@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will rebuild the entire tree. diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index fa375deef6c851867efdd8e9d6a79261b1256774..e170c988f01fb62c0193456c8e65378fad87e7b0 100644 +index 4bedf1ef1b3c642ff2839d0ad62caaedd1e1254f..ef5c81761df66c41fb8db575434280c4866d4f4a 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -123,6 +123,9 @@ if (current_os == "") { @@ -27,7 +27,7 @@ index fa375deef6c851867efdd8e9d6a79261b1256774..e170c988f01fb62c0193456c8e65378f # 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 -@@ -334,6 +337,7 @@ default_compiler_configs = [ +@@ -336,6 +339,7 @@ default_compiler_configs = [ "//build/config/compiler/pgo:default_pgo_flags", "//build/config/coverage:default_coverage", "//build/config/sanitizers:default_sanitizer_flags", diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index c4b76705451..039437590c6 100644 --- a/patches/chromium/can_create_window.patch +++ b/patches/chromium/can_create_window.patch @@ -9,10 +9,10 @@ potentially prevent a window from being created. TODO(loc): this patch is currently broken. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index b820fbf20860ee9809278053947ea5e32f24131f..f6a51a0d4844bcf8aba6ad19e128a5625f7fe838 100644 +index f2d027d32e3cff2d1f0f03ed6c47ee689524ca1d..82dac3411b63e541d92b486f5e2108cce881b48e 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -5285,6 +5285,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -5312,6 +5312,7 @@ void RenderFrameHostImpl::CreateNewWindow( last_committed_origin_, params->window_container_type, params->target_url, params->referrer.To(), params->frame_name, params->disposition, *params->features, @@ -21,10 +21,10 @@ index b820fbf20860ee9809278053947ea5e32f24131f..f6a51a0d4844bcf8aba6ad19e128a562 &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 2e461e4a61ff0556960a5448e2aa8ee645f05346..a21877e24ddfdefbccbf3bdafb2132cf244655e8 100644 +index 4094a543f7cedb290658b63c1c2f6c91517b6020..18564b3c0adbc8ecb5c930609204be207edfd3ea 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3610,6 +3610,14 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3637,6 +3637,14 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( } auto* new_contents_impl = new_contents.get(); @@ -39,7 +39,7 @@ index 2e461e4a61ff0556960a5448e2aa8ee645f05346..a21877e24ddfdefbccbf3bdafb2132cf new_contents_impl->GetController().SetSessionStorageNamespace( partition_id, session_storage_namespace); -@@ -3651,12 +3659,6 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3679,12 +3687,6 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( AddWebContentsDestructionObserver(new_contents_impl); } @@ -53,10 +53,10 @@ index 2e461e4a61ff0556960a5448e2aa8ee645f05346..a21877e24ddfdefbccbf3bdafb2132cf new_contents_impl, opener, params.target_url, params.referrer.To(), params.disposition, diff --git a/content/common/frame.mojom b/content/common/frame.mojom -index 9cf07bc99472729050b7743b7cd85a92e6af3683..0fd0a88c29ba75633af6201b3e1d498043caaf44 100644 +index 7f26f6ed0861bc5a351123feddddd10b479409f3..bfd5c4aca4b3c23ee092788eb97bf5dfe00ad944 100644 --- a/content/common/frame.mojom +++ b/content/common/frame.mojom -@@ -323,6 +323,10 @@ struct CreateNewWindowParams { +@@ -528,6 +528,10 @@ struct CreateNewWindowParams { // The impression associated with the navigation in the new window, if // one is specified. Impression? impression; @@ -68,10 +68,10 @@ index 9cf07bc99472729050b7743b7cd85a92e6af3683..0fd0a88c29ba75633af6201b3e1d4980 // 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 7433b453ee4a0b5c836a15971c179c555901e8b6..343fc9aa93967500f313809f825ac01122852dfe 100644 +index 4516cea37427a933e961e1e646dfa1b685b6acc1..8d899d675d0eca0856269e9887371a6f633ef767 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -554,6 +554,8 @@ bool ContentBrowserClient::CanCreateWindow( +@@ -552,6 +552,8 @@ bool ContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -81,10 +81,10 @@ index 7433b453ee4a0b5c836a15971c179c555901e8b6..343fc9aa93967500f313809f825ac011 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 49da693f8e214ea669257886bdaa6fbfc1f9ddd6..b1f955f30528077ab0aea5a343781b3221113249 100644 +index fedf85bfac89c9372b0fd48e908b1c73da92c0ee..52a300a553742469ad7eea7ccb85e5e9988363b7 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -154,6 +154,7 @@ class NetworkService; +@@ -158,6 +158,7 @@ class NetworkService; class TrustedURLLoaderHeaderClient; } // namespace mojom struct ResourceRequest; @@ -92,7 +92,7 @@ index 49da693f8e214ea669257886bdaa6fbfc1f9ddd6..b1f955f30528077ab0aea5a343781b32 } // namespace network namespace sandbox { -@@ -903,6 +904,8 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -910,6 +911,8 @@ class CONTENT_EXPORT ContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -102,7 +102,7 @@ index 49da693f8e214ea669257886bdaa6fbfc1f9ddd6..b1f955f30528077ab0aea5a343781b32 bool opener_suppressed, bool* no_javascript_access); diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc -index 11ff10f2f8a1479f045be6295d7fe7476eb3a28a..bf8e1830f3a394b611e592a1cdfc60c0f8bbcaca 100644 +index ba416aebd7936d5cf7f890d071acf503765b47f6..412fa31a6fb853eb757e19e64efb0829753faed9 100644 --- a/content/public/browser/web_contents_delegate.cc +++ b/content/public/browser/web_contents_delegate.cc @@ -27,6 +27,17 @@ namespace content { @@ -124,19 +124,19 @@ index 11ff10f2f8a1479f045be6295d7fe7476eb3a28a..bf8e1830f3a394b611e592a1cdfc60c0 const OpenURLParams& params) { return nullptr; diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h -index 39349ef0c0223f632bddd3b82fd6055344af9fb4..6aba9de130ed9abd81ecc7cae370ed5b5f2fa188 100644 +index 96c3b9e9b7e10af7103c5ac85422ffcd10bbe5db..4982f8d2641c3d3162db4f553f3b6726d1bc3593 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h -@@ -17,6 +17,7 @@ - #include "base/strings/string16.h" +@@ -16,6 +16,7 @@ + #include "base/memory/scoped_refptr.h" #include "build/build_config.h" #include "content/common/content_export.h" +#include "content/common/frame.mojom.h" #include "content/public/browser/eye_dropper.h" #include "content/public/browser/invalidate_type.h" #include "content/public/browser/media_stream_request.h" -@@ -337,6 +338,13 @@ class CONTENT_EXPORT WebContentsDelegate { - const std::string& partition_id, +@@ -340,6 +341,13 @@ class CONTENT_EXPORT WebContentsDelegate { + const StoragePartitionId& partition_id, SessionStorageNamespace* session_storage_namespace); + virtual void WebContentsCreatedWithFullParams( @@ -150,10 +150,10 @@ index 39349ef0c0223f632bddd3b82fd6055344af9fb4..6aba9de130ed9abd81ecc7cae370ed5b // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc -index bf1cf31da503c4ec7dd0348ff8d6ba22f95c66cd..e3536ce02346aa60ef5e1dd36d82ace362a3c022 100644 +index 43924d90b41a349bc496d6ca940c1c9963d2773c..2840883471055f0b09ecbc18d301e1b5de8b3d5a 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc -@@ -27,6 +27,7 @@ +@@ -28,6 +28,7 @@ #include "third_party/blink/public/platform/impression_conversions.h" #include "third_party/blink/public/platform/modules/video_capture/web_video_capture_impl_manager.h" #include "third_party/blink/public/platform/url_conversion.h" @@ -161,7 +161,7 @@ index bf1cf31da503c4ec7dd0348ff8d6ba22f95c66cd..e3536ce02346aa60ef5e1dd36d82ace3 #include "third_party/blink/public/web/modules/mediastream/web_media_stream_device_observer.h" #include "third_party/blink/public/web/web_frame_widget.h" #include "third_party/blink/public/web/web_local_frame.h" -@@ -345,6 +346,10 @@ WebView* RenderViewImpl::CreateView( +@@ -344,6 +345,10 @@ WebView* RenderViewImpl::CreateView( params->impression = blink::ConvertWebImpressionToImpression(*impression); } @@ -173,7 +173,7 @@ index bf1cf31da503c4ec7dd0348ff8d6ba22f95c66cd..e3536ce02346aa60ef5e1dd36d82ace3 // moved on send. bool is_background_tab = diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc -index 03167c25e9b201ea770489179d2e4ff76feceea9..53909672f57e2af2acc58492273e0b2de68c30a9 100644 +index 5b9926d436d85f4019a4311d247f24ca44cde192..e4f8517948ec79c6ceb0571c625cbe80cef1651d 100644 --- a/content/web_test/browser/web_test_content_browser_client.cc +++ b/content/web_test/browser/web_test_content_browser_client.cc @@ -443,6 +443,8 @@ bool WebTestContentBrowserClient::CanCreateWindow( @@ -186,7 +186,7 @@ index 03167c25e9b201ea770489179d2e4ff76feceea9..53909672f57e2af2acc58492273e0b2d bool opener_suppressed, bool* no_javascript_access) { diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h -index 08b5a0fd69b2ba2364e90fa66342880e4f284671..8ea32fadf0962ce87de5f107e5c0996684d5d2b7 100644 +index c65d30c9187dd275488ed74bcc3a4eb918d2cbce..e4c6c828150e91f555b1b42e1988a1013ab1a1f0 100644 --- a/content/web_test/browser/web_test_content_browser_client.h +++ b/content/web_test/browser/web_test_content_browser_client.h @@ -83,6 +83,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient { @@ -221,10 +221,10 @@ index 4f735ad0d97eaac9a57dad137e479f8a7ec33a36..0a3c5821962c85609b64b3625fa6b8d6 } // namespace blink diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc -index 17e2e87e0ceef4c1cfba34ba8f3ee222ac8b4ca1..0d7dc9553c24d67b0ff25fa86260689cfeff5bbe 100644 +index e4f5968c7917f932a52f23efb08c3bfd7aec6d2f..7fb0c57f3e6a6668acb99e47cf46b22d2cbe0f3a 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc -@@ -2019,6 +2019,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, +@@ -2015,6 +2015,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, } WebWindowFeatures window_features = GetWindowFeaturesFromString(features); diff --git a/patches/chromium/chore_expose_v8_initialization_isolate_callbacks.patch b/patches/chromium/chore_expose_v8_initialization_isolate_callbacks.patch index 8e49c48c162..4589c50ffb7 100644 --- a/patches/chromium/chore_expose_v8_initialization_isolate_callbacks.patch +++ b/patches/chromium/chore_expose_v8_initialization_isolate_callbacks.patch @@ -9,7 +9,7 @@ we're running with contextIsolation enabled, we should be falling back to Blink's logic. This will be upstreamed in some form. 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 50965d4f30b6ae233dab18d0a86f520bf1df8b10..3dfc10c1dafced96a6e61d117aaf2fd039359e62 100644 +index 42cdbc706a33792859fece7741846c4cc922008a..27c5a49f539ba438d3e58fc3a4cadb116d440c24 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc @@ -450,7 +450,7 @@ CodeGenerationCheckCallbackInMainThread(v8::Local context, diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index 3d3b1f45cbf..599af1f1fac 100644 --- a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch +++ b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch @@ -35,7 +35,7 @@ index 5b4d70991e19edcdfee731c56251932bf43e535f..fe1977c5e6ce0f5b30e8be529b9efa51 #endif // CHROME_BROWSER_ANDROID_DOCUMENT_DOCUMENT_WEB_CONTENTS_DELEGATE_H_ diff --git a/chrome/browser/chromeos/first_run/drive_first_run_controller.cc b/chrome/browser/chromeos/first_run/drive_first_run_controller.cc -index 46322975b9eed687569df3f89f6503513caffbcd..f196c0cf671a4969015219478c58c3a175b70832 100644 +index 8642c20123ec62fd6c90c8945d78bc3e04116c5b..f33ad843cc4b602c0e3312be426b81a0332afe66 100644 --- a/chrome/browser/chromeos/first_run/drive_first_run_controller.cc +++ b/chrome/browser/chromeos/first_run/drive_first_run_controller.cc @@ -123,8 +123,7 @@ class DriveWebContentsManager : public content::WebContentsObserver, @@ -126,10 +126,10 @@ index 07014765f33bdddebcc5bc32a2713d6523faf394..f866f69f9c810d89f1a0e9e4952293f6 content::WebContents* source, const content::OpenURLParams& params) override; diff --git a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc -index d80b6e5d7112cd5c50d719569e4222ad36a2b124..0e9878873d60948484bff36a6ee895541140a157 100644 +index 33f1168f834d138aefb190b7718271d6962b3532..aeb30a22349e0682586bd1bad20dc5e21fd0b08d 100644 --- a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc +++ b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc -@@ -64,8 +64,7 @@ class ChromeKeyboardContentsDelegate : public content::WebContentsDelegate, +@@ -65,8 +65,7 @@ class ChromeKeyboardContentsDelegate : public content::WebContentsDelegate, content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -140,10 +140,10 @@ index d80b6e5d7112cd5c50d719569e4222ad36a2b124..0e9878873d60948484bff36a6ee89554 } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc -index 5af69ac9d2362bff8a2a1dd854f484f5dc17aa82..42d131060744ab938d07b3f8e78fc38efa1d5878 100644 +index 19ca9ee265876d2d33ced262be84cda1d056372c..b41c489a683995c3aa582d7eccbabe679b5cbb46 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc -@@ -1762,12 +1762,11 @@ bool Browser::IsWebContentsCreationOverridden( +@@ -1769,12 +1769,11 @@ bool Browser::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -159,10 +159,10 @@ index 5af69ac9d2362bff8a2a1dd854f484f5dc17aa82..42d131060744ab938d07b3f8e78fc38e WebContents* Browser::CreateCustomWebContents( diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h -index 1701a29a3170fcc48eb5caa276509562f7869083..adc0d6865b8873870b2b3c76e74aa430a04459be 100644 +index f1c66751bff73836e58c6550f16dba060b88bd8d..94550c33ac0c84cbc37e30a4a569098af20520ab 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h -@@ -797,8 +797,7 @@ class Browser : public TabStripModelObserver, +@@ -795,8 +795,7 @@ class Browser : public TabStripModelObserver, content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -201,7 +201,7 @@ index 058ec72442d59989c4d6df4a7c791ecfeff0ef99..f7c8c2139382cb2e290c561624291afe // The profile used for the presentation. Profile* otr_profile_; diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.cc b/components/embedder_support/android/delegate/web_contents_delegate_android.cc -index e8cee3297c218cd86b1200003e574c3713ab7afe..48216c9fccf1452f869fcfb24ba5206798c4c4e6 100644 +index bf69ad20f61b6928b1a65edef324577dcc6af689..82050776a23fa7b6af4b27bd28325c10f75c5fb7 100644 --- a/components/embedder_support/android/delegate/web_contents_delegate_android.cc +++ b/components/embedder_support/android/delegate/web_contents_delegate_android.cc @@ -168,14 +168,13 @@ bool WebContentsDelegateAndroid::IsWebContentsCreationOverridden( @@ -222,7 +222,7 @@ index e8cee3297c218cd86b1200003e574c3713ab7afe..48216c9fccf1452f869fcfb24ba52067 java_gurl); } diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.h b/components/embedder_support/android/delegate/web_contents_delegate_android.h -index 348c65a323c6104030f50e1336ccbd9ada9e7628..c7d6a0041de46784bb28146d5ffd53ded3e5685d 100644 +index cf50204a6aeb099d25dc41d4180f8a1e32a63eda..642e88a4de3044173423fae5bfe2e30ef442f366 100644 --- a/components/embedder_support/android/delegate/web_contents_delegate_android.h +++ b/components/embedder_support/android/delegate/web_contents_delegate_android.h @@ -78,8 +78,7 @@ class WebContentsDelegateAndroid : public content::WebContentsDelegate { @@ -264,10 +264,10 @@ index c5c5a7b63b5b3b62a9517cbef3ae23ce57a3c89c..4f1b7e88d6d2ae89a60311c8aeb1fcee void AddNewContents(content::WebContents* source, std::unique_ptr new_contents, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 13bd9fc314ff85ac8ce7876f9f5f8a1507d4c7d3..e137e4e16941a539346cd248a51c872159765d32 100644 +index cee5507c240fb859420eb74326e67c444c3a127c..3311b6110666851b3946ebf8071f210752425695 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3562,8 +3562,7 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3589,8 +3589,7 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( if (delegate_ && delegate_->IsWebContentsCreationOverridden( source_site_instance, params.window_container_type, @@ -278,10 +278,10 @@ index 13bd9fc314ff85ac8ce7876f9f5f8a1507d4c7d3..e137e4e16941a539346cd248a51c8721 opener, source_site_instance, is_new_browsing_instance, opener->GetLastCommittedURL(), params.frame_name, params.target_url, diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc -index bf8e1830f3a394b611e592a1cdfc60c0f8bbcaca..12f8b5b86311eef6c9025bb170111a9334bab455 100644 +index 412fa31a6fb853eb757e19e64efb0829753faed9..1378593a48932b8272bafbe70c4797befdc32f02 100644 --- a/content/public/browser/web_contents_delegate.cc +++ b/content/public/browser/web_contents_delegate.cc -@@ -139,8 +139,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden( +@@ -135,8 +135,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden( SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -292,10 +292,10 @@ index bf8e1830f3a394b611e592a1cdfc60c0f8bbcaca..12f8b5b86311eef6c9025bb170111a93 } diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h -index 6aba9de130ed9abd81ecc7cae370ed5b5f2fa188..d19b7ba1cbb686f72ce6989052e5f91d54a086e6 100644 +index 4982f8d2641c3d3162db4f553f3b6726d1bc3593..87e11c21bd4a6f07f2897e0027b47f3e74d6e192 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h -@@ -316,8 +316,7 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -319,8 +319,7 @@ class CONTENT_EXPORT WebContentsDelegate { SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -306,7 +306,7 @@ index 6aba9de130ed9abd81ecc7cae370ed5b5f2fa188..d19b7ba1cbb686f72ce6989052e5f91d // Allow delegate to creates a custom WebContents when // WebContents::CreateNewWindow() is called. This function is only called diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc -index bda659c7a464a58413e7eb33a897065268ab3fc6..29950878aca7f1518265561dea79b78d82230982 100644 +index 5f49edfabed15d691dc6cc7b17896165297735a7..d64baa43afcf5a0f87797995b84b60d84e1f05a2 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc @@ -212,8 +212,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden( @@ -320,7 +320,7 @@ index bda659c7a464a58413e7eb33a897065268ab3fc6..29950878aca7f1518265561dea79b78d // view is used for displaying embedded extension options, we want any // external links to be opened in a new tab, not in a new guest view so we diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_options/extension_options_guest.h -index 97273c32a05acf325fd0de22c4f79c1746aa23bc..4b357acd069387963347d35d82371b955147893f 100644 +index 9b293d0df6c634bf44a69d607c4eee839a74b4a1..7e5b9cbdcc232c5e20eae0130d800f508411b827 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.h +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.h @@ -55,8 +55,7 @@ class ExtensionOptionsGuest @@ -334,10 +334,10 @@ index 97273c32a05acf325fd0de22c4f79c1746aa23bc..4b357acd069387963347d35d82371b95 content::RenderFrameHost* opener, content::SiteInstance* source_site_instance, diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index 8f4c53f3f3cae0efb507b9c8951e5e50883d5dc7..9239b5da0adb3a55c37b41a4b06d2a8ca0b88659 100644 +index f3b8095088310c0811d33904bc400a4ff8c60323..c5398f93dedef93b71e64af3a2d9f2c011245b8d 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -@@ -381,8 +381,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden( +@@ -379,8 +379,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -348,10 +348,10 @@ index 8f4c53f3f3cae0efb507b9c8951e5e50883d5dc7..9239b5da0adb3a55c37b41a4b06d2a8c } diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index d9e22ce31927da93f38f6a5a153222f91580f2c2..e6c8be2ad8175cd4a5b00e69f5072ff359ad862a 100644 +index 17f911eef902bd5f30c852c1f517f4c1dd22c5b0..be333612ef35a8f43e66f3ca181bd573dd40791b 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -@@ -155,8 +155,7 @@ class MimeHandlerViewGuest +@@ -157,8 +157,7 @@ class MimeHandlerViewGuest content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -362,7 +362,7 @@ index d9e22ce31927da93f38f6a5a153222f91580f2c2..e6c8be2ad8175cd4a5b00e69f5072ff3 content::RenderFrameHost* opener, content::SiteInstance* source_site_instance, diff --git a/fuchsia/engine/browser/frame_impl.cc b/fuchsia/engine/browser/frame_impl.cc -index 4be34546653082c6d479db7bf87d2c84a84e2b5c..a9ec63085731aea19164be50649e701cd5b560f0 100644 +index f50f4343ed5a487538ef9ce819cd19300623a3dd..282bca34f82e5a3b27bc66f0cab494e388f35b9e 100644 --- a/fuchsia/engine/browser/frame_impl.cc +++ b/fuchsia/engine/browser/frame_impl.cc @@ -372,8 +372,7 @@ bool FrameImpl::IsWebContentsCreationOverridden( @@ -376,7 +376,7 @@ index 4be34546653082c6d479db7bf87d2c84a84e2b5c..a9ec63085731aea19164be50649e701c // can catch bad client behavior while not interfering with normal operation. constexpr size_t kMaxPendingWebContentsCount = 10; diff --git a/fuchsia/engine/browser/frame_impl.h b/fuchsia/engine/browser/frame_impl.h -index ae33b07dcc38359bef27f043ec6d3d8e498ac2ad..a9854747a113e35ecfef644e824610640dc592de 100644 +index 429c3b508ea698dc286676a84b6a3817eb14b553..03a610610cbb120e4a9c367bbb074050365cc04f 100644 --- a/fuchsia/engine/browser/frame_impl.h +++ b/fuchsia/engine/browser/frame_impl.h @@ -234,8 +234,7 @@ class FrameImpl : public fuchsia::web::Frame, @@ -404,10 +404,10 @@ index 4fdbf1c7030bb2b3765780d1e8c5a502679745de..5b59ce27eaa03897e5cbb3115b485a3e ->options() ->block_new_web_contents(); diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc -index 39a58363e717a0b9d71b7e3ca26578f81f8fb453..4372cf1e383ef3884048fb2a06c72888abcac9e3 100644 +index 2315e34e4c9cb60fee248c71e44984f68f1462d3..49a165ac686f611d8a982bf0b5481504e824b5a6 100644 --- a/ui/views/controls/webview/web_dialog_view.cc +++ b/ui/views/controls/webview/web_dialog_view.cc -@@ -427,8 +427,7 @@ bool WebDialogView::IsWebContentsCreationOverridden( +@@ -431,8 +431,7 @@ bool WebDialogView::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -418,10 +418,10 @@ index 39a58363e717a0b9d71b7e3ca26578f81f8fb453..4372cf1e383ef3884048fb2a06c72888 return delegate_->HandleShouldOverrideWebContentsCreation(); return false; diff --git a/ui/views/controls/webview/web_dialog_view.h b/ui/views/controls/webview/web_dialog_view.h -index 97142bc886e1bbf05871fb6603342ed0cd15dcf8..94206bb4674e696093a5cfc027281254c3bf37ff 100644 +index dadead3378af8b756b37b4efc58bee0aa121751f..62ac39757774de85e3ab2ec62c929e70993ebcf2 100644 --- a/ui/views/controls/webview/web_dialog_view.h +++ b/ui/views/controls/webview/web_dialog_view.h -@@ -153,8 +153,7 @@ class WEBVIEW_EXPORT WebDialogView : public ClientView, +@@ -160,8 +160,7 @@ class WEBVIEW_EXPORT WebDialogView : public ClientView, content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, diff --git a/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch b/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch index 744aeeada5e..2f66d060228 100644 --- a/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch +++ b/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch @@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources. We need to load these from Electrons grit header instead of Chromes diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 0666cf8912fe0dca6483190f626619a0401d064e..244df419c989f27bda950747ad06cc9c4271c9a7 100644 +index de3b455eded016ac567d5716ad9de60ab66f201c..93d5497b47f47a2ae66942ff6af240a5051d5c11 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -6238,6 +6238,7 @@ static_library("browser") { +@@ -6233,6 +6233,7 @@ static_library("browser") { deps += [ "//components/spellcheck/browser", "//components/spellcheck/common", @@ -44,7 +44,7 @@ index 41761e18716a7d9221511978dc4582a1804920e2..faea3d936c678e31fa29b93ae1ccd976 ] } diff --git a/components/language/core/browser/language_prefs.cc b/components/language/core/browser/language_prefs.cc -index c14811efa87b223729d37695d86f858dd8f366ee..444c8273e4985f7e276ad0dd0fd001b027bc0d47 100644 +index fc220d8c9f297268e7e480bb518d2de0d3dd9e4f..18e27d61fab8919969756129de1f61f55790cc88 100644 --- a/components/language/core/browser/language_prefs.cc +++ b/components/language/core/browser/language_prefs.cc @@ -21,7 +21,7 @@ diff --git a/patches/chromium/chrome_key_systems.patch b/patches/chromium/chrome_key_systems.patch index fad186b7340..e8973e071f3 100644 --- a/patches/chromium/chrome_key_systems.patch +++ b/patches/chromium/chrome_key_systems.patch @@ -7,10 +7,10 @@ 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 d0c14fb475f870cd14797c051629e629d197919c..c25f1e3770bb653168b56f877bb92369bc0416b1 100644 +index 11ab5f846976418badb6ad062588b781aa6142dd..aa372535b7342a01e2b0732148b56ca4d1b846de 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc -@@ -16,7 +16,9 @@ +@@ -15,7 +15,9 @@ #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -20,7 +20,7 @@ index d0c14fb475f870cd14797c051629e629d197919c..c25f1e3770bb653168b56f877bb92369 #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" -@@ -201,12 +203,14 @@ static SupportedCodecs GetSupportedCodecs( +@@ -202,12 +204,14 @@ static SupportedCodecs GetSupportedCodecs( // Returns persistent-license session support. static EmeSessionTypeSupport GetPersistentLicenseSupport( bool supported_by_the_cdm) { diff --git a/patches/chromium/content_browser_main_loop.patch b/patches/chromium/content_browser_main_loop.patch index 24db72ca020..87cff27e3df 100644 --- a/patches/chromium/content_browser_main_loop.patch +++ b/patches/chromium/content_browser_main_loop.patch @@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously in electron::api::WebContents::ResetManagedWebContents. diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc -index 37b9556adceca54bfe80328232c8add16381e9c8..ed60f417f3a0704ac9b42a92f3f8493f0d314149 100644 +index 72693b82f5c4bcd0b5151e97820ec2de9662670c..dba51b8cdd420f8fecc45dff2a92a3110435c737 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc -@@ -1405,7 +1405,7 @@ void BrowserMainLoop::MainMessageLoopRun() { +@@ -1413,7 +1413,7 @@ void BrowserMainLoop::MainMessageLoopRun() { NOTREACHED(); #else base::RunLoop run_loop; diff --git a/patches/chromium/dcheck.patch b/patches/chromium/dcheck.patch index 192017ad7ed..1ac6eaa8c74 100644 --- a/patches/chromium/dcheck.patch +++ b/patches/chromium/dcheck.patch @@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the failing checks and allow the rest of the target to have them enabled. diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc -index 055f4bc95fffd1ccf3dcc9e5f7c20bcc141559eb..9bf5f1fb04ce91659b0f629c1a0d71f661081671 100644 +index 21601429c56fc374da8826cb68361ff0de56ac55..9b27a4ff1abac2b104f0ac16c9ed2e3518279d84 100644 --- a/content/browser/renderer_host/navigation_controller_impl.cc +++ b/content/browser/renderer_host/navigation_controller_impl.cc -@@ -1319,8 +1319,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation( +@@ -1336,8 +1336,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation( return NAVIGATION_TYPE_NEW_SUBFRAME; } @@ -33,7 +33,7 @@ index 055f4bc95fffd1ccf3dcc9e5f7c20bcc141559eb..9bf5f1fb04ce91659b0f629c1a0d71f6 if (rfh->GetParent()) { // All manual subframes would be did_create_new_entry and handled above, so -@@ -1611,7 +1613,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewEntry( +@@ -1629,7 +1631,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewEntry( new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon(); } @@ -46,10 +46,10 @@ index 055f4bc95fffd1ccf3dcc9e5f7c20bcc141559eb..9bf5f1fb04ce91659b0f629c1a0d71f6 // navigation. Now we know that the renderer has updated its state accordingly // and it is safe to also clear the browser side history. diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc -index 948c1ffcd2cf59326e4149817bd193ba3289bfa8..25921940846bd29988c3e885c18cc254f82f3d74 100644 +index 0763e37f028a708c6e739458ec4c87c406e79b46..2d238fde0a1eb3f22fd52cbad3b12d704af2e8ae 100644 --- a/ui/base/clipboard/clipboard_win.cc +++ b/ui/base/clipboard/clipboard_win.cc -@@ -823,10 +823,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const { +@@ -924,10 +924,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const { void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) { UINT cf_format = format.ToFormatEtc().cfFormat; diff --git a/patches/chromium/delay_lock_the_protocol_scheme_registry.patch b/patches/chromium/delay_lock_the_protocol_scheme_registry.patch index 098ad44b474..82dc9fbb575 100644 --- a/patches/chromium/delay_lock_the_protocol_scheme_registry.patch +++ b/patches/chromium/delay_lock_the_protocol_scheme_registry.patch @@ -19,10 +19,10 @@ https://chromium-review.googlesource.com/c/chromium/src/+/1901591, we should try re-submitting the patch. diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc -index fc2b90e1f7230049e0e0bb5ff753f1fab0630bd3..33ab8ce6fc56ec6fccaa4588b16c7d37c0e2350c 100644 +index e49304a95fdb71565f61d8d1eb27de365e450eb9..2cf621a173d9c10a20e802ee44fbaa1d364f67e9 100644 --- a/content/app/content_main_runner_impl.cc +++ b/content/app/content_main_runner_impl.cc -@@ -651,7 +651,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { +@@ -722,7 +722,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { } #endif @@ -68,12 +68,12 @@ index 3038f9d25798f36811b6398f8cc0e7d83ecc41b0..68189c36c47ef85b345b0ccc40c456f8 // Re-initializes schemes for tests. CONTENT_EXPORT void ReRegisterContentSchemesForTests(); diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc -index e6379748886956da819523200aa35f8f95d523ee..46110a92ba9849112889f3e93c1dccbbd4911dda 100644 +index 17d256b852b6e7615cf4e52e4a2d7fa326a4df44..bd0512902df4484e8714cda9ab1352b1c672a1cd 100644 --- a/content/public/app/content_main_delegate.cc +++ b/content/public/app/content_main_delegate.cc -@@ -36,6 +36,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() { - return 0; +@@ -42,6 +42,10 @@ bool ContentMainDelegate::ShouldHandleConsoleControlEvents() { } + #endif +bool ContentMainDelegate::ShouldLockSchemeRegistry() { + return true; @@ -83,7 +83,7 @@ index e6379748886956da819523200aa35f8f95d523ee..46110a92ba9849112889f3e93c1dccbb return true; } diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h -index abb46995385fccddf8363296fb0253624a4111c7..715d0818c03cfa7e5b9877b3ab83d1488f2f040f 100644 +index 4162083f789b6cf5e29e52e4bd498c377cab1a20..d6010bc0e4dba560d10c3ed4729d77b5a60eddcd 100644 --- a/content/public/app/content_main_delegate.h +++ b/content/public/app/content_main_delegate.h @@ -65,6 +65,20 @@ class CONTENT_EXPORT ContentMainDelegate { diff --git a/patches/chromium/desktop_media_list.patch b/patches/chromium/desktop_media_list.patch index f46074ebda1..4c0c59d7603 100644 --- a/patches/chromium/desktop_media_list.patch +++ b/patches/chromium/desktop_media_list.patch @@ -7,10 +7,10 @@ Subject: desktop_media_list.patch * Free the one-time use capturer after thumbnails are fetched diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h -index a489bf6ea2179059f53e53563e993db9c7cd123b..93e237569fe94ec8526f67d915e1a7352d586b16 100644 +index d7b52b0d1b8cfb823513303ec0f6322d8dc8d153..f2dbf39f81abfc6fde4064345ab0d222ee98438c 100644 --- a/chrome/browser/media/webrtc/desktop_media_list.h +++ b/chrome/browser/media/webrtc/desktop_media_list.h -@@ -38,6 +38,9 @@ class DesktopMediaList { +@@ -52,6 +52,9 @@ class DesktopMediaList { virtual ~DesktopMediaList() {} @@ -20,21 +20,21 @@ index a489bf6ea2179059f53e53563e993db9c7cd123b..93e237569fe94ec8526f67d915e1a735 // Sets time interval between updates. By default list of sources and their // thumbnail are updated once per second. If called after StartUpdating() then // it will take effect only after the next update. -@@ -69,6 +72,7 @@ class DesktopMediaList { +@@ -83,6 +86,7 @@ class DesktopMediaList { virtual int GetSourceCount() const = 0; virtual const Source& GetSource(int index) const = 0; + virtual const std::vector& GetSources() const = 0; - virtual content::DesktopMediaID::Type GetMediaListType() const = 0; + virtual Type GetMediaListType() const = 0; }; diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc -index 147d5be9f7f56fb71468b56e86eb33b59d51cd66..5930fe95e33a9e5a3108c31e8c34daa9c724511c 100644 +index a3e1de40e843b5450f417a0455e0e7d7dee1d1bd..2f7f96a5d56d503fc231ca3c96be243cf7cbb389 100644 --- a/chrome/browser/media/webrtc/desktop_media_list_base.cc +++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc -@@ -20,6 +20,11 @@ DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period) +@@ -24,6 +24,11 @@ DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period, - DesktopMediaListBase::~DesktopMediaListBase() {} + DesktopMediaListBase::~DesktopMediaListBase() = default; +void DesktopMediaListBase::AddObserver(DesktopMediaListObserver* observer) { + DCHECK(!observer_); @@ -44,7 +44,7 @@ index 147d5be9f7f56fb71468b56e86eb33b59d51cd66..5930fe95e33a9e5a3108c31e8c34daa9 void DesktopMediaListBase::SetUpdatePeriod(base::TimeDelta period) { DCHECK(!observer_); update_period_ = period; -@@ -54,7 +59,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) { +@@ -58,7 +63,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) { DCHECK(sources_.empty()); DCHECK(!refresh_callback_); refresh_callback_ = std::move(callback); @@ -53,7 +53,7 @@ index 147d5be9f7f56fb71468b56e86eb33b59d51cd66..5930fe95e33a9e5a3108c31e8c34daa9 } int DesktopMediaListBase::GetSourceCount() const { -@@ -68,6 +73,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource( +@@ -72,6 +77,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource( return sources_[index]; } @@ -62,10 +62,10 @@ index 147d5be9f7f56fb71468b56e86eb33b59d51cd66..5930fe95e33a9e5a3108c31e8c34daa9 + return sources_; +} + - DesktopMediaID::Type DesktopMediaListBase::GetMediaListType() const { + DesktopMediaList::Type DesktopMediaListBase::GetMediaListType() const { return type_; } -@@ -79,6 +89,12 @@ DesktopMediaListBase::SourceDescription::SourceDescription( +@@ -83,6 +93,12 @@ DesktopMediaListBase::SourceDescription::SourceDescription( void DesktopMediaListBase::UpdateSourcesList( const std::vector& new_sources) { @@ -79,7 +79,7 @@ index 147d5be9f7f56fb71468b56e86eb33b59d51cd66..5930fe95e33a9e5a3108c31e8c34daa9 SourceSet new_source_set; for (size_t i = 0; i < new_sources.size(); ++i) { diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h -index 3c09ec3111d54cb4f0b74f16a81292b779009eae..5c3667822afd47a22878b508b844a615c24f3162 100644 +index a1038183d5b44ca760576bff55534b5841e2e9d2..d036a4e630e9ba8311cf7670a53b12ac33fdd2ef 100644 --- a/chrome/browser/media/webrtc/desktop_media_list_base.h +++ b/chrome/browser/media/webrtc/desktop_media_list_base.h @@ -27,6 +27,7 @@ class DesktopMediaListBase : public DesktopMediaList { @@ -95,7 +95,7 @@ index 3c09ec3111d54cb4f0b74f16a81292b779009eae..5c3667822afd47a22878b508b844a615 int GetSourceCount() const override; const Source& GetSource(int index) const override; + const std::vector& GetSources() const override; - content::DesktopMediaID::Type GetMediaListType() const override; + DesktopMediaList::Type GetMediaListType() const override; static uint32_t GetImageHash(const gfx::Image& image); diff --git a/chrome/browser/media/webrtc/desktop_media_list_observer.h b/chrome/browser/media/webrtc/desktop_media_list_observer.h @@ -111,10 +111,10 @@ index ad7f766a36b1b6b2a8bc0f96369f1aaadf6681f7..f6c6c14a0937430df62c9b9c1132c591 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 63ee95a80309357293afa0684c2a1cec6a3ba105..a0098e9450b48f03b98008e0e81fe48cc2a7b293 100644 +index f0efd4af8b7dde2c13d9e63d64249589f14ac24c..6c8c91f7d9574517da6faebe9c73fe3ed03310e3 100644 --- a/chrome/browser/media/webrtc/native_desktop_media_list.cc +++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc -@@ -10,14 +10,15 @@ +@@ -10,15 +10,16 @@ #include "base/hash/hash.h" #include "base/message_loop/message_pump_type.h" #include "base/single_thread_task_runner.h" @@ -127,11 +127,12 @@ index 63ee95a80309357293afa0684c2a1cec6a3ba105..a0098e9450b48f03b98008e0e81fe48c -#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" + #include "content/public/common/content_features.h" +#include "electron/grit/electron_resources.h" #include "media/base/video_util.h" #include "third_party/libyuv/include/libyuv/scale_argb.h" #include "third_party/skia/include/core/SkBitmap.h" -@@ -257,6 +258,8 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() { +@@ -265,6 +266,8 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() { FROM_HERE, base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished, media_list_)); diff --git a/patches/chromium/disable-redraw-lock.patch b/patches/chromium/disable-redraw-lock.patch index 0c3455585f1..a367e313f9a 100644 --- a/patches/chromium/disable-redraw-lock.patch +++ b/patches/chromium/disable-redraw-lock.patch @@ -15,7 +15,7 @@ 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 0a3940b751709585b94e356e0beb02cd81f6e871..1013375edabb6e59338bcd9266f04ee09668098e 100644 +index 0cf04f6ee625d5d8b58c68f100a599e51ff65927..e92d9cd727d1347db2d455811cc9d4c731d44676 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -305,6 +305,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500; @@ -49,10 +49,10 @@ index 0a3940b751709585b94e356e0beb02cd81f6e871..1013375edabb6e59338bcd9266f04ee0 // HWNDMessageHandler, gfx::WindowImpl overrides: diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h -index 042392a659fd6934e84d66cc985d25863e365e34..5e88e780c3da4805eae7870291188e636423042e 100644 +index 56b25183faca61754617ac38dbd2972aa8d30759..40f9b694fcce86dd56233541b58055cb77d9e615 100644 --- a/ui/views/win/hwnd_message_handler.h +++ b/ui/views/win/hwnd_message_handler.h -@@ -202,6 +202,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl, +@@ -201,6 +201,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl, using TouchIDs = std::set; enum class DwmFrameState { kOff, kOn }; diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index 4ac27f6845c..bd85b57792f 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -20,10 +20,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 413c765988dcaac6b5788248bd84d9571c3f5a00..8623bee1308ca6ac91931b270eeedc9880db4b5f 100644 +index 6423a98c5bc951446b88051de15df45ade308349..c1ef0256347ea5bc4fa9c90c91c6322ce4cc60fd 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc -@@ -1771,6 +1771,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( +@@ -1785,6 +1785,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace( gfx::ContentColorUsage content_color_usage) const { @@ -35,7 +35,7 @@ index 413c765988dcaac6b5788248bd84d9571c3f5a00..8623bee1308ca6ac91931b270eeedc98 // If we are likely to software composite the resource, we use sRGB because diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h -index 63f087b74b93efe884df3833865e9aa7af912508..eb41d143ed1dd622a362b0f008a725034d6e1a97 100644 +index c02eb016dc3f772ccafcd8099b41a4aca4d8236a..317275b6315253f5f317a09b478b566536522f82 100644 --- a/cc/trees/layer_tree_settings.h +++ b/cc/trees/layer_tree_settings.h @@ -97,6 +97,8 @@ class CC_EXPORT LayerTreeSettings { @@ -81,7 +81,7 @@ index 4dbfd138a467462bae4ff062d9a8062b76ecaa4c..cc7c95bb0f4e6ec6b3579ced90a0f103 !command_line->HasSwitch(switches::kUIDisablePartialSwap); #if defined(OS_APPLE) diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc -index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4ec9599b9 100644 +index a0fc635ce92491cc3df706e3e52bd8b0cacb2f15..32c497ca0b40517d70639cb16829a6283363e85a 100644 --- a/components/viz/service/display/gl_renderer.cc +++ b/components/viz/service/display/gl_renderer.cc @@ -88,6 +88,9 @@ @@ -94,7 +94,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 namespace viz { namespace { -@@ -677,8 +680,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad, +@@ -678,8 +681,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad, void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) { SetBlendEnabled(quad->ShouldDrawWithBlending()); @@ -106,7 +106,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 // Use the full quad_rect for debug quads to not move the edges based on // partial swaps. -@@ -1664,7 +1668,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params, +@@ -1666,7 +1670,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params, params->use_color_matrix, tint_gl_composited_content_, params->apply_shader_based_rounded_corner && ShouldApplyRoundedCorner(params->quad)), @@ -116,7 +116,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 } void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) { -@@ -2137,15 +2142,16 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad, +@@ -2139,15 +2144,16 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad, SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA, tint_gl_composited_content_, ShouldApplyRoundedCorner(quad)), @@ -136,7 +136,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 gfx::ColorTransform::TriStim col(color_f.fR, color_f.fG, color_f.fB); color_transform->Transform(&col, 1); color_f.fR = col.x(); -@@ -2367,7 +2373,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad, +@@ -2369,7 +2375,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad, : NON_PREMULTIPLIED_ALPHA, false, false, tint_gl_composited_content_, ShouldApplyRoundedCorner(quad)), @@ -146,7 +146,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 if (current_program_->tint_color_matrix_location() != -1) { auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix(); -@@ -2466,7 +2473,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad, +@@ -2468,7 +2475,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad, !quad->ShouldDrawWithBlending(), has_tex_clamp_rect, tint_gl_composited_content_, ShouldApplyRoundedCorner(quad)), @@ -156,7 +156,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 if (current_program_->tint_color_matrix_location() != -1) { auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix(); -@@ -2576,7 +2584,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad, +@@ -2578,7 +2586,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad, // The source color space should never be RGB. DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB()); @@ -166,7 +166,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 #if defined(OS_WIN) // Force sRGB output on Windows for overlay candidate video quads to match -@@ -2756,7 +2765,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad, +@@ -2759,7 +2768,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad, SetUseProgram(ProgramKey::VideoStream(tex_coord_precision, ShouldApplyRoundedCorner(quad)), @@ -176,7 +176,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id()); -@@ -2827,8 +2837,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) { +@@ -2830,8 +2840,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) { draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR); // Bind the program to the GL state. @@ -187,7 +187,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 /*adjust_src_white_level=*/draw_cache_.is_video_frame); if (current_program_->rounded_corner_rect_location() != -1) { -@@ -3655,7 +3665,9 @@ void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color, +@@ -3659,7 +3669,9 @@ void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color, const gfx::ColorSpace& src_color_space, const gfx::ColorSpace& dst_color_space, bool adjust_src_white_level) { @@ -198,7 +198,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 gfx::ColorSpace adjusted_src_color_space = src_color_space; if (adjust_src_white_level) { // If the input color space is HDR, and it did not specify a white level, -@@ -4035,9 +4047,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource( +@@ -4037,9 +4049,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource( cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple); } @@ -211,7 +211,7 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 *new_bounds = gfx::RectF(updated_dst_rect.origin(), gfx::SizeF((*overlay_texture)->texture.size())); -@@ -4257,8 +4269,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) { +@@ -4259,8 +4271,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) { PrepareGeometry(SHARED_BINDING); @@ -222,14 +222,14 @@ index ca43fd244812f22242aafb3abcf5d74fe1d145ad..2e577e69472998d8ff6859bd925b72a4 gfx::Transform render_matrix; render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(), -@@ -4448,3 +4460,5 @@ GLRenderer::OverlayTexture::OverlayTexture() = default; +@@ -4450,3 +4462,5 @@ GLRenderer::OverlayTexture::OverlayTexture() = default; GLRenderer::OverlayTexture::~OverlayTexture() = default; } // namespace viz + +#undef PATCH_CS diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc -index 01d39c67a40567f49d8bd90e00c11034028c4895..2d30ca0c184453467ddf8415b5081c22d404af3e 100644 +index 2425c2b99a949c3181e2b69ea8d607f103442e34..86c91453231ca4762f50387b9be51393176b9cb8 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -223,6 +223,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( @@ -241,10 +241,10 @@ index 01d39c67a40567f49d8bd90e00c11034028c4895..2d30ca0c184453467ddf8415b5081c22 sandbox::policy::switches::kGpuSandboxAllowSysVShm, sandbox::policy::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 cddd153328e3e1e4154aa61e9786b3eaef3f4a05..a8885dffd9c78567f0052e490d17b427e03a74fb 100644 +index ae1aed1f26ae6202b4709a1931c48c55e3fae956..5629dd09ca564100bb1eb592f1176c5987eb0b71 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -218,6 +218,7 @@ +@@ -214,6 +214,7 @@ #include "ui/accessibility/accessibility_switches.h" #include "ui/base/ui_base_switches.h" #include "ui/display/display_switches.h" @@ -252,7 +252,7 @@ index cddd153328e3e1e4154aa61e9786b3eaef3f4a05..a8885dffd9c78567f0052e490d17b427 #include "ui/gl/gl_switches.h" #include "ui/native_theme/native_theme_features.h" #include "url/origin.h" -@@ -3240,6 +3241,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -3152,6 +3153,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[] = { diff --git a/patches/chromium/disable_compositor_recycling.patch b/patches/chromium/disable_compositor_recycling.patch index 332d82177bd..182ea6aa21c 100644 --- a/patches/chromium/disable_compositor_recycling.patch +++ b/patches/chromium/disable_compositor_recycling.patch @@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron. 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 bfa99980776b9aa216644ea146fbb1d1a085a85d..7ab2cd43c5383a778261998bd433f37d312f6966 100644 +index 925b5ab3e666c14f01745f59859ce25f14f64899..8c55c85010940f3ad2135841d9d780779bc2b07d 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -476,7 +476,11 @@ +@@ -487,7 +487,11 @@ return; host()->WasHidden(); diff --git a/patches/chromium/disable_hidden.patch b/patches/chromium/disable_hidden.patch index 3298be03fdb..e13df90cfcb 100644 --- a/patches/chromium/disable_hidden.patch +++ b/patches/chromium/disable_hidden.patch @@ -6,10 +6,10 @@ Subject: disable_hidden.patch Electron uses this to disable background throttling for hidden windows. diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index a0e730813c10f3fbb662590d81fb467ba32c3747..c50126455356bbe34b3f126b652aa098d2e0758c 100644 +index 20c2816765f639ce6ecab16db124f885702064dd..d98336a4b552290aff88a0c14321a58807c7eb05 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -734,6 +734,9 @@ void RenderWidgetHostImpl::WasHidden() { +@@ -709,6 +709,9 @@ void RenderWidgetHostImpl::WasHidden() { if (is_hidden_) return; @@ -20,12 +20,12 @@ index a0e730813c10f3fbb662590d81fb467ba32c3747..c50126455356bbe34b3f126b652aa098 blink::mojom::PointerLockResult::kWrongDocument); diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h -index 4ecd272b7fe070d0ae7a34faf1f5d007e1cf078a..1929617dcc595b5aca9ed5e981be684302f8da1f 100644 +index c0ab310d13e3f567aebdb9bcf1824897dba6b637..84c0d0943007adca3ce3a9c61f123a50aa67bf37 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h -@@ -826,6 +826,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl - - base::Optional LastComputedVisualProperties() const; +@@ -833,6 +833,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl + mojom::CreateFrameWidgetParamsPtr + BindAndGenerateCreateFrameWidgetParamsForNewWindow(); + // Electron: Prevents the widget from getting hidden. + bool disable_hidden_ = false; @@ -34,10 +34,10 @@ index 4ecd272b7fe070d0ae7a34faf1f5d007e1cf078a..1929617dcc595b5aca9ed5e981be6843 // |routing_id| must not be MSG_ROUTING_NONE. // If this object outlives |delegate|, DetachDelegate() must be called when diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc -index ea9d026a80b3b26eeb9adde81ebb03b5dfcb1535..ff813b3dfcc793f000ca4438eb3ba6eedfe50220 100644 +index 624f7f5aa5314bd810074f354073ff98bb66b3d2..6417bef874d990535a610c78e547ecba57b78369 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -595,7 +595,7 @@ void RenderWidgetHostViewAura::HideImpl() { +@@ -597,7 +597,7 @@ void RenderWidgetHostViewAura::HideImpl() { DCHECK(visibility_ == Visibility::HIDDEN || visibility_ == Visibility::OCCLUDED); diff --git a/patches/chromium/disable_unload_metrics.patch b/patches/chromium/disable_unload_metrics.patch index d059ce8c8cf..6ec51721354 100644 --- a/patches/chromium/disable_unload_metrics.patch +++ b/patches/chromium/disable_unload_metrics.patch @@ -24,10 +24,10 @@ This patch temporarily disables the metrics so we can have green CI, and we should continue seeking for a real fix. diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc -index 6013468ed431d43d635840a8a157f763a4647711..1747d257a2bdd9230e387d931fb45a4d71f4532f 100644 +index c30c380d80c15d3795365be20525ad7a01f3ca4a..8e7aeb43a436ec6be46ffcd7d319a3e2d85462e0 100644 --- a/content/browser/renderer_host/navigator.cc +++ b/content/browser/renderer_host/navigator.cc -@@ -1058,6 +1058,7 @@ void Navigator::RecordNavigationMetrics( +@@ -1017,6 +1017,7 @@ void Navigator::RecordNavigationMetrics( .InMilliseconds()); } @@ -35,7 +35,7 @@ index 6013468ed431d43d635840a8a157f763a4647711..1747d257a2bdd9230e387d931fb45a4d // If this is a same-process navigation and we have timestamps for unload // durations, fill those metrics out as well. if (params.unload_start && params.unload_end && -@@ -1104,6 +1105,7 @@ void Navigator::RecordNavigationMetrics( +@@ -1063,6 +1064,7 @@ void Navigator::RecordNavigationMetrics( first_before_unload_start_time) .InMilliseconds()); } diff --git a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch index b91708b69a7..47521b165f7 100644 --- a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch +++ b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch @@ -11,10 +11,10 @@ This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572 Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index db038990188455fc645c3c769a71e01af1ad3f0b..992086aa121623cd59ffa6f768559fd57e3f97d2 100644 +index 6dfa89f3117cb7b0165c352feb79e95b4a315061..31ca76bb13643b8dc1a530841f9c1941ebb43838 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -2643,7 +2643,7 @@ blink::WebLocalFrame* RenderFrameImpl::GetWebFrame() { +@@ -2667,7 +2667,7 @@ blink::WebLocalFrame* RenderFrameImpl::GetWebFrame() { } const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() { diff --git a/patches/chromium/enable_reset_aspect_ratio.patch b/patches/chromium/enable_reset_aspect_ratio.patch index 7486e4bec98..d92f2bc22cc 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -6,10 +6,10 @@ Subject: feat: enable setting aspect ratio to 0 Make SetAspectRatio accept 0 as valid input, which would reset to null. diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index 31db3cdbfad4d97b3cd9aa3bd884ea4e1dc6e564..5787a24deaefd177ddc0ed1b2f897b36a2f84d64 100644 +index 9eb420b6499dcf97a687b833b04c67be28e4074d..081463f6199eb9d9b1205685379d08f60f8ea551 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -@@ -484,7 +484,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) { +@@ -483,7 +483,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) { } void DesktopWindowTreeHostWin::SetAspectRatio(const gfx::SizeF& aspect_ratio) { @@ -19,7 +19,7 @@ index 31db3cdbfad4d97b3cd9aa3bd884ea4e1dc6e564..5787a24deaefd177ddc0ed1b2f897b36 aspect_ratio.height()); } diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 1013375edabb6e59338bcd9266f04ee09668098e..80b0e1cb9f52c8b25f00d538733c0c15c2df0196 100644 +index e92d9cd727d1347db2d455811cc9d4c731d44676..3dc8185c1fcb19ba20d90e3f5e999d1c4e6c1b1f 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -921,8 +921,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) { diff --git a/patches/chromium/expose_setuseragent_on_networkcontext.patch b/patches/chromium/expose_setuseragent_on_networkcontext.patch index 892a1dc10f8..15075ece0ae 100644 --- a/patches/chromium/expose_setuseragent_on_networkcontext.patch +++ b/patches/chromium/expose_setuseragent_on_networkcontext.patch @@ -33,10 +33,10 @@ index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a28970 DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings); }; diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index 1e220456a91ce81a994c611d9ef8efed88846bc0..d2dcb8d7f18e737a75659e103f760e43bb1d7ff3 100644 +index 8a00bf59c728217069000b1f1ece72e1540baf85..fc98675c01f64e6c674a7cdb4d9195edff446949 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -1128,6 +1128,13 @@ void NetworkContext::SetNetworkConditions( +@@ -1139,6 +1139,13 @@ void NetworkContext::SetNetworkConditions( std::move(network_conditions)); } @@ -51,10 +51,10 @@ index 1e220456a91ce81a994c611d9ef8efed88846bc0..d2dcb8d7f18e737a75659e103f760e43 // This may only be called on NetworkContexts created with the constructor // that calls MakeURLRequestContext(). diff --git a/services/network/network_context.h b/services/network/network_context.h -index 34281acc5a2dece3b84666b25f4af423a04bf8df..c4198cc21721f6c88074a1144618022a59689541 100644 +index 06b1a0d550de946aa41efca2be4efde694cc24c7..fe7c5c6501838e480c2bc95823e9f562839ad99c 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h -@@ -251,6 +251,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -254,6 +254,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext void CloseIdleConnections(CloseIdleConnectionsCallback callback) override; void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id, mojom::NetworkConditionsPtr conditions) override; @@ -63,10 +63,10 @@ index 34281acc5a2dece3b84666b25f4af423a04bf8df..c4198cc21721f6c88074a1144618022a void SetEnableReferrers(bool enable_referrers) override; #if BUILDFLAG(IS_CHROMEOS_ASH) diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index efe52249cbbcfed616d3190714ef037bdbde1621..84ab373ac9472bba739ca98c52b1f97c71169e88 100644 +index 7a62dfd110555d2bf6ed4be075967ce6396855ef..b35746e2850d7d724fcf3dc09ddbfea1ca56a746 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -1083,6 +1083,9 @@ interface NetworkContext { +@@ -948,6 +948,9 @@ interface NetworkContext { SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id, NetworkConditions? conditions); @@ -77,10 +77,10 @@ index efe52249cbbcfed616d3190714ef037bdbde1621..84ab373ac9472bba739ca98c52b1f97c SetAcceptLanguage(string new_accept_language); diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h -index e3f7acf5e828287f47eb3ba0d048a026a53f8a08..1d7bc55a002313ae8bc7e61c453f7aa113d35d8a 100644 +index f233265ccc0be9b412bf2e3e702e12614fa435c4..51006ddb52a0c4c4ea9f1cdb631cf4d75967bb66 100644 --- a/services/network/test/test_network_context.h +++ b/services/network/test/test_network_context.h -@@ -114,6 +114,7 @@ class TestNetworkContext : public mojom::NetworkContext { +@@ -117,6 +117,7 @@ class TestNetworkContext : public mojom::NetworkContext { void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {} void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id, mojom::NetworkConditionsPtr conditions) override {} diff --git a/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch index a10a08da943..734c46f1936 100644 --- a/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch +++ b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch @@ -13,11 +13,11 @@ uses internally for things like menus and devtools. We can remove this patch once it has in some shape been upstreamed. diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc -index 6f9221b95d5609d6bc3395bd3a3c81670877fdd0..bd4cd7cf50ea7f8816b35b3150bea8c459571231 100644 +index 3ee65184e31e7851a5f192f12318b813a5d3949a..7bc2abc443eaae2860b9178cd6d04b07fe2dbfac 100644 --- a/ui/native_theme/native_theme.cc +++ b/ui/native_theme/native_theme.cc -@@ -257,6 +257,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors) - NativeTheme::~NativeTheme() = default; +@@ -243,6 +243,8 @@ base::Optional NativeTheme::GetColorProviderColor( + } bool NativeTheme::ShouldUseDarkColors() const { + if (theme_source() == ThemeSource::kForcedLight) return false; @@ -26,12 +26,12 @@ index 6f9221b95d5609d6bc3395bd3a3c81670877fdd0..bd4cd7cf50ea7f8816b35b3150bea8c4 } diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h -index 20943ab98c28b2689d3e4f548dba95ad0e40b2da..a9364d386d42315e1fca52e4eb316569d3c7a9e0 100644 +index 0196aa21e880a517461001e7bbb1f3399bbc3b37..9375f55b6ab4a897d4e837e681eedf0145af9302 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h @@ -402,6 +402,22 @@ class NATIVE_THEME_EXPORT NativeTheme { - ColorId color_id, - ColorScheme color_scheme = ColorScheme::kDefault) const; + SkColor GetUnprocessedSystemColor(ColorId color_id, + ColorScheme color_scheme) const; + enum ThemeSource { + kSystem, @@ -52,7 +52,7 @@ index 20943ab98c28b2689d3e4f548dba95ad0e40b2da..a9364d386d42315e1fca52e4eb316569 // Returns a shared instance of the native theme that should be used for web // rendering. Do not use it in a normal application context (i.e. browser). // The returned object should not be deleted by the caller. This function is -@@ -552,6 +568,7 @@ class NATIVE_THEME_EXPORT NativeTheme { +@@ -568,6 +584,7 @@ class NATIVE_THEME_EXPORT NativeTheme { bool forced_colors_ = false; PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight; PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference; @@ -61,10 +61,10 @@ index 20943ab98c28b2689d3e4f548dba95ad0e40b2da..a9364d386d42315e1fca52e4eb316569 DISALLOW_COPY_AND_ASSIGN(NativeTheme); }; diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index f4dff8de98066ea0ee4fb30ce832b27707791743..3d8c850111c0bbcd724c752e5b717ee46cfd5852 100644 +index 90e3b67bd5c78be3ea0d0f0e4ef94bc95ea375a2..510791b29b6b16f92eecb804912992fd843c4d9c 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -741,6 +741,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -748,6 +748,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { // ...unless --force-dark-mode was specified in which case caveat emptor. if (InForcedColorsMode() && !IsForcedDarkMode()) return false; diff --git a/patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch b/patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch index 27d62b13f0b..b8dd7facc4d 100644 --- a/patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -6,10 +6,10 @@ Subject: feat: allow disabling blink scheduler throttling per RenderView This allows us to disable throttling for hidden windows. diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc -index 8d3e54fc773b1de7083e0630bac39c211973cd17..7acb88e44627804e356ffec3a3f3e6c06437d606 100644 +index a0dc55dc6751550527437b653f8a3ce782c755de..6e42cb67cc912620e32caaa40174cbd9c34218f1 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc -@@ -581,6 +581,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { +@@ -601,6 +601,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque); } @@ -22,10 +22,10 @@ index 8d3e54fc773b1de7083e0630bac39c211973cd17..7acb88e44627804e356ffec3a3f3e6c0 return is_active(); } diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h -index 9ac4773bb3600395b7e360b7c42aeb5e240607fc..cf7515a7c36cc394c37f851dd8c1371ebfeaa844 100644 +index 1af9066790af8f8b32186313e5c620908260e0eb..ab87e44fbaba1ad5d9cdaa00ee567b2ab414b2bf 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h -@@ -132,6 +132,7 @@ class CONTENT_EXPORT RenderViewHostImpl +@@ -133,6 +133,7 @@ class CONTENT_EXPORT RenderViewHostImpl RenderViewHostDelegate* GetDelegate() override; bool IsRenderViewLive() override; @@ -48,10 +48,10 @@ index 0edd8ddc099b2e66869d2d4fff42f761d3be6079..bcc704efaf27f9b042b349fa0b097917 // This interface should only be implemented inside content. friend class RenderViewHostImpl; diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h -index 3f455e17e167bd01a219abf2f6fd2b8e235cf3c8..5dd40d3e2f28cf53729801c6960a6f64d057bf7f 100644 +index cd191b07a0075245449035cfbe61c16ace913506..0364e1d649b10f998630f7775f8edb3e0585d536 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h -@@ -224,6 +224,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient, +@@ -223,6 +223,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient, static WindowOpenDisposition NavigationPolicyToDisposition( blink::WebNavigationPolicy policy); @@ -61,10 +61,10 @@ index 3f455e17e167bd01a219abf2f6fd2b8e235cf3c8..5dd40d3e2f28cf53729801c6960a6f64 #if defined(OS_ANDROID) diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom -index e122d4ffb857023841dabcb6fed352d7586d8344..3c7cd1cb8b204024a0835150302ee8896e01ee45 100644 +index 464faabf887dcdefa26a747393ccce851bf035d7..7048eec311563bd6f2b9eeba145c418a0f8f6c2d 100644 --- a/third_party/blink/public/mojom/page/page.mojom +++ b/third_party/blink/public/mojom/page/page.mojom -@@ -73,4 +73,7 @@ interface PageBroadcast { +@@ -76,4 +76,7 @@ interface PageBroadcast { // Set history offset and length. SetHistoryOffsetAndLength(int32 offset, int32 length); @@ -85,7 +85,7 @@ index e8212d4566666683d67590ef0fe11e452d71b6fc..b19500d4af881c795e84baff16e9973e // Visibility ----------------------------------------------------------- diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc -index a730ed9b13fc355542b7520b66fa015ac7ca58c4..fb994344ea53e17df84f176ad7d8722793b72cfd 100644 +index 222c8cda640b7255a8779f559eeba8151d63a673..a802da73e37c772760ee989ceda943a7f3ab8d6b 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -3516,6 +3516,13 @@ PageScheduler* WebViewImpl::Scheduler() const { @@ -113,10 +113,10 @@ index a730ed9b13fc355542b7520b66fa015ac7ca58c4..fb994344ea53e17df84f176ad7d87227 mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() { diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h -index a76b09c9226e45742847fbeac18bab6d8b7b7b7e..f1f878e483c9f7185c621cd803ac4855cb5e2067 100644 +index 9afdc9a5f84380436c0435662ae5c633bc7482f6..25fc8941370cb9ab0dd93402f5118e0184e6aca1 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.h +++ b/third_party/blink/renderer/core/exported/web_view_impl.h -@@ -368,6 +368,7 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -384,6 +384,7 @@ class CORE_EXPORT WebViewImpl final : public WebView, LocalDOMWindow* PagePopupWindow() const; PageScheduler* Scheduler() const override; @@ -124,8 +124,8 @@ index a76b09c9226e45742847fbeac18bab6d8b7b7b7e..f1f878e483c9f7185c621cd803ac4855 void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state, bool is_initial_state) override; mojom::blink::PageVisibilityState GetVisibilityState() override; -@@ -764,11 +765,18 @@ class CORE_EXPORT WebViewImpl final : public WebView, - SkColor background_color_override_ = Color::kTransparent; +@@ -780,11 +781,18 @@ class CORE_EXPORT WebViewImpl final : public WebView, + float zoom_factor_override_ = 0.f; + // TODO(bokan): Temporary debugging added to diagnose diff --git a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch index fbf67aae996..858258858bb 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -81,7 +81,7 @@ index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb3 private: const HWND hwnd_; diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn -index 85a18008a1344ab7c76d8df1338f8c7ab12850f8..3cc6f722fb63d47535fb91cfc2b1362c3328df2a 100644 +index 248021aeb18072215d77081158b73dc8107f8958..970171531b4a728becba5b0142471c2c976b7e35 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn @@ -129,6 +129,8 @@ viz_component("service") { @@ -484,10 +484,10 @@ index 0000000000000000000000000000000000000000..48fa86caaab3c15764f105eb7ad2aecf + +#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_ diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc -index 2bb30e5318b6b48c2e6d4b1f64a6a36c68f963d1..9e805f27a9d7d1c0aa68cdf9f48895c055ca7791 100644 +index 599b06c1765ef4ddbfeb2fd96e0875098f7c6ae1..2151fc8aa710162a3870639bd6e952df9d15a0be 100644 --- a/components/viz/service/display_embedder/software_output_device_win.cc +++ b/components/viz/service/display_embedder/software_output_device_win.cc -@@ -188,7 +188,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated( +@@ -191,7 +191,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated( if (!canvas_) return; @@ -497,10 +497,10 @@ index 2bb30e5318b6b48c2e6d4b1f64a6a36c68f963d1..9e805f27a9d7d1c0aa68cdf9f48895c0 waiting_on_draw_ack_ = true; diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc -index 8112abf9ca0bf214721f5996bb59f7458d9347d2..8b3c2a4cce0c4789fadd555b360dea2c145ae1a4 100644 +index 378ff94440c9f33ed3569d9818ca92083781cc48..831afb1678c889ac162666298849617d53bdc827 100644 --- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc +++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc -@@ -46,7 +46,8 @@ RootCompositorFrameSinkImpl::Create( +@@ -47,7 +47,8 @@ RootCompositorFrameSinkImpl::Create( params->gpu_compositing, params->widget, params->renderer_settings); auto output_surface = output_surface_provider->CreateOutputSurface( params->widget, params->gpu_compositing, display_client.get(), @@ -532,7 +532,7 @@ index 11ac1649ed0f5be1d12e8a30b8d170f86b8e9bb8..05746d9a561c3933ae0c5578467f20b4 compositor_data.display_client->GetBoundRemote(resize_task_runner_); diff --git a/services/viz/privileged/mojom/compositing/display_private.mojom b/services/viz/privileged/mojom/compositing/display_private.mojom -index 0c9686f3c8070000bf5b180d9c06a8817d430c4a..4538b95f6e71708144eb7752438b1b31d60cb2ca 100644 +index 56268cca8cd15bc7ac676b9e12f726cccd30a0e1..ce32565a23b598a2af12943179e4d6b79c245ead 100644 --- a/services/viz/privileged/mojom/compositing/display_private.mojom +++ b/services/viz/privileged/mojom/compositing/display_private.mojom @@ -85,7 +85,6 @@ interface DisplayClient { @@ -544,7 +544,7 @@ index 0c9686f3c8070000bf5b180d9c06a8817d430c4a..4538b95f6e71708144eb7752438b1b31 // Notifies that a swap has occurred and provides information about the pixel diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom -index a0b87925e0c9d02f586cc4e9446cbfcf12b7aa1c..71659834eec5237016f95f93defa9dcb30f0af52 100644 +index 427017cc9c38cbcaae4009e5dd62946a11f40d57..4cbbf3416cfd8f2f53c590e00b89d1fdf09c8811 100644 --- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom +++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom @@ -30,6 +30,7 @@ struct RootCompositorFrameSinkParams { @@ -567,10 +567,10 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h -index e1db8f745c077b2f57b39a48aeab434fe0e98541..ddafd1f2aa38ef30776fa89ffcf5d108be963ac9 100644 +index e4ff4cb0a2ec2ba5e469edc10e03abadb5bd660d..a4c55d9ca78168e23cad5ff6c0456f257acd8b8f 100644 --- a/ui/compositor/compositor.h +++ b/ui/compositor/compositor.h -@@ -77,6 +77,7 @@ class ExternalBeginFrameController; +@@ -78,6 +78,7 @@ class ExternalBeginFrameController; class DelegatedInkPointRenderer; } // namespace mojom class ContextProvider; @@ -578,7 +578,7 @@ index e1db8f745c077b2f57b39a48aeab434fe0e98541..ddafd1f2aa38ef30776fa89ffcf5d108 class HostFrameSinkManager; class LocalSurfaceId; class RasterContextProvider; -@@ -133,6 +134,16 @@ class COMPOSITOR_EXPORT ContextFactory { +@@ -134,6 +135,16 @@ class COMPOSITOR_EXPORT ContextFactory { virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0; }; @@ -595,7 +595,7 @@ index e1db8f745c077b2f57b39a48aeab434fe0e98541..ddafd1f2aa38ef30776fa89ffcf5d108 // 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 -@@ -167,6 +178,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -169,6 +180,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -605,7 +605,7 @@ index e1db8f745c077b2f57b39a48aeab434fe0e98541..ddafd1f2aa38ef30776fa89ffcf5d108 // Sets the root of the layer tree drawn by this Compositor. The root layer // must have no parent. The compositor's root layer is reset if the root layer // is destroyed. NULL can be passed to reset the root layer, in which case the -@@ -435,6 +449,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -440,6 +454,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, std::unique_ptr pending_begin_frame_args_; diff --git a/patches/chromium/fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch b/patches/chromium/fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch index 3260a967c23..b1e99bd71ab 100644 --- a/patches/chromium/fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch +++ b/patches/chromium/fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch @@ -7,7 +7,7 @@ Subject: Disable usage of pthread_fchdir_np and pthread_chdir_np in MAS builds. diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc -index d3396d984086717e69d99cff3107ab09506b2b02..237e310b12eb9814f7da9103cf61d69e423b2920 100644 +index 05ad8648a42cdca97d12167246a305373cb5aba3..e3c31792dbc3d9cc94c1e01aa3cfda4e35b6008c 100644 --- a/base/process/launch_mac.cc +++ b/base/process/launch_mac.cc @@ -27,8 +27,10 @@ extern "C" { diff --git a/patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch b/patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch index 67d94b94526..aa08ad6f3a1 100644 --- a/patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch +++ b/patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch @@ -7,7 +7,7 @@ This tweaks Chrome's Accessibility support at chrome://accessibility to make it usable from Electron by removing Profile references. diff --git a/chrome/browser/accessibility/accessibility_ui.cc b/chrome/browser/accessibility/accessibility_ui.cc -index 4453990236f07a58932f50701f31fab961d0fb9e..6193689e879f5e147ca1e6514fb2061423d31400 100644 +index eed11ee2d85b655073f3e5c704a5d5349a935cb6..c36379a17d564ea96de8172fbdf057f0d85b66fc 100644 --- a/chrome/browser/accessibility/accessibility_ui.cc +++ b/chrome/browser/accessibility/accessibility_ui.cc @@ -20,7 +20,10 @@ @@ -97,7 +97,7 @@ index 4453990236f07a58932f50701f31fab961d0fb9e..6193689e879f5e147ca1e6514fb20614 return; } -@@ -615,10 +622,12 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree( +@@ -614,10 +621,12 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree( AXPropertyFilter::ALLOW_EMPTY); AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY); @@ -111,7 +111,7 @@ index 4453990236f07a58932f50701f31fab961d0fb9e..6193689e879f5e147ca1e6514fb20614 result->SetString(kTreeField, accessibility_contents); FireWebUIListener(request_type, *(result.get())); } -@@ -642,6 +651,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree( +@@ -641,6 +650,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree( AXPropertyFilter::ALLOW_EMPTY); AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY); @@ -119,7 +119,7 @@ index 4453990236f07a58932f50701f31fab961d0fb9e..6193689e879f5e147ca1e6514fb20614 for (Browser* browser : *BrowserList::GetInstance()) { if (browser->session_id().id() == session_id) { std::unique_ptr result( -@@ -656,6 +666,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree( +@@ -655,6 +665,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree( return; } } @@ -127,7 +127,7 @@ index 4453990236f07a58932f50701f31fab961d0fb9e..6193689e879f5e147ca1e6514fb20614 #endif // !defined(OS_ANDROID) // No browser with the specified |session_id| was found. std::unique_ptr result(new base::DictionaryValue()); -@@ -771,5 +782,7 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents( +@@ -770,5 +781,7 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents( // static void AccessibilityUIMessageHandler::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { diff --git a/patches/chromium/fix_properly_honor_printing_page_ranges.patch b/patches/chromium/fix_properly_honor_printing_page_ranges.patch index c61dfd56622..e8d63efe6ee 100644 --- a/patches/chromium/fix_properly_honor_printing_page_ranges.patch +++ b/patches/chromium/fix_properly_honor_printing_page_ranges.patch @@ -10,7 +10,7 @@ them should they exist. This will be upstreamed. diff --git a/printing/printing_context_mac.h b/printing/printing_context_mac.h -index f63f7f2674d9562f57dea4f9c9f473aa595a0c5f..78a46dbea7ff31209748ef47d541725397d80616 100644 +index 00c78a7446480a15a4dfa360ccdc438eaf1215c1..5b0db3e754ac6c9e335365173800d2e1a5ca629d 100644 --- a/printing/printing_context_mac.h +++ b/printing/printing_context_mac.h @@ -82,6 +82,10 @@ class PRINTING_EXPORT PrintingContextMac : public PrintingContext { @@ -25,7 +25,7 @@ index f63f7f2674d9562f57dea4f9c9f473aa595a0c5f..78a46dbea7ff31209748ef47d5417253 // Returns true if duplex mode is set. bool SetDuplexModeInPrintSettings(mojom::DuplexMode mode); diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm -index aa950b59390fdae9a5152affb7a7438cb78eb6f4..9b5307bda7b73cb502fe185be2a7c02e23a7722c 100644 +index ff9b3e08d49cb0daec83df36257729ff2636fe66..20031e220903f0882bef091ed048f47c4c5dc61c 100644 --- a/printing/printing_context_mac.mm +++ b/printing/printing_context_mac.mm @@ -189,7 +189,8 @@ PMPaper MatchPaper(CFArrayRef paper_list, @@ -100,7 +100,7 @@ index fe7fc797504dcc7097a3d79a2dab2c18de737048..20c63b1f657f2969850b31eaafdff7e5 } else { // No need to bother, we don't know how many pages are available. diff --git a/ui/gtk/printing/print_dialog_gtk.cc b/ui/gtk/printing/print_dialog_gtk.cc -index f2ed36e1258f4f3ef1bfce972e215e3d5d7335b6..5b38bf1369a68546f0aeea8948abba995c65e7f7 100644 +index d2ed5cbe4a48abe0026dda24a016da654e7e201a..d1bdf05c89e2c2aef71e8a8a2bf293725b2559d3 100644 --- a/ui/gtk/printing/print_dialog_gtk.cc +++ b/ui/gtk/printing/print_dialog_gtk.cc @@ -239,6 +239,24 @@ void PrintDialogGtk::UpdateSettings( diff --git a/patches/chromium/fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch b/patches/chromium/fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch index 6b4ddb32357..3d36f8b2300 100644 --- a/patches/chromium/fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch +++ b/patches/chromium/fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch @@ -13,10 +13,10 @@ This patch can be removed once app.allowRendererProcessReuse is forced to true as then Chromiums assumptions around processes become correct. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 5c06f5d680357028cffa00f3dfdc17ff02a4a560..cefe0bab7ab42c8b0697cb64fc687545251f7410 100644 +index b5750a26185df8deed608e5d1bda8479d4a54aac..f64f3680ea16d3857db32eb2d8da8ffd3173bae1 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3026,11 +3026,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) { +@@ -3056,11 +3056,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) { WebContentsImpl* outermost = GetOutermostWebContents(); if (event.button == blink::WebPointerProperties::Button::kBack && outermost->GetController().CanGoBack()) { diff --git a/patches/chromium/fix_use_electron_generated_resources.patch b/patches/chromium/fix_use_electron_generated_resources.patch index 8311e7f2208..2b9745d5ea2 100644 --- a/patches/chromium/fix_use_electron_generated_resources.patch +++ b/patches/chromium/fix_use_electron_generated_resources.patch @@ -12,7 +12,7 @@ as they will loaded as empty strings. * IDS_UTILITY_PROCESS_PRINTING_SERVICE_NAME on Windows diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc -index 33fd198d1c92ad20c5f6243bc64956a7d9488e1f..40e5444e48ad8a2b15bace12cf4a28165902ccc8 100644 +index 0944d8c843985ee2f72e28bca37105a681cb82bb..6b1a3a1b7f8b776323d321d0b425e040654646a9 100644 --- a/chrome/browser/pdf/pdf_extension_util.cc +++ b/chrome/browser/pdf/pdf_extension_util.cc @@ -9,8 +9,7 @@ diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index 53e59e7c357..93e8f6b5f9b 100644 --- a/patches/chromium/frame_host_manager.patch +++ b/patches/chromium/frame_host_manager.patch @@ -8,7 +8,7 @@ and respond with custom instance. Also allows for us to at-runtime enable or disable this patch. diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc -index 2fdd2b3f3f8dcc14a2675b1c115d7b700a33c2e0..9f20f0f37890af424aba566f88653e6142d944eb 100644 +index b21dc7ca8847378ca87df6dd1a76ff79fbbf0a07..b118ec64382a725a7ef29de617d657f1bf436189 100644 --- a/content/browser/browsing_instance.cc +++ b/content/browser/browsing_instance.cc @@ -77,6 +77,13 @@ scoped_refptr BrowsingInstance::GetSiteInstanceForURL( @@ -42,10 +42,10 @@ index 65e627f2fa89352b0be27b5813d71a622bf1d326..113f4fd00f1cf994b39f64c9da387855 // another SiteInstance for the same site. void RegisterSiteInstance(SiteInstanceImpl* site_instance); diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc -index 7bd420257285961e5cd6f7b2367e251dbec97749..13a291fb52a4b588257522fbcf6bafb330f94ed2 100644 +index 6425cd2197aed8ff8b3a905ed5f6d38d92a27df7..c1d29c2684ed3d09ae12446e841c2c749c67c28a 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -1538,6 +1538,21 @@ void NavigationRequest::BeginNavigation() { +@@ -1570,6 +1570,21 @@ void NavigationRequest::BeginNavigation() { if (IsSameDocument()) { render_frame_host_ = frame_tree_node_->current_frame_host(); } else { @@ -67,7 +67,7 @@ index 7bd420257285961e5cd6f7b2367e251dbec97749..13a291fb52a4b588257522fbcf6bafb3 // Select an appropriate RenderFrameHost. std::string frame_host_choice_reason; render_frame_host_ = -@@ -5574,6 +5589,7 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const { +@@ -5746,6 +5761,7 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const { {WILL_START_REQUEST, { WILL_REDIRECT_REQUEST, WILL_PROCESS_RESPONSE, @@ -75,7 +75,7 @@ index 7bd420257285961e5cd6f7b2367e251dbec97749..13a291fb52a4b588257522fbcf6bafb3 READY_TO_COMMIT, DID_COMMIT, CANCELING, -@@ -5587,10 +5603,14 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const { +@@ -5759,10 +5775,14 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const { WILL_FAIL_REQUEST, }}, {WILL_PROCESS_RESPONSE, { @@ -91,10 +91,10 @@ index 7bd420257285961e5cd6f7b2367e251dbec97749..13a291fb52a4b588257522fbcf6bafb3 NOT_STARTED, DID_COMMIT, diff --git a/content/browser/renderer_host/navigation_request.h b/content/browser/renderer_host/navigation_request.h -index 5dbfedddef3b345844863db6444e9d23ea2c5fe8..d7307760c29af9f902c7385b5c77c061860542ba 100644 +index f9428e4c272254e0ddd7e564ef8ad6ef6ef30575..f518415b564c066c21a113869987436e0ae1fa4d 100644 --- a/content/browser/renderer_host/navigation_request.h +++ b/content/browser/renderer_host/navigation_request.h -@@ -133,6 +133,10 @@ class CONTENT_EXPORT NavigationRequest +@@ -139,6 +139,10 @@ class CONTENT_EXPORT NavigationRequest // asynchronous. WILL_PROCESS_RESPONSE, @@ -106,10 +106,10 @@ index 5dbfedddef3b345844863db6444e9d23ea2c5fe8..d7307760c29af9f902c7385b5c77c061 READY_TO_COMMIT, diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc -index 8c15970fce8516a96aab3c4c23c62cd56ad2516a..31665aeb08b5b7c68e3cc8168d209ba12f7869ee 100644 +index d3cc62fa063918b50ceb8f854bcc737f9e53193f..e09db90709c7b7b1c652d6e1b12e513d5bd6a10e 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc -@@ -2758,6 +2758,16 @@ scoped_refptr +@@ -2804,6 +2804,16 @@ scoped_refptr RenderFrameHostManager::GetSiteInstanceForNavigationRequest( NavigationRequest* request, std::string* reason) { @@ -126,7 +126,7 @@ index 8c15970fce8516a96aab3c4c23c62cd56ad2516a..31665aeb08b5b7c68e3cc8168d209ba1 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); // All children of MHTML documents must be MHTML documents. They all live in -@@ -2785,10 +2795,59 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -2831,10 +2841,59 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( // // TODO(clamy): We should also consider as a candidate SiteInstance the // speculative SiteInstance that was computed on redirects. @@ -190,7 +190,7 @@ index 8c15970fce8516a96aab3c4c23c62cd56ad2516a..31665aeb08b5b7c68e3cc8168d209ba1 // Account for renderer-initiated reload as well. // Needed as a workaround for https://crbug.com/1045524, remove it when it is -@@ -2828,6 +2887,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -2867,6 +2926,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request->ResetStateForSiteInstanceChange(); } @@ -201,10 +201,10 @@ index 8c15970fce8516a96aab3c4c23c62cd56ad2516a..31665aeb08b5b7c68e3cc8168d209ba1 } diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc -index 5dc7e7e2a1a9809f71fd115c240d736e09553314..55bdf011d7af564096e2f453faaf580172887878 100644 +index 216d9a065146a10fd6187cde30ce725ac1acf2a8..807125e8b47793efe998b76e95e94aae62259107 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc -@@ -792,6 +792,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const SiteInfo& site_info) { +@@ -1015,6 +1015,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const SiteInfo& site_info) { return browsing_instance_->HasSiteInstance(site_info); } @@ -216,10 +216,10 @@ index 5dc7e7e2a1a9809f71fd115c240d736e09553314..55bdf011d7af564096e2f453faaf5801 const GURL& url) { return GetRelatedSiteInstanceImpl( diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h -index 6aae4093ee732480f711a210fea0873a5e7ac77a..cb11fa9e3a425377ebc39067be69563047003d21 100644 +index 95da3d92e7732c233148ebdc8df0e8e440109bee..b32f71aaedad4e291cd18009c23845f754eea7ca 100644 --- a/content/browser/site_instance_impl.h +++ b/content/browser/site_instance_impl.h -@@ -335,6 +335,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance, +@@ -409,6 +409,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance, BrowserContext* GetBrowserContext() override; const GURL& GetSiteURL() override; scoped_refptr GetRelatedSiteInstance(const GURL& url) override; @@ -228,10 +228,10 @@ index 6aae4093ee732480f711a210fea0873a5e7ac77a..cb11fa9e3a425377ebc39067be695630 size_t GetRelatedActiveContentsCount() override; bool RequiresDedicatedProcess() override; diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc -index 343fc9aa93967500f313809f825ac01122852dfe..f7fa2a7fcf14a049f1cfa29bd86d335a3cb044c9 100644 +index 8d899d675d0eca0856269e9887371a6f633ef767..060d1fd273f4cd8da5898c0eb5b3b21bd38d766a 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -66,6 +66,21 @@ +@@ -69,6 +69,21 @@ namespace content { @@ -254,12 +254,12 @@ index 343fc9aa93967500f313809f825ac01122852dfe..f7fa2a7fcf14a049f1cfa29bd86d335a const MainFunctionParams& parameters) { return nullptr; diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index b1f955f30528077ab0aea5a343781b3221113249..2f828109553a26b91270d84d320e988a3793a822 100644 +index 52a300a553742469ad7eea7ccb85e5e9988363b7..656706320502312bd81a3af4e4185692cc841adb 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -254,8 +254,45 @@ class CONTENT_EXPORT ContentBrowserClient { - using IsClipboardPasteAllowedCallback = - base::OnceCallback; +@@ -257,8 +257,45 @@ class CONTENT_EXPORT ContentBrowserClient { + using IsClipboardPasteContentAllowedCallback = + base::OnceCallback; + // Identifies the type of site instance to use for a navigation. + enum SiteInstanceForNavigationType { @@ -304,7 +304,7 @@ index b1f955f30528077ab0aea5a343781b3221113249..2f828109553a26b91270d84d320e988a // implementations for the browser startup code. See comments in // browser_main_parts.h. diff --git a/content/public/browser/site_instance.h b/content/public/browser/site_instance.h -index a721f2fbab6e621085a8c7806abd92b8077340a8..e9b936e05e1d6ac8ea6eb5eb4d412b37ae4acc86 100644 +index 25502c2f733b63618ca4960501228a62dd181a64..c7234855bfd176cb334a296a8b19fd10a4052a3d 100644 --- a/content/public/browser/site_instance.h +++ b/content/public/browser/site_instance.h @@ -135,6 +135,11 @@ class CONTENT_EXPORT SiteInstance : public base::RefCounted { diff --git a/patches/chromium/gin_enable_disable_v8_platform.patch b/patches/chromium/gin_enable_disable_v8_platform.patch index 94ae28fb7ca..2c9c346b694 100644 --- a/patches/chromium/gin_enable_disable_v8_platform.patch +++ b/patches/chromium/gin_enable_disable_v8_platform.patch @@ -38,7 +38,7 @@ index f23af2d9738f3aa76e3a49301e1c3216ee4a64b4..ede178acabc63c3c33d6ce93efd5632b v8::Isolate* isolate() { return isolate_; } diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc -index ac74939f36630673c4ee9db02bef320f17c86154..3dd0f2be0be9ac5194523333aa0d822eaa9eb814 100644 +index e9cc71b968428b8806db8ad5089cc84f28f8cdbb..e5eff4f655bbaa1379499c2e480a930648e8d84b 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc @@ -198,12 +198,14 @@ enum LoadV8FileResult { diff --git a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch index ef16444b356..059b64d4852 100644 --- a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch +++ b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch @@ -40,10 +40,10 @@ index 23bd3c93795488055a4db2d81c22d7fdb18b0092..5c23468ec6289f331fd4aabdb844fcb8 // Update the GPU feature info. This updates the blocklist and enabled status // of GPU rasterization. In the future this will be used for more features. diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc -index bb38974278df53fab6f91bfce1a94b3a686beced..957a464f86940441d70b012351d6f6d82bae284f 100644 +index 8546a5b6accf1e848a6ef31bbd1e9049a165e2a2..eca11c451cb7e23412ae0942a558cd188d173951 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc -@@ -1073,6 +1073,11 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { +@@ -1075,6 +1075,11 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { host->ForceShutdown(); } diff --git a/patches/chromium/gritsettings_resource_ids.patch b/patches/chromium/gritsettings_resource_ids.patch index 5ed849b53d5..2c4c51c3b9d 100644 --- a/patches/chromium/gritsettings_resource_ids.patch +++ b/patches/chromium/gritsettings_resource_ids.patch @@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch Add electron resources file to the list of resource ids generation. diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec -index 6d19ae8a5a125b28d2228408383ccbed9496f10f..407f779d5ca671a065e60c166486cfc6fd912713 100644 +index cecbbaf47ca01d6a27b1fae6e973658a92a524ad..e90cd439ed661f8364394f5a1097129bc8fb5097 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec -@@ -723,6 +723,11 @@ +@@ -753,6 +753,11 @@ "includes": [3880], }, diff --git a/patches/chromium/gtk_visibility.patch b/patches/chromium/gtk_visibility.patch index 6ee108df05d..d36a23c120f 100644 --- a/patches/chromium/gtk_visibility.patch +++ b/patches/chromium/gtk_visibility.patch @@ -6,10 +6,10 @@ Subject: gtk_visibility.patch Allow electron to depend on GTK in the GN build. diff --git a/build/config/linux/gtk/BUILD.gn b/build/config/linux/gtk/BUILD.gn -index 5491aef735fc277521acbff97c1484fa81ef9ba4..8ff2728d1843e6d436aa2c59a6b991f2f257e864 100644 +index 150276479687782e9902af2c5435c3cea9df5295..42a4f685d75f7b20082e506331507bfe0b3044bd 100644 --- a/build/config/linux/gtk/BUILD.gn +++ b/build/config/linux/gtk/BUILD.gn -@@ -29,6 +29,8 @@ group("gtk") { +@@ -35,6 +35,8 @@ group("gtk") { # This should probably be moved into //ui/gtk. "//ui/ozone/platform/wayland", diff --git a/patches/chromium/mas_disable_remote_accessibility.patch b/patches/chromium/mas_disable_remote_accessibility.patch index a55009516f1..94581082ad5 100644 --- a/patches/chromium/mas_disable_remote_accessibility.patch +++ b/patches/chromium/mas_disable_remote_accessibility.patch @@ -47,7 +47,7 @@ index 9ddda9116e7284cbccde8a51e23ad7560dd06367..e846091ad99b0154636489e53491209f } // namespace diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -index d2b88549b3005cf5fe43fc57c35403696c94ba80..f14d779670711f5aa4a46ac310bc94082cef7d7f 100644 +index 276ef2a830848af488f12746d25f12413101342e..82d2d75adc0b659be392fc8d6068fa09880e1993 100644 --- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm +++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm @@ -550,10 +550,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { @@ -90,7 +90,7 @@ index c3a9fbf0f9d2b80c1de42a22ad094a286f0b559b..02493d4b62c98a3aebd3e460c459218a DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewBridgeOwner); }; diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h -index 055d28d8c6f6cc6826db1f888b1ea0f535c3c716..1eedb217a700ffdc73d30c5daadf003d1cec7bed 100644 +index dee1fd0bbbb3239ed435f9adbfc50fa6f898a7de..69d9fc9da5638e1e0c908210959cb0e8440babaa 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h @@ -46,7 +46,9 @@ class ScopedPasswordInputEnabler; @@ -103,7 +103,7 @@ index 055d28d8c6f6cc6826db1f888b1ea0f535c3c716..1eedb217a700ffdc73d30c5daadf003d @class RenderWidgetHostViewCocoa; namespace content { -@@ -640,10 +642,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac +@@ -643,10 +645,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac // EnsureSurfaceSynchronizedForWebTest(). uint32_t latest_capture_sequence_number_ = 0u; @@ -117,10 +117,10 @@ index 055d28d8c6f6cc6826db1f888b1ea0f535c3c716..1eedb217a700ffdc73d30c5daadf003d // Used to force the NSApplication's focused accessibility element to be the // content::BrowserAccessibilityCocoa accessibility tree when the NSView for 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 2b1574aa1669b0b5c9e7a38aba3f0345602bc440..bfa99980776b9aa216644ea146fbb1d1a085a85d 100644 +index dcde566593996b62833f20a65a24c658d3fcd629..925b5ab3e666c14f01745f59859ce25f14f64899 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -234,8 +234,10 @@ +@@ -236,8 +236,10 @@ void RenderWidgetHostViewMac::MigrateNSViewBridge( remote_cocoa::mojom::Application* remote_cocoa_application, uint64_t parent_ns_view_id) { @@ -131,7 +131,7 @@ index 2b1574aa1669b0b5c9e7a38aba3f0345602bc440..bfa99980776b9aa216644ea146fbb1d1 // Disconnect from the previous bridge (this will have the effect of // destroying the associated bridge), and close the receiver (to allow it -@@ -1383,8 +1385,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1395,8 +1397,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, gfx::NativeViewAccessible RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() { @@ -142,7 +142,7 @@ index 2b1574aa1669b0b5c9e7a38aba3f0345602bc440..bfa99980776b9aa216644ea146fbb1d1 return [GetInProcessNSView() window]; } -@@ -1416,9 +1420,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1428,9 +1432,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, } void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) { @@ -154,7 +154,7 @@ index 2b1574aa1669b0b5c9e7a38aba3f0345602bc440..bfa99980776b9aa216644ea146fbb1d1 } bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame( -@@ -1906,12 +1912,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1918,12 +1924,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken( const std::vector& window_token) { @@ -170,10 +170,10 @@ index 2b1574aa1669b0b5c9e7a38aba3f0345602bc440..bfa99980776b9aa216644ea146fbb1d1 /////////////////////////////////////////////////////////////////////////////// diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index 8987ed3c59a3b482cae14f2cce71a6febfd41a73..dc646e919475198d332004d59cde25d2a3044988 100644 +index eee1067a534be43aa47bb0d803011ddb8edd3f83..b9c9c32e3e3d71e10fa8f341a000696b54822e6a 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn -@@ -314,6 +314,13 @@ component("base") { +@@ -317,6 +317,13 @@ component("base") { ] } @@ -208,10 +208,10 @@ index e7adfee3210ec723c687adfcc4bee8827ef643e7..25a924a47eeb30d783ef83dbb4896c4b + #endif // UI_BASE_COCOA_REMOTE_ACCESSIBILITY_API_H_ diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h -index 492386c61ac6701fc38c5e90976b4e5f638189de..6050916081ebeb426ee6cf5dd67962f0961a1a94 100644 +index 69d612b69a91228c55bd71ed15244dc7d19ea4b7..a3078e7372bf1e928dcd8c0f023ae8e5d6f051a0 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.h +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h -@@ -29,7 +29,9 @@ +@@ -30,7 +30,9 @@ #include "ui/views/window/dialog_observer.h" @class NativeWidgetMacNSWindow; @@ -221,7 +221,7 @@ index 492386c61ac6701fc38c5e90976b4e5f638189de..6050916081ebeb426ee6cf5dd67962f0 @class NSView; namespace remote_cocoa { -@@ -408,11 +410,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost +@@ -409,11 +411,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost mojo::AssociatedRemote remote_ns_window_remote_; @@ -236,7 +236,7 @@ index 492386c61ac6701fc38c5e90976b4e5f638189de..6050916081ebeb426ee6cf5dd67962f0 // Used to force the NSApplication's focused accessibility element to be the // views::Views accessibility tree when the NSView for this is focused. diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm -index d0be0e2ff2d9477376514ed2e6fd648a9dad94ec..e9d7b4b0a1aa036b4f000cc979c45d7a5a557617 100644 +index eecf660ac81c6dbd85ee6cbcf490fb434cb5cf0e..19e145d22eeabb871799f6a7abb113c8c62a25a1 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm @@ -284,14 +284,22 @@ void HandleAccelerator(const ui::Accelerator& accelerator, @@ -262,7 +262,7 @@ index d0be0e2ff2d9477376514ed2e6fd648a9dad94ec..e9d7b4b0a1aa036b4f000cc979c45d7a } remote_cocoa::mojom::NativeWidgetNSWindow* -@@ -1133,6 +1141,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -1145,6 +1153,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator, void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens( const std::vector& window_token, const std::vector& view_token) { @@ -270,7 +270,7 @@ index d0be0e2ff2d9477376514ed2e6fd648a9dad94ec..e9d7b4b0a1aa036b4f000cc979c45d7a remote_window_accessible_ = ui::RemoteAccessibility::GetRemoteElementFromToken(window_token); remote_view_accessible_ = -@@ -1140,14 +1149,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -1152,14 +1161,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator, [remote_view_accessible_ setWindowUIElement:remote_window_accessible_.get()]; [remote_view_accessible_ setTopLevelUIElement:remote_window_accessible_.get()]; diff --git a/patches/chromium/mas_no_private_api.patch b/patches/chromium/mas_no_private_api.patch index 5c8ed2f47af..0a623ebdef2 100644 --- a/patches/chromium/mas_no_private_api.patch +++ b/patches/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/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm -index fa612b156034ca30446ccec5ec82098eafdf13a3..c6c06d1d62aee91a15827f30bf07b256e4d76c4e 100644 +index 1659e070cae733cf2213d752fcc262fb2bce2b54..57a3a34365f723b6e75a5f90d50533a45773e395 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm +++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm -@@ -238,7 +238,7 @@ +@@ -261,7 +261,7 @@ return PopulateSize([value sizeValue]); } } @@ -18,8 +18,8 @@ index fa612b156034ca30446ccec5ec82098eafdf13a3..c6c06d1d62aee91a15827f30bf07b256 +#ifndef MAS_BUILD // AXTextMarker if (content::IsAXTextMarker(value)) { - return PopulateTextPosition(content::AXTextMarkerToPosition(value).get(), -@@ -249,6 +249,7 @@ + return PopulateTextPosition(content::AXTextMarkerToAXPosition(value), +@@ -272,6 +272,7 @@ if (content::IsAXTextMarkerRange(value)) { return PopulateTextMarkerRange(value, line_indexer); } @@ -27,17 +27,17 @@ index fa612b156034ca30446ccec5ec82098eafdf13a3..c6c06d1d62aee91a15827f30bf07b256 // AXValue if (CFGetTypeID(value) == AXValueGetTypeID()) { -@@ -359,7 +360,7 @@ +@@ -384,7 +385,7 @@ kConstValuePrefix + affinity); return set; } - +#ifndef MAS_BUILD base::Value AccessibilityTreeFormatterMac::PopulateTextMarkerRange( - id object, + id marker_range, const LineIndexer* line_indexer) const { -@@ -373,7 +374,7 @@ - dict.SetPath("focus", PopulateTextPosition(range.focus(), line_indexer)); +@@ -400,7 +401,7 @@ + PopulateTextPosition(ax_range.focus()->Clone(), line_indexer)); return dict; } - @@ -46,7 +46,7 @@ index fa612b156034ca30446ccec5ec82098eafdf13a3..c6c06d1d62aee91a15827f30bf07b256 NSArray* node_array, const LineIndexer* line_indexer) const { diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm -index 955a1c85425016cf13b2447cbf1aec9607a135c6..18a2de387cb09e24ff599dd556cef0fcf6777a0a 100644 +index 88f339d1669436db9c1e4d048a46fc28038c83fe..2e194c5174c24552eb684faa339ad92b640d9dd7 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm +++ b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm @@ -234,6 +234,7 @@ @@ -73,19 +73,19 @@ index 955a1c85425016cf13b2447cbf1aec9607a135c6..18a2de387cb09e24ff599dd556cef0fc id AttributeInvoker::DictNodeToTextMarker( const AXPropertyNode& dictnode) const { if (!dictnode.IsDict()) { -@@ -410,6 +413,7 @@ OptionalNSObject TextMarkerRangeGetEndMarker(const OptionalNSObject& obj) { +@@ -413,6 +416,7 @@ OptionalNSObject TextMarkerRangeGetEndMarker(const OptionalNSObject& obj) { return OptionalNSObject::NotNilOrError(content::AXTextMarkerFrom( - cocoa_node, position->text_offset(), position->affinity())); + cocoa_node, range.focus()->text_offset(), range.focus()->affinity())); } +#endif OptionalNSObject MakePairArray(const OptionalNSObject& obj1, const OptionalNSObject& obj2) { diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h -index 33a689c23c72b1d18d0fceb595a4a45cf2790454..808eaf45096fbeb5d4bd62448c64078cccd13701 100644 +index a7d6351854d08926c4e9c43c95e9075bd4d4c728..9c89595cb6c37527b96b4afde387133349ec5999 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.h +++ b/content/browser/accessibility/browser_accessibility_cocoa.h -@@ -147,7 +147,9 @@ id AXTextMarkerRangeFrom(id anchor_textmarker, id focus_textmarker); +@@ -156,7 +156,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker); @property(nonatomic, readonly) NSNumber* enabled; // Returns a text marker that points to the last character in the document that // can be selected with Voiceover. @@ -95,7 +95,7 @@ index 33a689c23c72b1d18d0fceb595a4a45cf2790454..808eaf45096fbeb5d4bd62448c64078c @property(nonatomic, readonly) NSNumber* expanded; @property(nonatomic, readonly) NSNumber* focused; @property(nonatomic, readonly) NSNumber* grabbed; -@@ -159,7 +161,9 @@ id AXTextMarkerRangeFrom(id anchor_textmarker, id focus_textmarker); +@@ -168,7 +170,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker); // Index of a row, column, or tree item. @property(nonatomic, readonly) NSNumber* index; @property(nonatomic, readonly) NSNumber* treeItemRowIndex; @@ -105,7 +105,7 @@ index 33a689c23c72b1d18d0fceb595a4a45cf2790454..808eaf45096fbeb5d4bd62448c64078c @property(nonatomic, readonly) NSString* invalid; @property(nonatomic, readonly) NSNumber* isMultiSelectable; @property(nonatomic, readonly) NSString* placeholderValue; -@@ -182,14 +186,18 @@ id AXTextMarkerRangeFrom(id anchor_textmarker, id focus_textmarker); +@@ -191,14 +195,18 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker); // The object is selected as a whole. @property(nonatomic, readonly) NSNumber* selected; @property(nonatomic, readonly) NSArray* selectedChildren; @@ -125,10 +125,10 @@ index 33a689c23c72b1d18d0fceb595a4a45cf2790454..808eaf45096fbeb5d4bd62448c64078c // 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 b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21ca82a926 100644 +index 86e56961584a26746cc254e8d0f53fe29f62fdb9..2d8265b3d41ce834d29f2764daf4be4aad15a1d1 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm -@@ -209,6 +209,7 @@ +@@ -202,6 +202,7 @@ NSString* const NSAccessibilityLengthForTextMarkerRangeParameterizedAttribute = @"AXLengthForTextMarkerRange"; @@ -136,7 +136,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 // Private attributes that can be used for testing text markers, e.g. in dump // tree tests. NSString* const -@@ -220,6 +221,7 @@ +@@ -213,6 +214,7 @@ NSString* const NSAccessibilityTextMarkerNodeDebugDescriptionParameterizedAttribute = @"AXTextMarkerNodeDebugDescription"; @@ -144,7 +144,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 // Other private attributes. NSString* const NSAccessibilityIdentifierChromeAttribute = @"ChromeAXNodeId"; -@@ -244,6 +246,7 @@ +@@ -237,6 +239,7 @@ // VoiceOver uses -1 to mean "no limit" for AXResultsLimit. const int kAXResultsLimitNoLimit = -1; @@ -152,7 +152,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 extern "C" { // The following are private accessibility APIs required for cursor navigation -@@ -467,6 +470,7 @@ void AddMisspelledTextAttributes(const AXPlatformRange& ax_range, +@@ -472,6 +475,7 @@ void AddMisspelledTextAttributes(const BrowserAccessibility::AXRange& ax_range, AddMisspelledTextAttributes(ax_range, attributed_text); return attributed_text; } @@ -160,7 +160,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 // Returns an autoreleased copy of the AXNodeData's attribute. NSString* NSStringForStringAttribute(BrowserAccessibility* browserAccessibility, -@@ -738,6 +742,7 @@ bool IsSelectedStateRelevant(BrowserAccessibility* item) { +@@ -743,6 +747,7 @@ bool IsSelectedStateRelevant(BrowserAccessibility* item) { #define NSAccessibilityLanguageAttribute @"AXLanguage" #endif @@ -168,7 +168,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 bool content::IsAXTextMarker(id object) { if (object == nil) return false; -@@ -781,6 +786,7 @@ bool IsSelectedStateRelevant(BrowserAccessibility* item) { +@@ -786,6 +791,7 @@ bool IsSelectedStateRelevant(BrowserAccessibility* item) { kCFAllocatorDefault, anchor_textmarker, focus_textmarker); return [static_cast(cf_marker_range) autorelease]; } @@ -176,7 +176,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 @implementation BrowserAccessibilityCocoa -@@ -820,7 +826,9 @@ + (void)initialize { +@@ -825,7 +831,9 @@ + (void)initialize { {NSAccessibilityEditableAncestorAttribute, @"editableAncestor"}, {NSAccessibilityElementBusyAttribute, @"elementBusy"}, {NSAccessibilityEnabledAttribute, @"enabled"}, @@ -186,7 +186,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 {NSAccessibilityExpandedAttribute, @"expanded"}, {NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"}, {NSAccessibilityFocusedAttribute, @"focused"}, -@@ -832,8 +840,10 @@ + (void)initialize { +@@ -837,8 +845,10 @@ + (void)initialize { {NSAccessibilityHighestEditableAncestorAttribute, @"highestEditableAncestor"}, {NSAccessibilityIndexAttribute, @"index"}, @@ -197,7 +197,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 {NSAccessibilityInvalidAttribute, @"invalid"}, {NSAccessibilityIsMultiSelectableAttribute, @"isMultiSelectable"}, {NSAccessibilityLanguageAttribute, @"language"}, -@@ -855,13 +865,17 @@ + (void)initialize { +@@ -860,13 +870,17 @@ + (void)initialize { {NSAccessibilityRowsAttribute, @"rows"}, // TODO(aboxhall): expose // NSAccessibilityServesAsTitleForUIElementsAttribute @@ -215,7 +215,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 {NSAccessibilitySizeAttribute, @"size"}, {NSAccessibilitySortDirectionAttribute, @"sortDirection"}, {NSAccessibilitySubroleAttribute, @"subrole"}, -@@ -1357,6 +1371,7 @@ - (NSNumber*)enabled { +@@ -1370,6 +1384,7 @@ - (NSNumber*)enabled { ax::mojom::Restriction::kDisabled); } @@ -223,15 +223,15 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 // Returns a text marker that points to the last character in the document that // can be selected with VoiceOver. - (id)endTextMarker { -@@ -1365,6 +1380,7 @@ - (id)endTextMarker { - BrowserAccessibilityPositionInstance position = _owner->CreatePositionAt(0); +@@ -1378,6 +1393,7 @@ - (id)endTextMarker { + BrowserAccessibility::AXPosition position = _owner->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtEndOfContent()); } +#endif - (NSNumber*)expanded { if (![self instanceActive]) -@@ -1565,6 +1581,7 @@ - (bool)findRowIndex:(BrowserAccessibilityCocoa*)toFind +@@ -1578,6 +1594,7 @@ - (bool)findRowIndex:(BrowserAccessibilityCocoa*)toFind return false; } @@ -239,7 +239,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 - (NSNumber*)insertionPointLineNumber { if (![self instanceActive]) return nil; -@@ -1590,6 +1607,7 @@ - (NSNumber*)insertionPointLineNumber { +@@ -1603,6 +1620,7 @@ - (NSNumber*)insertionPointLineNumber { caretPosition->AsTextPosition()->text_offset()); return @(std::distance(lineBreaks.begin(), iterator)); } @@ -247,8 +247,8 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 // Returns whether or not this node should be ignored in the // accessibility tree. -@@ -1941,8 +1959,12 @@ - (BOOL)shouldExposeTitleUIElement { - return content::AXTextEdit(newValue, base::string16(), nil); +@@ -1954,8 +1972,12 @@ - (BOOL)shouldExposeTitleUIElement { + return content::AXTextEdit(newValue, std::u16string(), nil); } } +#ifndef MAS_BUILD @@ -260,7 +260,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 } - (BOOL)instanceActive { -@@ -2267,6 +2289,7 @@ - (NSArray*)selectedChildren { +@@ -2283,6 +2305,7 @@ - (NSArray*)selectedChildren { return ret; } @@ -268,7 +268,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 - (NSString*)selectedText { if (![self instanceActive]) return nil; -@@ -2278,11 +2301,13 @@ - (NSString*)selectedText { +@@ -2294,11 +2317,13 @@ - (NSString*)selectedText { return nil; return base::SysUTF16ToNSString(range.GetText()); } @@ -282,7 +282,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 - (NSValue*)selectedTextRange { if (![self instanceActive]) return nil; -@@ -2306,7 +2331,9 @@ - (NSValue*)selectedTextRange { +@@ -2323,7 +2348,9 @@ - (NSValue*)selectedTextRange { int selLength = range.GetText().length(); return [NSValue valueWithRange:NSMakeRange(selStart, selLength)]; } @@ -292,7 +292,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 - (id)selectedTextMarkerRange { if (![self instanceActive]) return nil; -@@ -2318,6 +2345,7 @@ - (id)selectedTextMarkerRange { +@@ -2335,6 +2362,7 @@ - (id)selectedTextMarkerRange { // words correctly. return CreateTextMarkerRange(ax_range.AsBackwardRange()); } @@ -300,7 +300,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 - (NSValue*)size { if (![self instanceActive]) -@@ -2350,6 +2378,7 @@ - (NSString*)sortDirection { +@@ -2367,6 +2395,7 @@ - (NSString*)sortDirection { return nil; } @@ -308,41 +308,38 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 // Returns a text marker that points to the first character in the document that // can be selected with VoiceOver. - (id)startTextMarker { -@@ -2358,6 +2387,7 @@ - (id)startTextMarker { - BrowserAccessibilityPositionInstance position = _owner->CreatePositionAt(0); +@@ -2375,6 +2404,7 @@ - (id)startTextMarker { + BrowserAccessibility::AXPosition position = _owner->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtStartOfContent()); } +#endif // Returns a subrole based upon the role. - (NSString*)subrole { -@@ -2687,11 +2717,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range { +@@ -2704,12 +2734,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range { NSMutableAttributedString* attributedInnerText = [[[NSMutableAttributedString alloc] initWithString:base::SysUTF16ToNSString(innerText)] autorelease]; +#ifndef MAS_BUILD if (!_owner->IsText()) { - AXPlatformRange ax_range(_owner->CreatePositionAt(0), - _owner->CreatePositionAt(int{innerText.length()})); + BrowserAccessibility::AXRange ax_range( + _owner->CreatePositionAt(0), + _owner->CreatePositionAt(int{innerText.length()})); AddMisspelledTextAttributes(ax_range, attributedInnerText); } +#endif return [attributedInnerText attributedSubstringFromRange:range]; } -@@ -2804,9 +2836,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2822,6 +2854,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return ToBrowserAccessibilityCocoa(cell); } -- if ([attribute -- isEqualToString: -- NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) { +#ifndef MAS_BUILD -+ if ([attribute isEqualToString:NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) { - BrowserAccessibilityPositionInstance position = - CreatePositionFromTextMarker(parameter); - if (!position->IsNullPosition()) -@@ -3119,6 +3150,7 @@ AXPlatformRange range(std::move(lineStartPosition), + if ([attribute + isEqualToString: + NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) { +@@ -3145,6 +3178,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return CreateTextMarker(root->CreatePositionAt(index)); } @@ -350,7 +347,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 if ([attribute isEqualToString: NSAccessibilityBoundsForRangeParameterizedAttribute]) { -@@ -3149,6 +3181,7 @@ AXPlatformRange range(std::move(lineStartPosition), +@@ -3175,6 +3209,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return nil; } @@ -358,7 +355,7 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 if ([attribute isEqualToString: NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) { -@@ -3263,6 +3296,7 @@ AXPlatformRange range(std::move(lineStartPosition), +@@ -3292,6 +3327,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return @(child->GetIndexInParent()); } @@ -366,27 +363,27 @@ index b5940319ae17bfaf43daf18feb42722bf3705bdd..d997cfaa6275a570686d0c1703c30f21 return nil; } -@@ -3792,6 +3826,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { - AXPlatformRange(_owner->CreatePositionAt(range.location), - _owner->CreatePositionAt(NSMaxRange(range)))); +@@ -3821,6 +3857,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { + _owner->CreatePositionAt(range.location), + _owner->CreatePositionAt(NSMaxRange(range)))); } +#ifndef MAS_BUILD if ([attribute isEqualToString:NSAccessibilitySelectedTextMarkerRangeAttribute]) { - AXPlatformRange range = CreateRangeFromTextMarkerRange(value); -@@ -3801,6 +3836,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { - manager->SetSelection(AXPlatformRange(range.anchor()->AsLeafTextPosition(), - range.focus()->AsLeafTextPosition())); + BrowserAccessibility::AXRange range = CreateRangeFromTextMarkerRange(value); +@@ -3831,6 +3868,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { + BrowserAccessibility::AXRange(range.anchor()->AsLeafTextPosition(), + range.focus()->AsLeafTextPosition())); } +#endif } - (id)accessibilityFocusedUIElement { diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm -index 03eb8ace47bc9262a05ac82747e1e67ffb1d5c97..ef39544bbf418099621784362660f5004934835d 100644 +index 2a5163acf68b8a26b562dd0ab54e78fb408e89fe..98a5b1efc461d8f46becd78a4e19c410300e40e0 100644 --- a/content/browser/accessibility/browser_accessibility_manager_mac.mm +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm -@@ -483,7 +483,7 @@ void PostAnnouncementNotification(NSString* announcement) { +@@ -482,7 +482,7 @@ void PostAnnouncementNotification(NSString* announcement) { if (native_focus_object && [native_focus_object instanceActive]) { [user_info setObject:native_focus_object forKey:ui::NSAccessibilityTextChangeElement]; @@ -395,7 +392,7 @@ index 03eb8ace47bc9262a05ac82747e1e67ffb1d5c97..ef39544bbf418099621784362660f500 id selected_text = [native_focus_object selectedTextMarkerRange]; if (selected_text) { NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute = -@@ -491,6 +491,7 @@ void PostAnnouncementNotification(NSString* announcement) { +@@ -490,6 +490,7 @@ void PostAnnouncementNotification(NSString* announcement) { [user_info setObject:selected_text forKey:NSAccessibilitySelectedTextMarkerRangeAttribute]; } @@ -518,10 +515,10 @@ index b56737af6f4da7cc01f78430c53dfa5afd1bc6df..60cdaa18e55acfd5817d2689bdb5a0ec void BluetoothAdapterMac::RemovePairingDelegateInternal( diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn -index 426d34399bdcb5494bc451fabd5c05fd901dce54..22d20a43f9717443a17056e4c3b561d63b469a0d 100644 +index c68099d5baa0fec203313e8734d2d659578d687d..4a724e0f744722a4ba30ff6e22b56997364e4c49 100644 --- a/media/audio/BUILD.gn +++ b/media/audio/BUILD.gn -@@ -177,6 +177,12 @@ source_set("audio") { +@@ -175,6 +175,12 @@ source_set("audio") { "mac/scoped_audio_unit.cc", "mac/scoped_audio_unit.h", ] diff --git a/patches/chromium/moves_background_color_setter_of_webview_to_blinks_webprefs_logic.patch b/patches/chromium/moves_background_color_setter_of_webview_to_blinks_webprefs_logic.patch index 25eb6020d39..129531d2873 100644 --- a/patches/chromium/moves_background_color_setter_of_webview_to_blinks_webprefs_logic.patch +++ b/patches/chromium/moves_background_color_setter_of_webview_to_blinks_webprefs_logic.patch @@ -12,7 +12,7 @@ Ideally we could add an embedder observer pattern here but that can be done in future work. diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc -index fb994344ea53e17df84f176ad7d8722793b72cfd..fb3d42378d1ec2611c3c2055f96380e3a9873847 100644 +index a802da73e37c772760ee989ceda943a7f3ab8d6b..7993fe5b4fb13db3a3493b7f536da1446740ce2d 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -154,6 +154,7 @@ @@ -23,7 +23,7 @@ index fb994344ea53e17df84f176ad7d8722793b72cfd..fb3d42378d1ec2611c3c2055f96380e3 #include "third_party/blink/renderer/platform/graphics/image.h" #include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h" #include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h" -@@ -1763,6 +1764,14 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, +@@ -1765,6 +1766,14 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, RuntimeEnabledFeatures::SetTranslateServiceEnabled( prefs.translate_service_available); diff --git a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch index 9b2395e9a26..172d3f0cc42 100644 --- a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch +++ b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch @@ -7,10 +7,10 @@ This adds a callback from the network service that's used to implement session.setCertificateVerifyCallback. diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index dc1d135df68e8f11619faffb57dfd38b41bc06d1..1e220456a91ce81a994c611d9ef8efed88846bc0 100644 +index 8e53d65ddca7b54a6effd1767257a4d8239251d8..8a00bf59c728217069000b1f1ece72e1540baf85 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -117,6 +117,11 @@ +@@ -116,6 +116,11 @@ #include "services/network/url_loader.h" #include "services/network/url_request_context_builder_mojo.h" @@ -22,7 +22,7 @@ index dc1d135df68e8f11619faffb57dfd38b41bc06d1..1e220456a91ce81a994c611d9ef8efed #if BUILDFLAG(IS_CT_SUPPORTED) #include "components/certificate_transparency/chrome_ct_policy_enforcer.h" #include "components/certificate_transparency/chrome_require_ct_delegate.h" -@@ -375,6 +380,79 @@ bool SCTAuditingDelegate::IsSCTAuditingEnabled() { +@@ -374,6 +379,79 @@ bool SCTAuditingDelegate::IsSCTAuditingEnabled() { } // namespace @@ -102,7 +102,7 @@ index dc1d135df68e8f11619faffb57dfd38b41bc06d1..1e220456a91ce81a994c611d9ef8efed constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess; NetworkContext::PendingCertVerify::PendingCertVerify() = default; -@@ -574,6 +652,13 @@ void NetworkContext::SetClient( +@@ -573,6 +651,13 @@ void NetworkContext::SetClient( client_.Bind(std::move(client)); } @@ -116,18 +116,18 @@ index dc1d135df68e8f11619faffb57dfd38b41bc06d1..1e220456a91ce81a994c611d9ef8efed void NetworkContext::CreateURLLoaderFactory( mojo::PendingReceiver receiver, mojom::URLLoaderFactoryParamsPtr params) { -@@ -1900,6 +1985,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( - std::move(cert_verifier), std::move(ct_verifier)); - } - #endif // BUILDFLAG(IS_CT_SUPPORTED) +@@ -1930,6 +2015,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( + std::move(cert_verifier)); + cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_); + #endif // BUILDFLAG(IS_CHROMEOS_ASH) + auto remote_cert_verifier = std::make_unique(std::move(cert_verifier)); + remote_cert_verifier_ = remote_cert_verifier.get(); -+ cert_verifier = std::move(remote_cert_verifier); ++ cert_verifier = std::make_unique(std::move(remote_cert_verifier)); + } - // Whether the cert verifier is remote or in-process, we should wrap it in - // caching and coalescing layers to avoid extra verifications and IPCs. + builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier( diff --git a/services/network/network_context.h b/services/network/network_context.h -index 102548a7f132cd1f7d46421fc2ae941dbff7c29d..34281acc5a2dece3b84666b25f4af423a04bf8df 100644 +index 72885bc1d20a4da5ad4df3fb8185f05bcf6fbfba..06b1a0d550de946aa41efca2be4efde694cc24c7 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h @@ -90,6 +90,7 @@ class DomainReliabilityMonitor; @@ -147,7 +147,7 @@ index 102548a7f132cd1f7d46421fc2ae941dbff7c29d..34281acc5a2dece3b84666b25f4af423 void ResetURLLoaderFactories() override; void GetCookieManager( mojo::PendingReceiver receiver) override; -@@ -693,6 +696,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -696,6 +699,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext CertVerifierWithTrustAnchors* cert_verifier_with_trust_anchors_ = nullptr; #endif @@ -157,10 +157,10 @@ index 102548a7f132cd1f7d46421fc2ae941dbff7c29d..34281acc5a2dece3b84666b25f4af423 // CertNetFetcher is not used by the current platform, or if the actual // net::CertVerifier is instantiated outside of the network service. diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 6f5abd0fa955f15584cb15a4a0dee6d47c657a1e..efe52249cbbcfed616d3190714ef037bdbde1621 100644 +index 49aefdb660cf522e44ce22bb7d183481d0948e85..7a62dfd110555d2bf6ed4be075967ce6396855ef 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -222,6 +222,17 @@ struct CTPolicy { +@@ -192,6 +192,17 @@ struct CTPolicy { array excluded_legacy_spkis; }; @@ -178,7 +178,7 @@ index 6f5abd0fa955f15584cb15a4a0dee6d47c657a1e..efe52249cbbcfed616d3190714ef037b // Parameters for constructing a network context. struct NetworkContextParams { // Name used by memory tools to identify the context. -@@ -870,6 +881,9 @@ interface NetworkContext { +@@ -728,6 +739,9 @@ interface NetworkContext { // Sets a client for this network context. SetClient(pending_remote client); diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index 0cec9be4359..305c868029b 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -7,7 +7,7 @@ Pass RenderProcessHost through to PlatformNotificationService 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 d756a1b8cfeba5900c95863ca29cb15d9e1b15e4..3159df3456483453b9b362bb8942b45160d67b4d 100644 +index 13faa9c4587faf1d75efd0b454d72386d78ecf08..703739cf8ee486a2dd1396e6275b5b7ae8f54ffb 100644 --- a/content/browser/notifications/blink_notification_service_impl.cc +++ b/content/browser/notifications/blink_notification_service_impl.cc @@ -87,9 +87,11 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl( @@ -108,10 +108,10 @@ index 60558d5f40b765ed3ca2f7d1abc1b95f7518fee9..ab44370dc89f64fe2b86089fd9781b71 mojo::PendingReceiver receiver); diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 0f62a9f4e236e8e91e06dfb5751cde17dddb7233..df3ff59008839c786217661e8862ba54580590ed 100644 +index 4ad8b7863cb001c741e0947d1e1fd5b195e81b53..8c7c5e9b0ee97e2471718cd50d1b0e1eab718df9 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2179,7 +2179,7 @@ void RenderProcessHostImpl::CreateNotificationService( +@@ -2107,7 +2107,7 @@ void RenderProcessHostImpl::CreateNotificationService( mojo::PendingReceiver receiver) { DCHECK_CURRENTLY_ON(BrowserThread::UI); storage_partition_impl_->GetPlatformNotificationContext()->CreateService( @@ -142,7 +142,7 @@ index ca61088079c4150fcf389504ddcf26bcf6bf69cd..d9c034c39890eef1fe3d95c6d7c0ae68 const GURL& origin, const blink::PlatformNotificationData& notification_data, diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc -index 2f5b8be21c8b37bb6a0c7fe52c87cb7f9debbca0..7934f6e625584466ff0aabc69583343c728759ea 100644 +index 1d8a0687f9ec7e7894c74ac94f1648ad3c1621c8..05450dbe825552e00136837ee4ec4e5373201a45 100644 --- a/content/test/mock_platform_notification_service.cc +++ b/content/test/mock_platform_notification_service.cc @@ -30,6 +30,7 @@ MockPlatformNotificationService::MockPlatformNotificationService( @@ -154,10 +154,10 @@ index 2f5b8be21c8b37bb6a0c7fe52c87cb7f9debbca0..7934f6e625584466ff0aabc69583343c const GURL& origin, const blink::PlatformNotificationData& notification_data, diff --git a/content/test/mock_platform_notification_service.h b/content/test/mock_platform_notification_service.h -index 6d108f9884f7e8f608b70ec33d286a06346e7456..4650a01c2d090c5957eb7a7e21f124489513142a 100644 +index d5d2a3b413dfe73bdf9f1a561d85482512fb2e37..c550def2a79a12b618f855816da50f9dfe3db0bb 100644 --- a/content/test/mock_platform_notification_service.h +++ b/content/test/mock_platform_notification_service.h -@@ -47,6 +47,7 @@ class MockPlatformNotificationService : public PlatformNotificationService { +@@ -46,6 +46,7 @@ class MockPlatformNotificationService : public PlatformNotificationService { // PlatformNotificationService implementation. void DisplayNotification( diff --git a/patches/chromium/patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch b/patches/chromium/patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch deleted file mode 100644 index f4050cd0035..00000000000 --- a/patches/chromium/patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jeremy Apthorp -Date: Fri, 12 Apr 2019 12:47:57 -0700 -Subject: patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch - -This patches the ensure_gn_version_py script to work on macOS CI. -This script is temporary until https://crbug.com/944667 is resolved. We need to -patch it because on mac CI, we check out the source code on Linux, which -confuses the script. - -diff --git a/buildtools/ensure_gn_version.py b/buildtools/ensure_gn_version.py -index cfc75a37792a93f209a0e7543d577a18d004a615..dd8c3468a914f44050b19002cb2c2df312038398 100755 ---- a/buildtools/ensure_gn_version.py -+++ b/buildtools/ensure_gn_version.py -@@ -45,6 +45,11 @@ def ChmodGnFile(path_to_exe): - stat.S_IROTH | stat.S_IXOTH) - - def main(): -+ # NB. on Electron's CI we check out the macOS source on Linux. Bypass this -+ # check as it's not relevant on Electron CI and it gets confused. -+ if os.environ.get('CI') is not None: -+ return 0 -+ - parser = argparse.ArgumentParser() - parser.add_argument('version', - help='CIPD "git_revision:XYZ" label for GN to sync to') diff --git a/patches/chromium/picture-in-picture.patch b/patches/chromium/picture-in-picture.patch index b34857a79fe..03b273d242a 100644 --- a/patches/chromium/picture-in-picture.patch +++ b/patches/chromium/picture-in-picture.patch @@ -9,7 +9,7 @@ don't get errors for Chrome's generated resources, which are non-existent because we don't generate them in our build. diff --git a/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc b/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc -index 664500224b99779388b5fabfface02a9ff599fdc..2be06a3e1934a73b9825953a3b897f5bc0f12540 100644 +index 84b64238fdf3a4cb13226af338a1cb3257f3a869..3fb23fab89abdb1eca15b549c9495edd0af03472 100644 --- a/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc +++ b/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc @@ -4,7 +4,7 @@ @@ -22,7 +22,7 @@ index 664500224b99779388b5fabfface02a9ff599fdc..2be06a3e1934a73b9825953a3b897f5b #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/color_palette.h" diff --git a/chrome/browser/ui/views/overlay/close_image_button.cc b/chrome/browser/ui/views/overlay/close_image_button.cc -index 79b969d83f5b2dcee7ece6c18ac9a1dcf47ac5a1..a4d38d5d0e248cf92195f649b96c77cd1a22583f 100644 +index a4f6f5dbbf08fc2c7e5f158d0ad170f98c80b4e4..916898ce712ce3327788882fa60048b7390731ee 100644 --- a/chrome/browser/ui/views/overlay/close_image_button.cc +++ b/chrome/browser/ui/views/overlay/close_image_button.cc @@ -5,7 +5,7 @@ @@ -35,7 +35,7 @@ index 79b969d83f5b2dcee7ece6c18ac9a1dcf47ac5a1..a4d38d5d0e248cf92195f649b96c77cd #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/color_palette.h" diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc -index 33c56c2c7b50561d03ba93346caa12b9da0fa6ab..f0daf2e4125f1aa34750b636449d0af2b70397bc 100644 +index b148e526ebb4de0111a07a971f038141889bda31..a163cdf5841186235513d9bd9d4ad7279e946d3f 100644 --- a/chrome/browser/ui/views/overlay/overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc @@ -15,16 +15,18 @@ @@ -73,11 +73,11 @@ index 33c56c2c7b50561d03ba93346caa12b9da0fa6ab..f0daf2e4125f1aa34750b636449d0af2 -#if defined(OS_WIN) +#if 0 - base::string16 app_user_model_id; + std::wstring app_user_model_id; Browser* browser = chrome::FindBrowserWithWebContents(controller->GetWebContents()); diff --git a/chrome/browser/ui/views/overlay/playback_image_button.cc b/chrome/browser/ui/views/overlay/playback_image_button.cc -index 36261d8e71b00aadbecc4d5e7c5d0568742481f4..13f4f6b451cd73e67792a5d8750a89af483b2d12 100644 +index 578d17812c1eedcd262b13c1a38338876a7b455e..774b1376750694e5082b88a0f1a15328e0766985 100644 --- a/chrome/browser/ui/views/overlay/playback_image_button.cc +++ b/chrome/browser/ui/views/overlay/playback_image_button.cc @@ -5,7 +5,7 @@ @@ -90,7 +90,7 @@ index 36261d8e71b00aadbecc4d5e7c5d0568742481f4..13f4f6b451cd73e67792a5d8750a89af #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/ui/views/overlay/resize_handle_button.cc b/chrome/browser/ui/views/overlay/resize_handle_button.cc -index b1272d8664afdd5c05afcb38a2f533741f210554..20f7ffa8be09b046122430c4497edce807f5d69f 100644 +index 5598da600a3172bde389d34537230e1502c05df1..a63d65a715de32e9ccad653bdbdf12b154265f32 100644 --- a/chrome/browser/ui/views/overlay/resize_handle_button.cc +++ b/chrome/browser/ui/views/overlay/resize_handle_button.cc @@ -5,7 +5,7 @@ @@ -103,7 +103,7 @@ index b1272d8664afdd5c05afcb38a2f533741f210554..20f7ffa8be09b046122430c4497edce8 #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/ui/views/overlay/skip_ad_label_button.cc b/chrome/browser/ui/views/overlay/skip_ad_label_button.cc -index 61b52275ad685ffc4970dd5e58714310e9af0835..72c0199189bf0efbb7530f12a5c8dc3e72cc783c 100644 +index e5a05b7b04c9679f0b61f0b997f5326ccf881dbf..7ddd4d5f9b55a403b207445f86d78ec62cfc9cc9 100644 --- a/chrome/browser/ui/views/overlay/skip_ad_label_button.cc +++ b/chrome/browser/ui/views/overlay/skip_ad_label_button.cc @@ -4,7 +4,7 @@ @@ -116,7 +116,7 @@ index 61b52275ad685ffc4970dd5e58714310e9af0835..72c0199189bf0efbb7530f12a5c8dc3e #include "ui/gfx/color_palette.h" #include "ui/views/background.h" diff --git a/chrome/browser/ui/views/overlay/track_image_button.cc b/chrome/browser/ui/views/overlay/track_image_button.cc -index c0d070733148d2c9e0271b125ab6e09c55a4f686..f93ca7115cc7c7ed85007d3a392e5bd85426cae3 100644 +index 82b18daa41184fa97da3cfca2fd80d766dfa40ba..bf00f25c64b3e126b61b2e2dc2a29fb9d46ebe7d 100644 --- a/chrome/browser/ui/views/overlay/track_image_button.cc +++ b/chrome/browser/ui/views/overlay/track_image_button.cc @@ -5,7 +5,7 @@ diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index 33e5aa7aea8..3935d125f1f 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -11,7 +11,7 @@ majority of changes originally come from these PRs: This patch also fixes callback for manual user cancellation and success. diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc -index 1f33cee63624693729b27caabb9f25891cf169f8..3d20b4e11497d91bf24b433846440a26df3effa4 100644 +index 3cff6d2a77cdd5e9303873c5e70d27f08a1b95c2..a0eeb96a74e0e40d0656c9670594f15a0dd906a0 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc @@ -350,18 +350,25 @@ void PrintJob::StartPdfToEmfConversion( @@ -43,7 +43,7 @@ index 1f33cee63624693729b27caabb9f25891cf169f8..3d20b4e11497d91bf24b433846440a26 using RenderMode = PdfRenderSettings::Mode; RenderMode mode; diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc -index 47a5b3c2a11ec595ff926df10f856ed3c5375c55..38769ab454b143a1f50d1291a363092cd3dad407 100644 +index 91edb6e296fd94491a7b379f289e3f7a0b91a53b..ec4fd72f889188869a8ee05ffee2132207b98d48 100644 --- a/chrome/browser/printing/print_job_worker.cc +++ b/chrome/browser/printing/print_job_worker.cc @@ -22,7 +22,6 @@ @@ -102,7 +102,7 @@ index 47a5b3c2a11ec595ff926df10f856ed3c5375c55..38769ab454b143a1f50d1291a363092c } diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc -index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d5f953a78 100644 +index 9aa99b764ad8620ca82c511ac22a981141cdf15c..3b6e1d2609af952fa825688833387518cafdb352 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc @@ -28,10 +28,10 @@ @@ -129,16 +129,16 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d @@ -75,6 +76,8 @@ using PrintSettingsCallback = base::OnceCallback)>; - void ShowWarningMessageBox(const base::string16& message) { + void ShowWarningMessageBox(const std::u16string& message) { + LOG(ERROR) << "Invalid printer settings " << message; +#if 0 // Runs always on the UI thread. static bool is_dialog_shown = false; if (is_dialog_shown) -@@ -83,6 +86,7 @@ void ShowWarningMessageBox(const base::string16& message) { +@@ -83,6 +86,7 @@ void ShowWarningMessageBox(const std::u16string& message) { base::AutoReset auto_reset(&is_dialog_shown, true); - chrome::ShowWarningMessageBox(nullptr, base::string16(), message); + chrome::ShowWarningMessageBox(nullptr, std::u16string(), message); +#endif } @@ -154,7 +154,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d RenderParamsFromPrintSettings(printer_query->settings(), params->params.get()); params->params->document_cookie = printer_query->cookie(); -@@ -348,12 +354,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents) +@@ -345,12 +351,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents) : PrintManager(web_contents), queue_(g_browser_process->print_job_manager()->queue()) { DCHECK(queue_); @@ -169,7 +169,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d } PrintViewManagerBase::~PrintViewManagerBase() { -@@ -361,7 +369,10 @@ PrintViewManagerBase::~PrintViewManagerBase() { +@@ -358,7 +366,10 @@ PrintViewManagerBase::~PrintViewManagerBase() { DisconnectFromCurrentPrintJob(); } @@ -181,7 +181,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d DisconnectFromCurrentPrintJob(); // Don't print / print preview crashed tabs. -@@ -369,7 +380,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) { +@@ -366,7 +377,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) { return false; SetPrintingRFH(rfh); @@ -197,7 +197,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d return true; } -@@ -490,9 +508,9 @@ void PrintViewManagerBase::StartLocalPrintJob( +@@ -487,9 +505,9 @@ void PrintViewManagerBase::StartLocalPrintJob( void PrintViewManagerBase::UpdatePrintingEnabled() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // The Unretained() is safe because ForEachFrame() is synchronous. @@ -210,7 +210,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d } void PrintViewManagerBase::NavigationStopped() { -@@ -609,12 +627,13 @@ void PrintViewManagerBase::DidPrintDocument( +@@ -606,12 +624,13 @@ void PrintViewManagerBase::DidPrintDocument( void PrintViewManagerBase::GetDefaultPrintSettings( GetDefaultPrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -225,7 +225,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d content::RenderFrameHost* render_frame_host = print_manager_host_receivers_.GetCurrentTargetFrame(); -@@ -630,11 +649,12 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -627,11 +646,12 @@ void PrintViewManagerBase::UpdatePrintSettings( base::Value job_settings, UpdatePrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -239,7 +239,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d if (!job_settings.FindIntKey(kSettingPrinterType)) { UpdatePrintSettingsReply(std::move(callback), nullptr, false); return; -@@ -673,7 +693,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) { +@@ -665,7 +685,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) { PrintManager::PrintingFailed(cookie); #if BUILDFLAG(ENABLE_PRINT_PREVIEW) @@ -248,7 +248,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d #endif ReleasePrinterQuery(); -@@ -685,6 +705,11 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) { +@@ -677,6 +697,11 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) { } void PrintViewManagerBase::ShowInvalidPrinterSettingsError() { @@ -260,7 +260,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&ShowWarningMessageBox, l10n_util::GetStringUTF16( -@@ -754,9 +779,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent( +@@ -746,9 +771,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent( content::NotificationService::NoDetails()); break; } @@ -276,7 +276,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d NOTREACHED(); break; } -@@ -854,8 +883,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -846,8 +875,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( DCHECK(!quit_inner_loop_); DCHECK(query); @@ -289,7 +289,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d // We can't print if there is no renderer. if (!web_contents()->GetMainFrame()->GetRenderViewHost() || -@@ -876,8 +907,6 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -868,8 +899,6 @@ bool PrintViewManagerBase::CreateNewPrintJob( /*source_id=*/""); #endif @@ -298,7 +298,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d printing_succeeded_ = false; return true; } -@@ -926,14 +955,22 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -918,14 +947,22 @@ void PrintViewManagerBase::ReleasePrintJob() { content::RenderFrameHost* rfh = printing_rfh_; printing_rfh_ = nullptr; @@ -323,7 +323,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d // Don't close the worker thread. print_job_ = nullptr; } -@@ -969,7 +1006,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { +@@ -961,7 +998,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { } bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) { @@ -333,7 +333,7 @@ index 81df8a2cb0c374c6a93520fdd3c1951752b3c1f3..cad3c7ab1f7182f596484fe29ad8a60d if (!cookie) { diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h -index 93103940036ece118c511703c20c659d73724202..fcbf4c69d1b6cd30124444158e3f2c6da3371977 100644 +index a96e5a33643e4f1b214bea6143d9e2744bb4e5c3..ccb9808bdb334a78ed7b64dd3030caff52055ad6 100644 --- a/chrome/browser/printing/print_view_manager_base.h +++ b/chrome/browser/printing/print_view_manager_base.h @@ -38,6 +38,8 @@ class PrintJob; @@ -387,10 +387,10 @@ index 4fde003f2a12794bfcd479ef2797cc6281c5720b..bc3bc4aee26f9373de35366ddb07f7ba // Tells the RenderFrame to switch the CSS to print media type, render every // requested page using the print preview document's frame/node, and then diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc -index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cffbe3671a1 100644 +index 54e6f97423fc08772cc3505e82fb8640178d41b0..c66aa6faaefad9b7d3b5371b5280356989da5e97 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc -@@ -41,6 +41,7 @@ +@@ -38,6 +38,7 @@ #include "printing/metafile_skia.h" #include "printing/mojom/print.mojom.h" #include "printing/print_job_constants.h" @@ -398,7 +398,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff #include "printing/units.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" -@@ -1169,7 +1170,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { +@@ -1165,7 +1166,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { if (!weak_this) return; @@ -408,7 +408,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff if (weak_this) web_frame->DispatchAfterPrintEvent(); -@@ -1196,7 +1198,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( +@@ -1193,7 +1195,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( receivers_.Add(this, std::move(receiver)); } @@ -417,7 +417,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr()); if (ipc_nesting_level_ > 1) return; -@@ -1211,7 +1213,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { +@@ -1208,7 +1210,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { // that instead. auto plugin = delegate_->GetPdfElement(frame); @@ -426,7 +426,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff if (!render_frame_gone_) frame->DispatchAfterPrintEvent(); -@@ -1230,7 +1232,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { +@@ -1227,7 +1229,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { } Print(frame, print_preview_context_.source_node(), @@ -436,7 +436,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff if (!render_frame_gone_) print_preview_context_.DispatchAfterPrintEvent(); // WARNING: |this| may be gone at this point. Do not do any more work here and -@@ -1278,6 +1281,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) { +@@ -1275,6 +1278,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) { if (ipc_nesting_level_ > 1) return; @@ -445,7 +445,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff print_preview_context_.OnPrintPreview(); if (print_preview_context_.IsForArc()) { -@@ -1852,7 +1857,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -1810,7 +1815,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { return; Print(duplicate_node.GetDocument().GetFrame(), duplicate_node, @@ -455,7 +455,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff // Check if |this| is still valid. if (!weak_this) return; -@@ -1867,7 +1873,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -1825,7 +1831,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -466,7 +466,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff // If still not finished with earlier print request simply ignore. if (prep_frame_view_) return; -@@ -1875,7 +1883,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -1833,7 +1841,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, FrameReference frame_ref(frame); uint32_t expected_page_count = 0; @@ -475,7 +475,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff DidFinishPrinting(FAIL_PRINT_INIT); return; // Failed to init print page settings. } -@@ -1894,8 +1902,41 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -1852,8 +1860,41 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, print_pages_params_->params->print_scaling_option; auto self = weak_ptr_factory_.GetWeakPtr(); @@ -518,7 +518,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff // Check if |this| is still valid. if (!self) return; -@@ -2144,7 +2185,9 @@ void PrintRenderFrameHelper::IPCProcessed() { +@@ -2102,7 +2143,9 @@ void PrintRenderFrameHelper::IPCProcessed() { } } @@ -529,7 +529,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff mojom::PrintPagesParams settings; settings.params = mojom::PrintParams::New(); GetPrintManagerHost()->GetDefaultPrintSettings(&settings.params); -@@ -2168,12 +2211,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) { +@@ -2126,12 +2169,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) { return result; } @@ -548,7 +548,7 @@ index cd1237696ff28e92aae5dd569b436a16deaf8777..c925bee8086b3b7918bcea9523244cff notify_browser_of_print_failure_ = false; GetPrintManagerHost()->ShowInvalidPrinterSettingsError(); return false; -@@ -2517,18 +2562,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) { +@@ -2486,18 +2531,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) { } bool PrintRenderFrameHelper::CheckForCancel() { @@ -622,10 +622,10 @@ index 92561ff7c6bce6febd8cd2f39f59e3df707f8bdb..241686fa8bdc346f073b5fb92f57c72c std::unique_ptr settings = PrintSettingsFromJobSettings(job_settings); diff --git a/printing/printing_context.h b/printing/printing_context.h -index 268e03d2b8d4f1c81f6ebe81b44ffa6252f88c4b..1baef8c1d58becf760b1576a2d541810a2f98555 100644 +index 0a9bf2b3a6c1f2417c550bb0f523491eccccb56b..a322f1897a69a8a8ca7c4bcb7a46b34726ff8127 100644 --- a/printing/printing_context.h +++ b/printing/printing_context.h -@@ -134,12 +134,12 @@ class PRINTING_EXPORT PrintingContext { +@@ -133,12 +133,12 @@ class PRINTING_EXPORT PrintingContext { int job_id() const { return job_id_; } diff --git a/patches/chromium/put_back_deleted_colors_for_autofill.patch b/patches/chromium/put_back_deleted_colors_for_autofill.patch index 4d9e0fb05ec..e4c917b3774 100644 --- a/patches/chromium/put_back_deleted_colors_for_autofill.patch +++ b/patches/chromium/put_back_deleted_colors_for_autofill.patch @@ -8,10 +8,10 @@ needed in chromium but our autofill implementation uses them. This patch can be our autofill implementation to work like Chromium's. diff --git a/ui/gtk/native_theme_gtk.cc b/ui/gtk/native_theme_gtk.cc -index 29ad448b1572856216b42d4f4737d844850b2ebb..5902d81f29984eb05a7c5324ab709e97e3b87557 100644 +index 8bcc5c175f63ea29d513d47dfea09ca3ac423545..d8b40ab1e35a93bc1a31c4735de29bb06ee40c8f 100644 --- a/ui/gtk/native_theme_gtk.cc +++ b/ui/gtk/native_theme_gtk.cc -@@ -357,6 +357,29 @@ base::Optional SkColorFromColorId( +@@ -364,6 +364,29 @@ base::Optional SkColorFromColorId( case ui::NativeTheme::kColorId_TableHeaderSeparator: return GetBorderColor("GtkTreeView#treeview.view GtkButton#button"); @@ -42,10 +42,10 @@ index 29ad448b1572856216b42d4f4737d844850b2ebb..5902d81f29984eb05a7c5324ab709e97 // TODO(thomasanderson): Render GtkSpinner directly. case ui::NativeTheme::kColorId_ThrobberSpinningColor: diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc -index 2969de7777e4104618149bacb99603b3f3fb416d..c7605301808133f9a995c0ceb95c84576d2cebd1 100644 +index 082e12fcabd16d3db77ee9c5e47f7e383245aa45..fc1d7a814c52fa09bea550039763b1c83fffc530 100644 --- a/ui/native_theme/common_theme.cc +++ b/ui/native_theme/common_theme.cc -@@ -64,7 +64,8 @@ base::Optional GetHighContrastColor( +@@ -52,7 +52,8 @@ base::Optional GetHighContrastColor( } } @@ -53,11 +53,11 @@ index 2969de7777e4104618149bacb99603b3f3fb416d..c7605301808133f9a995c0ceb95c8457 +base::Optional GetDarkSchemeColor(const NativeTheme* base_theme, + NativeTheme::ColorId color_id) { switch (color_id) { - // Dialogs - case NativeTheme::kColorId_WindowBackground: -@@ -83,6 +84,14 @@ base::Optional GetDarkSchemeColor(NativeTheme::ColorId color_id) { - case NativeTheme::kColorId_AvatarIconIncognito: - return gfx::kGoogleGrey200; + // Alert + case NativeTheme::kColorId_AlertSeverityLow: +@@ -64,6 +65,14 @@ base::Optional GetDarkSchemeColor(NativeTheme::ColorId color_id) { + case NativeTheme::kColorId_FootnoteContainerBorder: + return gfx::kGoogleGrey900; + // Results Tables + case NativeTheme::kColorId_ResultsTableNormalBackground: @@ -67,12 +67,12 @@ index 2969de7777e4104618149bacb99603b3f3fb416d..c7605301808133f9a995c0ceb95c8457 + case NativeTheme::kColorId_ResultsTableDimmedText: + return SkColorSetA(base_theme->GetSystemColor(NativeTheme::kColorId_ResultsTableNormalText), 0x80); + - // FocusableBorder - case NativeTheme::kColorId_FocusedBorderColor: - return SkColorSetA(gfx::kGoogleBlue300, 0x4D); -@@ -579,6 +588,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id, - case NativeTheme::kColorId_UnfocusedBorderColor: - return gfx::kGoogleGrey300; + // Button + case NativeTheme::kColorId_ProminentButtonColor: + return gfx::kGoogleBlue300; +@@ -512,6 +521,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id, + case NativeTheme::kColorId_WindowBackground: + return SK_ColorWHITE; + // Results Tables + case NativeTheme::kColorId_ResultsTableNormalBackground: @@ -86,23 +86,23 @@ index 2969de7777e4104618149bacb99603b3f3fb416d..c7605301808133f9a995c0ceb95c8457 + case NativeTheme::kColorId_ResultsTableDimmedText: + return SkColorSetRGB(0x64, 0x64, 0x64); + - // Material spinner/throbber - case NativeTheme::kColorId_ThrobberSpinningColor: - return gfx::kGoogleBlue600; -@@ -682,7 +703,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id, + case NativeTheme::kColorId_NumColors: + // Keeping the kColorId_NumColors case instead of using the default case + // allows ColorId additions to trigger compile error for an incomplete +@@ -556,7 +577,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id, } if (color_scheme == NativeTheme::ColorScheme::kDark) { - base::Optional color = GetDarkSchemeColor(color_id); + base::Optional color = GetDarkSchemeColor(base_theme, color_id); - if (color.has_value()) - return color.value(); - } + if (color.has_value()) { + DVLOG(2) << "GetDarkSchemeColor: " + << "NativeTheme::ColorId: " << NativeThemeColorIdName(color_id) diff --git a/ui/native_theme/native_theme_color_id.h b/ui/native_theme/native_theme_color_id.h -index d08b6a27c0377140562b8feee14b3ae595eb336e..b3d47ac70bc91f3e1cb9931560e6fb36cc6dfef5 100644 +index efb0f8658db38b99aadb92334b4c0948d289d224..a424ceaef8979084ca7dd514849a38dfe9e5b252 100644 --- a/ui/native_theme/native_theme_color_id.h +++ b/ui/native_theme/native_theme_color_id.h -@@ -151,6 +151,11 @@ +@@ -146,6 +146,11 @@ OP(kColorId_TableHeaderText), \ OP(kColorId_TableHeaderBackground), \ OP(kColorId_TableHeaderSeparator), \ @@ -115,10 +115,10 @@ index d08b6a27c0377140562b8feee14b3ae595eb336e..b3d47ac70bc91f3e1cb9931560e6fb36 OP(kColorId_ThrobberSpinningColor), \ OP(kColorId_ThrobberWaitingColor), \ diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index 4d0ed521015660da2376ebc9c50b0f4235ff112c..f4dff8de98066ea0ee4fb30ce832b27707791743 100644 +index 46eab8ff45a3bb874cd8b16076dd9fa918ffbd45..90e3b67bd5c78be3ea0d0f0e4ef94bc95ea375a2 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -652,6 +652,18 @@ base::Optional NativeThemeWin::GetPlatformHighContrastColor( +@@ -659,6 +659,18 @@ base::Optional NativeThemeWin::GetPlatformHighContrastColor( case kColorId_ThrobberWaitingColor: return system_colors_[SystemThemeColor::kGrayText]; diff --git a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch index d14d8d0869d..9a41479d35b 100644 --- a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch +++ b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch @@ -8,7 +8,7 @@ Chrome moved the SetCursor IPC message to mojo, which we use to tell OSR about ` Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172779 diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h -index e3fe7f35ddad36765bda4e38042ce77b58f37b3f..e5e45826022f65d57eccb2a0049344395303a019 100644 +index 4a60eef424879cf96003bc2522887dc8c7630254..51bcc78ecd8f5f40e90a5e9077ac59b37c5c3e13 100644 --- a/content/browser/renderer_host/render_widget_host_delegate.h +++ b/content/browser/renderer_host/render_widget_host_delegate.h @@ -14,6 +14,7 @@ @@ -30,10 +30,10 @@ index e3fe7f35ddad36765bda4e38042ce77b58f37b3f..e5e45826022f65d57eccb2a004934439 // RenderWidgetHost on the main frame, and false otherwise. virtual bool IsWidgetForMainFrame(RenderWidgetHostImpl*); diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index c50126455356bbe34b3f126b652aa098d2e0758c..34f9c18f8a35903e9ab97574a0e08a3b46696889 100644 +index d98336a4b552290aff88a0c14321a58807c7eb05..fd3eac0706be719433257c218abe5402863726fc 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -1928,6 +1928,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) { +@@ -1902,6 +1902,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) { void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) { if (view_) view_->UpdateCursor(WebCursor(cursor)); @@ -43,10 +43,10 @@ index c50126455356bbe34b3f126b652aa098d2e0758c..34f9c18f8a35903e9ab97574a0e08a3b void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index a21877e24ddfdefbccbf3bdafb2132cf244655e8..13bd9fc314ff85ac8ce7876f9f5f8a1507d4c7d3 100644 +index 18564b3c0adbc8ecb5c930609204be207edfd3ea..cee5507c240fb859420eb74326e67c444c3a127c 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4159,6 +4159,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { +@@ -4188,6 +4188,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { return text_input_manager_.get(); } @@ -59,10 +59,10 @@ index a21877e24ddfdefbccbf3bdafb2132cf244655e8..13bd9fc314ff85ac8ce7876f9f5f8a15 RenderWidgetHostImpl* render_widget_host) { return render_widget_host == GetMainFrame()->GetRenderWidgetHost(); diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h -index a861fc353dc845f294b0001544738dfa4d3ca1d1..f9fd8ebc471af32ad7158a0054f1b2dc6098026d 100644 +index 1f383dfb0302fcbf0220c6a4cd8890660b1131a9..cf4bfa28fbd48a655bfe3233155dd7bfd20c898b 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h -@@ -951,6 +951,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, +@@ -960,6 +960,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, blink::mojom::FrameVisibility visibility) override; void SendScreenRects() override; TextInputManager* GetTextInputManager() override; @@ -71,7 +71,7 @@ index a861fc353dc845f294b0001544738dfa4d3ca1d1..f9fd8ebc471af32ad7158a0054f1b2dc bool IsShowingContextMenuOnPage() const override; void DidChangeScreenOrientation() override; diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h -index adbfea805ecc09f9612b4ec9de31a408c8ca0019..3445d590b01918324dc4e5913ee1fc5dda27ab5d 100644 +index ada26a7d33b79596cc161aa3a73e3698bd76de81..a65f15f0f5788faf44213d484989a2cb112b1e30 100644 --- a/content/public/browser/web_contents_observer.h +++ b/content/public/browser/web_contents_observer.h @@ -14,6 +14,7 @@ @@ -82,7 +82,7 @@ index adbfea805ecc09f9612b4ec9de31a408c8ca0019..3445d590b01918324dc4e5913ee1fc5d #include "content/public/browser/allow_service_worker_result.h" #include "content/public/browser/cookie_access_details.h" #include "content/public/browser/navigation_controller.h" -@@ -363,6 +364,9 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { +@@ -369,6 +370,9 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { // Invoked every time the WebContents changes visibility. virtual void OnVisibilityChanged(Visibility visibility) {} diff --git a/patches/chromium/remove_some_deps_that_do_not_work_on_arm64.patch b/patches/chromium/remove_some_deps_that_do_not_work_on_arm64.patch index c9822a68537..6a2cc299150 100644 --- a/patches/chromium/remove_some_deps_that_do_not_work_on_arm64.patch +++ b/patches/chromium/remove_some_deps_that_do_not_work_on_arm64.patch @@ -6,7 +6,7 @@ Subject: remove some deps that do not work on arm64 Once these deps have been fixed upstream we can remove this patch. diff --git a/.vpython b/.vpython -index e76e966921da472fdf713eabe25235fb5951d0fc..031725b7b0417e456df5dab514382beb3e720226 100644 +index 827327374782363bd8db87681e864943d3bb97e7..c0588809b730997929ed1d78b3481612b6ba42f5 100644 --- a/.vpython +++ b/.vpython @@ -53,10 +53,10 @@ wheel: < @@ -24,7 +24,7 @@ index e76e966921da472fdf713eabe25235fb5951d0fc..031725b7b0417e456df5dab514382beb # Used by: # build/lacros/test_runner.py -@@ -74,37 +74,37 @@ wheel: < +@@ -74,27 +74,27 @@ wheel: < # This version must also be compatible with the "numpy" version, as "cv2" # depends on "numpy". In this case, OpenCV@2.4.13.2 has been built against # numpy@1.11.3. @@ -69,20 +69,6 @@ index e76e966921da472fdf713eabe25235fb5951d0fc..031725b7b0417e456df5dab514382beb +# match_tag: < +# platform: "macosx_10_6_intel" +# > -+#> - - # Used by: - # third_party/catapult - # - # This version must be compatible with the version range specified by - # //third_party/catapult/telemetry/telemetry/internal/util/external_modules.py --wheel: < -- name: "infra/python/wheels/numpy/${vpython_platform}" -- version: "version:1.11.3" --> -+#wheel: < -+# name: "infra/python/wheels/numpy/${vpython_platform}" -+# version: "version:1.11.3" +#> # Used by: diff --git a/patches/chromium/render_widget_host_view_base.patch b/patches/chromium/render_widget_host_view_base.patch index 97ca21ba86f..94beb303fca 100644 --- a/patches/chromium/render_widget_host_view_base.patch +++ b/patches/chromium/render_widget_host_view_base.patch @@ -6,10 +6,10 @@ Subject: render_widget_host_view_base.patch ... something to do with OSR? and maybe as well? terrifying. 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 fc77bac7d93213272a46cfd4cb1111f41e16ece2..067ffb6a7f235e421644b51fbafff361cbd0129d 100644 +index fd202aae99a908a6dc7be45ed620b6a77cba6af8..97d28c588a4779141215f768c0b36960c7f19c8e 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc -@@ -567,6 +567,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( +@@ -577,6 +577,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( return false; } @@ -24,7 +24,7 @@ index fc77bac7d93213272a46cfd4cb1111f41e16ece2..067ffb6a7f235e421644b51fbafff361 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 2607251a60c9fee6cd1ab08ac967af7a1b64024c..df311890f06447939f4befdc7306c3d6bc7f5d73 100644 +index db55b0b8383cd9499c9f91d4b6a1f679c2103703..7176614b64ec192be45690f4ac1632028f6bf9d6 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -25,8 +25,10 @@ @@ -60,7 +60,7 @@ index 2607251a60c9fee6cd1ab08ac967af7a1b64024c..df311890f06447939f4befdc7306c3d6 // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. gfx::PointF TransformPointToRootCoordSpaceF( -@@ -283,6 +290,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -282,6 +289,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void ProcessGestureEvent(const blink::WebGestureEvent& event, const ui::LatencyInfo& latency); diff --git a/patches/chromium/render_widget_host_view_mac.patch b/patches/chromium/render_widget_host_view_mac.patch index 187b1109ab0..c65978e87dc 100644 --- a/patches/chromium/render_widget_host_view_mac.patch +++ b/patches/chromium/render_widget_host_view_mac.patch @@ -10,7 +10,7 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`. Additionally, disables usage of some private APIs in MAS builds. diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -index fe292660023d2944a83eb672fd50f57212e5df3d..f33a7cf57b5b734a1f195935a5477d5ca8ba9611 100644 +index 86c10b377aafd4c3741900c112d94107ed841903..32fa5f0e099fab418344be1b939fd2f286b20999 100644 --- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm @@ -153,6 +153,15 @@ void ExtractUnderlines(NSAttributedString* string, @@ -29,7 +29,7 @@ index fe292660023d2944a83eb672fd50f57212e5df3d..f33a7cf57b5b734a1f195935a5477d5c // These are not documented, so use only after checking -respondsToSelector:. @interface NSApplication (UndocumentedSpeechMethods) - (void)speakString:(NSString*)string; -@@ -571,6 +580,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { +@@ -575,6 +584,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { @@ -39,7 +39,7 @@ index fe292660023d2944a83eb672fd50f57212e5df3d..f33a7cf57b5b734a1f195935a5477d5c return [self acceptsMouseEventsWhenInactive]; } -@@ -646,6 +658,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent { +@@ -650,6 +662,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent { // its parent view. BOOL hitSelf = NO; while (view) { @@ -50,7 +50,7 @@ index fe292660023d2944a83eb672fd50f57212e5df3d..f33a7cf57b5b734a1f195935a5477d5c if (view == self) hitSelf = YES; if ([view isKindOfClass:[self class]] && ![view isEqual:self] && -@@ -994,6 +1010,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { +@@ -1003,6 +1019,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { eventType == NSKeyDown && !(modifierFlags & NSCommandKeyMask); @@ -61,7 +61,7 @@ index fe292660023d2944a83eb672fd50f57212e5df3d..f33a7cf57b5b734a1f195935a5477d5c // We only handle key down events and just simply forward other events. if (eventType != NSKeyDown) { _hostHelper->ForwardKeyboardEvent(event, latency_info); -@@ -1722,9 +1742,11 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -1731,9 +1751,11 @@ - (NSAccessibilityRole)accessibilityRole { // Since this implementation doesn't have to wait any IPC calls, this doesn't // make any key-typing jank. --hbono 7/23/09 // @@ -73,7 +73,7 @@ index fe292660023d2944a83eb672fd50f57212e5df3d..f33a7cf57b5b734a1f195935a5477d5c - (NSArray*)validAttributesForMarkedText { // This code is just copied from WebKit except renaming variables. -@@ -1733,7 +1755,10 @@ - (NSArray*)validAttributesForMarkedText { +@@ -1742,7 +1764,10 @@ - (NSArray*)validAttributesForMarkedText { initWithObjects:NSUnderlineStyleAttributeName, NSUnderlineColorAttributeName, NSMarkedClauseSegmentAttributeName, diff --git a/patches/chromium/resource_file_conflict.patch b/patches/chromium/resource_file_conflict.patch index c607a80a3d0..3ebe221e2e9 100644 --- a/patches/chromium/resource_file_conflict.patch +++ b/patches/chromium/resource_file_conflict.patch @@ -52,10 +52,10 @@ Some alternatives to this patch: None of these options seems like a substantial maintainability win over this patch to me (@nornagon). diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index 6f386508b11746fb9d313b51642e3450bfdf2ef5..247c6bc34f6405c4b186c93387c2731b149d243c 100644 +index f80853980d0d72fa843f3109593e3c4fadbfb65f..a76a56e19ce8450e1965aebe505d8f537a493b56 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -1423,7 +1423,7 @@ if (is_chrome_branded && !is_android) { +@@ -1499,7 +1499,7 @@ if (is_chrome_branded && !is_android) { } } @@ -64,7 +64,7 @@ index 6f386508b11746fb9d313b51642e3450bfdf2ef5..247c6bc34f6405c4b186c93387c2731b chrome_paks("packed_resources") { if (is_mac) { output_dir = "$root_gen_dir/repack" -@@ -1443,6 +1443,12 @@ if (!is_android) { +@@ -1519,6 +1519,12 @@ if (!is_android) { } } diff --git a/patches/chromium/revert_remove_contentrendererclient_shouldfork.patch b/patches/chromium/revert_remove_contentrendererclient_shouldfork.patch index 84c7c0ede73..0016796c61d 100644 --- a/patches/chromium/revert_remove_contentrendererclient_shouldfork.patch +++ b/patches/chromium/revert_remove_contentrendererclient_shouldfork.patch @@ -9,10 +9,10 @@ for every navigation to keep Node.js working properly. Once Native Modules in th are required to be NAPI or context aware (Electron v11), this patch can be removed. diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc -index 092cb7aa6b5d1e2b516569eae8b9dabed6661dfc..963196951c0dce346220c11287ceeab32fec2e32 100644 +index 08dda0d5779cefcc0aa2d7d691d8f84137975b5e..d3439ac00ea7e58c2eee210831d38bb8745468cc 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc -@@ -1266,6 +1266,25 @@ ChromeContentRendererClient::GetProtocolHandlerSecurityLevel() { +@@ -1282,6 +1282,25 @@ ChromeContentRendererClient::GetProtocolHandlerSecurityLevel() { #endif } @@ -39,10 +39,10 @@ index 092cb7aa6b5d1e2b516569eae8b9dabed6661dfc..963196951c0dce346220c11287ceeab3 WebLocalFrame* frame, ui::PageTransition transition_type, diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h -index 30718f6b057fcca8eef7516cb48720c4137c3cb4..7a1f4ad8e73cf141ac7c60a9aced2b81cbc61812 100644 +index 4fb3926576c80881a9230bb91bfe7655fec12df1..988769f833354d16b68dd9ace603d17e157a666a 100644 --- a/chrome/renderer/chrome_content_renderer_client.h +++ b/chrome/renderer/chrome_content_renderer_client.h -@@ -122,6 +122,11 @@ class ChromeContentRendererClient +@@ -121,6 +121,11 @@ class ChromeContentRendererClient base::SingleThreadTaskRunner* compositor_thread_task_runner) override; bool RunIdleHandlerWhenWidgetsHidden() override; bool AllowPopup() override; @@ -55,7 +55,7 @@ index 30718f6b057fcca8eef7516cb48720c4137c3cb4..7a1f4ad8e73cf141ac7c60a9aced2b81 override; void WillSendRequest(blink::WebLocalFrame* frame, diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc -index 18e13633bc5f2be2830f6c10f4a46783c57720d4..e9123e07996f511e66ce23e28bcfc2f8ecedd6c5 100644 +index 9745f3208baaf1654c8386c11067958c0e47fd28..8ebebd91eb1216d5ccb4dd31dad0b9772053f2f1 100644 --- a/content/public/renderer/content_renderer_client.cc +++ b/content/public/renderer/content_renderer_client.cc @@ -117,6 +117,14 @@ bool ContentRendererClient::HandleNavigation( @@ -74,10 +74,10 @@ index 18e13633bc5f2be2830f6c10f4a46783c57720d4..e9123e07996f511e66ce23e28bcfc2f8 blink::WebLocalFrame* frame, ui::PageTransition transition_type, diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h -index 357df68c64071ef7dca98ce4aab885dd936b1c49..f501a2ab0bd6d4664dad13913671c4d7d5a96c1e 100644 +index f259835ef4cabb8923f8b0fe9b3f6ae8f2b2b79f..205685f200d54e53829ddc29de3bc07e24ea13b1 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h -@@ -210,6 +210,13 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -207,6 +207,13 @@ class CONTENT_EXPORT ContentRendererClient { bool is_redirect); #endif @@ -92,10 +92,10 @@ index 357df68c64071ef7dca98ce4aab885dd936b1c49..f501a2ab0bd6d4664dad13913671c4d7 // |url|. If the function returns a valid |new_url|, the request must be // updated to use it. diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 49b0d9012c43661a4fb4b9b8b8a68c156c7a76b6..db038990188455fc645c3c769a71e01af1ad3f0b 100644 +index be3779de84dbda14c3425c5115da78ab703e9cfb..6dfa89f3117cb7b0165c352feb79e95b4a315061 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -5313,6 +5313,23 @@ void RenderFrameImpl::BeginNavigation( +@@ -5346,6 +5346,23 @@ void RenderFrameImpl::BeginNavigation( // we can do a per-frame check here rather than a process-wide check. bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || (enabled_bindings_ & kWebUIBindingsPolicyMask); diff --git a/patches/chromium/scroll_bounce_flag.patch b/patches/chromium/scroll_bounce_flag.patch index f42ba112fa2..0100bfb8f4f 100644 --- a/patches/chromium/scroll_bounce_flag.patch +++ b/patches/chromium/scroll_bounce_flag.patch @@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch Patch to make scrollBounce option work. diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc -index 0059045f81b205157e7e4bf772500a49808edb31..5b7a11d3c2b18f403fc0123d0c6d58757daeeec2 100644 +index cac1c3290fb78457057f0e557ca35b49719c8bbd..173d78a5f2aa9b1c0da1f0916e7658b392f4c71a 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1274,7 +1274,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { +@@ -1267,7 +1267,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { } bool RenderThreadImpl::IsElasticOverscrollEnabled() { diff --git a/patches/chromium/skip_atk_toolchain_check.patch b/patches/chromium/skip_atk_toolchain_check.patch index c43c307f015..f1067bf2ada 100644 --- a/patches/chromium/skip_atk_toolchain_check.patch +++ b/patches/chromium/skip_atk_toolchain_check.patch @@ -33,3 +33,15 @@ index bc8e27894732a6d3e834d6b21f00441eca02dd63..f7381c1d5b5842521e0c35476ae468ab if (use_atk) { assert(use_glib, "use_atk=true requires that use_glib=true") +diff --git a/build/config/linux/atspi2/BUILD.gn b/build/config/linux/atspi2/BUILD.gn +index 988a9956813617456ee1945de8e857d43543e411..e6e17e9e8f5ff99404b52c0a42d508f97c61e7fc 100644 +--- a/build/config/linux/atspi2/BUILD.gn ++++ b/build/config/linux/atspi2/BUILD.gn +@@ -6,7 +6,6 @@ import("//build/config/linux/pkg_config.gni") + import("//build/config/ui.gni") + + # These packages should _only_ be expected when building for a target. +-assert(current_toolchain == default_toolchain) + + if (use_atk) { + pkg_config("atspi2") { diff --git a/patches/chromium/ssl_security_state_tab_helper.patch b/patches/chromium/ssl_security_state_tab_helper.patch index bbdb91cdcb3..24470069fb7 100644 --- a/patches/chromium/ssl_security_state_tab_helper.patch +++ b/patches/chromium/ssl_security_state_tab_helper.patch @@ -6,7 +6,7 @@ Subject: ssl_security_state_tab_helper.patch Allows populating security tab info for devtools in Electron. diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc -index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb7538e1a7cf7 100644 +index 810fdd18c25a3d3abf13b163e8e63b201d3736e9..0c678efd12694b2f5bd3969f9ad7d1adf4ef4a72 100644 --- a/chrome/browser/ssl/security_state_tab_helper.cc +++ b/chrome/browser/ssl/security_state_tab_helper.cc @@ -7,6 +7,7 @@ @@ -17,7 +17,7 @@ index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb753 #include "base/feature_list.h" #include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_macros.h" -@@ -14,25 +15,29 @@ +@@ -14,24 +15,28 @@ #include "base/strings/string_util.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -29,7 +29,6 @@ index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb753 #include "chrome/browser/safe_browsing/ui_manager.h" #include "chrome/browser/ssl/known_interception_disclosure_infobar_delegate.h" +#endif - #include "chrome/browser/ssl/tls_deprecation_config.h" #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" @@ -48,7 +47,7 @@ index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb753 #include "components/security_state/content/content_utils.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/navigation_entry.h" -@@ -55,7 +60,7 @@ +@@ -54,7 +59,7 @@ #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -57,23 +56,7 @@ index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb753 #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" #endif -@@ -99,9 +104,12 @@ bool IsLegacyTLS(GURL url, int connection_status) { - // default we treat TLS < 1.2 as Legacy, unless the "SSLVersionMin" policy is - // set. - std::string ssl_version_min_str = switches::kSSLVersionTLSv12; -- PrefService* local_state = g_browser_process->local_state(); -- if (local_state && local_state->HasPrefPath(prefs::kSSLVersionMin)) { -- ssl_version_min_str = local_state->GetString(prefs::kSSLVersionMin); -+ -+ // Read directly from the command line, since our pref store is not the same -+ // as Chrome's. -+ auto* cmd_line = base::CommandLine::ForCurrentProcess(); -+ if (cmd_line->HasSwitch(::switches::kSSLVersionMin)) { -+ ssl_version_min_str = cmd_line->GetSwitchValueASCII(::switches::kSSLVersionMin); - } - - // Convert the pref string to an SSLVersion, if it is valid. Otherwise use the -@@ -121,8 +129,9 @@ bool IsLegacyTLS(GURL url, int connection_status) { +@@ -76,8 +81,9 @@ void RecordSecurityLevel( } // namespace @@ -84,7 +67,7 @@ index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb753 SecurityStateTabHelper::SecurityStateTabHelper( content::WebContents* web_contents) -@@ -168,6 +177,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() { +@@ -101,6 +107,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() { // information is still being initialized, thus no need to check for that. state->malicious_content_status = GetMaliciousContentStatus(); @@ -92,7 +75,7 @@ index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb753 ReputationWebContentsObserver* reputation_web_contents_observer = ReputationWebContentsObserver::FromWebContents(web_contents()); state->safety_tip_info = -@@ -192,6 +202,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() { +@@ -125,6 +132,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() { } } @@ -100,7 +83,7 @@ index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb753 return state; } -@@ -254,8 +265,10 @@ void SecurityStateTabHelper::DidFinishNavigation( +@@ -184,8 +192,10 @@ void SecurityStateTabHelper::DidFinishNavigation( UMA_HISTOGRAM_BOOLEAN("interstitial.ssl.visited_site_after_warning", true); } @@ -111,7 +94,7 @@ index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb753 } void SecurityStateTabHelper::DidChangeVisibleSecurityState() { -@@ -279,6 +292,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { +@@ -209,6 +219,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { web_contents()->GetController().GetVisibleEntry(); if (!entry) return security_state::MALICIOUS_CONTENT_STATUS_NONE; @@ -119,7 +102,7 @@ index 70491781c7c97a86a3469b3a6954b579156f164d..813ebf8fc088822e7d17d0fbe4aeb753 safe_browsing::SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service(); if (!sb_service) -@@ -361,6 +375,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { +@@ -291,6 +302,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { break; } } diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index d1a296b3de8..6f27572e17f 100644 --- a/patches/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,12 +22,12 @@ 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 df3ff59008839c786217661e8862ba54580590ed..cddd153328e3e1e4154aa61e9786b3eaef3f4a05 100644 +index 8c7c5e9b0ee97e2471718cd50d1b0e1eab718df9..ae1aed1f26ae6202b4709a1931c48c55e3fae956 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -405,6 +405,11 @@ class RendererSandboxedProcessLauncherDelegate - { - } +@@ -392,10 +392,18 @@ class RendererSandboxedProcessLauncherDelegate + public: + RendererSandboxedProcessLauncherDelegate() = default; +#if BUILDFLAG(USE_ZYGOTE_HANDLE) + RendererSandboxedProcessLauncherDelegate(bool use_zygote): @@ -36,9 +36,6 @@ index df3ff59008839c786217661e8862ba54580590ed..cddd153328e3e1e4154aa61e9786b3ea + ~RendererSandboxedProcessLauncherDelegate() override = default; - #if defined(OS_WIN) -@@ -433,6 +438,9 @@ class RendererSandboxedProcessLauncherDelegate - #if BUILDFLAG(USE_ZYGOTE_HANDLE) ZygoteHandle GetZygote() override { + if (!use_zygote_) { @@ -47,38 +44,41 @@ index df3ff59008839c786217661e8862ba54580590ed..cddd153328e3e1e4154aa61e9786b3ea const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); base::CommandLine::StringType renderer_prefix = -@@ -447,10 +455,13 @@ class RendererSandboxedProcessLauncherDelegate +@@ -413,6 +421,11 @@ class RendererSandboxedProcessLauncherDelegate + sandbox::policy::SandboxType GetSandboxType() override { return sandbox::policy::SandboxType::kRenderer; } - --#if defined(OS_WIN) - private: -+#if defined(OS_WIN) - const bool renderer_code_integrity_enabled_; - #endif ++ ++ private: +#if BUILDFLAG(USE_ZYGOTE_HANDLE) + bool use_zygote_ = true; +#endif }; - const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey"; -@@ -1909,11 +1920,18 @@ bool RenderProcessHostImpl::Init() { - cmd_line->PrependWrapper(renderer_prefix); - AppendRendererCommandLine(cmd_line.get()); - + #if defined(OS_WIN) +@@ -423,6 +436,9 @@ class RendererSandboxedProcessLauncherDelegateWin + RendererSandboxedProcessLauncherDelegateWin(base::CommandLine* cmd_line) + : renderer_code_integrity_enabled_( + GetContentClient()->browser()->IsRendererCodeIntegrityEnabled()) { ++#if BUILDFLAG(USE_ZYGOTE_HANDLE) ++ use_zygote_ = !cmd_line->HasSwitch(switches::kNoZygote); ++#endif + if (cmd_line->HasSwitch(switches::kJavaScriptFlags)) { + std::string js_flags = + cmd_line->GetSwitchValueASCII(switches::kJavaScriptFlags); +@@ -1832,9 +1848,15 @@ bool RenderProcessHostImpl::Init() { + std::unique_ptr sandbox_delegate = + std::make_unique( + cmd_line.get()); ++#else +#if BUILDFLAG(USE_ZYGOTE_HANDLE) + bool use_zygote = !cmd_line->HasSwitch(switches::kNoZygote); -+ auto delegate = std::make_unique(use_zygote); -+#else -+ auto delegate = std::make_unique(); ++ std::unique_ptr sandbox_delegate = ++ std::make_unique(use_zygote); + #else + std::unique_ptr sandbox_delegate = + std::make_unique(); +#endif -+ + #endif // Spawn the child process asynchronously to avoid blocking the UI thread. // As long as there's no renderer prefix, we can use the zygote process - // at this stage. - child_process_launcher_ = std::make_unique( -- std::make_unique(), -+ std::move(delegate), - std::move(cmd_line), GetID(), this, std::move(mojo_invitation_), - base::BindRepeating(&RenderProcessHostImpl::OnMojoError, id_), - GetV8SnapshotFilesToPreload()); diff --git a/patches/chromium/ui_gtk_public_header.patch b/patches/chromium/ui_gtk_public_header.patch index 26683e7caa9..233539886f7 100644 --- a/patches/chromium/ui_gtk_public_header.patch +++ b/patches/chromium/ui_gtk_public_header.patch @@ -6,10 +6,10 @@ Subject: ui_gtk_public_header.patch Allow electron to depend on //ui/gtk/gtk_util.h diff --git a/ui/gtk/BUILD.gn b/ui/gtk/BUILD.gn -index 3ca7f064f627e5076c12cd79c56991e351cea6b1..7530f279b9d81ce3196a49d10e34c317a8a030fd 100644 +index 73d65668a65802b0ca6112d05c76aefddd157502..b4f29ffa2e029cbcee413aaa7bf54cc03e790864 100644 --- a/ui/gtk/BUILD.gn +++ b/ui/gtk/BUILD.gn -@@ -31,13 +31,15 @@ component("gtk_ui_delegate") { +@@ -39,11 +39,13 @@ component("gtk_ui_delegate") { } component("gtk") { @@ -19,8 +19,6 @@ index 3ca7f064f627e5076c12cd79c56991e351cea6b1..7530f279b9d81ce3196a49d10e34c317 + "gtk_util.h", + ] sources = [ - "gtk_key_bindings_handler.cc", - "gtk_key_bindings_handler.h", "gtk_ui.cc", "gtk_util.cc", - "gtk_util.h", diff --git a/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch b/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch index e003f93d5b2..b35a510900d 100644 --- a/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch +++ b/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch @@ -6,7 +6,7 @@ Subject: unsandboxed_ppapi_processes_skip_zygote.patch Unsandboxed ppapi processes should skip zygote. diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc -index 4ee1f46e8b8ee1685f1c9eb8bafe48fa299b69e2..ce5a23d935e09a4f4c41ed108f18ccc0fbeab3b6 100644 +index 7e40de399a031edf1320358c3e6b94afdec53d4d..2c08b54de2e457754900100950845730c9493366 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -111,6 +111,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate diff --git a/patches/chromium/upload_list_add_loadsync_method.patch b/patches/chromium/upload_list_add_loadsync_method.patch index ad68278328c..d4c50132477 100644 --- a/patches/chromium/upload_list_add_loadsync_method.patch +++ b/patches/chromium/upload_list_add_loadsync_method.patch @@ -9,7 +9,7 @@ deprecated, and this API should be removed once the deprecated behavior is no longer supported. diff --git a/components/upload_list/upload_list.cc b/components/upload_list/upload_list.cc -index 4a6b57e81398727977a9ad21ec601ee2f81e910b..03163affcc649ae53c2b7110d27dbd39ae00ae26 100644 +index c5c8119703c245132433f95fbd3764cfff41f8c3..9aa707d8b13b9c91a21ff5f38e680a7f6446503c 100644 --- a/components/upload_list/upload_list.cc +++ b/components/upload_list/upload_list.cc @@ -72,6 +72,10 @@ void UploadList::Load(base::OnceClosure callback) { @@ -24,10 +24,10 @@ index 4a6b57e81398727977a9ad21ec601ee2f81e910b..03163affcc649ae53c2b7110d27dbd39 const base::Time& end, base::OnceClosure callback) { diff --git a/components/upload_list/upload_list.h b/components/upload_list/upload_list.h -index 20358339df63ae2bb8b955870c5daf51b65f19f7..7cf89626bea8ee9436f15366446f053a479ac438 100644 +index c9dee47c8bb0917cd662d0565702890e953cdeea..b914d133df43fc2458af111a4dc83285bfc1aa02 100644 --- a/components/upload_list/upload_list.h +++ b/components/upload_list/upload_list.h -@@ -73,6 +73,8 @@ class UploadList : public base::RefCountedThreadSafe { +@@ -75,6 +75,8 @@ class UploadList : public base::RefCountedThreadSafe { // overwrite the previously supplied one, and the first will not be called. void Load(base::OnceClosure callback); diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index 54b01b275b2..cdb4be2456b 100644 --- a/patches/chromium/web_contents.patch +++ b/patches/chromium/web_contents.patch @@ -9,12 +9,12 @@ is needed for OSR. Originally landed in https://github.com/electron/libchromiumcontent/pull/226. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index e137e4e16941a539346cd248a51c872159765d32..5c06f5d680357028cffa00f3dfdc17ff02a4a560 100644 +index 3311b6110666851b3946ebf8071f210752425695..b5750a26185df8deed608e5d1bda8479d4a54aac 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -2734,6 +2734,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2764,6 +2764,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { frame_tree_.Init(site_instance.get(), params.renderer_initiated_creation, - params.main_frame_name); + params.main_frame_name, params.is_prerendering); + if (params.view && params.delegate_view) { + view_.reset(params.view); @@ -25,7 +25,7 @@ index e137e4e16941a539346cd248a51c872159765d32..5c06f5d680357028cffa00f3dfdc17ff WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -2744,6 +2750,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2774,6 +2780,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { view_.reset(CreateWebContentsView(this, delegate, &render_view_host_delegate_view_)); } @@ -34,7 +34,7 @@ index e137e4e16941a539346cd248a51c872159765d32..5c06f5d680357028cffa00f3dfdc17ff CHECK(view_.get()); diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index 8a913c6aa050fce21b71a0b493abb6c90d2f2931..79af85209da3ca2d6eb7bc27f97e5becad7312e4 100644 +index b48367e41a8d4f0fa73dd33103e5eb796d8880a9..d6833aeaa09af7d0ec6937db7a1cca051aebe43e 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h @@ -87,8 +87,11 @@ class BrowserContext; @@ -49,7 +49,7 @@ index 8a913c6aa050fce21b71a0b493abb6c90d2f2931..79af85209da3ca2d6eb7bc27f97e5bec class WebUI; struct DropData; struct MHTMLGenerationParams; -@@ -221,6 +224,10 @@ class WebContents : public PageNavigator, +@@ -228,6 +231,10 @@ class WebContents : public PageNavigator, // Sandboxing flags set on the new WebContents. network::mojom::WebSandboxFlags starting_sandbox_flags; diff --git a/patches/chromium/webview_cross_drag.patch b/patches/chromium/webview_cross_drag.patch index 8ae9fcd9d6c..c9be206723d 100644 --- a/patches/chromium/webview_cross_drag.patch +++ b/patches/chromium/webview_cross_drag.patch @@ -8,10 +8,10 @@ This allows dragging and dropping between s. Originally landed in https://github.com/electron/libchromiumcontent/pull/267 diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc -index 4bdcc50a40e498f83eef230780d538c77e038c80..5b6f371b80675a8681accf28eeeb1ce5fc981d36 100644 +index d8d434d386b40388d804b6b887c10c4ada206d72..1f261fc8ae77b38d58b13eee2dcb6d53fb26a6f7 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc -@@ -794,9 +794,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const { +@@ -791,9 +791,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const { bool WebContentsViewAura::IsValidDragTarget( RenderWidgetHostImpl* target_rwh) const { diff --git a/patches/chromium/worker_context_will_destroy.patch b/patches/chromium/worker_context_will_destroy.patch index 3c50bec68e5..81a54997555 100644 --- a/patches/chromium/worker_context_will_destroy.patch +++ b/patches/chromium/worker_context_will_destroy.patch @@ -10,10 +10,10 @@ An attempt to upstream this was made, but rejected: https://chromium-review.googlesource.com/c/chromium/src/+/1954347 diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h -index a4695ba832fc5ae6f458baf38bbf7efa95dc610e..357df68c64071ef7dca98ce4aab885dd936b1c49 100644 +index f84df6e5816063072c7e32afcd90e7d590b83974..f259835ef4cabb8923f8b0fe9b3f6ae8f2b2b79f 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h -@@ -374,6 +374,11 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -371,6 +371,11 @@ class CONTENT_EXPORT ContentRendererClient { virtual void DidInitializeWorkerContextOnWorkerThread( v8::Local context) {} @@ -26,7 +26,7 @@ index a4695ba832fc5ae6f458baf38bbf7efa95dc610e..357df68c64071ef7dca98ce4aab885dd // 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 9362fb2b7cb2fa0054c3b8578f1e56c7bfd82627..e7ee8f52f4cf276d301522e00fed6ab9f34e1f56 100644 +index 7aec578843ce514da499fc40ddb8a9ceb8e7a78f..8b2287e020172e17c5dc5fa28a19ac7a251d4732 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc @@ -910,6 +910,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { @@ -43,10 +43,10 @@ index 9362fb2b7cb2fa0054c3b8578f1e56c7bfd82627..e7ee8f52f4cf276d301522e00fed6ab9 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 aea8d1c53436dbb90352f2de1eebb287815e7e78..534c8f6032124d6b94e35f036158bbe8122f85bb 100644 +index 7a836b82ee155148ea8711b0f933331074d24524..4e3805bbef80957ff7d2c42282eaf9f8fedac46c 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -196,6 +196,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -194,6 +194,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void DidStartWorkerThread() override; void WillStopWorkerThread() override; void WorkerContextCreated(const v8::Local& worker) override; @@ -55,10 +55,10 @@ index aea8d1c53436dbb90352f2de1eebb287815e7e78..534c8f6032124d6b94e35f036158bbe8 const blink::WebSecurityOrigin& script_origin) override; blink::ProtocolHandlerSecurityLevel GetProtocolHandlerSecurityLevel() diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h -index 563c13288c6664469c0c5ae121b0c7add38a1ddd..96c5370e38f9960aa14d7dcfcc841a427b129aca 100644 +index b5904a748f70b86df3ffda9ed8f0cab1132ad35d..911708b508fb38c0f22b3ceaa92fc6a66308ac17 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -697,6 +697,7 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -684,6 +684,7 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local& worker) {} @@ -67,10 +67,10 @@ index 563c13288c6664469c0c5ae121b0c7add38a1ddd..96c5370e38f9960aa14d7dcfcc841a42 const WebSecurityOrigin& script_origin) { return false; diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc -index cf8326757d4f1ad8acb27ad61c65ab0db61874c3..10292488d8700123edaa6f9834a6f37ae4c169f0 100644 +index f3112e1618c7040e6781a19519a19cded9b1335d..aeeeae4b4b9429a6c3cb3c91ae0c642e74fdcc36 100644 --- a/third_party/blink/renderer/core/workers/worker_thread.cc +++ b/third_party/blink/renderer/core/workers/worker_thread.cc -@@ -737,6 +737,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() { +@@ -738,6 +738,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() { nested_runner_->QuitNow(); } diff --git a/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch b/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch index e92c4ccde38..0d3511dda94 100644 --- a/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch +++ b/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch @@ -19,10 +19,10 @@ that clearly establishes the worker script is ready for evaluation with the scop initialized. diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h -index f501a2ab0bd6d4664dad13913671c4d7d5a96c1e..e633d1755405feeae8c45c0bcbf90f672aacadc5 100644 +index 205685f200d54e53829ddc29de3bc07e24ea13b1..31656a92b1e0be23ffc4f4fc3d1ba303c76ba234 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h -@@ -381,6 +381,11 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -378,6 +378,11 @@ class CONTENT_EXPORT ContentRendererClient { virtual void DidInitializeWorkerContextOnWorkerThread( v8::Local context) {} @@ -35,7 +35,7 @@ index f501a2ab0bd6d4664dad13913671c4d7d5a96c1e..e633d1755405feeae8c45c0bcbf90f67 // from the worker thread. virtual void WillDestroyWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index e7ee8f52f4cf276d301522e00fed6ab9f34e1f56..99906d5d855f2331332065d609c44b919dfe5edf 100644 +index 8b2287e020172e17c5dc5fa28a19ac7a251d4732..f0ebbb0fc851f85811bef5aeb22f4d7414e3c84b 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc @@ -922,6 +922,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated( @@ -52,10 +52,10 @@ index e7ee8f52f4cf276d301522e00fed6ab9f34e1f56..99906d5d855f2331332065d609c44b91 const blink::WebSecurityOrigin& script_origin) { return GetContentClient()->renderer()->AllowScriptExtensionForServiceWorker( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index 534c8f6032124d6b94e35f036158bbe8122f85bb..ac95f5daea0919464f87aeeab99a0c5e5581318b 100644 +index 4e3805bbef80957ff7d2c42282eaf9f8fedac46c..ad1551231a3411c86969b4108d66b3dc22c73e21 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -196,6 +196,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -194,6 +194,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void DidStartWorkerThread() override; void WillStopWorkerThread() override; void WorkerContextCreated(const v8::Local& worker) override; @@ -65,10 +65,10 @@ index 534c8f6032124d6b94e35f036158bbe8122f85bb..ac95f5daea0919464f87aeeab99a0c5e bool AllowScriptExtensionForServiceWorker( const blink::WebSecurityOrigin& script_origin) override; diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h -index 96c5370e38f9960aa14d7dcfcc841a427b129aca..92fda0b5d32f75fff1508e146333082a3eb9ef1c 100644 +index 911708b508fb38c0f22b3ceaa92fc6a66308ac17..792ea5e1159f17354a5e6fd838f3e789469d37cd 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -697,6 +697,8 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -684,6 +684,8 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local& worker) {} @@ -78,10 +78,10 @@ index 96c5370e38f9960aa14d7dcfcc841a427b129aca..92fda0b5d32f75fff1508e146333082a virtual bool AllowScriptExtensionForServiceWorker( const WebSecurityOrigin& script_origin) { diff --git a/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc b/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc -index a14ccefd7d315bc9757dd995723ec9705ccc2416..c735b617969235ced5a41fc7a1915de0177c71ce 100644 +index 59430d092bec9e633c35d02d267884a66268ae81..10a567b0b0331f7ed119f62b8a842f27bfa31ee0 100644 --- a/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc +++ b/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc -@@ -273,6 +273,7 @@ void WorkerOrWorkletScriptController::PrepareForEvaluation() { +@@ -257,6 +257,7 @@ void WorkerOrWorkletScriptController::PrepareForEvaluation() { V8PerContextData* per_context_data = script_state_->PerContextData(); ignore_result(per_context_data->ConstructorForType( global_scope_->GetWrapperTypeInfo())); @@ -89,7 +89,7 @@ index a14ccefd7d315bc9757dd995723ec9705ccc2416..c735b617969235ced5a41fc7a1915de0 #else // USE_BLINK_V8_BINDING_NEW_IDL_INTERFACE ScriptState::Scope scope(script_state_); v8::Local context = script_state_->GetContext(); -@@ -298,6 +299,8 @@ void WorkerOrWorkletScriptController::PrepareForEvaluation() { +@@ -282,6 +283,8 @@ void WorkerOrWorkletScriptController::PrepareForEvaluation() { wrapper_type_info->InstallConditionalFeatures( context, *world_, global_object, v8::Local(), v8::Local(), global_interface_template); diff --git a/patches/depot_tools/remove_some_deps_that_do_not_work_on_arm64.patch b/patches/depot_tools/remove_some_deps_that_do_not_work_on_arm64.patch index 1a8decbfe46..a887fa2262d 100644 --- a/patches/depot_tools/remove_some_deps_that_do_not_work_on_arm64.patch +++ b/patches/depot_tools/remove_some_deps_that_do_not_work_on_arm64.patch @@ -6,7 +6,7 @@ Subject: remove some deps that do not work on arm64 Once these deps have newly built arm64 versions we can remove this patch. diff --git a/gsutil.vpython b/gsutil.vpython -index b0a646271eae7426988bbef47a4162f47872c1d1..d9465adeb29f1c696d8ef442a753e6737627bd6f 100644 +index a9b6ec9ef6794dd980f3fa90780dcf20cb20ac15..7dd97f2e41789e640d508c584e4d510e62fe3616 100644 --- a/gsutil.vpython +++ b/gsutil.vpython @@ -25,19 +25,19 @@ wheel < @@ -27,26 +27,26 @@ index b0a646271eae7426988bbef47a4162f47872c1d1..d9465adeb29f1c696d8ef442a753e673 ## -wheel: < -- name: "infra/python/wheels/cryptography/${platform}_${py_python}_${py_abi}" -- version: "version:2.0.3" +- name: "infra/python/wheels/cryptography/${vpython_platform}" +- version: "version:2.9.2" -> +#wheel: < -+# name: "infra/python/wheels/cryptography/${platform}_${py_python}_${py_abi}" -+# version: "version:2.0.3" ++# name: "infra/python/wheels/cryptography/${vpython_platform}" ++# version: "version:2.9.2" +#> wheel: < name: "infra/python/wheels/appdirs-py2_py3" -@@ -54,10 +54,10 @@ wheel: < +@@ -49,10 +49,10 @@ wheel: < version: "version:1.1.6" > -wheel: < -- name: "infra/python/wheels/cffi/${platform}_${py_python}_${py_abi}" +- name: "infra/python/wheels/cffi/${vpython_platform}" - version: "version:1.10.0" -> +#wheel: < -+# name: "infra/python/wheels/cffi/${platform}_${py_python}_${py_abi}" ++# name: "infra/python/wheels/cffi/${vpython_platform}" +# version: "version:1.10.0" +#> diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index a62422e83ce..97e6bcd5754 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -846,10 +846,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636 +} diff --git a/filenames.json b/filenames.json new file mode 100644 -index 0000000000000000000000000000000000000000..2dc4680dd90f854ac965266c6f14a7196da1dba0 +index 0000000000000000000000000000000000000000..7ecda5c553fe547f79f7d9fb5dc2d71c0ef8c474 --- /dev/null +++ b/filenames.json -@@ -0,0 +1,542 @@ +@@ -0,0 +1,544 @@ +// This file is automatically generated by generate_gn_filenames_json.py +// DO NOT EDIT +{ @@ -875,9 +875,11 @@ index 0000000000000000000000000000000000000000..2dc4680dd90f854ac965266c6f14a719 + "//v8/include/cppgc/custom-space.h", + "//v8/include/cppgc/default-platform.h", + "//v8/include/cppgc/ephemeron-pair.h", ++ "//v8/include/cppgc/explicit-management.h", + "//v8/include/cppgc/garbage-collected.h", + "//v8/include/cppgc/heap-consistency.h", + "//v8/include/cppgc/heap-state.h", ++ "//v8/include/cppgc/heap-statistics.h", + "//v8/include/cppgc/heap.h", + "//v8/include/cppgc/liveness-broker.h", + "//v8/include/cppgc/macros.h", @@ -887,6 +889,7 @@ index 0000000000000000000000000000000000000000..2dc4680dd90f854ac965266c6f14a719 + "//v8/include/cppgc/persistent.h", + "//v8/include/cppgc/platform.h", + "//v8/include/cppgc/prefinalizer.h", ++ "//v8/include/cppgc/process-heap-statistics.h", + "//v8/include/cppgc/sentinel-pointer.h", + "//v8/include/cppgc/source-location.h", + "//v8/include/cppgc/testing.h", @@ -909,7 +912,6 @@ index 0000000000000000000000000000000000000000..2dc4680dd90f854ac965266c6f14a719 + "//v8/include/cppgc/internal/persistent-node.h", + "//v8/include/cppgc/internal/pointer-policies.h", + "//v8/include/cppgc/internal/prefinalizer-handler.h", -+ "//v8/include/cppgc/internal/process-heap.h", + "//v8/include/cppgc/internal/write-barrier.h" + ] + }, diff --git a/patches/v8/.patches b/patches/v8/.patches index c28181e02f9..7a3300db16c 100644 --- a/patches/v8/.patches +++ b/patches/v8/.patches @@ -6,4 +6,4 @@ export_symbols_needed_for_windows_build.patch workaround_an_undefined_symbol_error.patch do_not_export_private_v8_symbols_on_windows.patch fix_build_deprecated_attirbute_for_older_msvc_versions.patch -chore_disallow_copying_cppheapcreateparams.patch +skip_global_registration_of_shared_arraybuffer_backing_stores.patch diff --git a/patches/v8/add_realloc.patch b/patches/v8/add_realloc.patch index 66e69651237..f4be06560fd 100644 --- a/patches/v8/add_realloc.patch +++ b/patches/v8/add_realloc.patch @@ -12,10 +12,10 @@ when we override ReallocateBufferMemory, so we therefore need to implement Realloc on the v8 side. diff --git a/include/v8.h b/include/v8.h -index 63bd969ed6f83f8728a2cbb4479e269d1e3ffbc0..0d79c72077d05c69312d527b0e23b68f85a7cfd7 100644 +index 2947cd8f5472cbc48d639ff4d93757fc77fde96b..5e2fe09afb714920fefefe5c51a62af82c4b27f7 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -5295,6 +5295,13 @@ class V8_EXPORT ArrayBuffer : public Object { +@@ -5373,6 +5373,13 @@ class V8_EXPORT ArrayBuffer : public Object { */ virtual void* AllocateUninitialized(size_t length) = 0; @@ -30,10 +30,10 @@ index 63bd969ed6f83f8728a2cbb4479e269d1e3ffbc0..0d79c72077d05c69312d527b0e23b68f * Free the memory block of size |length|, pointed to by |data|. * That memory is guaranteed to be previously allocated by |Allocate|. diff --git a/src/api/api.cc b/src/api/api.cc -index 1107b70b672d783b479a28f7a66afb10959e41d8..3e00ce21aeba97372b0b849ecc47e1e9a5b3c804 100644 +index acf8d69388c1e6ae6ed60d82bcc0b1f0ee5516cb..37a112d52ddf96dabd581a6053bc33082458a3fc 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -313,6 +313,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { +@@ -320,6 +320,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { i::V8::SetSnapshotBlob(snapshot_blob); } diff --git a/patches/v8/build_gn.patch b/patches/v8/build_gn.patch index 92f2156e368..98a81fb5253 100644 --- a/patches/v8/build_gn.patch +++ b/patches/v8/build_gn.patch @@ -9,10 +9,10 @@ necessary for native modules to load. Also, some fixes relating to mksnapshot on ARM. diff --git a/BUILD.gn b/BUILD.gn -index 2b6029fd109844fc140c6576a19c621f812bea93..54a421d6541a3811b7a6e24cd4ac55fa1c1d7a1a 100644 +index 82151b6d1fef24c02eaf6048908b3399c4442946..4be98113938ca2e688f5f1e69dc1bfdb94501059 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -441,7 +441,7 @@ config("internal_config") { +@@ -453,7 +453,7 @@ config("internal_config") { ":cppgc_header_features", ] @@ -21,7 +21,7 @@ index 2b6029fd109844fc140c6576a19c621f812bea93..54a421d6541a3811b7a6e24cd4ac55fa defines += [ "BUILDING_V8_SHARED" ] } } -@@ -4877,7 +4877,7 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -5057,7 +5057,7 @@ if (current_toolchain == v8_generator_toolchain) { "src/interpreter/bytecodes.h", ] @@ -30,7 +30,7 @@ index 2b6029fd109844fc140c6576a19c621f812bea93..54a421d6541a3811b7a6e24cd4ac55fa deps = [ ":v8_libbase", -@@ -4914,6 +4914,8 @@ if (current_toolchain == v8_snapshot_toolchain) { +@@ -5095,6 +5095,8 @@ if (current_toolchain == v8_snapshot_toolchain) { configs = [ ":internal_config" ] diff --git a/patches/v8/chore_disallow_copying_cppheapcreateparams.patch b/patches/v8/chore_disallow_copying_cppheapcreateparams.patch deleted file mode 100644 index 50c7c8a0f18..00000000000 --- a/patches/v8/chore_disallow_copying_cppheapcreateparams.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Charles Kerr -Date: Thu, 19 Nov 2020 13:12:56 -0600 -Subject: chore: disallow copying CppHeapCreateParams - -Experimental commit to resolve FTBS https://ci.appveyor.com/project/electron-bot/electron-ljo26/builds/36405680#L25345 -which introduces a new struct CppHeapCreateParams that aggregates a -vector of unique_ptrs. Our Windows CI is unhappy that this struct -implicitly deletes its copy ctor, so this commit makes it explicit. - -Xref: https://chromium-review.googlesource.com/c/v8/v8/+/2536642 - -diff --git a/include/v8-cppgc.h b/include/v8-cppgc.h -index 8860ea8a78de67ab9e9ac453ec1774c8c6b17b8a..1ae9c485bbf083449d7e812696975ffef5e37573 100644 ---- a/include/v8-cppgc.h -+++ b/include/v8-cppgc.h -@@ -26,8 +26,13 @@ namespace internal { - class CppHeap; - } // namespace internal - --struct V8_EXPORT CppHeapCreateParams { -+class V8_EXPORT CppHeapCreateParams { -+ public: - std::vector> custom_spaces; -+ -+ private: -+ CppHeapCreateParams (const CppHeapCreateParams&) =delete; -+ CppHeapCreateParams& operator=(const CppHeapCreateParams&) =delete; - }; - - /** -diff --git a/include/v8.h b/include/v8.h -index 0d79c72077d05c69312d527b0e23b68f85a7cfd7..5e03f54a918191650d5dd6768a6e8c3a31de4300 100644 ---- a/include/v8.h -+++ b/include/v8.h -@@ -93,6 +93,7 @@ class Utils; - class Value; - class WasmMemoryObject; - class WasmModuleObject; -+class CppHeapCreateParams; - template - class GlobalValueMap; - template diff --git a/patches/v8/dcheck.patch b/patches/v8/dcheck.patch index e8f5db7b831..31455d60251 100644 --- a/patches/v8/dcheck.patch +++ b/patches/v8/dcheck.patch @@ -6,10 +6,10 @@ Subject: dcheck.patch https://github.com/auchenberg/volkswagen diff --git a/src/api/api.cc b/src/api/api.cc -index 3e00ce21aeba97372b0b849ecc47e1e9a5b3c804..5c5498a5c0732158bf4f4eb37c7d21231ccac45d 100644 +index 37a112d52ddf96dabd581a6053bc33082458a3fc..2c12f19b287cf5e3c5aaa04d339f2301e1e57c47 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -8798,7 +8798,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { +@@ -8615,7 +8615,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { } void Isolate::PerformMicrotaskCheckpoint() { @@ -19,10 +19,10 @@ index 3e00ce21aeba97372b0b849ecc47e1e9a5b3c804..5c5498a5c0732158bf4f4eb37c7d2123 isolate->default_microtask_queue()->PerformCheckpoint(this); } diff --git a/src/heap/heap.cc b/src/heap/heap.cc -index 23b84296be18f17371ae1aaa3d4389e23963e313..5b53bc8ee05824bab22302e8a731839f3b3f2318 100644 +index 2c1b6788f3b1648855aa1496eebfb679461de64f..b8a77816772593211cc015589c6ee17d06374c6f 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc -@@ -5551,9 +5551,9 @@ void Heap::TearDown() { +@@ -5553,9 +5553,9 @@ void Heap::TearDown() { void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback, GCType gc_type, void* data) { DCHECK_NOT_NULL(callback); diff --git a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch index e52411d9d20..fbab7c262a5 100644 --- a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch +++ b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch @@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not contain any standard C++ library exports (e.g. `std::ostringstream`). diff --git a/BUILD.gn b/BUILD.gn -index 77760d840e62acfd214633108da576f296d32ce8..6d3202f21931cccbd69765d27926b8c92dc9aad1 100644 +index b1c9106a65eeb468a3cf5d11b0a88e50c7d1a6be..5eb0fd274fcc94af41abb5ad95856f98643c7bc1 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -441,6 +441,10 @@ config("internal_config") { +@@ -453,6 +453,10 @@ config("internal_config") { ":cppgc_header_features", ] @@ -27,7 +27,7 @@ index 77760d840e62acfd214633108da576f296d32ce8..6d3202f21931cccbd69765d27926b8c9 defines += [ "BUILDING_V8_SHARED" ] } diff --git a/src/base/macros.h b/src/base/macros.h -index 9079d15662836848d0b3ba1c09a5207936c6a79b..370eb1a6344b998d028f90f5087a4b92f46cfddb 100644 +index b370d8818b1fa23fb916e8be343a0f98fada0aba..dda0ada417544059f041609655c3d50a433d59db 100644 --- a/src/base/macros.h +++ b/src/base/macros.h @@ -394,13 +394,17 @@ bool is_inbounds(float_t v) { diff --git a/patches/v8/export_symbols_needed_for_windows_build.patch b/patches/v8/export_symbols_needed_for_windows_build.patch index 5cffe9e6f8a..94e4fec916b 100644 --- a/patches/v8/export_symbols_needed_for_windows_build.patch +++ b/patches/v8/export_symbols_needed_for_windows_build.patch @@ -6,10 +6,10 @@ Subject: Export symbols needed for Windows build These symbols are required to build v8 with BUILD_V8_SHARED on Windows. diff --git a/src/objects/objects.h b/src/objects/objects.h -index 73b3369da085f8950d6f92589f93cd80273a57ab..da598f60382f54d30abae1ad30256f998b7b2628 100644 +index c68445597f562d043953bd38baf25d818646de68..60f519ad45da2680d24ea2012446f5d62fd8e981 100644 --- a/src/objects/objects.h +++ b/src/objects/objects.h -@@ -826,7 +826,7 @@ enum class KeyCollectionMode { +@@ -824,7 +824,7 @@ enum class KeyCollectionMode { // Utility superclass for stack-allocated objects that must be updated // on gc. It provides two ways for the gc to update instances, either // iterating or updating after gc. @@ -19,7 +19,7 @@ index 73b3369da085f8950d6f92589f93cd80273a57ab..da598f60382f54d30abae1ad30256f99 explicit inline Relocatable(Isolate* isolate); inline virtual ~Relocatable(); diff --git a/src/objects/ordered-hash-table.h b/src/objects/ordered-hash-table.h -index ca1d29d2fd686453747efa2e1d18fedba3883929..db5ab3f57ae2e75e8b90966161359926f70bf7cd 100644 +index 1746e2dc89625a00c6cae0b249142a11de7072c3..cd076405a17f99f77d51b6c146223becf4fb4587 100644 --- a/src/objects/ordered-hash-table.h +++ b/src/objects/ordered-hash-table.h @@ -63,7 +63,7 @@ namespace internal { diff --git a/patches/v8/expose_mksnapshot.patch b/patches/v8/expose_mksnapshot.patch index c0539fe6b2b..4d0a66c6288 100644 --- a/patches/v8/expose_mksnapshot.patch +++ b/patches/v8/expose_mksnapshot.patch @@ -6,10 +6,10 @@ Subject: expose_mksnapshot.patch Needed in order to target mksnapshot for mksnapshot zip. diff --git a/BUILD.gn b/BUILD.gn -index 54a421d6541a3811b7a6e24cd4ac55fa1c1d7a1a..77760d840e62acfd214633108da576f296d32ce8 100644 +index 4be98113938ca2e688f5f1e69dc1bfdb94501059..b1c9106a65eeb468a3cf5d11b0a88e50c7d1a6be 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -4888,7 +4888,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -5069,7 +5069,6 @@ if (current_toolchain == v8_generator_toolchain) { if (current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { diff --git a/patches/v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch b/patches/v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch new file mode 100644 index 00000000000..2fb4123e247 --- /dev/null +++ b/patches/v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch @@ -0,0 +1,137 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ulan Degenbaev +Date: Tue, 16 Mar 2021 12:18:36 +0100 +Subject: Skip global registration of [Shared]ArrayBuffer backing stores + +Previously we needed to register the backing stores globally because +the embedder could create them from a raw pointer. This is no longer +possible after the removal of the old API. + +The global backing store registry now keeps track only of wasm memory +backing stores. + +Bug: v8:9380 +Change-Id: Iffefbf14dcafc1f9ce0dc3613335c754c9cb649a +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2763874 +Reviewed-by: Andreas Haas +Commit-Queue: Ulan Degenbaev +Cr-Commit-Position: refs/heads/master@{#73493} + +diff --git a/src/api/api.cc b/src/api/api.cc +index 2c12f19b287cf5e3c5aaa04d339f2301e1e57c47..703720b2fea123b118a187f407e846781d62249f 100644 +--- a/src/api/api.cc ++++ b/src/api/api.cc +@@ -3786,7 +3786,6 @@ std::shared_ptr v8::ArrayBuffer::GetBackingStore() { + backing_store = + i::BackingStore::EmptyBackingStore(i::SharedFlag::kNotShared); + } +- i::GlobalBackingStoreRegistry::Register(backing_store); + std::shared_ptr bs_base = backing_store; + return std::static_pointer_cast(bs_base); + } +@@ -3797,7 +3796,6 @@ std::shared_ptr v8::SharedArrayBuffer::GetBackingStore() { + if (!backing_store) { + backing_store = i::BackingStore::EmptyBackingStore(i::SharedFlag::kShared); + } +- i::GlobalBackingStoreRegistry::Register(backing_store); + std::shared_ptr bs_base = backing_store; + return std::static_pointer_cast(bs_base); + } +diff --git a/src/objects/backing-store.cc b/src/objects/backing-store.cc +index 7931fbf13ddecc49969e23c57a51513d2e605039..08288ef62c0b930483004a154967925e2ed14d8a 100644 +--- a/src/objects/backing-store.cc ++++ b/src/objects/backing-store.cc +@@ -685,17 +685,8 @@ inline GlobalBackingStoreRegistryImpl* impl() { + void GlobalBackingStoreRegistry::Register( + std::shared_ptr backing_store) { + if (!backing_store || !backing_store->buffer_start()) return; +- +- if (!backing_store->free_on_destruct()) { +- // If the backing store buffer is managed by the embedder, +- // then we don't have to guarantee that there is single unique +- // BackingStore per buffer_start() because the destructor of +- // of the BackingStore will be a no-op in that case. +- +- // All Wasm memory has to be registered. +- CHECK(!backing_store->is_wasm_memory()); +- return; +- } ++ // Only wasm memory backing stores need to be registered globally. ++ CHECK(backing_store->is_wasm_memory()); + + base::MutexGuard scope_lock(&impl()->mutex_); + if (backing_store->globally_registered_) return; +@@ -711,6 +702,8 @@ void GlobalBackingStoreRegistry::Register( + void GlobalBackingStoreRegistry::Unregister(BackingStore* backing_store) { + if (!backing_store->globally_registered_) return; + ++ CHECK(backing_store->is_wasm_memory()); ++ + DCHECK_NOT_NULL(backing_store->buffer_start()); + + base::MutexGuard scope_lock(&impl()->mutex_); +@@ -722,26 +715,6 @@ void GlobalBackingStoreRegistry::Unregister(BackingStore* backing_store) { + backing_store->globally_registered_ = false; + } + +-std::shared_ptr GlobalBackingStoreRegistry::Lookup( +- void* buffer_start, size_t length) { +- base::MutexGuard scope_lock(&impl()->mutex_); +- TRACE_BS("BS:lookup mem=%p (%zu bytes)\n", buffer_start, length); +- const auto& result = impl()->map_.find(buffer_start); +- if (result == impl()->map_.end()) { +- return std::shared_ptr(); +- } +- auto backing_store = result->second.lock(); +- CHECK_EQ(buffer_start, backing_store->buffer_start()); +- if (backing_store->is_wasm_memory()) { +- // Grow calls to shared WebAssembly threads can be triggered from different +- // workers, length equality cannot be guaranteed here. +- CHECK_LE(length, backing_store->byte_length()); +- } else { +- CHECK_EQ(length, backing_store->byte_length()); +- } +- return backing_store; +-} +- + void GlobalBackingStoreRegistry::Purge(Isolate* isolate) { + // We need to keep a reference to all backing stores that are inspected + // in the purging loop below. Otherwise, we might get a deadlock +@@ -755,7 +728,7 @@ void GlobalBackingStoreRegistry::Purge(Isolate* isolate) { + auto backing_store = entry.second.lock(); + prevent_destruction_under_lock.emplace_back(backing_store); + if (!backing_store) continue; // skip entries where weak ptr is null +- if (!backing_store->is_wasm_memory()) continue; // skip non-wasm memory ++ CHECK(backing_store->is_wasm_memory()); + if (!backing_store->is_shared()) continue; // skip non-shared memory + SharedWasmMemoryData* shared_data = + backing_store->get_shared_wasm_memory_data(); +diff --git a/src/objects/backing-store.h b/src/objects/backing-store.h +index 4d20109676e8c955b2dfb40a882b5f27783a4ac6..eb879d5e8adf5a9a7d727dd571a77f01289f3be3 100644 +--- a/src/objects/backing-store.h ++++ b/src/objects/backing-store.h +@@ -219,21 +219,16 @@ class V8_EXPORT_PRIVATE BackingStore : public BackingStoreBase { + #endif // V8_ENABLE_WEBASSEMBLY + }; + +-// A global, per-process mapping from buffer addresses to backing stores. +-// This is generally only used for dealing with an embedder that has not +-// migrated to the new API which should use proper pointers to manage +-// backing stores. ++// A global, per-process mapping from buffer addresses to backing stores ++// of wasm memory objects. + class GlobalBackingStoreRegistry { + public: + // Register a backing store in the global registry. A mapping from the + // {buffer_start} to the backing store object will be added. The backing + // store will automatically unregister itself upon destruction. ++ // Only wasm memory backing stores are supported. + static void Register(std::shared_ptr backing_store); + +- // Look up a backing store based on the {buffer_start} pointer. +- static std::shared_ptr Lookup(void* buffer_start, +- size_t length); +- + private: + friend class BackingStore; + // Unregister a backing store in the global registry. diff --git a/patches/v8/workaround_an_undefined_symbol_error.patch b/patches/v8/workaround_an_undefined_symbol_error.patch index 99a90814739..c746ff3c573 100644 --- a/patches/v8/workaround_an_undefined_symbol_error.patch +++ b/patches/v8/workaround_an_undefined_symbol_error.patch @@ -12,10 +12,10 @@ By moving some functions out of the the arm64-assembler header file, this error no longer seems to happen. diff --git a/src/codegen/arm64/assembler-arm64.cc b/src/codegen/arm64/assembler-arm64.cc -index 441f299a17a6f870f545dbcd2c28a5e49b952ac3..79249d463c8fe7d73caca6b36ed6033b3c363c67 100644 +index 72cac5bd603bb84d721e4f5cbadaecd7c0d2e89e..8b31f57f4897a70906a92654a4d41f4c5787f271 100644 --- a/src/codegen/arm64/assembler-arm64.cc +++ b/src/codegen/arm64/assembler-arm64.cc -@@ -3658,6 +3658,22 @@ void Assembler::MoveWide(const Register& rd, uint64_t imm, int shift, +@@ -3659,6 +3659,22 @@ void Assembler::MoveWide(const Register& rd, uint64_t imm, int shift, ImmMoveWide(static_cast(imm)) | ShiftMoveWide(shift)); } diff --git a/script/nan-spec-runner.js b/script/nan-spec-runner.js index 947723e4ca7..e4c077f3e1e 100644 --- a/script/nan-spec-runner.js +++ b/script/nan-spec-runner.js @@ -47,7 +47,10 @@ async function main () { const onlyTests = args.only && args.only.split(','); - const DISABLED_TESTS = ['nannew-test.js']; + const DISABLED_TESTS = [ + 'nannew-test.js', + 'typedarrays-test.js' // TODO(nornagon): https://github.com/electron/electron/issues/28414 + ]; const testsToRun = fs.readdirSync(path.resolve(NAN_DIR, 'test', 'js')) .filter(test => !DISABLED_TESTS.includes(test)) .filter(test => { diff --git a/shell/app/electron_content_client.cc b/shell/app/electron_content_client.cc index 530637ac4d5..421601aefb7 100644 --- a/shell/app/electron_content_client.cc +++ b/shell/app/electron_content_client.cc @@ -161,7 +161,7 @@ ElectronContentClient::ElectronContentClient() = default; ElectronContentClient::~ElectronContentClient() = default; -base::string16 ElectronContentClient::GetLocalizedString(int message_id) { +std::u16string ElectronContentClient::GetLocalizedString(int message_id) { return l10n_util::GetStringUTF16(message_id); } diff --git a/shell/app/electron_content_client.h b/shell/app/electron_content_client.h index 0e6eb9715e0..8ac3a688da3 100644 --- a/shell/app/electron_content_client.h +++ b/shell/app/electron_content_client.h @@ -21,7 +21,7 @@ class ElectronContentClient : public content::ContentClient { protected: // content::ContentClient: - base::string16 GetLocalizedString(int message_id) override; + std::u16string GetLocalizedString(int message_id) override; base::StringPiece GetDataResource(int resource_id, ui::ScaleFactor) override; gfx::Image& GetNativeImageNamed(int resource_id) override; base::RefCountedMemory* GetDataResourceBytes(int resource_id) override; diff --git a/shell/app/electron_crash_reporter_client.cc b/shell/app/electron_crash_reporter_client.cc index 07fc91e30c1..6ad5557f139 100644 --- a/shell/app/electron_crash_reporter_client.cc +++ b/shell/app/electron_crash_reporter_client.cc @@ -33,6 +33,10 @@ #include "base/debug/dump_without_crashing.h" #endif +#if defined(OS_WIN) +#include "base/strings/string_util_win.h" +#endif + namespace { ElectronCrashReporterClient* Instance() { @@ -130,8 +134,8 @@ void ElectronCrashReporterClient::GetProductNameAndVersion( std::wstring* version, std::wstring* special_build, std::wstring* channel_name) { - *product_name = base::UTF8ToUTF16(ELECTRON_PRODUCT_NAME); - *version = base::UTF8ToUTF16(ELECTRON_VERSION_STRING); + *product_name = base::UTF8ToWide(ELECTRON_PRODUCT_NAME); + *version = base::UTF8ToWide(ELECTRON_VERSION_STRING); } #endif diff --git a/shell/app/node_main.cc b/shell/app/node_main.cc index bc0f3f7469c..73db4f0e181 100644 --- a/shell/app/node_main.cc +++ b/shell/app/node_main.cc @@ -66,7 +66,7 @@ void SetNodeCliFlags() { for (const auto& arg : argv) { #if defined(OS_WIN) - const auto& option = base::UTF16ToUTF8(arg); + const auto& option = base::WideToUTF8(arg); #else const auto& option = arg; #endif diff --git a/shell/browser/api/content_tracing.idl b/shell/browser/api/content_tracing.idl new file mode 100644 index 00000000000..74199b9f9c6 --- /dev/null +++ b/shell/browser/api/content_tracing.idl @@ -0,0 +1,26 @@ +enum RecordingMode { "record-until-full", "record-continuously", "record-as-much-as-possible", "trace-to-console" }; + +dictionary TraceConfig { + Recordingmode recording_mode; + unsigned long trace_buffer_size_in_kb; + unsigned long trace_buffer_size_in_events; + boolean enable_argument_filter; + sequence included_categories; + sequence excluded_categories; + sequence included_process_ids; + sequence histogram_names; + object memory_dump_config; +}; + +dictionary TraceCategoriesAndOptions { + DOMString categoryFilter; + DOMString traceOptions; +}; + +interface ContentTracing { + Promise> getCategories(); + Promise startRecording(TraceConfig config); + Promise startRecording(TraceCategoriesAndOptions categoriesAndOptions); + Promise stopRecording(optional DOMString resultFilePath); + Promise getTraceBufferUsage(); +}; diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index 9ffe14483f1..7790c576918 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -549,7 +549,7 @@ void OnClientCertificateSelected( #if defined(USE_NSS_CERTS) int ImportIntoCertStore(CertificateManagerModel* model, base::Value options) { std::string file_data, cert_path; - base::string16 password; + std::u16string password; net::ScopedCERTCertificateList imported_certs; int rv = -1; @@ -1553,8 +1553,10 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) { base::BindRepeating(&Browser::AddRecentDocument, browser)) .SetMethod("clearRecentDocuments", base::BindRepeating(&Browser::ClearRecentDocuments, browser)) +#if defined(OS_WIN) .SetMethod("setAppUserModelId", base::BindRepeating(&Browser::SetAppUserModelID, browser)) +#endif .SetMethod( "isDefaultProtocolClient", base::BindRepeating(&Browser::IsDefaultProtocolClient, browser)) diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index ed9e0eeb908..4a3bc35c43f 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -1089,11 +1089,11 @@ bool BaseWindow::SetThumbnailToolTip(const std::string& tooltip) { } void BaseWindow::SetAppDetails(const gin_helper::Dictionary& options) { - base::string16 app_id; + std::wstring app_id; base::FilePath app_icon_path; int app_icon_index = 0; - base::string16 relaunch_command; - base::string16 relaunch_display_name; + std::wstring relaunch_command; + std::wstring relaunch_display_name; options.Get("appId", &app_id); options.Get("appIconPath", &app_icon_path); diff --git a/shell/browser/api/electron_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc index 1ba361cbc37..b7ade31bdcd 100644 --- a/shell/browser/api/electron_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -210,7 +210,7 @@ void BrowserWindow::OnActivateContents() { #endif } -void BrowserWindow::OnPageTitleUpdated(const base::string16& title, +void BrowserWindow::OnPageTitleUpdated(const std::u16string& title, bool explicit_set) { // Change window title to page title. auto self = GetWeakPtr(); diff --git a/shell/browser/api/electron_api_browser_window.h b/shell/browser/api/electron_api_browser_window.h index f0547d8039a..d398249aee7 100644 --- a/shell/browser/api/electron_api_browser_window.h +++ b/shell/browser/api/electron_api_browser_window.h @@ -62,7 +62,7 @@ class BrowserWindow : public BaseWindow, const std::vector& regions) override; void OnSetContentBounds(const gfx::Rect& rect) override; void OnActivateContents() override; - void OnPageTitleUpdated(const base::string16& title, + void OnPageTitleUpdated(const std::u16string& title, bool explicit_set) override; #if defined(OS_MAC) void OnDevToolsResized() override; diff --git a/shell/browser/api/electron_api_crash_reporter.cc b/shell/browser/api/electron_api_crash_reporter.cc index b7bf09a6bfb..5e56f960337 100644 --- a/shell/browser/api/electron_api_crash_reporter.cc +++ b/shell/browser/api/electron_api_crash_reporter.cc @@ -175,7 +175,7 @@ void Start(const std::string& submit_url, base::PathService::Get(DIR_USER_DATA, &user_data_dir); ::crash_reporter::InitializeCrashpadWithEmbeddedHandler( process_type.empty(), process_type, - base::UTF16ToUTF8(user_data_dir.value()), base::FilePath()); + base::WideToUTF8(user_data_dir.value()), base::FilePath()); #endif #endif } diff --git a/shell/browser/api/electron_api_desktop_capturer.cc b/shell/browser/api/electron_api_desktop_capturer.cc index 00aded1a1be..d0ac57d4c51 100644 --- a/shell/browser/api/electron_api_desktop_capturer.cc +++ b/shell/browser/api/electron_api_desktop_capturer.cc @@ -96,7 +96,7 @@ void DesktopCapturer::StartHandling(bool capture_window, // Apply the new thumbnail size and restart capture. if (capture_window) { window_capturer_ = std::make_unique( - content::DesktopMediaID::TYPE_WINDOW, + DesktopMediaList::Type::kWindow, content::desktop_capture::CreateWindowCapturer()); window_capturer_->SetThumbnailSize(thumbnail_size); window_capturer_->AddObserver(this); @@ -107,7 +107,7 @@ void DesktopCapturer::StartHandling(bool capture_window, if (capture_screen) { screen_capturer_ = std::make_unique( - content::DesktopMediaID::TYPE_SCREEN, + DesktopMediaList::Type::kScreen, content::desktop_capture::CreateScreenCapturer()); screen_capturer_->SetThumbnailSize(thumbnail_size); screen_capturer_->AddObserver(this); @@ -124,7 +124,7 @@ void DesktopCapturer::OnSourceUnchanged(DesktopMediaList* list) { void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) { if (capture_window_ && - list->GetMediaListType() == content::DesktopMediaID::TYPE_WINDOW) { + list->GetMediaListType() == DesktopMediaList::Type::kWindow) { capture_window_ = false; const auto& media_list_sources = list->GetSources(); std::vector window_sources; @@ -138,7 +138,7 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) { } if (capture_screen_ && - list->GetMediaListType() == content::DesktopMediaID::TYPE_SCREEN) { + list->GetMediaListType() == DesktopMediaList::Type::kScreen) { capture_screen_ = false; const auto& media_list_sources = list->GetSources(); std::vector screen_sources; diff --git a/shell/browser/api/electron_api_menu.cc b/shell/browser/api/electron_api_menu.cc index 5c4758f8de9..c992168e778 100644 --- a/shell/browser/api/electron_api_menu.cc +++ b/shell/browser/api/electron_api_menu.cc @@ -163,7 +163,7 @@ base::OnceClosure Menu::BindSelfToClosure(base::OnceClosure callback) { void Menu::InsertItemAt(int index, int command_id, - const base::string16& label) { + const std::u16string& label) { model_->InsertItemAt(index, command_id, label); } @@ -173,20 +173,20 @@ void Menu::InsertSeparatorAt(int index) { void Menu::InsertCheckItemAt(int index, int command_id, - const base::string16& label) { + const std::u16string& label) { model_->InsertCheckItemAt(index, command_id, label); } void Menu::InsertRadioItemAt(int index, int command_id, - const base::string16& label, + const std::u16string& label, int group_id) { model_->InsertRadioItemAt(index, command_id, label, group_id); } void Menu::InsertSubMenuAt(int index, int command_id, - const base::string16& label, + const std::u16string& label, Menu* menu) { menu->parent_ = this; model_->InsertSubMenuAt(index, command_id, label, menu->model_.get()); @@ -196,15 +196,15 @@ void Menu::SetIcon(int index, const gfx::Image& image) { model_->SetIcon(index, ui::ImageModel::FromImage(image)); } -void Menu::SetSublabel(int index, const base::string16& sublabel) { +void Menu::SetSublabel(int index, const std::u16string& sublabel) { model_->SetSecondaryLabel(index, sublabel); } -void Menu::SetToolTip(int index, const base::string16& toolTip) { +void Menu::SetToolTip(int index, const std::u16string& toolTip) { model_->SetToolTip(index, toolTip); } -void Menu::SetRole(int index, const base::string16& role) { +void Menu::SetRole(int index, const std::u16string& role) { model_->SetRole(index, role); } @@ -224,19 +224,19 @@ int Menu::GetCommandIdAt(int index) const { return model_->GetCommandIdAt(index); } -base::string16 Menu::GetLabelAt(int index) const { +std::u16string Menu::GetLabelAt(int index) const { return model_->GetLabelAt(index); } -base::string16 Menu::GetSublabelAt(int index) const { +std::u16string Menu::GetSublabelAt(int index) const { return model_->GetSecondaryLabelAt(index); } -base::string16 Menu::GetToolTipAt(int index) const { +std::u16string Menu::GetToolTipAt(int index) const { return model_->GetToolTipAt(index); } -base::string16 Menu::GetAcceleratorTextAt(int index) const { +std::u16string Menu::GetAcceleratorTextAt(int index) const { ui::Accelerator accelerator; model_->GetAcceleratorAtWithParams(index, true, &accelerator); return accelerator.GetShortcutText(); diff --git a/shell/browser/api/electron_api_menu.h b/shell/browser/api/electron_api_menu.h index 5c47990fa69..89150f5bd34 100644 --- a/shell/browser/api/electron_api_menu.h +++ b/shell/browser/api/electron_api_menu.h @@ -87,31 +87,31 @@ class Menu : public gin::Wrappable, void OnMenuWillShow() override; private: - void InsertItemAt(int index, int command_id, const base::string16& label); + void InsertItemAt(int index, int command_id, const std::u16string& label); void InsertSeparatorAt(int index); void InsertCheckItemAt(int index, int command_id, - const base::string16& label); + const std::u16string& label); void InsertRadioItemAt(int index, int command_id, - const base::string16& label, + const std::u16string& label, int group_id); void InsertSubMenuAt(int index, int command_id, - const base::string16& label, + const std::u16string& label, Menu* menu); void SetIcon(int index, const gfx::Image& image); - void SetSublabel(int index, const base::string16& sublabel); - void SetToolTip(int index, const base::string16& toolTip); - void SetRole(int index, const base::string16& role); + void SetSublabel(int index, const std::u16string& sublabel); + void SetToolTip(int index, const std::u16string& toolTip); + void SetRole(int index, const std::u16string& role); void Clear(); int GetIndexOfCommandId(int command_id); int GetItemCount() const; int GetCommandIdAt(int index) const; - base::string16 GetLabelAt(int index) const; - base::string16 GetSublabelAt(int index) const; - base::string16 GetToolTipAt(int index) const; - base::string16 GetAcceleratorTextAt(int index) const; + std::u16string GetLabelAt(int index) const; + std::u16string GetSublabelAt(int index) const; + std::u16string GetToolTipAt(int index) const; + std::u16string GetAcceleratorTextAt(int index) const; bool IsItemCheckedAt(int index) const; bool IsEnabledAt(int index) const; bool IsVisibleAt(int index) const; diff --git a/shell/browser/api/electron_api_notification.cc b/shell/browser/api/electron_api_notification.cc index 501daa43232..5216b7407df 100644 --- a/shell/browser/api/electron_api_notification.cc +++ b/shell/browser/api/electron_api_notification.cc @@ -92,15 +92,15 @@ gin::Handle Notification::New(gin_helper::ErrorThrower thrower, } // Getters -base::string16 Notification::GetTitle() const { +std::u16string Notification::GetTitle() const { return title_; } -base::string16 Notification::GetSubtitle() const { +std::u16string Notification::GetSubtitle() const { return subtitle_; } -base::string16 Notification::GetBody() const { +std::u16string Notification::GetBody() const { return body_; } @@ -112,19 +112,19 @@ bool Notification::GetHasReply() const { return has_reply_; } -base::string16 Notification::GetTimeoutType() const { +std::u16string Notification::GetTimeoutType() const { return timeout_type_; } -base::string16 Notification::GetReplyPlaceholder() const { +std::u16string Notification::GetReplyPlaceholder() const { return reply_placeholder_; } -base::string16 Notification::GetSound() const { +std::u16string Notification::GetSound() const { return sound_; } -base::string16 Notification::GetUrgency() const { +std::u16string Notification::GetUrgency() const { return urgency_; } @@ -132,24 +132,24 @@ std::vector Notification::GetActions() const { return actions_; } -base::string16 Notification::GetCloseButtonText() const { +std::u16string Notification::GetCloseButtonText() const { return close_button_text_; } -base::string16 Notification::GetToastXml() const { +std::u16string Notification::GetToastXml() const { return toast_xml_; } // Setters -void Notification::SetTitle(const base::string16& new_title) { +void Notification::SetTitle(const std::u16string& new_title) { title_ = new_title; } -void Notification::SetSubtitle(const base::string16& new_subtitle) { +void Notification::SetSubtitle(const std::u16string& new_subtitle) { subtitle_ = new_subtitle; } -void Notification::SetBody(const base::string16& new_body) { +void Notification::SetBody(const std::u16string& new_body) { body_ = new_body; } @@ -161,19 +161,19 @@ void Notification::SetHasReply(bool new_has_reply) { has_reply_ = new_has_reply; } -void Notification::SetTimeoutType(const base::string16& new_timeout_type) { +void Notification::SetTimeoutType(const std::u16string& new_timeout_type) { timeout_type_ = new_timeout_type; } -void Notification::SetReplyPlaceholder(const base::string16& new_placeholder) { +void Notification::SetReplyPlaceholder(const std::u16string& new_placeholder) { reply_placeholder_ = new_placeholder; } -void Notification::SetSound(const base::string16& new_sound) { +void Notification::SetSound(const std::u16string& new_sound) { sound_ = new_sound; } -void Notification::SetUrgency(const base::string16& new_urgency) { +void Notification::SetUrgency(const std::u16string& new_urgency) { urgency_ = new_urgency; } @@ -182,11 +182,11 @@ void Notification::SetActions( actions_ = actions; } -void Notification::SetCloseButtonText(const base::string16& text) { +void Notification::SetCloseButtonText(const std::u16string& text) { close_button_text_ = text; } -void Notification::SetToastXml(const base::string16& new_toast_xml) { +void Notification::SetToastXml(const std::u16string& new_toast_xml) { toast_xml_ = new_toast_xml; } diff --git a/shell/browser/api/electron_api_notification.h b/shell/browser/api/electron_api_notification.h index a914f88082b..64a6cbec319 100644 --- a/shell/browser/api/electron_api_notification.h +++ b/shell/browser/api/electron_api_notification.h @@ -65,49 +65,49 @@ class Notification : public gin::Wrappable, void Close(); // Prop Getters - base::string16 GetTitle() const; - base::string16 GetSubtitle() const; - base::string16 GetBody() const; + std::u16string GetTitle() const; + std::u16string GetSubtitle() const; + std::u16string GetBody() const; bool GetSilent() const; bool GetHasReply() const; - base::string16 GetTimeoutType() const; - base::string16 GetReplyPlaceholder() const; - base::string16 GetUrgency() const; - base::string16 GetSound() const; + std::u16string GetTimeoutType() const; + std::u16string GetReplyPlaceholder() const; + std::u16string GetUrgency() const; + std::u16string GetSound() const; std::vector GetActions() const; - base::string16 GetCloseButtonText() const; - base::string16 GetToastXml() const; + std::u16string GetCloseButtonText() const; + std::u16string GetToastXml() const; // Prop Setters - void SetTitle(const base::string16& new_title); - void SetSubtitle(const base::string16& new_subtitle); - void SetBody(const base::string16& new_body); + void SetTitle(const std::u16string& new_title); + void SetSubtitle(const std::u16string& new_subtitle); + void SetBody(const std::u16string& new_body); void SetSilent(bool new_silent); void SetHasReply(bool new_has_reply); - void SetUrgency(const base::string16& new_urgency); - void SetTimeoutType(const base::string16& new_timeout_type); - void SetReplyPlaceholder(const base::string16& new_reply_placeholder); - void SetSound(const base::string16& sound); + void SetUrgency(const std::u16string& new_urgency); + void SetTimeoutType(const std::u16string& new_timeout_type); + void SetReplyPlaceholder(const std::u16string& new_reply_placeholder); + void SetSound(const std::u16string& sound); void SetActions(const std::vector& actions); - void SetCloseButtonText(const base::string16& text); - void SetToastXml(const base::string16& new_toast_xml); + void SetCloseButtonText(const std::u16string& text); + void SetToastXml(const std::u16string& new_toast_xml); private: - base::string16 title_; - base::string16 subtitle_; - base::string16 body_; + std::u16string title_; + std::u16string subtitle_; + std::u16string body_; gfx::Image icon_; - base::string16 icon_path_; + std::u16string icon_path_; bool has_icon_ = false; bool silent_ = false; bool has_reply_ = false; - base::string16 timeout_type_; - base::string16 reply_placeholder_; - base::string16 sound_; - base::string16 urgency_; + std::u16string timeout_type_; + std::u16string reply_placeholder_; + std::u16string sound_; + std::u16string urgency_; std::vector actions_; - base::string16 close_button_text_; - base::string16 toast_xml_; + std::u16string close_button_text_; + std::u16string toast_xml_; electron::NotificationPresenter* presenter_; diff --git a/shell/browser/api/electron_api_url_loader.cc b/shell/browser/api/electron_api_url_loader.cc index 1224be6f216..c08e65b038b 100644 --- a/shell/browser/api/electron_api_url_loader.cc +++ b/shell/browser/api/electron_api_url_loader.cc @@ -344,7 +344,7 @@ void SimpleURLLoaderWrapper::OnAuthRequired( auto cb = base::BindOnce( [](mojo::Remote auth_responder, gin::Arguments* args) { - base::string16 username_str, password_str; + std::u16string username_str, password_str; if (!args->GetNext(&username_str) || !args->GetNext(&password_str)) { auth_responder->OnAuthCredentials(base::nullopt); return; diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 65c4610855f..ee3de4b51ac 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -157,6 +157,7 @@ #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) #include "extensions/browser/script_executor.h" #include "extensions/browser/view_type_utils.h" +#include "extensions/common/mojom/view_type.mojom.h" #include "shell/browser/extensions/electron_extension_web_contents_observer.h" #endif @@ -407,7 +408,7 @@ base::Optional GetCursorBlinkInterval() { // This will return false if no printer with the provided device_name can be // found on the network. We need to check this because Chromium does not do // sanity checking of device_name validity and so will crash on invalid names. -bool IsDeviceNameValid(const base::string16& device_name) { +bool IsDeviceNameValid(const std::u16string& device_name) { #if defined(OS_MAC) base::ScopedCFTypeRef new_printer_id( base::SysUTF16ToCFStringRef(device_name)); @@ -417,12 +418,12 @@ bool IsDeviceNameValid(const base::string16& device_name) { return printer_exists; #elif defined(OS_WIN) printing::ScopedPrinterHandle printer; - return printer.OpenPrinterWithName(device_name.c_str()); + return printer.OpenPrinterWithName(base::UTF16ToWide(device_name).c_str()); #endif return true; } -base::string16 GetDefaultPrinterAsync() { +std::u16string GetDefaultPrinterAsync() { #if defined(OS_WIN) // Blocking is needed here because Windows printer drivers are oftentimes // not thread-safe and have to be accessed on the UI thread. @@ -591,19 +592,19 @@ bool IsDevToolsFileSystemAdded(content::WebContents* web_contents, #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) -WebContents::Type GetTypeFromViewType(extensions::ViewType view_type) { +WebContents::Type GetTypeFromViewType(extensions::mojom::ViewType view_type) { switch (view_type) { - case extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: + case extensions::mojom::ViewType::kExtensionBackgroundPage: return WebContents::Type::kBackgroundPage; - case extensions::VIEW_TYPE_APP_WINDOW: - case extensions::VIEW_TYPE_COMPONENT: - case extensions::VIEW_TYPE_EXTENSION_DIALOG: - case extensions::VIEW_TYPE_EXTENSION_POPUP: - case extensions::VIEW_TYPE_BACKGROUND_CONTENTS: - case extensions::VIEW_TYPE_EXTENSION_GUEST: - case extensions::VIEW_TYPE_TAB_CONTENTS: - case extensions::VIEW_TYPE_INVALID: + case extensions::mojom::ViewType::kAppWindow: + case extensions::mojom::ViewType::kComponent: + case extensions::mojom::ViewType::kExtensionDialog: + case extensions::mojom::ViewType::kExtensionPopup: + case extensions::mojom::ViewType::kBackgroundContents: + case extensions::mojom::ViewType::kExtensionGuest: + case extensions::mojom::ViewType::kTabContents: + case extensions::mojom::ViewType::kInvalid: return WebContents::Type::kRemote; } } @@ -625,8 +626,8 @@ WebContents::WebContents(v8::Isolate* isolate, { #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) // WebContents created by extension host will have valid ViewType set. - extensions::ViewType view_type = extensions::GetViewType(web_contents); - if (view_type != extensions::VIEW_TYPE_INVALID) { + extensions::mojom::ViewType view_type = extensions::GetViewType(web_contents); + if (view_type != extensions::mojom::ViewType::kInvalid) { InitWithExtensionView(isolate, web_contents, view_type); } @@ -865,7 +866,7 @@ void WebContents::InitWithSessionAndOptions( #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) void WebContents::InitWithExtensionView(v8::Isolate* isolate, content::WebContents* web_contents, - extensions::ViewType view_type) { + extensions::mojom::ViewType view_type) { // Must reassign type prior to calling `Init`. type_ = GetTypeFromViewType(view_type); if (GetType() == Type::kRemote) @@ -958,9 +959,9 @@ void WebContents::Destroy() { bool WebContents::DidAddMessageToConsole( content::WebContents* source, blink::mojom::ConsoleMessageLevel level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) { + const std::u16string& source_id) { return Emit("console-message", static_cast(level), message, line_no, source_id); } @@ -1036,7 +1037,7 @@ content::WebContents* WebContents::CreateCustomWebContents( const GURL& opener_url, const std::string& frame_name, const GURL& target_url, - const std::string& partition_id, + const content::StoragePartitionId& partition_id, content::SessionStorageNamespace* session_storage_namespace) { return nullptr; } @@ -1717,7 +1718,7 @@ void WebContents::DidFinishNavigation( } void WebContents::TitleWasSet(content::NavigationEntry* entry) { - base::string16 final_title; + std::u16string final_title; bool explicit_set = true; if (entry) { auto title = entry->GetTitle(); @@ -1984,7 +1985,7 @@ GURL WebContents::GetURL() const { return web_contents()->GetURL(); } -base::string16 WebContents::GetTitle() const { +std::u16string WebContents::GetTitle() const { return web_contents()->GetTitle(); } @@ -2293,9 +2294,9 @@ bool WebContents::IsCurrentlyAudible() { void WebContents::OnGetDefaultPrinter( base::Value print_settings, printing::CompletionCallback print_callback, - base::string16 device_name, + std::u16string device_name, bool silent, - base::string16 default_printer) { + std::u16string default_printer) { // The content::WebContents might be already deleted at this point, and the // PrintViewManagerBasic class does not do null check. if (!web_contents()) { @@ -2304,7 +2305,7 @@ void WebContents::OnGetDefaultPrinter( return; } - base::string16 printer_name = + std::u16string printer_name = device_name.empty() ? default_printer : device_name; // If there are no valid printers available on the network, we bail. @@ -2402,7 +2403,7 @@ void WebContents::Print(gin::Arguments* args) { // We set the default to the system's default printer and only update // if at the Chromium level if the user overrides. // Printer device name as opened by the OS. - base::string16 device_name; + std::u16string device_name; options.Get("deviceName", &device_name); if (!device_name.empty() && !IsDeviceNameValid(device_name)) { gin_helper::ErrorThrower(args->isolate()) @@ -2571,16 +2572,16 @@ void WebContents::Unselect() { web_contents()->CollapseSelection(); } -void WebContents::Replace(const base::string16& word) { +void WebContents::Replace(const std::u16string& word) { web_contents()->Replace(word); } -void WebContents::ReplaceMisspelling(const base::string16& word) { +void WebContents::ReplaceMisspelling(const std::u16string& word) { web_contents()->ReplaceMisspelling(word); } uint32_t WebContents::FindInPage(gin::Arguments* args) { - base::string16 search_text; + std::u16string search_text; if (!args->GetNext(&search_text) || search_text.empty()) { gin_helper::ErrorThrower(args->isolate()) .ThrowError("Must provide a non-empty search content"); diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 1613ae2a7d5..9d7eadc2384 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -48,7 +48,7 @@ #endif #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) -#include "extensions/common/view_type.h" +#include "extensions/common/mojom/view_type.mojom.h" namespace extensions { class ScriptExecutor; @@ -156,7 +156,7 @@ class WebContents : public gin::Wrappable, void LoadURL(const GURL& url, const gin_helper::Dictionary& options); void DownloadURL(const GURL& url); GURL GetURL() const; - base::string16 GetTitle() const; + std::u16string GetTitle() const; bool IsLoading() const; bool IsLoadingMainFrame() const; bool IsWaitingForResponse() const; @@ -201,9 +201,9 @@ class WebContents : public gin::Wrappable, #if BUILDFLAG(ENABLE_PRINTING) void OnGetDefaultPrinter(base::Value print_settings, printing::CompletionCallback print_callback, - base::string16 device_name, + std::u16string device_name, bool silent, - base::string16 default_printer); + std::u16string default_printer); void Print(gin::Arguments* args); // Print current page as PDF. v8::Local PrintToPDF(base::DictionaryValue settings); @@ -225,8 +225,8 @@ class WebContents : public gin::Wrappable, void Delete(); void SelectAll(); void Unselect(); - void Replace(const base::string16& word); - void ReplaceMisspelling(const base::string16& word); + void Replace(const std::u16string& word); + void ReplaceMisspelling(const std::u16string& word); uint32_t FindInPage(gin::Arguments* args); void StopFindInPage(content::StopFindAction action); void ShowDefinitionForSelection(); @@ -325,7 +325,7 @@ class WebContents : public gin::Wrappable, } void RemoveObserver(ExtendedWebContentsObserver* obs) { // Trying to remove from an empty collection leads to an access violation - if (observers_.might_have_observers()) + if (!observers_.empty()) observers_.RemoveObserver(obs); } @@ -438,15 +438,15 @@ class WebContents : public gin::Wrappable, #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) void InitWithExtensionView(v8::Isolate* isolate, content::WebContents* web_contents, - extensions::ViewType view_type); + extensions::mojom::ViewType view_type); #endif // content::WebContentsDelegate: bool DidAddMessageToConsole(content::WebContents* source, blink::mojom::ConsoleMessageLevel level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) override; + const std::u16string& source_id) override; bool IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, @@ -459,7 +459,7 @@ class WebContents : public gin::Wrappable, const GURL& opener_url, const std::string& frame_name, const GURL& target_url, - const std::string& partition_id, + const content::StoragePartitionId& partition_id, content::SessionStorageNamespace* session_storage_namespace) override; void WebContentsCreatedWithFullParams( content::WebContents* source_contents, diff --git a/shell/browser/api/electron_api_web_frame_main.cc b/shell/browser/api/electron_api_web_frame_main.cc index 8834eef51c6..9ef45ea185e 100644 --- a/shell/browser/api/electron_api_web_frame_main.cc +++ b/shell/browser/api/electron_api_web_frame_main.cc @@ -78,7 +78,7 @@ bool WebFrameMain::CheckRenderFrame() const { v8::Local WebFrameMain::ExecuteJavaScript( gin::Arguments* args, - const base::string16& code) { + const std::u16string& code) { gin_helper::Promise promise(args->isolate()); v8::Local handle = promise.GetHandle(); diff --git a/shell/browser/api/electron_api_web_frame_main.h b/shell/browser/api/electron_api_web_frame_main.h index 18e7515ec9c..4d0dc989055 100644 --- a/shell/browser/api/electron_api_web_frame_main.h +++ b/shell/browser/api/electron_api_web_frame_main.h @@ -78,7 +78,7 @@ class WebFrameMain : public gin::Wrappable, void Connect(); v8::Local ExecuteJavaScript(gin::Arguments* args, - const base::string16& code); + const std::u16string& code); bool Reload(); void Send(v8::Isolate* isolate, bool internal, diff --git a/shell/browser/browser.h b/shell/browser/browser.h index 07aae2b1a95..cd96d4ea1b2 100755 --- a/shell/browser/browser.h +++ b/shell/browser/browser.h @@ -12,7 +12,6 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/observer_list.h" -#include "base/strings/string16.h" #include "base/task/cancelable_task_tracker.h" #include "base/values.h" #include "gin/dictionary.h" @@ -85,7 +84,7 @@ class Browser : public WindowListObserver { void ClearRecentDocuments(); // Set the application user model ID. - void SetAppUserModelID(const base::string16& name); + void SetAppUserModelID(const std::wstring& name); // Remove the default protocol handler registry key bool RemoveAsDefaultProtocolClient(const std::string& protocol, @@ -99,7 +98,7 @@ class Browser : public WindowListObserver { bool IsDefaultProtocolClient(const std::string& protocol, gin::Arguments* args); - base::string16 GetApplicationNameForProtocol(const GURL& url); + std::u16string GetApplicationNameForProtocol(const GURL& url); #if !defined(OS_LINUX) // get the name, icon and path for an application @@ -113,10 +112,10 @@ class Browser : public WindowListObserver { #if defined(OS_WIN) struct LaunchItem { - base::string16 name; - base::string16 path; - base::string16 scope; - std::vector args; + std::wstring name; + std::wstring path; + std::wstring scope; + std::vector args; bool enabled = true; LaunchItem(); @@ -132,13 +131,13 @@ class Browser : public WindowListObserver { bool restore_state = false; bool opened_at_login = false; bool opened_as_hidden = false; - base::string16 path; - std::vector args; + std::u16string path; + std::vector args; #if defined(OS_WIN) // used in browser::setLoginItemSettings bool enabled = true; - base::string16 name = base::string16(); + std::wstring name; // used in browser::getLoginItemSettings bool executable_will_launch_at_login = false; @@ -238,9 +237,9 @@ class Browser : public WindowListObserver { #if defined(OS_WIN) struct UserTask { base::FilePath program; - base::string16 arguments; - base::string16 title; - base::string16 description; + std::wstring arguments; + std::wstring title; + std::wstring description; base::FilePath working_dir; base::FilePath icon_path; int icon_index; diff --git a/shell/browser/browser_linux.cc b/shell/browser/browser_linux.cc index 8d3c26e95d0..6243db89303 100644 --- a/shell/browser/browser_linux.cc +++ b/shell/browser/browser_linux.cc @@ -88,7 +88,7 @@ void Browser::AddRecentDocument(const base::FilePath& path) {} void Browser::ClearRecentDocuments() {} -void Browser::SetAppUserModelID(const base::string16& name) {} +void Browser::SetAppUserModelID(const std::wstring& name) {} bool Browser::SetAsDefaultProtocolClient(const std::string& protocol, gin::Arguments* args) { @@ -122,7 +122,7 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol, return false; } -base::string16 Browser::GetApplicationNameForProtocol(const GURL& url) { +std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) { const std::vector argv = { "xdg-mime", "query", "default", std::string("x-scheme-handler/") + url.scheme()}; diff --git a/shell/browser/browser_mac.mm b/shell/browser/browser_mac.mm index 5bc184dd0b0..86d1be74a38 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -58,7 +58,7 @@ gfx::Image GetApplicationIconForProtocol(NSString* _Nonnull app_path) { return icon; } -base::string16 GetAppDisplayNameForProtocol(NSString* app_path) { +std::u16string GetAppDisplayNameForProtocol(NSString* app_path) { NSString* app_display_name = [[NSFileManager defaultManager] displayNameAtPath:app_path]; return base::SysNSStringToUTF16(app_display_name); @@ -81,8 +81,8 @@ v8::Local Browser::GetApplicationInfoForProtocol( return handle; } - base::string16 app_path = base::SysNSStringToUTF16(ns_app_path); - base::string16 app_display_name = GetAppDisplayNameForProtocol(ns_app_path); + std::u16string app_path = base::SysNSStringToUTF16(ns_app_path); + std::u16string app_display_name = GetAppDisplayNameForProtocol(ns_app_path); gfx::Image app_icon = GetApplicationIconForProtocol(ns_app_path); dict.Set("name", app_display_name); @@ -209,16 +209,16 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol, return result == NSOrderedSame; } -base::string16 Browser::GetApplicationNameForProtocol(const GURL& url) { +std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) { NSString* app_path = GetAppPathForProtocol(url); if (!app_path) { - return base::string16(); + return std::u16string(); } - base::string16 app_display_name = GetAppDisplayNameForProtocol(app_path); + std::u16string app_display_name = GetAppDisplayNameForProtocol(app_path); return app_display_name; } -void Browser::SetAppUserModelID(const base::string16& name) {} +void Browser::SetAppUserModelID(const std::wstring& name) {} bool Browser::SetBadgeCount(base::Optional count) { DockSetBadgeText(!count.has_value() || count.value() != 0 diff --git a/shell/browser/browser_win.cc b/shell/browser/browser_win.cc index ce488e982ea..0db6ab988d9 100755 --- a/shell/browser/browser_win.cc +++ b/shell/browser/browser_win.cc @@ -48,7 +48,7 @@ namespace electron { namespace { -bool GetProcessExecPath(base::string16* exe) { +bool GetProcessExecPath(std::wstring* exe) { base::FilePath path; if (!base::PathService::Get(base::FILE_EXE, &path)) { return false; @@ -57,13 +57,13 @@ bool GetProcessExecPath(base::string16* exe) { return true; } -bool GetProtocolLaunchPath(gin::Arguments* args, base::string16* exe) { +bool GetProtocolLaunchPath(gin::Arguments* args, std::wstring* exe) { if (!args->GetNext(exe) && !GetProcessExecPath(exe)) { return false; } // Read in optional args arg - std::vector launch_args; + std::vector launch_args; if (args->GetNext(&launch_args) && !launch_args.empty()) *exe = base::StringPrintf(L"\"%ls\" %ls \"%%1\"", exe->c_str(), base::JoinString(launch_args, L" ").c_str()); @@ -75,7 +75,7 @@ bool GetProtocolLaunchPath(gin::Arguments* args, base::string16* exe) { // Windows treats a given scheme as an Internet scheme only if its registry // entry has a "URL Protocol" key. Check this, otherwise we allow ProgIDs to be // used as custom protocols which leads to security bugs. -bool IsValidCustomProtocol(const base::string16& scheme) { +bool IsValidCustomProtocol(const std::wstring& scheme) { if (scheme.empty()) return false; base::win::RegKey cmd_key(HKEY_CLASSES_ROOT, scheme.c_str(), KEY_QUERY_VALUE); @@ -90,11 +90,10 @@ bool IsValidCustomProtocol(const base::string16& scheme) { // Windows 8 introduced a new protocol->executable binding system which cannot // be retrieved in the HKCR registry subkey method implemented below. We call // AssocQueryString with the new Win8-only flag ASSOCF_IS_PROTOCOL instead. -base::string16 GetAppInfoHelperForProtocol(ASSOCSTR assoc_str, - const GURL& url) { - const base::string16 url_scheme = base::ASCIIToUTF16(url.scheme()); +std::wstring GetAppInfoHelperForProtocol(ASSOCSTR assoc_str, const GURL& url) { + const std::wstring url_scheme = base::ASCIIToWide(url.scheme()); if (!IsValidCustomProtocol(url_scheme)) - return base::string16(); + return std::wstring(); wchar_t out_buffer[1024]; DWORD buffer_size = base::size(out_buffer); @@ -103,13 +102,13 @@ base::string16 GetAppInfoHelperForProtocol(ASSOCSTR assoc_str, out_buffer, &buffer_size); if (FAILED(hr)) { DLOG(WARNING) << "AssocQueryString failed!"; - return base::string16(); + return std::wstring(); } - return base::string16(out_buffer); + return std::wstring(out_buffer); } void OnIconDataAvailable(const base::FilePath& app_path, - const base::string16& app_display_name, + const std::wstring& app_display_name, gin_helper::Promise promise, gfx::Image icon) { if (!icon.IsEmpty()) { @@ -126,21 +125,21 @@ void OnIconDataAvailable(const base::FilePath& app_path, } } -base::string16 GetAppDisplayNameForProtocol(const GURL& url) { +std::wstring GetAppDisplayNameForProtocol(const GURL& url) { return GetAppInfoHelperForProtocol(ASSOCSTR_FRIENDLYAPPNAME, url); } -base::string16 GetAppPathForProtocol(const GURL& url) { +std::wstring GetAppPathForProtocol(const GURL& url) { return GetAppInfoHelperForProtocol(ASSOCSTR_EXECUTABLE, url); } -base::string16 GetAppForProtocolUsingRegistry(const GURL& url) { - const base::string16 url_scheme = base::ASCIIToUTF16(url.scheme()); +std::wstring GetAppForProtocolUsingRegistry(const GURL& url) { + const std::wstring url_scheme = base::ASCIIToWide(url.scheme()); if (!IsValidCustomProtocol(url_scheme)) - return base::string16(); + return std::wstring(); // First, try and extract the application's display name. - base::string16 command_to_launch; + std::wstring command_to_launch; base::win::RegKey cmd_key_name(HKEY_CLASSES_ROOT, url_scheme.c_str(), KEY_READ); if (cmd_key_name.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS && @@ -150,7 +149,7 @@ base::string16 GetAppForProtocolUsingRegistry(const GURL& url) { // Otherwise, parse the command line in the registry, and return the basename // of the program path if it exists. - const base::string16 cmd_key_path = url_scheme + L"\\shell\\open\\command"; + const std::wstring cmd_key_path = url_scheme + L"\\shell\\open\\command"; base::win::RegKey cmd_key_exe(HKEY_CLASSES_ROOT, cmd_key_path.c_str(), KEY_READ); if (cmd_key_exe.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS) { @@ -159,18 +158,20 @@ base::string16 GetAppForProtocolUsingRegistry(const GURL& url) { return command_line.GetProgram().BaseName().value(); } - return base::string16(); + return std::wstring(); } -bool FormatCommandLineString(base::string16* exe, - const std::vector& launch_args) { +bool FormatCommandLineString(std::wstring* exe, + const std::vector& launch_args) { if (exe->empty() && !GetProcessExecPath(exe)) { return false; } if (!launch_args.empty()) { + std::u16string joined_launch_args = + base::JoinString(launch_args, base::UTF8ToUTF16(" ")); *exe = base::StringPrintf(L"%ls %ls", exe->c_str(), - base::JoinString(launch_args, L" ").c_str()); + base::UTF16ToWide(joined_launch_args).c_str()); } return true; @@ -184,18 +185,20 @@ bool FormatCommandLineString(base::string16* exe, std::vector GetLoginItemSettingsHelper( base::win::RegistryValueIterator* it, boolean* executable_will_launch_at_login, - base::string16 scope, + std::wstring scope, const Browser::LoginItemSettings& options) { std::vector launch_items; base::FilePath lookup_exe_path; if (options.path.empty()) { - base::string16 process_exe_path; + std::wstring process_exe_path; GetProcessExecPath(&process_exe_path); lookup_exe_path = base::CommandLine::FromString(process_exe_path).GetProgram(); } else { - lookup_exe_path = base::CommandLine::FromString(options.path).GetProgram(); + lookup_exe_path = + base::CommandLine::FromString(base::UTF16ToWide(options.path)) + .GetProgram(); } if (!lookup_exe_path.empty()) { @@ -287,7 +290,7 @@ Browser::UserTask::~UserTask() = default; void GetFileIcon(const base::FilePath& path, v8::Isolate* isolate, base::CancelableTaskTracker* cancelable_task_tracker_, - const base::string16 app_display_name, + const std::wstring app_display_name, gin_helper::Promise promise) { base::FilePath normalized_path = path.NormalizePathSeparators(); IconLoader::IconSize icon_size = IconLoader::IconSize::LARGE; @@ -316,13 +319,13 @@ void GetApplicationInfoForProtocolUsingRegistry( base::CancelableTaskTracker* cancelable_task_tracker_) { base::FilePath app_path; - const base::string16 url_scheme = base::ASCIIToUTF16(url.scheme()); + const std::wstring url_scheme = base::ASCIIToWide(url.scheme()); if (!IsValidCustomProtocol(url_scheme)) { promise.RejectWithErrorMessage("invalid url_scheme"); return; } - base::string16 command_to_launch; - const base::string16 cmd_key_path = url_scheme + L"\\shell\\open\\command"; + std::wstring command_to_launch; + const std::wstring cmd_key_path = url_scheme + L"\\shell\\open\\command"; base::win::RegKey cmd_key_exe(HKEY_CLASSES_ROOT, cmd_key_path.c_str(), KEY_READ); if (cmd_key_exe.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS) { @@ -334,7 +337,7 @@ void GetApplicationInfoForProtocolUsingRegistry( "Unable to retrieve installation path to app"); return; } - const base::string16 app_display_name = GetAppForProtocolUsingRegistry(url); + const std::wstring app_display_name = GetAppForProtocolUsingRegistry(url); if (app_display_name.empty()) { promise.RejectWithErrorMessage( @@ -354,7 +357,7 @@ void GetApplicationInfoForProtocolUsingAssocQuery( const GURL& url, gin_helper::Promise promise, base::CancelableTaskTracker* cancelable_task_tracker_) { - base::string16 app_path = GetAppPathForProtocol(url); + std::wstring app_path = GetAppPathForProtocol(url); if (app_path.empty()) { promise.RejectWithErrorMessage( @@ -362,7 +365,7 @@ void GetApplicationInfoForProtocolUsingAssocQuery( return; } - base::string16 app_display_name = GetAppDisplayNameForProtocol(url); + std::wstring app_display_name = GetAppDisplayNameForProtocol(url); if (app_display_name.empty()) { promise.RejectWithErrorMessage("Unable to retrieve display name of app"); @@ -390,7 +393,7 @@ void Browser::ClearRecentDocuments() { SHAddToRecentDocs(SHARD_APPIDINFO, nullptr); } -void Browser::SetAppUserModelID(const base::string16& name) { +void Browser::SetAppUserModelID(const std::wstring& name) { electron::SetAppUserModelID(name); } @@ -426,12 +429,12 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol, // Main Registry Key HKEY root = HKEY_CURRENT_USER; - base::string16 keyPath = L"Software\\Classes\\"; + std::wstring keyPath = L"Software\\Classes\\"; // Command Key - base::string16 wprotocol = base::UTF8ToUTF16(protocol); - base::string16 shellPath = wprotocol + L"\\shell"; - base::string16 cmdPath = keyPath + shellPath + L"\\open\\command"; + std::wstring wprotocol = base::UTF8ToWide(protocol); + std::wstring shellPath = wprotocol + L"\\shell"; + std::wstring cmdPath = keyPath + shellPath + L"\\open\\command"; base::win::RegKey classesKey; base::win::RegKey commandKey; @@ -445,12 +448,12 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol, // Key doesn't even exist, we can confirm that it is not set return true; - base::string16 keyVal; + std::wstring keyVal; if (FAILED(commandKey.ReadValue(L"", &keyVal))) // Default value not set, we can confirm that it is not set return true; - base::string16 exe; + std::wstring exe; if (!GetProtocolLaunchPath(args, &exe)) return false; @@ -461,7 +464,7 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol, // Let's clean up after ourselves base::win::RegKey protocolKey; - base::string16 protocolPath = keyPath + wprotocol; + std::wstring protocolPath = keyPath + wprotocol; if (SUCCEEDED( protocolKey.Open(root, protocolPath.c_str(), KEY_ALL_ACCESS))) { @@ -500,17 +503,17 @@ bool Browser::SetAsDefaultProtocolClient(const std::string& protocol, if (protocol.empty()) return false; - base::string16 exe; + std::wstring exe; if (!GetProtocolLaunchPath(args, &exe)) return false; // Main Registry Key HKEY root = HKEY_CURRENT_USER; - base::string16 keyPath = base::UTF8ToUTF16("Software\\Classes\\" + protocol); - base::string16 urlDecl = base::UTF8ToUTF16("URL:" + protocol); + std::wstring keyPath = base::UTF8ToWide("Software\\Classes\\" + protocol); + std::wstring urlDecl = base::UTF8ToWide("URL:" + protocol); // Command Key - base::string16 cmdPath = keyPath + L"\\shell\\open\\command"; + std::wstring cmdPath = keyPath + L"\\shell\\open\\command"; // Write information to registry base::win::RegKey key(root, keyPath.c_str(), KEY_ALL_ACCESS); @@ -530,16 +533,16 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol, if (protocol.empty()) return false; - base::string16 exe; + std::wstring exe; if (!GetProtocolLaunchPath(args, &exe)) return false; // Main Registry Key HKEY root = HKEY_CURRENT_USER; - base::string16 keyPath = base::UTF8ToUTF16("Software\\Classes\\" + protocol); + std::wstring keyPath = base::UTF8ToWide("Software\\Classes\\" + protocol); // Command Key - base::string16 cmdPath = keyPath + L"\\shell\\open\\command"; + std::wstring cmdPath = keyPath + L"\\shell\\open\\command"; base::win::RegKey key; base::win::RegKey commandKey; @@ -551,7 +554,7 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol, // Key doesn't exist, we can confirm that it is not set return false; - base::string16 keyVal; + std::wstring keyVal; if (FAILED(commandKey.ReadValue(L"", &keyVal))) // Default value not set, we can confirm that it is not set return false; @@ -560,15 +563,15 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol, return keyVal == exe; } -base::string16 Browser::GetApplicationNameForProtocol(const GURL& url) { +std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) { // Windows 8 or above has a new protocol association query. if (base::win::GetVersion() >= base::win::Version::WIN8) { - base::string16 application_name = GetAppDisplayNameForProtocol(url); + std::wstring application_name = GetAppDisplayNameForProtocol(url); if (!application_name.empty()) - return application_name; + return base::WideToUTF16(application_name); } - return GetAppForProtocolUsingRegistry(url); + return base::WideToUTF16(GetAppForProtocolUsingRegistry(url)); } v8::Local Browser::GetApplicationInfoForProtocol( @@ -686,11 +689,10 @@ void Browser::UpdateBadgeContents( } void Browser::SetLoginItemSettings(LoginItemSettings settings) { - base::string16 key_path = - L"Software\\Microsoft\\Windows\\CurrentVersion\\Run"; + std::wstring key_path = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run"; base::win::RegKey key(HKEY_CURRENT_USER, key_path.c_str(), KEY_ALL_ACCESS); - base::string16 startup_approved_key_path = + std::wstring startup_approved_key_path = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StartupApproved" L"\\Run"; base::win::RegKey startup_approved_key( @@ -699,7 +701,7 @@ void Browser::SetLoginItemSettings(LoginItemSettings settings) { !settings.name.empty() ? settings.name.c_str() : GetAppUserModelID(); if (settings.open_at_login) { - base::string16 exe = settings.path; + std::wstring exe = base::UTF16ToWide(settings.path); if (FormatCommandLineString(&exe, settings.args)) { key.WriteValue(key_name, exe.c_str()); @@ -732,13 +734,13 @@ void Browser::SetLoginItemSettings(LoginItemSettings settings) { Browser::LoginItemSettings Browser::GetLoginItemSettings( const LoginItemSettings& options) { LoginItemSettings settings; - base::string16 keyPath = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run"; + std::wstring keyPath = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run"; base::win::RegKey key(HKEY_CURRENT_USER, keyPath.c_str(), KEY_ALL_ACCESS); - base::string16 keyVal; + std::wstring keyVal; // keep old openAtLogin behaviour if (!FAILED(key.ReadValue(GetAppUserModelID(), &keyVal))) { - base::string16 exe = options.path; + std::wstring exe = base::UTF16ToWide(options.path); if (FormatCommandLineString(&exe, options.args)) { settings.open_at_login = keyVal == exe; } diff --git a/shell/browser/electron_autofill_driver.cc b/shell/browser/electron_autofill_driver.cc index 029df62158e..fb541ac9f75 100644 --- a/shell/browser/electron_autofill_driver.cc +++ b/shell/browser/electron_autofill_driver.cc @@ -27,8 +27,8 @@ AutofillDriver::~AutofillDriver() = default; void AutofillDriver::ShowAutofillPopup( const gfx::RectF& bounds, - const std::vector& values, - const std::vector& labels) { + const std::vector& values, + const std::vector& labels) { v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); v8::HandleScope scope(isolate); auto* web_contents = api::WebContents::From( diff --git a/shell/browser/electron_autofill_driver.h b/shell/browser/electron_autofill_driver.h index f1085e73090..2e3b0c489df 100644 --- a/shell/browser/electron_autofill_driver.h +++ b/shell/browser/electron_autofill_driver.h @@ -27,8 +27,8 @@ class AutofillDriver : public mojom::ElectronAutofillDriver { ~AutofillDriver() override; void ShowAutofillPopup(const gfx::RectF& bounds, - const std::vector& values, - const std::vector& labels) override; + const std::vector& values, + const std::vector& labels) override; void HideAutofillPopup() override; private: diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 3a42043bf6b..fca40a30cc0 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -30,6 +30,7 @@ #include "chrome/common/chrome_version.h" #include "components/net_log/chrome_net_log.h" #include "components/network_hints/common/network_hints.mojom.h" +#include "content/browser/site_instance_impl.h" // nogncheck #include "content/public/browser/browser_main_runner.h" #include "content/public/browser/browser_ppapi_host.h" #include "content/public/browser/browser_task_traits.h" @@ -195,6 +196,14 @@ namespace { // Next navigation should not restart renderer process. bool g_suppress_renderer_process_restart = false; +// c.f. https://chromium-review.googlesource.com/c/chromium/src/+/2680274 +content::SiteInfo GetSiteForURL(content::BrowserContext* browser_context, + const GURL& url) { + return content::SiteInfo::Create( + content::IsolationContext(browser_context), content::UrlInfo(url, false), + content::CoopCoepCrossOriginIsolatedInfo::CreateNonIsolated()); +} + bool IsSameWebSite(content::BrowserContext* browser_context, content::SiteInstance* site_instance, const GURL& dest_url) { @@ -202,7 +211,7 @@ bool IsSameWebSite(content::BrowserContext* browser_context, // `IsSameSiteWithURL` doesn't seem to work for some URIs such as // `file:`, handle these scenarios by comparing only the site as // defined by `GetSiteForURL`. - (content::SiteInstance::GetSiteForURL(browser_context, dest_url) == + (GetSiteForURL(browser_context, dest_url).site_url() == site_instance->GetSiteURL()); } @@ -499,7 +508,7 @@ content::SiteInstance* ElectronBrowserClient::GetSiteInstanceFromAffinity( std::string affinity = GetAffinityPreference(rfh); if (!affinity.empty()) { auto iter = site_per_affinities_.find(affinity); - GURL dest_site = content::SiteInstance::GetSiteForURL(browser_context, url); + GURL dest_site = GetSiteForURL(browser_context, url).site_url(); if (iter != site_per_affinities_.end() && IsSameWebSite(browser_context, iter->second, dest_site)) { return iter->second; @@ -911,7 +920,7 @@ ElectronBrowserClient::CreateWindowForPictureInPicture( content::PictureInPictureWindowController* controller) { auto overlay_window = content::OverlayWindow::Create(controller); #if defined(OS_WIN) - base::string16 app_user_model_id = Browser::Get()->GetAppUserModelID(); + std::wstring app_user_model_id = Browser::Get()->GetAppUserModelID(); if (!app_user_model_id.empty()) { auto* overlay_window_view = static_cast(overlay_window.get()); @@ -1068,7 +1077,8 @@ void ElectronBrowserClient::ConfigureNetworkContextParams( bool in_memory, const base::FilePath& relative_partition_path, network::mojom::NetworkContextParams* network_context_params, - network::mojom::CertVerifierCreationParams* cert_verifier_creation_params) { + cert_verifier::mojom::CertVerifierCreationParams* + cert_verifier_creation_params) { DCHECK(browser_context); return NetworkContextServiceFactory::GetForContext(browser_context) ->ConfigureNetworkContextParams(network_context_params, @@ -1161,6 +1171,7 @@ bool ElectronBrowserClient::HandleExternalProtocol( const GURL& url, content::WebContents::OnceGetter web_contents_getter, int child_id, + int frame_tree_node_id, content::NavigationUIData* navigation_data, bool is_main_frame, ui::PageTransition page_transition, diff --git a/shell/browser/electron_browser_client.h b/shell/browser/electron_browser_client.h index 18da46835c2..354d7a89b68 100644 --- a/shell/browser/electron_browser_client.h +++ b/shell/browser/electron_browser_client.h @@ -167,8 +167,8 @@ class ElectronBrowserClient : public content::ContentBrowserClient, bool in_memory, const base::FilePath& relative_partition_path, network::mojom::NetworkContextParams* network_context_params, - network::mojom::CertVerifierCreationParams* cert_verifier_creation_params) - override; + cert_verifier::mojom::CertVerifierCreationParams* + cert_verifier_creation_params) override; network::mojom::NetworkContext* GetSystemNetworkContext() override; content::MediaObserver* GetMediaObserver() override; content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; @@ -239,6 +239,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient, const GURL& url, content::WebContents::OnceGetter web_contents_getter, int child_id, + int frame_tree_node_id, content::NavigationUIData* navigation_data, bool is_main_frame, ui::PageTransition page_transition, diff --git a/shell/browser/electron_browser_context.cc b/shell/browser/electron_browser_context.cc index 2f48d7f2e86..f09a92e2d18 100644 --- a/shell/browser/electron_browser_context.cc +++ b/shell/browser/electron_browser_context.cc @@ -108,9 +108,7 @@ ElectronBrowserContext::ElectronBrowserContext(const std::string& partition, : storage_policy_(new SpecialStoragePolicy), protocol_registry_(new ProtocolRegistry), in_memory_(in_memory), - ssl_config_(network::mojom::SSLConfig::New()), - shared_cors_origin_access_list_( - content::SharedCorsOriginAccessList::Create()) { + ssl_config_(network::mojom::SSLConfig::New()) { user_agent_ = ElectronBrowserClient::Get()->GetUserAgent(); // Read options. @@ -354,8 +352,8 @@ ElectronBrowserContext::GetURLLoaderFactory() { auto* storage_partition = content::BrowserContext::GetDefaultStoragePartition(this); - params->auth_cert_observer = - storage_partition->CreateAuthAndCertObserverForNavigationRequest(-1); + params->url_loader_network_observer = + storage_partition->CreateURLLoaderNetworkObserverForNavigationRequest(-1); storage_partition->GetNetworkContext()->CreateURLLoaderFactory( std::move(factory_receiver), std::move(params)); url_loader_factory_ = @@ -433,34 +431,6 @@ ElectronBrowserContext::GetStorageNotificationService() { return nullptr; } -void ElectronBrowserContext::SetCorsOriginAccessListForOrigin( - TargetBrowserContexts target_mode, - const url::Origin& source_origin, - std::vector allow_patterns, - std::vector block_patterns, - base::OnceClosure closure) { - using content::CorsOriginPatternSetter; - // We ignore target_mode because we don't support extensions in in-memory - // sessions. - auto barrier_closure = BarrierClosure(2, std::move(closure)); - base::MakeRefCounted( - source_origin, CorsOriginPatternSetter::ClonePatterns(allow_patterns), - CorsOriginPatternSetter::ClonePatterns(block_patterns), barrier_closure) - ->ApplyToEachStoragePartition(this); - - // Keep the per-profile access list up to date so that we can use this to - // restore NetworkContext settings at anytime, e.g. on restarting the - // network service. - shared_cors_origin_access_list_->SetForOrigin( - source_origin, std::move(allow_patterns), std::move(block_patterns), - barrier_closure); -} - -content::SharedCorsOriginAccessList* -ElectronBrowserContext::GetSharedCorsOriginAccessList() { - return shared_cors_origin_access_list_.get(); -} - ResolveProxyHelper* ElectronBrowserContext::GetResolveProxyHelper() { if (!resolve_proxy_helper_) { resolve_proxy_helper_ = base::MakeRefCounted(this); diff --git a/shell/browser/electron_browser_context.h b/shell/browser/electron_browser_context.h index 1a55d7191cc..1db419e0451 100644 --- a/shell/browser/electron_browser_context.h +++ b/shell/browser/electron_browser_context.h @@ -113,15 +113,6 @@ class ElectronBrowserContext override; content::StorageNotificationService* GetStorageNotificationService() override; - // extensions deps - void SetCorsOriginAccessListForOrigin( - TargetBrowserContexts target_mode, - const url::Origin& source_origin, - std::vector allow_patterns, - std::vector block_patterns, - base::OnceClosure closure) override; - content::SharedCorsOriginAccessList* GetSharedCorsOriginAccessList() override; - CookieChangeNotifier* cookie_change_notifier() const { return cookie_change_notifier_.get(); } @@ -199,9 +190,6 @@ class ElectronBrowserContext network::mojom::SSLConfigPtr ssl_config_; mojo::Remote ssl_config_client_; - scoped_refptr - shared_cors_origin_access_list_; - base::WeakPtrFactory weak_factory_{this}; DISALLOW_COPY_AND_ASSIGN(ElectronBrowserContext); diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index 8e21a1e5ee6..607f4e0b8fe 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -86,7 +86,6 @@ #endif #if defined(OS_WIN) -#include "ui/base/cursor/win/win_cursor_factory.h" #include "ui/base/l10n/l10n_util_win.h" #include "ui/display/win/dpi.h" #include "ui/gfx/system_fonts_win.h" @@ -142,7 +141,7 @@ int GetMinimumFontSize() { } #endif -base::string16 MediaStringProvider(media::MessageId id) { +std::u16string MediaStringProvider(media::MessageId id) { switch (id) { case media::DEFAULT_AUDIO_DEVICE_NAME: return base::ASCIIToUTF16("Default"); @@ -151,7 +150,7 @@ base::string16 MediaStringProvider(media::MessageId id) { return base::ASCIIToUTF16("Communications"); #endif default: - return base::string16(); + return std::u16string(); } } @@ -408,10 +407,6 @@ void ElectronBrowserMainParts::ToolkitInitialized() { #if defined(OS_WIN) gfx::win::SetAdjustFontCallback(&AdjustUIFont); gfx::win::SetGetMinimumFontSizeCallback(&GetMinimumFontSize); - - wchar_t module_name[MAX_PATH] = {0}; - if (GetModuleFileName(NULL, module_name, base::size(module_name))) - ui::SetCursorResourceModule(module_name); #endif #if defined(OS_MAC) diff --git a/shell/browser/electron_javascript_dialog_manager.cc b/shell/browser/electron_javascript_dialog_manager.cc index 519dc0aa98b..b78d5c5f424 100644 --- a/shell/browser/electron_javascript_dialog_manager.cc +++ b/shell/browser/electron_javascript_dialog_manager.cc @@ -34,8 +34,8 @@ void ElectronJavaScriptDialogManager::RunJavaScriptDialog( content::WebContents* web_contents, content::RenderFrameHost* rfh, JavaScriptDialogType dialog_type, - const base::string16& message_text, - const base::string16& default_prompt_text, + const std::u16string& message_text, + const std::u16string& default_prompt_text, DialogClosedCallback callback, bool* did_suppress_message) { auto origin_url = rfh->GetLastCommittedURL(); @@ -50,19 +50,19 @@ void ElectronJavaScriptDialogManager::RunJavaScriptDialog( } if (origin_counts_[origin] == kUserWantsNoMoreDialogs) { - return std::move(callback).Run(false, base::string16()); + return std::move(callback).Run(false, std::u16string()); } if (dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT && dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) { - std::move(callback).Run(false, base::string16()); + std::move(callback).Run(false, std::u16string()); return; } auto* web_preferences = WebContentsPreferences::From(web_contents); if (web_preferences && web_preferences->IsEnabled("disableDialogs")) { - return std::move(callback).Run(false, base::string16()); + return std::move(callback).Run(false, std::u16string()); } // No default button @@ -116,7 +116,7 @@ void ElectronJavaScriptDialogManager::RunBeforeUnloadDialog( auto* api_web_contents = api::WebContents::From(web_contents); if (api_web_contents) { bool default_prevented = api_web_contents->Emit("will-prevent-unload"); - std::move(callback).Run(default_prevented, base::string16()); + std::move(callback).Run(default_prevented, std::u16string()); } } @@ -131,7 +131,7 @@ void ElectronJavaScriptDialogManager::OnMessageBoxCallback( bool checkbox_checked) { if (checkbox_checked) origin_counts_[origin] = kUserWantsNoMoreDialogs; - std::move(callback).Run(code == 0, base::string16()); + std::move(callback).Run(code == 0, std::u16string()); } } // namespace electron diff --git a/shell/browser/electron_javascript_dialog_manager.h b/shell/browser/electron_javascript_dialog_manager.h index 0794a6aa063..4c5135c9eda 100644 --- a/shell/browser/electron_javascript_dialog_manager.h +++ b/shell/browser/electron_javascript_dialog_manager.h @@ -26,8 +26,8 @@ class ElectronJavaScriptDialogManager void RunJavaScriptDialog(content::WebContents* web_contents, content::RenderFrameHost* rfh, content::JavaScriptDialogType dialog_type, - const base::string16& message_text, - const base::string16& default_prompt_text, + const std::u16string& message_text, + const std::u16string& default_prompt_text, DialogClosedCallback callback, bool* did_suppress_message) override; void RunBeforeUnloadDialog(content::WebContents* web_contents, diff --git a/shell/browser/extended_web_contents_observer.h b/shell/browser/extended_web_contents_observer.h index 3914789eaf7..20fd7b45596 100644 --- a/shell/browser/extended_web_contents_observer.h +++ b/shell/browser/extended_web_contents_observer.h @@ -8,7 +8,6 @@ #include #include "base/observer_list.h" -#include "base/strings/string16.h" #include "electron/shell/common/api/api.mojom.h" #include "ui/gfx/geometry/rect.h" @@ -23,7 +22,7 @@ class ExtendedWebContentsObserver : public base::CheckedObserver { const std::vector& regions) {} virtual void OnSetContentBounds(const gfx::Rect& rect) {} virtual void OnActivateContents() {} - virtual void OnPageTitleUpdated(const base::string16& title, + virtual void OnPageTitleUpdated(const std::u16string& title, bool explicit_set) {} virtual void OnDevToolsResized() {} diff --git a/shell/browser/extensions/api/management/electron_management_api_delegate.cc b/shell/browser/extensions/api/management/electron_management_api_delegate.cc index 8ff30485521..2239c8759c2 100644 --- a/shell/browser/extensions/api/management/electron_management_api_delegate.cc +++ b/shell/browser/extensions/api/management/electron_management_api_delegate.cc @@ -204,7 +204,7 @@ bool ElectronManagementAPIDelegate::UninstallExtension( content::BrowserContext* context, const std::string& transient_extension_id, extensions::UninstallReason reason, - base::string16* error) const { + std::u16string* error) const { // TODO(sentialx): we don't have ExtensionService // return extensions::ExtensionSystem::Get(context) // ->extension_service() diff --git a/shell/browser/extensions/api/management/electron_management_api_delegate.h b/shell/browser/extensions/api/management/electron_management_api_delegate.h index 55395613271..2a066b0cfc4 100644 --- a/shell/browser/extensions/api/management/electron_management_api_delegate.h +++ b/shell/browser/extensions/api/management/electron_management_api_delegate.h @@ -73,7 +73,7 @@ class ElectronManagementAPIDelegate : public extensions::ManagementAPIDelegate { bool UninstallExtension(content::BrowserContext* context, const std::string& transient_extension_id, extensions::UninstallReason reason, - base::string16* error) const override; + std::u16string* error) const override; void SetLaunchType(content::BrowserContext* context, const std::string& extension_id, extensions::LaunchType launch_type) const override; diff --git a/shell/browser/extensions/api/tabs/tabs_api.cc b/shell/browser/extensions/api/tabs/tabs_api.cc index ffc0124cff1..13f89e077d8 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.cc +++ b/shell/browser/extensions/api/tabs/tabs_api.cc @@ -10,6 +10,7 @@ #include "extensions/browser/extension_api_frame_id_map.h" #include "extensions/common/error_utils.h" #include "extensions/common/manifest_constants.h" +#include "extensions/common/mojom/host_id.mojom.h" #include "extensions/common/permissions/permissions_data.h" #include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/web_contents_zoom_controller.h" @@ -84,7 +85,8 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() { execute_tab_id_ = tab_id; details_ = std::move(details); - set_host_id(HostID(HostID::EXTENSIONS, extension()->id())); + set_host_id( + mojom::HostID(mojom::HostID::HostType::kExtensions, extension()->id())); return set_init_result(SUCCESS); } diff --git a/shell/browser/extensions/electron_component_extension_resource_manager.cc b/shell/browser/extensions/electron_component_extension_resource_manager.cc index 58309f93bdb..2ef745f083b 100644 --- a/shell/browser/extensions/electron_component_extension_resource_manager.cc +++ b/shell/browser/extensions/electron_component_extension_resource_manager.cc @@ -82,7 +82,7 @@ ElectronComponentExtensionResourceManager::GetTemplateReplacementsForExtension( } void ElectronComponentExtensionResourceManager::AddComponentResourceEntries( - const GritResourceMap* entries, + const webui::ResourcePath* entries, size_t size) { base::FilePath gen_folder_path = base::FilePath().AppendASCII( "@out_folder@/gen/chrome/browser/resources/"); @@ -90,12 +90,12 @@ void ElectronComponentExtensionResourceManager::AddComponentResourceEntries( for (size_t i = 0; i < size; ++i) { base::FilePath resource_path = - base::FilePath().AppendASCII(entries[i].name); + base::FilePath().AppendASCII(entries[i].path); resource_path = resource_path.NormalizePathSeparators(); if (!gen_folder_path.IsParent(resource_path)) { DCHECK(!base::Contains(path_to_resource_id_, resource_path)); - path_to_resource_id_[resource_path] = entries[i].value; + path_to_resource_id_[resource_path] = entries[i].id; } else { // If the resource is a generated file, strip the generated folder's path, // so that it can be served from a normal URL (as if it were not @@ -104,7 +104,7 @@ void ElectronComponentExtensionResourceManager::AddComponentResourceEntries( base::FilePath().AppendASCII(resource_path.AsUTF8Unsafe().substr( gen_folder_path.value().length())); DCHECK(!base::Contains(path_to_resource_id_, effective_path)); - path_to_resource_id_[effective_path] = entries[i].value; + path_to_resource_id_[effective_path] = entries[i].id; } } } diff --git a/shell/browser/extensions/electron_component_extension_resource_manager.h b/shell/browser/extensions/electron_component_extension_resource_manager.h index 5823ea5b2bd..499928f2da9 100644 --- a/shell/browser/extensions/electron_component_extension_resource_manager.h +++ b/shell/browser/extensions/electron_component_extension_resource_manager.h @@ -13,6 +13,7 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "extensions/browser/component_extension_resource_manager.h" +#include "ui/base/webui/resource_path.h" struct GritResourceMap; @@ -32,7 +33,8 @@ class ElectronComponentExtensionResourceManager const std::string& extension_id) const override; private: - void AddComponentResourceEntries(const GritResourceMap* entries, size_t size); + void AddComponentResourceEntries(const webui::ResourcePath* entries, + size_t size); // A map from a resource path to the resource ID. Used by // IsComponentExtensionResource. diff --git a/shell/browser/extensions/electron_extension_system.cc b/shell/browser/extensions/electron_extension_system.cc index 3abd46744fc..1f04d4b4541 100644 --- a/shell/browser/extensions/electron_extension_system.cc +++ b/shell/browser/extensions/electron_extension_system.cc @@ -24,7 +24,6 @@ #include "electron/buildflags/buildflags.h" #include "extensions/browser/api/app_runtime/app_runtime_api.h" #include "extensions/browser/extension_registry.h" -#include "extensions/browser/extension_user_script_manager.h" #include "extensions/browser/info_map.h" #include "extensions/browser/management_policy.h" #include "extensions/browser/notification_types.h" @@ -32,6 +31,7 @@ #include "extensions/browser/quota_service.h" #include "extensions/browser/runtime_data.h" #include "extensions/browser/service_worker_manager.h" +#include "extensions/browser/user_script_manager.h" #include "extensions/browser/value_store/value_store_factory_impl.h" #include "extensions/common/constants.h" #include "extensions/common/file_util.h" @@ -84,8 +84,7 @@ void ElectronExtensionSystem::InitForRegularProfile(bool extensions_enabled) { runtime_data_ = std::make_unique(ExtensionRegistry::Get(browser_context_)); quota_service_ = std::make_unique(); - extension_user_script_manager_ = - std::make_unique(browser_context_); + user_script_manager_ = std::make_unique(browser_context_); app_sorting_ = std::make_unique(); extension_loader_ = std::make_unique(browser_context_); @@ -143,9 +142,8 @@ ServiceWorkerManager* ElectronExtensionSystem::service_worker_manager() { return service_worker_manager_.get(); } -ExtensionUserScriptManager* -ElectronExtensionSystem::extension_user_script_manager() { - return new ExtensionUserScriptManager(browser_context_); +UserScriptManager* ElectronExtensionSystem::user_script_manager() { + return new UserScriptManager(browser_context_); } StateStore* ElectronExtensionSystem::state_store() { diff --git a/shell/browser/extensions/electron_extension_system.h b/shell/browser/extensions/electron_extension_system.h index 53dc8cccf6a..09b06f9bc7f 100644 --- a/shell/browser/extensions/electron_extension_system.h +++ b/shell/browser/extensions/electron_extension_system.h @@ -61,7 +61,7 @@ class ElectronExtensionSystem : public ExtensionSystem { RuntimeData* runtime_data() override; ManagementPolicy* management_policy() override; ServiceWorkerManager* service_worker_manager() override; - ExtensionUserScriptManager* extension_user_script_manager() override; + UserScriptManager* user_script_manager() override; StateStore* state_store() override; StateStore* rules_store() override; scoped_refptr store_factory() override; @@ -103,7 +103,7 @@ class ElectronExtensionSystem : public ExtensionSystem { std::unique_ptr service_worker_manager_; std::unique_ptr runtime_data_; std::unique_ptr quota_service_; - std::unique_ptr extension_user_script_manager_; + std::unique_ptr user_script_manager_; std::unique_ptr app_sorting_; std::unique_ptr management_policy_; diff --git a/shell/browser/file_select_helper.cc b/shell/browser/file_select_helper.cc index 72066541e94..1bb02cc7a24 100644 --- a/shell/browser/file_select_helper.cc +++ b/shell/browser/file_select_helper.cc @@ -125,7 +125,7 @@ void FileSelectHelper::OnListDone(int error) { std::vector file_info; for (const auto& path : lister_paths_) file_info.push_back(FileChooserFileInfo::NewNativeFile( - NativeFileInfo::New(path, base::string16()))); + NativeFileInfo::New(path, std::u16string()))); OnFilesSelected(std::move(file_info), lister_base_dir_); } diff --git a/shell/browser/font_defaults.cc b/shell/browser/font_defaults.cc index 9491af7f0b7..d704eea5e3b 100644 --- a/shell/browser/font_defaults.cc +++ b/shell/browser/font_defaults.cc @@ -120,7 +120,7 @@ std::string GetDefaultFontForPref(const char* pref_name) { // Map from script to font. // Key comparison uses pointer equality. -using ScriptFontMap = std::unordered_map; +using ScriptFontMap = std::unordered_map; // Map from font family to ScriptFontMap. // Key comparison uses pointer equality. @@ -130,7 +130,7 @@ using FontFamilyMap = std::unordered_map; // e.g. ("sans-serif", "Zyyy") -> "Arial" FontFamilyMap g_font_cache; -base::string16 FetchFont(const char* script, const char* map_name) { +std::u16string FetchFont(const char* script, const char* map_name) { FontFamilyMap::const_iterator it = g_font_cache.find(map_name); if (it != g_font_cache.end()) { ScriptFontMap::const_iterator it2 = it->second.find(script); @@ -140,7 +140,7 @@ base::string16 FetchFont(const char* script, const char* map_name) { std::string pref_name = base::StringPrintf("%s.%s", map_name, script); std::string font = GetDefaultFontForPref(pref_name.c_str()); - base::string16 font16 = base::UTF8ToUTF16(font); + std::u16string font16 = base::UTF8ToUTF16(font); ScriptFontMap& map = g_font_cache[map_name]; map[script] = font16; @@ -151,7 +151,7 @@ void FillFontFamilyMap(const char* map_name, blink::web_pref::ScriptFontFamilyMap* map) { for (size_t i = 0; i < prefs::kWebKitScriptsForFontFamilyMapsLength; ++i) { const char* script = prefs::kWebKitScriptsForFontFamilyMaps[i]; - base::string16 result = FetchFont(script, map_name); + std::u16string result = FetchFont(script, map_name); if (!result.empty()) { (*map)[script] = result; } diff --git a/shell/browser/javascript_environment.cc b/shell/browser/javascript_environment.cc index 3c2cc82fb02..343e4065481 100644 --- a/shell/browser/javascript_environment.cc +++ b/shell/browser/javascript_environment.cc @@ -9,6 +9,7 @@ #include #include +#include "base/allocator/partition_allocator/partition_alloc.h" #include "base/command_line.h" #include "base/task/current_thread.h" #include "base/task/thread_pool/initialization_util.h" @@ -65,6 +66,83 @@ struct base::trace_event::TraceValue::Helper< namespace electron { +class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { + public: + enum InitializationPolicy { kZeroInitialize, kDontInitialize }; + + ArrayBufferAllocator() { + // Ref. + // https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/platform/wtf/allocator/partitions.cc;l=94;drc=062c315a858a87f834e16a144c2c8e9591af2beb + allocator_->init({base::PartitionOptions::Alignment::kRegular, + base::PartitionOptions::ThreadCache::kDisabled, + base::PartitionOptions::Quarantine::kAllowed, + base::PartitionOptions::RefCount::kDisabled}); + } + + // Allocate() methods return null to signal allocation failure to V8, which + // should respond by throwing a RangeError, per + // http://www.ecma-international.org/ecma-262/6.0/#sec-createbytedatablock. + void* Allocate(size_t size) override { + void* result = AllocateMemoryOrNull(size, kZeroInitialize); + return result; + } + + void* AllocateUninitialized(size_t size) override { + void* result = AllocateMemoryOrNull(size, kDontInitialize); + return result; + } + + void* Realloc(void* data, size_t size) override { + return allocator_->root()->Realloc(data, size, "Electron"); + } + + void Free(void* data, size_t size) override { + allocator_->root()->Free(data); + } + + private: + static void* AllocateMemoryOrNull(size_t size, InitializationPolicy policy) { + return AllocateMemoryWithFlags(size, policy, + base::PartitionAllocReturnNull); + } + + static void* AllocateMemoryWithFlags(size_t size, + InitializationPolicy policy, + int flags) { + // The array buffer contents are sometimes expected to be 16-byte aligned in + // order to get the best optimization of SSE, especially in case of audio + // and video buffers. Hence, align the given size up to 16-byte boundary. + // Technically speaking, 16-byte aligned size doesn't mean 16-byte aligned + // address, but this heuristics works with the current implementation of + // PartitionAlloc (and PartitionAlloc doesn't support a better way for now). + if (base::kAlignment < + 16) { // base::kAlignment is a compile-time constant. + size_t aligned_size = base::bits::AlignUp(size, 16); + if (size == 0) { + aligned_size = 16; + } + if (aligned_size >= size) { // Only when no overflow + size = aligned_size; + } + } + + if (policy == kZeroInitialize) { + flags |= base::PartitionAllocZeroFill; + } + void* data = allocator_->root()->AllocFlags(flags, size, "Electron"); + if (base::kAlignment < 16) { + char* ptr = reinterpret_cast(data); + DCHECK_EQ(base::bits::AlignUp(ptr, 16), ptr) + << "Pointer " << ptr << " not 16B aligned for size " << size; + } + return data; + } + + static base::NoDestructor allocator_; +}; + +base::NoDestructor ArrayBufferAllocator::allocator_{}; + JavascriptEnvironment::JavascriptEnvironment(uv_loop_t* event_loop) : isolate_(Initialize(event_loop)), isolate_holder_(base::ThreadTaskRunnerHandle::Get(), @@ -249,10 +327,9 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop) { tracing_controller, gin::V8Platform::PageAllocator()); v8::V8::InitializePlatform(platform_); - gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, - gin::ArrayBufferAllocator::SharedInstance(), - nullptr /* external_reference_table */, - false /* create_v8_platform */); + gin::IsolateHolder::Initialize( + gin::IsolateHolder::kNonStrictMode, new ArrayBufferAllocator(), + nullptr /* external_reference_table */, false /* create_v8_platform */); v8::Isolate* isolate = v8::Isolate::Allocate(); platform_->RegisterIsolate(isolate, event_loop); diff --git a/shell/browser/lib/bluetooth_chooser.cc b/shell/browser/lib/bluetooth_chooser.cc index 3233bb94ed2..4aad929d911 100644 --- a/shell/browser/lib/bluetooth_chooser.cc +++ b/shell/browser/lib/bluetooth_chooser.cc @@ -104,7 +104,7 @@ void BluetoothChooser::ShowDiscoveryState(DiscoveryState state) { void BluetoothChooser::AddOrUpdateDevice(const std::string& device_id, bool should_update_name, - const base::string16& device_name, + const std::u16string& device_name, bool is_gatt_connected, bool is_paired, int signal_strength_level) { diff --git a/shell/browser/lib/bluetooth_chooser.h b/shell/browser/lib/bluetooth_chooser.h index 1cff5df0bdb..e7ada17fc7a 100644 --- a/shell/browser/lib/bluetooth_chooser.h +++ b/shell/browser/lib/bluetooth_chooser.h @@ -18,7 +18,7 @@ class BluetoothChooser : public content::BluetoothChooser { public: struct DeviceInfo { std::string device_id; - base::string16 device_name; + std::u16string device_name; }; explicit BluetoothChooser(api::WebContents* contents, @@ -30,14 +30,14 @@ class BluetoothChooser : public content::BluetoothChooser { void ShowDiscoveryState(DiscoveryState state) override; void AddOrUpdateDevice(const std::string& device_id, bool should_update_name, - const base::string16& device_name, + const std::u16string& device_name, bool is_gatt_connected, bool is_paired, int signal_strength_level) override; std::vector GetDeviceList(); private: - std::map device_map_; + std::map device_map_; api::WebContents* api_web_contents_; EventHandler event_handler_; int num_retries_ = 0; diff --git a/shell/browser/login_handler.cc b/shell/browser/login_handler.cc index fa1bee995dc..e0ac4458ff1 100644 --- a/shell/browser/login_handler.cc +++ b/shell/browser/login_handler.cc @@ -10,7 +10,6 @@ #include #include "base/callback.h" -#include "base/strings/string16.h" #include "base/threading/sequenced_task_runner_handle.h" #include "gin/arguments.h" #include "gin/dictionary.h" @@ -83,7 +82,7 @@ LoginHandler::~LoginHandler() = default; void LoginHandler::CallbackFromJS(gin::Arguments* args) { if (auth_required_callback_) { - base::string16 username, password; + std::u16string username, password; if (!args->GetNext(&username) || !args->GetNext(&password)) { std::move(auth_required_callback_).Run(base::nullopt); return; diff --git a/shell/browser/native_window.cc b/shell/browser/native_window.cc index 3b1d65b9b3e..3fa8315cb60 100644 --- a/shell/browser/native_window.cc +++ b/shell/browser/native_window.cc @@ -604,7 +604,7 @@ const views::Widget* NativeWindow::GetWidget() const { return widget(); } -base::string16 NativeWindow::GetAccessibleWindowTitle() const { +std::u16string NativeWindow::GetAccessibleWindowTitle() const { if (accessible_title_.empty()) { return views::WidgetDelegate::GetAccessibleWindowTitle(); } diff --git a/shell/browser/native_window.h b/shell/browser/native_window.h index 0b1b8585e8f..0da492ef9b7 100644 --- a/shell/browser/native_window.h +++ b/shell/browser/native_window.h @@ -15,7 +15,6 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/optional.h" -#include "base/strings/string16.h" #include "base/supports_user_data.h" #include "base/values.h" #include "content/public/browser/desktop_media_id.h" @@ -326,7 +325,7 @@ class NativeWindow : public base::SupportsUserData, // views::WidgetDelegate: views::Widget* GetWidget() override; const views::Widget* GetWidget() const override; - base::string16 GetAccessibleWindowTitle() const override; + std::u16string GetAccessibleWindowTitle() const override; void set_content_view(views::View* view) { content_view_ = view; } @@ -384,7 +383,7 @@ class NativeWindow : public base::SupportsUserData, base::ObserverList observers_; // Accessible title. - base::string16 accessible_title_; + std::u16string accessible_title_; base::WeakPtrFactory weak_factory_{this}; diff --git a/shell/browser/native_window_observer.h b/shell/browser/native_window_observer.h index edf5c2408e1..4d81276b5fb 100644 --- a/shell/browser/native_window_observer.h +++ b/shell/browser/native_window_observer.h @@ -8,7 +8,6 @@ #include #include "base/observer_list_types.h" -#include "base/strings/string16.h" #include "base/values.h" #include "ui/base/window_open_disposition.h" #include "url/gurl.h" @@ -28,7 +27,7 @@ class NativeWindowObserver : public base::CheckedObserver { ~NativeWindowObserver() override {} // Called when the web page in window wants to create a popup window. - virtual void WillCreatePopupWindow(const base::string16& frame_name, + virtual void WillCreatePopupWindow(const std::u16string& frame_name, const GURL& target_url, const std::string& partition_id, WindowOpenDisposition disposition) {} diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 53645b04c3b..1cc596f392d 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -1484,7 +1484,7 @@ bool NativeWindowViews::CanMinimize() const { #endif } -base::string16 NativeWindowViews::GetWindowTitle() const { +std::u16string NativeWindowViews::GetWindowTitle() const { return base::UTF8ToUTF16(title_); } diff --git a/shell/browser/native_window_views.h b/shell/browser/native_window_views.h index fbde6d0f6be..3c7aba646bb 100644 --- a/shell/browser/native_window_views.h +++ b/shell/browser/native_window_views.h @@ -184,7 +184,7 @@ class NativeWindowViews : public NativeWindow, bool CanResize() const override; bool CanMaximize() const override; bool CanMinimize() const override; - base::string16 GetWindowTitle() const override; + std::u16string GetWindowTitle() const override; views::View* GetContentsView() override; bool ShouldDescendIntoChildForEventHandling( gfx::NativeView child, diff --git a/shell/browser/net/electron_url_loader_factory.cc b/shell/browser/net/electron_url_loader_factory.cc index 6944e0da67a..2f670eeb598 100644 --- a/shell/browser/net/electron_url_loader_factory.cc +++ b/shell/browser/net/electron_url_loader_factory.cc @@ -501,7 +501,7 @@ void ElectronURLLoaderFactory::StartLoadingStream( client_remote->OnReceiveResponse(std::move(head)); mojo::ScopedDataPipeProducerHandle producer; mojo::ScopedDataPipeConsumerHandle consumer; - if (mojo::CreateDataPipe(nullptr, &producer, &consumer) != MOJO_RESULT_OK) { + if (mojo::CreateDataPipe(nullptr, producer, consumer) != MOJO_RESULT_OK) { client_remote->OnComplete( network::URLLoaderCompletionStatus(net::ERR_INSUFFICIENT_RESOURCES)); return; @@ -548,7 +548,7 @@ void ElectronURLLoaderFactory::SendContents( // Code bellow follows the pattern of data_url_loader_factory.cc. mojo::ScopedDataPipeProducerHandle producer; mojo::ScopedDataPipeConsumerHandle consumer; - if (mojo::CreateDataPipe(nullptr, &producer, &consumer) != MOJO_RESULT_OK) { + if (mojo::CreateDataPipe(nullptr, producer, consumer) != MOJO_RESULT_OK) { client_remote->OnComplete( network::URLLoaderCompletionStatus(net::ERR_INSUFFICIENT_RESOURCES)); return; diff --git a/shell/browser/net/network_context_service.cc b/shell/browser/net/network_context_service.cc index e7c8ea19500..a1ee1d2dc38 100644 --- a/shell/browser/net/network_context_service.cc +++ b/shell/browser/net/network_context_service.cc @@ -26,7 +26,8 @@ NetworkContextService::~NetworkContextService() = default; void NetworkContextService::ConfigureNetworkContextParams( network::mojom::NetworkContextParams* network_context_params, - network::mojom::CertVerifierCreationParams* cert_verifier_creation_params) { + cert_verifier::mojom::CertVerifierCreationParams* + cert_verifier_creation_params) { bool in_memory = browser_context_->IsOffTheRecord(); const base::FilePath& path = browser_context_->GetPath(); @@ -43,7 +44,7 @@ void NetworkContextService::ConfigureNetworkContextParams( network_context_params->user_agent = browser_context_->GetUserAgent(); network_context_params->cors_origin_access_list = - browser_context_->GetSharedCorsOriginAccessList() + content::BrowserContext::GetSharedCorsOriginAccessList(browser_context_) ->GetOriginAccessList() .CreateCorsOriginAccessPatternsList(); diff --git a/shell/browser/net/network_context_service.h b/shell/browser/net/network_context_service.h index be5e92b905c..ef0c3fdebb7 100644 --- a/shell/browser/net/network_context_service.h +++ b/shell/browser/net/network_context_service.h @@ -9,6 +9,7 @@ #include "chrome/browser/net/proxy_config_monitor.h" #include "components/keyed_service/core/keyed_service.h" #include "mojo/public/cpp/bindings/remote.h" +#include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom.h" #include "services/network/public/mojom/network_context.mojom.h" #include "shell/browser/electron_browser_context.h" @@ -26,7 +27,7 @@ class NetworkContextService : public KeyedService { void ConfigureNetworkContextParams( network::mojom::NetworkContextParams* network_context_params, - network::mojom::CertVerifierCreationParams* + cert_verifier::mojom::CertVerifierCreationParams* cert_verifier_creation_params); private: diff --git a/shell/browser/net/node_stream_loader.cc b/shell/browser/net/node_stream_loader.cc index a6925494639..423216a4db6 100644 --- a/shell/browser/net/node_stream_loader.cc +++ b/shell/browser/net/node_stream_loader.cc @@ -52,7 +52,7 @@ NodeStreamLoader::~NodeStreamLoader() { void NodeStreamLoader::Start(network::mojom::URLResponseHeadPtr head) { mojo::ScopedDataPipeProducerHandle producer; mojo::ScopedDataPipeConsumerHandle consumer; - MojoResult rv = mojo::CreateDataPipe(nullptr, &producer, &consumer); + MojoResult rv = mojo::CreateDataPipe(nullptr, producer, consumer); if (rv != MOJO_RESULT_OK) { NotifyComplete(net::ERR_INSUFFICIENT_RESOURCES); return; diff --git a/shell/browser/net/proxying_url_loader_factory.cc b/shell/browser/net/proxying_url_loader_factory.cc index b63960c1100..7c8e2a3cffe 100644 --- a/shell/browser/net/proxying_url_loader_factory.cc +++ b/shell/browser/net/proxying_url_loader_factory.cc @@ -240,6 +240,11 @@ void ProxyingURLLoaderFactory::InProgressRequest::OnReceiveResponse( } } +void ProxyingURLLoaderFactory::InProgressRequest::OnReceiveEarlyHints( + network::mojom::EarlyHintsPtr early_hints) { + target_client_->OnReceiveEarlyHints(std::move(early_hints)); +} + void ProxyingURLLoaderFactory::InProgressRequest::OnReceiveRedirect( const net::RedirectInfo& redirect_info, network::mojom::URLResponseHeadPtr head) { diff --git a/shell/browser/net/proxying_url_loader_factory.h b/shell/browser/net/proxying_url_loader_factory.h index 6980890ac39..2ea819dd50e 100644 --- a/shell/browser/net/proxying_url_loader_factory.h +++ b/shell/browser/net/proxying_url_loader_factory.h @@ -74,6 +74,8 @@ class ProxyingURLLoaderFactory // network::mojom::URLLoaderClient: void OnReceiveResponse(network::mojom::URLResponseHeadPtr head) override; + void OnReceiveEarlyHints( + network::mojom::EarlyHintsPtr early_hints) override; void OnReceiveRedirect(const net::RedirectInfo& redirect_info, network::mojom::URLResponseHeadPtr head) override; void OnUploadProgress(int64_t current_position, diff --git a/shell/browser/net/system_network_context_manager.cc b/shell/browser/net/system_network_context_manager.cc index f2454e27fa3..03385e1a749 100644 --- a/shell/browser/net/system_network_context_manager.cc +++ b/shell/browser/net/system_network_context_manager.cc @@ -15,6 +15,7 @@ #include "content/public/common/content_features.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "net/net_buildflags.h" +#include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom.h" #include "services/network/network_service.h" #include "services/network/public/cpp/cross_thread_pending_shared_url_loader_factory.h" #include "services/network/public/cpp/features.h" @@ -157,8 +158,9 @@ SystemNetworkContextManager::CreateDefaultNetworkContextParams() { ConfigureDefaultNetworkContextParams(network_context_params.get()); - network::mojom::CertVerifierCreationParamsPtr cert_verifier_creation_params = - network::mojom::CertVerifierCreationParams::New(); + cert_verifier::mojom::CertVerifierCreationParamsPtr + cert_verifier_creation_params = + cert_verifier::mojom::CertVerifierCreationParams::New(); network_context_params->cert_verifier_params = content::GetCertVerifierParams(std::move(cert_verifier_creation_params)); return network_context_params; diff --git a/shell/browser/net/url_pipe_loader.cc b/shell/browser/net/url_pipe_loader.cc index a290478f4af..39a4152e647 100644 --- a/shell/browser/net/url_pipe_loader.cc +++ b/shell/browser/net/url_pipe_loader.cc @@ -61,7 +61,7 @@ void URLPipeLoader::OnResponseStarted( const network::mojom::URLResponseHead& response_head) { mojo::ScopedDataPipeProducerHandle producer; mojo::ScopedDataPipeConsumerHandle consumer; - MojoResult rv = mojo::CreateDataPipe(nullptr, &producer, &consumer); + MojoResult rv = mojo::CreateDataPipe(nullptr, producer, consumer); if (rv != MOJO_RESULT_OK) { NotifyComplete(net::ERR_INSUFFICIENT_RESOURCES); return; diff --git a/shell/browser/notifications/notification.h b/shell/browser/notifications/notification.h index 28355cb4649..927d9424ebf 100644 --- a/shell/browser/notifications/notification.h +++ b/shell/browser/notifications/notification.h @@ -9,7 +9,6 @@ #include #include "base/memory/weak_ptr.h" -#include "base/strings/string16.h" #include "third_party/skia/include/core/SkBitmap.h" #include "url/gurl.h" @@ -19,26 +18,26 @@ class NotificationDelegate; class NotificationPresenter; struct NotificationAction { - base::string16 type; - base::string16 text; + std::u16string type; + std::u16string text; }; struct NotificationOptions { - base::string16 title; - base::string16 subtitle; - base::string16 msg; + std::u16string title; + std::u16string subtitle; + std::u16string msg; std::string tag; bool silent; GURL icon_url; SkBitmap icon; bool has_reply; - base::string16 timeout_type; - base::string16 reply_placeholder; - base::string16 sound; - base::string16 urgency; // Linux + std::u16string timeout_type; + std::u16string reply_placeholder; + std::u16string sound; + std::u16string urgency; // Linux std::vector actions; - base::string16 close_button_text; - base::string16 toast_xml; + std::u16string close_button_text; + std::u16string toast_xml; NotificationOptions(); ~NotificationOptions(); diff --git a/shell/browser/notifications/win/notification_presenter_win.cc b/shell/browser/notifications/win/notification_presenter_win.cc index bacf04481f5..e1f7fbdf3a6 100644 --- a/shell/browser/notifications/win/notification_presenter_win.cc +++ b/shell/browser/notifications/win/notification_presenter_win.cc @@ -72,7 +72,7 @@ bool NotificationPresenterWin::Init() { return temp_dir_.CreateUniqueTempDir(); } -base::string16 NotificationPresenterWin::SaveIconToFilesystem( +std::wstring NotificationPresenterWin::SaveIconToFilesystem( const SkBitmap& icon, const GURL& origin) { std::string filename; @@ -85,12 +85,12 @@ base::string16 NotificationPresenterWin::SaveIconToFilesystem( } base::ThreadRestrictions::ScopedAllowIO allow_io; - base::FilePath path = temp_dir_.GetPath().Append(base::UTF8ToUTF16(filename)); + base::FilePath path = temp_dir_.GetPath().Append(base::UTF8ToWide(filename)); if (base::PathExists(path)) return path.value(); if (SaveIconToPath(icon, path)) return path.value(); - return base::UTF8ToUTF16(origin.spec()); + return base::UTF8ToWide(origin.spec()); } Notification* NotificationPresenterWin::CreateNotificationObject( diff --git a/shell/browser/notifications/win/notification_presenter_win.h b/shell/browser/notifications/win/notification_presenter_win.h index a5006c139b2..670cfd6db2e 100644 --- a/shell/browser/notifications/win/notification_presenter_win.h +++ b/shell/browser/notifications/win/notification_presenter_win.h @@ -24,7 +24,6 @@ #define SHELL_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_PRESENTER_WIN_H_ #include "base/files/scoped_temp_dir.h" -#include "base/strings/string16.h" #include "shell/browser/notifications/notification_presenter.h" class GURL; @@ -39,7 +38,7 @@ class NotificationPresenterWin : public NotificationPresenter { bool Init(); - base::string16 SaveIconToFilesystem(const SkBitmap& icon, const GURL& origin); + std::wstring SaveIconToFilesystem(const SkBitmap& icon, const GURL& origin); private: Notification* CreateNotificationObject( diff --git a/shell/browser/notifications/win/win32_notification.cc b/shell/browser/notifications/win/win32_notification.cc index 2b04f09eb70..b0cdaeb72dd 100644 --- a/shell/browser/notifications/win/win32_notification.cc +++ b/shell/browser/notifications/win/win32_notification.cc @@ -13,6 +13,7 @@ #include #include +#include "base/strings/utf_string_conversions.h" #include "third_party/skia/include/core/SkBitmap.h" namespace electron { @@ -49,13 +50,15 @@ void Win32Notification::Show(const NotificationOptions& options) { existing->tag_.clear(); this->notification_ref_ = std::move(existing->notification_ref_); - this->notification_ref_.Set(options.title, options.msg, image); + this->notification_ref_.Set(base::UTF16ToWide(options.title), + base::UTF16ToWide(options.msg), image); // Need to remove the entry in the notifications set that // NotificationPresenter is holding existing->Destroy(); } else { this->notification_ref_ = - presenter->AddNotification(options.title, options.msg, image); + presenter->AddNotification(base::UTF16ToWide(options.title), + base::UTF16ToWide(options.msg), image); } this->tag_ = options.tag; diff --git a/shell/browser/notifications/win/windows_toast_notification.cc b/shell/browser/notifications/win/windows_toast_notification.cc index 4f079151851..2ece87ae917 100644 --- a/shell/browser/notifications/win/windows_toast_notification.cc +++ b/shell/browser/notifications/win/windows_toast_notification.cc @@ -21,7 +21,7 @@ #include "shell/browser/notifications/win/notification_presenter_win.h" #include "shell/browser/win/scoped_hstring.h" #include "shell/common/application_info.h" -#include "ui/base/l10n/l10n_util.h" +#include "ui/base/l10n/l10n_util_win.h" #include "ui/strings/grit/ui_strings.h" using ABI::Windows::Data::Xml::Dom::IXmlAttribute; @@ -132,15 +132,18 @@ HRESULT WindowsToastNotification::ShowInternal( // The custom xml takes priority over the preset template. if (!options.toast_xml.empty()) { REPORT_AND_RETURN_IF_FAILED( - XmlDocumentFromString(options.toast_xml.c_str(), &toast_xml), + XmlDocumentFromString(base::UTF16ToWide(options.toast_xml).c_str(), + &toast_xml), "XML: Invalid XML"); } else { auto* presenter_win = static_cast(presenter()); std::wstring icon_path = presenter_win->SaveIconToFilesystem(options.icon, options.icon_url); REPORT_AND_RETURN_IF_FAILED( - GetToastXml(toast_manager_.Get(), options.title, options.msg, icon_path, - options.timeout_type, options.silent, &toast_xml), + GetToastXml(toast_manager_.Get(), base::UTF16ToWide(options.title), + base::UTF16ToWide(options.msg), icon_path, + base::UTF16ToWide(options.timeout_type), options.silent, + &toast_xml), "XML: Failed to create XML document"); } @@ -211,7 +214,7 @@ HRESULT WindowsToastNotification::GetToastXml( } // Configure the toast's timeout settings - if (timeout_type == base::ASCIIToUTF16("never")) { + if (timeout_type == base::ASCIIToWide("never")) { REPORT_AND_RETURN_IF_FAILED( (SetXmlScenarioReminder(*toast_xml)), "XML: Setting \"scenario\" option on notification failed"); @@ -379,7 +382,7 @@ HRESULT WindowsToastNotification::SetXmlScenarioReminder(IXmlDocument* doc) { RETURN_IF_FAILED(content_attribute.As(&content_attribute_node)); // Set content attribute to Dismiss - ScopedHString content_value(l10n_util::GetStringUTF16(IDS_APP_CLOSE)); + ScopedHString content_value(l10n_util::GetWideString(IDS_APP_CLOSE)); if (!content_value.success()) return E_FAIL; diff --git a/shell/browser/osr/osr_render_widget_host_view.cc b/shell/browser/osr/osr_render_widget_host_view.cc index 449e296929d..343c62e84a5 100644 --- a/shell/browser/osr/osr_render_widget_host_view.cc +++ b/shell/browser/osr/osr_render_widget_host_view.cc @@ -144,8 +144,9 @@ class ElectronDelegatedFrameHostClient return *view_->GetBackgroundColor(); } - void OnFrameTokenChanged(uint32_t frame_token) override { - view_->render_widget_host()->DidProcessFrame(frame_token); + void OnFrameTokenChanged(uint32_t frame_token, + base::TimeTicks activation_time) override { + view_->render_widget_host()->DidProcessFrame(frame_token, activation_time); } float GetDeviceScaleFactor() const override { @@ -455,7 +456,7 @@ void OffScreenRenderWidgetHostView::Destroy() { delete this; } -void OffScreenRenderWidgetHostView::SetTooltipText(const base::string16&) {} +void OffScreenRenderWidgetHostView::SetTooltipText(const std::u16string&) {} uint32_t OffScreenRenderWidgetHostView::GetCaptureSequenceNumber() const { return latest_capture_sequence_number_; diff --git a/shell/browser/osr/osr_render_widget_host_view.h b/shell/browser/osr/osr_render_widget_host_view.h index 8fb46cfaa5a..cd3b0279600 100644 --- a/shell/browser/osr/osr_render_widget_host_view.h +++ b/shell/browser/osr/osr_render_widget_host_view.h @@ -114,7 +114,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, void ImeCancelComposition(void) override; void RenderProcessGone() override; void Destroy(void) override; - void SetTooltipText(const base::string16&) override; + void SetTooltipText(const std::u16string&) override; content::CursorManager* GetCursorManager() override; void CopyFromSurface( const gfx::Rect& src_rect, diff --git a/shell/browser/osr/osr_web_contents_view.cc b/shell/browser/osr/osr_web_contents_view.cc index 8c20818f911..eed0be9cc7e 100644 --- a/shell/browser/osr/osr_web_contents_view.cc +++ b/shell/browser/osr/osr_web_contents_view.cc @@ -139,7 +139,7 @@ OffScreenWebContentsView::CreateViewForChildWidget( render_widget_host, view, GetSize()); } -void OffScreenWebContentsView::SetPageTitle(const base::string16& title) {} +void OffScreenWebContentsView::SetPageTitle(const std::u16string& title) {} void OffScreenWebContentsView::RenderViewReady() { if (GetView()) diff --git a/shell/browser/osr/osr_web_contents_view.h b/shell/browser/osr/osr_web_contents_view.h index 193080aacdb..d530ca0627c 100644 --- a/shell/browser/osr/osr_web_contents_view.h +++ b/shell/browser/osr/osr_web_contents_view.h @@ -57,7 +57,7 @@ class OffScreenWebContentsView : public content::WebContentsView, content::RenderWidgetHost* render_widget_host) override; content::RenderWidgetHostViewBase* CreateViewForChildWidget( content::RenderWidgetHost* render_widget_host) override; - void SetPageTitle(const base::string16& title) override; + void SetPageTitle(const std::u16string& title) override; void RenderViewReady() override; void RenderViewHostChanged(content::RenderViewHost* old_host, content::RenderViewHost* new_host) override; diff --git a/shell/browser/serial/serial_chooser_controller.h b/shell/browser/serial/serial_chooser_controller.h index 40bff12b7f8..85c37590825 100644 --- a/shell/browser/serial/serial_chooser_controller.h +++ b/shell/browser/serial/serial_chooser_controller.h @@ -10,7 +10,6 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" -#include "base/strings/string16.h" #include "content/public/browser/serial_chooser.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" diff --git a/shell/browser/ui/autofill_popup.cc b/shell/browser/ui/autofill_popup.cc index aad02085208..81d6f1262b7 100644 --- a/shell/browser/ui/autofill_popup.cc +++ b/shell/browser/ui/autofill_popup.cc @@ -89,8 +89,8 @@ void AutofillPopup::Hide() { } } -void AutofillPopup::SetItems(const std::vector& values, - const std::vector& labels) { +void AutofillPopup::SetItems(const std::vector& values, + const std::vector& labels) { DCHECK(view_); values_ = values; labels_ = labels; @@ -184,11 +184,11 @@ int AutofillPopup::GetLineCount() { return values_.size(); } -base::string16 AutofillPopup::GetValueAt(int i) { +std::u16string AutofillPopup::GetValueAt(int i) { return values_.at(i); } -base::string16 AutofillPopup::GetLabelAt(int i) { +std::u16string AutofillPopup::GetLabelAt(int i) { return labels_.at(i); } diff --git a/shell/browser/ui/autofill_popup.h b/shell/browser/ui/autofill_popup.h index 7ac961a8cfb..1a7090d9f0d 100644 --- a/shell/browser/ui/autofill_popup.h +++ b/shell/browser/ui/autofill_popup.h @@ -30,8 +30,8 @@ class AutofillPopup : public views::ViewObserver { const gfx::RectF& bounds); void Hide(); - void SetItems(const std::vector& values, - const std::vector& labels); + void SetItems(const std::vector& values, + const std::vector& labels); void UpdatePopupBounds(); gfx::Rect popup_bounds_in_view(); @@ -53,8 +53,8 @@ class AutofillPopup : public views::ViewObserver { ui::NativeTheme::ColorId GetBackgroundColorIDForRow(int index) const; int GetLineCount(); - base::string16 GetValueAt(int i); - base::string16 GetLabelAt(int i); + std::u16string GetValueAt(int i); + std::u16string GetLabelAt(int i); int LineFromY(int y) const; int selected_index_; @@ -66,8 +66,8 @@ class AutofillPopup : public views::ViewObserver { gfx::Rect element_bounds_; // Datalist suggestions - std::vector values_; - std::vector labels_; + std::vector values_; + std::vector labels_; // Font lists for the suggestions gfx::FontList smaller_font_list_; diff --git a/shell/browser/ui/cocoa/electron_menu_controller.h b/shell/browser/ui/cocoa/electron_menu_controller.h index af080b1071e..42f987b3fa2 100644 --- a/shell/browser/ui/cocoa/electron_menu_controller.h +++ b/shell/browser/ui/cocoa/electron_menu_controller.h @@ -11,7 +11,6 @@ #include "base/callback.h" #include "base/mac/scoped_nsobject.h" #include "base/memory/weak_ptr.h" -#include "base/strings/string16.h" namespace electron { class ElectronMenuModel; diff --git a/shell/browser/ui/cocoa/electron_menu_controller.mm b/shell/browser/ui/cocoa/electron_menu_controller.mm index 4de4248a5f6..d543c27295f 100644 --- a/shell/browser/ui/cocoa/electron_menu_controller.mm +++ b/shell/browser/ui/cocoa/electron_menu_controller.mm @@ -197,7 +197,7 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; // Locate & retain the recent documents menu item if (!recentDocumentsMenuItem_) { - base::string16 title = base::ASCIIToUTF16("Open Recent"); + std::u16string title = base::ASCIIToUTF16("Open Recent"); NSString* openTitle = l10n_util::FixUpWindowsStyleLabel(title); recentDocumentsMenuItem_.reset([[[[[NSApp mainMenu] @@ -320,7 +320,7 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; - (void)addItemToMenu:(NSMenu*)menu atIndex:(NSInteger)index fromModel:(electron::ElectronMenuModel*)model { - base::string16 label16 = model->GetLabelAt(index); + std::u16string label16 = model->GetLabelAt(index); NSString* label = l10n_util::FixUpWindowsStyleLabel(label16); base::scoped_nsobject item([[NSMenuItem alloc] @@ -333,14 +333,14 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; if (icon.IsImage()) [item setImage:icon.GetImage().ToNSImage()]; - base::string16 toolTip = model->GetToolTipAt(index); + std::u16string toolTip = model->GetToolTipAt(index); [item setToolTip:base::SysUTF16ToNSString(toolTip)]; - base::string16 role = model->GetRoleAt(index); + std::u16string role = model->GetRoleAt(index); electron::ElectronMenuModel::ItemType type = model->GetTypeAt(index); if (role == base::ASCIIToUTF16("services")) { - base::string16 title = base::ASCIIToUTF16("Services"); + std::u16string title = base::ASCIIToUTF16("Services"); NSString* label = l10n_util::FixUpWindowsStyleLabel(title); [item setTarget:nil]; diff --git a/shell/browser/ui/cocoa/electron_ns_window.mm b/shell/browser/ui/cocoa/electron_ns_window.mm index 44dff6a5803..3ced22196e2 100644 --- a/shell/browser/ui/cocoa/electron_ns_window.mm +++ b/shell/browser/ui/cocoa/electron_ns_window.mm @@ -35,7 +35,7 @@ bool ScopedDisableResize::disable_resize_ = false; if ((self = [super initWithContentRect:ui::kWindowSizeDeterminedLater styleMask:styleMask backing:NSBackingStoreBuffered - defer:YES])) { + defer:NO])) { shell_ = shell; } return self; diff --git a/shell/browser/ui/electron_menu_model.cc b/shell/browser/ui/electron_menu_model.cc index b4680e64f92..7b91850160c 100644 --- a/shell/browser/ui/electron_menu_model.cc +++ b/shell/browser/ui/electron_menu_model.cc @@ -27,38 +27,38 @@ ElectronMenuModel::ElectronMenuModel(Delegate* delegate) ElectronMenuModel::~ElectronMenuModel() = default; -void ElectronMenuModel::SetToolTip(int index, const base::string16& toolTip) { +void ElectronMenuModel::SetToolTip(int index, const std::u16string& toolTip) { int command_id = GetCommandIdAt(index); toolTips_[command_id] = toolTip; } -base::string16 ElectronMenuModel::GetToolTipAt(int index) { +std::u16string ElectronMenuModel::GetToolTipAt(int index) { const int command_id = GetCommandIdAt(index); const auto iter = toolTips_.find(command_id); - return iter == std::end(toolTips_) ? base::string16() : iter->second; + return iter == std::end(toolTips_) ? std::u16string() : iter->second; } -void ElectronMenuModel::SetRole(int index, const base::string16& role) { +void ElectronMenuModel::SetRole(int index, const std::u16string& role) { int command_id = GetCommandIdAt(index); roles_[command_id] = role; } -base::string16 ElectronMenuModel::GetRoleAt(int index) { +std::u16string ElectronMenuModel::GetRoleAt(int index) { const int command_id = GetCommandIdAt(index); const auto iter = roles_.find(command_id); - return iter == std::end(roles_) ? base::string16() : iter->second; + return iter == std::end(roles_) ? std::u16string() : iter->second; } void ElectronMenuModel::SetSecondaryLabel(int index, - const base::string16& sublabel) { + const std::u16string& sublabel) { int command_id = GetCommandIdAt(index); sublabels_[command_id] = sublabel; } -base::string16 ElectronMenuModel::GetSecondaryLabelAt(int index) const { +std::u16string ElectronMenuModel::GetSecondaryLabelAt(int index) const { int command_id = GetCommandIdAt(index); const auto iter = sublabels_.find(command_id); - return iter == std::end(sublabels_) ? base::string16() : iter->second; + return iter == std::end(sublabels_) ? std::u16string() : iter->second; } bool ElectronMenuModel::GetAcceleratorAtWithParams( diff --git a/shell/browser/ui/electron_menu_model.h b/shell/browser/ui/electron_menu_model.h index de2ebd07899..bf8dbcb95fe 100644 --- a/shell/browser/ui/electron_menu_model.h +++ b/shell/browser/ui/electron_menu_model.h @@ -77,12 +77,12 @@ class ElectronMenuModel : public ui::SimpleMenuModel { void AddObserver(Observer* obs) { observers_.AddObserver(obs); } void RemoveObserver(Observer* obs) { observers_.RemoveObserver(obs); } - void SetToolTip(int index, const base::string16& toolTip); - base::string16 GetToolTipAt(int index); - void SetRole(int index, const base::string16& role); - base::string16 GetRoleAt(int index); - void SetSecondaryLabel(int index, const base::string16& sublabel); - base::string16 GetSecondaryLabelAt(int index) const override; + void SetToolTip(int index, const std::u16string& toolTip); + std::u16string GetToolTipAt(int index); + void SetRole(int index, const std::u16string& role); + std::u16string GetRoleAt(int index); + void SetSecondaryLabel(int index, const std::u16string& sublabel); + std::u16string GetSecondaryLabelAt(int index) const override; bool GetAcceleratorAtWithParams(int index, bool use_default_accelerator, ui::Accelerator* accelerator) const; @@ -114,9 +114,9 @@ class ElectronMenuModel : public ui::SimpleMenuModel { base::Optional sharing_item_; #endif - std::map toolTips_; // command id -> tooltip - std::map roles_; // command id -> role - std::map sublabels_; // command id -> sublabel + std::map toolTips_; // command id -> tooltip + std::map roles_; // command id -> role + std::map sublabels_; // command id -> sublabel base::ObserverList observers_; base::WeakPtrFactory weak_factory_{this}; diff --git a/shell/browser/ui/file_dialog_win.cc b/shell/browser/ui/file_dialog_win.cc index 931e0346e3e..5aeaa238c21 100644 --- a/shell/browser/ui/file_dialog_win.cc +++ b/shell/browser/ui/file_dialog_win.cc @@ -6,10 +6,13 @@ #include // windows.h must be included first -#include // atlbase.h for CComPtr +#include "base/win/shlwapi.h" // NOLINT(build/include_order) -#include -#include +// atlbase.h for CComPtr +#include // NOLINT(build/include_order) + +#include // NOLINT(build/include_order) +#include // NOLINT(build/include_order) #include "base/files/file_util.h" #include "base/i18n/case_conversion.h" @@ -118,10 +121,10 @@ static void ApplySettings(IFileDialog* dialog, const DialogSettings& settings) { dialog->SetFileName(file_part.c_str()); if (!settings.title.empty()) - dialog->SetTitle(base::UTF8ToUTF16(settings.title).c_str()); + dialog->SetTitle(base::UTF8ToWide(settings.title).c_str()); if (!settings.button_label.empty()) - dialog->SetOkButtonLabel(base::UTF8ToUTF16(settings.button_label).c_str()); + dialog->SetOkButtonLabel(base::UTF8ToWide(settings.button_label).c_str()); std::vector buffer; std::vector filterspec; diff --git a/shell/browser/ui/gtk/app_indicator_icon.cc b/shell/browser/ui/gtk/app_indicator_icon.cc index f87b752fbef..6a530857163 100644 --- a/shell/browser/ui/gtk/app_indicator_icon.cc +++ b/shell/browser/ui/gtk/app_indicator_icon.cc @@ -157,7 +157,7 @@ namespace gtkui { AppIndicatorIcon::AppIndicatorIcon(std::string id, const gfx::ImageSkia& image, - const base::string16& tool_tip) + const std::u16string& tool_tip) : id_(id) { std::unique_ptr env(base::Environment::Create()); desktop_env_ = base::nix::GetDesktopEnvironment(env.get()); @@ -215,7 +215,7 @@ void AppIndicatorIcon::SetIcon(const gfx::ImageSkia& image) { } } -void AppIndicatorIcon::SetToolTip(const base::string16& tool_tip) { +void AppIndicatorIcon::SetToolTip(const std::u16string& tool_tip) { DCHECK(!tool_tip_.empty()); tool_tip_ = base::UTF16ToUTF8(tool_tip); UpdateClickActionReplacementMenuItem(); diff --git a/shell/browser/ui/gtk/app_indicator_icon.h b/shell/browser/ui/gtk/app_indicator_icon.h index 7aa02391934..4174463ca84 100644 --- a/shell/browser/ui/gtk/app_indicator_icon.h +++ b/shell/browser/ui/gtk/app_indicator_icon.h @@ -41,7 +41,7 @@ class AppIndicatorIcon : public views::StatusIconLinux { // icons. AppIndicatorIcon(std::string id, const gfx::ImageSkia& image, - const base::string16& tool_tip); + const std::u16string& tool_tip); ~AppIndicatorIcon() override; // Indicates whether libappindicator so could be opened. @@ -49,7 +49,7 @@ class AppIndicatorIcon : public views::StatusIconLinux { // Overridden from views::StatusIconLinux: void SetIcon(const gfx::ImageSkia& image) override; - void SetToolTip(const base::string16& tool_tip) override; + void SetToolTip(const std::u16string& tool_tip) override; void UpdatePlatformContextMenu(ui::MenuModel* menu) override; void RefreshPlatformContextMenu() override; diff --git a/shell/browser/ui/gtk/gtk_status_icon.cc b/shell/browser/ui/gtk/gtk_status_icon.cc index 244f3876f86..ecad7d470c5 100644 --- a/shell/browser/ui/gtk/gtk_status_icon.cc +++ b/shell/browser/ui/gtk/gtk_status_icon.cc @@ -20,7 +20,7 @@ namespace electron { namespace gtkui { GtkStatusIcon::GtkStatusIcon(const gfx::ImageSkia& image, - const base::string16& tool_tip) { + const std::u16string& tool_tip) { GdkPixbuf* pixbuf = gtk_util::GdkPixbufFromSkBitmap(*image.bitmap()); { // GTK has a bug that leaks 384 bytes when creating a GtkStatusIcon. It @@ -50,7 +50,7 @@ void GtkStatusIcon::SetIcon(const gfx::ImageSkia& image) { g_object_unref(pixbuf); } -void GtkStatusIcon::SetToolTip(const base::string16& tool_tip) { +void GtkStatusIcon::SetToolTip(const std::u16string& tool_tip) { gtk_status_icon_set_tooltip_text(gtk_status_icon_, base::UTF16ToUTF8(tool_tip).c_str()); } diff --git a/shell/browser/ui/gtk/gtk_status_icon.h b/shell/browser/ui/gtk/gtk_status_icon.h index 07c49f25f86..eee9a21af40 100644 --- a/shell/browser/ui/gtk/gtk_status_icon.h +++ b/shell/browser/ui/gtk/gtk_status_icon.h @@ -8,7 +8,6 @@ #include #include "base/macros.h" -#include "base/strings/string16.h" #include "ui/base/glib/glib_integers.h" #include "ui/base/glib/glib_signal.h" #include "ui/views/linux_ui/status_icon_linux.h" @@ -32,12 +31,12 @@ class AppIndicatorIconMenu; // GtkStatusIcon). class GtkStatusIcon : public views::StatusIconLinux { public: - GtkStatusIcon(const gfx::ImageSkia& image, const base::string16& tool_tip); + GtkStatusIcon(const gfx::ImageSkia& image, const std::u16string& tool_tip); ~GtkStatusIcon() override; // Overridden from views::StatusIconLinux: void SetIcon(const gfx::ImageSkia& image) override; - void SetToolTip(const base::string16& tool_tip) override; + void SetToolTip(const std::u16string& tool_tip) override; void UpdatePlatformContextMenu(ui::MenuModel* menu) override; void RefreshPlatformContextMenu() override; diff --git a/shell/browser/ui/gtk/status_icon.cc b/shell/browser/ui/gtk/status_icon.cc index 43b91c645ea..6a78f82d0c1 100644 --- a/shell/browser/ui/gtk/status_icon.cc +++ b/shell/browser/ui/gtk/status_icon.cc @@ -37,7 +37,7 @@ bool IsStatusIconSupported() { std::unique_ptr CreateLinuxStatusIcon( const gfx::ImageSkia& image, - const base::string16& tool_tip, + const std::u16string& tool_tip, const char* id_prefix) { #if GTK_CHECK_VERSION(3, 90, 0) NOTIMPLEMENTED(); diff --git a/shell/browser/ui/gtk/status_icon.h b/shell/browser/ui/gtk/status_icon.h index 3fd40dcf270..384938ef8e8 100644 --- a/shell/browser/ui/gtk/status_icon.h +++ b/shell/browser/ui/gtk/status_icon.h @@ -22,7 +22,7 @@ namespace gtkui { bool IsStatusIconSupported(); std::unique_ptr CreateLinuxStatusIcon( const gfx::ImageSkia& image, - const base::string16& tool_tip, + const std::u16string& tool_tip, const char* id_prefix); } // namespace gtkui diff --git a/shell/browser/ui/inspectable_web_contents.cc b/shell/browser/ui/inspectable_web_contents.cc index 6d804138fa3..87829e848a0 100644 --- a/shell/browser/ui/inspectable_web_contents.cc +++ b/shell/browser/ui/inspectable_web_contents.cc @@ -567,7 +567,7 @@ void InspectableWebContents::LoadCompleted() { prefs->GetString("currentDockState", ¤t_dock_state); base::RemoveChars(current_dock_state, "\"", &dock_state_); } - base::string16 javascript = base::UTF8ToUTF16( + std::u16string javascript = base::UTF8ToUTF16( "UI.DockController.instance().setDockSide(\"" + dock_state_ + "\");"); GetDevToolsWebContents()->GetMainFrame()->ExecuteJavaScript( javascript, base::NullCallback()); @@ -902,7 +902,7 @@ void InspectableWebContents::DispatchProtocolMessage( if (str_message.size() < kMaxMessageChunkSize) { std::string param; base::EscapeJSONString(str_message, true, ¶m); - base::string16 javascript = + std::u16string javascript = base::UTF8ToUTF16("DevToolsAPI.dispatchMessage(" + param + ");"); GetDevToolsWebContents()->GetMainFrame()->ExecuteJavaScript( javascript, base::NullCallback()); @@ -949,9 +949,9 @@ void InspectableWebContents::WebContentsDestroyed() { bool InspectableWebContents::DidAddMessageToConsole( content::WebContents* source, blink::mojom::ConsoleMessageLevel level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) { + const std::u16string& source_id) { logging::LogMessage("CONSOLE", line_no, blink::ConsoleMessageLevelToLogSeverity(level)) .stream() diff --git a/shell/browser/ui/inspectable_web_contents.h b/shell/browser/ui/inspectable_web_contents.h index e59976a7373..70f60bc8602 100644 --- a/shell/browser/ui/inspectable_web_contents.h +++ b/shell/browser/ui/inspectable_web_contents.h @@ -177,9 +177,9 @@ class InspectableWebContents // content::WebContentsDelegate: bool DidAddMessageToConsole(content::WebContents* source, blink::mojom::ConsoleMessageLevel level, - const base::string16& message, + const std::u16string& message, int32_t line_no, - const base::string16& source_id) override; + const std::u16string& source_id) override; bool HandleKeyboardEvent(content::WebContents*, const content::NativeWebKeyboardEvent&) override; void CloseContents(content::WebContents* source) override; diff --git a/shell/browser/ui/inspectable_web_contents_view.h b/shell/browser/ui/inspectable_web_contents_view.h index 4fbd3d7fd84..c5d2be5732e 100644 --- a/shell/browser/ui/inspectable_web_contents_view.h +++ b/shell/browser/ui/inspectable_web_contents_view.h @@ -6,7 +6,8 @@ #ifndef SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_VIEW_H_ #define SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_VIEW_H_ -#include "base/strings/string16.h" +#include + #include "ui/gfx/native_widget_types.h" class DevToolsContentsResizingStrategy; @@ -51,7 +52,7 @@ class InspectableWebContentsView { virtual void SetIsDocked(bool docked, bool activate) = 0; virtual void SetContentsResizingStrategy( const DevToolsContentsResizingStrategy& strategy) = 0; - virtual void SetTitle(const base::string16& title) = 0; + virtual void SetTitle(const std::u16string& title) = 0; private: InspectableWebContentsViewDelegate* delegate_ = nullptr; // weak references. diff --git a/shell/browser/ui/inspectable_web_contents_view_mac.h b/shell/browser/ui/inspectable_web_contents_view_mac.h index 3ab732f96f3..8a30bc53291 100644 --- a/shell/browser/ui/inspectable_web_contents_view_mac.h +++ b/shell/browser/ui/inspectable_web_contents_view_mac.h @@ -33,7 +33,7 @@ class InspectableWebContentsViewMac : public InspectableWebContentsView { void SetIsDocked(bool docked, bool activate) override; void SetContentsResizingStrategy( const DevToolsContentsResizingStrategy& strategy) override; - void SetTitle(const base::string16& title) override; + void SetTitle(const std::u16string& title) override; InspectableWebContents* inspectable_web_contents() { return inspectable_web_contents_; diff --git a/shell/browser/ui/inspectable_web_contents_view_mac.mm b/shell/browser/ui/inspectable_web_contents_view_mac.mm index 2523a933e5b..f9e9011669d 100644 --- a/shell/browser/ui/inspectable_web_contents_view_mac.mm +++ b/shell/browser/ui/inspectable_web_contents_view_mac.mm @@ -58,7 +58,7 @@ void InspectableWebContentsViewMac::SetContentsResizingStrategy( [view_ setContentsResizingStrategy:strategy]; } -void InspectableWebContentsViewMac::SetTitle(const base::string16& title) { +void InspectableWebContentsViewMac::SetTitle(const std::u16string& title) { [view_ setTitle:base::SysUTF16ToNSString(title)]; } diff --git a/shell/browser/ui/message_box.h b/shell/browser/ui/message_box.h index d2548ffa536..9cc2d716f54 100644 --- a/shell/browser/ui/message_box.h +++ b/shell/browser/ui/message_box.h @@ -10,7 +10,6 @@ #include #include "base/callback_forward.h" -#include "base/strings/string16.h" #include "ui/gfx/image/image_skia.h" namespace electron { @@ -56,7 +55,7 @@ void ShowMessageBox(const MessageBoxSettings& settings, // Like ShowMessageBox with simplest settings, but safe to call at very early // stage of application. -void ShowErrorBox(const base::string16& title, const base::string16& content); +void ShowErrorBox(const std::u16string& title, const std::u16string& content); } // namespace electron diff --git a/shell/browser/ui/message_box_gtk.cc b/shell/browser/ui/message_box_gtk.cc index 739f4a8de8e..b1290a6a578 100644 --- a/shell/browser/ui/message_box_gtk.cc +++ b/shell/browser/ui/message_box_gtk.cc @@ -220,7 +220,7 @@ void ShowMessageBox(const MessageBoxSettings& settings, (new GtkMessageBox(settings))->RunAsynchronous(std::move(callback)); } -void ShowErrorBox(const base::string16& title, const base::string16& content) { +void ShowErrorBox(const std::u16string& title, const std::u16string& content) { if (Browser::Get()->is_ready()) { electron::MessageBoxSettings settings; settings.type = electron::MessageBoxType::kError; diff --git a/shell/browser/ui/message_box_mac.mm b/shell/browser/ui/message_box_mac.mm index fe24fe963ce..55fbf746e53 100644 --- a/shell/browser/ui/message_box_mac.mm +++ b/shell/browser/ui/message_box_mac.mm @@ -146,7 +146,7 @@ void ShowMessageBox(const MessageBoxSettings& settings, } } -void ShowErrorBox(const base::string16& title, const base::string16& content) { +void ShowErrorBox(const std::u16string& title, const std::u16string& content) { NSAlert* alert = [[NSAlert alloc] init]; [alert setMessageText:base::SysUTF16ToNSString(title)]; [alert setInformativeText:base::SysUTF16ToNSString(content)]; diff --git a/shell/browser/ui/message_box_win.cc b/shell/browser/ui/message_box_win.cc index 19e0190f050..1d64e2b6297 100644 --- a/shell/browser/ui/message_box_win.cc +++ b/shell/browser/ui/message_box_win.cc @@ -39,8 +39,8 @@ struct CommonButtonID { int button; int id; }; -CommonButtonID GetCommonID(const base::string16& button) { - base::string16 lower = base::ToLowerASCII(button); +CommonButtonID GetCommonID(const std::wstring& button) { + std::wstring lower = base::ToLowerASCII(button); if (lower == L"ok") return {TDCBF_OK_BUTTON, IDOK}; else if (lower == L"yes") @@ -58,7 +58,7 @@ CommonButtonID GetCommonID(const base::string16& button) { // Determine whether the buttons are common buttons, if so map common ID // to button ID. -void MapToCommonID(const std::vector& buttons, +void MapToCommonID(const std::vector& buttons, std::map* id_map, TASKDIALOG_COMMON_BUTTON_FLAGS* button_flags, std::vector* dialog_buttons) { @@ -76,18 +76,18 @@ void MapToCommonID(const std::vector& buttons, } } -DialogResult ShowTaskDialogUTF16(NativeWindow* parent, - MessageBoxType type, - const std::vector& buttons, - int default_id, - int cancel_id, - bool no_link, - const base::string16& title, - const base::string16& message, - const base::string16& detail, - const base::string16& checkbox_label, - bool checkbox_checked, - const gfx::ImageSkia& icon) { +DialogResult ShowTaskDialogWstr(NativeWindow* parent, + MessageBoxType type, + const std::vector& buttons, + int default_id, + int cancel_id, + bool no_link, + const std::wstring& title, + const std::wstring& message, + const std::wstring& detail, + const std::wstring& checkbox_label, + bool checkbox_checked, + const gfx::ImageSkia& icon) { TASKDIALOG_FLAGS flags = TDF_SIZE_TO_CONTENT | // Show all content. TDF_ALLOW_DIALOG_CANCELLATION; // Allow canceling the dialog. @@ -107,11 +107,12 @@ DialogResult ShowTaskDialogUTF16(NativeWindow* parent, // TaskDialogIndirect doesn't allow empty name, if we set empty title it // will show "electron.exe" in title. - base::string16 app_name = base::UTF8ToUTF16(Browser::Get()->GetName()); - if (title.empty()) + if (title.empty()) { + std::wstring app_name = base::UTF8ToWide(Browser::Get()->GetName()); config.pszWindowTitle = app_name.c_str(); - else + } else { config.pszWindowTitle = title.c_str(); + } base::win::ScopedHICON hicon; if (!icon.isNull()) { @@ -185,20 +186,19 @@ DialogResult ShowTaskDialogUTF16(NativeWindow* parent, } DialogResult ShowTaskDialogUTF8(const MessageBoxSettings& settings) { - std::vector utf16_buttons; + std::vector buttons; for (const auto& button : settings.buttons) - utf16_buttons.push_back(base::UTF8ToUTF16(button)); + buttons.push_back(base::UTF8ToWide(button)); - const base::string16 title_16 = base::UTF8ToUTF16(settings.title); - const base::string16 message_16 = base::UTF8ToUTF16(settings.message); - const base::string16 detail_16 = base::UTF8ToUTF16(settings.detail); - const base::string16 checkbox_label_16 = - base::UTF8ToUTF16(settings.checkbox_label); + const std::wstring title = base::UTF8ToWide(settings.title); + const std::wstring message = base::UTF8ToWide(settings.message); + const std::wstring detail = base::UTF8ToWide(settings.detail); + const std::wstring checkbox_label = base::UTF8ToWide(settings.checkbox_label); - return ShowTaskDialogUTF16( - settings.parent_window, settings.type, utf16_buttons, settings.default_id, - settings.cancel_id, settings.no_link, title_16, message_16, detail_16, - checkbox_label_16, settings.checkbox_checked, settings.icon); + return ShowTaskDialogWstr( + settings.parent_window, settings.type, buttons, settings.default_id, + settings.cancel_id, settings.no_link, title, message, detail, + checkbox_label, settings.checkbox_checked, settings.icon); } } // namespace @@ -219,10 +219,12 @@ void ShowMessageBox(const MessageBoxSettings& settings, std::move(callback))); } -void ShowErrorBox(const base::string16& title, const base::string16& content) { +void ShowErrorBox(const std::u16string& title, const std::u16string& content) { electron::UnresponsiveSuppressor suppressor; - ShowTaskDialogUTF16(nullptr, MessageBoxType::kError, {}, -1, 0, false, - L"Error", title, content, L"", false, gfx::ImageSkia()); + ShowTaskDialogWstr(nullptr, MessageBoxType::kError, {}, -1, 0, false, + base::UTF8ToWide("Error"), base::UTF16ToWide(title), + base::UTF16ToWide(content), base::UTF8ToWide(""), false, + gfx::ImageSkia()); } } // namespace electron diff --git a/shell/browser/ui/tray_icon.h b/shell/browser/ui/tray_icon.h index 307bf49bf89..16f1ef05135 100644 --- a/shell/browser/ui/tray_icon.h +++ b/shell/browser/ui/tray_icon.h @@ -64,8 +64,8 @@ class TrayIcon { #else gfx::Image icon; #endif - base::string16 title; - base::string16 content; + std::u16string title; + std::u16string content; bool large_icon = true; bool no_sound = false; bool respect_quiet_time = false; diff --git a/shell/browser/ui/tray_icon_gtk.cc b/shell/browser/ui/tray_icon_gtk.cc index 1c97aa61be7..a1205e27f78 100644 --- a/shell/browser/ui/tray_icon_gtk.cc +++ b/shell/browser/ui/tray_icon_gtk.cc @@ -47,7 +47,7 @@ const gfx::ImageSkia& TrayIconGtk::GetImage() const { return image_; } -const base::string16& TrayIconGtk::GetToolTip() const { +const std::u16string& TrayIconGtk::GetToolTip() const { return tool_tip_; } diff --git a/shell/browser/ui/tray_icon_gtk.h b/shell/browser/ui/tray_icon_gtk.h index 1580d60bf50..41193af329d 100644 --- a/shell/browser/ui/tray_icon_gtk.h +++ b/shell/browser/ui/tray_icon_gtk.h @@ -33,14 +33,14 @@ class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate { // The following four methods are only used by StatusIconLinuxDbus, which we // aren't yet using, so they are given stub implementations. const gfx::ImageSkia& GetImage() const override; - const base::string16& GetToolTip() const override; + const std::u16string& GetToolTip() const override; ui::MenuModel* GetMenuModel() const override; void OnImplInitializationFailed() override; private: std::unique_ptr icon_; gfx::ImageSkia image_; - base::string16 tool_tip_; + std::u16string tool_tip_; ui::MenuModel* menu_model_; DISALLOW_COPY_AND_ASSIGN(TrayIconGtk); diff --git a/shell/browser/ui/views/autofill_popup_view.h b/shell/browser/ui/views/autofill_popup_view.h index c6e0da1d457..1209bdd7a2a 100644 --- a/shell/browser/ui/views/autofill_popup_view.h +++ b/shell/browser/ui/views/autofill_popup_view.h @@ -37,7 +37,7 @@ class AutofillPopup; // by |AutofillPopupViewViews|. class AutofillPopupChildView : public views::View { public: - explicit AutofillPopupChildView(const base::string16& suggestion) + explicit AutofillPopupChildView(const std::u16string& suggestion) : suggestion_(suggestion) { SetFocusBehavior(FocusBehavior::ALWAYS); } @@ -48,7 +48,7 @@ class AutofillPopupChildView : public views::View { // views::Views implementation void GetAccessibleNodeData(ui::AXNodeData* node_data) override; - base::string16 suggestion_; + std::u16string suggestion_; DISALLOW_COPY_AND_ASSIGN(AutofillPopupChildView); }; diff --git a/shell/browser/ui/views/electron_views_delegate.cc b/shell/browser/ui/views/electron_views_delegate.cc index bdc206f7d40..faf123fc09d 100644 --- a/shell/browser/ui/views/electron_views_delegate.cc +++ b/shell/browser/ui/views/electron_views_delegate.cc @@ -47,8 +47,8 @@ bool ViewsDelegate::GetSavedWindowPlacement( return false; } -void ViewsDelegate::NotifyMenuItemFocused(const base::string16& menu_name, - const base::string16& menu_item_name, +void ViewsDelegate::NotifyMenuItemFocused(const std::u16string& menu_name, + const std::u16string& menu_item_name, int item_index, int item_count, bool has_submenu) {} diff --git a/shell/browser/ui/views/electron_views_delegate.h b/shell/browser/ui/views/electron_views_delegate.h index 58c4e33cb85..6c06a7ff18e 100644 --- a/shell/browser/ui/views/electron_views_delegate.h +++ b/shell/browser/ui/views/electron_views_delegate.h @@ -29,8 +29,8 @@ class ViewsDelegate : public views::ViewsDelegate { const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const override; - void NotifyMenuItemFocused(const base::string16& menu_name, - const base::string16& menu_item_name, + void NotifyMenuItemFocused(const std::u16string& menu_name, + const std::u16string& menu_item_name, int item_index, int item_count, bool has_submenu) override; diff --git a/shell/browser/ui/views/global_menu_bar_x11.cc b/shell/browser/ui/views/global_menu_bar_x11.cc index d96fad6e0e3..63cdffcf4e9 100644 --- a/shell/browser/ui/views/global_menu_bar_x11.cc +++ b/shell/browser/ui/views/global_menu_bar_x11.cc @@ -8,7 +8,6 @@ #include #include "base/logging.h" -#include "base/strings/string16.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h" @@ -297,7 +296,7 @@ void GlobalMenuBarX11::RegisterAccelerator(DbusmenuMenuitem* item, NOTIMPLEMENTED(); return; } - std::string name = base::UTF16ToUTF8(base::string16(1, keysym)); + std::string name = base::UTF16ToUTF8(std::u16string(1, keysym)); g_variant_builder_add(&builder, "s", name.c_str()); GVariant* inside_array = g_variant_builder_end(&builder); diff --git a/shell/browser/ui/views/inspectable_web_contents_view_views.cc b/shell/browser/ui/views/inspectable_web_contents_view_views.cc index cbeab44decf..74b1f706cf4 100644 --- a/shell/browser/ui/views/inspectable_web_contents_view_views.cc +++ b/shell/browser/ui/views/inspectable_web_contents_view_views.cc @@ -46,7 +46,7 @@ class DevToolsWindowDelegate : public views::ClientView, bool CanResize() const override { return true; } bool CanMaximize() const override { return true; } bool CanMinimize() const override { return true; } - base::string16 GetWindowTitle() const override { return shell_->GetTitle(); } + std::u16string GetWindowTitle() const override { return shell_->GetTitle(); } gfx::ImageSkia GetWindowAppIcon() override { return GetWindowIcon(); } gfx::ImageSkia GetWindowIcon() override { return icon_; } views::Widget* GetWidget() override { return widget_; } @@ -202,7 +202,7 @@ void InspectableWebContentsViewViews::SetContentsResizingStrategy( Layout(); } -void InspectableWebContentsViewViews::SetTitle(const base::string16& title) { +void InspectableWebContentsViewViews::SetTitle(const std::u16string& title) { if (devtools_window_) { title_ = title; devtools_window_->UpdateWindowTitle(); diff --git a/shell/browser/ui/views/inspectable_web_contents_view_views.h b/shell/browser/ui/views/inspectable_web_contents_view_views.h index 69864f96bb1..3b209152889 100644 --- a/shell/browser/ui/views/inspectable_web_contents_view_views.h +++ b/shell/browser/ui/views/inspectable_web_contents_view_views.h @@ -39,13 +39,13 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView, void SetIsDocked(bool docked, bool activate) override; void SetContentsResizingStrategy( const DevToolsContentsResizingStrategy& strategy) override; - void SetTitle(const base::string16& title) override; + void SetTitle(const std::u16string& title) override; InspectableWebContents* inspectable_web_contents() { return inspectable_web_contents_; } - const base::string16& GetTitle() const { return title_; } + const std::u16string& GetTitle() const { return title_; } private: // views::View: @@ -62,7 +62,7 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView, DevToolsContentsResizingStrategy strategy_; bool devtools_visible_ = false; views::WidgetDelegate* devtools_window_delegate_ = nullptr; - base::string16 title_; + std::u16string title_; DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewViews); }; diff --git a/shell/browser/ui/views/menu_bar.cc b/shell/browser/ui/views/menu_bar.cc index fe4ed9f7ac1..a55a8128dbd 100644 --- a/shell/browser/ui/views/menu_bar.cc +++ b/shell/browser/ui/views/menu_bar.cc @@ -78,7 +78,7 @@ void MenuBar::SetAcceleratorVisibility(bool visible) { static_cast(child)->SetAcceleratorVisibility(visible); } -MenuBar::View* MenuBar::FindAccelChild(base::char16 key) { +MenuBar::View* MenuBar::FindAccelChild(char16_t key) { for (auto* child : GetChildrenInZOrder()) { if (static_cast(child)->accelerator() == key) return child; @@ -86,11 +86,11 @@ MenuBar::View* MenuBar::FindAccelChild(base::char16 key) { return nullptr; } -bool MenuBar::HasAccelerator(base::char16 key) { +bool MenuBar::HasAccelerator(char16_t key) { return FindAccelChild(key) != nullptr; } -void MenuBar::ActivateAccelerator(base::char16 key) { +void MenuBar::ActivateAccelerator(char16_t key) { auto* child = FindAccelChild(key); if (child) static_cast(child)->Activate(nullptr); diff --git a/shell/browser/ui/views/menu_bar.h b/shell/browser/ui/views/menu_bar.h index eb2e2d35ac5..1b211838181 100644 --- a/shell/browser/ui/views/menu_bar.h +++ b/shell/browser/ui/views/menu_bar.h @@ -51,10 +51,10 @@ class MenuBar : public views::AccessiblePaneView, void SetAcceleratorVisibility(bool visible); // Returns true if the submenu has accelerator |key| - bool HasAccelerator(base::char16 key); + bool HasAccelerator(char16_t key); // Shows the submenu whose accelerator is |key|. - void ActivateAccelerator(base::char16 key); + void ActivateAccelerator(char16_t key); // Returns there are how many items in the root menu. int GetItemCount() const; @@ -95,7 +95,7 @@ class MenuBar : public views::AccessiblePaneView, RootView* window_ = nullptr; ElectronMenuModel* menu_model_ = nullptr; - View* FindAccelChild(base::char16 key); + View* FindAccelChild(char16_t key); bool has_focus_ = true; diff --git a/shell/browser/ui/views/menu_delegate.cc b/shell/browser/ui/views/menu_delegate.cc index e2988ec6f77..435242c2a2c 100644 --- a/shell/browser/ui/views/menu_delegate.cc +++ b/shell/browser/ui/views/menu_delegate.cc @@ -70,7 +70,7 @@ bool MenuDelegate::GetAccelerator(int id, ui::Accelerator* accelerator) const { return adapter_->GetAccelerator(id, accelerator); } -base::string16 MenuDelegate::GetLabel(int id) const { +std::u16string MenuDelegate::GetLabel(int id) const { return adapter_->GetLabel(id); } diff --git a/shell/browser/ui/views/menu_delegate.h b/shell/browser/ui/views/menu_delegate.h index d961dbb68a4..1156d45a922 100644 --- a/shell/browser/ui/views/menu_delegate.h +++ b/shell/browser/ui/views/menu_delegate.h @@ -46,7 +46,7 @@ class MenuDelegate : public views::MenuDelegate { bool IsTriggerableEvent(views::MenuItemView* source, const ui::Event& e) override; bool GetAccelerator(int id, ui::Accelerator* accelerator) const override; - base::string16 GetLabel(int id) const override; + std::u16string GetLabel(int id) const override; void GetLabelStyle(int id, LabelStyle* style) const override; bool IsCommandEnabled(int id) const override; bool IsCommandVisible(int id) const override; diff --git a/shell/browser/ui/views/submenu_button.cc b/shell/browser/ui/views/submenu_button.cc index 3e3c70356c2..a6027e8d8bc 100644 --- a/shell/browser/ui/views/submenu_button.cc +++ b/shell/browser/ui/views/submenu_button.cc @@ -21,7 +21,7 @@ namespace electron { SubmenuButton::SubmenuButton(PressedCallback callback, - const base::string16& title, + const std::u16string& title, const SkColor& background_color) : views::MenuButton(callback, gfx::RemoveAccelerator(title)), background_color_(background_color) { @@ -89,12 +89,12 @@ void SubmenuButton::PaintButtonContents(gfx::Canvas* canvas) { } } -bool SubmenuButton::GetUnderlinePosition(const base::string16& text, - base::char16* accelerator, +bool SubmenuButton::GetUnderlinePosition(const std::u16string& text, + char16_t* accelerator, int* start, int* end) const { int pos, span; - base::string16 trimmed = + std::u16string trimmed = gfx::LocateAndRemoveAcceleratorChar(text, &pos, &span); if (pos > -1 && span != 0) { *accelerator = base::ToUpperASCII(trimmed[pos]); @@ -106,7 +106,7 @@ bool SubmenuButton::GetUnderlinePosition(const base::string16& text, return false; } -void SubmenuButton::GetCharacterPosition(const base::string16& text, +void SubmenuButton::GetCharacterPosition(const std::u16string& text, int index, int* pos) const { int height = 0; diff --git a/shell/browser/ui/views/submenu_button.h b/shell/browser/ui/views/submenu_button.h index a5685cd1b06..2a4d5cae8ad 100644 --- a/shell/browser/ui/views/submenu_button.h +++ b/shell/browser/ui/views/submenu_button.h @@ -17,14 +17,14 @@ namespace electron { class SubmenuButton : public views::MenuButton { public: SubmenuButton(PressedCallback callback, - const base::string16& title, + const std::u16string& title, const SkColor& background_color); ~SubmenuButton() override; void SetAcceleratorVisibility(bool visible); void SetUnderlineColor(SkColor color); - base::char16 accelerator() const { return accelerator_; } + char16_t accelerator() const { return accelerator_; } void GetAccessibleNodeData(ui::AXNodeData* node_data) override; @@ -36,15 +36,15 @@ class SubmenuButton : public views::MenuButton { std::unique_ptr CreateInkDrop() override; private: - bool GetUnderlinePosition(const base::string16& text, - base::char16* accelerator, + bool GetUnderlinePosition(const std::u16string& text, + char16_t* accelerator, int* start, int* end) const; - void GetCharacterPosition(const base::string16& text, + void GetCharacterPosition(const std::u16string& text, int index, int* pos) const; - base::char16 accelerator_ = 0; + char16_t accelerator_ = 0; bool show_underline_ = false; diff --git a/shell/browser/ui/win/jump_list.cc b/shell/browser/ui/win/jump_list.cc index 310887ca421..ecea78b1fae 100644 --- a/shell/browser/ui/win/jump_list.cc +++ b/shell/browser/ui/win/jump_list.cc @@ -158,7 +158,7 @@ JumpListCategory::JumpListCategory() = default; JumpListCategory::JumpListCategory(const JumpListCategory&) = default; JumpListCategory::~JumpListCategory() = default; -JumpList::JumpList(const base::string16& app_id) : app_id_(app_id) { +JumpList::JumpList(const std::wstring& app_id) : app_id_(app_id) { destinations_.CoCreateInstance(CLSID_DestinationList); } diff --git a/shell/browser/ui/win/jump_list.h b/shell/browser/ui/win/jump_list.h index 39dc118ec4f..9bed90477f9 100644 --- a/shell/browser/ui/win/jump_list.h +++ b/shell/browser/ui/win/jump_list.h @@ -46,9 +46,9 @@ struct JumpListItem { // For tasks this is the path to the program executable, for file links this // is the full filename. base::FilePath path; - base::string16 arguments; - base::string16 title; - base::string16 description; + std::wstring arguments; + std::wstring title; + std::wstring description; base::FilePath working_dir; base::FilePath icon_path; int icon_index = 0; @@ -73,7 +73,7 @@ struct JumpListCategory { }; Type type = Type::kTasks; - base::string16 name; + std::wstring name; std::vector items; JumpListCategory(); @@ -88,7 +88,7 @@ class JumpList { // |app_id| must be the Application User Model ID of the app for which the // custom Jump List should be created/removed, it's usually obtained by // calling GetCurrentProcessExplicitAppUserModelID(). - explicit JumpList(const base::string16& app_id); + explicit JumpList(const std::wstring& app_id); ~JumpList(); // Starts a new transaction, must be called before appending any categories, @@ -111,7 +111,7 @@ class JumpList { const std::vector& categories); private: - base::string16 app_id_; + std::wstring app_id_; CComPtr destinations_; DISALLOW_COPY_AND_ASSIGN(JumpList); diff --git a/shell/browser/ui/win/notify_icon.cc b/shell/browser/ui/win/notify_icon.cc index 405c599481b..aff97784f47 100644 --- a/shell/browser/ui/win/notify_icon.cc +++ b/shell/browser/ui/win/notify_icon.cc @@ -141,7 +141,7 @@ void NotifyIcon::SetToolTip(const std::string& tool_tip) { NOTIFYICONDATA icon_data; InitIconData(&icon_data); icon_data.uFlags |= NIF_TIP; - wcsncpy_s(icon_data.szTip, base::UTF8ToUTF16(tool_tip).c_str(), _TRUNCATE); + wcsncpy_s(icon_data.szTip, base::UTF8ToWide(tool_tip).c_str(), _TRUNCATE); BOOL result = Shell_NotifyIcon(NIM_MODIFY, &icon_data); if (!result) LOG(WARNING) << "Unable to set tooltip for status tray icon"; @@ -151,8 +151,10 @@ void NotifyIcon::DisplayBalloon(const BalloonOptions& options) { NOTIFYICONDATA icon_data; InitIconData(&icon_data); icon_data.uFlags |= NIF_INFO; - wcsncpy_s(icon_data.szInfoTitle, options.title.c_str(), _TRUNCATE); - wcsncpy_s(icon_data.szInfo, options.content.c_str(), _TRUNCATE); + wcsncpy_s(icon_data.szInfoTitle, base::UTF16ToWide(options.title).c_str(), + _TRUNCATE); + wcsncpy_s(icon_data.szInfo, base::UTF16ToWide(options.content).c_str(), + _TRUNCATE); icon_data.uTimeout = 0; icon_data.hBalloonIcon = options.icon; icon_data.dwInfoFlags = ConvertIconType(options.icon_type); diff --git a/shell/browser/ui/win/taskbar_host.cc b/shell/browser/ui/win/taskbar_host.cc index 23d52d6fb85..59682f9bf48 100644 --- a/shell/browser/ui/win/taskbar_host.cc +++ b/shell/browser/ui/win/taskbar_host.cc @@ -104,7 +104,7 @@ bool TaskbarHost::SetThumbarButtons(HWND window, // Set tooltip. if (!button.tooltip.empty()) { thumb_button.dwMask |= THB_TOOLTIP; - wcsncpy_s(thumb_button.szTip, base::UTF8ToUTF16(button.tooltip).c_str(), + wcsncpy_s(thumb_button.szTip, base::UTF8ToWide(button.tooltip).c_str(), _TRUNCATE); } @@ -174,7 +174,7 @@ bool TaskbarHost::SetOverlayIcon(HWND window, base::win::ScopedHICON icon(IconUtil::CreateHICONFromSkBitmap(overlay)); return SUCCEEDED(taskbar_->SetOverlayIcon(window, icon.get(), - base::UTF8ToUTF16(text).c_str())); + base::UTF8ToWide(text).c_str())); } bool TaskbarHost::SetThumbnailClip(HWND window, const gfx::Rect& region) { @@ -194,8 +194,8 @@ bool TaskbarHost::SetThumbnailToolTip(HWND window, const std::string& tooltip) { if (!InitializeTaskbar()) return false; - return SUCCEEDED(taskbar_->SetThumbnailTooltip( - window, base::UTF8ToUTF16(tooltip).c_str())); + return SUCCEEDED( + taskbar_->SetThumbnailTooltip(window, base::UTF8ToWide(tooltip).c_str())); } bool TaskbarHost::HandleThumbarButtonEvent(int button_id) { diff --git a/shell/browser/web_contents_preferences.cc b/shell/browser/web_contents_preferences.cc index 8cab86df11f..a34ca795a27 100644 --- a/shell/browser/web_contents_preferences.cc +++ b/shell/browser/web_contents_preferences.cc @@ -50,7 +50,7 @@ bool GetAsString(const base::Value* val, bool GetAsString(const base::Value* val, base::StringPiece path, - base::string16* out) { + std::u16string* out) { if (val) { auto* found = val->FindKeyOfType(path, base::Value::Type::STRING); if (found) { @@ -61,6 +61,21 @@ bool GetAsString(const base::Value* val, return false; } +#if defined(OS_WIN) +bool GetAsString(const base::Value* val, + base::StringPiece path, + std::wstring* out) { + if (val) { + auto* found = val->FindKeyOfType(path, base::Value::Type::STRING); + if (found) { + *out = base::UTF8ToWide(found->GetString()); + return true; + } + } + return false; +} +#endif + bool GetAsInteger(const base::Value* val, base::StringPiece path, int* out) { if (val) { auto* found = val->FindKey(path); @@ -246,7 +261,13 @@ bool WebContentsPreferences::GetPreloadPath(base::FilePath* path) const { } else if (GetAsString(&preference_, options::kPreloadURL, &preload_path)) { // Translate to file path if there is "preload-url" option. base::FilePath preload; - if (net::FileURLToFilePath(GURL(preload_path), &preload)) { + GURL preload_url; +#if defined(OS_WIN) + preload_url = GURL(base::WideToUTF8(preload_path)); +#else + preload_url = GURL(preload_path); +#endif + if (net::FileURLToFilePath(preload_url, &preload)) { *path = std::move(preload); return true; } else { @@ -380,7 +401,7 @@ void WebContentsPreferences::OverrideWebkitPrefs( auto* fonts_dict = preference_.FindKeyOfType("defaultFontFamily", base::Value::Type::DICTIONARY); if (fonts_dict) { - base::string16 font; + std::u16string font; if (GetAsString(fonts_dict, "standard", &font)) prefs->standard_font_family_map[blink::web_pref::kCommonScript] = font; if (GetAsString(fonts_dict, "serif", &font)) diff --git a/shell/browser/web_dialog_helper.cc b/shell/browser/web_dialog_helper.cc index 47993cd4a48..8146b7e055c 100644 --- a/shell/browser/web_dialog_helper.cc +++ b/shell/browser/web_dialog_helper.cc @@ -35,7 +35,7 @@ using blink::mojom::NativeFileInfo; namespace { file_dialog::Filters GetFileTypesFromAcceptType( - const std::vector& accept_types) { + const std::vector& accept_types) { file_dialog::Filters filters; if (accept_types.empty()) return filters; @@ -86,7 +86,7 @@ file_dialog::Filters GetFileTypesFromAcceptType( for (const auto& extension : extensions) { #if defined(OS_WIN) - filters[0].second.push_back(base::UTF16ToASCII(extension)); + filters[0].second.push_back(base::WideToASCII(extension)); #else filters[0].second.push_back(extension); #endif @@ -163,7 +163,7 @@ void WebDialogHelper::EnumerateDirectory( std::vector file_info; while (!(path = file_enum.Next()).empty()) { file_info.push_back(FileChooserFileInfo::NewNativeFile( - NativeFileInfo::New(path, base::string16()))); + NativeFileInfo::New(path, std::u16string()))); } listener->FileSelected(std::move(file_info), dir, diff --git a/shell/common/api/electron_api_clipboard.cc b/shell/common/api/electron_api_clipboard.cc index 50db8a1c59a..e67e846912e 100644 --- a/shell/common/api/electron_api_clipboard.cc +++ b/shell/common/api/electron_api_clipboard.cc @@ -26,9 +26,9 @@ ui::ClipboardBuffer Clipboard::GetClipboardBuffer(gin_helper::Arguments* args) { return ui::ClipboardBuffer::kCopyPaste; } -std::vector Clipboard::AvailableFormats( +std::vector Clipboard::AvailableFormats( gin_helper::Arguments* args) { - std::vector format_types; + std::vector format_types; ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); clipboard->ReadAvailableTypes(GetClipboardBuffer(args), /* data_dst = */ nullptr, &format_types); @@ -80,7 +80,7 @@ void Clipboard::WriteBuffer(const std::string& format, void Clipboard::Write(const gin_helper::Dictionary& data, gin_helper::Arguments* args) { ui::ScopedClipboardWriter writer(GetClipboardBuffer(args)); - base::string16 text, html, bookmark; + std::u16string text, html, bookmark; gfx::Image image; if (data.Get("text", &text)) { @@ -102,8 +102,8 @@ void Clipboard::Write(const gin_helper::Dictionary& data, writer.WriteImage(image.AsBitmap()); } -base::string16 Clipboard::ReadText(gin_helper::Arguments* args) { - base::string16 data; +std::u16string Clipboard::ReadText(gin_helper::Arguments* args) { + std::u16string data; ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); auto type = GetClipboardBuffer(args); if (clipboard->IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(), @@ -123,13 +123,13 @@ base::string16 Clipboard::ReadText(gin_helper::Arguments* args) { return data; } -void Clipboard::WriteText(const base::string16& text, +void Clipboard::WriteText(const std::u16string& text, gin_helper::Arguments* args) { ui::ScopedClipboardWriter writer(GetClipboardBuffer(args)); writer.WriteText(text); } -base::string16 Clipboard::ReadRTF(gin_helper::Arguments* args) { +std::u16string Clipboard::ReadRTF(gin_helper::Arguments* args) { std::string data; ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); clipboard->ReadRTF(GetClipboardBuffer(args), /* data_dst = */ nullptr, &data); @@ -141,9 +141,9 @@ void Clipboard::WriteRTF(const std::string& text, gin_helper::Arguments* args) { writer.WriteRTF(text); } -base::string16 Clipboard::ReadHTML(gin_helper::Arguments* args) { - base::string16 data; - base::string16 html; +std::u16string Clipboard::ReadHTML(gin_helper::Arguments* args) { + std::u16string data; + std::u16string html; std::string url; uint32_t start; uint32_t end; @@ -154,14 +154,14 @@ base::string16 Clipboard::ReadHTML(gin_helper::Arguments* args) { return data; } -void Clipboard::WriteHTML(const base::string16& html, +void Clipboard::WriteHTML(const std::u16string& html, gin_helper::Arguments* args) { ui::ScopedClipboardWriter writer(GetClipboardBuffer(args)); writer.WriteHTML(html, std::string()); } v8::Local Clipboard::ReadBookmark(gin_helper::Arguments* args) { - base::string16 title; + std::u16string title; std::string url; gin_helper::Dictionary dict = gin_helper::Dictionary::CreateEmpty(args->isolate()); @@ -172,7 +172,7 @@ v8::Local Clipboard::ReadBookmark(gin_helper::Arguments* args) { return dict.GetHandle(); } -void Clipboard::WriteBookmark(const base::string16& title, +void Clipboard::WriteBookmark(const std::u16string& title, const std::string& url, gin_helper::Arguments* args) { ui::ScopedClipboardWriter writer(GetClipboardBuffer(args)); @@ -207,9 +207,9 @@ void Clipboard::WriteImage(const gfx::Image& image, } #if !defined(OS_MAC) -void Clipboard::WriteFindText(const base::string16& text) {} -base::string16 Clipboard::ReadFindText() { - return base::string16(); +void Clipboard::WriteFindText(const std::u16string& text) {} +std::u16string Clipboard::ReadFindText() { + return std::u16string(); } #endif diff --git a/shell/common/api/electron_api_clipboard.h b/shell/common/api/electron_api_clipboard.h index 815d588281d..7c5bdac805a 100644 --- a/shell/common/api/electron_api_clipboard.h +++ b/shell/common/api/electron_api_clipboard.h @@ -24,7 +24,7 @@ namespace api { class Clipboard { public: static ui::ClipboardBuffer GetClipboardBuffer(gin_helper::Arguments* args); - static std::vector AvailableFormats( + static std::vector AvailableFormats( gin_helper::Arguments* args); static bool Has(const std::string& format_string, gin_helper::Arguments* args); @@ -34,27 +34,27 @@ class Clipboard { static void Write(const gin_helper::Dictionary& data, gin_helper::Arguments* args); - static base::string16 ReadText(gin_helper::Arguments* args); - static void WriteText(const base::string16& text, + static std::u16string ReadText(gin_helper::Arguments* args); + static void WriteText(const std::u16string& text, gin_helper::Arguments* args); - static base::string16 ReadRTF(gin_helper::Arguments* args); + static std::u16string ReadRTF(gin_helper::Arguments* args); static void WriteRTF(const std::string& text, gin_helper::Arguments* args); - static base::string16 ReadHTML(gin_helper::Arguments* args); - static void WriteHTML(const base::string16& html, + static std::u16string ReadHTML(gin_helper::Arguments* args); + static void WriteHTML(const std::u16string& html, gin_helper::Arguments* args); static v8::Local ReadBookmark(gin_helper::Arguments* args); - static void WriteBookmark(const base::string16& title, + static void WriteBookmark(const std::u16string& title, const std::string& url, gin_helper::Arguments* args); static gfx::Image ReadImage(gin_helper::Arguments* args); static void WriteImage(const gfx::Image& image, gin_helper::Arguments* args); - static base::string16 ReadFindText(); - static void WriteFindText(const base::string16& text); + static std::u16string ReadFindText(); + static void WriteFindText(const std::u16string& text); static v8::Local ReadBuffer(const std::string& format_string, gin_helper::Arguments* args); diff --git a/shell/common/api/electron_api_clipboard_mac.mm b/shell/common/api/electron_api_clipboard_mac.mm index aa47bab85dd..7f101c259bd 100644 --- a/shell/common/api/electron_api_clipboard_mac.mm +++ b/shell/common/api/electron_api_clipboard_mac.mm @@ -10,12 +10,12 @@ namespace electron { namespace api { -void Clipboard::WriteFindText(const base::string16& text) { +void Clipboard::WriteFindText(const std::u16string& text) { NSString* text_ns = base::SysUTF16ToNSString(text); [[FindPasteboard sharedInstance] setFindText:text_ns]; } -base::string16 Clipboard::ReadFindText() { +std::u16string Clipboard::ReadFindText() { return GetFindPboardText(); } diff --git a/shell/common/api/electron_api_native_image.cc b/shell/common/api/electron_api_native_image.cc index 98fe8d90445..d1e7ce6c00c 100644 --- a/shell/common/api/electron_api_native_image.cc +++ b/shell/common/api/electron_api_native_image.cc @@ -156,7 +156,7 @@ bool NativeImage::TryConvertNativeImage(v8::Isolate* isolate, *native_image = NativeImage::CreateFromPath(isolate, icon_path).get(); if ((*native_image)->image().IsEmpty()) { #if defined(OS_WIN) - const auto img_path = base::UTF16ToUTF8(icon_path.value()); + const auto img_path = base::WideToUTF8(icon_path.value()); #else const auto img_path = icon_path.value(); #endif diff --git a/shell/common/api/electron_api_native_image_win.cc b/shell/common/api/electron_api_native_image_win.cc index 23f24e30b33..455b702f231 100644 --- a/shell/common/api/electron_api_native_image_win.cc +++ b/shell/common/api/electron_api_native_image_win.cc @@ -37,7 +37,7 @@ v8::Local NativeImage::CreateThumbnailFromPath( // create an IShellItem Microsoft::WRL::ComPtr pItem; - std::wstring image_path = path.AsUTF16Unsafe(); + std::wstring image_path = path.value(); hr = SHCreateItemFromParsingName(image_path.c_str(), nullptr, IID_PPV_ARGS(&pItem)); diff --git a/shell/common/api/electron_api_shell.cc b/shell/common/api/electron_api_shell.cc index 9f341ac61dc..a6222f7f7e0 100644 --- a/shell/common/api/electron_api_shell.cc +++ b/shell/common/api/electron_api_shell.cc @@ -117,7 +117,7 @@ bool WriteShortcutLink(const base::FilePath& shortcut_path, base::win::ShortcutProperties properties; base::FilePath path; - base::string16 str; + std::wstring str; UUID toastActivatorClsid; int index; if (options.Get("target", &path)) diff --git a/shell/common/application_info.h b/shell/common/application_info.h index cee9156702d..a79443ec31a 100644 --- a/shell/common/application_info.h +++ b/shell/common/application_info.h @@ -6,7 +6,6 @@ #define SHELL_COMMON_APPLICATION_INFO_H_ #if defined(OS_WIN) -#include "base/strings/string16.h" #include "shell/browser/win/scoped_hstring.h" #endif @@ -28,7 +27,7 @@ std::string GetApplicationUserAgent(); #if defined(OS_WIN) PCWSTR GetRawAppUserModelID(); bool GetAppUserModelID(ScopedHString* app_id); -void SetAppUserModelID(const base::string16& name); +void SetAppUserModelID(const std::wstring& name); bool IsRunningInDesktopBridge(); #endif diff --git a/shell/common/application_info_win.cc b/shell/common/application_info_win.cc index e34f88d4b06..c6af65fd19f 100644 --- a/shell/common/application_info_win.cc +++ b/shell/common/application_info_win.cc @@ -15,6 +15,7 @@ #include "base/file_version_info.h" #include "base/notreached.h" #include "base/strings/string_util.h" +#include "base/strings/string_util_win.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "shell/browser/win/scoped_hstring.h" @@ -23,7 +24,7 @@ namespace electron { namespace { -base::string16 g_app_user_model_id; +std::wstring g_app_user_model_id; } const wchar_t kAppUserModelIDFormat[] = L"electron.app.$1"; @@ -42,7 +43,7 @@ std::string GetApplicationVersion() { return base::UTF16ToUTF8(info->product_version()); } -void SetAppUserModelID(const base::string16& name) { +void SetAppUserModelID(const std::wstring& name) { g_app_user_model_id = name; SetCurrentProcessExplicitAppUserModelID(g_app_user_model_id.c_str()); } @@ -54,8 +55,8 @@ PCWSTR GetRawAppUserModelID() { g_app_user_model_id = current_app_id; } else { std::string name = GetApplicationName(); - base::string16 generated_app_id = base::ReplaceStringPlaceholders( - kAppUserModelIDFormat, base::UTF8ToUTF16(name), nullptr); + std::wstring generated_app_id = base::ReplaceStringPlaceholders( + kAppUserModelIDFormat, {base::UTF8ToWide(name)}, nullptr); SetAppUserModelID(generated_app_id); } CoTaskMemFree(current_app_id); diff --git a/shell/common/gin_converters/blink_converter.cc b/shell/common/gin_converters/blink_converter.cc index c7cfb3a6be6..f653f7f8eba 100644 --- a/shell/common/gin_converters/blink_converter.cc +++ b/shell/common/gin_converters/blink_converter.cc @@ -23,7 +23,6 @@ #include "third_party/blink/public/common/input/web_mouse_event.h" #include "third_party/blink/public/common/input/web_mouse_wheel_event.h" #include "third_party/blink/public/common/widget/device_emulation_params.h" -#include "third_party/blink/public/platform/web_size.h" #include "ui/base/clipboard/clipboard.h" #include "ui/events/blink/blink_event_util.h" #include "ui/events/keycodes/dom/keycode_converter.h" @@ -44,11 +43,11 @@ int VectorToBitArray(const std::vector& vec) { namespace gin { template <> -struct Converter { +struct Converter { static bool FromV8(v8::Isolate* isolate, v8::Handle val, - base::char16* out) { - base::string16 code = base::UTF8ToUTF16(gin::V8ToString(isolate, val)); + char16_t* out) { + std::u16string code = base::UTF8ToUTF16(gin::V8ToString(isolate, val)); if (code.length() != 1) return false; *out = code[0]; @@ -207,7 +206,7 @@ bool Converter::FromV8(v8::Isolate* isolate, // Make sure to not read beyond the buffer in case some bad code doesn't // NULL-terminate it (this is called from plugins). size_t text_length_cap = blink::WebKeyboardEvent::kTextLengthCap; - base::string16 text16 = base::UTF8ToUTF16(str); + std::u16string text16 = base::UTF8ToUTF16(str); std::fill_n(out->text, text_length_cap, 0); std::fill_n(out->unmodified_text, text_length_cap, 0); @@ -285,15 +284,6 @@ bool Converter::FromV8( return true; } -bool Converter::FromV8(v8::Isolate* isolate, - v8::Local val, - blink::WebSize* out) { - gin_helper::Dictionary dict; - if (!ConvertFromV8(isolate, val, &dict)) - return false; - return dict.Get("width", &out->width) && dict.Get("height", &out->height); -} - bool Converter::FromV8( v8::Isolate* isolate, v8::Local val, @@ -375,7 +365,7 @@ v8::Local EditFlagsToV8(v8::Isolate* isolate, int editFlags) { bool pasteFlag = false; if (editFlags & blink::ContextMenuDataEditFlags::kCanPaste) { - std::vector types; + std::vector types; ui::Clipboard::GetForCurrentThread()->ReadAvailableTypes( ui::ClipboardBuffer::kCopyPaste, /* data_dst = */ nullptr, &types); pasteFlag = !types.empty(); diff --git a/shell/common/gin_converters/blink_converter.h b/shell/common/gin_converters/blink_converter.h index 0ece2fb2e5a..9f170bb42ac 100644 --- a/shell/common/gin_converters/blink_converter.h +++ b/shell/common/gin_converters/blink_converter.h @@ -52,13 +52,6 @@ struct Converter { blink::WebMouseWheelEvent* out); }; -template <> -struct Converter { - static bool FromV8(v8::Isolate* isolate, - v8::Local val, - blink::WebSize* out); -}; - template <> struct Converter { static bool FromV8(v8::Isolate* isolate, diff --git a/shell/common/gin_converters/content_converter.cc b/shell/common/gin_converters/content_converter.cc index 953f0cd48d9..ac68e60250f 100644 --- a/shell/common/gin_converters/content_converter.cc +++ b/shell/common/gin_converters/content_converter.cc @@ -21,61 +21,6 @@ #include "ui/events/keycodes/dom/keycode_converter.h" #include "ui/events/keycodes/keyboard_code_conversion.h" -namespace { - -void ExecuteCommand(content::WebContents* web_contents, - int action, - const GURL& link_followed) { - web_contents->ExecuteCustomContextMenuCommand(action, link_followed); -} - -// Forward declaration for nested recursive call. -v8::Local MenuToV8(v8::Isolate* isolate, - content::WebContents* web_contents, - const GURL& link_followed, - const std::vector& menu); - -v8::Local MenuItemToV8(v8::Isolate* isolate, - content::WebContents* web_contents, - const GURL& link_followed, - const blink::MenuItem& item) { - gin_helper::Dictionary v8_item = gin::Dictionary::CreateEmpty(isolate); - switch (item.type) { - case blink::MenuItem::CHECKABLE_OPTION: - case blink::MenuItem::GROUP: - v8_item.Set("checked", item.checked); - FALLTHROUGH; - case blink::MenuItem::OPTION: - case blink::MenuItem::SUBMENU: - v8_item.Set("label", item.label); - v8_item.Set("enabled", item.enabled); - FALLTHROUGH; - default: - v8_item.Set("type", item.type); - } - if (item.type == blink::MenuItem::SUBMENU) - v8_item.Set("submenu", - MenuToV8(isolate, web_contents, link_followed, item.submenu)); - else if (item.action > 0) - v8_item.Set("click", base::BindRepeating(ExecuteCommand, web_contents, - item.action, link_followed)); - return v8_item.GetHandle(); -} - -v8::Local MenuToV8(v8::Isolate* isolate, - content::WebContents* web_contents, - const GURL& link_followed, - const std::vector& menu) { - std::vector> v8_menu; - v8_menu.reserve(menu.size()); - for (const auto& menu_item : menu) - v8_menu.push_back( - MenuItemToV8(isolate, web_contents, link_followed, menu_item)); - return gin::ConvertToV8(isolate, v8_menu); -} - -} // namespace - namespace gin { template <> @@ -110,19 +55,19 @@ struct Converter { }; // static -v8::Local Converter::ToV8( +v8::Local Converter::ToV8( v8::Isolate* isolate, - const blink::MenuItem::Type& val) { + const blink::mojom::MenuItem::Type& val) { switch (val) { - case blink::MenuItem::CHECKABLE_OPTION: + case blink::mojom::MenuItem::Type::kCheckableOption: return StringToV8(isolate, "checkbox"); - case blink::MenuItem::GROUP: + case blink::mojom::MenuItem::Type::kGroup: return StringToV8(isolate, "radio"); - case blink::MenuItem::SEPARATOR: + case blink::mojom::MenuItem::Type::kSeparator: return StringToV8(isolate, "separator"); - case blink::MenuItem::SUBMENU: + case blink::mojom::MenuItem::Type::kSubMenu: return StringToV8(isolate, "submenu"); - case blink::MenuItem::OPTION: + case blink::mojom::MenuItem::Type::kOption: default: return StringToV8(isolate, "normal"); } diff --git a/shell/common/gin_converters/content_converter.h b/shell/common/gin_converters/content_converter.h index 8b0e5adb3ab..61f846c987f 100644 --- a/shell/common/gin_converters/content_converter.h +++ b/shell/common/gin_converters/content_converter.h @@ -11,7 +11,7 @@ #include "content/public/common/referrer.h" #include "content/public/common/stop_find_action.h" #include "gin/converter.h" -#include "third_party/blink/public/common/context_menu_data/menu_item.h" +#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h" #include "third_party/blink/public/mojom/permissions/permission_status.mojom.h" namespace content { @@ -26,9 +26,9 @@ using ContextMenuParamsWithWebContents = namespace gin { template <> -struct Converter { +struct Converter { static v8::Local ToV8(v8::Isolate* isolate, - const blink::MenuItem::Type& val); + const blink::mojom::MenuItem::Type& val); }; template <> diff --git a/shell/common/gin_converters/file_path_converter.h b/shell/common/gin_converters/file_path_converter.h index 31362229558..28d5c4bfda8 100644 --- a/shell/common/gin_converters/file_path_converter.h +++ b/shell/common/gin_converters/file_path_converter.h @@ -7,6 +7,7 @@ #include "base/files/file_path.h" #include "gin/converter.h" +#include "shell/common/gin_converters/std_converter.h" namespace gin { diff --git a/shell/common/gin_converters/std_converter.h b/shell/common/gin_converters/std_converter.h index 7a4240b6213..fef3cd26fa6 100644 --- a/shell/common/gin_converters/std_converter.h +++ b/shell/common/gin_converters/std_converter.h @@ -11,6 +11,10 @@ #include "gin/converter.h" +#if defined(OS_WIN) +#include "base/strings/string_util_win.h" +#endif + namespace gin { // Make it possible to convert move-only types. @@ -182,6 +186,30 @@ struct Converter> { } }; +#if defined(OS_WIN) +template <> +struct Converter { + static v8::Local ToV8(v8::Isolate* isolate, + const std::wstring& val) { + return Converter::ToV8(isolate, base::AsString16(val)); + } + static bool FromV8(v8::Isolate* isolate, + v8::Local val, + std::wstring* out) { + if (!val->IsString()) + return false; + + std::u16string str; + if (Converter::FromV8(isolate, val, &str)) { + *out = base::AsWString(str); + return true; + } else { + return false; + } + } +}; +#endif + } // namespace gin #endif // SHELL_COMMON_GIN_CONVERTERS_STD_CONVERTER_H_ diff --git a/shell/common/keyboard_util.cc b/shell/common/keyboard_util.cc index dc77b947937..c5dc82c540d 100644 --- a/shell/common/keyboard_util.cc +++ b/shell/common/keyboard_util.cc @@ -138,7 +138,7 @@ ui::KeyboardCode KeyboardCodeFromKeyIdentifier(const std::string& s, } // namespace -ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted) { +ui::KeyboardCode KeyboardCodeFromCharCode(char16_t c, bool* shifted) { c = base::ToLowerASCII(c); *shifted = false; switch (c) { diff --git a/shell/common/keyboard_util.h b/shell/common/keyboard_util.h index e444c327ce4..28f2a69637a 100644 --- a/shell/common/keyboard_util.h +++ b/shell/common/keyboard_util.h @@ -7,14 +7,13 @@ #include -#include "base/strings/string16.h" #include "ui/events/keycodes/keyboard_codes.h" namespace electron { // Return key code of the char, and also determine whether the SHIFT key is // pressed. -ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted); +ui::KeyboardCode KeyboardCodeFromCharCode(char16_t c, bool* shifted); // Return key code of the |str|, and also determine whether the SHIFT key is // pressed. diff --git a/shell/common/language_util.h b/shell/common/language_util.h index 3e35073c142..eac23ad4ed6 100644 --- a/shell/common/language_util.h +++ b/shell/common/language_util.h @@ -8,19 +8,12 @@ #include #include -#include "base/strings/string16.h" - namespace electron { // Return a list of user preferred languages from OS. The list doesn't include // overrides from command line arguments. std::vector GetPreferredLanguages(); -#if defined(OS_WIN) -bool GetPreferredLanguagesUsingGlobalization( - std::vector* languages); -#endif - } // namespace electron #endif // SHELL_COMMON_LANGUAGE_UTIL_H_ diff --git a/shell/common/language_util_win.cc b/shell/common/language_util_win.cc index d6717b31aec..e8e681aaaf7 100644 --- a/shell/common/language_util_win.cc +++ b/shell/common/language_util_win.cc @@ -16,24 +16,8 @@ namespace electron { -std::vector GetPreferredLanguages() { - std::vector languages16; - - // Attempt to use API available on Windows 10 or later, which - // returns the full list of language preferences. - if (!GetPreferredLanguagesUsingGlobalization(&languages16)) { - base::win::i18n::GetThreadPreferredUILanguageList(&languages16); - } - - std::vector languages; - for (const auto& language : languages16) { - languages.push_back(base::SysWideToUTF8(language)); - } - return languages; -} - bool GetPreferredLanguagesUsingGlobalization( - std::vector* languages) { + std::vector* languages) { if (base::win::GetVersion() < base::win::Version::WIN10) return false; if (!base::win::ResolveCoreWinRTDelayload() || @@ -73,4 +57,20 @@ bool GetPreferredLanguagesUsingGlobalization( return true; } +std::vector GetPreferredLanguages() { + std::vector languages16; + + // Attempt to use API available on Windows 10 or later, which + // returns the full list of language preferences. + if (!GetPreferredLanguagesUsingGlobalization(&languages16)) { + base::win::i18n::GetThreadPreferredUILanguageList(&languages16); + } + + std::vector languages; + for (const auto& language : languages16) { + languages.push_back(base::SysWideToUTF8(language)); + } + return languages; +} + } // namespace electron diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 91bf1125548..e8f942a7fa0 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -214,7 +214,7 @@ void SetNodeCliFlags() { for (const auto& arg : argv) { #if defined(OS_WIN) - const auto& option = base::UTF16ToUTF8(arg); + const auto& option = base::WideToUTF8(arg); #else const auto& option = arg; #endif diff --git a/shell/common/platform_util.h b/shell/common/platform_util.h index 541660003b4..b9e801f055a 100644 --- a/shell/common/platform_util.h +++ b/shell/common/platform_util.h @@ -11,10 +11,6 @@ #include "base/files/file_path.h" #include "build/build_config.h" -#if defined(OS_WIN) -#include "base/strings/string16.h" -#endif - class GURL; namespace platform_util { diff --git a/shell/common/platform_util_win.cc b/shell/common/platform_util_win.cc index ecef1f8a2a3..c45093a559a 100644 --- a/shell/common/platform_util_win.cc +++ b/shell/common/platform_util_win.cc @@ -242,10 +242,10 @@ std::string OpenExternalOnWorkerThread( // Quote the input scheme to be sure that the command does not have // parameters unexpected by the external program. This url should already // have been escaped. - base::string16 escaped_url = - L"\"" + base::UTF8ToUTF16(net::EscapeExternalHandlerValue(url.spec())) + + std::wstring escaped_url = + L"\"" + base::UTF8ToWide(net::EscapeExternalHandlerValue(url.spec())) + L"\""; - base::string16 working_dir = options.working_dir.value(); + std::wstring working_dir = options.working_dir.value(); if (reinterpret_cast( ShellExecuteW(nullptr, L"open", escaped_url.c_str(), nullptr, diff --git a/shell/common/v8_value_converter.cc b/shell/common/v8_value_converter.cc index 46674718f79..9bc691f0a1f 100644 --- a/shell/common/v8_value_converter.cc +++ b/shell/common/v8_value_converter.cc @@ -257,7 +257,9 @@ v8::Local V8ValueConverter::ToArrayBuffer( } auto context = isolate->GetCurrentContext(); auto array_buffer = v8::ArrayBuffer::New(isolate, length); - memcpy(array_buffer->GetContents().Data(), data, length); + std::shared_ptr backing_store = + array_buffer->GetBackingStore(); + memcpy(backing_store->Data(), data, length); // From this point, if something goes wrong(can't find Buffer class for // example) we'll simply return a Uint8Array based on the created ArrayBuffer. // This can happen if no preload script was specified to the renderer. diff --git a/shell/renderer/api/electron_api_spell_check_client.cc b/shell/renderer/api/electron_api_spell_check_client.cc index f978f5f1f7b..51379aecbd9 100644 --- a/shell/renderer/api/electron_api_spell_check_client.cc +++ b/shell/renderer/api/electron_api_spell_check_client.cc @@ -28,8 +28,8 @@ namespace api { namespace { -bool HasWordCharacters(const base::string16& text, int index) { - const base::char16* data = text.data(); +bool HasWordCharacters(const std::u16string& text, int index) { + const char16_t* data = text.data(); int length = text.length(); while (index < length) { uint32_t code = 0; @@ -43,8 +43,8 @@ bool HasWordCharacters(const base::string16& text, int index) { struct Word { blink::WebTextCheckingResult result; - base::string16 text; - std::vector contraction_words; + std::u16string text; + std::vector contraction_words; }; } // namespace @@ -52,19 +52,19 @@ struct Word { class SpellCheckClient::SpellcheckRequest { public: SpellcheckRequest( - const base::string16& text, + const std::u16string& text, std::unique_ptr completion) : text_(text), completion_(std::move(completion)) {} SpellcheckRequest(const SpellcheckRequest&) = delete; SpellcheckRequest& operator=(const SpellcheckRequest&) = delete; ~SpellcheckRequest() = default; - const base::string16& text() const { return text_; } + const std::u16string& text() const { return text_; } blink::WebTextCheckingCompletion* completion() { return completion_.get(); } std::vector& wordlist() { return word_list_; } private: - base::string16 text_; // Text to be checked in this task. + std::u16string text_; // Text to be checked in this task. std::vector word_list_; // List of Words found in text // The interface to send the misspelled ranges to WebKit. std::unique_ptr completion_; @@ -93,7 +93,7 @@ SpellCheckClient::~SpellCheckClient() { void SpellCheckClient::RequestCheckingOfText( const blink::WebString& textToCheck, std::unique_ptr completionCallback) { - base::string16 text(textToCheck.Utf16()); + std::u16string text(textToCheck.Utf16()); // Ignore invalid requests. if (text.empty() || !HasWordCharacters(text, 0)) { completionCallback->DidCancelCheckingText(); @@ -151,10 +151,10 @@ void SpellCheckClient::SpellCheckText() { text_iterator_.SetText(text.c_str(), text.size()); SpellCheckScope scope(*this); - base::string16 word; + std::u16string word; size_t word_start; size_t word_length; - std::set words; + std::set words; auto& word_list = pending_request_param_->wordlist(); Word word_entry; for (;;) { // Run until end of text @@ -186,9 +186,9 @@ void SpellCheckClient::SpellCheckText() { } void SpellCheckClient::OnSpellCheckDone( - const std::vector& misspelled_words) { + const std::vector& misspelled_words) { std::vector results; - std::unordered_set misspelled(misspelled_words.begin(), + std::unordered_set misspelled(misspelled_words.begin(), misspelled_words.end()); auto& word_list = pending_request_param_->wordlist(); @@ -216,7 +216,7 @@ void SpellCheckClient::OnSpellCheckDone( } void SpellCheckClient::SpellCheckWords(const SpellCheckScope& scope, - const std::set& words) { + const std::set& words) { DCHECK(!scope.spell_check_.IsEmpty()); v8::Local templ = gin_helper::CreateFunctionTemplate( @@ -238,13 +238,13 @@ void SpellCheckClient::SpellCheckWords(const SpellCheckScope& scope, // words in the contraction. bool SpellCheckClient::IsContraction( const SpellCheckScope& scope, - const base::string16& contraction, - std::vector* contraction_words) { + const std::u16string& contraction, + std::vector* contraction_words) { DCHECK(contraction_iterator_.IsInitialized()); contraction_iterator_.SetText(contraction.c_str(), contraction.length()); - base::string16 word; + std::u16string word; size_t word_start; size_t word_length; for (auto status = diff --git a/shell/renderer/api/electron_api_spell_check_client.h b/shell/renderer/api/electron_api_spell_check_client.h index 1e32be9c003..72b5572fbcb 100644 --- a/shell/renderer/api/electron_api_spell_check_client.h +++ b/shell/renderer/api/electron_api_spell_check_client.h @@ -69,18 +69,18 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient, // The javascript function will callback OnSpellCheckDone // with the results of all the misspelled words. void SpellCheckWords(const SpellCheckScope& scope, - const std::set& words); + const std::set& words); // Returns whether or not the given word is a contraction of valid words // (e.g. "word:word"). // Output variable contraction_words will contain individual // words in the contraction. bool IsContraction(const SpellCheckScope& scope, - const base::string16& word, - std::vector* contraction_words); + const std::u16string& word, + std::vector* contraction_words); // Callback for the JS API which returns the list of misspelled words. - void OnSpellCheckDone(const std::vector& misspelled_words); + void OnSpellCheckDone(const std::vector& misspelled_words); // Represents character attributes used for filtering out characters which // are not supported by this SpellCheck object. diff --git a/shell/renderer/api/electron_api_web_frame.cc b/shell/renderer/api/electron_api_web_frame.cc index 8c36d450003..3f2b2ed0981 100644 --- a/shell/renderer/api/electron_api_web_frame.cc +++ b/shell/renderer/api/electron_api_web_frame.cc @@ -114,7 +114,7 @@ content::RenderFrame* GetRenderFrame(v8::Local value) { bool SpellCheckWord(v8::Isolate* isolate, v8::Local window, const std::string& word, - std::vector* optional_suggestions) { + std::vector* optional_suggestions) { size_t start; size_t length; @@ -123,7 +123,7 @@ bool SpellCheckWord(v8::Isolate* isolate, if (!render_frame) return true; - base::string16 w = base::UTF8ToUTF16(word); + std::u16string w = base::UTF8ToUTF16(word); int id = render_frame->GetRoutingID(); return client->GetSpellCheck()->SpellCheckWord( w.c_str(), 0, word.size(), id, &start, &length, optional_suggestions); @@ -576,7 +576,7 @@ void InsertText(gin_helper::ErrorThrower thrower, } } -base::string16 InsertCSS(v8::Local window, +std::u16string InsertCSS(v8::Local window, const std::string& css, gin_helper::Arguments* args) { blink::WebDocument::CSSOrigin css_origin = @@ -591,7 +591,7 @@ base::string16 InsertCSS(v8::Local window, args->ThrowError( "Render frame was torn down before webFrame.insertCSS could be " "executed"); - return base::string16(); + return std::u16string(); } blink::WebFrame* web_frame = render_frame->GetWebFrame(); @@ -601,12 +601,12 @@ base::string16 InsertCSS(v8::Local window, .InsertStyleSheet(blink::WebString::FromUTF8(css), nullptr, css_origin) .Utf16(); } - return base::string16(); + return std::u16string(); } void RemoveInsertedCSS(gin_helper::ErrorThrower thrower, v8::Local window, - const base::string16& key) { + const std::u16string& key) { auto* render_frame = GetRenderFrame(window); if (!render_frame) { thrower.ThrowError( @@ -624,7 +624,7 @@ void RemoveInsertedCSS(gin_helper::ErrorThrower thrower, v8::Local ExecuteJavaScript(gin_helper::Arguments* args, v8::Local window, - const base::string16& code) { + const std::u16string& code) { v8::Isolate* isolate = args->isolate(); gin_helper::Promise> promise(isolate); v8::Local handle = promise.GetHandle(); @@ -685,8 +685,8 @@ v8::Local ExecuteJavaScriptInIsolatedWorld( std::vector sources; for (const auto& script : scripts) { - base::string16 code; - base::string16 url; + std::u16string code; + std::u16string url; int start_line = 1; script.Get("url", &url); script.Get("startLine", &start_line); @@ -766,10 +766,10 @@ bool IsWordMisspelled(v8::Isolate* isolate, return !SpellCheckWord(isolate, window, word, nullptr); } -std::vector GetWordSuggestions(v8::Isolate* isolate, +std::vector GetWordSuggestions(v8::Isolate* isolate, v8::Local window, const std::string& word) { - std::vector suggestions; + std::vector suggestions; SpellCheckWord(isolate, window, word, &suggestions); return suggestions; } diff --git a/shell/renderer/electron_autofill_agent.cc b/shell/renderer/electron_autofill_agent.cc index 8d060571aa5..9d8282079a4 100644 --- a/shell/renderer/electron_autofill_agent.cc +++ b/shell/renderer/electron_autofill_agent.cc @@ -25,18 +25,18 @@ const size_t kMaxDataLength = 1024; const size_t kMaxListSize = 512; void GetDataListSuggestions(const blink::WebInputElement& element, - std::vector* values, - std::vector* labels) { + std::vector* values, + std::vector* labels) { for (const auto& option : element.FilteredDataListOptions()) { values->push_back(option.Value().Utf16()); if (option.Value() != option.Label()) labels->push_back(option.Label().Utf16()); else - labels->push_back(base::string16()); + labels->push_back(std::u16string()); } } -void TrimStringVectorForIPC(std::vector* strings) { +void TrimStringVectorForIPC(std::vector* strings) { // Limit the size of the vector. if (strings->size() > kMaxListSize) strings->resize(kMaxListSize); @@ -152,8 +152,8 @@ void AutofillAgent::ShowSuggestions(const blink::WebFormControlElement& element, return; } - std::vector data_list_values; - std::vector data_list_labels; + std::vector data_list_values; + std::vector data_list_labels; if (input_element) { GetDataListSuggestions(*input_element, &data_list_values, &data_list_labels); @@ -182,13 +182,13 @@ void AutofillAgent::HidePopup() { } void AutofillAgent::ShowPopup(const blink::WebFormControlElement& element, - const std::vector& values, - const std::vector& labels) { + const std::vector& values, + const std::vector& labels) { gfx::RectF bounds = render_frame()->ElementBoundsInWindow(element); GetAutofillDriver()->ShowAutofillPopup(bounds, values, labels); } -void AutofillAgent::AcceptDataListSuggestion(const base::string16& suggestion) { +void AutofillAgent::AcceptDataListSuggestion(const std::u16string& suggestion) { auto element = render_frame()->GetWebFrame()->GetDocument().FocusedElement(); if (element.IsFormControlElement()) { ToWebInputElement(&element)->SetAutofillValue( diff --git a/shell/renderer/electron_autofill_agent.h b/shell/renderer/electron_autofill_agent.h index 91a0c8e0ff8..d9fa0640da3 100644 --- a/shell/renderer/electron_autofill_agent.h +++ b/shell/renderer/electron_autofill_agent.h @@ -58,13 +58,13 @@ class AutofillAgent : public content::RenderFrameObserver, void DataListOptionsChanged(const blink::WebInputElement&) override; // mojom::ElectronAutofillAgent - void AcceptDataListSuggestion(const base::string16& suggestion) override; + void AcceptDataListSuggestion(const std::u16string& suggestion) override; bool IsUserGesture() const; void HidePopup(); void ShowPopup(const blink::WebFormControlElement&, - const std::vector&, - const std::vector&); + const std::vector&, + const std::vector&); void ShowSuggestions(const blink::WebFormControlElement& element, const ShowSuggestionsOptions& options); diff --git a/shell/renderer/electron_render_frame_observer.h b/shell/renderer/electron_render_frame_observer.h index eb59ae0cd44..03f0b82397d 100644 --- a/shell/renderer/electron_render_frame_observer.h +++ b/shell/renderer/electron_render_frame_observer.h @@ -7,7 +7,6 @@ #include -#include "base/strings/string16.h" #include "content/public/renderer/render_frame_observer.h" #include "ipc/ipc_platform_file.h" #include "shell/renderer/renderer_client_base.h" diff --git a/shell/renderer/renderer_client_base.cc b/shell/renderer/renderer_client_base.cc index 77e766cd2b4..7e6cf1b31b0 100644 --- a/shell/renderer/renderer_client_base.cc +++ b/shell/renderer/renderer_client_base.cc @@ -222,7 +222,7 @@ void RendererClientBase::RenderThreadStarted() { #if defined(OS_WIN) // Set ApplicationUserModelID in renderer process. - base::string16 app_id = + std::wstring app_id = command_line->GetSwitchValueNative(switches::kAppUserModelId); if (!app_id.empty()) { SetCurrentProcessExplicitAppUserModelID(app_id.c_str()); diff --git a/spec/yarn.lock b/spec/yarn.lock index 7f37f3ed4d9..fb259074a4f 100644 --- a/spec/yarn.lock +++ b/spec/yarn.lock @@ -691,9 +691,9 @@ ms@^2.1.1: integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== nan@2.x, nan@^2.12.1: - version "2.14.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" - integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== + version "2.14.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" + integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== oauth-sign@~0.9.0: version "0.9.0"