diff --git a/BUILD.gn b/BUILD.gn index 344f772ee46e..8375c68e2893 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -37,7 +37,7 @@ if (is_mac) { import("build/rules.gni") assert( - mac_deployment_target == "10.13", + mac_deployment_target == "10.15", "Chromium has updated the mac_deployment_target, please update this assert, update the supported versions documentation (docs/tutorial/support.md) and flag this as a breaking change") } diff --git a/DEPS b/DEPS index 02abe218d5da..eb9b04a5f214 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ gclient_gn_args_from = 'src' vars = { 'chromium_version': - '116.0.5845.0', + '117.0.5852.0', 'node_version': 'v18.16.1', 'nan_version': diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index 6f4747f7c6c1..aa28cc672135 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -127,13 +127,6 @@ static_library("chrome") { sources += [ "//chrome/browser/process_singleton_posix.cc" ] } - if (is_mac) { - sources += [ - "//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.h", - "//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.mm", - ] - } - if (is_win) { sources += [ "//chrome/browser/extensions/global_shortcut_listener_win.cc", @@ -349,6 +342,8 @@ if (is_mac) { "//chrome/browser/media/webrtc/window_icon_util_mac.mm", "//chrome/browser/platform_util_mac.mm", "//chrome/browser/process_singleton_mac.mm", + "//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.h", + "//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.mm", ] deps = [ diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index d1a36589ae22..3528a13139e5 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -1554,16 +1554,12 @@ Adds a window as a tab on this window, after the tab for the window instance. #### `win.setVibrancy(type)` _macOS_ -* `type` string | null - Can be `appearance-based`, `light`, `dark`, `titlebar`, - `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. See +* `type` string | null - Can be `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. See the [macOS documentation][vibrancy-docs] for more details. Adds a vibrancy effect to the browser window. Passing `null` or an empty string will remove the vibrancy effect on the window. -Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been -deprecated and will be removed in an upcoming version of macOS. - #### `win.setBackgroundMaterial(material)` _Windows_ * `material` string diff --git a/docs/api/structures/browser-window-options.md b/docs/api/structures/browser-window-options.md index 64204ba470ea..4e7e07b814ec 100644 --- a/docs/api/structures/browser-window-options.md +++ b/docs/api/structures/browser-window-options.md @@ -104,12 +104,9 @@ Windows, which adds standard window frame. Setting it to `false` will remove window shadow and window animations. Default is `true`. * `vibrancy` string (optional) _macOS_ - Add a type of vibrancy effect to - the window, only on macOS. Can be `appearance-based`, `light`, `dark`, - `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, - `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, - `tooltip`, `content`, `under-window`, or `under-page`. Please note that - `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are - deprecated and have been removed in macOS Catalina (10.15). + the window, only on macOS. Can be `appearance-based`, `titlebar`, `selection`, + `menu`, `popover`, `sidebar`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, + `tooltip`, `content`, `under-window`, or `under-page`. * `backgroundMaterial` string (optional) _Windows_ - Set the window's system-drawn background material, including behind the non-client area. Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See [win.setBackgroundMaterial](../browser-window.md#winsetbackgroundmaterialmaterial-windows) for more information. diff --git a/docs/api/structures/product.md b/docs/api/structures/product.md index d37a57771fd5..5268e4f336fa 100644 --- a/docs/api/structures/product.md +++ b/docs/api/structures/product.md @@ -3,8 +3,6 @@ * `productIdentifier` string - The string that identifies the product to the Apple App Store. * `localizedDescription` string - A description of the product. * `localizedTitle` string - The name of the product. -* `contentVersion` string - A string that identifies the version of the content. -* `contentLengths` number[] - The total size of the content, in bytes. * `price` number - The cost of the product in the local currency. * `formattedPrice` string - The locale formatted price of the product. * `currencyCode` string - 3 character code presenting a product's currency based on the ISO 4217 standard. diff --git a/filenames.libcxx.gni b/filenames.libcxx.gni index 9bdeedc0f42e..569214cf826d 100644 --- a/filenames.libcxx.gni +++ b/filenames.libcxx.gni @@ -25,6 +25,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__algorithm/find_if_not.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/for_each.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/for_each_n.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/for_each_segment.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/generate.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/generate_n.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/half_positive.h", @@ -71,9 +72,30 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__algorithm/pop_heap.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/prev_permutation.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_any_all_none_of.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backend.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backend.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/any_of.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/backend.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/fill.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/find_if.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/for_each.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/merge.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/serial.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/thread.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/transform.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_copy.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_count.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_fill.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_find.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_for_each.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_frontend_dispatch.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_generate.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_merge.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_replace.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_stable_sort.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_transform.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/push_heap.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_adjacent_find.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_all_of.h", @@ -156,6 +178,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sort_heap.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_stable_partition.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_stable_sort.h", + "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_starts_with.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_swap_ranges.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_transform.h", "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_unique.h", @@ -306,6 +329,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__coroutine/trivial_awaitables.h", "//buildtools/third_party/libc++/trunk/include/__debug", "//buildtools/third_party/libc++/trunk/include/__debug_utils/randomize_range.h", + "//buildtools/third_party/libc++/trunk/include/__debug_utils/strict_weak_ordering_check.h", "//buildtools/third_party/libc++/trunk/include/__exception/exception.h", "//buildtools/third_party/libc++/trunk/include/__exception/exception_ptr.h", "//buildtools/third_party/libc++/trunk/include/__exception/nested_exception.h", @@ -388,7 +412,6 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__functional/reference_wrapper.h", "//buildtools/third_party/libc++/trunk/include/__functional/unary_function.h", "//buildtools/third_party/libc++/trunk/include/__functional/unary_negate.h", - "//buildtools/third_party/libc++/trunk/include/__functional/unwrap_ref.h", "//buildtools/third_party/libc++/trunk/include/__functional/weak_result_type.h", "//buildtools/third_party/libc++/trunk/include/__fwd/array.h", "//buildtools/third_party/libc++/trunk/include/__fwd/fstream.h", @@ -415,6 +438,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__iterator/common_iterator.h", "//buildtools/third_party/libc++/trunk/include/__iterator/concepts.h", "//buildtools/third_party/libc++/trunk/include/__iterator/counted_iterator.h", + "//buildtools/third_party/libc++/trunk/include/__iterator/cpp17_iterator_concepts.h", "//buildtools/third_party/libc++/trunk/include/__iterator/data.h", "//buildtools/third_party/libc++/trunk/include/__iterator/default_sentinel.h", "//buildtools/third_party/libc++/trunk/include/__iterator/distance.h", @@ -453,6 +477,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h", "//buildtools/third_party/libc++/trunk/include/__locale_dir/locale_base_api/locale_guard.h", "//buildtools/third_party/libc++/trunk/include/__mbstate_t.h", + "//buildtools/third_party/libc++/trunk/include/__mdspan/extents.h", "//buildtools/third_party/libc++/trunk/include/__memory/addressof.h", "//buildtools/third_party/libc++/trunk/include/__memory/align.h", "//buildtools/third_party/libc++/trunk/include/__memory/aligned_alloc.h", @@ -502,6 +527,8 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__numeric/iota.h", "//buildtools/third_party/libc++/trunk/include/__numeric/midpoint.h", "//buildtools/third_party/libc++/trunk/include/__numeric/partial_sum.h", + "//buildtools/third_party/libc++/trunk/include/__numeric/pstl_reduce.h", + "//buildtools/third_party/libc++/trunk/include/__numeric/pstl_transform_reduce.h", "//buildtools/third_party/libc++/trunk/include/__numeric/reduce.h", "//buildtools/third_party/libc++/trunk/include/__numeric/transform_exclusive_scan.h", "//buildtools/third_party/libc++/trunk/include/__numeric/transform_inclusive_scan.h", @@ -535,8 +562,6 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__pstl/internal/parallel_backend_serial.h", "//buildtools/third_party/libc++/trunk/include/__pstl/internal/parallel_backend_tbb.h", "//buildtools/third_party/libc++/trunk/include/__pstl/internal/parallel_backend_utils.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/parallel_impl.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/pstl_config.h", "//buildtools/third_party/libc++/trunk/include/__pstl/internal/unseq_backend_simd.h", "//buildtools/third_party/libc++/trunk/include/__pstl/internal/utils.h", "//buildtools/third_party/libc++/trunk/include/__pstl_algorithm", @@ -585,6 +610,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__ranges/as_rvalue_view.h", "//buildtools/third_party/libc++/trunk/include/__ranges/common_view.h", "//buildtools/third_party/libc++/trunk/include/__ranges/concepts.h", + "//buildtools/third_party/libc++/trunk/include/__ranges/container_compatible_range.h", "//buildtools/third_party/libc++/trunk/include/__ranges/copyable_box.h", "//buildtools/third_party/libc++/trunk/include/__ranges/counted.h", "//buildtools/third_party/libc++/trunk/include/__ranges/dangling.h", @@ -597,6 +623,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__ranges/enable_borrowed_range.h", "//buildtools/third_party/libc++/trunk/include/__ranges/enable_view.h", "//buildtools/third_party/libc++/trunk/include/__ranges/filter_view.h", + "//buildtools/third_party/libc++/trunk/include/__ranges/from_range.h", "//buildtools/third_party/libc++/trunk/include/__ranges/iota_view.h", "//buildtools/third_party/libc++/trunk/include/__ranges/istream_view.h", "//buildtools/third_party/libc++/trunk/include/__ranges/join_view.h", @@ -620,6 +647,13 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__ranges/zip_view.h", "//buildtools/third_party/libc++/trunk/include/__split_buffer", "//buildtools/third_party/libc++/trunk/include/__std_mbstate_t.h", + "//buildtools/third_party/libc++/trunk/include/__stop_token/atomic_unique_lock.h", + "//buildtools/third_party/libc++/trunk/include/__stop_token/intrusive_list_view.h", + "//buildtools/third_party/libc++/trunk/include/__stop_token/intrusive_shared_ptr.h", + "//buildtools/third_party/libc++/trunk/include/__stop_token/stop_callback.h", + "//buildtools/third_party/libc++/trunk/include/__stop_token/stop_source.h", + "//buildtools/third_party/libc++/trunk/include/__stop_token/stop_state.h", + "//buildtools/third_party/libc++/trunk/include/__stop_token/stop_token.h", "//buildtools/third_party/libc++/trunk/include/__string/char_traits.h", "//buildtools/third_party/libc++/trunk/include/__string/constexpr_c_functions.h", "//buildtools/third_party/libc++/trunk/include/__string/extern_template_lists.h", @@ -632,9 +666,6 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__support/musl/xlocale.h", "//buildtools/third_party/libc++/trunk/include/__support/newlib/xlocale.h", "//buildtools/third_party/libc++/trunk/include/__support/openbsd/xlocale.h", - "//buildtools/third_party/libc++/trunk/include/__support/solaris/floatingpoint.h", - "//buildtools/third_party/libc++/trunk/include/__support/solaris/wchar.h", - "//buildtools/third_party/libc++/trunk/include/__support/solaris/xlocale.h", "//buildtools/third_party/libc++/trunk/include/__support/win32/locale_win32.h", "//buildtools/third_party/libc++/trunk/include/__support/xlocale/__nop_locale_mgmt.h", "//buildtools/third_party/libc++/trunk/include/__support/xlocale/__posix_l_fallback.h", @@ -682,6 +713,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__type_traits/has_unique_object_representation.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/has_virtual_destructor.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/integral_constant.h", + "//buildtools/third_party/libc++/trunk/include/__type_traits/invoke.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/is_abstract.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/is_aggregate.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/is_allocator.h", @@ -754,6 +786,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copyable.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_default_constructible.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_destructible.h", + "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_lexicographically_comparable.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_move_assignable.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_move_constructible.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/is_unbounded_array.h", @@ -772,6 +805,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__type_traits/nat.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/negation.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/noexcept_move_assign_container.h", + "//buildtools/third_party/libc++/trunk/include/__type_traits/operation_traits.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/predicate_traits.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/promote.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/rank.h", @@ -789,6 +823,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__type_traits/type_identity.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/type_list.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/underlying_type.h", + "//buildtools/third_party/libc++/trunk/include/__type_traits/unwrap_ref.h", "//buildtools/third_party/libc++/trunk/include/__type_traits/void_t.h", "//buildtools/third_party/libc++/trunk/include/__undef_macros", "//buildtools/third_party/libc++/trunk/include/__utility/as_const.h", @@ -802,6 +837,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/__utility/forward_like.h", "//buildtools/third_party/libc++/trunk/include/__utility/in_place.h", "//buildtools/third_party/libc++/trunk/include/__utility/integer_sequence.h", + "//buildtools/third_party/libc++/trunk/include/__utility/is_pointer_in_range.h", "//buildtools/third_party/libc++/trunk/include/__utility/move.h", "//buildtools/third_party/libc++/trunk/include/__utility/pair.h", "//buildtools/third_party/libc++/trunk/include/__utility/piecewise_construct.h", @@ -906,6 +942,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/locale.h", "//buildtools/third_party/libc++/trunk/include/map", "//buildtools/third_party/libc++/trunk/include/math.h", + "//buildtools/third_party/libc++/trunk/include/mdspan", "//buildtools/third_party/libc++/trunk/include/memory", "//buildtools/third_party/libc++/trunk/include/memory_resource", "//buildtools/third_party/libc++/trunk/include/module.modulemap.in", @@ -936,6 +973,7 @@ libcxx_headers = [ "//buildtools/third_party/libc++/trunk/include/stdint.h", "//buildtools/third_party/libc++/trunk/include/stdio.h", "//buildtools/third_party/libc++/trunk/include/stdlib.h", + "//buildtools/third_party/libc++/trunk/include/stop_token", "//buildtools/third_party/libc++/trunk/include/streambuf", "//buildtools/third_party/libc++/trunk/include/string", "//buildtools/third_party/libc++/trunk/include/string.h", diff --git a/patches/chromium/.patches b/patches/chromium/.patches index bf4eadc47be5..f07d4084483e 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -108,7 +108,6 @@ chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch add_maximized_parameter_to_linuxui_getwindowframeprovider.patch add_electron_deps_to_license_credits_file.patch fix_crash_loading_non-standard_schemes_in_iframes.patch -fix_return_v8_value_from_localframe_requestexecutescript.patch create_browser_v8_snapshot_file_name_fuse.patch feat_configure_launch_options_for_service_process.patch feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch @@ -129,3 +128,6 @@ chore_patch_out_profile_methods_in_chrome_browser_pdf.patch chore_patch_out_profile_methods_in_titlebar_config.patch fix_crash_on_nativetheme_change_during_context_menu_close.patch fix_select_the_first_menu_item_when_opened_via_keyboard.patch +fix_return_v8_value_from_localframe_requestexecutescript.patch +revert_simplify_dwm_transitions_on_windows.patch +fix_harden_blink_scriptstate_maybefrom.patch diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index 46a5edd74c09..201d782c6735 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -23,10 +23,10 @@ index 103a9d9fb17e954ecaf0acecaa3eeafc23e39c94..de299316216dba204decba3b0eb57f5c int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 3829c1b7902c0fbc0bb2fb53e2917ecabdfc8e96..34b02a2d2af10c7f894ed513e82fb92c52c682d1 100644 +index 9a078bafa73976d9abb53a9a31ef8b30b1033a0c..3cccad1404a08e99e02f7a7d8f4f8ce7a803fed0 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4442,6 +4442,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, +@@ -4438,6 +4438,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, observer.DidCreateScriptContext(context, world_id); } @@ -67,7 +67,7 @@ index 93acf68fbb7ff9b3bfc414a33fa1cdda4fe73bb1..90ec3437c2c94e87cfd0b25b200729c1 virtual void WillReleaseScriptContext(v8::Local, int32_t world_id) {} diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc -index 1cada05806cb35a82822507f708d43979d97de61..f8e063397b161b7501308945a7df9fb89ea7d165 100644 +index efaf1870cb579119724f0723ffae3165e0aec3c7..9ebd6fc8dd9084ff3c87c10be886e1dfc882d356 100644 --- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc +++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc @@ -198,6 +198,7 @@ void LocalWindowProxy::Initialize() { diff --git a/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch b/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch index 41c87fd37787..d4114822f5b2 100644 --- a/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch +++ b/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch @@ -8,10 +8,10 @@ decorations in maximized mode where needed, preventing empty space caused by decoration shadows and rounded titlebars around the window while maximized. diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc -index 99d3dc38ca60dbdc68bcb679067e8fd64e43b06a..7f5c3b103da21d213aa19fe8a4320bec0b7ebeb5 100644 +index a0d000a3f7d9bfb9e42f5548d5c4c6c0bfe68b71..0d47f92855e41ab06ad2c2c5421820daae01a8a0 100644 --- a/ui/gtk/gtk_ui.cc +++ b/ui/gtk/gtk_ui.cc -@@ -480,12 +480,13 @@ std::unique_ptr GtkUi::CreateNavButtonProvider() { +@@ -481,12 +481,13 @@ std::unique_ptr GtkUi::CreateNavButtonProvider() { return std::make_unique(); } diff --git a/patches/chromium/add_webmessageportconverter_entangleandinjectmessageportchannel.patch b/patches/chromium/add_webmessageportconverter_entangleandinjectmessageportchannel.patch index 519bdf7743c3..70dc582a3991 100644 --- a/patches/chromium/add_webmessageportconverter_entangleandinjectmessageportchannel.patch +++ b/patches/chromium/add_webmessageportconverter_entangleandinjectmessageportchannel.patch @@ -8,18 +8,18 @@ accessing Blink internals. Its inverse, which already exists, is used in Android WebView. diff --git a/third_party/blink/public/web/web_message_port_converter.h b/third_party/blink/public/web/web_message_port_converter.h -index a58ddcc8f6e79d3288d0c645875c8b1bbdaaf209..1283bd18cce78bc5eaad71b3fad01031b54d1ab3 100644 +index 23b17b4a46a31cb005e36bb1bbadba6cc3ea6b3c..b86862dcf5232fc6971293fe2c9f17c97008a3a7 100644 --- a/third_party/blink/public/web/web_message_port_converter.h +++ b/third_party/blink/public/web/web_message_port_converter.h -@@ -13,6 +13,7 @@ class Isolate; - template - class Local; +@@ -12,6 +12,7 @@ + namespace v8 { + class Isolate; class Value; +class Context; } // namespace v8 namespace blink { -@@ -25,6 +26,9 @@ class BLINK_EXPORT WebMessagePortConverter { +@@ -24,6 +25,9 @@ class BLINK_EXPORT WebMessagePortConverter { // neutered, it will return nullopt. static absl::optional DisentangleAndExtractMessagePortChannel(v8::Isolate*, v8::Local); diff --git a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch index 2efb91fdd20e..8abe0c40de90 100644 --- a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -84,10 +84,10 @@ index 8a18ecf567cd3a6a2fb1627083a5544a93198bf4..6bb4074e033e045de164bc776f75f152 // 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 3fd94156edd9868f0d46746227ae40da604bbc2c..ce99c90306bf2988fdb9a92e04d2ed8ec318da78 100644 +index de21b67b41dc24626fdedd0b8f74e94bc37a64d9..779dc1c05a58f23517a9375bfed59b7e9337199e 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -3847,13 +3847,21 @@ PageScheduler* WebViewImpl::Scheduler() const { +@@ -3853,13 +3853,21 @@ PageScheduler* WebViewImpl::Scheduler() const { return GetPage()->GetPageScheduler(); } diff --git a/patches/chromium/blink_local_frame.patch b/patches/chromium/blink_local_frame.patch index a0e21274e4bb..7cad5d8037a4 100644 --- a/patches/chromium/blink_local_frame.patch +++ b/patches/chromium/blink_local_frame.patch @@ -49,7 +49,7 @@ index 22c4d4e9718a503d9c7ca26a40c97149b0f8986a..6bdc2757c96a28022fda9e6f5e3b74a0 // 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 fa418d01914fdb671055666c72a84351349eaba8..f2b09355ba3f42dd72804fb470e98621c1a153f3 100644 +index 5e87e9b9d958de1c5ff9e36da7645415a2319c50..c0c82737679ea9b92fb3195c465bc1083e86e710 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc @@ -669,10 +669,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { diff --git a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch index aaad90d8b41f..dacd6f97297f 100644 --- a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch +++ b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch @@ -33,10 +33,10 @@ index 884bccba58c66861b43b3b50a7535cba543302e2..82e7bf534aa6b998cee8df53be3ca7db "//base", "//build:branding_buildflags", diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index c7ff5942d379b068f13c470677c83845b960858a..cd9fd963dc720f7394b656afe6ec032b10136d6b 100644 +index 34c95081fe1f74f75878135854cc2e776ddd4026..f32310c3869058bceb0ef803b6ff017038cfd7a7 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -4606,7 +4606,7 @@ static_library("browser") { +@@ -4602,7 +4602,7 @@ static_library("browser") { # On Windows, the hashes are embedded in //chrome:chrome_initial rather # than here in :chrome_dll. @@ -46,10 +46,10 @@ index c7ff5942d379b068f13c470677c83845b960858a..cd9fd963dc720f7394b656afe6ec032b sources += [ "certificate_viewer_stub.cc" ] } diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index 8d51f9ff0067aab05b4b31b9938575d9e84027be..c0c9d6a1da12d24bc61e4b5a3e26e6be02c4255f 100644 +index 3a6fba25d3badbce7da1ca27a38d65562dabc3c9..7ade86387a567de7689b10b2bce4c03dd930a7d2 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -6581,7 +6581,6 @@ test("unit_tests") { +@@ -6615,7 +6615,6 @@ test("unit_tests") { deps += [ "//chrome:other_version", @@ -57,7 +57,7 @@ index 8d51f9ff0067aab05b4b31b9938575d9e84027be..c0c9d6a1da12d24bc61e4b5a3e26e6be "//chrome//services/util_win:unit_tests", "//chrome/app:chrome_dll_resources", "//chrome/app:win_unit_tests", -@@ -6607,6 +6606,10 @@ test("unit_tests") { +@@ -6641,6 +6640,10 @@ test("unit_tests") { "//ui/resources", ] @@ -68,7 +68,7 @@ index 8d51f9ff0067aab05b4b31b9938575d9e84027be..c0c9d6a1da12d24bc61e4b5a3e26e6be ldflags = [ "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll", "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll", -@@ -7531,7 +7534,6 @@ test("unit_tests") { +@@ -7566,7 +7569,6 @@ test("unit_tests") { } deps += [ @@ -76,7 +76,7 @@ index 8d51f9ff0067aab05b4b31b9938575d9e84027be..c0c9d6a1da12d24bc61e4b5a3e26e6be "//chrome/browser/apps:icon_standardizer", "//chrome/browser/apps/app_service", "//chrome/browser/apps/app_service:test_support", -@@ -7617,6 +7619,10 @@ test("unit_tests") { +@@ -7653,6 +7655,10 @@ test("unit_tests") { "//ui/webui/resources/js/browser_command:mojo_bindings", ] diff --git a/patches/chromium/build_libc_as_static_library.patch b/patches/chromium/build_libc_as_static_library.patch index fb66f377c13e..61b97dcd3a8e 100644 --- a/patches/chromium/build_libc_as_static_library.patch +++ b/patches/chromium/build_libc_as_static_library.patch @@ -7,7 +7,7 @@ Build libc++ as static library to compile and pass nan tests diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn -index 027ed522bf54972a6586004d4d4302bda3481146..c227b7e0379539d14859701b00c8f9419a053703 100644 +index 306b38c22f23ea962b530c5569b52d76c69c2643..294176e4a8a8e5803d2be33f40fddd01bcd61136 100644 --- a/buildtools/third_party/libc++/BUILD.gn +++ b/buildtools/third_party/libc++/BUILD.gn @@ -44,7 +44,11 @@ config("winver") { diff --git a/patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch b/patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch index 1c80ec736bf9..ab817d822e6e 100644 --- a/patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch +++ b/patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch @@ -6,7 +6,7 @@ Subject: build: make libcxx_abi_unstable false for electron https://nornagon.medium.com/a-libc-odyssey-973e51649063 diff --git a/buildtools/third_party/libc++/__config_site b/buildtools/third_party/libc++/__config_site -index b3821295f7eeae5d3b5a4e2f3203a9d08b92a760..2b513ae604d65b38dd87cda6882f856f3318f9fd 100644 +index 54e6b7e39b0e79843a2d128135f0ed19e14a85c6..1decbe4d26b2a62cd254d253202c245f4e73b423 100644 --- a/buildtools/third_party/libc++/__config_site +++ b/buildtools/third_party/libc++/__config_site @@ -12,7 +12,6 @@ diff --git a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch index c333711867f6..c6b3d37d834a 100644 --- a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch +++ b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch @@ -6,7 +6,7 @@ Subject: build: only use the mas build config in the required components Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts diff --git a/base/BUILD.gn b/base/BUILD.gn -index 304223b58a7062e3a6ae466d54b9e877708e5cb3..e9efa7f9d44977982fdf72153623e423753f0386 100644 +index 7ea132b9a57dcd59e993a656973e40211c1528f1..f95939e8e6af4d38c5d6741e8366017d905eec90 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -228,6 +228,7 @@ if (is_apple) { @@ -17,7 +17,7 @@ index 304223b58a7062e3a6ae466d54b9e877708e5cb3..e9efa7f9d44977982fdf72153623e423 deps = [ "//base:base_static", "//base/numerics:base_numerics", -@@ -1082,6 +1083,7 @@ component("base") { +@@ -1083,6 +1084,7 @@ component("base") { "//build/config/compiler:prevent_unsafe_narrowing", "//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wglobal_constructors", @@ -92,7 +92,7 @@ index 488abc9ed0d61a4b73f4bec34cbca416abfbf715..7b1b36d6ab787e2c43d7556b1e4bb1d3 if (is_win) { diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 7901304acdeb5845f1c1292d6360bda41c0764e0..a3d148324a0d7bc7d5416fd8e6fbdfdd956d9ccf 100644 +index 723e937150ce59cf72cc5800ca2af82b0686a534..a43e8995dab378fdb3a1774cbf91a273d2d98a6c 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -56,6 +56,7 @@ source_set("browser") { @@ -128,7 +128,7 @@ index 65714a5dca013794527640645d8eb2ce36049ac6..b2df50b4cd64816ddf9c5b7e222c47b6 public_deps = [ diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index e4ad1503753b46cf9488eec9c41c122a0b2b8d68..3c71c505a49e9abd2ccfcb840d296fc270615dea 100644 +index d0c494bb1943b6f634f703b6f1a697cc3a105b91..601535c2483b9385f9f7866c496d4c4a16ae1ffc 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn @@ -475,6 +475,7 @@ static_library("test_support") { @@ -230,7 +230,7 @@ index 5e9fc18352d1bf0939f8366d2282b49aeb307994..69dcc2cafa27b3d8bdf3fe8d0a22a980 source_set("sandbox_unittests") { diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn -index d1ab6d45d519dd131a854b01b90295b5e7316d71..7086774c980636b160f5152ac2c3c6b737217dd1 100644 +index cec00272736c844246aabbf688b13d631af41236..82de763b603baf242aec6c82ac20e3abc8bf808f 100644 --- a/third_party/blink/renderer/core/BUILD.gn +++ b/third_party/blink/renderer/core/BUILD.gn @@ -308,6 +308,7 @@ component("core") { @@ -255,10 +255,10 @@ index 7637db0ce03b9e8d242e47f5aff85c21967a541f..e66fdb98adb035a917942432806e0dfa sources += [ "ca_layer_frame_sink_provider.h" ] } diff --git a/ui/accessibility/platform/BUILD.gn b/ui/accessibility/platform/BUILD.gn -index cb282e3a526fb724b25c0d4c6a2af3da30ee0a20..d4275f68211f5a0cddfd2bcbc0f620e8f8b6c7aa 100644 +index 46dedcc0be88eb0abe461efef1f99928397d6d89..ac2711e76aebb765a14794d550f6ef7e5cf740f4 100644 --- a/ui/accessibility/platform/BUILD.gn +++ b/ui/accessibility/platform/BUILD.gn -@@ -247,6 +247,7 @@ component("platform") { +@@ -248,6 +248,7 @@ component("platform") { weak_frameworks = [ "Accessibility.framework", # macOS 11 ] @@ -306,10 +306,10 @@ index f5038c6478eeccc17e061681dbee0f384dac4911..bf23c3576bb7b2d10a840e6eb2a420b7 if (is_win) { sources += [ diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn -index 2feb32f83513e4fe6f395ef4d0149af4fb74023e..045ad4c53a8670df70eedbd98ca5dc4763c711a1 100644 +index c2c93302e51f629594583e5c2f2b89fe084f819e..363892cfe0d359579cff47f85a0bc60794cee22f 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn -@@ -684,6 +684,7 @@ component("views") { +@@ -682,6 +682,7 @@ component("views") { "IOSurface.framework", "QuartzCore.framework", ] @@ -317,7 +317,7 @@ index 2feb32f83513e4fe6f395ef4d0149af4fb74023e..045ad4c53a8670df70eedbd98ca5dc47 } if (is_win) { -@@ -1100,6 +1101,8 @@ source_set("test_support") { +@@ -1098,6 +1099,8 @@ source_set("test_support") { "//testing/gtest", ] diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index 3b5e5d669ff3..a15cdc9da0a8 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 8bd1e3c02b5851d9178cc0e2573b5000847902ec..b40f3b4bcd7adf0d1341cbf0752e48d8abe1ce2c 100644 +index 4b0be7f7f79de3f7aa4d7ce5ee2b267da8f558e2..b52964fe166e60d5104cabc524a0b36502839927 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -7843,6 +7843,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -7844,6 +7844,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 8bd1e3c02b5851d9178cc0e2573b5000847902ec..b40f3b4bcd7adf0d1341cbf0752e48d8 &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 4efa2e72fdc340624ce888e93ffd4359e20c0973..5018e17e0f56efd54529ef3e9ae1de5e223aed68 100644 +index 010061b7efaf3ae52eb9cc5509976bcf711e0cbe..e1650b721e8c0c444347879f324014becc7f8223 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4206,6 +4206,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4207,6 +4207,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( auto* new_contents_impl = new_contents.get(); @@ -37,7 +37,7 @@ index 4efa2e72fdc340624ce888e93ffd4359e20c0973..5018e17e0f56efd54529ef3e9ae1de5e // If the new frame has a name, make sure any SiteInstances that can find // this named frame have proxies for it. Must be called after // SetSessionStorageNamespace, since this calls CreateRenderView, which uses -@@ -4247,12 +4253,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4248,12 +4254,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( AddWebContentsDestructionObserver(new_contents_impl); } @@ -66,10 +66,10 @@ index 455703114d540328fafccdec7c9caafa838fdbee..5e37edd4295b501b21d5fe1cad31c993 // 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 d9b45cc4c827738e2d958fc85eed0d2ffc10bf74..b9a817079ec336ff70a529a050caedc555ae1ba9 100644 +index 36989f60674cb05aedfdd391d445b00e57369dd6..bf36e251479c6c205aaa4257ccc9cbc1be3ed306 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -658,6 +658,8 @@ bool ContentBrowserClient::CanCreateWindow( +@@ -666,6 +666,8 @@ bool ContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -79,10 +79,10 @@ index d9b45cc4c827738e2d958fc85eed0d2ffc10bf74..b9a817079ec336ff70a529a050caedc5 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 f750767092895262d2ac9432b6288d0d261caaa1..106d02d39b46ccec96d84577e0cdd720b8869465 100644 +index 359fb9cb9bd508e4ebb0116a370e9c83bd078ccc..3ce0a6acc811d0dd46fc341ef0ce88ae123a4e62 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -168,6 +168,7 @@ class NetworkService; +@@ -169,6 +169,7 @@ class NetworkService; class TrustedURLLoaderHeaderClient; } // namespace mojom struct ResourceRequest; @@ -90,7 +90,7 @@ index f750767092895262d2ac9432b6288d0d261caaa1..106d02d39b46ccec96d84577e0cdd720 } // namespace network namespace sandbox { -@@ -1068,6 +1069,8 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1077,6 +1078,8 @@ class CONTENT_EXPORT ContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -148,10 +148,10 @@ index c5bda327264c330345baf7b44b4ba5c478e58952..989778079d5dc91127989e43f3ce6b25 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index b441530bf7da62ddac5a6f17b6b5c76363efea55..3829c1b7902c0fbc0bb2fb53e2917ecabdfc8e96 100644 +index 09d28c8993294d134e983fe96be8b63029b9a5ff..9a078bafa73976d9abb53a9a31ef8b30b1033a0c 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -6320,6 +6320,10 @@ WebView* RenderFrameImpl::CreateNewWindow( +@@ -6316,6 +6316,10 @@ WebView* RenderFrameImpl::CreateNewWindow( blink::GetNavigationInitiatorActivationAndAdStatus( request.HasUserGesture(), GetWebFrame()->IsAdScriptInStack()); @@ -163,7 +163,7 @@ index b441530bf7da62ddac5a6f17b6b5c76363efea55..3829c1b7902c0fbc0bb2fb53e2917eca // 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 bdf18ff21a92c7cde33cb299b5c3c0a609ce2ea8..97822402213729a4204cf36c3cd42ee5f568fc21 100644 +index e4ee6ba03a5683ce7b1a72ac643b5b2520a2f998..44ac0ad92d22b2db8992c67910e420029f005433 100644 --- a/content/web_test/browser/web_test_content_browser_client.cc +++ b/content/web_test/browser/web_test_content_browser_client.cc @@ -504,6 +504,8 @@ bool WebTestContentBrowserClient::CanCreateWindow( @@ -176,7 +176,7 @@ index bdf18ff21a92c7cde33cb299b5c3c0a609ce2ea8..97822402213729a4204cf36c3cd42ee5 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 6e9041279578d8365a4eae6bd9f221baf79324d7..39ff665cc8b87ed4997a60a18c05cd42bc6ffd24 100644 +index d17a2d7f09d1899f2e8888c4747ecffbc5b5ff9a..894795fe392013e66513f1f578970908ec652d5d 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 { @@ -210,10 +210,10 @@ index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59 } // 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 8b66b0254a673c95f1823321d942ea6caed8d7e5..6ed13e56f489da39b7dff90ed02eedc8c231715f 100644 +index 710c475946e9512db62ec049dc11f22acc74678b..3ce044d008b2f56c4d76bdbd59e99dff09aefd21 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc -@@ -2195,6 +2195,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, +@@ -2194,6 +2194,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, WebWindowFeatures window_features = GetWindowFeaturesFromString(features, entered_window); diff --git a/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch b/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch index d17db4d30f43..a8408c69c7f9 100644 --- a/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch +++ b/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch @@ -7,10 +7,10 @@ With WCO, allow chromium to handle synthetic mouse events generated for touch actions in the non-client caption area. 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 06fd4d3962b8aa0767d295deeba2e949e7cd856c..61673ac08ca19816dc01c89b6687f5b2a7c289e2 100644 +index d90c652d7c572686bf54c4d282960ea49525fd5a..73e76c0d940f09336bbec6db47f1afee5153ced0 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 -@@ -1215,6 +1215,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged( +@@ -1213,6 +1213,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged( window()->SetProperty(aura::client::kHeadlessBoundsKey, bounds); } @@ -34,10 +34,10 @@ index 2e4bacce52a45b5d9d7829c1f88f82aa0bb1b4bb..f3537e89191bd2c6d9b06c9b741a1680 Widget* GetWidget(); const Widget* GetWidget() const; diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 49d95d6d67eb5e9bf5ae2f1d64aaafe21e18bf5b..bffa2e1e41f6e61135c6ec3627268d2fbd8783b9 100644 +index 86ee9cae68bfbccc1eec83422c3a62db4eecf536..8099940abae264e80eef29b2fa6227a28b801500 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3243,15 +3243,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3229,15 +3229,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, SetMsgHandled(FALSE); // We must let Windows handle the caption buttons if it's drawing them, or // they won't work. diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index ae16b5f2d91b..85c1daff6b2e 100644 --- a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch +++ b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch @@ -218,10 +218,10 @@ index 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7 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 865414f0994a4e29f297532538486f780edd51d3..3a60a59497571a33bba8efa7654a32403ab99978 100644 +index 3c3c9912b747f4b5f4b8b72f070f39de66c21bfd..a8dfcc826dd3a74c15e2699a59bde9e9867cc69e 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4113,8 +4113,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4114,8 +4114,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( if (delegate_ && delegate_->IsWebContentsCreationOverridden( source_site_instance, params.window_container_type, diff --git a/patches/chromium/command-ismediakey.patch b/patches/chromium/command-ismediakey.patch index 13367567823c..34c21eea04ae 100644 --- a/patches/chromium/command-ismediakey.patch +++ b/patches/chromium/command-ismediakey.patch @@ -117,10 +117,10 @@ index db596585cbb44b3710636e3fc013f288966f604f..6d5557ee1a2c35ee15e695e024834184 } // namespace ui diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerators/media_keys_listener_mac.mm -index 7eb89675a7bb3f22aefc1fb843d7e68554a165fd..bd783a0bfd92c3f9b5553a6480d258c2528ee740 100644 +index e6eb63380dfa7141e1e542635c582a131d2d515f..2b56fbeac62b79420bb1d82101a3c57fd798d260 100644 --- a/ui/base/accelerators/media_keys_listener_mac.mm +++ b/ui/base/accelerators/media_keys_listener_mac.mm -@@ -32,6 +32,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) { +@@ -36,6 +36,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) { case NX_KEYTYPE_NEXT: case NX_KEYTYPE_FAST: return VKEY_MEDIA_NEXT_TRACK; @@ -133,7 +133,7 @@ index 7eb89675a7bb3f22aefc1fb843d7e68554a165fd..bd783a0bfd92c3f9b5553a6480d258c2 } return VKEY_UNKNOWN; } -@@ -190,7 +196,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy, +@@ -194,7 +200,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy, int key_code = (data1 & 0xFFFF0000) >> 16; if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT && key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST && diff --git a/patches/chromium/crash_allow_setting_more_options.patch b/patches/chromium/crash_allow_setting_more_options.patch index 2c67259d5844..6ea6d521b5af 100644 --- a/patches/chromium/crash_allow_setting_more_options.patch +++ b/patches/chromium/crash_allow_setting_more_options.patch @@ -9,10 +9,10 @@ rate-limiting, compression and global annotations. This should be upstreamed. diff --git a/components/crash/core/app/crash_reporter_client.cc b/components/crash/core/app/crash_reporter_client.cc -index 284dd099122df85d2cebf467cdb3a54b45a343eb..bb21ddbd2ee4d2952a4b753a5c553005f8dc46db 100644 +index 3f3ed53d48fc4b19642cae847e69982782790e31..51d089f9fa0e1734f98f270a81a200beda71f2f4 100644 --- a/components/crash/core/app/crash_reporter_client.cc +++ b/components/crash/core/app/crash_reporter_client.cc -@@ -145,6 +145,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { +@@ -141,6 +141,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { return false; } diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index a5005628c1d7..0a69887f7b90 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -93,7 +93,7 @@ index b7df289e4546fd5d33266223f4b678c1ab0e26e2..af4fdec439ebe630d43a60cfa53d3add 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 19d712720b5eaf880c75eaaef897d814f4a5c35d..c8ad0f02d51d3340c8732ea8e349b3876be39601 100644 +index 865769b29edd5b2651f3baaecca2d0fcfde9ab8d..79b6dacb1e1cf198d8deeda0ff85ae8277282d50 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -3517,6 +3517,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( @@ -170,7 +170,7 @@ index 2a31606b1f5814d57ffe59026cc5735fa7cee597..272ae9f414f8d0873e30479b5bfd237c // is what the renderer uses if its not threaded. settings.enable_checker_imaging = diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc -index 8ca1f2220032401f7d63a52c563b526cc3f5200c..c006ccccc9717f8811b8ad43171fe24c3e6bb2b5 100644 +index 4336e255385b4f5ec86e7bfa710b5caaf22adb6b..578ea22f1c29512fd58e631629d5ee03aeb10b38 100644 --- a/ui/gfx/mac/io_surface.cc +++ b/ui/gfx/mac/io_surface.cc @@ -20,6 +20,7 @@ @@ -196,7 +196,7 @@ index 8ca1f2220032401f7d63a52c563b526cc3f5200c..c006ccccc9717f8811b8ad43171fe24c // Allow but ignore invalid color spaces. if (!color_space.IsValid()) return true; -@@ -318,6 +327,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, +@@ -319,6 +328,15 @@ base::ScopedCFTypeRef CreateIOSurface( DCHECK_EQ(kIOReturnSuccess, r); } diff --git a/patches/chromium/enable_reset_aspect_ratio.patch b/patches/chromium/enable_reset_aspect_ratio.patch index 5c9ea177b85a..ade09fb31a46 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -6,7 +6,7 @@ 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 3d22d934c39f50760d1c519d665ddc3cb1908541..06fd4d3962b8aa0767d295deeba2e949e7cd856c 100644 +index 53c1d25e3f56daa9d7929089620c9df7971ceda6..d90c652d7c572686bf54c4d282960ea49525fd5a 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 @@ -570,7 +570,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) { @@ -19,7 +19,7 @@ index 3d22d934c39f50760d1c519d665ddc3cb1908541..06fd4d3962b8aa0767d295deeba2e949 excluded_margin); } diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 60e4436e29b8eaa36cea939edc53d3752e395eef..14a6ad7a22c809a1cd59f5e12d04752b6e7940ed 100644 +index f13408019906af072686001c63d9d2782daa5179..e7dea84e6302ffd5d8824755e3cbf51766418a61 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -1141,8 +1141,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 f3c2b5bfd038..8e7429855717 100644 --- a/patches/chromium/expose_setuseragent_on_networkcontext.patch +++ b/patches/chromium/expose_setuseragent_on_networkcontext.patch @@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4 } // namespace net diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index 0ffa0ec042bd59de5d28fad53dee2b6321d64b18..a6570cb144952a1bb7eca124bb4cbb33e249ef15 100644 +index ea54a2ac9530b2872ecb213c6057a5f0abfb1c08..73171e36a08fbff64f64f6eecc5a75916b206cff 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -1491,6 +1491,13 @@ void NetworkContext::SetNetworkConditions( +@@ -1490,6 +1490,13 @@ void NetworkContext::SetNetworkConditions( std::move(network_conditions)); } @@ -63,10 +63,10 @@ index f10414f382b48ecc162b22d9638d948e3e719733..47d13dbe9efd501efabe096607e53cb8 void SetEnableReferrers(bool enable_referrers) override; #if BUILDFLAG(IS_CHROMEOS) diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 8d4718075da2b8632ca181c5b7ce97eb3e300a1c..3315dff6fdf3a93297ee57da202c690b8277e90a 100644 +index 1ced7811390f72e4c29d998dadcc8c92fbeea818..9e16219871c14d135a4ce2902bc96b3a36f906da 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -1162,6 +1162,9 @@ interface NetworkContext { +@@ -1163,6 +1163,9 @@ interface NetworkContext { SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id, NetworkConditions? conditions); diff --git a/patches/chromium/extend_apply_webpreferences.patch b/patches/chromium/extend_apply_webpreferences.patch index 80b4395100e7..78534a8fb930 100644 --- a/patches/chromium/extend_apply_webpreferences.patch +++ b/patches/chromium/extend_apply_webpreferences.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 ce99c90306bf2988fdb9a92e04d2ed8ec318da78..77f90f35ebad0655af1bd063d9a942964db48017 100644 +index 779dc1c05a58f23517a9375bfed59b7e9337199e..6b3ed3105636b7fcccc1d4994733b0e49b307a44 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -166,6 +166,7 @@ @@ -23,7 +23,7 @@ index ce99c90306bf2988fdb9a92e04d2ed8ec318da78..77f90f35ebad0655af1bd063d9a94296 #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" -@@ -1765,6 +1766,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, +@@ -1771,6 +1772,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, #if BUILDFLAG(IS_MAC) web_view_impl->SetMaximumLegibleScale( prefs.default_maximum_page_scale_factor); diff --git a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch index 134cc12b6c6a..6dc02e4fb51f 100644 --- a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch +++ b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch @@ -65,10 +65,10 @@ index 02d9eabfef9521722340739bf86df3dfc30018d7..af8639ebcc61d8081a12334f652a551d #if BUILDFLAG(IS_WIN) bool EscapeVirtualization(const base::FilePath& user_data_dir); diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc -index 7cd73bf6d1884bd9b38bcb33de009efb1da2add9..a7a441a24098dc95e71e871e776e2cd8dd3c0ea2 100644 +index 2071c301644f95e6cd0448b08cc7b535343a55a0..ec6c6425f4d76557ddb37a80fd68c1086fc5103d 100644 --- a/chrome/browser/process_singleton_posix.cc +++ b/chrome/browser/process_singleton_posix.cc -@@ -608,6 +608,7 @@ class ProcessSingleton::LinuxWatcher +@@ -613,6 +613,7 @@ class ProcessSingleton::LinuxWatcher // |reader| is for sending back ACK message. void HandleMessage(const std::string& current_dir, const std::vector& argv, @@ -76,7 +76,7 @@ index 7cd73bf6d1884bd9b38bcb33de009efb1da2add9..a7a441a24098dc95e71e871e776e2cd8 SocketReader* reader); private: -@@ -662,13 +663,16 @@ void ProcessSingleton::LinuxWatcher::StartListening(int socket) { +@@ -667,13 +668,16 @@ void ProcessSingleton::LinuxWatcher::StartListening(int socket) { } void ProcessSingleton::LinuxWatcher::HandleMessage( @@ -95,7 +95,7 @@ index 7cd73bf6d1884bd9b38bcb33de009efb1da2add9..a7a441a24098dc95e71e871e776e2cd8 // Send back "ACK" message to prevent the client process from starting up. reader->FinishWithACK(kACKToken, std::size(kACKToken) - 1); } else { -@@ -716,7 +720,8 @@ void ProcessSingleton::LinuxWatcher::SocketReader:: +@@ -721,7 +725,8 @@ void ProcessSingleton::LinuxWatcher::SocketReader:: } } @@ -105,7 +105,7 @@ index 7cd73bf6d1884bd9b38bcb33de009efb1da2add9..a7a441a24098dc95e71e871e776e2cd8 const size_t kMinMessageLength = std::size(kStartToken) + 4; if (bytes_read_ < kMinMessageLength) { buf_[bytes_read_] = 0; -@@ -746,10 +751,28 @@ void ProcessSingleton::LinuxWatcher::SocketReader:: +@@ -751,10 +756,28 @@ void ProcessSingleton::LinuxWatcher::SocketReader:: tokens.erase(tokens.begin()); tokens.erase(tokens.begin()); @@ -135,7 +135,7 @@ index 7cd73bf6d1884bd9b38bcb33de009efb1da2add9..a7a441a24098dc95e71e871e776e2cd8 fd_watch_controller_.reset(); // LinuxWatcher::HandleMessage() is in charge of destroying this SocketReader -@@ -778,8 +801,10 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK( +@@ -783,8 +806,10 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK( // ProcessSingleton::ProcessSingleton( const base::FilePath& user_data_dir, @@ -146,7 +146,7 @@ index 7cd73bf6d1884bd9b38bcb33de009efb1da2add9..a7a441a24098dc95e71e871e776e2cd8 current_pid_(base::GetCurrentProcId()) { socket_path_ = user_data_dir.Append(chrome::kSingletonSocketFilename); lock_path_ = user_data_dir.Append(chrome::kSingletonLockFilename); -@@ -897,7 +922,8 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout( +@@ -902,7 +927,8 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout( sizeof(socket_timeout)); // Found another process, prepare our command line @@ -156,7 +156,7 @@ index 7cd73bf6d1884bd9b38bcb33de009efb1da2add9..a7a441a24098dc95e71e871e776e2cd8 std::string to_send(kStartToken); to_send.push_back(kTokenDelimiter); -@@ -907,11 +933,21 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout( +@@ -912,11 +938,21 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout( to_send.append(current_dir.value()); const std::vector& argv = cmd_line.argv(); 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 516f8d4044f3..86e1057bac44 100644 --- a/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch +++ b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch @@ -13,7 +13,7 @@ uses internally for things like menus and devtools. We can remove this patch once it has in some shape been upstreamed. diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc -index 8f13ff7194c8420038583b9c82ccb8b586d86aac..222f2983d85c2c57017e751919919a03d886c0e5 100644 +index bbc44e2e130d7de88d12a283ee69b83bfde8962e..7d5c401fe5909551a42509ea3b14f263ccab5d0f 100644 --- a/ui/native_theme/native_theme.cc +++ b/ui/native_theme/native_theme.cc @@ -145,6 +145,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors, @@ -26,11 +26,11 @@ index 8f13ff7194c8420038583b9c82ccb8b586d86aac..222f2983d85c2c57017e751919919a03 } diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h -index 5ee7cd7952f7b956c32e793e251d5b0cb457026a..bc2fac2b97ffbcc4c0b54d1652c37bfb021d5d3d 100644 +index f39f9910371d1108146e6dde96ef853f5f7cba2d..8eed5c3d6b04b9dbdbc06ce384e8d91ac562f1a6 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h -@@ -410,6 +410,23 @@ class NATIVE_THEME_EXPORT NativeTheme { - custom_theme, +@@ -405,6 +405,23 @@ class NATIVE_THEME_EXPORT NativeTheme { + scoped_refptr custom_theme, bool use_custom_frame = true) const; + @@ -53,7 +53,7 @@ index 5ee7cd7952f7b956c32e793e251d5b0cb457026a..bc2fac2b97ffbcc4c0b54d1652c37bfb // 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 -@@ -606,6 +623,7 @@ class NATIVE_THEME_EXPORT NativeTheme { +@@ -600,6 +617,7 @@ class NATIVE_THEME_EXPORT NativeTheme { PageColors page_colors_ = PageColors::kOff; PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight; PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference; 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 c127c9c03eb8..908b11b8c051 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -197,7 +197,7 @@ index e82717d5167e13e2926bcaf6c0ad66c1502e66f6..783c4d6ed399120e026bbf18baab4092 const raw_ptr gpu_service_impl_; diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc -index a8fcbf5149efa95ec5ec01f4571428053a10bbdb..9fa132fd8dd984e65e53ef6298c09a7d2f358988 100644 +index 761eb3e14b5848463b8886a1d1ea2ac603e4f677..6e717449ca7b3b6cdb440f69f7d1c9565329eb1f 100644 --- a/components/viz/service/display_embedder/software_output_device_mac.cc +++ b/components/viz/service/display_embedder/software_output_device_mac.cc @@ -106,6 +106,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage( diff --git a/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch b/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch index b06862f4d65b..e7f84a901030 100644 --- a/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch +++ b/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch @@ -112,10 +112,10 @@ index 3464dcf4713762ede8ca5ef4918c935c0c1ae1d1..b47cc49c8691acbe03fd23a773e23ffe string mime_type; diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc -index 73955b10b858243f95576b197e4bede26f9a827f..3b71d6f9f2edeb83bd9d360cc7581cbe5a3a9f70 100644 +index cc6bbf3a41a96a2218164d5b87863566e02a0d1c..03fd58c761af81102645eee609e80a815e8d94d4 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc -@@ -650,6 +650,7 @@ URLLoader::URLLoader( +@@ -655,6 +655,7 @@ URLLoader::URLLoader( has_user_activation_ = request.trusted_params->has_user_activation; allow_cookies_from_browser_ = request.trusted_params->allow_cookies_from_browser; @@ -123,7 +123,7 @@ index 73955b10b858243f95576b197e4bede26f9a827f..3b71d6f9f2edeb83bd9d360cc7581cbe } // Store any cookies passed from the browser process to later attach them to -@@ -725,7 +726,7 @@ URLLoader::URLLoader( +@@ -730,7 +731,7 @@ URLLoader::URLLoader( url_request_->SetRequestHeadersCallback(base::BindRepeating( &URLLoader::SetRawRequestHeadersAndNotify, base::Unretained(this))); @@ -132,7 +132,7 @@ index 73955b10b858243f95576b197e4bede26f9a827f..3b71d6f9f2edeb83bd9d360cc7581cbe url_request_->SetResponseHeadersCallback(base::BindRepeating( &URLLoader::SetRawResponseHeaders, base::Unretained(this))); } -@@ -1620,6 +1621,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) { +@@ -1624,6 +1625,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) { } response_ = BuildResponseHead(); @@ -153,10 +153,10 @@ index 73955b10b858243f95576b197e4bede26f9a827f..3b71d6f9f2edeb83bd9d360cc7581cbe // Parse and remove the Trust Tokens response headers, if any are expected, diff --git a/services/network/url_loader.h b/services/network/url_loader.h -index 471d196dc4f5ccd8c0fdf6d25a13629cdd0ae808..c1b52c9394f2471a584e9a6cc0ebdfc0b6ef04ef 100644 +index c2a4bf76d1fa990890f50ee592215883e6352048..e33a3c599c93f0d1687f230daf1c0d76e006a121 100644 --- a/services/network/url_loader.h +++ b/services/network/url_loader.h -@@ -555,6 +555,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader +@@ -580,6 +580,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader std::unique_ptr resource_scheduler_request_handle_; diff --git a/patches/chromium/feat_filter_out_non-shareable_windows_in_the_current_application_in.patch b/patches/chromium/feat_filter_out_non-shareable_windows_in_the_current_application_in.patch index 308fe52b62c3..7b8bbb790b05 100644 --- a/patches/chromium/feat_filter_out_non-shareable_windows_in_the_current_application_in.patch +++ b/patches/chromium/feat_filter_out_non-shareable_windows_in_the_current_application_in.patch @@ -7,10 +7,10 @@ Subject: feat: filter out non-shareable windows in the current application in This patch ensures that windows protected via win.setContentProtection(true) do not appear in full display captures via desktopCapturer. This patch could be upstreamed but as the check is limited to in-process windows it doesn't make a lot of sense for Chromium itself. This patch currently has a limitation that it only function for windows created / protected BEFORE the stream is started. There is theoretical future work we can do via polling / observers to automatically update the SCContentFilter when new windows are made but for now this will solve 99+% of the problem and folks can re-order their logic a bit to get it working for their use cases. diff --git a/content/browser/media/capture/screen_capture_kit_device_mac.mm b/content/browser/media/capture/screen_capture_kit_device_mac.mm -index c1949132c7c6c6f23eb1bb2d795f3dc4f55bbe2f..c552860ca6e0d3a57836149af33eea10508844e3 100644 +index ffc09580be4f78c10dab2f02bc6b89855c4f80ae..92a9f4e4d256a329b9ad2378819289abe1cc8d66 100644 --- a/content/browser/media/capture/screen_capture_kit_device_mac.mm +++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm -@@ -168,7 +168,15 @@ void OnShareableContentCreated( +@@ -170,7 +170,15 @@ void OnShareableContentCreated( case DesktopMediaID::TYPE_SCREEN: for (SCDisplay* display : [content displays]) { if (source_.id == [display displayID]) { diff --git a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch index 170ecd3333af..67660c1595b2 100644 --- a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch +++ b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch @@ -6,10 +6,10 @@ Subject: fix: allow guest webcontents to enter fullscreen This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 0582143a5466afb3ba618e848ff23ffa23e5ca70..7a7f74778d0d9118d01a2dc8b916fada56a8dfaa 100644 +index 8560ba622ae17bbd89944c67ab951652cc1835ff..0773633ba568c5f723149df8af30fa685c18c6c0 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3633,7 +3633,7 @@ void WebContentsImpl::EnterFullscreenMode( +@@ -3634,7 +3634,7 @@ void WebContentsImpl::EnterFullscreenMode( OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode"); DCHECK(CanEnterFullscreenMode(requesting_frame, options)); DCHECK(requesting_frame->IsActive()); diff --git a/patches/chromium/fix_aspect_ratio_with_max_size.patch b/patches/chromium/fix_aspect_ratio_with_max_size.patch index bbf18f546339..44f198cc8b37 100644 --- a/patches/chromium/fix_aspect_ratio_with_max_size.patch +++ b/patches/chromium/fix_aspect_ratio_with_max_size.patch @@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the BrowserWindow. diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 14a6ad7a22c809a1cd59f5e12d04752b6e7940ed..49d95d6d67eb5e9bf5ae2f1d64aaafe21e18bf5b 100644 +index e7dea84e6302ffd5d8824755e3cbf51766418a61..86ee9cae68bfbccc1eec83422c3a62db4eecf536 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3818,14 +3818,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, +@@ -3780,14 +3780,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, delegate_->GetMinMaxSize(&min_window_size, &max_window_size); min_window_size = delegate_->DIPToScreenSize(min_window_size); max_window_size = delegate_->DIPToScreenSize(max_window_size); diff --git a/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch b/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch index 8514e69ef703..46d2da9fffa0 100644 --- a/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch +++ b/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch @@ -17,10 +17,10 @@ policy->CanCommitOriginAndUrl. Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266. diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc -index 948ee821dfea0dc84a5cc9e93b9dc178fade4892..cf32d9032556d550b0dc3f799458d71cb4484dc5 100644 +index 860422baf9918b83bdac88eb97a6a029333eb97a..985a4daf7fa6ba07bfc5b176aeb9a1968814c605 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -7334,10 +7334,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -7353,10 +7353,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { if (IsForMhtmlSubframe()) return origin_with_debug_info; @@ -37,10 +37,10 @@ index 948ee821dfea0dc84a5cc9e93b9dc178fade4892..cf32d9032556d550b0dc3f799458d71c } diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h -index 8e0a631735dedc27898727fbe2a16f3a8ed4e784..5ae6ac7672a7bda8bb147a1fa0d623f3dce7efc2 100644 +index b82987cdc645d74340d5297d1355235c8cfc633c..c02c8a889f75cbb4905eb57285dfdeb219cf271a 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h -@@ -2933,6 +2933,17 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -2936,6 +2936,17 @@ class CONTENT_EXPORT RenderFrameHostImpl // last committed document. CookieChangeListener::CookieChangeInfo GetCookieChangeInfo(); @@ -58,7 +58,7 @@ index 8e0a631735dedc27898727fbe2a16f3a8ed4e784..5ae6ac7672a7bda8bb147a1fa0d623f3 // Sets a ResourceCache in the renderer. `this` must be active and there must // be no pending navigation. `remote` must have the same and process // isolation policy. -@@ -3315,17 +3326,6 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -3318,17 +3329,6 @@ class CONTENT_EXPORT RenderFrameHostImpl // relevant. void ResetWaitingState(); diff --git a/patches/chromium/fix_harden_blink_scriptstate_maybefrom.patch b/patches/chromium/fix_harden_blink_scriptstate_maybefrom.patch new file mode 100644 index 000000000000..c31a05d8dd6c --- /dev/null +++ b/patches/chromium/fix_harden_blink_scriptstate_maybefrom.patch @@ -0,0 +1,120 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: deepak1556 +Date: Wed, 28 Jun 2023 21:11:40 +0900 +Subject: fix: harden blink::ScriptState::MaybeFrom + +This is needed as side effect of https://chromium-review.googlesource.com/c/chromium/src/+/4609446 +which now gets blink::ExecutionContext from blink::ScriptState +and there are isolate callbacks which get entered from Node.js +environment that has v8::Context not associated with blink::ScriptState. +Some examples are ModifyCodeGenerationFromStrings in node_bindings.cc, +blink::UseCounterCallback etc. + +Without this patch when blink::ScriptState::MaybeFrom tries to extract +blink::ScriptState from the provided v8::Context and since Node.js has context +embedder data fields with index greater than blink (see node_context_data.h) +leading to the following CHECK failure. + +``` +script_state.h(169)] Security Check Failed: script_state +``` + +This patch adds a new tag in the context associated with ScriptState +to uniquely identify. It is based on what Node.js does to identify the +context created by it in `node_context_data.h`. + +PS: We are not performing a check like + +``` +ScriptState* script_state = + static_cast(context->GetAlignedPointerFromEmbedderData( + kV8ContextPerContextDataIndex)); +if (!script_state) { + return nullptr; +} +``` + +since in 32-bit builds which does not have v8 sandbox enabled unlike 64-bit builds, +the embedder data slot will not lazy initialize indexes in the former. This means +accessing uninitialized lower indexes can return garbage values that cannot be null checked. +Refer to v8::EmbedderDataSlot::store_aligned_pointer for context. + +diff --git a/gin/public/gin_embedders.h b/gin/public/gin_embedders.h +index 8d7c5631fd8f1499c67384286f0e3c4037673b32..6a7491bc27334f6d1b1175eaa472c888e2b35b5e 100644 +--- a/gin/public/gin_embedders.h ++++ b/gin/public/gin_embedders.h +@@ -18,6 +18,7 @@ namespace gin { + enum GinEmbedder : uint16_t { + kEmbedderNativeGin, + kEmbedderBlink, ++ kEmbedderBlinkTag, + kEmbedderPDFium, + kEmbedderFuchsia, + }; +diff --git a/third_party/blink/renderer/platform/bindings/script_state.cc b/third_party/blink/renderer/platform/bindings/script_state.cc +index 7ff8785cd64c1264a88f91f7bd3292c6943f58ea..bc14ad8cab9fa3ec45bcb9f670b198970ecbeb92 100644 +--- a/third_party/blink/renderer/platform/bindings/script_state.cc ++++ b/third_party/blink/renderer/platform/bindings/script_state.cc +@@ -13,6 +13,10 @@ namespace blink { + + ScriptState::CreateCallback ScriptState::s_create_callback_ = nullptr; + ++int const ScriptState::kScriptStateTag = 0x6e6f64; ++void* const ScriptState::kScriptStateTagPtr = const_cast( ++ static_cast(&ScriptState::kScriptStateTag)); ++ + // static + void ScriptState::SetCreateCallback(CreateCallback create_callback) { + DCHECK(create_callback); +@@ -37,6 +41,8 @@ ScriptState::ScriptState(v8::Local context, + DCHECK(world_); + context_.SetWeak(this, &OnV8ContextCollectedCallback); + context->SetAlignedPointerInEmbedderData(kV8ContextPerContextDataIndex, this); ++ context->SetAlignedPointerInEmbedderData( ++ kV8ContextPerContextDataTagIndex, ScriptState::kScriptStateTagPtr); + RendererResourceCoordinator::Get()->OnScriptStateCreated(this, + execution_context); + } +@@ -78,6 +84,8 @@ void ScriptState::DissociateContext() { + // Cut the reference from V8 context to ScriptState. + GetContext()->SetAlignedPointerInEmbedderData(kV8ContextPerContextDataIndex, + nullptr); ++ GetContext()->SetAlignedPointerInEmbedderData( ++ kV8ContextPerContextDataTagIndex, nullptr); + reference_from_v8_context_.Clear(); + + // Cut the reference from ScriptState to V8 context. +diff --git a/third_party/blink/renderer/platform/bindings/script_state.h b/third_party/blink/renderer/platform/bindings/script_state.h +index 7109852950cde0a6553000421faacefb39366b41..79be73cb660839d6074b11cd7491dc3d5e876345 100644 +--- a/third_party/blink/renderer/platform/bindings/script_state.h ++++ b/third_party/blink/renderer/platform/bindings/script_state.h +@@ -178,7 +178,12 @@ class PLATFORM_EXPORT ScriptState : public GarbageCollected { + static ScriptState* MaybeFrom(v8::Local context) { + DCHECK(!context.IsEmpty()); + if (context->GetNumberOfEmbedderDataFields() <= +- kV8ContextPerContextDataIndex) { ++ kV8ContextPerContextDataTagIndex) { ++ return nullptr; ++ } ++ if (context->GetAlignedPointerFromEmbedderData( ++ kV8ContextPerContextDataTagIndex) != ++ ScriptState::kScriptStateTagPtr) { + return nullptr; + } + return From(context); +@@ -249,9 +254,15 @@ class PLATFORM_EXPORT ScriptState : public GarbageCollected { + static void SetCreateCallback(CreateCallback); + friend class ScriptStateImpl; + ++ static void* const kScriptStateTagPtr; ++ static int const kScriptStateTag; + static constexpr int kV8ContextPerContextDataIndex = + static_cast(gin::kPerContextDataStartIndex) + + static_cast(gin::kEmbedderBlink); ++ static constexpr int kV8ContextPerContextDataTagIndex = ++ static_cast(gin::kPerContextDataStartIndex) + ++ static_cast(gin::kEmbedderBlink) + ++ static_cast(gin::kEmbedderBlinkTag); + }; + + // ScriptStateProtectingContext keeps the context associated with the diff --git a/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch b/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch index 069e54fb09f5..ede079758fe6 100644 --- a/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch +++ b/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch @@ -45,10 +45,10 @@ index ed0641b888c6421b1791c086466bd9c158e9109d..3760b3823d5af3325017bb53f5b1d38e // RenderFrameMetadataProvider::Observer implementation. void OnRenderFrameMetadataChangedBeforeActivation( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 7a7f74778d0d9118d01a2dc8b916fada56a8dfaa..96bd0573473d9f401791125cd18cb24e76fab0db 100644 +index 0773633ba568c5f723149df8af30fa685c18c6c0..0b7f856436344c7a86ca2d3889596eafcebfcf39 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -8163,7 +8163,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( +@@ -8164,7 +8164,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( "WebContentsImpl::OnFocusedElementChangedInFrame", "render_frame_host", frame); RenderWidgetHostViewBase* root_view = diff --git a/patches/chromium/fix_remove_caption-removing_style_call.patch b/patches/chromium/fix_remove_caption-removing_style_call.patch index c1baf77bb9b1..2853ae5dc138 100644 --- a/patches/chromium/fix_remove_caption-removing_style_call.patch +++ b/patches/chromium/fix_remove_caption-removing_style_call.patch @@ -18,10 +18,10 @@ or resizing, but Electron does not seem to run into that issue for opaque frameless windows even with that block commented out. diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index bffa2e1e41f6e61135c6ec3627268d2fbd8783b9..90dd6487fdf438a61672a81f08b545742045944a 100644 +index 8099940abae264e80eef29b2fa6227a28b801500..575877b4fb0929d0cdd22af399f7078fcd713584 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -1874,7 +1874,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { +@@ -1860,7 +1860,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0); diff --git a/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch b/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch index 2d7acb42c847..1b2564bea1df 100644 --- a/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch +++ b/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch @@ -20,7 +20,7 @@ index 34777e89362b14587979cef76d8cd71b634cca8c..3d5e44883bab30eebdfaba70f3933435 injector_->ExpectsResults(), injector_->ShouldWaitForPromise()); } diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h -index 1a7e70ad767cc6d196ae0e376e57d92319d22a4c..6ad1f142113966776685c95094a1e2fd65595928 100644 +index 2aeb74dbcf1721d29bc57e7f227122c213ec52b4..db1eab9a06cf2bf1affe05b054558e7d3db1c209 100644 --- a/third_party/blink/public/web/web_local_frame.h +++ b/third_party/blink/public/web/web_local_frame.h @@ -444,6 +444,7 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame { @@ -64,10 +64,10 @@ index 4cd668a127a50e5462e3878c3f1dcb7384926768..dfbec49249404df8f8ebdbd26e6e865c #endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index f2b09355ba3f42dd72804fb470e98621c1a153f3..c5ede938b3a05f2bf71aec9246c6deb630ae30a5 100644 +index c0c82737679ea9b92fb3195c465bc1083e86e710..a7e5ce39727b70f93cca50c0f1a8162171cc32d8 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc -@@ -2778,6 +2778,7 @@ void LocalFrame::RequestExecuteScript( +@@ -2775,6 +2775,7 @@ void LocalFrame::RequestExecuteScript( mojom::blink::EvaluationTiming evaluation_timing, mojom::blink::LoadEventBlockingOption blocking_option, WebScriptExecutionCallback callback, @@ -75,21 +75,20 @@ index f2b09355ba3f42dd72804fb470e98621c1a153f3..c5ede938b3a05f2bf71aec9246c6deb6 BackForwardCacheAware back_forward_cache_aware, mojom::blink::WantResultOption want_result_option, mojom::blink::PromiseResultOption promise_behavior) { -@@ -2808,7 +2809,8 @@ void LocalFrame::RequestExecuteScript( +@@ -2808,7 +2809,7 @@ void LocalFrame::RequestExecuteScript( PausableScriptExecutor::CreateAndRun( - ToScriptState(DomWindow(), *world), std::move(script_sources), - execute_script_policy, user_gesture, evaluation_timing, blocking_option, -- want_result_option, promise_behavior, std::move(callback)); -+ want_result_option, promise_behavior, std::move(callback), -+ std::move(raw_callback)); + script_state, std::move(script_sources), execute_script_policy, + user_gesture, evaluation_timing, blocking_option, want_result_option, +- promise_behavior, std::move(callback)); ++ promise_behavior, std::move(callback), std::move(raw_callback)); } void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() { diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h -index 3b648c0c3212a886ee5714a8ccc414e3f649b75c..4abf6372264bba9f1234b39918fb2064393ba487 100644 +index efc13a430de1ec3b2bb0f84d6bf713699e4536f4..aa13b2a7dc3f0b7bb3d05d83169d1208345cd2b6 100644 --- a/third_party/blink/renderer/core/frame/local_frame.h +++ b/third_party/blink/renderer/core/frame/local_frame.h -@@ -806,6 +806,7 @@ class CORE_EXPORT LocalFrame final +@@ -805,6 +805,7 @@ class CORE_EXPORT LocalFrame final mojom::blink::EvaluationTiming, mojom::blink::LoadEventBlockingOption, WebScriptExecutionCallback, @@ -205,10 +204,10 @@ index 1e4d9e098463d61dcab787afcc46fea63b27e012..3f1ebf493ddd7d1c209acee2fb1255a0 const mojom::blink::UserActivationOption user_activation_option_; const mojom::blink::LoadEventBlockingOption blocking_option_; 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 59c1dff78aa1e8069d9c7ee0cf26c8291a78b483..4010ae2efe1eeb885864435eb40818a6f3ee7ec3 100644 +index 4cf1d423da07ee405748674eb44b83ac8c0a336d..c6325aeb196aa697b238493c490072b8c26e1062 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 -@@ -1132,14 +1132,15 @@ void WebLocalFrameImpl::RequestExecuteScript( +@@ -1155,14 +1155,15 @@ void WebLocalFrameImpl::RequestExecuteScript( mojom::blink::EvaluationTiming evaluation_timing, mojom::blink::LoadEventBlockingOption blocking_option, WebScriptExecutionCallback callback, @@ -227,7 +226,7 @@ index 59c1dff78aa1e8069d9c7ee0cf26c8291a78b483..4010ae2efe1eeb885864435eb40818a6 v8::MaybeLocal WebLocalFrameImpl::CallFunctionEvenIfScriptDisabled( 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 7cc5a466904a9763c50c2add02f50c9d15643faf..452496056c528bf9c0d7216e8dfa0d94f358c1ca 100644 +index cc487e218fc55e451a8c6da4e75b5afcc59777a9..a9f46b3d4f52d9a28f209e732af2da768bd6392c 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 @@ -196,6 +196,7 @@ class CORE_EXPORT WebLocalFrameImpl final diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index efb388ecd757..755562786aed 100644 --- a/patches/chromium/frame_host_manager.patch +++ b/patches/chromium/frame_host_manager.patch @@ -20,10 +20,10 @@ index 02c8f132c266a599c335f83474b3322700a0e5d1..19f731476a2a2beacef7c4493a586c4a } diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index 106d02d39b46ccec96d84577e0cdd720b8869465..84ae879b787e3bd4b117f9717355957a84bf3b0c 100644 +index 3ce0a6acc811d0dd46fc341ef0ce88ae123a4e62..af1319b60be5bf1fc32262de1998e9705bd34642 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -304,6 +304,11 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -306,6 +306,11 @@ class CONTENT_EXPORT ContentBrowserClient { virtual ~ContentBrowserClient() = default; diff --git a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch index 906260891021..6263754a1f48 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 dec0836918007eb0d3be46e57cfc92c31af3dc62..9059320a73d27b81fb627753ce5a3794 void UpdateDawnInfo(const std::vector& dawn_info_list); diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc -index 8fbe54453cf26281ba302a7176ad2559cc03bfc7..d83ececfc077e99a287f535435aa447b4406de95 100644 +index a8884357f015b8205e9b25ff6ab7a5c268d4ef01..e6ffc967a38df013f767f1d5b5af830ad0ab4e95 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc -@@ -1194,6 +1194,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { +@@ -1190,6 +1190,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { if (host) host->ForceShutdown(); } diff --git a/patches/chromium/gritsettings_resource_ids.patch b/patches/chromium/gritsettings_resource_ids.patch index ebcb09bf9a32..a0e192e15006 100644 --- a/patches/chromium/gritsettings_resource_ids.patch +++ b/patches/chromium/gritsettings_resource_ids.patch @@ -6,7 +6,7 @@ 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 887146425378c061fedb49b9c1dfe009d8e25a83..1d51c7b6c26c6e7c72e4fb6d87af4533240f789e 100644 +index aa2e705856410072ef9b6d1016f17652b5ecd50a..a19589246ad8fdec6e66bd4be26c612ff900cf78 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec @@ -1185,6 +1185,11 @@ diff --git a/patches/chromium/mas_avoid_usage_of_private_macos_apis.patch b/patches/chromium/mas_avoid_usage_of_private_macos_apis.patch index 83320bbe8479..2581229b2e42 100644 --- a/patches/chromium/mas_avoid_usage_of_private_macos_apis.patch +++ b/patches/chromium/mas_avoid_usage_of_private_macos_apis.patch @@ -14,10 +14,10 @@ Disable usage of the following private APIs in MAS builds: * AudioDeviceDuck diff --git a/base/enterprise_util_mac.mm b/base/enterprise_util_mac.mm -index 32837d4ef4fddecf510c8681bc9bdb65f06cdbe6..6eac43311d31a5c71e07b74c8a9fbbbf46466eeb 100644 +index 09e99c33ba9f0fe739a26757aa9018d4dcf180aa..6ac1f2ea2aeff8e640d0307dc7ad4c28a4764552 100644 --- a/base/enterprise_util_mac.mm +++ b/base/enterprise_util_mac.mm -@@ -193,6 +193,13 @@ MacDeviceManagementStateNew IsDeviceRegisteredWithManagementNew() { +@@ -117,6 +117,13 @@ MacDeviceManagementState IsDeviceRegisteredWithManagement() { DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { static DeviceUserDomainJoinState state = [] { DeviceUserDomainJoinState state{false, false}; @@ -31,7 +31,7 @@ index 32837d4ef4fddecf510c8681bc9bdb65f06cdbe6..6eac43311d31a5c71e07b74c8a9fbbbf @autoreleasepool { ODSession* session = [ODSession defaultSession]; -@@ -299,5 +306,6 @@ DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { +@@ -223,5 +230,6 @@ DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { return state; } @@ -39,23 +39,10 @@ index 32837d4ef4fddecf510c8681bc9bdb65f06cdbe6..6eac43311d31a5c71e07b74c8a9fbbbf } // namespace base diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm -index be594941e41d59cfc6bc34ce1fc21ca1b2d399c0..f46b0979f66fdb77bfdbd22358f306c6cf505816 100644 +index d3cd2a2324e3da84d80778bc251d8e4e1feee93b..8c9a9518eab32569a550c9fbf7085917c49caf27 100644 --- a/base/mac/foundation_util.mm +++ b/base/mac/foundation_util.mm -@@ -28,12 +28,6 @@ - extern "C" { - CFTypeID SecKeyGetTypeID(); - #if !BUILDFLAG(IS_IOS) --// The NSFont/CTFont toll-free bridging is broken before 10.15. --// https://openradar.appspot.com/15341349 --// --// TODO(https://crbug.com/1076527): This is fixed in 10.15. When 10.15 is the --// minimum OS for Chromium, remove this SPI declaration. --Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj); - #endif - } // extern "C" - -@@ -323,8 +317,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) { +@@ -371,8 +371,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) { const_cast(reinterpret_cast(cf_val)); DCHECK(!cf_val || CTFontGetTypeID() == CFGetTypeID(cf_val) || @@ -65,7 +52,7 @@ index be594941e41d59cfc6bc34ce1fc21ca1b2d399c0..f46b0979f66fdb77bfdbd22358f306c6 return ns_val; } -@@ -397,9 +390,6 @@ CTFontRef NSToCFCast(NSFont* ns_val) { +@@ -445,9 +444,6 @@ CTFontRef NSToCFCast(NSFont* ns_val) { return (CTFontRef)(cf_val); } diff --git a/patches/chromium/mas_no_private_api.patch b/patches/chromium/mas_no_private_api.patch index 7347c35b98a3..decdc27e279a 100644 --- a/patches/chromium/mas_no_private_api.patch +++ b/patches/chromium/mas_no_private_api.patch @@ -66,7 +66,7 @@ index 22c7e07dffab64061d546aa537620c50948afec0..bf7f32fe6908ad5bf0186b0ad7a5e5ce } // namespace diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm -index 55ef23bac1acd703d4e29a4418d85676f8b56be3..42bd5787bfc77dac3e309f1075325368d508f9b7 100644 +index b9788cf84caf5e151b124e4b3bea81cc906e0673..e4a884a2715be084d0d5ae8d75a3e613f181e56f 100644 --- a/content/renderer/theme_helper_mac.mm +++ b/content/renderer/theme_helper_mac.mm @@ -12,10 +12,11 @@ @@ -75,33 +75,32 @@ index 55ef23bac1acd703d4e29a4418d85676f8b56be3..42bd5787bfc77dac3e309f1075325368 +#if !IS_MAS_BUILD() extern "C" { - bool CGFontRenderingGetFontSmoothingDisabled(void) API_AVAILABLE(macos(10.14)); + bool CGFontRenderingGetFontSmoothingDisabled(void); } - +#endif namespace content { void SystemColorsDidChange(int aqua_color_variant) { -@@ -36,8 +37,19 @@ void SystemColorsDidChange(int aqua_color_variant) { - bool IsSubpixelAntialiasingAvailable() { - if (@available(macOS 10.14, *)) { - // See https://trac.webkit.org/changeset/239306/webkit for more info. -+#if !IS_MAS_BUILD() - return !CGFontRenderingGetFontSmoothingDisabled(); -+#else -+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; -+ NSString *default_key = @"CGFontRenderingGetFontSmoothingDisabled"; -+ // Check that key exists since boolForKey defaults to NO when the -+ // key is missing and this key in fact defaults to YES; -+ if ([defaults objectForKey:default_key] == nil) -+ return false; -+ return ![defaults boolForKey:default_key]; -+#endif - } -+ - return true; +@@ -34,8 +35,18 @@ void SystemColorsDidChange(int aqua_color_variant) { } + bool IsSubpixelAntialiasingAvailable() { ++#if !IS_MAS_BUILD() + // See https://trac.webkit.org/changeset/239306/webkit for more info. + return !CGFontRenderingGetFontSmoothingDisabled(); ++#else ++ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; ++ NSString *default_key = @"CGFontRenderingGetFontSmoothingDisabled"; ++ // Check that key exists since boolForKey defaults to NO when the ++ // key is missing and this key in fact defaults to YES; ++ if ([defaults objectForKey:default_key] == nil) ++ return false; ++ return ![defaults boolForKey:default_key]; ++#endif + } + + } // namespace content diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm index 79bf09102ab4ca9b0a5830132d98b7bd844b1c26..e2b20c0cda169d7b4af5c05b8797188955df8e3c 100644 --- a/device/bluetooth/bluetooth_adapter_mac.mm 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 4fbaf38b833d..711c473e8beb 100644 --- a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch +++ b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch @@ -7,7 +7,7 @@ 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 d553d31e90ca7f3ea9a540d0eda7aaa6801f007b..0ffa0ec042bd59de5d28fad53dee2b6321d64b18 100644 +index 5928eca7c9ef8ddf6ec6bdb949228d7bfc280b22..ea54a2ac9530b2872ecb213c6057a5f0abfb1c08 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc @@ -142,6 +142,11 @@ @@ -122,7 +122,7 @@ index d553d31e90ca7f3ea9a540d0eda7aaa6801f007b..0ffa0ec042bd59de5d28fad53dee2b63 constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess; NetworkContext::PendingCertVerify::PendingCertVerify() = default; -@@ -756,6 +854,13 @@ void NetworkContext::SetClient( +@@ -757,6 +855,13 @@ void NetworkContext::SetClient( client_.Bind(std::move(client)); } @@ -136,7 +136,7 @@ index d553d31e90ca7f3ea9a540d0eda7aaa6801f007b..0ffa0ec042bd59de5d28fad53dee2b63 void NetworkContext::CreateURLLoaderFactory( mojo::PendingReceiver receiver, mojom::URLLoaderFactoryParamsPtr params) { -@@ -2289,6 +2394,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2288,6 +2393,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( std::move(cert_verifier)); cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_.get()); #endif // BUILDFLAG(IS_CHROMEOS) @@ -177,10 +177,10 @@ index 9cac607573e5411c6dd8c2a6309ae78c2a1784f4..f10414f382b48ecc162b22d9638d948e std::unique_ptr internal_host_resolver_; // Map values set to non-null only if that HostResolver has its own private diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index bff25abd86e9d386f9a50b65a20724243b5210e0..8d4718075da2b8632ca181c5b7ce97eb3e300a1c 100644 +index 85973a2d03302701e4429515d1629e3f2090177a..1ced7811390f72e4c29d998dadcc8c92fbeea818 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -296,6 +296,17 @@ struct NetworkContextFilePaths { +@@ -307,6 +307,17 @@ struct NetworkContextFilePaths { bool trigger_migration = false; }; @@ -198,7 +198,7 @@ index bff25abd86e9d386f9a50b65a20724243b5210e0..8d4718075da2b8632ca181c5b7ce97eb // Parameters for constructing a network context. struct NetworkContextParams { // The user agent string. -@@ -876,6 +887,9 @@ interface NetworkContext { +@@ -877,6 +888,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 eaf0aa19a463..58ecab56483e 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -133,7 +133,7 @@ index bbd2aa78722fc0a14ac815ca0243b83965ad8d7c..b6e0a2fce3a0fb9c449aa1bef6a0f970 const GURL& document_url, const WeakDocumentPtr& weak_document_ptr, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 15dc38f75fd7f967bbc045c9b53b2d1f3d896ff9..2d77f10cfed48e316d4026eb57c085dc6c922f68 100644 +index 7a873293b0ec83da11241e0ae407583d86efde8b..994b153f6e7e576d31456e2e63c58457c044c1bd 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -2220,7 +2220,7 @@ void RenderProcessHostImpl::CreateNotificationService( diff --git a/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch b/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch index bbed19f53206..af2e42930138 100644 --- a/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch +++ b/patches/chromium/port_autofill_colors_to_the_color_pipeline.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/color/color_id.h b/ui/color/color_id.h -index 0a9045ddd0c02064ce2557cc8ff8c893713e1d80..eaa24c5e32bc1080481acb84be6df1515ee57915 100644 +index 713dacb89ef7770449383cb8c5c83e679741a78d..0eaef82b4416e3fd4b51c71a544adb328084be39 100644 --- a/ui/color/color_id.h +++ b/ui/color/color_id.h -@@ -373,6 +373,10 @@ +@@ -371,6 +371,10 @@ E_CPONLY(kColorScrollbarThumbInactive) \ E_CPONLY(kColorScrollbarThumbPressed) \ E_CPONLY(kColorScrollbarTrack) \ @@ -22,7 +22,7 @@ index 0a9045ddd0c02064ce2557cc8ff8c893713e1d80..eaa24c5e32bc1080481acb84be6df151 E_CPONLY(kColorSegmentedButtonBorder) \ E_CPONLY(kColorSegmentedButtonFocus) \ E_CPONLY(kColorSegmentedButtonForegroundChecked) \ -@@ -460,6 +464,7 @@ +@@ -458,6 +462,7 @@ E_CPONLY(kColorTreeNodeForeground) \ E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \ E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \ @@ -31,10 +31,10 @@ index 0a9045ddd0c02064ce2557cc8ff8c893713e1d80..eaa24c5e32bc1080481acb84be6df151 #if BUILDFLAG(IS_CHROMEOS) diff --git a/ui/color/ui_color_mixer.cc b/ui/color/ui_color_mixer.cc -index 5f73cfc2dc8b80eb82e7793dee538cb6d03364bf..8378aa22e901e1f128cd9930aef6779bab979741 100644 +index bd00e5b1a74e00bf9827c08f3ef615da827a328f..9d50c292c808688de27b4b173e07afd3e2887d4a 100644 --- a/ui/color/ui_color_mixer.cc +++ b/ui/color/ui_color_mixer.cc -@@ -224,6 +224,17 @@ void AddUiColorMixer(ColorProvider* provider, +@@ -217,6 +217,17 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) { : SkColorSetA(SK_ColorBLACK, 0x80)}; mixer[kColorScrollbarTrack] = {dark_mode ? SkColorSetRGB(0x42, 0x42, 0x42) : SkColorSetRGB(0xF1, 0xF1, 0xF1)}; @@ -52,7 +52,7 @@ index 5f73cfc2dc8b80eb82e7793dee538cb6d03364bf..8378aa22e901e1f128cd9930aef6779b mixer[kColorSeparator] = {kColorMidground}; mixer[kColorShadowBase] = {dark_mode ? SK_ColorBLACK : gfx::kGoogleGrey800}; mixer[kColorShadowValueAmbientShadowElevationThree] = -@@ -322,6 +333,7 @@ void AddUiColorMixer(ColorProvider* provider, +@@ -315,6 +326,7 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) { mixer[kColorTreeNodeForegroundSelectedFocused] = {kColorTreeNodeForeground}; mixer[kColorTreeNodeForegroundSelectedUnfocused] = { kColorTreeNodeForegroundSelectedFocused}; @@ -61,10 +61,10 @@ index 5f73cfc2dc8b80eb82e7793dee538cb6d03364bf..8378aa22e901e1f128cd9930aef6779b } diff --git a/ui/color/win/native_color_mixers_win.cc b/ui/color/win/native_color_mixers_win.cc -index d6c783d34e84c0fb5485b099f527f95dd158e226..7a676e39e0de3c2ab7628cc2f951ee1212c47168 100644 +index 186870aad74c0244c171f2dac28f6d4956fd8b2d..cb9a47b1988a30229b99f236b19cb49cc3e6cfa1 100644 --- a/ui/color/win/native_color_mixers_win.cc +++ b/ui/color/win/native_color_mixers_win.cc -@@ -199,6 +199,10 @@ void AddNativeUiColorMixer(ColorProvider* provider, +@@ -201,6 +201,10 @@ void AddNativeUiColorMixer(ColorProvider* provider, SetAlpha(kColorNotificationInputForeground, gfx::kGoogleGreyAlpha700); mixer[kColorSliderTrack] = AlphaBlend( kColorNativeHighlight, kColorNativeWindow, gfx::kGoogleGreyAlpha400); @@ -75,7 +75,7 @@ index d6c783d34e84c0fb5485b099f527f95dd158e226..7a676e39e0de3c2ab7628cc2f951ee12 // Window Background mixer[kColorBubbleFooterBackground] = {kColorNativeWindow}; -@@ -207,6 +211,7 @@ void AddNativeUiColorMixer(ColorProvider* provider, +@@ -209,6 +213,7 @@ void AddNativeUiColorMixer(ColorProvider* provider, mixer[kColorFrameInactive] = {ui::kColorNativeWindow}; mixer[kColorPrimaryBackground] = {kColorNativeWindow}; mixer[kColorTooltipBackground] = {kColorNativeWindow}; @@ -83,7 +83,7 @@ index d6c783d34e84c0fb5485b099f527f95dd158e226..7a676e39e0de3c2ab7628cc2f951ee12 // Window Text mixer[kColorAlertLowSeverity] = {kColorNativeWindowText}; -@@ -220,6 +225,7 @@ void AddNativeUiColorMixer(ColorProvider* provider, +@@ -222,6 +227,7 @@ void AddNativeUiColorMixer(ColorProvider* provider, mixer[kColorTableGroupingIndicator] = {kColorNativeWindowText}; mixer[kColorThrobber] = {kColorNativeWindowText}; mixer[kColorTooltipForeground] = {kColorNativeWindowText}; @@ -91,7 +91,7 @@ index d6c783d34e84c0fb5485b099f527f95dd158e226..7a676e39e0de3c2ab7628cc2f951ee12 // Hyperlinks mixer[kColorLinkForegroundDefault] = {kColorNativeHotlight}; -@@ -262,6 +268,7 @@ void AddNativeUiColorMixer(ColorProvider* provider, +@@ -264,6 +270,7 @@ void AddNativeUiColorMixer(ColorProvider* provider, mixer[kColorTextfieldForeground] = {kColorNativeBtnText}; mixer[kColorTextfieldForegroundPlaceholder] = {kColorNativeBtnText}; mixer[kColorTextfieldForegroundDisabled] = {kColorNativeBtnText}; diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index 41649b76762a..e206d493ca81 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/BUILD.gn b/BUILD.gn -index 9298bc0945ff258f295bb08849091036d15cadf1..67adb3fe09844e5dcaa8bbd1a9071d13366357ec 100644 +index 08dae2813066a22c16c7cd524fa2c9747bf6ff40..de224c63c242c38b9d12c445a46483a1b2778944 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -971,7 +971,6 @@ if (is_win) { @@ -674,7 +674,7 @@ index ca71560874a0189068dd11fbc039f5673bf6bd96..a8551d95e64da2afbc1685b2df8f1fc3 mojom::PrintFailureReason reason) override; diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom -index cd0f1c1d118cafc4ce12faeb531c38dc12153632..095130068f245dbbc3b7b536892eff9f10456e8c 100644 +index c97825d05cb7d132c9af489998f4ed8c32603c00..fde20b8a6c4811ce728abfee26b2ab7b53027a94 100644 --- a/components/printing/common/print.mojom +++ b/components/printing/common/print.mojom @@ -296,7 +296,7 @@ union PrintWithParamsResult { @@ -699,7 +699,7 @@ index cd0f1c1d118cafc4ce12faeb531c38dc12153632..095130068f245dbbc3b7b536892eff9f // Tells the browser printing failed. PrintingFailed(int32 cookie, PrintFailureReason reason); diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc -index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be16261587 100644 +index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263d30aea4e 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc @@ -45,6 +45,7 @@ @@ -710,7 +710,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be #include "printing/units.h" #include "services/metrics/public/cpp/ukm_source_id.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" -@@ -1345,7 +1346,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { +@@ -1344,7 +1345,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { if (!weak_this) return; @@ -720,7 +720,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be if (!weak_this) return; -@@ -1376,7 +1378,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( +@@ -1375,7 +1377,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( receivers_.Add(this, std::move(receiver)); } @@ -729,7 +729,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr()); if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; -@@ -1391,7 +1393,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { +@@ -1390,7 +1392,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { // plugin node and print that instead. auto plugin = delegate_->GetPdfElement(frame); @@ -738,7 +738,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be if (!render_frame_gone_) frame->DispatchAfterPrintEvent(); -@@ -1470,7 +1472,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { +@@ -1469,7 +1471,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { } Print(frame, print_preview_context_.source_node(), @@ -748,7 +748,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be if (!render_frame_gone_) print_preview_context_.DispatchAfterPrintEvent(); // WARNING: |this| may be gone at this point. Do not do any more work here and -@@ -1521,6 +1524,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { +@@ -1520,6 +1523,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; @@ -757,7 +757,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be print_preview_context_.OnPrintPreview(); #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -2142,7 +2147,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -2130,7 +2135,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { return; Print(duplicate_node.GetDocument().GetFrame(), duplicate_node, @@ -767,7 +767,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be // Check if |this| is still valid. if (!weak_this) return; -@@ -2157,7 +2163,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -2145,7 +2151,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -778,7 +778,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be // If still not finished with earlier print request simply ignore. if (prep_frame_view_) return; -@@ -2165,7 +2173,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2153,7 +2161,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, FrameReference frame_ref(frame); uint32_t expected_page_count = 0; @@ -787,7 +787,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be DidFinishPrinting(FAIL_PRINT_INIT); return; // Failed to init print page settings. } -@@ -2184,8 +2192,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2172,8 +2180,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, print_pages_params_->params->print_scaling_option; auto self = weak_ptr_factory_.GetWeakPtr(); @@ -804,7 +804,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be // Check if |this| is still valid. if (!self) return; -@@ -2418,35 +2433,47 @@ void PrintRenderFrameHelper::IPCProcessed() { +@@ -2406,35 +2421,47 @@ void PrintRenderFrameHelper::IPCProcessed() { } } @@ -862,7 +862,7 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be return false; } -@@ -2550,7 +2577,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( +@@ -2538,7 +2565,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( std::move(params), base::BindOnce( [](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output, @@ -872,10 +872,10 @@ index 4c31c8a926f89ed10fce2ce497c249f0707db9e5..0e4913a5d99aee139014467e848003be std::move(quit_closure).Run(); }, diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h -index d971e446859507456da153a9d59f3ed4857b66cb..9ab75731a941e7065dfaa481508cfa47dbcf7d0b 100644 +index 0fea424325081a0ef6720000841ea321b89024d0..c700de4b81fc0c157946e76faedaca6b59aeac0c 100644 --- a/components/printing/renderer/print_render_frame_helper.h +++ b/components/printing/renderer/print_render_frame_helper.h -@@ -245,7 +245,7 @@ class PrintRenderFrameHelper +@@ -247,7 +247,7 @@ class PrintRenderFrameHelper mojo::PendingAssociatedReceiver receiver); // printing::mojom::PrintRenderFrame: @@ -884,7 +884,7 @@ index d971e446859507456da153a9d59f3ed4857b66cb..9ab75731a941e7065dfaa481508cfa47 void PrintWithParams(mojom::PrintPagesParamsPtr params, PrintWithParamsCallback callback) override; #if BUILDFLAG(ENABLE_PRINT_PREVIEW) -@@ -322,7 +322,9 @@ class PrintRenderFrameHelper +@@ -317,7 +317,9 @@ class PrintRenderFrameHelper // WARNING: |this| may be gone after this method returns. void Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -895,7 +895,7 @@ index d971e446859507456da153a9d59f3ed4857b66cb..9ab75731a941e7065dfaa481508cfa47 // Notification when printing is done - signal tear-down/free resources. void DidFinishPrinting(PrintingResult result); -@@ -331,12 +333,14 @@ class PrintRenderFrameHelper +@@ -326,12 +328,14 @@ class PrintRenderFrameHelper // Initialize print page settings with default settings. // Used only for native printing workflow. @@ -913,10 +913,10 @@ index d971e446859507456da153a9d59f3ed4857b66cb..9ab75731a941e7065dfaa481508cfa47 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Set options for print preset from source PDF document. diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index f57b2e228134e72e6b1f1766faf6e119fc15a4aa..7901304acdeb5845f1c1292d6360bda41c0764e0 100644 +index 853c976d87eb2bc571a270bfe2ca5922ed21a6ee..723e937150ce59cf72cc5800ca2af82b0686a534 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn -@@ -2899,8 +2899,9 @@ source_set("browser") { +@@ -2905,8 +2905,9 @@ source_set("browser") { "//ppapi/shared_impl", ] diff --git a/patches/chromium/process_singleton.patch b/patches/chromium/process_singleton.patch index e13fde93d79a..44ac0821c987 100644 --- a/patches/chromium/process_singleton.patch +++ b/patches/chromium/process_singleton.patch @@ -51,7 +51,7 @@ index b05c0157ecca222452fb38e3b28c9d7cc6bcfbfd..02d9eabfef9521722340739bf86df3df base::win::MessageWindow window_; // The message-only window. bool is_virtualized_; // Stuck inside Microsoft Softricity VM environment. diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc -index c7c8f4c7f89073990c8fd6269ab83e75abd9ad7d..7cd73bf6d1884bd9b38bcb33de009efb1da2add9 100644 +index 356c30cc4bf0d672f62ccf15de829b3c7c42f476..2071c301644f95e6cd0448b08cc7b535343a55a0 100644 --- a/chrome/browser/process_singleton_posix.cc +++ b/chrome/browser/process_singleton_posix.cc @@ -54,6 +54,7 @@ @@ -70,9 +70,9 @@ index c7c8f4c7f89073990c8fd6269ab83e75abd9ad7d..7cd73bf6d1884bd9b38bcb33de009efb #include "base/threading/platform_thread.h" #include "base/time/time.h" #include "base/timer/timer.h" -@@ -96,9 +98,11 @@ - #include "net/base/network_interfaces.h" +@@ -97,9 +99,11 @@ #include "ui/base/l10n/l10n_util.h" + #include "ui/base/resource/scoped_startup_resource_bundle.h" +#if 0 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) @@ -82,17 +82,17 @@ index c7c8f4c7f89073990c8fd6269ab83e75abd9ad7d..7cd73bf6d1884bd9b38bcb33de009efb using content::BrowserThread; -@@ -342,6 +346,9 @@ bool SymlinkPath(const base::FilePath& target, const base::FilePath& path) { +@@ -343,6 +347,9 @@ bool SymlinkPath(const base::FilePath& target, const base::FilePath& path) { bool DisplayProfileInUseError(const base::FilePath& lock_path, const std::string& hostname, int pid) { + return true; + +#if 0 - std::u16string error = l10n_util::GetStringFUTF16( - IDS_PROFILE_IN_USE_POSIX, base::NumberToString16(pid), - base::ASCIIToUTF16(hostname)); -@@ -361,6 +368,7 @@ bool DisplayProfileInUseError(const base::FilePath& lock_path, + // Ensure there is an instance of ResourceBundle that is initialized for + // localized string resource accesses. + ui::ScopedStartupResourceBundle ensure_startup_resource_bundle; +@@ -366,6 +373,7 @@ bool DisplayProfileInUseError(const base::FilePath& lock_path, NOTREACHED(); return false; @@ -100,7 +100,7 @@ index c7c8f4c7f89073990c8fd6269ab83e75abd9ad7d..7cd73bf6d1884bd9b38bcb33de009efb } bool IsChromeProcess(pid_t pid) { -@@ -401,6 +409,21 @@ bool CheckCookie(const base::FilePath& path, const base::FilePath& cookie) { +@@ -406,6 +414,21 @@ bool CheckCookie(const base::FilePath& path, const base::FilePath& cookie) { return (cookie == ReadLink(path)); } @@ -122,7 +122,7 @@ index c7c8f4c7f89073990c8fd6269ab83e75abd9ad7d..7cd73bf6d1884bd9b38bcb33de009efb bool ConnectSocket(ScopedSocket* socket, const base::FilePath& socket_path, const base::FilePath& cookie_path) { -@@ -768,6 +791,10 @@ ProcessSingleton::ProcessSingleton( +@@ -773,6 +796,10 @@ ProcessSingleton::ProcessSingleton( ProcessSingleton::~ProcessSingleton() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -133,7 +133,7 @@ index c7c8f4c7f89073990c8fd6269ab83e75abd9ad7d..7cd73bf6d1884bd9b38bcb33de009efb } ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() { -@@ -1031,14 +1058,32 @@ bool ProcessSingleton::Create() { +@@ -1036,14 +1063,32 @@ bool ProcessSingleton::Create() { #endif } diff --git a/patches/chromium/proxy_config_monitor.patch b/patches/chromium/proxy_config_monitor.patch index 333387b273e1..fa20ca345154 100644 --- a/patches/chromium/proxy_config_monitor.patch +++ b/patches/chromium/proxy_config_monitor.patch @@ -6,7 +6,7 @@ Subject: proxy_config_monitor.patch Allow monitoring proxy config changes for a pref service. diff --git a/chrome/browser/net/proxy_config_monitor.cc b/chrome/browser/net/proxy_config_monitor.cc -index 6dc5622f50847e35d66eff8b34b4888aa6c4ca90..dcbf445709d0511b84ea647892d12266f6be446a 100644 +index c9281f7abfbdeaa4f0d9fe3c199b34fcb5acaf2c..10c008a225d7f88bc2cc39ae0a84580f8ef10a7d 100644 --- a/chrome/browser/net/proxy_config_monitor.cc +++ b/chrome/browser/net/proxy_config_monitor.cc @@ -11,7 +11,9 @@ @@ -19,7 +19,7 @@ index 6dc5622f50847e35d66eff8b34b4888aa6c4ca90..dcbf445709d0511b84ea647892d12266 #include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "content/public/browser/browser_thread.h" #include "mojo/public/cpp/bindings/pending_remote.h" -@@ -22,12 +24,13 @@ +@@ -21,12 +23,13 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -34,7 +34,7 @@ index 6dc5622f50847e35d66eff8b34b4888aa6c4ca90..dcbf445709d0511b84ea647892d12266 ProxyConfigMonitor::ProxyConfigMonitor(Profile* profile) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(profile); -@@ -58,6 +61,7 @@ ProxyConfigMonitor::ProxyConfigMonitor(Profile* profile) { +@@ -57,6 +60,7 @@ ProxyConfigMonitor::ProxyConfigMonitor(Profile* profile) { proxy_config_service_->AddObserver(this); } @@ -42,7 +42,7 @@ index 6dc5622f50847e35d66eff8b34b4888aa6c4ca90..dcbf445709d0511b84ea647892d12266 ProxyConfigMonitor::ProxyConfigMonitor(PrefService* local_state) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || -@@ -139,9 +143,11 @@ void ProxyConfigMonitor::OnLazyProxyConfigPoll() { +@@ -136,9 +140,11 @@ void ProxyConfigMonitor::OnLazyProxyConfigPoll() { void ProxyConfigMonitor::OnPACScriptError(int32_t line_number, const std::string& details) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -54,7 +54,7 @@ index 6dc5622f50847e35d66eff8b34b4888aa6c4ca90..dcbf445709d0511b84ea647892d12266 } void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings( -@@ -155,9 +161,10 @@ void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings( +@@ -152,9 +158,10 @@ void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings( // controlled. return; } 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 e621a3e7e8f3..70102cf7511b 100644 --- a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch +++ b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch @@ -44,10 +44,10 @@ index 2d705b183b1014a6f8dc89672b327d619ac52b1a..7107c17a8f36688d245b4cad5ee92dfc void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 5018e17e0f56efd54529ef3e9ae1de5e223aed68..865414f0994a4e29f297532538486f780edd51d3 100644 +index e1650b721e8c0c444347879f324014becc7f8223..3c3c9912b747f4b5f4b8b72f070f39de66c21bfd 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4798,6 +4798,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { +@@ -4799,6 +4799,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { return text_input_manager_.get(); } @@ -60,10 +60,10 @@ index 5018e17e0f56efd54529ef3e9ae1de5e223aed68..865414f0994a4e29f297532538486f78 RenderWidgetHostImpl* render_widget_host) { return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost(); diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h -index 742fd02e00dca4056cde074f6fa85dd76814cfd8..b6ef149aed6641de2ca1ea8bf3d7bcc86768dd53 100644 +index f96c4b958d4d69d11bb00cd0b0cd4ee8aed9e0b5..bac4973df0890fbd29d015573550898056d552ec 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h -@@ -976,6 +976,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, +@@ -977,6 +977,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, void SendScreenRects() override; void SendActiveState(bool active) override; TextInputManager* GetTextInputManager() override; diff --git a/patches/chromium/revert_simplify_dwm_transitions_on_windows.patch b/patches/chromium/revert_simplify_dwm_transitions_on_windows.patch new file mode 100644 index 000000000000..63cd6ffa4781 --- /dev/null +++ b/patches/chromium/revert_simplify_dwm_transitions_on_windows.patch @@ -0,0 +1,368 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: deepak1556 +Date: Tue, 27 Jun 2023 22:05:17 +0900 +Subject: Revert "Simplify DWM transitions on Windows" + +This reverts commit 392e5f43aae8d225a118145cbc5f5bb104cbe541. + +Can be removed once https://github.com/electron/electron/issues/38937 is resolved. + +diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h +index 15f4aac24744228c0e74ec521c18eb6ab5f59c5b..b9a71c9063d8ee573424a9161cc127af169944a9 100644 +--- a/chrome/app/chrome_command_ids.h ++++ b/chrome/app/chrome_command_ids.h +@@ -59,6 +59,7 @@ + #define IDC_MOVE_TAB_NEXT 34032 + #define IDC_MOVE_TAB_PREVIOUS 34033 + #define IDC_SEARCH 34035 ++#define IDC_DEBUG_FRAME_TOGGLE 34038 + #define IDC_WINDOW_MENU 34045 + #define IDC_MINIMIZE_WINDOW 34046 + #define IDC_MAXIMIZE_WINDOW 34047 +diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc +index b198e41661d459302ddccfab70ac3de8cd2c48b5..405c0ac7c41ef4cb6a8804c8a34a7328d796d7bd 100644 +--- a/chrome/browser/ui/browser_command_controller.cc ++++ b/chrome/browser/ui/browser_command_controller.cc +@@ -1184,6 +1184,7 @@ void BrowserCommandController::InitCommandState() { + IDC_DUPLICATE_TAB, !browser_->is_type_picture_in_picture()); + UpdateTabRestoreCommandState(); + command_updater_.UpdateCommandEnabled(IDC_EXIT, true); ++ command_updater_.UpdateCommandEnabled(IDC_DEBUG_FRAME_TOGGLE, true); + command_updater_.UpdateCommandEnabled(IDC_NAME_WINDOW, true); + #if BUILDFLAG(IS_CHROMEOS) + command_updater_.UpdateCommandEnabled( +diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc +index fa718692b769c3bbcf83f700718cf88dc631d058..c8ed066b698ab08d5cfbc644ca1f66f23c0fbeec 100644 +--- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc ++++ b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc +@@ -397,6 +397,13 @@ void BrowserDesktopWindowTreeHostWin::HandleDestroying() { + DesktopWindowTreeHostWin::HandleDestroying(); + } + ++void BrowserDesktopWindowTreeHostWin::HandleFrameChanged() { ++ // Reinitialize the status bubble, since it needs to be initialized ++ // differently depending on whether or not DWM composition is enabled ++ browser_view_->InitStatusBubble(); ++ DesktopWindowTreeHostWin::HandleFrameChanged(); ++} ++ + void BrowserDesktopWindowTreeHostWin::HandleWindowScaleFactorChanged( + float window_scale_factor) { + DesktopWindowTreeHostWin::HandleWindowScaleFactorChanged(window_scale_factor); +diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.h b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.h +index 28412d00adf463a1453aecc82ca1179f0521822d..a3bd2e0cae1d341adfe9dd498886ae5914e1cba7 100644 +--- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.h ++++ b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.h +@@ -66,6 +66,7 @@ class BrowserDesktopWindowTreeHostWin + bool GetDwmFrameInsetsInPixels(gfx::Insets* insets) const override; + void HandleCreate() override; + void HandleDestroying() override; ++ void HandleFrameChanged() override; + void HandleWindowScaleFactorChanged(float window_scale_factor) override; + bool PreHandleMSG(UINT message, + WPARAM w_param, +diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc +index 6920106ba91e0d1c0c1706a28b4ce5a14b5f3aed..306affc1d9573acd475d79f30a3583f0e716f33e 100644 +--- a/chrome/browser/ui/views/frame/browser_view.cc ++++ b/chrome/browser/ui/views/frame/browser_view.cc +@@ -927,8 +927,7 @@ BrowserView::BrowserView(std::unique_ptr browser) + infobar_container_ = + AddChildView(std::make_unique(this)); + +- status_bubble_ = std::make_unique(contents_web_view_); +- contents_web_view_->SetStatusBubble(status_bubble_.get()); ++ InitStatusBubble(); + + // Create do-nothing view for the sake of controlling the z-order of the find + // bar widget. +@@ -1049,6 +1048,11 @@ void BrowserView::SetDisableRevealerDelayForTesting(bool disable) { + g_disable_revealer_delay_for_testing = disable; + } + ++void BrowserView::InitStatusBubble() { ++ status_bubble_ = std::make_unique(contents_web_view_); ++ contents_web_view_->SetStatusBubble(status_bubble_.get()); ++} ++ + gfx::Rect BrowserView::GetFindBarBoundingBox() const { + gfx::Rect contents_bounds = contents_container_->ConvertRectToWidget( + contents_container_->GetLocalBounds()); +@@ -3397,6 +3401,11 @@ ui::ImageModel BrowserView::GetWindowIcon() { + } + + bool BrowserView::ExecuteWindowsCommand(int command_id) { ++ // This function handles WM_SYSCOMMAND, WM_APPCOMMAND, and WM_COMMAND. ++#if BUILDFLAG(IS_WIN) ++ if (command_id == IDC_DEBUG_FRAME_TOGGLE) ++ GetWidget()->DebugToggleFrameType(); ++#endif + // Translate WM_APPCOMMAND command ids into a command id that the browser + // knows how to handle. + int command_id_from_app_command = GetCommandIDForAppCommandID(command_id); +diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h +index d80a6df7380e5aec6ecba092315c905a09d7e2cc..bde91001c6f75f9918b9063eb0eaff5d56ea06c1 100644 +--- a/chrome/browser/ui/views/frame/browser_view.h ++++ b/chrome/browser/ui/views/frame/browser_view.h +@@ -164,6 +164,12 @@ class BrowserView : public BrowserWindow, + + void SetDownloadShelfForTest(DownloadShelf* download_shelf); + ++ // Initializes (or re-initializes) the status bubble. We try to only create ++ // the bubble once and re-use it for the life of the browser, but certain ++ // events (such as changing enabling/disabling Aero on Win) can force a need ++ // to change some of the bubble's creation parameters. ++ void InitStatusBubble(); ++ + // Returns the constraining bounding box that should be used to lay out the + // FindBar within. This is _not_ the size of the find bar, just the bounding + // box it should be laid out within. The coordinate system of the returned +diff --git a/chrome/browser/ui/views/frame/system_menu_model_builder.cc b/chrome/browser/ui/views/frame/system_menu_model_builder.cc +index 984929bb899dbd791443bf3ccd841f5a975a7dbd..75719ef6280ce46c176cb3277e602a11d99a45e0 100644 +--- a/chrome/browser/ui/views/frame/system_menu_model_builder.cc ++++ b/chrome/browser/ui/views/frame/system_menu_model_builder.cc +@@ -69,6 +69,7 @@ void SystemMenuModelBuilder::BuildMenu(ui::SimpleMenuModel* model) { + BuildSystemMenuForBrowserWindow(model); + else + BuildSystemMenuForAppOrPopupWindow(model); ++ AddFrameToggleItems(model); + } + + void SystemMenuModelBuilder::BuildSystemMenuForBrowserWindow( +@@ -157,6 +158,14 @@ void SystemMenuModelBuilder::BuildSystemMenuForAppOrPopupWindow( + AppendTeleportMenu(model); + } + ++void SystemMenuModelBuilder::AddFrameToggleItems(ui::SimpleMenuModel* model) { ++ if (base::CommandLine::ForCurrentProcess()->HasSwitch( ++ switches::kDebugEnableFrameToggle)) { ++ model->AddSeparator(ui::NORMAL_SEPARATOR); ++ model->AddItem(IDC_DEBUG_FRAME_TOGGLE, u"Toggle Frame Type"); ++ } ++} ++ + #if BUILDFLAG(IS_CHROMEOS) + void SystemMenuModelBuilder::AppendMoveToDesksMenu(ui::SimpleMenuModel* model) { + gfx::NativeWindow window = +diff --git a/chrome/browser/ui/views/frame/system_menu_model_builder.h b/chrome/browser/ui/views/frame/system_menu_model_builder.h +index 8f69eab1fc2b9c81d14f7b547b4f434c722b98aa..8acaa2816a03f41b19ec364eea2658682737798c 100644 +--- a/chrome/browser/ui/views/frame/system_menu_model_builder.h ++++ b/chrome/browser/ui/views/frame/system_menu_model_builder.h +@@ -47,6 +47,9 @@ class SystemMenuModelBuilder { + void BuildSystemMenuForBrowserWindow(ui::SimpleMenuModel* model); + void BuildSystemMenuForAppOrPopupWindow(ui::SimpleMenuModel* model); + ++ // Adds items for toggling the frame type (if necessary). ++ void AddFrameToggleItems(ui::SimpleMenuModel* model); ++ + #if BUILDFLAG(IS_CHROMEOS) + // Add the submenu for move to desks. + void AppendMoveToDesksMenu(ui::SimpleMenuModel* model); +diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc +index b23fbffea35f1f9936b998bbe501c9e5acdecf6a..4d635764d6c5db0b493aba9d3b2add095fc9ebe4 100644 +--- a/chrome/common/chrome_switches.cc ++++ b/chrome/common/chrome_switches.cc +@@ -143,6 +143,10 @@ const char kCredits[] = "credits"; + // devtools://devtools/bundled/ + const char kCustomDevtoolsFrontend[] = "custom-devtools-frontend"; + ++// Enables a frame context menu item that toggles the frame in and out of glass ++// mode (Windows Vista and up only). ++const char kDebugEnableFrameToggle[] = "debug-enable-frame-toggle"; ++ + // Adds debugging entries such as Inspect Element to context menus of packed + // apps. + const char kDebugPackedApps[] = "debug-packed-apps"; +diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h +index be1f7824d85a6705aa8c220578ac62f0d1a4114e..7ce3dd85d1cab1fbd5aff6104ea0d1b864ebcb0c 100644 +--- a/chrome/common/chrome_switches.h ++++ b/chrome/common/chrome_switches.h +@@ -61,6 +61,7 @@ extern const char kCrashOnHangThreads[]; + extern const char kCreateBrowserOnStartupForTests[]; + extern const char kCredits[]; + extern const char kCustomDevtoolsFrontend[]; ++extern const char kDebugEnableFrameToggle[]; + extern const char kDebugPackedApps[]; + extern const char kDevToolsFlags[]; + extern const char kDiagnostics[]; +diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc +index d0dc2b4993891837c6ac76e095833126db461032..ba1bcbc63475b7151e2335c9237124ca8ca31dc7 100644 +--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc ++++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc +@@ -136,6 +136,30 @@ TEST_F(DesktopNativeWidgetAuraTest, WidgetNotVisibleOnlyWindowTreeHostShown) { + } + #endif + ++TEST_F(DesktopNativeWidgetAuraTest, DesktopAuraWindowShowFrameless) { ++ Widget widget; ++ Widget::InitParams init_params = ++ CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS); ++ init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; ++ widget.Init(std::move(init_params)); ++ ++ // Make sure that changing frame type doesn't crash when there's no non-client ++ // view. ++ ASSERT_EQ(nullptr, widget.non_client_view()); ++ widget.DebugToggleFrameType(); ++ widget.Show(); ++ ++#if BUILDFLAG(IS_WIN) ++ // On Windows also make sure that handling WM_SYSCOMMAND doesn't crash with ++ // custom frame. Frame type needs to be toggled again if Aero Glass is ++ // disabled. ++ if (widget.ShouldUseNativeFrame()) ++ widget.DebugToggleFrameType(); ++ SendMessage(widget.GetNativeWindow()->GetHost()->GetAcceleratedWidget(), ++ WM_SYSCOMMAND, SC_RESTORE, 0); ++#endif // BUILDFLAG(IS_WIN) ++} ++ + #if BUILDFLAG(IS_CHROMEOS_ASH) + // TODO(crbug.com/916272): investigate fixing and enabling on Chrome OS. + #define MAYBE_GlobalCursorState DISABLED_GlobalCursorState +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 73e76c0d940f09336bbec6db47f1afee5153ced0..61673ac08ca19816dc01c89b6687f5b2a7c289e2 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 +@@ -1028,6 +1028,8 @@ void DesktopWindowTreeHostWin::HandleClientSizeChanged( + } + + void DesktopWindowTreeHostWin::HandleFrameChanged() { ++ CheckForMonitorChange(); ++ desktop_native_widget_aura_->UpdateWindowTransparency(); + // Replace the frame and layout the contents. + if (GetWidget()->non_client_view()) + GetWidget()->non_client_view()->UpdateFrame(); +diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc +index 2b52ad2f63bd6924fcd3d000bbb7ed6fd9f4b0dd..3d7a2f986c38de6b2e69722e63ee3b139d257756 100644 +--- a/ui/views/widget/widget.cc ++++ b/ui/views/widget/widget.cc +@@ -1209,6 +1209,21 @@ bool Widget::ShouldWindowContentsBeTransparent() const { + : false; + } + ++void Widget::DebugToggleFrameType() { ++ if (!native_widget_) ++ return; ++ ++ if (frame_type_ == FrameType::kDefault) { ++ frame_type_ = ShouldUseNativeFrame() ? FrameType::kForceCustom ++ : FrameType::kForceNative; ++ } else { ++ frame_type_ = frame_type_ == FrameType::kForceCustom ++ ? FrameType::kForceNative ++ : FrameType::kForceCustom; ++ } ++ FrameTypeChanged(); ++} ++ + void Widget::FrameTypeChanged() { + if (native_widget_) + native_widget_->FrameTypeChanged(); +diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h +index 51017b6f5dd9a9d5f26723c7ec7a6e0404c93b65..54b9e676c9423b78184fc63b80299dd7529cbd28 100644 +--- a/ui/views/widget/widget.h ++++ b/ui/views/widget/widget.h +@@ -922,6 +922,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, + // (for example, so that they can overhang onto the window title bar). + bool ShouldWindowContentsBeTransparent() const; + ++ // Forces the frame into the alternate frame type (custom or native) depending ++ // on its current state. ++ void DebugToggleFrameType(); ++ + // Tell the window that something caused the frame type to change. + void FrameTypeChanged(); + +diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc +index 9aced70287c3ac877310457c1aad3b2544a85800..35f435d3d4d5eda44b69e5e66ec9480534d3ef44 100644 +--- a/ui/views/widget/widget_unittest.cc ++++ b/ui/views/widget/widget_unittest.cc +@@ -1317,6 +1317,10 @@ TEST_P(WidgetWithDestroyedNativeViewOrNativeWidgetTest, Deactivate) { + widget()->Deactivate(); + } + ++TEST_P(WidgetWithDestroyedNativeViewOrNativeWidgetTest, DebugToggleFrameType) { ++ widget()->DebugToggleFrameType(); ++} ++ + TEST_P(WidgetWithDestroyedNativeViewOrNativeWidgetTest, DraggedView) { + widget()->dragged_view(); + } +diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc +index 575877b4fb0929d0cdd22af399f7078fcd713584..90dd6487fdf438a61672a81f08b545742045944a 100644 +--- a/ui/views/win/hwnd_message_handler.cc ++++ b/ui/views/win/hwnd_message_handler.cc +@@ -1741,6 +1741,20 @@ void HWNDMessageHandler::ResetWindowRegion(bool force, bool redraw) { + } + } + ++void HWNDMessageHandler::UpdateDwmNcRenderingPolicy() { ++ if (IsFullscreen()) ++ return; ++ ++ DWMNCRENDERINGPOLICY policy = ++ custom_window_region_.is_valid() || ++ delegate_->GetFrameMode() == FrameMode::CUSTOM_DRAWN ++ ? DWMNCRP_DISABLED ++ : DWMNCRP_ENABLED; ++ ++ DwmSetWindowAttribute(hwnd(), DWMWA_NCRENDERING_POLICY, &policy, ++ sizeof(DWMNCRENDERINGPOLICY)); ++} ++ + LRESULT HWNDMessageHandler::DefWindowProcWithRedrawLock(UINT message, + WPARAM w_param, + LPARAM l_param) { +@@ -3607,10 +3621,34 @@ bool HWNDMessageHandler::IsSynthesizedMouseMessage(unsigned int message, + } + + void HWNDMessageHandler::PerformDwmTransition() { +- CHECK(IsFrameSystemDrawn()); +- + dwm_transition_desired_ = false; ++ ++ UpdateDwmNcRenderingPolicy(); ++ // Don't redraw the window here, because we need to hide and show the window ++ // which will also trigger a redraw. ++ ResetWindowRegion(true, false); ++ // The non-client view needs to update too. + delegate_->HandleFrameChanged(); ++ // This calls DwmExtendFrameIntoClientArea which must be called when DWM ++ // composition state changes. ++ UpdateDwmFrame(); ++ ++ if (IsVisible() && IsFrameSystemDrawn()) { ++ // For some reason, we need to hide the window after we change from a custom ++ // frame to a native frame. If we don't, the client area will be filled ++ // with black. This seems to be related to an interaction between DWM and ++ // SetWindowRgn, but the details aren't clear. Additionally, we need to ++ // specify SWP_NOZORDER here, otherwise if you have multiple chrome windows ++ // open they will re-appear with a non-deterministic Z-order. ++ // Note: caused http://crbug.com/895855, where a laptop lid close+reopen ++ // puts window in the background but acts like a foreground window. Fixed by ++ // not calling this unless DWM composition actually changes. Finally, since ++ // we don't want windows stealing focus if they're not already active, we ++ // set SWP_NOACTIVATE. ++ UINT flags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE; ++ SetWindowPos(hwnd(), nullptr, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); ++ SetWindowPos(hwnd(), nullptr, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); ++ } + } + + void HWNDMessageHandler::UpdateDwmFrame() { +diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h +index 7238af3f51179145a1c1eb9639ca756c2a697554..694945c4f3a62ed13a3b80cc5fba5673e29eef4e 100644 +--- a/ui/views/win/hwnd_message_handler.h ++++ b/ui/views/win/hwnd_message_handler.h +@@ -324,6 +324,11 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl, + // frame windows. + void ResetWindowRegion(bool force, bool redraw); + ++ // Enables or disables rendering of the non-client (glass) area by DWM, ++ // under Vista and above, depending on whether the caller has requested a ++ // custom frame. ++ void UpdateDwmNcRenderingPolicy(); ++ + // Calls DefWindowProc, safely wrapping the call in a ScopedRedrawLock to + // prevent frame flicker. DefWindowProc handling can otherwise render the + // classic-look window title bar directly. diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index b93e3e318d97..1bf14921f000 100644 --- a/patches/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,7 +22,7 @@ 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 2d77f10cfed48e316d4026eb57c085dc6c922f68..19d712720b5eaf880c75eaaef897d814f4a5c35d 100644 +index 994b153f6e7e576d31456e2e63c58457c044c1bd..865769b29edd5b2651f3baaecca2d0fcfde9ab8d 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1905,9 +1905,15 @@ bool RenderProcessHostImpl::Init() { diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index 949b7ca62fad..1929206f719f 100644 --- a/patches/chromium/web_contents.patch +++ b/patches/chromium/web_contents.patch @@ -9,10 +9,10 @@ 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 3a60a59497571a33bba8efa7654a32403ab99978..0582143a5466afb3ba618e848ff23ffa23e5ca70 100644 +index a8dfcc826dd3a74c15e2699a59bde9e9867cc69e..8560ba622ae17bbd89944c67ab951652cc1835ff 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3242,6 +3242,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3243,6 +3243,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, params.main_frame_name, GetOpener(), primary_main_frame_policy, base::UnguessableToken::Create()); @@ -26,7 +26,7 @@ index 3a60a59497571a33bba8efa7654a32403ab99978..0582143a5466afb3ba618e848ff23ffa std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3252,6 +3259,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3253,6 +3260,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } @@ -35,7 +35,7 @@ index 3a60a59497571a33bba8efa7654a32403ab99978..0582143a5466afb3ba618e848ff23ffa CHECK(view_.get()); diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index ea1643f689885617bc4a4e1809ce3f64b80764ee..d4c85155fd7c1fc1031655ec7b3a803c5c5c49db 100644 +index 71466f62c10d1000dfcc6c4e1fc256ded1e7f897..2267a97ba8e2f2c8cbc8a5cdb3584b5be25b9c18 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h @@ -97,10 +97,13 @@ class BrowserContext; diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index 89711b6132d0..23c2f6bdc337 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -14,10 +14,10 @@ Note that we also need to manually update embedder's `api::WebContents::IsFullscreenForTabOrPending` value. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index b40f3b4bcd7adf0d1341cbf0752e48d8abe1ce2c..4faa6e471eecce952b30618f09f8a6c7086bc98a 100644 +index b52964fe166e60d5104cabc524a0b36502839927..4eedf6d5033d68c309a94cffbe575daa9e1222f7 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -7060,6 +7060,17 @@ void RenderFrameHostImpl::EnterFullscreen( +@@ -7061,6 +7061,17 @@ void RenderFrameHostImpl::EnterFullscreen( } } diff --git a/patches/chromium/worker_context_will_destroy.patch b/patches/chromium/worker_context_will_destroy.patch index af8c36e656cc..9ede73917cd2 100644 --- a/patches/chromium/worker_context_will_destroy.patch +++ b/patches/chromium/worker_context_will_destroy.patch @@ -55,10 +55,10 @@ index 587565fa2fd5d677f77ed1a44cb39a9e3007c221..9b234f2ea8daa9300c2a41f7001b140c 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 2d99d8aff36e3687e788f0b23b1e30dd881d70e3..ea6c75433f4e4092d77f938dff1cbf2671643400 100644 +index d5190a687527788319cedadafbb169b3090f7b7c..a7617a5fa849ac2dd516c2348126b3ade8592443 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -617,6 +617,7 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -616,6 +616,7 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local& worker) {} 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 d3462d1e045f..df4665501e8e 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 @@ -65,10 +65,10 @@ index 9b234f2ea8daa9300c2a41f7001b140c52ac5c0f..7b666ae7276f6393b4ce7390e811c0c4 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 ea6c75433f4e4092d77f938dff1cbf2671643400..f5306fc986340c519dcb6fa0920b544cc927a30b 100644 +index a7617a5fa849ac2dd516c2348126b3ade8592443..6ab4740bd3719202af7c82e5e8eefbbe6f09d187 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -617,6 +617,8 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -616,6 +616,8 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local& worker) {} @@ -78,10 +78,10 @@ index ea6c75433f4e4092d77f938dff1cbf2671643400..f5306fc986340c519dcb6fa0920b544c 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 89c59263ebd8fa078cc2110a9915322d265d075b..1715745c392ee99a1bfca1b29dd0f832b6b6b568 100644 +index a7403bd90f0ca076d917adec3dcd325673858bd1..da059844dcb6ff4b2401f043146b84eb8d516898 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 -@@ -262,6 +262,7 @@ void WorkerOrWorkletScriptController::PrepareForEvaluation() { +@@ -261,6 +261,7 @@ void WorkerOrWorkletScriptController::PrepareForEvaluation() { V8PerContextData* per_context_data = script_state_->PerContextData(); std::ignore = per_context_data->ConstructorForType(global_scope_->GetWrapperTypeInfo()); diff --git a/patches/squirrel.mac/.patches b/patches/squirrel.mac/.patches index 1a2a44222c4a..ea4ac7726f4d 100644 --- a/patches/squirrel.mac/.patches +++ b/patches/squirrel.mac/.patches @@ -4,3 +4,4 @@ fix_use_kseccschecknestedcode_kseccsstrictvalidate_in_the_sec.patch feat_add_new_squirrel_mac_bundle_installation_method_behind_flag.patch refactor_use_posix_spawn_instead_of_nstask_so_we_can_disclaim_the.patch fix_abort_installation_attempt_at_the_final_mile_if_the_app_is.patch +chore_disable_api_deprecation_warnings_in_nskeyedarchiver.patch diff --git a/patches/squirrel.mac/chore_disable_api_deprecation_warnings_in_nskeyedarchiver.patch b/patches/squirrel.mac/chore_disable_api_deprecation_warnings_in_nskeyedarchiver.patch new file mode 100644 index 000000000000..c4760ca747cc --- /dev/null +++ b/patches/squirrel.mac/chore_disable_api_deprecation_warnings_in_nskeyedarchiver.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Thu, 22 Jun 2023 12:52:10 +0200 +Subject: chore: disable API deprecation warnings in NSKeyedArchiver + +This should be updated to use the newer APIs. + +Upstream PR at https://github.com/Squirrel/Squirrel.Mac/pull/273 + +diff --git a/Squirrel/SQRLInstaller.m b/Squirrel/SQRLInstaller.m +index f502df2f88424ea902a061adfeb30358daf212e4..a18fedc3e47eb9c8bb7afc42aeab7cef3df742a3 100644 +--- a/Squirrel/SQRLInstaller.m ++++ b/Squirrel/SQRLInstaller.m +@@ -182,14 +182,20 @@ - (SQRLInstallerOwnedBundle *)ownedBundle { + id archiveData = CFBridgingRelease(CFPreferencesCopyValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost)); + if (![archiveData isKindOfClass:NSData.class]) return nil; + ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SQRLInstallerOwnedBundle *ownedBundle = [NSKeyedUnarchiver unarchiveObjectWithData:archiveData]; + if (![ownedBundle isKindOfClass:SQRLInstallerOwnedBundle.class]) return nil; ++#pragma clang diagnostic pop + + return ownedBundle; + } + + - (void)setOwnedBundle:(SQRLInstallerOwnedBundle *)ownedBundle { ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wdeprecated-declarations" + NSData *archiveData = (ownedBundle == nil ? nil : [NSKeyedArchiver archivedDataWithRootObject:ownedBundle]); ++#pragma clang diagnostic pop + CFPreferencesSetValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFPropertyListRef)archiveData, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost); + CFPreferencesSynchronize((__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost); + } diff --git a/patches/squirrel.mac/fix_abort_installation_attempt_at_the_final_mile_if_the_app_is.patch b/patches/squirrel.mac/fix_abort_installation_attempt_at_the_final_mile_if_the_app_is.patch index febb0650dba1..d227b713ff3b 100644 --- a/patches/squirrel.mac/fix_abort_installation_attempt_at_the_final_mile_if_the_app_is.patch +++ b/patches/squirrel.mac/fix_abort_installation_attempt_at_the_final_mile_if_the_app_is.patch @@ -53,10 +53,10 @@ index c1f328fa8c3689218ef260347cb8f9d30b789efe..f502df2f88424ea902a061adfeb30358 }] flattenMap:^(SQRLShipItRequest *request) { diff --git a/Squirrel/ShipIt-main.m b/Squirrel/ShipIt-main.m -index 2c515ffdd67052a08ee8155c0e46b57e9721a0e5..5f3e29642012d04fc506b730a4e87fba861df250 100644 +index 032f0b3e9200b423f1cd25fa2f39bc4117443741..671f8fa2104df85046ff813d4b824a65caae502f 100644 --- a/Squirrel/ShipIt-main.m +++ b/Squirrel/ShipIt-main.m -@@ -201,8 +201,14 @@ static void installRequest(RACSignal *readRequestSignal, NSString *applicationId +@@ -199,8 +199,14 @@ static void installRequest(RACSignal *readRequestSignal, NSString *applicationId return action; }] subscribeError:^(NSError *error) { diff --git a/patches/squirrel.mac/refactor_use_posix_spawn_instead_of_nstask_so_we_can_disclaim_the.patch b/patches/squirrel.mac/refactor_use_posix_spawn_instead_of_nstask_so_we_can_disclaim_the.patch index c69df44026fd..2a96e74d9cdb 100644 --- a/patches/squirrel.mac/refactor_use_posix_spawn_instead_of_nstask_so_we_can_disclaim_the.patch +++ b/patches/squirrel.mac/refactor_use_posix_spawn_instead_of_nstask_so_we_can_disclaim_the.patch @@ -7,7 +7,7 @@ Subject: refactor: use posix_spawn instead of NSTask so we can disclaim the This ensures that if the ShipIt executable is hotswapped it doesn't inherit TCC permissions diff --git a/Squirrel/ShipIt-main.m b/Squirrel/ShipIt-main.m -index db246534e176f9c3ea2dd8b1c8659378fdc2435d..2c515ffdd67052a08ee8155c0e46b57e9721a0e5 100644 +index db246534e176f9c3ea2dd8b1c8659378fdc2435d..032f0b3e9200b423f1cd25fa2f39bc4117443741 100644 --- a/Squirrel/ShipIt-main.m +++ b/Squirrel/ShipIt-main.m @@ -13,6 +13,9 @@ @@ -41,7 +41,7 @@ index db246534e176f9c3ea2dd8b1c8659378fdc2435d..2c515ffdd67052a08ee8155c0e46b57e // The maximum number of times ShipIt should run the same installation state, in // an attempt to update. // -@@ -136,11 +153,37 @@ static void installRequest(RACSignal *readRequestSignal, NSString *applicationId +@@ -136,11 +153,35 @@ static void installRequest(RACSignal *readRequestSignal, NSString *applicationId NSString *exe = NSProcessInfo.processInfo.arguments[0]; NSLog(@"Launching new ShipIt at %@ with instructions to launch %@", exe, bundleURL); @@ -53,11 +53,9 @@ index db246534e176f9c3ea2dd8b1c8659378fdc2435d..2c515ffdd67052a08ee8155c0e46b57e + posix_spawnattr_t attr; + CHECK_ERR(posix_spawnattr_init(&attr)); + -+ if (@available(macOS 10.14, *)) { -+ // Disclaim TCC responsibilities -+ if (responsibility_spawnattrs_setdisclaim) -+ CHECK_ERR(responsibility_spawnattrs_setdisclaim(&attr, 1)); -+ } ++ // Disclaim TCC responsibilities ++ if (responsibility_spawnattrs_setdisclaim) ++ CHECK_ERR(responsibility_spawnattrs_setdisclaim(&attr, 1)); + + pid_t pid = 0; + @@ -84,7 +82,7 @@ index db246534e176f9c3ea2dd8b1c8659378fdc2435d..2c515ffdd67052a08ee8155c0e46b57e NSLog(@"New ShipIt exited"); } else { -@@ -172,7 +215,13 @@ int main(int argc, const char * argv[]) { +@@ -172,7 +213,13 @@ int main(int argc, const char * argv[]) { }); if (argc < 3) { diff --git a/patches/v8/build_gn.patch b/patches/v8/build_gn.patch index 32c9dd9385d9..a4d1e0592c69 100644 --- a/patches/v8/build_gn.patch +++ b/patches/v8/build_gn.patch @@ -9,10 +9,10 @@ necessary for native modules to load. Also change visibility on mksnapshot in order to target mksnapshot for mksnapshot zip. diff --git a/BUILD.gn b/BUILD.gn -index c13cf053a80d212b836a9be3ec6e76b11627a19d..ca07c3ef538388f3efa982abf526e763c8b66cab 100644 +index d0194c7215176cf00a69bfeca826e08b386223d2..c9484114c5d359d0a783572eb80278615528a92e 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -715,7 +715,7 @@ config("internal_config") { +@@ -729,7 +729,7 @@ config("internal_config") { ":cppgc_header_features", ] @@ -21,7 +21,7 @@ index c13cf053a80d212b836a9be3ec6e76b11627a19d..ca07c3ef538388f3efa982abf526e763 defines += [ "BUILDING_V8_SHARED" ] } -@@ -6546,7 +6546,7 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6620,7 +6620,7 @@ if (current_toolchain == v8_generator_toolchain) { "src/interpreter/bytecodes.h", ] @@ -30,7 +30,7 @@ index c13cf053a80d212b836a9be3ec6e76b11627a19d..ca07c3ef538388f3efa982abf526e763 deps = [ ":v8_libbase", -@@ -6558,7 +6558,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6632,7 +6632,6 @@ if (current_toolchain == v8_generator_toolchain) { if (current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { 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 87618e6e6e78..3ce7e2598c97 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 ca07c3ef538388f3efa982abf526e763c8b66cab..80987309d40bd6ec564b9644a66068eb3e5755a8 100644 +index c9484114c5d359d0a783572eb80278615528a92e..4f10220aa95caee26e09d6a483a2239036e5c1bb 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -715,6 +715,10 @@ config("internal_config") { +@@ -729,6 +729,10 @@ config("internal_config") { ":cppgc_header_features", ] diff --git a/shell/browser/api/electron_api_global_shortcut.cc b/shell/browser/api/electron_api_global_shortcut.cc index 7e4f544c777e..278cad9529b8 100644 --- a/shell/browser/api/electron_api_global_shortcut.cc +++ b/shell/browser/api/electron_api_global_shortcut.cc @@ -29,14 +29,8 @@ namespace { #if BUILDFLAG(IS_MAC) bool RegisteringMediaKeyForUntrustedClient(const ui::Accelerator& accelerator) { - if (base::mac::IsAtLeastOS10_14()) { - if (Command::IsMediaKey(accelerator)) { - if (!electron::api::SystemPreferences::IsTrustedAccessibilityClient( - false)) - return true; - } - } - return false; + return Command::IsMediaKey(accelerator) && + !electron::api::SystemPreferences::IsTrustedAccessibilityClient(false); } bool MapHasMediaKeys( diff --git a/shell/browser/api/electron_api_in_app_purchase.cc b/shell/browser/api/electron_api_in_app_purchase.cc index 376e818a481c..52561740457f 100644 --- a/shell/browser/api/electron_api_in_app_purchase.cc +++ b/shell/browser/api/electron_api_in_app_purchase.cc @@ -109,8 +109,6 @@ struct Converter { dict.Set("productIdentifier", val.productIdentifier); dict.Set("localizedDescription", val.localizedDescription); dict.Set("localizedTitle", val.localizedTitle); - dict.Set("contentVersion", val.contentVersion); - dict.Set("contentLengths", val.contentLengths); // Pricing Information dict.Set("price", val.price); diff --git a/shell/browser/api/electron_api_native_theme_mac.mm b/shell/browser/api/electron_api_native_theme_mac.mm index 27ce389d2d6f..ec409e5df5ae 100644 --- a/shell/browser/api/electron_api_native_theme_mac.mm +++ b/shell/browser/api/electron_api_native_theme_mac.mm @@ -10,23 +10,20 @@ namespace electron::api { void NativeTheme::UpdateMacOSAppearanceForOverrideValue( ui::NativeTheme::ThemeSource override) { - if (@available(macOS 10.14, *)) { - NSAppearance* new_appearance; - switch (override) { - case ui::NativeTheme::ThemeSource::kForcedDark: - new_appearance = - [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]; - break; - case ui::NativeTheme::ThemeSource::kForcedLight: - new_appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua]; - break; - case ui::NativeTheme::ThemeSource::kSystem: - default: - new_appearance = nil; - break; - } - [[NSApplication sharedApplication] setAppearance:new_appearance]; + NSAppearance* new_appearance; + switch (override) { + case ui::NativeTheme::ThemeSource::kForcedDark: + new_appearance = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]; + break; + case ui::NativeTheme::ThemeSource::kForcedLight: + new_appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua]; + break; + case ui::NativeTheme::ThemeSource::kSystem: + default: + new_appearance = nil; + break; } + [[NSApplication sharedApplication] setAppearance:new_appearance]; } } // namespace electron::api diff --git a/shell/browser/api/electron_api_system_preferences_mac.mm b/shell/browser/api/electron_api_system_preferences_mac.mm index a048200a196f..6569d2379619 100644 --- a/shell/browser/api/electron_api_system_preferences_mac.mm +++ b/shell/browser/api/electron_api_system_preferences_mac.mm @@ -51,11 +51,7 @@ struct Converter { *out = [NSAppearance appearanceNamed:NSAppearanceNameAqua]; return true; } else if (name == "dark") { - if (@available(macOS 10.14, *)) { - *out = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]; - } else { - *out = [NSAppearance appearanceNamed:NSAppearanceNameAqua]; - } + *out = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]; return true; } @@ -63,17 +59,13 @@ struct Converter { } static v8::Local ToV8(v8::Isolate* isolate, NSAppearance* val) { - if (val == nil) { + if (val == nil) return v8::Null(isolate); - } if ([val.name isEqualToString:NSAppearanceNameAqua]) { return gin::ConvertToV8(isolate, "light"); - } - if (@available(macOS 10.14, *)) { - if ([val.name isEqualToString:NSAppearanceNameDarkAqua]) { - return gin::ConvertToV8(isolate, "dark"); - } + } else if ([val.name isEqualToString:NSAppearanceNameDarkAqua]) { + return gin::ConvertToV8(isolate, "dark"); } return gin::ConvertToV8(isolate, "unknown"); @@ -382,10 +374,7 @@ void SystemPreferences::SetUserDefault(const std::string& name, } std::string SystemPreferences::GetAccentColor() { - NSColor* sysColor = nil; - if (@available(macOS 10.14, *)) - sysColor = [NSColor controlAccentColor]; - + NSColor* sysColor = sysColor = [NSColor controlAccentColor]; return ToRGBAHex(skia::NSSystemColorToSkColor(sysColor), false /* include_hash */); } @@ -421,14 +410,10 @@ std::string SystemPreferences::GetSystemColor(gin_helper::ErrorThrower thrower, bool SystemPreferences::CanPromptTouchID() { base::scoped_nsobject context([[LAContext alloc] init]); - LAPolicy auth_policy = LAPolicyDeviceOwnerAuthenticationWithBiometrics; - if (@available(macOS 10.15, *)) - auth_policy = LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch; + LAPolicy auth_policy = LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch; if (![context canEvaluatePolicy:auth_policy error:nil]) return false; - if (@available(macOS 10.13.2, *)) - return [context biometryType] == LABiometryTypeTouchID; - return true; + return [context biometryType] == LABiometryTypeTouchID; } v8::Local SystemPreferences::PromptTouchID( @@ -501,8 +486,7 @@ std::string SystemPreferences::GetColor(gin_helper::ErrorThrower thrower, } else if (color == "disabled-control-text") { sysColor = [NSColor disabledControlTextColor]; } else if (color == "find-highlight") { - if (@available(macOS 10.14, *)) - sysColor = [NSColor findHighlightColor]; + sysColor = [NSColor findHighlightColor]; } else if (color == "grid") { sysColor = [NSColor gridColor]; } else if (color == "header-text") { @@ -524,8 +508,7 @@ std::string SystemPreferences::GetColor(gin_helper::ErrorThrower thrower, } else if (color == "secondary-label") { sysColor = [NSColor secondaryLabelColor]; } else if (color == "selected-content-background") { - if (@available(macOS 10.14, *)) - sysColor = [NSColor selectedContentBackgroundColor]; + sysColor = [NSColor selectedContentBackgroundColor]; } else if (color == "selected-control") { sysColor = [NSColor selectedControlColor]; } else if (color == "selected-control-text") { @@ -537,8 +520,7 @@ std::string SystemPreferences::GetColor(gin_helper::ErrorThrower thrower, } else if (color == "selected-text") { sysColor = [NSColor selectedTextColor]; } else if (color == "separator") { - if (@available(macOS 10.14, *)) - sysColor = [NSColor separatorColor]; + sysColor = [NSColor separatorColor]; } else if (color == "shadow") { sysColor = [NSColor shadowColor]; } else if (color == "tertiary-label") { @@ -550,14 +532,11 @@ std::string SystemPreferences::GetColor(gin_helper::ErrorThrower thrower, } else if (color == "under-page-background") { sysColor = [NSColor underPageBackgroundColor]; } else if (color == "unemphasized-selected-content-background") { - if (@available(macOS 10.14, *)) - sysColor = [NSColor unemphasizedSelectedContentBackgroundColor]; + sysColor = [NSColor unemphasizedSelectedContentBackgroundColor]; } else if (color == "unemphasized-selected-text-background") { - if (@available(macOS 10.14, *)) - sysColor = [NSColor unemphasizedSelectedTextBackgroundColor]; + sysColor = [NSColor unemphasizedSelectedTextBackgroundColor]; } else if (color == "unemphasized-selected-text") { - if (@available(macOS 10.14, *)) - sysColor = [NSColor unemphasizedSelectedTextColor]; + sysColor = [NSColor unemphasizedSelectedTextColor]; } else if (color == "window-background") { sysColor = [NSColor windowBackgroundColor]; } else if (color == "window-frame-text") { @@ -596,18 +575,13 @@ v8::Local SystemPreferences::AskForMediaAccess( v8::Local handle = promise.GetHandle(); if (auto type = ParseMediaType(media_type)) { - if (@available(macOS 10.14, *)) { - __block gin_helper::Promise p = std::move(promise); - [AVCaptureDevice requestAccessForMediaType:type - completionHandler:^(BOOL granted) { - dispatch_async(dispatch_get_main_queue(), ^{ - p.Resolve(!!granted); - }); - }]; - } else { - // access always allowed pre-10.14 Mojave - promise.Resolve(true); - } + __block gin_helper::Promise p = std::move(promise); + [AVCaptureDevice requestAccessForMediaType:type + completionHandler:^(BOOL granted) { + dispatch_async(dispatch_get_main_queue(), ^{ + p.Resolve(!!granted); + }); + }]; } else { promise.RejectWithErrorMessage("Invalid media type"); } @@ -626,30 +600,22 @@ bool SystemPreferences::IsSwipeTrackingFromScrollEventsEnabled() { v8::Local SystemPreferences::GetEffectiveAppearance( v8::Isolate* isolate) { - if (@available(macOS 10.14, *)) { - return gin::ConvertToV8( - isolate, [NSApplication sharedApplication].effectiveAppearance); - } - return v8::Null(isolate); + return gin::ConvertToV8( + isolate, [NSApplication sharedApplication].effectiveAppearance); } v8::Local SystemPreferences::GetAppLevelAppearance( v8::Isolate* isolate) { - if (@available(macOS 10.14, *)) { - return gin::ConvertToV8(isolate, - [NSApplication sharedApplication].appearance); - } - return v8::Null(isolate); + return gin::ConvertToV8(isolate, + [NSApplication sharedApplication].appearance); } void SystemPreferences::SetAppLevelAppearance(gin::Arguments* args) { - if (@available(macOS 10.14, *)) { - NSAppearance* appearance; - if (args->GetNext(&appearance)) { - [[NSApplication sharedApplication] setAppearance:appearance]; - } else { - args->ThrowError(); - } + NSAppearance* appearance; + if (args->GetNext(&appearance)) { + [[NSApplication sharedApplication] setAppearance:appearance]; + } else { + args->ThrowError(); } } diff --git a/shell/browser/api/electron_api_url_loader.h b/shell/browser/api/electron_api_url_loader.h index 5f92df34564c..f4ca61bb1036 100644 --- a/shell/browser/api/electron_api_url_loader.h +++ b/shell/browser/api/electron_api_url_loader.h @@ -90,6 +90,12 @@ class SimpleURLLoaderWrapper const scoped_refptr& cert_info, mojo::PendingRemote client_cert_responder) override {} + void OnPrivateNetworkAccessPermissionRequired( + const GURL& url, + const net::IPAddress& ip_address, + const std::string& private_network_device_id, + const std::string& private_network_device_name, + OnPrivateNetworkAccessPermissionRequiredCallback callback) override {} void OnClearSiteData( const GURL& url, const std::string& header_value, diff --git a/shell/browser/browser_mac.mm b/shell/browser/browser_mac.mm index d5a39991047c..125ab9807a24 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -179,7 +179,11 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol, NSString* protocol_ns = [NSString stringWithUTF8String:protocol.c_str()]; CFStringRef protocol_cf = base::mac::NSToCFCast(protocol_ns); +// TODO(codebytere): Use -[NSWorkspace URLForApplicationToOpenURL:] instead +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" CFArrayRef bundleList = LSCopyAllHandlersForURLScheme(protocol_cf); +#pragma clang diagnostic pop if (!bundleList) { return false; } @@ -229,9 +233,12 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol, NSString* protocol_ns = [NSString stringWithUTF8String:protocol.c_str()]; +// TODO(codebytere): Use -[NSWorkspace URLForApplicationToOpenURL:] instead +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" base::ScopedCFTypeRef bundleId( LSCopyDefaultHandlerForURLScheme(base::mac::NSToCFCast(protocol_ns))); - +#pragma clang diagnostic pop if (!bundleId) return false; diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 7e701ee8a205..dd750f64262d 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -759,12 +759,17 @@ bool ElectronBrowserClient::ShouldUseProcessPerSite( #endif } -bool ElectronBrowserClient::ArePersistentMediaDeviceIDsAllowed( - content::BrowserContext* browser_context, - const GURL& scope, +void ElectronBrowserClient::GetMediaDeviceIDSalt( + content::RenderFrameHost* rfh, const net::SiteForCookies& site_for_cookies, - const absl::optional& top_frame_origin) { - return true; + const blink::StorageKey& storage_key, + base::OnceCallback callback) { + constexpr bool persistent_media_device_id_allowed = true; + std::string persistent_media_device_id_salt = + static_cast(rfh->GetBrowserContext()) + ->GetMediaDeviceIDSalt(); + std::move(callback).Run(persistent_media_device_id_allowed, + persistent_media_device_id_salt); } base::FilePath ElectronBrowserClient::GetLoggingFileName( diff --git a/shell/browser/electron_browser_client.h b/shell/browser/electron_browser_client.h index adaa1b4535ed..f508dd94deed 100644 --- a/shell/browser/electron_browser_client.h +++ b/shell/browser/electron_browser_client.h @@ -287,11 +287,11 @@ class ElectronBrowserClient : public content::ContentBrowserClient, const GURL& site_url) override; bool ShouldUseProcessPerSite(content::BrowserContext* browser_context, const GURL& effective_url) override; - bool ArePersistentMediaDeviceIDsAllowed( - content::BrowserContext* browser_context, - const GURL& scope, + void GetMediaDeviceIDSalt( + content::RenderFrameHost* rfh, const net::SiteForCookies& site_for_cookies, - const absl::optional& top_frame_origin) override; + const blink::StorageKey& storage_key, + base::OnceCallback callback) override; base::FilePath GetLoggingFileName(const base::CommandLine& cmd_line) override; // content::RenderProcessHostObserver: diff --git a/shell/browser/electron_browser_context.h b/shell/browser/electron_browser_context.h index 7ab732c7a0d6..a758d72fedc1 100644 --- a/shell/browser/electron_browser_context.h +++ b/shell/browser/electron_browser_context.h @@ -140,6 +140,8 @@ class ElectronBrowserContext : public content::BrowserContext { predictors::PreconnectManager* GetPreconnectManager(); scoped_refptr GetURLLoaderFactory(); + std::string GetMediaDeviceIDSalt(); + // content::BrowserContext: base::FilePath GetPath() override; bool IsOffTheRecord() override; @@ -152,7 +154,6 @@ class ElectronBrowserContext : public content::BrowserContext { content::BackgroundSyncController* GetBackgroundSyncController() override; content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate() override; - std::string GetMediaDeviceIDSalt() override; content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; content::BrowserPluginGuestManager* GetGuestManager() override; content::PlatformNotificationService* GetPlatformNotificationService() diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index af31c6eff253..8795668266a1 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -67,6 +67,7 @@ #include "ui/base/idle/idle.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/ui_base_switches.h" +#include "ui/color/color_provider_manager.h" #if defined(USE_AURA) #include "ui/display/display.h" 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 b4a8f1be0fed..62757d66605b 100644 --- a/shell/browser/extensions/api/management/electron_management_api_delegate.cc +++ b/shell/browser/extensions/api/management/electron_management_api_delegate.cc @@ -164,23 +164,6 @@ void ElectronManagementAPIDelegate::InstallOrLaunchReplacementWebApp( // TODO(sentialx) } -bool ElectronManagementAPIDelegate::CanContextInstallAndroidApps( - content::BrowserContext* context) const { - return false; -} - -void ElectronManagementAPIDelegate::CheckAndroidAppInstallStatus( - const std::string& package_name, - AndroidAppInstallStatusCallback callback) const { - std::move(callback).Run(false); -} - -void ElectronManagementAPIDelegate::InstallReplacementAndroidApp( - const std::string& package_name, - InstallAndroidAppCallback callback) const { - std::move(callback).Run(false); -} - void ElectronManagementAPIDelegate::EnableExtension( content::BrowserContext* context, const std::string& extension_id) const { 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 7e82d6fa4d18..162255cee3c6 100644 --- a/shell/browser/extensions/api/management/electron_management_api_delegate.h +++ b/shell/browser/extensions/api/management/electron_management_api_delegate.h @@ -54,15 +54,6 @@ class ElectronManagementAPIDelegate : public extensions::ManagementAPIDelegate { const GURL& web_app_url, ManagementAPIDelegate::InstallOrLaunchWebAppCallback callback) const override; - bool CanContextInstallAndroidApps( - content::BrowserContext* context) const override; - void CheckAndroidAppInstallStatus( - const std::string& package_name, - ManagementAPIDelegate::AndroidAppInstallStatusCallback callback) - const override; - void InstallReplacementAndroidApp( - const std::string& package_name, - ManagementAPIDelegate::InstallAndroidAppCallback callback) const override; void EnableExtension(content::BrowserContext* context, const std::string& extension_id) const override; void DisableExtension( diff --git a/shell/browser/mac/electron_application_delegate.mm b/shell/browser/mac/electron_application_delegate.mm index 875ca3f728be..7bbdfd36d6a1 100644 --- a/shell/browser/mac/electron_application_delegate.mm +++ b/shell/browser/mac/electron_application_delegate.mm @@ -24,7 +24,7 @@ #endif static NSDictionary* UNNotificationResponseToNSDictionary( - UNNotificationResponse* response) API_AVAILABLE(macosx(10.14)) { + UNNotificationResponse* response) { if (![response respondsToSelector:@selector(actionIdentifier)] || ![response respondsToSelector:@selector(notification)]) { return nil; @@ -82,7 +82,7 @@ static NSDictionary* UNNotificationResponseToNSDictionary( if ([user_notification isKindOfClass:[NSUserNotification class]]) { notification_info = [static_cast(user_notification) userInfo]; - } else if (@available(macOS 10.14, *)) { + } else { notification_info = UNNotificationResponseToNSDictionary( static_cast(user_notification)); } diff --git a/shell/browser/mac/in_app_purchase_observer.mm b/shell/browser/mac/in_app_purchase_observer.mm index 066cd4a81542..b7eb63631367 100644 --- a/shell/browser/mac/in_app_purchase_observer.mm +++ b/shell/browser/mac/in_app_purchase_observer.mm @@ -99,7 +99,7 @@ using InAppTransactionCallback = base::RepeatingCallback contentLengths; // Pricing Information double price = 0.0; diff --git a/shell/browser/mac/in_app_purchase_product.mm b/shell/browser/mac/in_app_purchase_product.mm index 6e261505d2d1..862716827922 100644 --- a/shell/browser/mac/in_app_purchase_product.mm +++ b/shell/browser/mac/in_app_purchase_product.mm @@ -114,8 +114,7 @@ */ - (in_app_purchase::ProductSubscriptionPeriod) skProductSubscriptionPeriodToStruct: - (SKProductSubscriptionPeriod*)productSubscriptionPeriod - API_AVAILABLE(macosx(10.13.2)) { + (SKProductSubscriptionPeriod*)productSubscriptionPeriod { in_app_purchase::ProductSubscriptionPeriod productSubscriptionPeriodStruct; productSubscriptionPeriodStruct.numberOfUnits = @@ -140,7 +139,7 @@ * @param productDiscount - The SKProductDiscount object to convert. */ - (in_app_purchase::ProductDiscount)skProductDiscountToStruct: - (SKProductDiscount*)productDiscount API_AVAILABLE(macosx(10.13.2)) { + (SKProductDiscount*)productDiscount { in_app_purchase::ProductDiscount productDiscountStruct; if (productDiscount.paymentMode == SKProductDiscountPaymentModePayAsYouGo) { @@ -166,14 +165,11 @@ skProductSubscriptionPeriodToStruct:productDiscount.subscriptionPeriod]; } - if (@available(macOS 10.14.4, *)) { - productDiscountStruct.type = (int)productDiscount.type; - if (productDiscount.identifier != nil) { - productDiscountStruct.identifier = - [productDiscount.identifier UTF8String]; - } - productDiscountStruct.price = [productDiscount.price doubleValue]; + productDiscountStruct.type = (int)productDiscount.type; + if (productDiscount.identifier != nil) { + productDiscountStruct.identifier = [productDiscount.identifier UTF8String]; } + productDiscountStruct.price = [productDiscount.price doubleValue]; return productDiscountStruct; } @@ -199,16 +195,6 @@ if (product.localizedTitle != nil) { productStruct.localizedTitle = [product.localizedTitle UTF8String]; } - if (product.contentVersion != nil) { - productStruct.contentVersion = [product.contentVersion UTF8String]; - } - if (product.contentLengths != nil) { - productStruct.contentLengths.reserve([product.contentLengths count]); - - for (NSNumber* contentLength in product.contentLengths) { - productStruct.contentLengths.push_back([contentLength longLongValue]); - } - } // Pricing Information if (product.price != nil) { @@ -226,62 +212,45 @@ } } } - if (@available(macOS 10.13.2, *)) { - if (product.introductoryPrice != nil) { - productStruct.introductoryPrice = - [self skProductDiscountToStruct:product.introductoryPrice]; - } - if (product.subscriptionPeriod != nil) { - productStruct.subscriptionPeriod = - [self skProductSubscriptionPeriodToStruct:product.subscriptionPeriod]; - } - } - if (@available(macOS 10.14, *)) { - if (product.subscriptionGroupIdentifier != nil) { - productStruct.subscriptionGroupIdentifier = - [product.subscriptionGroupIdentifier UTF8String]; - } - } - if (@available(macOS 10.14.4, *)) { - if (product.discounts != nil) { - productStruct.discounts.reserve([product.discounts count]); - for (SKProductDiscount* discount in product.discounts) { - productStruct.discounts.push_back( - [self skProductDiscountToStruct:discount]); - } + if (product.introductoryPrice != nil) { + productStruct.introductoryPrice = + [self skProductDiscountToStruct:product.introductoryPrice]; + } + if (product.subscriptionPeriod != nil) { + productStruct.subscriptionPeriod = + [self skProductSubscriptionPeriodToStruct:product.subscriptionPeriod]; + } + + if (product.subscriptionGroupIdentifier != nil) { + productStruct.subscriptionGroupIdentifier = + [product.subscriptionGroupIdentifier UTF8String]; + } + + if (product.discounts != nil) { + productStruct.discounts.reserve([product.discounts count]); + + for (SKProductDiscount* discount in product.discounts) { + productStruct.discounts.push_back( + [self skProductDiscountToStruct:discount]); } } // Downloadable Content Information - productStruct.isDownloadable = [product downloadable]; - if (@available(macOS 10.14, *)) { - if (product.downloadContentVersion != nil) { - productStruct.downloadContentVersion = - [product.downloadContentVersion UTF8String]; - } - if (product.downloadContentLengths != nil) { - productStruct.downloadContentLengths.reserve( - [product.downloadContentLengths count]); + productStruct.isDownloadable = [product isDownloadable]; - for (NSNumber* contentLength in product.downloadContentLengths) { - productStruct.downloadContentLengths.push_back( - [contentLength longLongValue]); - } - } - } else { - if (product.contentVersion != nil) { - productStruct.downloadContentVersion = - [product.contentVersion UTF8String]; - } - if (product.contentLengths != nil) { - productStruct.downloadContentLengths.reserve( - [product.contentLengths count]); + if (product.downloadContentVersion != nil) { + productStruct.downloadContentVersion = + [product.downloadContentVersion UTF8String]; + } - for (NSNumber* contentLength in product.contentLengths) { - productStruct.downloadContentLengths.push_back( - [contentLength longLongValue]); - } + if (product.downloadContentLengths != nil) { + productStruct.downloadContentLengths.reserve( + [product.downloadContentLengths count]); + + for (NSNumber* contentLength in product.downloadContentLengths) { + productStruct.downloadContentLengths.push_back( + [contentLength longLongValue]); } } diff --git a/shell/browser/media/media_device_id_salt.cc b/shell/browser/media/media_device_id_salt.cc index d7602a852fe5..46f6e6502e24 100644 --- a/shell/browser/media/media_device_id_salt.cc +++ b/shell/browser/media/media_device_id_salt.cc @@ -4,6 +4,7 @@ #include "shell/browser/media/media_device_id_salt.h" +#include "base/unguessable_token.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_context.h" @@ -24,8 +25,7 @@ MediaDeviceIDSalt::MediaDeviceIDSalt(PrefService* pref_service) { media_device_id_salt_.Init(kMediaDeviceIdSalt, pref_service); if (media_device_id_salt_.GetValue().empty()) { - media_device_id_salt_.SetValue( - content::BrowserContext::CreateRandomMediaDeviceIDSalt()); + media_device_id_salt_.SetValue(base::UnguessableToken::Create().ToString()); } } @@ -46,9 +46,8 @@ void MediaDeviceIDSalt::RegisterPrefs(PrefRegistrySimple* registry) { // static void MediaDeviceIDSalt::Reset(PrefService* pref_service) { - pref_service->SetString( - kMediaDeviceIdSalt, - content::BrowserContext::CreateRandomMediaDeviceIDSalt()); + pref_service->SetString(kMediaDeviceIdSalt, + base::UnguessableToken::Create().ToString()); } } // namespace electron diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 5dc6bf0db7e3..774b8482f92d 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -58,7 +58,7 @@ @implementation ElectronProgressBar - (void)drawRect:(NSRect)dirtyRect { - if (self.style != NSProgressIndicatorBarStyle) + if (self.style != NSProgressIndicatorStyleBar) return; // Draw edges of rounded rect. NSRect rect = NSInsetRect([self bounds], 1.0, 1.0); @@ -915,7 +915,6 @@ void NativeWindowMac::Center() { } void NativeWindowMac::Invalidate() { - [window_ flushWindow]; [[window_ contentView] setNeedsDisplay:YES]; } @@ -1289,7 +1288,7 @@ void NativeWindowMac::SetProgressBar(double progress, NSRect frame = NSMakeRect(0.0f, 0.0f, dock_tile.size.width, 15.0); NSProgressIndicator* progress_indicator = [[[ElectronProgressBar alloc] initWithFrame:frame] autorelease]; - [progress_indicator setStyle:NSProgressIndicatorBarStyle]; + [progress_indicator setStyle:NSProgressIndicatorStyleBar]; [progress_indicator setIndeterminate:NO]; [progress_indicator setBezeled:YES]; [progress_indicator setMinValue:0]; @@ -1400,26 +1399,10 @@ void NativeWindowMac::SetVibrancy(const std::string& type) { return; } - std::string dep_warn = " has been deprecated and removed as of macOS 10.15."; - node::Environment* env = - node::Environment::GetCurrent(JavascriptEnvironment::GetIsolate()); - NSVisualEffectMaterial vibrancyType{}; - if (type == "appearance-based") { - EmitWarning(env, "NSVisualEffectMaterialAppearanceBased" + dep_warn, - "electron"); - vibrancyType = NSVisualEffectMaterialAppearanceBased; - } else if (type == "light") { - EmitWarning(env, "NSVisualEffectMaterialLight" + dep_warn, "electron"); - vibrancyType = NSVisualEffectMaterialLight; - } else if (type == "dark") { - EmitWarning(env, "NSVisualEffectMaterialDark" + dep_warn, "electron"); - vibrancyType = NSVisualEffectMaterialDark; - } else if (type == "titlebar") { + if (type == "titlebar") { vibrancyType = NSVisualEffectMaterialTitlebar; - } - - if (type == "selection") { + } else if (type == "selection") { vibrancyType = NSVisualEffectMaterialSelection; } else if (type == "menu") { vibrancyType = NSVisualEffectMaterialMenu; @@ -1427,35 +1410,24 @@ void NativeWindowMac::SetVibrancy(const std::string& type) { vibrancyType = NSVisualEffectMaterialPopover; } else if (type == "sidebar") { vibrancyType = NSVisualEffectMaterialSidebar; - } else if (type == "medium-light") { - EmitWarning(env, "NSVisualEffectMaterialMediumLight" + dep_warn, - "electron"); - vibrancyType = NSVisualEffectMaterialMediumLight; - } else if (type == "ultra-dark") { - EmitWarning(env, "NSVisualEffectMaterialUltraDark" + dep_warn, "electron"); - vibrancyType = NSVisualEffectMaterialUltraDark; - } - - if (@available(macOS 10.14, *)) { - if (type == "header") { - vibrancyType = NSVisualEffectMaterialHeaderView; - } else if (type == "sheet") { - vibrancyType = NSVisualEffectMaterialSheet; - } else if (type == "window") { - vibrancyType = NSVisualEffectMaterialWindowBackground; - } else if (type == "hud") { - vibrancyType = NSVisualEffectMaterialHUDWindow; - } else if (type == "fullscreen-ui") { - vibrancyType = NSVisualEffectMaterialFullScreenUI; - } else if (type == "tooltip") { - vibrancyType = NSVisualEffectMaterialToolTip; - } else if (type == "content") { - vibrancyType = NSVisualEffectMaterialContentBackground; - } else if (type == "under-window") { - vibrancyType = NSVisualEffectMaterialUnderWindowBackground; - } else if (type == "under-page") { - vibrancyType = NSVisualEffectMaterialUnderPageBackground; - } + } else if (type == "header") { + vibrancyType = NSVisualEffectMaterialHeaderView; + } else if (type == "sheet") { + vibrancyType = NSVisualEffectMaterialSheet; + } else if (type == "window") { + vibrancyType = NSVisualEffectMaterialWindowBackground; + } else if (type == "hud") { + vibrancyType = NSVisualEffectMaterialHUDWindow; + } else if (type == "fullscreen-ui") { + vibrancyType = NSVisualEffectMaterialFullScreenUI; + } else if (type == "tooltip") { + vibrancyType = NSVisualEffectMaterialToolTip; + } else if (type == "content") { + vibrancyType = NSVisualEffectMaterialContentBackground; + } else if (type == "under-window") { + vibrancyType = NSVisualEffectMaterialUnderWindowBackground; + } else if (type == "under-page") { + vibrancyType = NSVisualEffectMaterialUnderPageBackground; } if (vibrancyType) { diff --git a/shell/browser/net/network_context_service.cc b/shell/browser/net/network_context_service.cc index 176f28aa688d..8c6d4a13630d 100644 --- a/shell/browser/net/network_context_service.cc +++ b/shell/browser/net/network_context_service.cc @@ -80,8 +80,6 @@ void NetworkContextService::ConfigureNetworkContextParams( // Configure on-disk storage for persistent sessions. if (!in_memory) { // Configure the HTTP cache path and size. - network_context_params->http_cache_directory = - path.Append(chrome::kCacheDirname); network_context_params->http_cache_max_size = browser_context_->GetMaxCacheSize(); @@ -92,6 +90,8 @@ void NetworkContextService::ConfigureNetworkContextParams( network_context_params->file_paths->unsandboxed_data_path = path; network_context_params->file_paths->trigger_migration = ShouldTriggerNetworkDataMigration(); + network_context_params->file_paths->http_cache_directory = + path.Append(chrome::kCacheDirname); // Currently this just contains HttpServerProperties network_context_params->file_paths->http_server_properties_file_name = diff --git a/shell/browser/ui/cocoa/electron_menu_controller.mm b/shell/browser/ui/cocoa/electron_menu_controller.mm index 9d5945521d0d..d7ceb05fd19b 100644 --- a/shell/browser/ui/cocoa/electron_menu_controller.mm +++ b/shell/browser/ui/cocoa/electron_menu_controller.mm @@ -467,7 +467,8 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; BOOL checked = model->IsItemCheckedAt(modelIndex); DCHECK([(id)item isKindOfClass:[NSMenuItem class]]); - [(id)item setState:(checked ? NSOnState : NSOffState)]; + [(id)item + setState:(checked ? NSControlStateValueOn : NSControlStateValueOff)]; [(id)item setHidden:(!model->IsVisibleAt(modelIndex))]; return model->IsEnabledAt(modelIndex); diff --git a/shell/browser/ui/message_box_mac.mm b/shell/browser/ui/message_box_mac.mm index a874554e01cb..cc1b3ec4883e 100644 --- a/shell/browser/ui/message_box_mac.mm +++ b/shell/browser/ui/message_box_mac.mm @@ -92,8 +92,9 @@ NSAlert* CreateNSAlert(const MessageBoxSettings& settings) { alert.showsSuppressionButton = YES; alert.suppressionButton.title = base::SysUTF8ToNSString(settings.checkbox_label); - alert.suppressionButton.state = - settings.checkbox_checked ? NSOnState : NSOffState; + alert.suppressionButton.state = settings.checkbox_checked + ? NSControlStateValueOn + : NSControlStateValueOff; } if (!settings.icon.isNull()) { @@ -145,7 +146,8 @@ void ShowMessageBox(const MessageBoxSettings& settings, // window to wait for. if (!settings.parent_window) { int ret = [[alert autorelease] runModal]; - std::move(callback).Run(ret, alert.suppressionButton.state == NSOnState); + std::move(callback).Run( + ret, alert.suppressionButton.state == NSControlStateValueOn); } else { if (settings.id) { if (base::Contains(GetDialogsMap(), *settings.id)) @@ -172,7 +174,7 @@ void ShowMessageBox(const MessageBoxSettings& settings, // CloseMessageBox API, and we should return cancelId as result. if (response < 0) response = cancel_id; - bool suppressed = alert.suppressionButton.state == NSOnState; + bool suppressed = alert.suppressionButton.state == NSControlStateValueOn; [alert release]; // The completionHandler runs inside a transaction commit, and we should // not do any runModal inside it. However since we can not control what diff --git a/shell/browser/ui/tray_icon_cocoa.mm b/shell/browser/ui/tray_icon_cocoa.mm index db6d8cc0f3a6..19cb62a9a583 100644 --- a/shell/browser/ui/tray_icon_cocoa.mm +++ b/shell/browser/ui/tray_icon_cocoa.mm @@ -44,8 +44,11 @@ if ((self = [super initWithFrame:CGRectZero])) { [self registerForDraggedTypes:@[ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" NSFilenamesPboardType, - NSStringPboardType, +#pragma clang diagnostic pop + NSPasteboardTypeString, ]]; // Create the status item. @@ -123,16 +126,13 @@ // Change font type, if specified CGFloat existing_size = [[[statusItem_ button] font] pointSize]; if ([font_type isEqualToString:@"monospaced"]) { - if (@available(macOS 10.15, *)) { - NSDictionary* attributes = @{ - NSFontAttributeName : - [NSFont monospacedSystemFontOfSize:existing_size - weight:NSFontWeightRegular] - }; - [attributed_title - addAttributes:attributes - range:NSMakeRange(0, [attributed_title length])]; - } + NSDictionary* attributes = @{ + NSFontAttributeName : + [NSFont monospacedSystemFontOfSize:existing_size + weight:NSFontWeightRegular] + }; + [attributed_title addAttributes:attributes + range:NSMakeRange(0, [attributed_title length])]; } else if ([font_type isEqualToString:@"monospacedDigit"]) { NSDictionary* attributes = @{ NSFontAttributeName : @@ -292,6 +292,10 @@ - (BOOL)handleDrop:(id)sender { NSPasteboard* pboard = [sender draggingPasteboard]; +// TODO(codebytere): update to currently supported NSPasteboardTypeFileURL or +// kUTTypeFileURL. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" if ([[pboard types] containsObject:NSFilenamesPboardType]) { std::vector dropFiles; NSArray* files = [pboard propertyListForType:NSFilenamesPboardType]; @@ -299,12 +303,12 @@ dropFiles.push_back(base::SysNSStringToUTF8(file)); trayIcon_->NotifyDropFiles(dropFiles); return YES; - } else if ([[pboard types] containsObject:NSStringPboardType]) { - NSString* dropText = [pboard stringForType:NSStringPboardType]; + } else if ([[pboard types] containsObject:NSPasteboardTypeString]) { + NSString* dropText = [pboard stringForType:NSPasteboardTypeString]; trayIcon_->NotifyDropText(base::SysNSStringToUTF8(dropText)); return YES; } - +#pragma clang diagnostic pop return NO; } diff --git a/shell/browser/ui/views/win_caption_button.cc b/shell/browser/ui/views/win_caption_button.cc index 9d90fc6a6fd2..2875982e3c7a 100644 --- a/shell/browser/ui/views/win_caption_button.cc +++ b/shell/browser/ui/views/win_caption_button.cc @@ -120,7 +120,7 @@ int WinCaptionButton::GetBetweenButtonSpacing() const { const int display_order_index = GetButtonDisplayOrderIndex(); return display_order_index == 0 ? 0 - : WindowFrameUtil::kWindows10GlassCaptionButtonVisualSpacing; + : WindowFrameUtil::kWindowsCaptionButtonVisualSpacing; } int WinCaptionButton::GetButtonDisplayOrderIndex() const { diff --git a/shell/browser/ui/views/win_caption_button.h b/shell/browser/ui/views/win_caption_button.h index e3d2741912b1..4eef1d3078dd 100644 --- a/shell/browser/ui/views/win_caption_button.h +++ b/shell/browser/ui/views/win_caption_button.h @@ -63,8 +63,8 @@ class WinCaptionButton : public views::Button { std::unique_ptr icon_painter_; ViewID button_type_; - int base_width_ = WindowFrameUtil::kWindows10GlassCaptionButtonWidth; - int height_ = WindowFrameUtil::kWindows10GlassCaptionButtonHeightRestored; + int base_width_ = WindowFrameUtil::kWindowsCaptionButtonWidth; + int height_ = WindowFrameUtil::kWindowsCaptionButtonHeightRestored; }; } // namespace electron diff --git a/shell/browser/usb/electron_usb_delegate.cc b/shell/browser/usb/electron_usb_delegate.cc index 9baf621c660d..1f602b864125 100644 --- a/shell/browser/usb/electron_usb_delegate.cc +++ b/shell/browser/usb/electron_usb_delegate.cc @@ -159,13 +159,13 @@ void ElectronUsbDelegate::AdjustProtectedInterfaceClasses( std::unique_ptr ElectronUsbDelegate::RunChooser( content::RenderFrameHost& frame, - std::vector filters, + blink::mojom::WebUsbRequestDeviceOptionsPtr options, blink::mojom::WebUsbService::GetPermissionCallback callback) { UsbChooserController* controller = ControllerForFrame(&frame); if (controller) { DeleteControllerForFrame(&frame); } - AddControllerForFrame(&frame, std::move(filters), std::move(callback)); + AddControllerForFrame(&frame, std::move(options), std::move(callback)); // Return a nullptr because the return value isn't used for anything. The // return value is simply used in Chromium to cleanup the chooser UI once the // usb service is destroyed. @@ -269,12 +269,12 @@ UsbChooserController* ElectronUsbDelegate::ControllerForFrame( UsbChooserController* ElectronUsbDelegate::AddControllerForFrame( content::RenderFrameHost* render_frame_host, - std::vector filters, + blink::mojom::WebUsbRequestDeviceOptionsPtr options, blink::mojom::WebUsbService::GetPermissionCallback callback) { auto* web_contents = content::WebContents::FromRenderFrameHost(render_frame_host); auto controller = std::make_unique( - render_frame_host, std::move(filters), std::move(callback), web_contents, + render_frame_host, std::move(options), std::move(callback), web_contents, weak_factory_.GetWeakPtr()); controller_map_.insert( std::make_pair(render_frame_host, std::move(controller))); diff --git a/shell/browser/usb/electron_usb_delegate.h b/shell/browser/usb/electron_usb_delegate.h index 943921bfb70b..49c296f401fb 100644 --- a/shell/browser/usb/electron_usb_delegate.h +++ b/shell/browser/usb/electron_usb_delegate.h @@ -45,7 +45,7 @@ class ElectronUsbDelegate : public content::UsbDelegate { std::vector& classes) override; std::unique_ptr RunChooser( content::RenderFrameHost& frame, - std::vector filters, + blink::mojom::WebUsbRequestDeviceOptionsPtr options, blink::mojom::WebUsbService::GetPermissionCallback callback) override; bool CanRequestDevicePermission(content::BrowserContext* browser_context, const url::Origin& origin) override; @@ -83,7 +83,7 @@ class ElectronUsbDelegate : public content::UsbDelegate { UsbChooserController* AddControllerForFrame( content::RenderFrameHost* render_frame_host, - std::vector filters, + blink::mojom::WebUsbRequestDeviceOptionsPtr options, blink::mojom::WebUsbService::GetPermissionCallback callback); class ContextObservation; diff --git a/shell/browser/usb/usb_chooser_controller.cc b/shell/browser/usb/usb_chooser_controller.cc index ccee9919d8c0..ba6b28553b45 100644 --- a/shell/browser/usb/usb_chooser_controller.cc +++ b/shell/browser/usb/usb_chooser_controller.cc @@ -8,6 +8,7 @@ #include #include "base/functional/bind.h" +#include "base/ranges/algorithm.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" @@ -35,12 +36,12 @@ namespace electron { UsbChooserController::UsbChooserController( RenderFrameHost* render_frame_host, - std::vector device_filters, + blink::mojom::WebUsbRequestDeviceOptionsPtr options, blink::mojom::WebUsbService::GetPermissionCallback callback, content::WebContents* web_contents, base::WeakPtr usb_delegate) : WebContentsObserver(web_contents), - filters_(std::move(device_filters)), + options_(std::move(options)), callback_(std::move(callback)), origin_(render_frame_host->GetMainFrame()->GetLastCommittedOrigin()), usb_delegate_(usb_delegate), @@ -136,8 +137,16 @@ void UsbChooserController::GotUsbDeviceList( bool UsbChooserController::DisplayDevice( const device::mojom::UsbDeviceInfo& device_info) const { - if (!device::UsbDeviceFilterMatchesAny(filters_, device_info)) + if (!device::UsbDeviceFilterMatchesAny(options_->filters, device_info)) { return false; + } + + if (base::ranges::any_of( + options_->exclusion_filters, [&device_info](const auto& filter) { + return device::UsbDeviceFilterMatches(*filter, device_info); + })) { + return false; + } return true; } diff --git a/shell/browser/usb/usb_chooser_controller.h b/shell/browser/usb/usb_chooser_controller.h index 239e128816f5..f0219afc7159 100644 --- a/shell/browser/usb/usb_chooser_controller.h +++ b/shell/browser/usb/usb_chooser_controller.h @@ -32,7 +32,7 @@ class UsbChooserController final : public UsbChooserContext::DeviceObserver, public: UsbChooserController( content::RenderFrameHost* render_frame_host, - std::vector device_filters, + blink::mojom::WebUsbRequestDeviceOptionsPtr options, blink::mojom::WebUsbService::GetPermissionCallback callback, content::WebContents* web_contents, base::WeakPtr usb_delegate); @@ -58,7 +58,7 @@ class UsbChooserController final : public UsbChooserContext::DeviceObserver, void RunCallback(device::mojom::UsbDeviceInfoPtr device_info); void OnDeviceChosen(gin::Arguments* args); - std::vector filters_; + blink::mojom::WebUsbRequestDeviceOptionsPtr options_; blink::mojom::WebUsbService::GetPermissionCallback callback_; url::Origin origin_; diff --git a/shell/common/api/electron_api_native_image_mac.mm b/shell/common/api/electron_api_native_image_mac.mm index a6ba907a0992..29645d2ba5f0 100644 --- a/shell/common/api/electron_api_native_image_mac.mm +++ b/shell/common/api/electron_api_native_image_mac.mm @@ -29,7 +29,7 @@ NSData* bufferFromNSImage(NSImage* image) { CGImageRef ref = [image CGImageForProposedRect:nil context:nil hints:nil]; NSBitmapImageRep* rep = [[NSBitmapImageRep alloc] initWithCGImage:ref]; [rep setSize:[image size]]; - return [rep representationUsingType:NSPNGFileType + return [rep representationUsingType:NSBitmapImageFileTypePNG properties:[[NSDictionary alloc] init]]; } @@ -54,80 +54,51 @@ v8::Local NativeImage::CreateThumbnailFromPath( CGSize cg_size = size.ToCGSize(); - if (@available(macOS 10.15, *)) { - NSURL* nsurl = base::mac::FilePathToNSURL(path); + NSURL* nsurl = base::mac::FilePathToNSURL(path); - // We need to explicitly check if the user has passed an invalid path - // because QLThumbnailGenerationRequest will generate a stock file icon - // and pass silently if we do not. - if (![[NSFileManager defaultManager] fileExistsAtPath:[nsurl path]]) { - promise.RejectWithErrorMessage( - "unable to retrieve thumbnail preview image for the given path"); - return handle; - } - - NSScreen* screen = [[NSScreen screens] firstObject]; - base::scoped_nsobject request( - [[QLThumbnailGenerationRequest alloc] - initWithFileAtURL:nsurl - size:cg_size - scale:[screen backingScaleFactor] - representationTypes: - QLThumbnailGenerationRequestRepresentationTypeAll]); - __block gin_helper::Promise p = std::move(promise); - [[QLThumbnailGenerator sharedGenerator] - generateBestRepresentationForRequest:request - completionHandler:^( - QLThumbnailRepresentation* thumbnail, - NSError* error) { - if (error || !thumbnail) { - std::string err_msg( - [error.localizedDescription UTF8String]); - dispatch_async(dispatch_get_main_queue(), ^{ - p.RejectWithErrorMessage( - "unable to retrieve thumbnail preview " - "image for the given path: " + - err_msg); - }); - } else { - NSImage* result = [[[NSImage alloc] - initWithCGImage:[thumbnail CGImage] - size:cg_size] autorelease]; - gfx::Image image(result); - dispatch_async(dispatch_get_main_queue(), ^{ - p.Resolve(image); - }); - } - }]; - } else { - base::ScopedCFTypeRef cfurl = base::mac::FilePathToCFURL(path); - base::ScopedCFTypeRef ql_thumbnail( - QLThumbnailCreate(kCFAllocatorDefault, cfurl, cg_size, NULL)); - __block gin_helper::Promise p = std::move(promise); - // Do not block the main thread waiting for quicklook to generate the - // thumbnail. - QLThumbnailDispatchAsync( - ql_thumbnail, - dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, /*flags*/ 0), ^{ - base::ScopedCFTypeRef cg_thumbnail( - QLThumbnailCopyImage(ql_thumbnail)); - if (cg_thumbnail) { - NSImage* result = - [[[NSImage alloc] initWithCGImage:cg_thumbnail - size:cg_size] autorelease]; - gfx::Image thumbnail(result); - dispatch_async(dispatch_get_main_queue(), ^{ - p.Resolve(thumbnail); - }); - } else { - dispatch_async(dispatch_get_main_queue(), ^{ - p.RejectWithErrorMessage("unable to retrieve thumbnail preview " - "image for the given path"); - }); - } - }); + // We need to explicitly check if the user has passed an invalid path + // because QLThumbnailGenerationRequest will generate a stock file icon + // and pass silently if we do not. + if (![[NSFileManager defaultManager] fileExistsAtPath:[nsurl path]]) { + promise.RejectWithErrorMessage( + "unable to retrieve thumbnail preview image for the given path"); + return handle; } + NSScreen* screen = [[NSScreen screens] firstObject]; + base::scoped_nsobject request( + [[QLThumbnailGenerationRequest alloc] + initWithFileAtURL:nsurl + size:cg_size + scale:[screen backingScaleFactor] + representationTypes: + QLThumbnailGenerationRequestRepresentationTypeAll]); + __block gin_helper::Promise p = std::move(promise); + [[QLThumbnailGenerator sharedGenerator] + generateBestRepresentationForRequest:request + completionHandler:^( + QLThumbnailRepresentation* thumbnail, + NSError* error) { + if (error || !thumbnail) { + std::string err_msg( + [error.localizedDescription UTF8String]); + dispatch_async(dispatch_get_main_queue(), ^{ + p.RejectWithErrorMessage( + "unable to retrieve thumbnail preview " + "image for the given path: " + + err_msg); + }); + } else { + NSImage* result = [[[NSImage alloc] + initWithCGImage:[thumbnail CGImage] + size:cg_size] autorelease]; + gfx::Image image(result); + dispatch_async(dispatch_get_main_queue(), ^{ + p.Resolve(image); + }); + } + }]; + return handle; } diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index 733d5e6272c9..de52ce8377cb 100644 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -2499,10 +2499,10 @@ describe('BrowserWindow module', () => { it('allows setting, changing, and removing the vibrancy', () => { const w = new BrowserWindow({ show: false }); expect(() => { - w.setVibrancy('light'); - w.setVibrancy('dark'); + w.setVibrancy('titlebar'); + w.setVibrancy('selection'); w.setVibrancy(null); - w.setVibrancy('ultra-dark'); + w.setVibrancy('menu'); w.setVibrancy('' as any); }).to.not.throw(); }); diff --git a/spec/api-native-theme-spec.ts b/spec/api-native-theme-spec.ts index 524a90581299..ec463839452e 100644 --- a/spec/api-native-theme-spec.ts +++ b/spec/api-native-theme-spec.ts @@ -1,9 +1,7 @@ import { expect } from 'chai'; import { nativeTheme, systemPreferences, BrowserWindow, ipcMain } from 'electron/main'; import { once } from 'node:events'; -import * as os from 'node:os'; import * as path from 'node:path'; -import * as semver from 'semver'; import { setTimeout } from 'node:timers/promises'; import { ifdescribe } from './lib/spec-helpers'; @@ -60,7 +58,7 @@ describe('nativeTheme module', () => { expect(called).to.equal(false); }); - ifdescribe(process.platform === 'darwin' && semver.gte(os.release(), '18.0.0'))('on macOS 10.14', () => { + ifdescribe(process.platform === 'darwin')('on macOS', () => { it('should update appLevelAppearance when set', () => { nativeTheme.themeSource = 'dark'; expect(systemPreferences.appLevelAppearance).to.equal('dark');