diff --git a/DEPS b/DEPS index a1143df5e6a3d..3c08bade6832a 100644 --- a/DEPS +++ b/DEPS @@ -14,7 +14,7 @@ gclient_gn_args = [ vars = { 'chromium_version': - '92.0.4511.0', + '93.0.4530.0', 'node_version': 'v14.17.0', 'nan_version': diff --git a/build/args/all.gn b/build/args/all.gn index 9d4a8474e49d3..e18315dd14bb6 100644 --- a/build/args/all.gn +++ b/build/args/all.gn @@ -29,7 +29,5 @@ enable_pseudolocales = false is_cfi = false -enable_pak_file_integrity_checks = false - # Make application name configurable at runtime for cookie crypto allow_runtime_configurable_key_storage = true diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 1a6fb05d05a56..37855ab911feb 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -3,7 +3,6 @@ dcheck.patch accelerator.patch blink_file_path.patch blink_local_frame.patch -blink_world_context.patch can_create_window.patch disable_hidden.patch dom_storage_limits.patch @@ -49,7 +48,6 @@ build_add_electron_tracing_category.patch worker_context_will_destroy.patch frame_host_manager.patch crashpad_pid_check.patch -preconnect_feature.patch network_service_allow_remote_certificate_verification_logic.patch put_back_deleted_colors_for_autofill.patch disable_color_correct_rendering.patch @@ -83,7 +81,6 @@ crash_allow_disabling_compression_on_linux.patch allow_setting_secondary_label_via_simplemenumodel.patch feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch fix_patch_out_profile_refs_in_accessibility_ui.patch -fix_check_issecureeventinputenabled_in_constructor_before_setting.patch skip_atk_toolchain_check.patch worker_feat_add_hook_to_notify_script_ready.patch chore_provide_iswebcontentscreationoverridden_with_full_params.patch @@ -99,7 +96,8 @@ fix_add_check_for_sandbox_then_result.patch extend_apply_webpreferences.patch fix_expose_decrementcapturercount_in_web_contents_impl.patch add_setter_for_browsermainloop_result_code.patch -chore_allow_overriding_of_enable_pak_file_integrity_checks.patch make_include_of_stack_trace_h_unconditional.patch build_libc_as_static_library.patch -support_runtime_configurable_key_storage_on_linux_os_crypto.patch +build_do_not_depend_on_packed_resource_integrity.patch +build_read_idl_files_as_utf8_to_fix_python3_character_encodding.patch +build_do_not_include_vr_directx_helpers_when_enable_vr.patch diff --git a/patches/chromium/accelerator.patch b/patches/chromium/accelerator.patch index dfd2ec2c282ac..b206327a55210 100644 --- a/patches/chromium/accelerator.patch +++ b/patches/chromium/accelerator.patch @@ -63,14 +63,14 @@ index d6913b15149f773cad28b5e2278b0f80df3d2896..25342f62acdc28806a0e6ae0bd129c59 if (IsCmdDown()) { diff --git a/ui/base/accelerators/accelerator.h b/ui/base/accelerators/accelerator.h -index 780a45f9ca2dd60e0deac27cc6e8f69e72cd8435..b740fbbfb14b5737b18b84c07c8e9f79cfc645c0 100644 +index 780a45f9ca2dd60e0deac27cc6e8f69e72cd8435..b1b46f18e9c600820fdd2d26631eac38da672811 100644 --- a/ui/base/accelerators/accelerator.h +++ b/ui/base/accelerators/accelerator.h @@ -16,6 +16,7 @@ #include #include "base/component_export.h" -+#include "base/optional.h" ++#include "third_party/abseil-cpp/absl/types/optional.h" #include "base/time/time.h" #include "build/build_config.h" #include "ui/events/event_constants.h" @@ -78,7 +78,7 @@ index 780a45f9ca2dd60e0deac27cc6e8f69e72cd8435..b740fbbfb14b5737b18b84c07c8e9f79 return interrupted_by_mouse_event_; } -+ base::Optional shifted_char; ++ absl::optional shifted_char; + private: std::u16string ApplyLongFormModifiers(const std::u16string& shortcut) const; diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index dfc8661eaec43..598d1ae744cf3 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -10,7 +10,7 @@ DidCreateScriptContext is called, not all JS APIs are available in the context, which can cause some preload scripts to trip. diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h -index 107c22e38babc4860d53d4fb539f322e6dec1df0..366382caddffc3beb363fe96eab63ea7474f81d1 100644 +index 3d985164eee3d7d8ef9e7ff2215ec9a17ec157a5..9c1c4fd8528fbb088f1836c8503c5875727f5d62 100644 --- a/content/public/renderer/render_frame_observer.h +++ b/content/public/renderer/render_frame_observer.h @@ -127,6 +127,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, @@ -23,10 +23,10 @@ index 107c22e38babc4860d53d4fb539f322e6dec1df0..366382caddffc3beb363fe96eab63ea7 int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index e0c8e8c19450b067757a8e8289f46f32b7d443eb..0f13101c719e6f43cfc5d281d0f6f345d475744d 100644 +index 08d697c611363155d3b6230b3e994ac456fb843b..cfc895ca8ce72655df5862d917a3954009930c4c 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4135,6 +4135,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, +@@ -4259,6 +4259,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, observer.DidCreateScriptContext(context, world_id); } @@ -40,10 +40,10 @@ index e0c8e8c19450b067757a8e8289f46f32b7d443eb..0f13101c719e6f43cfc5d281d0f6f345 int world_id) { for (auto& observer : observers_) diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h -index 77aaa3c08c1268c246f698a02df3e8a1aa4ef294..ffc6a5d1cd16ee2aecee027e9a321f1e435f5410 100644 +index 9636a1b59f05353b0777a0c304238703d17e1a01..0b5e6e726ebe7f4467b26725c477dc46dea579a5 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h -@@ -576,6 +576,8 @@ class CONTENT_EXPORT RenderFrameImpl +@@ -582,6 +582,8 @@ class CONTENT_EXPORT RenderFrameImpl blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override; void DidCreateScriptContext(v8::Local context, int world_id) override; @@ -53,10 +53,10 @@ index 77aaa3c08c1268c246f698a02df3e8a1aa4ef294..ffc6a5d1cd16ee2aecee027e9a321f1e int world_id) override; void DidChangeScrollOffset() override; diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h -index 4b3b9b1c4034656fdf5f9862d3fffa66f51e72fe..55e69bb644e2c47ac15fe8b2e255d660b8a51b4f 100644 +index 7bbe3754fec723c490c61cf52b875930dfa3543f..6035143b0d47fd0222fe7bc5c44328b043073335 100644 --- a/third_party/blink/public/web/web_local_frame_client.h +++ b/third_party/blink/public/web/web_local_frame_client.h -@@ -577,6 +577,9 @@ class BLINK_EXPORT WebLocalFrameClient { +@@ -580,6 +580,9 @@ class BLINK_EXPORT WebLocalFrameClient { virtual void DidCreateScriptContext(v8::Local, int32_t world_id) {} @@ -79,10 +79,10 @@ index 83b81f4c1fd4232ee5c2b7b1b7b85424164f3acc..bdd4a0031af6f9c2b701979dd469867c if (World().IsMainWorld()) { GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld(); diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h -index d8ac4cd5b0847b03ed30663dea24654c6e29d2f0..8c46855d4a5f888425ea4b6d4f69c74ac649933e 100644 +index 549a8f00a631bc860dde7a2362a0234420a1167a..14c3151f86a4d268352865c78c4889df6e9cf325 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client.h +++ b/third_party/blink/renderer/core/frame/local_frame_client.h -@@ -291,6 +291,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient { +@@ -297,6 +297,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient { virtual void DidCreateScriptContext(v8::Local, int32_t world_id) = 0; @@ -92,7 +92,7 @@ index d8ac4cd5b0847b03ed30663dea24654c6e29d2f0..8c46855d4a5f888425ea4b6d4f69c74a int32_t world_id) = 0; virtual bool AllowScriptExtensions() = 0; diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc -index 3538350785762dc742f862ff0e9ba8f43c92199a..0c980c66d861af11760faf1f1f78070d9f487367 100644 +index 077a726d6f2c0899fac1bccfe8ecc05b3bbd76b3..ed6dfe4598d2396c4cc48b6fd3cfecf0076726d4 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc @@ -272,6 +272,13 @@ void LocalFrameClientImpl::DidCreateScriptContext( @@ -110,7 +110,7 @@ index 3538350785762dc742f862ff0e9ba8f43c92199a..0c980c66d861af11760faf1f1f78070d v8::Local context, int32_t world_id) { diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h -index aab6643b89899a2b7f5bd74d4501bbf74562a663..8a3dddf797106e3d5da6a75d458ddea97cdf5edc 100644 +index dd342c654a29a18fad347abe8d94131f78ce0f3e..51276dfa934ebb9d2695a068f89e4d5b07c190a2 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h @@ -77,6 +77,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient { diff --git a/patches/chromium/add_setter_for_browsermainloop_result_code.patch b/patches/chromium/add_setter_for_browsermainloop_result_code.patch index 39263d255b039..34083d7b74c99 100644 --- a/patches/chromium/add_setter_for_browsermainloop_result_code.patch +++ b/patches/chromium/add_setter_for_browsermainloop_result_code.patch @@ -10,10 +10,10 @@ valid use cases for setting custom exit codes of the main loop. This exposes a simple setter that embedders can call. diff --git a/content/browser/browser_main_loop.h b/content/browser/browser_main_loop.h -index 30d6d6f54e453c5b9690bc028005d4169f7d71c4..76228c72b87368d5372ed812693b81e7d4d370d0 100644 +index 090ca9c6e8785c6e9f1b9245771645ea19805795..fdf587055a71103c21f27fd79e5714baa24ea5c4 100644 --- a/content/browser/browser_main_loop.h +++ b/content/browser/browser_main_loop.h -@@ -164,6 +164,10 @@ class CONTENT_EXPORT BrowserMainLoop { +@@ -161,6 +161,10 @@ class CONTENT_EXPORT BrowserMainLoop { int GetResultCode() const { return result_code_; } 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 8b56c3c2606ac..8db31f5762275 100644 --- a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -6,10 +6,10 @@ Subject: allow disabling blink scheduler throttling per RenderView This allows us to disable throttling for hidden windows. diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc -index e38a3a04c260d66b0f116d101c197824e3aaae93..bb3c79f407ab638fcd3180f6b16af98ec6ece5f8 100644 +index 5f4b4d0a6b7df869fef93129b6a3ce4c217a74c5..f00052e3335c5c2dbd00812be61ccae048e3e5b1 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc -@@ -611,6 +611,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { +@@ -615,6 +615,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque); } @@ -22,7 +22,7 @@ index e38a3a04c260d66b0f116d101c197824e3aaae93..bb3c79f407ab638fcd3180f6b16af98e return is_active(); } diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h -index 8926801ad5fdc5a560cb8a1eb40675eb5416f5cc..691abfe3802c207f402aef54eae481aaedafc364 100644 +index 37f3a9cae4ce9652943bbe7e71541ce182f52c1e..608b54785a1d8b34df41b030f65253c14b8285a1 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h @@ -135,6 +135,7 @@ class CONTENT_EXPORT RenderViewHostImpl @@ -48,18 +48,18 @@ index 9f1acca2bdb697b79a01362a9a5d8dd098eca925..c57c03b838a773d41614002afee27520 // This interface should only be implemented inside content. friend class RenderViewHostImpl; diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h -index dfaf88a323e6b1e63cc2b7abd1d7a1dcc26b1b8c..9cbc5fcf90d54173c84b5e91c620d175166ed9b3 100644 +index 59f8c47769c5fa325bb9464912561da1f0ba6c8b..822c94e3a3439b1c97ef25baf3eac97a017fa472 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h -@@ -183,6 +183,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient, +@@ -155,6 +155,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient, static WindowOpenDisposition NavigationPolicyToDisposition( blink::WebNavigationPolicy policy); + void OnSetSchedulerThrottling(bool allowed); + - // Misc private functions ---------------------------------------------------- - - // In OOPIF-enabled modes, this tells each RenderFrame with a pending state + // --------------------------------------------------------------------------- + // ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put + // it in the same order in the .cc file as it was in the header. diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom index e122d4ffb857023841dabcb6fed352d7586d8344..3c7cd1cb8b204024a0835150302ee8896e01ee45 100644 --- a/third_party/blink/public/mojom/page/page.mojom @@ -73,10 +73,10 @@ index e122d4ffb857023841dabcb6fed352d7586d8344..3c7cd1cb8b204024a0835150302ee889 + SetSchedulerThrottling(bool allowed); }; diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h -index 26aafb1350fe3e5df35800d858794b60aa309f21..e686722564b5d85ee77acc09ccba93d8605b1a0a 100644 +index 7acd3f2bf496172490e8bf3ea033ee213fcfdb02..ebc73fa9fbaf689f50deb547ac778f0a74c376fb 100644 --- a/third_party/blink/public/web/web_view.h +++ b/third_party/blink/public/web/web_view.h -@@ -357,6 +357,7 @@ class WebView { +@@ -364,6 +364,7 @@ class WebView { // Scheduling ----------------------------------------------------------- virtual PageScheduler* Scheduler() const = 0; @@ -85,10 +85,10 @@ index 26aafb1350fe3e5df35800d858794b60aa309f21..e686722564b5d85ee77acc09ccba93d8 // 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 e5d12060da4fd6366313a28f4a99ac52ce119803..ff5dda58a3db3efeea952f0ae75cf85575e1a12c 100644 +index f2fbcc760726822b86a9ca7ae37ef07d209a0984..ac730780c3f643b7131b742bd8fb6fd34aae0d9b 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -3559,6 +3559,13 @@ PageScheduler* WebViewImpl::Scheduler() const { +@@ -3573,6 +3573,13 @@ PageScheduler* WebViewImpl::Scheduler() const { return GetPage()->GetPageScheduler(); } @@ -102,7 +102,7 @@ index e5d12060da4fd6366313a28f4a99ac52ce119803..ff5dda58a3db3efeea952f0ae75cf855 void WebViewImpl::SetVisibilityState( mojom::blink::PageVisibilityState visibility_state, bool is_initial_state) { -@@ -3570,7 +3577,8 @@ void WebViewImpl::SetVisibilityState( +@@ -3584,7 +3591,8 @@ void WebViewImpl::SetVisibilityState( } GetPage()->SetVisibilityState(visibility_state, is_initial_state); GetPage()->GetPageScheduler()->SetPageVisible( @@ -113,10 +113,10 @@ index e5d12060da4fd6366313a28f4a99ac52ce119803..ff5dda58a3db3efeea952f0ae75cf855 mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() { diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h -index e536aeacc79dcc5cf45674fbc4d288a8265a7548..c06214e3c714c96acd104208c7495397e924bc12 100644 +index c2e704e745d3859790e73e515c3c1cbcd11ce529..5b3233f4d1f108492f370fc0f6450633dbe713f0 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.h +++ b/third_party/blink/renderer/core/exported/web_view_impl.h -@@ -403,6 +403,7 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -408,6 +408,7 @@ class CORE_EXPORT WebViewImpl final : public WebView, LocalDOMWindow* PagePopupWindow() const; PageScheduler* Scheduler() const override; @@ -124,7 +124,7 @@ index e536aeacc79dcc5cf45674fbc4d288a8265a7548..c06214e3c714c96acd104208c7495397 void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state, bool is_initial_state) override; mojom::blink::PageVisibilityState GetVisibilityState() override; -@@ -828,6 +829,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -833,6 +834,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, // If true, we send IPC messages when |preferred_size_| changes. bool send_preferred_size_changes_ = false; diff --git a/patches/chromium/blink_file_path.patch b/patches/chromium/blink_file_path.patch index 08264cd5583fa..3bae083f52892 100644 --- a/patches/chromium/blink_file_path.patch +++ b/patches/chromium/blink_file_path.patch @@ -7,10 +7,10 @@ This is used by editors to obtain the filesystem path from a dragged file. See documentation at https://electronjs.org/docs/api/file-object diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h -index 7c21e6bc889c5bead5aa25a3a7582918d2f6d953..fe255a5d6afca61852adead82beaac275ebe9c54 100644 +index d70a95cc9b28674dd4ac925e9f1aca481e60c34b..fa9d21a20e77867a7d596e0df4ec143edb871f27 100644 --- a/third_party/blink/renderer/core/fileapi/file.h +++ b/third_party/blink/renderer/core/fileapi/file.h -@@ -200,6 +200,9 @@ class CORE_EXPORT File final : public Blob { +@@ -191,6 +191,9 @@ class CORE_EXPORT File final : public Blob { } const String& name() const { return name_; } diff --git a/patches/chromium/blink_local_frame.patch b/patches/chromium/blink_local_frame.patch index b884dcf6086af..843a66f3def5f 100644 --- a/patches/chromium/blink_local_frame.patch +++ b/patches/chromium/blink_local_frame.patch @@ -15,7 +15,7 @@ Refs changes in: This patch reverts the changes to fix associated crashes in Electron. diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc -index a190fd8233e295555d4b5e93cb3a8edd59d7df59..37f199f6e6471d97105ffad9dd7d4450cb02331f 100644 +index 8bf6b4bc077cc41da5e0e6b13302bc343537c68f..01bddc0bcb7476408023c4cfc042a0883c16430c 100644 --- a/third_party/blink/renderer/core/frame/frame.cc +++ b/third_party/blink/renderer/core/frame/frame.cc @@ -120,14 +120,6 @@ bool Frame::Detach(FrameDetachType type) { @@ -49,10 +49,10 @@ index a190fd8233e295555d4b5e93cb3a8edd59d7df59..37f199f6e6471d97105ffad9dd7d4450 // 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 fab2d2cbc446cc283939830f5e8fe9bb5b500b73..7530888913597ac9afd32d634d461c74f1da69ed 100644 +index 932b271a34fe295b2f0dd807f67b22682addfbf9..ea8336ff1f6c8bf26465e5ff6ed01cae0899f258 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc -@@ -785,10 +785,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { +@@ -784,10 +784,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { } DCHECK(!view_ || !view_->IsAttached()); @@ -63,7 +63,7 @@ index fab2d2cbc446cc283939830f5e8fe9bb5b500b73..7530888913597ac9afd32d634d461c74 if (!Client()) return false; -@@ -834,6 +830,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { +@@ -833,6 +829,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { DCHECK(!view_->IsAttached()); Client()->WillBeDetached(); diff --git a/patches/chromium/blink_world_context.patch b/patches/chromium/blink_world_context.patch deleted file mode 100644 index c86966c7f1024..0000000000000 --- a/patches/chromium/blink_world_context.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Anonymous -Date: Thu, 20 Sep 2018 17:45:11 -0700 -Subject: blink_world_context.patch - -This exposes a method for obtaining a reference to an isolated world, which is -otherwise not available in the Blink API. - -diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h -index fd6ce9a3df30bc11387db8ee63293f202a8d00aa..014a71c2b81cb6ab3a6a295d8ee6f403f75770fd 100644 ---- a/third_party/blink/public/web/web_local_frame.h -+++ b/third_party/blink/public/web/web_local_frame.h -@@ -369,6 +369,8 @@ class WebLocalFrame : public WebFrame { - // Returns the world ID associated with |script_context|. - virtual int32_t GetScriptContextWorldId( - v8::Local script_context) const = 0; -+ virtual v8::Local WorldScriptContext( -+ v8::Isolate* isolate, int world_id) const = 0; - - // Executes script in the context of the current page and returns the value - // that the script evaluated to with callback. Script execution can be -diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc -index 35290011b1c32b8695e08ec80398e4df2cf611dc..1ae8fc18f467c50f2a7e0de9e24d708514c5cc86 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 -@@ -1078,6 +1078,13 @@ v8::Local WebLocalFrameImpl::GlobalProxy() const { - return MainWorldScriptContext()->Global(); - } - -+v8::Local WebLocalFrameImpl::WorldScriptContext( -+ v8::Isolate* isolate, int world_id) const { -+ scoped_refptr world = DOMWrapperWorld::EnsureIsolatedWorld( -+ isolate, world_id); -+ return ToScriptState(GetFrame(), *world)->GetContext(); -+} -+ - bool WebFrame::ScriptCanAccess(WebFrame* target) { - return BindingSecurity::ShouldAllowAccessToFrame( - CurrentDOMWindow(V8PerIsolateData::MainThreadIsolate()), -diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h -index 415bd0ead0d6be7e73dbdfc2066612b7abee99b4..7e6512649709e68b9ea9cd829f6b7ffadf8a59dd 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 -@@ -170,6 +170,8 @@ class CORE_EXPORT WebLocalFrameImpl final - v8::Local MainWorldScriptContext() const override; - int32_t GetScriptContextWorldId( - v8::Local script_context) const override; -+ v8::Local WorldScriptContext( -+ v8::Isolate* isolate, int world_id) const override; - void RequestExecuteScriptAndReturnValue(const WebScriptSource&, - bool user_gesture, - WebScriptExecutionCallback*) override; diff --git a/patches/chromium/build_add_electron_tracing_category.patch b/patches/chromium/build_add_electron_tracing_category.patch index ae6d66e831bd1..5a57b70120a59 100644 --- a/patches/chromium/build_add_electron_tracing_category.patch +++ b/patches/chromium/build_add_electron_tracing_category.patch @@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us to introduce a new Electron category for Electron-specific tracing. diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h -index 563674ae9631732979d973f5233a3b707312d638..779b76fe62c520f1681a82343a21aa4d734b3a55 100644 +index c0bcfbab13bc243a4cf575340867463d79358ab7..6d51381b8d9414e44dba0fc1246066e97f9ff88a 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h @@ -77,6 +77,7 @@ 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 new file mode 100644 index 0000000000000..a1585edd2c4f1 --- /dev/null +++ b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch @@ -0,0 +1,68 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Samuel Attard +Date: Thu, 27 May 2021 17:21:07 -0700 +Subject: build: do not depend on packed_resource_integrity + +This ensures we do not depend on a target that does not exist when +building Electron, electron generates its own .pak files via +electron_repack and therefore this integrity target which is generated +by the chrome_paks target does not exist. This can not be upstreamed, +if we ever align our .pak file generation with Chrome we can remove this +patch. + +diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn +index 75868925758560075e95b79a7473e635b23127d5..1aba073ab6bddfa20d82f66938383fe98baf5774 100644 +--- a/chrome/BUILD.gn ++++ b/chrome/BUILD.gn +@@ -170,11 +170,16 @@ if (!is_android && !is_mac) { + "common/crash_keys.h", + ] + ++ if (!is_electron_build) { ++ deps += [ ++ ":packed_resources_integrity", ++ ] ++ } ++ + deps += [ + ":chrome_dll", + ":chrome_exe_version", + ":copy_first_run", +- ":packed_resources_integrity", + ":visual_elements_resources", + "//base", + "//build:branding_buildflags", +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +index 6a690c18e5fd8b36237be6711437cf8997e074c7..8b0fc49851669ac98bdeed9975ed1f84596ddfa2 100644 +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -4287,7 +4287,7 @@ static_library("browser") { + + # On Windows, the hashes are embedded in //chrome:chrome_initial rather + # than here in :chrome_dll. +- if (!is_win) { ++ if (!is_win && !is_electron_build) { + deps += [ "//chrome:packed_resources_integrity" ] + } + +diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn +index 081cb42207daad824a12ea8b5c709387a3a0832a..4c4d614a47f36d2d75bd83081f10c5d294f59d6c 100644 +--- a/chrome/test/BUILD.gn ++++ b/chrome/test/BUILD.gn +@@ -4878,10 +4878,15 @@ test("unit_tests") { + assert(toolkit_views) + sources += [ "../browser/ui/startup/credential_provider_signin_info_fetcher_win_unittest.cc" ] + deps += [ +- "//chrome:packed_resources_integrity", + "//chrome/browser/win/conflicts:unit_tests", + "//chrome/test:credential_provider_test_utils", + ] ++ ++ if (!is_electron_build) { ++ deps += [ ++ "//chrome:packed_resources_integrity", ++ ] ++ } + } + + if (is_win || is_chromeos_ash || is_mac) { diff --git a/patches/chromium/build_do_not_include_vr_directx_helpers_when_enable_vr.patch b/patches/chromium/build_do_not_include_vr_directx_helpers_when_enable_vr.patch new file mode 100644 index 0000000000000..07e0a25cfdf07 --- /dev/null +++ b/patches/chromium/build_do_not_include_vr_directx_helpers_when_enable_vr.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Samuel Attard +Date: Wed, 2 Jun 2021 15:10:18 -0700 +Subject: build: do not include vr:directx_helpers when !enable_vr + +Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2935426 + +diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn +index 4c4d614a47f36d2d75bd83081f10c5d294f59d6c..864708e3f75b3fb8fce7b3cfedda52049c43bcc1 100644 +--- a/chrome/test/BUILD.gn ++++ b/chrome/test/BUILD.gn +@@ -4883,9 +4883,7 @@ test("unit_tests") { + ] + + if (!is_electron_build) { +- deps += [ +- "//chrome:packed_resources_integrity", +- ] ++ deps += [ "//chrome:packed_resources_integrity" ] + } + } + +@@ -8568,7 +8566,7 @@ if (!is_android) { + "//third_party/blink/web_tests/resources/testharness.js", + ] + +- if (is_win) { ++ if (is_win && enable_vr) { + deps += [ + "//device/vr", + "//device/vr:directx_helpers", diff --git a/patches/chromium/build_gn.patch b/patches/chromium/build_gn.patch index 3153e2f87533a..eb55f778aabbf 100644 --- a/patches/chromium/build_gn.patch +++ b/patches/chromium/build_gn.patch @@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will rebuild the entire tree. diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index 0ef73ab2b2e124466c4ff22fe662273ade82603b..f2451ca5f2ce1f22b84fe81637314daeb3dc64d8 100644 +index 46bc4769236eabee773be1e5690f0d406cb22229..0c674012b6265a8109e00b13c7c95a36eaddbe27 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -123,6 +123,9 @@ if (current_os == "") { diff --git a/patches/chromium/build_read_idl_files_as_utf8_to_fix_python3_character_encodding.patch b/patches/chromium/build_read_idl_files_as_utf8_to_fix_python3_character_encodding.patch new file mode 100644 index 0000000000000..388b362d83d3f --- /dev/null +++ b/patches/chromium/build_read_idl_files_as_utf8_to_fix_python3_character_encodding.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Samuel Attard +Date: Fri, 28 May 2021 14:29:38 -0700 +Subject: build: read IDL files as utf8 to fix python3 character encodding + issue + +This should be upstreamed + +diff --git a/tools/json_schema_compiler/compiler.py b/tools/json_schema_compiler/compiler.py +index 6e6990525d0441d22899450d34991bbb94265ca6..2ac3ae8f783f7472ffaf054714f07cf50bdf0fd3 100755 +--- a/tools/json_schema_compiler/compiler.py ++++ b/tools/json_schema_compiler/compiler.py +@@ -146,7 +146,7 @@ def GenerateSchema(generator_name, + output_dir = os.path.join(destdir, src_path) + if not os.path.exists(output_dir): + os.makedirs(output_dir) +- with open(os.path.join(output_dir, filename), 'w') as f: ++ with open(os.path.join(output_dir, filename), 'w', encoding='utf-8') as f: + f.write(code) + # If multiple files are being output, add the filename for each file. + if len(generators) > 1: +diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py +index 029e83c7179b2582bc46b5e3eeac1e32a016a479..f83d9edd37ad89478d6b741e1cf0c525bab94587 100755 +--- a/tools/json_schema_compiler/idl_schema.py ++++ b/tools/json_schema_compiler/idl_schema.py +@@ -575,7 +575,7 @@ def Load(filename): + Python dictionary in a format that the JSON schema compiler expects to see. + ''' + +- f = open(filename, 'r') ++ f = open(filename, 'r', encoding='utf-8') + contents = f.read() + f.close() + diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index 0b917d576127f..6515fb968721c 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 9708cea34a2a15bf0ad10d0acbd23870abcc0bf7..05b5abd7b4b9aca999ed428ed50fcf2d6983b767 100644 +index bf3147e7dcb7b2a31a856c8397c41f1d09d857b2..5c52a31673c511b58a49857a97dcb3c12ba5e702 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -5720,6 +5720,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -5934,6 +5934,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 9708cea34a2a15bf0ad10d0acbd23870abcc0bf7..05b5abd7b4b9aca999ed428ed50fcf2d &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index ec8c6d3956485103b7add39d111ba372126ce21f..04e320e1b0150dbf7edd42be88c3ab6ceaecf46f 100644 +index da7b464837a13a901e4a670d00d2a45c94dabd7a..4728f584f537b6496a437511873028c0a454a1d2 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3658,6 +3658,14 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3757,6 +3757,14 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( } auto* new_contents_impl = new_contents.get(); @@ -39,7 +39,7 @@ index ec8c6d3956485103b7add39d111ba372126ce21f..04e320e1b0150dbf7edd42be88c3ab6c new_contents_impl->GetController().SetSessionStorageNamespace( partition_id, session_storage_namespace); -@@ -3700,12 +3708,6 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3799,12 +3807,6 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( AddWebContentsDestructionObserver(new_contents_impl); } @@ -53,10 +53,10 @@ index ec8c6d3956485103b7add39d111ba372126ce21f..04e320e1b0150dbf7edd42be88c3ab6c new_contents_impl, opener, params.target_url, params.referrer.To(), params.disposition, diff --git a/content/common/frame.mojom b/content/common/frame.mojom -index 5f6980ca1865dfb58830de7012d7c3f499457e3d..04bfe5f3cc0fdaf5065d64f1a0a9ec6b2595e5f8 100644 +index e7293484f9779d87ee5e5d913b72f2eca24f91e1..71928d8cc6216f20704a7adda528bacd9292e188 100644 --- a/content/common/frame.mojom +++ b/content/common/frame.mojom -@@ -455,6 +455,10 @@ struct CreateNewWindowParams { +@@ -468,6 +468,10 @@ struct CreateNewWindowParams { // The impression associated with the navigation in the new window, if // one is specified. Impression? impression; @@ -68,10 +68,10 @@ index 5f6980ca1865dfb58830de7012d7c3f499457e3d..04bfe5f3cc0fdaf5065d64f1a0a9ec6b // 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 1b1761121436278e1d113da19f58dd832117ef69..92675cb2cf49b7fb750612ac6edc4ee39c349f9b 100644 +index dcc9c2261a5a68230f929e2d8755cc752d704c4d..6ddae5e216070967b592c81e3d465087d27905b1 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -561,6 +561,8 @@ bool ContentBrowserClient::CanCreateWindow( +@@ -566,6 +566,8 @@ bool ContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -81,10 +81,10 @@ index 1b1761121436278e1d113da19f58dd832117ef69..92675cb2cf49b7fb750612ac6edc4ee3 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 0b1a60bf8cdc0452d9f818d799e8ece5400698bd..c24c05c17e5511d247fb93a4f987dd852742b5a4 100644 +index 09ce07d6501e1c651cf3ae76e4687650bb0c6f18..31414b7818ecb333be7cff85195d06c850202c6b 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -158,6 +158,7 @@ class NetworkService; +@@ -160,6 +160,7 @@ class NetworkService; class TrustedURLLoaderHeaderClient; } // namespace mojom struct ResourceRequest; @@ -92,7 +92,7 @@ index 0b1a60bf8cdc0452d9f818d799e8ece5400698bd..c24c05c17e5511d247fb93a4f987dd85 } // namespace network namespace sandbox { -@@ -928,6 +929,8 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -937,6 +938,8 @@ class CONTENT_EXPORT ContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -150,10 +150,10 @@ index b1cfa654259d431adfada00a00f9bfc8ae5ab292..484d36de2ac0ef3b1d19bbd0d6c79db8 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc -index 9ee8f76a0de7fa8ab568363b97c9dc22eb698e15..71d98e472641d6ebbc8857365ee1ee36c6ee1ff9 100644 +index 870b5f66ec8ec2e243c691b460071a9363cd0fa4..3d8175c6d343450173bc2f16cc6a6f37e7d0084d 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc -@@ -27,6 +27,7 @@ +@@ -26,6 +26,7 @@ #include "third_party/blink/public/platform/impression_conversions.h" #include "third_party/blink/public/platform/modules/video_capture/web_video_capture_impl_manager.h" #include "third_party/blink/public/platform/url_conversion.h" @@ -161,7 +161,7 @@ index 9ee8f76a0de7fa8ab568363b97c9dc22eb698e15..71d98e472641d6ebbc8857365ee1ee36 #include "third_party/blink/public/web/modules/mediastream/web_media_stream_device_observer.h" #include "third_party/blink/public/web/web_frame_widget.h" #include "third_party/blink/public/web/web_local_frame.h" -@@ -312,6 +313,10 @@ WebView* RenderViewImpl::CreateView( +@@ -289,6 +290,10 @@ WebView* RenderViewImpl::CreateView( params->impression = blink::ConvertWebImpressionToImpression(*impression); } @@ -173,7 +173,7 @@ index 9ee8f76a0de7fa8ab568363b97c9dc22eb698e15..71d98e472641d6ebbc8857365ee1ee36 // 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 5e9b1a409f5fb0dd683cc67318bae9c542816451..e2a3780b6ea5e15839b89ff92c85e57e7c48b017 100644 +index e3dd040164fec1a70c9bd2dac7cc3d93478ec39f..f8894682e181a99b9e6cf3d0e4b46413076eb5ef 100644 --- a/content/web_test/browser/web_test_content_browser_client.cc +++ b/content/web_test/browser/web_test_content_browser_client.cc @@ -450,6 +450,8 @@ bool WebTestContentBrowserClient::CanCreateWindow( diff --git a/patches/chromium/chore_allow_overriding_of_enable_pak_file_integrity_checks.patch b/patches/chromium/chore_allow_overriding_of_enable_pak_file_integrity_checks.patch deleted file mode 100644 index 2a20d4243be23..0000000000000 --- a/patches/chromium/chore_allow_overriding_of_enable_pak_file_integrity_checks.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: John Kleinschmidt -Date: Tue, 11 May 2021 21:35:39 -0400 -Subject: chore: allow overriding of enable_pak_file_integrity_checks - -enable_pak_file_integrity_checks is not currently overridable -but Electron does not need to run this. - -diff --git a/chrome/browser/buildflags.gni b/chrome/browser/buildflags.gni -index 8c19e707371c7ad4fbcd46d58b147de3bfc89790..17c82c078a2beb8146c39290aa37703c7a3b07f2 100644 ---- a/chrome/browser/buildflags.gni -+++ b/chrome/browser/buildflags.gni -@@ -21,11 +21,13 @@ declare_args() { - # app_session_service and some not. - enable_app_session_service = - !(is_chromeos_lacros || is_chromecast || is_android) --} - --# If true, the resource .pak files will be hashed and the digest will be --# embedded in the binary and checked at run-time. This is incompatible with --# enable_resource_allowlist_generation on Windows because it creates a circular --# dependency with chrome_dll. --enable_pak_file_integrity_checks = -- !(enable_resource_allowlist_generation && is_win) && !is_android -+ -+ # If true, the resource .pak files will be hashed and the digest will be -+ # embedded in the binary and checked at run-time. This is incompatible with -+ # enable_resource_allowlist_generation on Windows because it creates a circular -+ # dependency with chrome_dll. -+ enable_pak_file_integrity_checks = -+ !(enable_resource_allowlist_generation && is_win) && !is_android -+ -+} -\ No newline at end of file diff --git a/patches/chromium/chore_expose_v8_initialization_isolate_callbacks.patch b/patches/chromium/chore_expose_v8_initialization_isolate_callbacks.patch index 4cf3876c7bcd6..363ce9a494986 100644 --- a/patches/chromium/chore_expose_v8_initialization_isolate_callbacks.patch +++ b/patches/chromium/chore_expose_v8_initialization_isolate_callbacks.patch @@ -9,10 +9,10 @@ we're running with contextIsolation enabled, we should be falling back to Blink's logic. This will be upstreamed in some form. diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc -index 72248101cdaee12ff71d0d6cd9b83ea50db2c829..2b242fa4f7cb0562c31a48ba5aad49f534fbd71c 100644 +index e3ad92d44fe90f45f8986f2ba3b6d5af096f831b..dafa7d7e67ed3a870d5ae534124047703c0328f1 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc -@@ -464,7 +464,7 @@ CodeGenerationCheckCallbackInMainThread(v8::Local context, +@@ -448,7 +448,7 @@ CodeGenerationCheckCallbackInMainThread(v8::Local context, return {true, std::move(stringified_source)}; } diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index e918324b3806d..c7a8626c5f055 100644 --- a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch +++ b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch @@ -67,10 +67,10 @@ index d072e66a2ad8a05c9678c98aa5dbeecd4a925465..3874397a4f3096cc965fc8ce4ee955c7 return extension && extension->id() == app_id_; } diff --git a/chrome/browser/media/offscreen_tab.cc b/chrome/browser/media/offscreen_tab.cc -index 4499d9df3723b1c721aef919cbe376166985ddab..c641a8e3dc64f98aacc09567cc5fc9edcc6c9ff5 100644 +index 412e6b05265a97077c3b617e12908c88719e6e73..8365a0d5923beb2ffbd837535db2abc23e32e891 100644 --- a/chrome/browser/media/offscreen_tab.cc +++ b/chrome/browser/media/offscreen_tab.cc -@@ -283,8 +283,7 @@ bool OffscreenTab::IsWebContentsCreationOverridden( +@@ -282,8 +282,7 @@ bool OffscreenTab::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -140,10 +140,10 @@ index ef84e04d628fb5cdbaf8fbbf84af3bf23e00c522..f1ee0bee5bfd08227a29498f8410d5d3 } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc -index 7c840e8a0cbe1b8e5b7ebfba5d4dbd1488f4a530..b0854e1191b2fb124b4dfd52bd49a13f321829b3 100644 +index 268f6547ff84b14c8f35afe36fcc3a46df65fdc9..68ad5985f1bc5d2e6bf90b2e8b59f413c1b888e1 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc -@@ -1793,12 +1793,11 @@ bool Browser::IsWebContentsCreationOverridden( +@@ -1796,12 +1796,11 @@ bool Browser::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -159,10 +159,10 @@ index 7c840e8a0cbe1b8e5b7ebfba5d4dbd1488f4a530..b0854e1191b2fb124b4dfd52bd49a13f WebContents* Browser::CreateCustomWebContents( diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h -index 71ce1e28e6291dcf5a8765003b93054eca360925..11d87d0ad1f86963b52c870adcdc65c2322ececc 100644 +index 946c447afbde10c3136e8f13c3aaaa6333cc0153..f6d8708947997aa8256fd14687ca5c1bc79db68e 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h -@@ -796,8 +796,7 @@ class Browser : public TabStripModelObserver, +@@ -791,8 +791,7 @@ class Browser : public TabStripModelObserver, content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -201,7 +201,7 @@ index 058ec72442d59989c4d6df4a7c791ecfeff0ef99..f7c8c2139382cb2e290c561624291afe // The profile used for the presentation. Profile* otr_profile_; diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.cc b/components/embedder_support/android/delegate/web_contents_delegate_android.cc -index e878f49dd6cc69f5ba0b43e666277d29ed8c0d91..3a8eb296fee0ac2dda52435b58537a98d90e4467 100644 +index 821efb221cd2a6efca5ec9af0e91d930bf335dea..f5c34246a329ce49d5fe84067c722656005b89fa 100644 --- a/components/embedder_support/android/delegate/web_contents_delegate_android.cc +++ b/components/embedder_support/android/delegate/web_contents_delegate_android.cc @@ -169,14 +169,13 @@ bool WebContentsDelegateAndroid::IsWebContentsCreationOverridden( @@ -264,10 +264,10 @@ index c5c5a7b63b5b3b62a9517cbef3ae23ce57a3c89c..4f1b7e88d6d2ae89a60311c8aeb1fcee void AddNewContents(content::WebContents* source, std::unique_ptr new_contents, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index e240f8a32b1f7f69afa992861c995e668695c51f..87792fc94a84ed3336c70d431516150a91ec5928 100644 +index 6cbe9f509390367bf97bfbf1f2ebd58215e74db3..b21c2fa17d71a05a2b363cf31bbaaae82a3dc7aa 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3610,8 +3610,7 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3709,8 +3709,7 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( if (delegate_ && delegate_->IsWebContentsCreationOverridden( source_site_instance, params.window_container_type, @@ -334,7 +334,7 @@ index 9b293d0df6c634bf44a69d607c4eee839a74b4a1..7e5b9cbdcc232c5e20eae0130d800f50 content::RenderFrameHost* opener, content::SiteInstance* source_site_instance, diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index 8dc27c2df589861c3176a54c02abe821419e39c7..7e5d49798cd4f55e6b3e24f5f10824f5043c2ddd 100644 +index a28112a99dfdc46148904fb064a321c13f443359..087d85af8f65873ce44b81580cf6392f568e3182 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc @@ -380,8 +380,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden( @@ -362,10 +362,10 @@ index 7d27e12c4e9a7f32af8a26f672359057a643dd67..7a30ac31f79871f2a9afa0345e0e88af content::RenderFrameHost* opener, content::SiteInstance* source_site_instance, diff --git a/fuchsia/engine/browser/frame_impl.cc b/fuchsia/engine/browser/frame_impl.cc -index ba54048e3af4e71a38afbd07ad1e5bef57aa589b..833f4425b6499c8bbcd17dfa488e8126ac28bd1c 100644 +index d5bb190807b3b8e7b025d3779420e41c222c054a..b7dc3554078011c9fbf5d467df31bc091b94013c 100644 --- a/fuchsia/engine/browser/frame_impl.cc +++ b/fuchsia/engine/browser/frame_impl.cc -@@ -381,8 +381,7 @@ bool FrameImpl::IsWebContentsCreationOverridden( +@@ -387,8 +387,7 @@ bool FrameImpl::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -376,10 +376,10 @@ index ba54048e3af4e71a38afbd07ad1e5bef57aa589b..833f4425b6499c8bbcd17dfa488e8126 // can catch bad client behavior while not interfering with normal operation. constexpr size_t kMaxPendingWebContentsCount = 10; diff --git a/fuchsia/engine/browser/frame_impl.h b/fuchsia/engine/browser/frame_impl.h -index 5ae42572b62fa277aae17e6722f714a90dd9496e..5aa358ecdf4b1a7f3a272834fd50e7bee49accc8 100644 +index 08b2a1d7e1a0bc458e478a77bfd2fbaf35865d08..690c4baace675a6f8bbeaa1e7297e3bf0f0a8a50 100644 --- a/fuchsia/engine/browser/frame_impl.h +++ b/fuchsia/engine/browser/frame_impl.h -@@ -240,8 +240,7 @@ class FrameImpl : public fuchsia::web::Frame, +@@ -241,8 +241,7 @@ class FrameImpl : public fuchsia::web::Frame, content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -390,10 +390,10 @@ index 5ae42572b62fa277aae17e6722f714a90dd9496e..5aa358ecdf4b1a7f3a272834fd50e7be int opener_render_process_id, int opener_render_frame_id, diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc -index 4e4b37cc0fbbcf8f630a4e928c957261e9a03603..610848b09bba4dfa7dd645ca62354930b74e3ed5 100644 +index dd1f6129173a0e19023f4ec9b66c44486b080456..d10468c06f84b59387af0a8fd5bc1c06108865eb 100644 --- a/headless/lib/browser/headless_web_contents_impl.cc +++ b/headless/lib/browser/headless_web_contents_impl.cc -@@ -198,8 +198,7 @@ class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate { +@@ -192,8 +192,7 @@ class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate { content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, diff --git a/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch b/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch index b5831a60d93b1..53b1472865b23 100644 --- a/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch +++ b/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch @@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources. We need to load these from Electrons grit header instead of Chromes diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index be9370112776419a6df98c364e9eae149eabdbb4..f6ce53126e53995966692fbbbf74c3bf3489a088 100644 +index b4acb5dd3862e8411bfb00a99168e69822be0d53..6a690c18e5fd8b36237be6711437cf8997e074c7 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -6350,6 +6350,7 @@ static_library("browser") { +@@ -6365,6 +6365,7 @@ static_library("browser") { deps += [ "//components/spellcheck/browser", "//components/spellcheck/common", @@ -19,7 +19,7 @@ index be9370112776419a6df98c364e9eae149eabdbb4..f6ce53126e53995966692fbbbf74c3bf if (!is_android) { diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc -index d511c9085253ebfba69ba37f41193d15638bb10f..d98cfc569c775b52687a533e03c595a5e45be87e 100644 +index 2b7aa1add57dccbcbf8202cead5b7d2d5a174270..2ba03fc045f2e4bb12f173aacb6581ccb20bfc5a 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.cc +++ b/chrome/browser/spellchecker/spellcheck_factory.cc @@ -6,7 +6,7 @@ diff --git a/patches/chromium/chrome_key_systems.patch b/patches/chromium/chrome_key_systems.patch index a8ceecb5666ea..adeb0797bba1d 100644 --- a/patches/chromium/chrome_key_systems.patch +++ b/patches/chromium/chrome_key_systems.patch @@ -7,7 +7,7 @@ Disable persiste licence support check for widevine cdm, as its not supported in the current version of chrome. diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc -index 0ccd5815839ff3bc3b05e76241959912f0730b6b..36cecfb80de305a93e6dd4aef087f169630fa502 100644 +index 03489704b2632b8a5af07ca073e83b03fe407130..21233d01ef39a959769bd0bb58cbe4c9a0daef08 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc @@ -16,7 +16,9 @@ @@ -20,10 +20,10 @@ index 0ccd5815839ff3bc3b05e76241959912f0730b6b..36cecfb80de305a93e6dd4aef087f169 #include "components/cdm/renderer/external_clear_key_key_system_properties.h" #include "components/cdm/renderer/widevine_key_system_properties.h" #include "content/public/renderer/render_thread.h" -@@ -201,12 +203,14 @@ static SupportedCodecs GetSupportedCodecs( +@@ -269,12 +271,14 @@ SupportedCodecs GetSupportedCodecs(const media::CdmCapability& capability, + // Returns persistent-license session support. - static EmeSessionTypeSupport GetPersistentLicenseSupport( - bool supported_by_the_cdm) { + EmeSessionTypeSupport GetPersistentLicenseSupport(bool supported_by_the_cdm) { +#if 0 // Do not support persistent-license if the process cannot persist data. // TODO(crbug.com/457487): Have a better plan on this. See bug for details. diff --git a/patches/chromium/command-ismediakey.patch b/patches/chromium/command-ismediakey.patch index 10e6833ab17ae..06dcbac7d5d72 100644 --- a/patches/chromium/command-ismediakey.patch +++ b/patches/chromium/command-ismediakey.patch @@ -201,7 +201,7 @@ index 60f7ad6ffb28fa6554e02a7e031408f4d1124d86..0e8325e993178443d926249c427957bb } diff --git a/ui/base/x/x11_global_shortcut_listener.cc b/ui/base/x/x11_global_shortcut_listener.cc -index 658c04c865f0e0f17501fc97965adc3bd56c709a..8c693eecbca10cd8b287fdd504d498e6a5e72e96 100644 +index a772666160a71e8e31242e25a8f3383ad9b914bf..7ed78ff875ccf9c38a480d0d59f4688ada1a3ad3 100644 --- a/ui/base/x/x11_global_shortcut_listener.cc +++ b/ui/base/x/x11_global_shortcut_listener.cc @@ -32,11 +32,13 @@ const x11::ModMask kModifiersMasks[] = { diff --git a/patches/chromium/crash_allow_setting_more_options.patch b/patches/chromium/crash_allow_setting_more_options.patch index 5135335947a1f..261818089d41e 100644 --- a/patches/chromium/crash_allow_setting_more_options.patch +++ b/patches/chromium/crash_allow_setting_more_options.patch @@ -102,7 +102,7 @@ index e3fc1fb2bcab31d6a7cb325a892acb26dc00d4e4..fd654d6e514de416457c283caeb1895d arguments.push_back("--monitor-self"); } diff --git a/components/crash/core/app/crashpad_win.cc b/components/crash/core/app/crashpad_win.cc -index 686be7964d77dbba91a6265d157d05d97d5823fb..3e4585f7ba14650fa8b7e644b026147e0bac5119 100644 +index 7dd251b2fdda8c59bb630a5d3ee86e9e858f256e..93f1d5954651ef961c72b97885a708ecff2e9aa7 100644 --- a/components/crash/core/app/crashpad_win.cc +++ b/components/crash/core/app/crashpad_win.cc @@ -89,6 +89,7 @@ base::FilePath PlatformCrashpadInitialization( diff --git a/patches/chromium/dcheck.patch b/patches/chromium/dcheck.patch index 661a0a2915977..e88284bc6bbb2 100644 --- a/patches/chromium/dcheck.patch +++ b/patches/chromium/dcheck.patch @@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the failing checks and allow the rest of the target to have them enabled. diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc -index d1f10922b82e4e0578d1c32978784216117e0696..8f0a750d1a5957b987c5ac506455587a09474461 100644 +index c2df77803f30ad948d357a9679938320702e14b4..7d4a89e10e475c8cddd8fea77eac348c54014f0e 100644 --- a/ui/base/clipboard/clipboard_win.cc +++ b/ui/base/clipboard/clipboard_win.cc -@@ -889,10 +889,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const { +@@ -882,10 +882,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const { void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) { UINT cf_format = format.ToFormatEtc().cfFormat; diff --git a/patches/chromium/disable-redraw-lock.patch b/patches/chromium/disable-redraw-lock.patch index 69b305dcc7fbc..119391a6f6aa0 100644 --- a/patches/chromium/disable-redraw-lock.patch +++ b/patches/chromium/disable-redraw-lock.patch @@ -15,7 +15,7 @@ the redraw locking mechanism, which fixes these issues. The electron issue can be found at https://github.com/electron/electron/issues/1821 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 41363666bbbec7a92ac563282816f0a058979bc7..82ec517dbd675ad8b4a78848b7d2a7f71512c2d5 100644 +index aabbdffa06268d5cd2b7ab46322d2db39e095cca..42d093965aa6d10a2d5f17fb9e0561adb60a5a70 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -307,6 +307,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500; diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index be8430b93e7f8..d4698e63c5bc0 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at https://crbug.com/634542 and https://crbug.com/711107. diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc -index f75e776fc6cae207a7ba42fa7d893b3e8cb02856..6a9563fe2a7570bb0109a8dab83983c3935f49c5 100644 +index 32cddc7ebb6f643bf81b395ce42ad8919719e5d6..a6eb50bad0bf0e05e91c5a7fa4a8d3f74886fa22 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc -@@ -1791,6 +1791,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( +@@ -1796,6 +1796,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace( gfx::ContentColorUsage content_color_usage) const { @@ -81,10 +81,10 @@ index f919df4d79a1168269c1538ac13a2a944586cf4e..fc34cf5d7dab95e7b6fc0576674b3e2b !command_line->HasSwitch(switches::kUIDisablePartialSwap); diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc -index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d07259b74dfaa 100644 +index 6eb1aa1766528176a1b9b77596031494f8b4fc00..67cc9e57b28d0544256c36c2744917e22b1cf43b 100644 --- a/components/viz/service/display/gl_renderer.cc +++ b/components/viz/service/display/gl_renderer.cc -@@ -87,6 +87,9 @@ +@@ -89,6 +89,9 @@ using gpu::gles2::GLES2Interface; @@ -94,7 +94,7 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 namespace viz { namespace { -@@ -677,8 +680,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad, +@@ -679,8 +682,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad, void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) { SetBlendEnabled(quad->ShouldDrawWithBlending()); @@ -106,7 +106,7 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 // Use the full quad_rect for debug quads to not move the edges based on // partial swaps. -@@ -1668,7 +1672,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params, +@@ -1670,7 +1674,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params, params->use_color_matrix, tint_gl_composited_content_, params->apply_shader_based_rounded_corner && ShouldApplyRoundedCorner(params->quad)), @@ -116,7 +116,7 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 } void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) { -@@ -2141,15 +2146,16 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad, +@@ -2143,15 +2148,16 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad, SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA, tint_gl_composited_content_, ShouldApplyRoundedCorner(quad)), @@ -136,7 +136,7 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 gfx::ColorTransform::TriStim col(color_f.fR, color_f.fG, color_f.fB); color_transform->Transform(&col, 1); color_f.fR = col.x(); -@@ -2371,7 +2377,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad, +@@ -2373,7 +2379,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad, : NON_PREMULTIPLIED_ALPHA, false, false, tint_gl_composited_content_, ShouldApplyRoundedCorner(quad)), @@ -146,7 +146,7 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 if (current_program_->tint_color_matrix_location() != -1) { auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix(); -@@ -2470,7 +2477,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad, +@@ -2472,7 +2479,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad, !quad->ShouldDrawWithBlending(), has_tex_clamp_rect, tint_gl_composited_content_, ShouldApplyRoundedCorner(quad)), @@ -156,7 +156,7 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 if (current_program_->tint_color_matrix_location() != -1) { auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix(); -@@ -2580,7 +2588,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad, +@@ -2582,7 +2590,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad, // The source color space should never be RGB. DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB()); @@ -166,7 +166,7 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 #if defined(OS_WIN) // Force sRGB output on Windows for overlay candidate video quads to match -@@ -2761,7 +2770,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad, +@@ -2763,7 +2772,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad, SetUseProgram(ProgramKey::VideoStream(tex_coord_precision, ShouldApplyRoundedCorner(quad)), @@ -176,7 +176,7 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id()); -@@ -2832,8 +2842,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) { +@@ -2834,8 +2844,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) { draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR); // Bind the program to the GL state. @@ -184,21 +184,21 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 - CurrentRenderPassColorSpace(), + SetUseProgram(draw_cache_.program_key, PATCH_CS(locked_quad.color_space()), + PATCH_CS(CurrentRenderPassColorSpace()), - /*adjust_src_white_level=*/draw_cache_.is_video_frame); + /*adjust_src_white_level=*/draw_cache_.is_video_frame, + locked_quad.hdr_metadata()); - if (current_program_->rounded_corner_rect_location() != -1) { -@@ -3661,7 +3671,9 @@ void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color, - const gfx::ColorSpace& src_color_space, +@@ -3666,7 +3676,9 @@ void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color, const gfx::ColorSpace& dst_color_space, - bool adjust_src_white_level) { + bool adjust_src_white_level, + absl::optional hdr_metadata) { - DCHECK(dst_color_space.IsValid()); + if (settings_->enable_color_correct_rendering) { + DCHECK(dst_color_space.IsValid()); + } gfx::ColorSpace adjusted_src_color_space = src_color_space; - if (adjust_src_white_level) { - // If the input color space is HDR, and it did not specify a white level, -@@ -4040,9 +4052,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource( + if (adjust_src_white_level && src_color_space.IsHDR()) { + // TODO(b/183236148): consider using the destination's HDR static metadata +@@ -4050,9 +4062,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource( cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple); } @@ -211,7 +211,7 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 *new_bounds = gfx::RectF(updated_dst_rect.origin(), gfx::SizeF((*overlay_texture)->texture.size())); -@@ -4262,8 +4274,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) { +@@ -4272,8 +4284,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) { PrepareGeometry(SHARED_BINDING); @@ -222,14 +222,14 @@ index f2032b6f0f3794dac20f690421369cf33356394b..e6261f1e4e85470084ce37aa043d0725 gfx::Transform render_matrix; render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(), -@@ -4453,3 +4465,5 @@ GLRenderer::OverlayTexture::OverlayTexture() = default; +@@ -4463,3 +4475,5 @@ GLRenderer::OverlayTexture::OverlayTexture() = default; GLRenderer::OverlayTexture::~OverlayTexture() = default; } // namespace viz + +#undef PATCH_CS diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc -index f0689a0342831498b5bde01af92839137cc0ac87..47541cb43e55b01b59f1680a8628973cc6a22afb 100644 +index 262633bdb89ffefb78091788b4b48d23e0e473e6..69016f864405f87a5ee161b52b9dacf909c52949 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -225,6 +225,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( @@ -241,7 +241,7 @@ index f0689a0342831498b5bde01af92839137cc0ac87..47541cb43e55b01b59f1680a8628973c 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 c54084b7b1b7b3459a4b34f4afc0891db5cdb6a7..b5b89e2c1d97b9a1f0979f76a1ac1acbd435f677 100644 +index aa5b91076df81cf32f6aa1e128073c278234a684..9e7f587deb1be9f6043784c6ad9a7dc934c264f3 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -213,6 +213,7 @@ @@ -252,7 +252,7 @@ index c54084b7b1b7b3459a4b34f4afc0891db5cdb6a7..b5b89e2c1d97b9a1f0979f76a1ac1acb #include "ui/gl/gl_switches.h" #include "ui/native_theme/native_theme_features.h" #include "url/origin.h" -@@ -3237,6 +3238,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -3313,6 +3314,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { @@ -315,7 +315,7 @@ index f5751beeb390b556dde8598b67b5fc9270e6805b..b155ad47f19950602000cecba52b1176 // 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 e5fd0a36f83e14f13ad37525266076d791829900..f75d17d9506e7f9aad9f95a9a2026db4dda2706e 100644 +index 4e22b4cf0bd06955af5fbac32db084f41d547545..087ec6df3e7cf53e0d79c7b3edb581dc426ff3a3 100644 --- a/ui/gfx/mac/io_surface.cc +++ b/ui/gfx/mac/io_surface.cc @@ -20,6 +20,7 @@ diff --git a/patches/chromium/disable_compositor_recycling.patch b/patches/chromium/disable_compositor_recycling.patch index 52a5d42c3182f..ac40833011b40 100644 --- a/patches/chromium/disable_compositor_recycling.patch +++ b/patches/chromium/disable_compositor_recycling.patch @@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron. diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index c4ba0addc40a9f9b304ae207b765a0ed6f1bcb45..2e21eb0b6fcb5de410e30617f1949590dc8427f2 100644 +index 4f4e4c0af566570e276090558c8427531a370ff5..b613b7462c548061d14b14fb6ef9151f7cc2a7ac 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -478,7 +478,11 @@ +@@ -482,7 +482,11 @@ return; host()->WasHidden(); diff --git a/patches/chromium/disable_hidden.patch b/patches/chromium/disable_hidden.patch index 69f53c4611060..c55a9d2b7bd53 100644 --- a/patches/chromium/disable_hidden.patch +++ b/patches/chromium/disable_hidden.patch @@ -6,10 +6,10 @@ Subject: disable_hidden.patch Electron uses this to disable background throttling for hidden windows. diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index b38b11e555791ca37646bc6fad9d31509cad0533..738920fccc048d0a4471dac407619afde3811def 100644 +index 499d2ce54fa960f61bd91c040baa8a989d9b3dc1..f25796e28c6381cc1a844026f9a81e0ce9ddef0f 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -712,6 +712,9 @@ void RenderWidgetHostImpl::WasHidden() { +@@ -744,6 +744,9 @@ void RenderWidgetHostImpl::WasHidden() { if (is_hidden_) return; @@ -20,10 +20,10 @@ index b38b11e555791ca37646bc6fad9d31509cad0533..738920fccc048d0a4471dac407619afd blink::mojom::PointerLockResult::kWrongDocument); diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h -index 1490224235f9a34fc76e688349e1bb86bbcbe967..eb2a4320080c15e1b884587cf0777f30846d99ff 100644 +index fc32f198f1aa66d11fc51a793e9d0e495f5acc36..f508236c9ae6f85a90f2e14269ee8ae7bd3625bd 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h -@@ -850,6 +850,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -855,6 +855,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl mojom::CreateFrameWidgetParamsPtr BindAndGenerateCreateFrameWidgetParamsForNewWindow(); @@ -34,7 +34,7 @@ index 1490224235f9a34fc76e688349e1bb86bbcbe967..eb2a4320080c15e1b884587cf0777f30 // |routing_id| must not be MSG_ROUTING_NONE. // If this object outlives |delegate|, DetachDelegate() must be called when diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc -index b8ae3c5d06c09139966accc3861e2c65d6310fb9..00de546240344c20548f05ff750a86223c9613ed 100644 +index d8365d0848719b16c8a068dd62861d37e2b10938..f9accc80b305d361dae0874da774e05067438059 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -595,7 +595,7 @@ void RenderWidgetHostViewAura::HideImpl() { diff --git a/patches/chromium/disable_unload_metrics.patch b/patches/chromium/disable_unload_metrics.patch index 1d239c96e6350..7e562361e314a 100644 --- a/patches/chromium/disable_unload_metrics.patch +++ b/patches/chromium/disable_unload_metrics.patch @@ -24,10 +24,10 @@ This patch temporarily disables the metrics so we can have green CI, and we should continue seeking for a real fix. diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc -index 3654c2b2511677afd472c4ccd62b20d3e81d240c..719cef1979ff95fa778fe11e5325a41d1d4751ba 100644 +index bf827d4e83fc3efb35de8dbb30f27bf3eef1394f..817824317183fa55fe1bc2aec224d4de6967e5a8 100644 --- a/content/browser/renderer_host/navigator.cc +++ b/content/browser/renderer_host/navigator.cc -@@ -1078,6 +1078,7 @@ void Navigator::RecordNavigationMetrics( +@@ -1059,6 +1059,7 @@ void Navigator::RecordNavigationMetrics( .InMilliseconds()); } @@ -35,7 +35,7 @@ index 3654c2b2511677afd472c4ccd62b20d3e81d240c..719cef1979ff95fa778fe11e5325a41d // If this is a same-process navigation and we have timestamps for unload // durations, fill those metrics out as well. if (params.unload_start && params.unload_end && -@@ -1124,6 +1125,7 @@ void Navigator::RecordNavigationMetrics( +@@ -1105,6 +1106,7 @@ void Navigator::RecordNavigationMetrics( first_before_unload_start_time) .InMilliseconds()); } diff --git a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch index 71dba43637dc6..af93a1119b82c 100644 --- a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch +++ b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch @@ -11,14 +11,14 @@ This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572 Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index ba517758ddd044a32e9c364bd803e0090d19b8cb..23717632bad15eaaf34d9190d242724cc1a4a07b 100644 +index 5193c3f4b1832bf0ccb070b91aa6439cd7e56571..d34db0be6911cc058828135b4873483a735586a9 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -2278,7 +2278,7 @@ blink::WebLocalFrame* RenderFrameImpl::GetWebFrame() { +@@ -2328,7 +2328,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const { } const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() { -- return GetWebFrame()->View()->GetWebPreferences(); +- return GetWebView()->GetWebPreferences(); + return render_view_->GetWebView()->GetWebPreferences(); } diff --git a/patches/chromium/enable_reset_aspect_ratio.patch b/patches/chromium/enable_reset_aspect_ratio.patch index d0775eeffaf7c..88fbe8016b59b 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -19,7 +19,7 @@ index fb8bbb639f6b6d93581b4eb6500a54deb331f18d..71a5b130e2c956f4d43c9a5b6a21f887 aspect_ratio.height()); } diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 82ec517dbd675ad8b4a78848b7d2a7f71512c2d5..4a44a9f5fe9ffa69ebd7bb10e02f7b6f8acdb21c 100644 +index 42d093965aa6d10a2d5f17fb9e0561adb60a5a70..b0e7ccdb24a28abce941a690c914ee9f01963775 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -928,8 +928,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) { diff --git a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch index 291a23a750499..d69cb4a3c766b 100644 --- a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch +++ b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch @@ -9,7 +9,7 @@ correctly tagged with MAP_JIT we need to use gins page allocator instead of the default V8 allocator. This probably can't be usptreamed. diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h -index 967ef1dffddfb4d6e30c7b97eacc099c70f4ef31..9c870947e2747c9c73bbf9a058a689b8b422f470 100644 +index fa0e7faad9296b9be8d662324c52f40e502f2e38..a579b359c684ccd72dcbe43f40b4aa7b4779c36b 100644 --- a/gin/public/v8_platform.h +++ b/gin/public/v8_platform.h @@ -25,6 +25,7 @@ class GIN_EXPORT V8Platform : public v8::Platform { diff --git a/patches/chromium/expose_setuseragent_on_networkcontext.patch b/patches/chromium/expose_setuseragent_on_networkcontext.patch index a17379ad56f94..5cc363f222c6d 100644 --- a/patches/chromium/expose_setuseragent_on_networkcontext.patch +++ b/patches/chromium/expose_setuseragent_on_networkcontext.patch @@ -33,10 +33,10 @@ index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a28970 DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings); }; diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index 81acb80ef2a52b2133dcc59a1214723345095f61..634ef00866805f3953327f92f572e370ac56e015 100644 +index f70cf0036d950a0fd5ccb2ea432f51231ca382f2..946c749fd69743fe1e4d3a3b724f7d16fbcd3685 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -1140,6 +1140,13 @@ void NetworkContext::SetNetworkConditions( +@@ -1141,6 +1141,13 @@ void NetworkContext::SetNetworkConditions( std::move(network_conditions)); } @@ -63,10 +63,10 @@ index 22e155061860f6782b261205f6297c09f8c6e1fa..656d1de560a1db7ff4973a9e087fcb7c void SetEnableReferrers(bool enable_referrers) override; #if BUILDFLAG(IS_CHROMEOS_ASH) diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 6f830a84d20e39b802b44465882f9ae0627a0759..b425a47d5a70267418fee69b55080ac05328a0b5 100644 +index 492a03d742702e2aaaf00cc77fdd53c8a8d968cd..30795a4ce31f22fe49511be96ba9865bc5ff8300 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -952,6 +952,9 @@ interface NetworkContext { +@@ -943,6 +943,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 30bbbbee90cf9..b2778f988ba46 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 ff5dda58a3db3efeea952f0ae75cf85575e1a12c..f68aefa3d56949f42690c2a807ccffa5d2fc89cd 100644 +index ac730780c3f643b7131b742bd8fb6fd34aae0d9b..4db50c1dc41b4b0bec636f885a1fad6a11c0b5b7 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -155,6 +155,7 @@ @@ -23,7 +23,7 @@ index ff5dda58a3db3efeea952f0ae75cf85575e1a12c..f68aefa3d56949f42690c2a807ccffa5 #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" -@@ -1787,6 +1788,16 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, +@@ -1788,6 +1789,16 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, RuntimeEnabledFeatures::SetTranslateServiceEnabled( prefs.translate_service_available); diff --git a/patches/chromium/feat_add_onclose_to_messageport.patch b/patches/chromium/feat_add_onclose_to_messageport.patch index 66ca524638be7..f08a974f56448 100644 --- a/patches/chromium/feat_add_onclose_to_messageport.patch +++ b/patches/chromium/feat_add_onclose_to_messageport.patch @@ -10,10 +10,10 @@ get this standardised, but in lieu of that, this makes MessagePort a whole bunch more useful! diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc -index 002ee34ce9a1bbcbdeb5c54967a2f22b1444cc85..c22870137449bf55a62f74d702e25fa6547baca3 100644 +index bacf27d57927dba10566b4c02ce12c6ed5c876c9..d0247e32a93447cfe3af286ae83bff958e6edcca 100644 --- a/third_party/blink/renderer/core/messaging/message_port.cc +++ b/third_party/blink/renderer/core/messaging/message_port.cc -@@ -158,6 +158,7 @@ void MessagePort::close() { +@@ -159,6 +159,7 @@ void MessagePort::close() { Entangle(pipe.TakePort0()); } closed_ = true; 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 0c3fd032ef588..53386d64701e3 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 @@ -26,10 +26,10 @@ index db0681f9278b4a60f6c25faf37fdb2aba41d65a6..58655f4285d3835b51c43e0b55fe15d9 } diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h -index 519e969c3088b9990cbc596aad7b87c5e1bfc133..a414b5a5dbdbf8c05d2a0f543fa498e2563c4566 100644 +index 2ba7ea70d901b17c3f8f98cb93e2bc8a97ec8853..ad2dc2a217bdc08820fc5311a2bda08e42182620 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h -@@ -403,6 +403,22 @@ class NATIVE_THEME_EXPORT NativeTheme { +@@ -404,6 +404,22 @@ class NATIVE_THEME_EXPORT NativeTheme { SkColor GetUnprocessedSystemColor(ColorId color_id, ColorScheme color_scheme) const; @@ -52,7 +52,7 @@ index 519e969c3088b9990cbc596aad7b87c5e1bfc133..a414b5a5dbdbf8c05d2a0f543fa498e2 // 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 -@@ -577,6 +593,7 @@ class NATIVE_THEME_EXPORT NativeTheme { +@@ -578,6 +594,7 @@ class NATIVE_THEME_EXPORT NativeTheme { bool forced_colors_ = false; PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight; PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference; @@ -61,10 +61,10 @@ index 519e969c3088b9990cbc596aad7b87c5e1bfc133..a414b5a5dbdbf8c05d2a0f543fa498e2 SEQUENCE_CHECKER(sequence_checker_); diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index ae908912cd5ea1b2cd43974e1b8ea1bc0c600042..d0a34eca1ded4cbba46fe1d0655a49018b667461 100644 +index eafe512bc90d967eaadddc2e355c418ecd7dd83a..581de5b8a056dc1d529568e7c4c1f5f48555f579 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -749,6 +749,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -748,6 +748,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { // ...unless --force-dark-mode was specified in which case caveat emptor. if (InForcedColorsMode() && !IsForcedDarkMode()) return false; diff --git a/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch b/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch index 7876d7c4cf3cb..8e2a5fc7c5db0 100644 --- a/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch +++ b/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch @@ -13,7 +13,7 @@ other protocols to register their streaming behavior. MultibufferDataSource::Ass then refers to the list so that it can correctly determine the data source's settings. diff --git a/media/blink/multibuffer_data_source.cc b/media/blink/multibuffer_data_source.cc -index c157471b08e12edf2ff5385e78cd4cbe2e8129a9..5ef9dbd289f50359f611290d6a42b2f2aac77977 100644 +index e43037d541ad5d387d71222d831e7119bbb7c278..d49b92f3605523c62cdc267b1424b06c345a0a8c 100644 --- a/media/blink/multibuffer_data_source.cc +++ b/media/blink/multibuffer_data_source.cc @@ -10,9 +10,11 @@ @@ -48,12 +48,12 @@ index c157471b08e12edf2ff5385e78cd4cbe2e8129a9..5ef9dbd289f50359f611290d6a42b2f2 + GetStreamingSchemes()->push_back(new_scheme); +} + - class MultibufferDataSource::ReadOperation { + class MultiBufferDataSource::ReadOperation { public: ReadOperation(int64_t position, -@@ -153,7 +167,14 @@ bool MultibufferDataSource::media_has_played() const { +@@ -153,7 +167,14 @@ bool MultiBufferDataSource::media_has_played() const { - bool MultibufferDataSource::AssumeFullyBuffered() const { + bool MultiBufferDataSource::AssumeFullyBuffered() const { DCHECK(url_data_); - return !url_data_->url().SchemeIsHTTPOrHTTPS(); + @@ -66,12 +66,12 @@ index c157471b08e12edf2ff5385e78cd4cbe2e8129a9..5ef9dbd289f50359f611290d6a42b2f2 + return true; } - void MultibufferDataSource::SetReader(MultiBufferReader* reader) { + void MultiBufferDataSource::SetReader(MultiBufferReader* reader) { diff --git a/media/blink/multibuffer_data_source.h b/media/blink/multibuffer_data_source.h -index 2f35c43811e98679c739d1d672fd6dce517ea24f..b598d58c26a12f0e97ecfcb611baf46a86af4a62 100644 +index 1ee6944629ab348f327848f6bda8b521e9fc3db4..3c4dfcf25ec67a8ca1e3a2ae1941386990e63827 100644 --- a/media/blink/multibuffer_data_source.h +++ b/media/blink/multibuffer_data_source.h -@@ -32,6 +32,8 @@ class BufferedDataSourceHost; +@@ -31,6 +31,8 @@ class BufferedDataSourceHost; class MediaLog; class MultiBufferReader; diff --git a/patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch b/patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch index ccc15a2166a0f..a7a61f6813606 100644 --- a/patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch +++ b/patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch @@ -7,10 +7,10 @@ Subject: feat: allow embedders to add observers on created hunspell This patch is used by Electron to implement spellchecker events. diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc -index 14e9f03d5663e68082827fb0a00f61ca03ead8d0..4ff0bc6f55de133aa0622690665ddcf42c791f5a 100644 +index 340667d184550f09077c0c6afb3e0befc9f3044e..c60be9ac250466dc882d950c4ec64787c0c19053 100644 --- a/chrome/browser/spellchecker/spellcheck_service.cc +++ b/chrome/browser/spellchecker/spellcheck_service.cc -@@ -482,6 +482,9 @@ void SpellcheckService::LoadDictionaries() { +@@ -466,6 +466,9 @@ void SpellcheckService::LoadDictionaries() { std::make_unique( dictionary, platform_spellcheck_language, context_, this)); hunspell_dictionaries_.back()->AddObserver(this); @@ -20,7 +20,7 @@ index 14e9f03d5663e68082827fb0a00f61ca03ead8d0..4ff0bc6f55de133aa0622690665ddcf4 hunspell_dictionaries_.back()->Load(); } -@@ -534,6 +537,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const { +@@ -518,6 +521,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const { (!hunspell_dictionaries_.empty() || enable_if_uninitialized); } 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 4238bd1758483..b4729ddd45726 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -532,7 +532,7 @@ index 83a23404d1c029af6f7e7aa695bfe60e71d86fde..eef92d3366715774670ebcdcb76ad84d compositor_data.display_client->GetBoundRemote(resize_task_runner_); diff --git a/services/viz/privileged/mojom/compositing/display_private.mojom b/services/viz/privileged/mojom/compositing/display_private.mojom -index 409115f95787e3cf037f762a33368b173441012f..45a7a1607b8711420ba4e1a5455a61fb7d8b75ac 100644 +index 03ad7c39128fc408d576a23e595021ffa3238423..de1c1f6984f8d81081643415d1724bce333ca940 100644 --- a/services/viz/privileged/mojom/compositing/display_private.mojom +++ b/services/viz/privileged/mojom/compositing/display_private.mojom @@ -90,7 +90,6 @@ interface DisplayClient { @@ -567,10 +567,10 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h -index fe4e33a62087ce5714c897d75373c061f9a1d3f9..35daaf212772863b6b5def361ad5d467af7dabd2 100644 +index 5bf36e2873bfb7dfa46ca6f010c780f1f02235ac..0378d1246930c3dc4ac8b4d1886fc5dc497dcb66 100644 --- a/ui/compositor/compositor.h +++ b/ui/compositor/compositor.h -@@ -80,6 +80,7 @@ class DisplayPrivate; +@@ -81,6 +81,7 @@ class DisplayPrivate; class ExternalBeginFrameController; } // namespace mojom class ContextProvider; @@ -578,7 +578,7 @@ index fe4e33a62087ce5714c897d75373c061f9a1d3f9..35daaf212772863b6b5def361ad5d467 class HostFrameSinkManager; class LocalSurfaceId; class RasterContextProvider; -@@ -136,6 +137,16 @@ class COMPOSITOR_EXPORT ContextFactory { +@@ -137,6 +138,16 @@ class COMPOSITOR_EXPORT ContextFactory { virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0; }; @@ -595,7 +595,7 @@ index fe4e33a62087ce5714c897d75373c061f9a1d3f9..35daaf212772863b6b5def361ad5d467 // Compositor object to take care of GPU painting. // A Browser compositor object is responsible for generating the final // displayable form of pixels comprising a single widget's contents. It draws an -@@ -171,6 +182,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -172,6 +183,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -605,7 +605,7 @@ index fe4e33a62087ce5714c897d75373c061f9a1d3f9..35daaf212772863b6b5def361ad5d467 // Sets the root of the layer tree drawn by this Compositor. The root layer // must have no parent. The compositor's root layer is reset if the root layer // is destroyed. NULL can be passed to reset the root layer, in which case the -@@ -442,6 +456,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -443,6 +457,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, std::unique_ptr pending_begin_frame_args_; diff --git a/patches/chromium/fix_check_issecureeventinputenabled_in_constructor_before_setting.patch b/patches/chromium/fix_check_issecureeventinputenabled_in_constructor_before_setting.patch deleted file mode 100644 index c34d3cfd2297b..0000000000000 --- a/patches/chromium/fix_check_issecureeventinputenabled_in_constructor_before_setting.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: John Kleinschmidt -Date: Thu, 9 Jul 2020 11:16:30 -0400 -Subject: fix: check IsSecureEventInputEnabled in constructor before setting - SetPasswordInputEnabled to true - -It appears that macOS 12 has IsSecureEventInputEnabled set to true initially. - -diff --git a/ui/base/cocoa/secure_password_input.mm b/ui/base/cocoa/secure_password_input.mm -index c9d003216ec51407d80b2c3ed0a77e747d203069..f10829d7fe369d2419bb1f0828d6d1ec7c8f57e1 100644 ---- a/ui/base/cocoa/secure_password_input.mm -+++ b/ui/base/cocoa/secure_password_input.mm -@@ -41,7 +41,7 @@ void SetPasswordInputEnabled(bool enabled) { - namespace ui { - - ScopedPasswordInputEnabler::ScopedPasswordInputEnabler() { -- if (!g_password_input_counter) { -+ if (!g_password_input_counter && !IsSecureEventInputEnabled()) { - SetPasswordInputEnabled(true); - } - ++g_password_input_counter; diff --git a/patches/chromium/fix_export_zlib_symbols.patch b/patches/chromium/fix_export_zlib_symbols.patch index 2e5b209607535..d93e637fa7b9c 100644 --- a/patches/chromium/fix_export_zlib_symbols.patch +++ b/patches/chromium/fix_export_zlib_symbols.patch @@ -6,7 +6,7 @@ Subject: fix: export zlib symbols This patch sets ZLIB_DLL so that we properly export zlib symbols. diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn -index d64cb38bcdab4fbf9449f259d4dd62d39edcbfe1..6e4cd5c43d98145df2eca6b1dbe6d0e4047c2750 100644 +index 74ecbd19ae270e3fead8702187aa0c78d42fcc4d..72cb46657a800259ce6541164909694fd54a3aaf 100644 --- a/third_party/zlib/BUILD.gn +++ b/third_party/zlib/BUILD.gn @@ -301,6 +301,10 @@ component("zlib") { diff --git a/patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch b/patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch index 4038c1dce0f10..72a8ee82955a8 100644 --- a/patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch +++ b/patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch @@ -8,31 +8,33 @@ we invoke it in order to expose contents.decrementCapturerCount([stayHidden, sta to users. We should try to upstream this. diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h -index 5212e1547796cae0c2c2508e5c0fcdab18190895..db8b468eecca3e980075072e50863738c280e1a2 100644 +index de9f77c4fe4dda9005e7211fba22c496008e6d98..28d401ae1ebb1d6f94d5069003d1bc5546e5449e 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h -@@ -1738,9 +1738,11 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, - // shown in the address bar), as opposed to one in for example a Prerender. - bool IsPrimaryFrameTree(const FrameTree& frame_tree) const; +@@ -1771,10 +1771,12 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, + // outermost frame trees in this WebContents. + std::vector GetOutermostMainFrames(); + public: // Called when the base::ScopedClosureRunner returned by // IncrementCapturerCount() is destructed. - void DecrementCapturerCount(bool stay_hidden, bool stay_awake); + void DecrementCapturerCount(bool stay_hidden, bool stay_awake) override; -+ private: ++ private: // Calculates the PageVisibilityState for |visibility|, taking the capturing // state into account. + PageVisibilityState CalculatePageVisibilityState(Visibility visibility) const; diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index 3b7b5facc0cd2454a83f9034d63add1e684f438c..409bd016ee867d2e826feb441b6b8f15f56c0dd6 100644 +index e4e70e4d378cf13eb00d7327b88e2501dcfc7f84..7c0d9ee9311de772f8966bacf7908480b89c7915 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h -@@ -561,6 +561,7 @@ class WebContents : public PageNavigator, - const gfx::Size& capture_size, +@@ -582,6 +582,8 @@ class WebContents : public PageNavigator, bool stay_hidden, bool stay_awake) WARN_UNUSED_RESULT = 0; -+ virtual void DecrementCapturerCount(bool stay_hidden, bool stay_awake) = 0; - // Returns true if audio/screenshot/video is being captured by the embedder, - // as indicated by calls to IncrementCapturerCount(). ++ virtual void DecrementCapturerCount(bool stay_hidden, bool stay_awake) = 0; ++ + // Getter for the capture handle, which allows a captured application to + // opt-in to exposing information to its capturer(s). + virtual const blink::mojom::CaptureHandleConfig& GetCaptureHandleConfig() = 0; diff --git a/patches/chromium/fix_properly_honor_printing_page_ranges.patch b/patches/chromium/fix_properly_honor_printing_page_ranges.patch index 7652d31f9033e..c3c89f82da506 100644 --- a/patches/chromium/fix_properly_honor_printing_page_ranges.patch +++ b/patches/chromium/fix_properly_honor_printing_page_ranges.patch @@ -10,10 +10,10 @@ them should they exist. This will be upstreamed. diff --git a/printing/printing_context_mac.h b/printing/printing_context_mac.h -index 07fcfad6ecf676068d3f0b44f97e748d58b13016..f165eea20ca3b120f5fb499248d65fa7befc7686 100644 +index 0fb5c91b8abcdd7e674251bafebfc2c51044ef77..8c134bae25afeb0dbbb6e33182f053bb34e2f978 100644 --- a/printing/printing_context_mac.h +++ b/printing/printing_context_mac.h -@@ -82,6 +82,10 @@ class COMPONENT_EXPORT(PRINTING) PrintingContextMac : public PrintingContext { +@@ -83,6 +83,10 @@ class COMPONENT_EXPORT(PRINTING) PrintingContextMac : public PrintingContext { // Returns true if the orientation was set. bool SetOrientationIsLandscape(bool landscape); @@ -25,10 +25,10 @@ index 07fcfad6ecf676068d3f0b44f97e748d58b13016..f165eea20ca3b120f5fb499248d65fa7 // Returns true if duplex mode is set. bool SetDuplexModeInPrintSettings(mojom::DuplexMode mode); diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm -index 1a52ea3cd11b3ec573cfef6f6f03ab39fcb998d6..c8a17ef24a4bb62fc03b361d5153acc8f0098c6b 100644 +index 9f80fe6f10515849dd02d580db9852e6fbbbaa30..67f5b76a8141857ba02abd806341f06b07a4ebdc 100644 --- a/printing/printing_context_mac.mm +++ b/printing/printing_context_mac.mm -@@ -189,7 +189,8 @@ PMPaper MatchPaper(CFArrayRef paper_list, +@@ -190,7 +190,8 @@ PMPaper MatchPaper(CFArrayRef paper_list, !SetCollateInPrintSettings(settings_->collate()) || !SetDuplexModeInPrintSettings(settings_->duplex_mode()) || !SetOutputColor(static_cast(settings_->color())) || @@ -38,7 +38,7 @@ index 1a52ea3cd11b3ec573cfef6f6f03ab39fcb998d6..c8a17ef24a4bb62fc03b361d5153acc8 return OnError(); } } -@@ -342,6 +343,22 @@ PMPaper MatchPaper(CFArrayRef paper_list, +@@ -343,6 +344,22 @@ PMPaper MatchPaper(CFArrayRef paper_list, return PMSetCopies(print_settings, copies, false) == noErr; } @@ -100,7 +100,7 @@ index fe7fc797504dcc7097a3d79a2dab2c18de737048..20c63b1f657f2969850b31eaafdff7e5 } else { // No need to bother, we don't know how many pages are available. diff --git a/ui/gtk/printing/print_dialog_gtk.cc b/ui/gtk/printing/print_dialog_gtk.cc -index 5e7dd30b97c4ca3e6f14636955791ab0c6b63d6d..11a521a5f261e8306a7159487ffad6e4f990a0b2 100644 +index 62108f0eb91fd04235d29a5e010aa600f76f8288..0e21b30dbe3f6daca9dce6d2b89b063c13d044ee 100644 --- a/ui/gtk/printing/print_dialog_gtk.cc +++ b/ui/gtk/printing/print_dialog_gtk.cc @@ -238,6 +238,24 @@ void PrintDialogGtk::UpdateSettings( diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index 5de67a7752451..8ebb04baac185 100644 --- a/patches/chromium/frame_host_manager.patch +++ b/patches/chromium/frame_host_manager.patch @@ -6,10 +6,10 @@ Subject: frame_host_manager.patch Allows embedder to intercept site instances created by chromium. diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc -index 6d84bf99d112eb2877cc1b022a90cee4d1043b0a..0b03f38856a6a0b7896b7432ad10d1ef8d92a34e 100644 +index 2b89bf4e6073f4f4c7b8c6a6005efdaf64c7a7b5..9c507c6f227580fd0f8d717ca0b11a545eca6d98 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc -@@ -2942,6 +2942,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -2929,6 +2929,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request->ResetStateForSiteInstanceChange(); } @@ -20,10 +20,10 @@ index 6d84bf99d112eb2877cc1b022a90cee4d1043b0a..0b03f38856a6a0b7896b7432ad10d1ef } diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index c24c05c17e5511d247fb93a4f987dd852742b5a4..57fac275ce40087e8928df51f50f191e07690e42 100644 +index 31414b7818ecb333be7cff85195d06c850202c6b..ec3a452d43a08fe9edca1073f8b1c56771c42e41 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -263,6 +263,11 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -265,6 +265,11 @@ class CONTENT_EXPORT ContentBrowserClient { virtual ~ContentBrowserClient() = default; diff --git a/patches/chromium/gin_enable_disable_v8_platform.patch b/patches/chromium/gin_enable_disable_v8_platform.patch index 7956923fd7a2a..9cc7342444ee3 100644 --- a/patches/chromium/gin_enable_disable_v8_platform.patch +++ b/patches/chromium/gin_enable_disable_v8_platform.patch @@ -38,10 +38,10 @@ index eaf06bd895f3ed390d1b206b2dc5adcca5c87e72..6bd634c4a66999648c51b8867c0d9b0c v8::Isolate* isolate() { return isolate_; } diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc -index f4d6372c79a7e0b91df287be19494129c391d50d..7e247ee07de099a3cff1cdfdf2dabe207d3c648b 100644 +index 8bac97b6809a1f09020db980790d538c8ff03033..5230314293c6970d99f3700ec616eb99f5fd5dbd 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc -@@ -216,12 +216,14 @@ void SetV8FlagsFormatted(const char* format, ...) { +@@ -207,12 +207,14 @@ void SetV8FlagsFormatted(const char* format, ...) { } // namespace // static diff --git a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch index 2bbbd749e02d5..d4284aec57cdc 100644 --- a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch +++ b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch @@ -40,7 +40,7 @@ index 9b75a03bb11bb9e9338017a1a287209bdb0636c5..aab43444bdb1a968d9c880028144ac81 // Update the GPU feature info. This updates the blocklist and enabled status // of GPU rasterization. In the future this will be used for more features. diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc -index 82c37883b0760e283e1539d3c7d14176a25e9bbd..d48f443c5ea0ebd7b42f23eb1ef72a31d6e2bb37 100644 +index 420dbbdfab57b18edc0ea646acac6d9d8748471d..7f00895f75177016045cbd016bc55cbec0a5f4ee 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -1082,6 +1082,11 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { @@ -56,10 +56,10 @@ index 82c37883b0760e283e1539d3c7d14176a25e9bbd..d48f443c5ea0ebd7b42f23eb1ef72a31 void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo( diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h -index 9fcaec43515ca2a488ddee08e9dd275c966a7d40..b8508a6c11d46a7f3c7e3143924ced78a2b3ddc0 100644 +index c679229beae9440a9fc92f39be76a1d37065d586..a0468d452604a5dee05f5dd5d0bb6256d2808aea 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.h +++ b/content/browser/gpu/gpu_data_manager_impl_private.h -@@ -76,6 +76,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { +@@ -77,6 +77,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { bool VulkanRequested() const; void PostCreateThreads(); void TerminateInfoCollectionGpuProcess(); diff --git a/patches/chromium/gritsettings_resource_ids.patch b/patches/chromium/gritsettings_resource_ids.patch index b0a52c9bec62b..232d872399ea3 100644 --- a/patches/chromium/gritsettings_resource_ids.patch +++ b/patches/chromium/gritsettings_resource_ids.patch @@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch Add electron resources file to the list of resource ids generation. diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec -index c149ea34605b6640fffb0f84cf9dac3ab8fa2e49..11f211b65fddee011fedd0ff281a71549598d6b5 100644 +index a67a4b93e9551d33c4daf419512598d56ef330f2..3a46809edea6ae0906d2591afc69e2db1259033a 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec -@@ -765,6 +765,11 @@ +@@ -781,6 +781,11 @@ "includes": [3880], }, diff --git a/patches/chromium/hack_plugin_response_interceptor_to_point_to_electron.patch b/patches/chromium/hack_plugin_response_interceptor_to_point_to_electron.patch index 35e37fe4162cd..9ddd673caa6a9 100644 --- a/patches/chromium/hack_plugin_response_interceptor_to_point_to_electron.patch +++ b/patches/chromium/hack_plugin_response_interceptor_to_point_to_electron.patch @@ -8,7 +8,7 @@ require a largeish patch to get working, so just redirect it to our implementation instead. diff --git a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc -index b264d431b0581fa88bd2a22a2736cf7c853cdb16..a4b29f3911b6c93732adbda61a2c92356cabd294 100644 +index f993f92509620752c861e7ae447bc375f1453e80..4f562b30cbb6079ecf62c54e1538cca4140f497c 100644 --- a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc +++ b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc @@ -9,8 +9,8 @@ diff --git a/patches/chromium/mas_disable_custom_window_frame.patch b/patches/chromium/mas_disable_custom_window_frame.patch index caa485004d591..2e8f7963b76ba 100644 --- a/patches/chromium/mas_disable_custom_window_frame.patch +++ b/patches/chromium/mas_disable_custom_window_frame.patch @@ -95,7 +95,7 @@ index 5a23ea7558814eec59eda349bc7194afcb70d01e..c9147bbe5a225291552082434e5db342 // The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that // can only be accomplished by overriding methods. diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -index 73e450939f1232bb8f2e19067c15c1f465ca6745..a19db25096260258ae2debc16bc5612edd62e411 100644 +index e301610a2d7cc0559e1bca7947f4f557b32b3c94..c98a6a1d02a607bb30869c14e915ed12f1941b91 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm @@ -16,7 +16,9 @@ diff --git a/patches/chromium/mas_disable_remote_accessibility.patch b/patches/chromium/mas_disable_remote_accessibility.patch index af7ecbb674105..7933c031c4008 100644 --- a/patches/chromium/mas_disable_remote_accessibility.patch +++ b/patches/chromium/mas_disable_remote_accessibility.patch @@ -44,7 +44,7 @@ index 9ddda9116e7284cbccde8a51e23ad7560dd06367..e846091ad99b0154636489e53491209f } // namespace diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -index f20d8147d52df79b27e65036d947d3a8fbef93e4..f176e98283a86bd63109f3d2aa2754081d7bb4ed 100644 +index def66d5040d17537decbfe596356ef11dc2471bd..f7b305c5916ee35a4f35a0051c38f9dfc3ed456d 100644 --- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm +++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm @@ -559,10 +559,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { @@ -114,10 +114,10 @@ index 3116e9098aad4fab8d1f8d2bb74b2437548b3566..1bb3ed4c7ec4f03c2512c6321c016fac // Used to force the NSApplication's focused accessibility element to be the // content::BrowserAccessibilityCocoa accessibility tree when the NSView for diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index e8364021255814f7d3d41688f623a189bc44f52e..c4ba0addc40a9f9b304ae207b765a0ed6f1bcb45 100644 +index 9ac29edf10f8ffd2e1e4db549a7977d8f26e8c22..4f4e4c0af566570e276090558c8427531a370ff5 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -241,8 +241,10 @@ +@@ -240,8 +240,10 @@ void RenderWidgetHostViewMac::MigrateNSViewBridge( remote_cocoa::mojom::Application* remote_cocoa_application, uint64_t parent_ns_view_id) { @@ -128,7 +128,7 @@ index e8364021255814f7d3d41688f623a189bc44f52e..c4ba0addc40a9f9b304ae207b765a0ed // Disconnect from the previous bridge (this will have the effect of // destroying the associated bridge), and close the receiver (to allow it -@@ -1435,8 +1437,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1438,8 +1440,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, gfx::NativeViewAccessible RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() { @@ -139,7 +139,7 @@ index e8364021255814f7d3d41688f623a189bc44f52e..c4ba0addc40a9f9b304ae207b765a0ed return [GetInProcessNSView() window]; } -@@ -1480,9 +1484,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1483,9 +1487,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, } void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) { @@ -151,7 +151,7 @@ index e8364021255814f7d3d41688f623a189bc44f52e..c4ba0addc40a9f9b304ae207b765a0ed } bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame( -@@ -1976,12 +1982,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1979,12 +1985,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken( const std::vector& window_token) { @@ -167,10 +167,10 @@ index e8364021255814f7d3d41688f623a189bc44f52e..c4ba0addc40a9f9b304ae207b765a0ed /////////////////////////////////////////////////////////////////////////////// diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index a7fd3c7812a65cd10a53a2e29e7dd50b0aa428e9..f19cba3289def3fbd70b6106f7c4491b320bf608 100644 +index a6b721245a5b141b7ee3170b92335a5f89eaebb6..8a370c537f62ee2246f0d64ee1f1f1613e76bf29 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn -@@ -328,6 +328,13 @@ component("base") { +@@ -320,6 +320,13 @@ component("base") { ] } @@ -205,7 +205,7 @@ index e7adfee3210ec723c687adfcc4bee8827ef643e7..25a924a47eeb30d783ef83dbb4896c4b + #endif // UI_BASE_COCOA_REMOTE_ACCESSIBILITY_API_H_ diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h -index b6d860060e4ba86d8871bd19e7011a64eb057350..040a18fa5049698429d2c51b52d3240977657751 100644 +index c164c3a8b28172a5c6d3a82b7ffdb48222328e60..de717b3603158d7baf71e32ce37b6398e2f6590d 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.h +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h @@ -30,7 +30,9 @@ @@ -218,7 +218,7 @@ index b6d860060e4ba86d8871bd19e7011a64eb057350..040a18fa5049698429d2c51b52d32409 @class NSView; namespace remote_cocoa { -@@ -416,11 +418,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost +@@ -418,11 +420,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost mojo::AssociatedRemote remote_ns_window_remote_; @@ -233,7 +233,7 @@ index b6d860060e4ba86d8871bd19e7011a64eb057350..040a18fa5049698429d2c51b52d32409 // Used to force the NSApplication's focused accessibility element to be the // views::Views accessibility tree when the NSView for this is focused. diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm -index 1de90c3bf77b2b1d69d10cd0fbe6e963f7b48861..f437109802677f1c237116eadfc2952249daf084 100644 +index d20f9af87220533749bc4897f87c51f91ce1a091..564bcca78a451f6504d66f60e0a936ce934f2304 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm @@ -285,14 +285,22 @@ void HandleAccelerator(const ui::Accelerator& accelerator, @@ -259,7 +259,7 @@ index 1de90c3bf77b2b1d69d10cd0fbe6e963f7b48861..f437109802677f1c237116eadfc29522 } remote_cocoa::mojom::NativeWidgetNSWindow* -@@ -1173,6 +1181,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -1193,6 +1201,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator, void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens( const std::vector& window_token, const std::vector& view_token) { @@ -267,7 +267,7 @@ index 1de90c3bf77b2b1d69d10cd0fbe6e963f7b48861..f437109802677f1c237116eadfc29522 remote_window_accessible_ = ui::RemoteAccessibility::GetRemoteElementFromToken(window_token); remote_view_accessible_ = -@@ -1180,14 +1189,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -1200,14 +1209,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator, [remote_view_accessible_ setWindowUIElement:remote_window_accessible_.get()]; [remote_view_accessible_ setTopLevelUIElement:remote_window_accessible_.get()]; diff --git a/patches/chromium/mas_no_private_api.patch b/patches/chromium/mas_no_private_api.patch index 8e8051b65490e..549bf58c79f13 100644 --- a/patches/chromium/mas_no_private_api.patch +++ b/patches/chromium/mas_no_private_api.patch @@ -46,18 +46,18 @@ index 65adc773e82d99c5dd57d52e84a71e67d676be13..f5d0318c1c4fa036a233142cd6eea0a0 NSArray* node_array, const LineIndexer* line_indexer) const { diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm -index 754d25d76da46d5a02973e314893e8d70fcf9b68..cfefed563c59f7f97304b4cb7d5b008da713fc3c 100644 +index 9e659cffb60ceec3d9f9ece23a524229e3eba565..36218d5179ea2f9935e1d8869f9205885c0bd6a4 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm +++ b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm -@@ -177,6 +177,7 @@ - if (property_name == "AXIndexForChildUIElement") { // UIElement +@@ -186,6 +186,7 @@ + property_name == "AXTextMarkerRangeForUIElement") { // UIElement return OptionalNSObject::NotNilOrError(PropertyNodeToUIElement(arg_node)); } +#ifndef MAS_BUILD if (property_name == "AXIndexForTextMarker") { // TextMarker return OptionalNSObject::NotNilOrError(PropertyNodeToTextMarker(arg_node)); } -@@ -184,6 +185,7 @@ +@@ -193,6 +194,7 @@ return OptionalNSObject::NotNilOrError( PropertyNodeToTextMarkerRange(arg_node)); } @@ -65,7 +65,7 @@ index 754d25d76da46d5a02973e314893e8d70fcf9b68..cfefed563c59f7f97304b4cb7d5b008d return OptionalNSObject::NotApplicable(); } -@@ -249,6 +251,7 @@ +@@ -258,6 +260,7 @@ return uielement; } @@ -73,7 +73,7 @@ index 754d25d76da46d5a02973e314893e8d70fcf9b68..cfefed563c59f7f97304b4cb7d5b008d id AttributeInvoker::DictNodeToTextMarker( const AXPropertyNode& dictnode) const { if (!dictnode.IsDict()) { -@@ -356,6 +359,7 @@ OptionalNSObject TextMarkerRangeGetEndMarker(const OptionalNSObject& obj) { +@@ -365,6 +368,7 @@ OptionalNSObject TextMarkerRangeGetEndMarker(const OptionalNSObject& obj) { return OptionalNSObject::NotNilOrError(content::AXTextMarkerFrom( cocoa_node, range.focus()->text_offset(), range.focus()->affinity())); } @@ -471,10 +471,10 @@ index c15f3a631292b538698625328fb429ee3c9964f5..37e038753ecf1b82ec92c06b2c0729b5 } diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm -index c1b17a752c12b3fba2275ff09896a2bd5ee53546..e9675f50499d8d260410a29252f0d3fdac3c226c 100644 +index 717daca205b64ddbaf138f88400683dafac1a270..50ce32674525567b24b387e64b27f815585e61a0 100644 --- a/device/bluetooth/bluetooth_adapter_mac.mm +++ b/device/bluetooth/bluetooth_adapter_mac.mm -@@ -43,6 +43,7 @@ +@@ -42,6 +42,7 @@ #include "device/bluetooth/bluetooth_socket_mac.h" #include "device/bluetooth/public/cpp/bluetooth_address.h" @@ -482,7 +482,7 @@ index c1b17a752c12b3fba2275ff09896a2bd5ee53546..e9675f50499d8d260410a29252f0d3fd extern "C" { // Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and // `Karabiner` [3] to programmatically control the Bluetooth state. Calling the -@@ -56,6 +57,7 @@ +@@ -55,6 +56,7 @@ // [4] https://support.apple.com/kb/PH25091 void IOBluetoothPreferenceSetControllerPowerState(int state); } @@ -490,7 +490,7 @@ index c1b17a752c12b3fba2275ff09896a2bd5ee53546..e9675f50499d8d260410a29252f0d3fd namespace { -@@ -124,8 +126,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { +@@ -123,8 +125,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { controller_state_function_( base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState, base::Unretained(this))), @@ -501,7 +501,7 @@ index c1b17a752c12b3fba2275ff09896a2bd5ee53546..e9675f50499d8d260410a29252f0d3fd classic_discovery_manager_( BluetoothDiscoveryManagerMac::CreateClassic(this)), low_energy_discovery_manager_( -@@ -356,8 +360,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { +@@ -355,8 +359,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { } bool BluetoothAdapterMac::SetPoweredImpl(bool powered) { 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 8c063189991e4..4b39f9afd3c0b 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 9cdf5d553feb765a77da3b959a052e86daffdd2f..81acb80ef2a52b2133dcc59a1214723345095f61 100644 +index fa95b1744e46396013cdf8344b23933aacefc270..f70cf0036d950a0fd5ccb2ea432f51231ca382f2 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc @@ -117,6 +117,11 @@ @@ -22,7 +22,7 @@ index 9cdf5d553feb765a77da3b959a052e86daffdd2f..81acb80ef2a52b2133dcc59a12147233 #if BUILDFLAG(IS_CT_SUPPORTED) #include "components/certificate_transparency/chrome_ct_policy_enforcer.h" #include "components/certificate_transparency/chrome_require_ct_delegate.h" -@@ -375,6 +380,79 @@ bool SCTAuditingDelegate::IsSCTAuditingEnabled() { +@@ -376,6 +381,79 @@ bool SCTAuditingDelegate::IsSCTAuditingEnabled() { } // namespace @@ -102,7 +102,7 @@ index 9cdf5d553feb765a77da3b959a052e86daffdd2f..81acb80ef2a52b2133dcc59a12147233 constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess; NetworkContext::PendingCertVerify::PendingCertVerify() = default; -@@ -574,6 +652,13 @@ void NetworkContext::SetClient( +@@ -575,6 +653,13 @@ void NetworkContext::SetClient( client_.Bind(std::move(client)); } @@ -157,10 +157,10 @@ index 89451c626bee5a9970a1f77f2739ce03a01e6b30..22e155061860f6782b261205f6297c09 // CertNetFetcher is not used by the current platform, or if the actual // net::CertVerifier is instantiated outside of the network service. diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index e24ec4cb3c49ade12be048d96aaca2f672fb292f..6f830a84d20e39b802b44465882f9ae0627a0759 100644 +index 8b74f2f855eaed87c012fea690238e1c95978f71..492a03d742702e2aaaf00cc77fdd53c8a8d968cd 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -192,6 +192,17 @@ struct CTPolicy { +@@ -189,6 +189,17 @@ struct CTPolicy { array excluded_legacy_spkis; }; @@ -178,7 +178,7 @@ index e24ec4cb3c49ade12be048d96aaca2f672fb292f..6f830a84d20e39b802b44465882f9ae0 // Parameters for constructing a network context. struct NetworkContextParams { // Name used by memory tools to identify the context. -@@ -732,6 +743,9 @@ interface NetworkContext { +@@ -723,6 +734,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 edecb66a16dca..f76cd62a386c4 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -54,7 +54,7 @@ index 19c2beb1f1949f0dc4466a8728f151c035544b24..f7aa5f94d6dea0e6b2c1107b8ef01600 scoped_refptr service_worker_context_; diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc -index 9f6c32085b8808735a0cbf3502bcb1a186a200ba..ae6d2960a767bf9c20a1e14c93454cd544f4a2a3 100644 +index 0c2117e90b32d42ff71ee63b2f4d85293cbb5cd1..11879ef5ae0971dbb0810cbdee29d7b8ef4c9509 100644 --- a/content/browser/notifications/blink_notification_service_impl_unittest.cc +++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc @@ -139,7 +139,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test { @@ -108,10 +108,10 @@ index b195cb84d8bba3c51b04f8c32cf909d15bf34335..37528715db985d12771ba2dca86dcec8 const GURL& document_url, mojo::PendingReceiver receiver); diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index fcb30910e0d473d5f67a823e68c5002a85b9c2f0..ec0f47781d42d55e907afd039e961a74ed9c7c9c 100644 +index a107b15508da3ebcf30fad08f209847a2032e38d..5de57bd4a08e586251d26ede70e6b51ad61d2c42 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2169,7 +2169,7 @@ void RenderProcessHostImpl::CreateNotificationService( +@@ -2266,7 +2266,7 @@ void RenderProcessHostImpl::CreateNotificationService( document_url = rfh->GetLastCommittedURL(); storage_partition_impl_->GetPlatformNotificationContext()->CreateService( diff --git a/patches/chromium/pepper_plugin_support.patch b/patches/chromium/pepper_plugin_support.patch index 224700c1a79e4..e24b00d599b61 100644 --- a/patches/chromium/pepper_plugin_support.patch +++ b/patches/chromium/pepper_plugin_support.patch @@ -7,13 +7,13 @@ This tweaks Chrome's pepper flash and PDF plugin support to make it usable from Electron. diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc -index e90525fdee7b7f1e299e56899ddca51af93d7aa6..4afb696f57d83935dabd0abc97bfe80018b56977 100644 +index 66e5a32ca6021a712a82d918a6dcb44039f71bf2..ce1559ea6020825ad0fa996e3148ff2744fa00c4 100644 --- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc +++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc @@ -7,17 +7,21 @@ #include - #include "base/stl_util.h" + #include "base/cxx17_backports.h" +#if 0 #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" @@ -154,7 +154,7 @@ index 56a23e8f41bb418d414f11af5797b30571d4cc2b..6f9f577f16de80dd2ab194b557bbd9ec DISALLOW_COPY_AND_ASSIGN(PepperIsolatedFileSystemMessageFilter); }; diff --git a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc b/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc -index 7820a55f563d40865cd7bbf4a03e7f82db81043e..d9b1c4bc6abfa395782761455d4dd2e3105d7b14 100644 +index 60cfd89dfd18eced6f6d103267b80d547d2e9f26..95d36e99832f434d878a2a2fc3101a611926acb2 100644 --- a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc +++ b/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc @@ -7,8 +7,13 @@ @@ -169,40 +169,42 @@ index 7820a55f563d40865cd7bbf4a03e7f82db81043e..d9b1c4bc6abfa395782761455d4dd2e3 #include "components/pdf/renderer/pepper_pdf_host.h" +#endif #include "content/public/renderer/renderer_ppapi_host.h" + #include "pdf/buildflags.h" #include "ppapi/host/ppapi_host.h" - #include "ppapi/host/resource_host.h" -@@ -36,19 +41,10 @@ ChromeRendererPepperHostFactory::CreateResourceHost( +@@ -37,6 +42,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost( if (!host_->IsValidInstance(instance)) return nullptr; -- if (host_->GetPpapiHost()->permissions().HasPermission( -- ppapi::PERMISSION_FLASH)) { -- switch (message.type()) { -- case PpapiHostMsg_FlashFullscreen_Create::ID: { -- return std::make_unique(host_, instance, -- resource); -- } -- } -- } -- - // TODO(raymes): PDF also needs access to the FlashFontFileHost currently. - // We should either rename PPB_FlashFont_File to PPB_FontFile_Private or get - // rid of its use in PDF if possible. -+#if BUILDFLAG(ENABLE_PDF_VIEWER) ++#if 0 if (host_->GetPpapiHost()->permissions().HasPermission( - ppapi::PERMISSION_FLASH) || - host_->GetPpapiHost()->permissions().HasPermission( -@@ -75,7 +71,9 @@ ChromeRendererPepperHostFactory::CreateResourceHost( + ppapi::PERMISSION_FLASH)) { + switch (message.type()) { +@@ -46,6 +52,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost( } } } +#endif + // TODO(raymes): PDF also needs access to the FlashFontFileHost currently. + // We should either rename PPB_FlashFont_File to PPB_FontFile_Private or get +@@ -68,7 +75,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost( + } + } + +-#if BUILDFLAG(ENABLE_PDF) ++#if BUILDFLAG(ENABLE_PDF_VIEWER) + if (host_->GetPpapiHost()->permissions().HasPermission( + ppapi::PERMISSION_PDF)) { + switch (message.type()) { +@@ -79,6 +86,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost( + } + #endif + +#if 0 // Permissions for the following interfaces will be checked at the // time of the corresponding instance's method calls. Currently these // interfaces are available only for whitelisted apps which may not have -@@ -85,6 +83,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost( +@@ -88,6 +96,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost( return std::make_unique(host_, instance, resource); } } diff --git a/patches/chromium/preconnect_feature.patch b/patches/chromium/preconnect_feature.patch deleted file mode 100644 index 52def7c006809..0000000000000 --- a/patches/chromium/preconnect_feature.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Alexey Kuts -Date: Fri, 26 Jul 2019 22:32:54 +0300 -Subject: remove references to Profile from PreconnectManager - -The PreconnectManager in Chrome only depends on Profile for testing purposes; -this patch removes that dependency so we can reuse it. -Ideally we would change this class in upstream to not depend on Profile. - -diff --git a/chrome/browser/predictors/preconnect_manager.cc b/chrome/browser/predictors/preconnect_manager.cc -index 7cbe5b3ebac99849dc784e1dc587b3a091abbf49..6de33ea6f7e452cdfbf3271827a943828e93fb8f 100644 ---- a/chrome/browser/predictors/preconnect_manager.cc -+++ b/chrome/browser/predictors/preconnect_manager.cc -@@ -69,7 +69,7 @@ PreresolveJob::PreresolveJob(PreresolveJob&& other) = default; - PreresolveJob::~PreresolveJob() = default; - - PreconnectManager::PreconnectManager(base::WeakPtr delegate, -- Profile* profile) -+ content::BrowserContext* profile) - : delegate_(std::move(delegate)), - profile_(profile), - inflight_preresolves_count_(0) { -@@ -329,11 +329,13 @@ network::mojom::NetworkContext* PreconnectManager::GetNetworkContext() const { - if (network_context_) - return network_context_; - -+#if 0 - if (profile_->AsTestingProfile()) { - // We're testing and |network_context_| wasn't set. Return nullptr to avoid - // hitting the network. - return nullptr; - } -+#endif - - return profile_->GetDefaultStoragePartition()->GetNetworkContext(); - } -diff --git a/chrome/browser/predictors/preconnect_manager.h b/chrome/browser/predictors/preconnect_manager.h -index dbdde3dfd9bb160486a1d06f16ef86548798b61c..a4373ebdbe8bb833c3b782e3d3cb27a5116f976d 100644 ---- a/chrome/browser/predictors/preconnect_manager.h -+++ b/chrome/browser/predictors/preconnect_manager.h -@@ -22,6 +22,10 @@ - - class Profile; - -+namespace content { -+class BrowserContext; -+} -+ - namespace network { - namespace mojom { - class NetworkContext; -@@ -145,7 +149,7 @@ class PreconnectManager { - bool success) {} - }; - -- PreconnectManager(base::WeakPtr delegate, Profile* profile); -+ PreconnectManager(base::WeakPtr delegate, content::BrowserContext* profile); - virtual ~PreconnectManager(); - - // Starts preconnect and preresolve jobs keyed by |url|. -@@ -210,7 +214,7 @@ class PreconnectManager { - network::mojom::NetworkContext* GetNetworkContext() const; - - base::WeakPtr delegate_; -- Profile* const profile_; -+ content::BrowserContext* const profile_; - std::list queued_jobs_; - PreresolveJobMap preresolve_jobs_; - std::map> preresolve_info_; diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index 4c5ef32a2e7f0..6e903131966ae 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -102,7 +102,7 @@ index f2ba13cb21d66c2067264086926341e8490b1b84..29dc7c84c22d9aa7bf0711467fa98b16 } diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc -index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed138ed777c 100644 +index 15dcd3179a2705ab87c525efe1a5210c07ffc17b..fc45f0449fc8bc24fe3bdc3571c9793c6789d36b 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc @@ -28,10 +28,10 @@ @@ -143,10 +143,10 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 } #if BUILDFLAG(ENABLE_PRINT_PREVIEW) -@@ -256,7 +260,9 @@ void UpdatePrintSettingsReplyOnIO( +@@ -236,7 +240,9 @@ void UpdatePrintSettingsReplyOnIO( + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK(printer_query); - auto params = mojom::PrintPagesParams::New(); - params->params = mojom::PrintParams::New(); + mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr(); - if (printer_query->last_status() == PrintingContext::OK) { + // We call update without first printing from defaults, + // so the last printer status will still be defaulted to PrintingContext::FAILED @@ -154,7 +154,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 RenderParamsFromPrintSettings(printer_query->settings(), params->params.get()); params->params->document_cookie = printer_query->cookie(); -@@ -382,12 +388,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents) +@@ -339,12 +345,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents) : PrintManager(web_contents), queue_(g_browser_process->print_job_manager()->queue()) { DCHECK(queue_); @@ -169,7 +169,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 } PrintViewManagerBase::~PrintViewManagerBase() { -@@ -395,7 +403,10 @@ PrintViewManagerBase::~PrintViewManagerBase() { +@@ -352,7 +360,10 @@ PrintViewManagerBase::~PrintViewManagerBase() { DisconnectFromCurrentPrintJob(); } @@ -181,7 +181,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 DisconnectFromCurrentPrintJob(); // Don't print / print preview crashed tabs. -@@ -403,7 +414,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) { +@@ -360,7 +371,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) { return false; SetPrintingRFH(rfh); @@ -197,7 +197,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 return true; } -@@ -524,9 +542,9 @@ void PrintViewManagerBase::StartLocalPrintJob( +@@ -515,9 +533,9 @@ void PrintViewManagerBase::ScriptedPrintReply( void PrintViewManagerBase::UpdatePrintingEnabled() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // The Unretained() is safe because ForEachFrame() is synchronous. @@ -210,36 +210,37 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 } void PrintViewManagerBase::NavigationStopped() { -@@ -643,12 +661,13 @@ void PrintViewManagerBase::DidPrintDocument( +@@ -631,12 +649,13 @@ void PrintViewManagerBase::DidPrintDocument( void PrintViewManagerBase::GetDefaultPrintSettings( GetDefaultPrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); +#if 0 // Printing is always enabled. if (!printing_enabled_.GetValue()) { - auto params = mojom::PrintParams::New(); - GetDefaultPrintSettingsReply(std::move(callback), std::move(params)); + GetDefaultPrintSettingsReply(std::move(callback), + mojom::PrintParams::New()); return; } - +#endif - content::RenderFrameHost* render_frame_host = - print_manager_host_receivers_.GetCurrentTargetFrame(); - -@@ -665,11 +684,12 @@ void PrintViewManagerBase::UpdatePrintSettings( + content::RenderFrameHost* render_frame_host = GetCurrentTargetFrame(); + auto callback_wrapper = + base::BindOnce(&PrintViewManagerBase::GetDefaultPrintSettingsReply, +@@ -654,12 +673,13 @@ void PrintViewManagerBase::UpdatePrintSettings( base::Value job_settings, UpdatePrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); -+ #if 0 // Printing is always enabled. ++#if 0 // Printing is always enabled. if (!printing_enabled_.GetValue()) { - UpdatePrintSettingsReply(std::move(callback), nullptr, false); + UpdatePrintSettingsReply(std::move(callback), + CreateEmptyPrintPagesParamsPtr(), false); return; } - -+ #endif ++#endif if (!job_settings.FindIntKey(kSettingPrinterType)) { - UpdatePrintSettingsReply(std::move(callback), nullptr, false); - return; -@@ -709,7 +729,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) { + UpdatePrintSettingsReply(std::move(callback), + CreateEmptyPrintPagesParamsPtr(), false); +@@ -704,7 +724,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) { PrintManager::PrintingFailed(cookie); #if BUILDFLAG(ENABLE_PRINT_PREVIEW) @@ -248,7 +249,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 #endif ReleasePrinterQuery(); -@@ -721,6 +741,11 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) { +@@ -716,6 +736,11 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) { } void PrintViewManagerBase::ShowInvalidPrinterSettingsError() { @@ -260,7 +261,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&ShowWarningMessageBox, l10n_util::GetStringUTF16( -@@ -790,9 +815,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent( +@@ -785,9 +810,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent( content::NotificationService::NoDetails()); break; } @@ -276,7 +277,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 NOTREACHED(); break; } -@@ -901,8 +930,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -896,8 +925,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( DCHECK(!quit_inner_loop_); DCHECK(query); @@ -289,7 +290,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 // We can't print if there is no renderer. if (!web_contents()->GetMainFrame()->GetRenderViewHost() || -@@ -923,8 +954,6 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -918,8 +949,6 @@ bool PrintViewManagerBase::CreateNewPrintJob( /*source_id=*/""); #endif @@ -298,7 +299,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 printing_succeeded_ = false; return true; } -@@ -973,14 +1002,22 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -968,14 +997,22 @@ void PrintViewManagerBase::ReleasePrintJob() { content::RenderFrameHost* rfh = printing_rfh_; printing_rfh_ = nullptr; @@ -323,7 +324,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 // Don't close the worker thread. print_job_ = nullptr; } -@@ -1016,7 +1053,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { +@@ -1011,7 +1048,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { } bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) { @@ -333,7 +334,7 @@ index f6084545a8acf1485d862a2366eee1da56d0a565..e2882c8b4fbb5402066c9132ed5ebed1 if (!cookie) { diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h -index 62f4dc6083a13dd68ca510982a8073216d4f4b24..89ce604d8363c3a4d7b2f206da20167d9e722927 100644 +index b19ee4414584d0e192ea6b4b91b4e2ed59aef51b..e67bf37ca58877639a724589ca911940fd04016e 100644 --- a/chrome/browser/printing/print_view_manager_base.h +++ b/chrome/browser/printing/print_view_manager_base.h @@ -38,6 +38,8 @@ class PrintJob; @@ -357,7 +358,7 @@ index 62f4dc6083a13dd68ca510982a8073216d4f4b24..89ce604d8363c3a4d7b2f206da20167d #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Prints the document in |print_data| with settings specified in -@@ -216,9 +221,15 @@ class PrintViewManagerBase : public content::NotificationObserver, +@@ -231,9 +236,15 @@ class PrintViewManagerBase : public content::NotificationObserver, // The current RFH that is printing with a system printing dialog. content::RenderFrameHost* printing_rfh_ = nullptr; @@ -374,7 +375,7 @@ index 62f4dc6083a13dd68ca510982a8073216d4f4b24..89ce604d8363c3a4d7b2f206da20167d // This means we are _blocking_ until all the necessary pages have been // rendered or the print settings are being loaded. diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom -index bea375f1c23fdb6efdd6e0f7801e7bd087ddb7a3..f74c70d1c535384df1849b2d2841b27f5d0b25c6 100644 +index bfca294bd94763d7a661f9b424bbe1351f076030..a5b50dfbf2a64d87c5f9e632c0709bf5967c0f1e 100644 --- a/components/printing/common/print.mojom +++ b/components/printing/common/print.mojom @@ -271,7 +271,7 @@ interface PrintPreviewUI { @@ -387,7 +388,7 @@ index bea375f1c23fdb6efdd6e0f7801e7bd087ddb7a3..f74c70d1c535384df1849b2d2841b27f // Tells the RenderFrame to switch the CSS to print media type, render every // requested page using the print preview document's frame/node, and then diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc -index f0811e6c7775419d2e7cceafc9aba05f8b877d58..2c6890d7b2b88064d7942774def1054a7e5d868f 100644 +index 2831dbf4235f52869d7e5e8f4c7b978a17a19c44..c76abf666d1e16175d1962eebc5f7ab7efe71924 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc @@ -38,6 +38,7 @@ @@ -518,7 +519,7 @@ index f0811e6c7775419d2e7cceafc9aba05f8b877d58..2c6890d7b2b88064d7942774def1054a // Check if |this| is still valid. if (!self) return; -@@ -2129,7 +2170,9 @@ void PrintRenderFrameHelper::IPCProcessed() { +@@ -2128,7 +2169,9 @@ void PrintRenderFrameHelper::IPCProcessed() { } } @@ -529,7 +530,7 @@ index f0811e6c7775419d2e7cceafc9aba05f8b877d58..2c6890d7b2b88064d7942774def1054a mojom::PrintPagesParams settings; settings.params = mojom::PrintParams::New(); GetPrintManagerHost()->GetDefaultPrintSettings(&settings.params); -@@ -2153,12 +2196,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) { +@@ -2152,12 +2195,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) { return result; } @@ -548,7 +549,7 @@ index f0811e6c7775419d2e7cceafc9aba05f8b877d58..2c6890d7b2b88064d7942774def1054a notify_browser_of_print_failure_ = false; GetPrintManagerHost()->ShowInvalidPrinterSettingsError(); return false; -@@ -2529,18 +2574,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) { +@@ -2528,18 +2573,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) { } bool PrintRenderFrameHelper::CheckForCancel() { diff --git a/patches/chromium/put_back_deleted_colors_for_autofill.patch b/patches/chromium/put_back_deleted_colors_for_autofill.patch index f87ca1afeda97..dd34b25d9608b 100644 --- a/patches/chromium/put_back_deleted_colors_for_autofill.patch +++ b/patches/chromium/put_back_deleted_colors_for_autofill.patch @@ -62,10 +62,10 @@ index 083640808cd6a4a5e6e65d715c77ef58d090ba1e..d7d2fe4e0ada417769cbfe8390b8e2b1 OP(kColorId_ThrobberSpinningColor), \ OP(kColorId_ThrobberWaitingColor), \ diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index 5e1dcf9487470986d771b7777033be2c32677962..ae908912cd5ea1b2cd43974e1b8ea1bc0c600042 100644 +index a02662fb29ff297a55afdb0d6e2dc336137a749d..eafe512bc90d967eaadddc2e355c418ecd7dd83a 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -659,6 +659,18 @@ absl::optional NativeThemeWin::GetPlatformHighContrastColor( +@@ -658,6 +658,18 @@ absl::optional NativeThemeWin::GetPlatformHighContrastColor( case kColorId_ThrobberWaitingColor: return system_colors_[SystemThemeColor::kGrayText]; diff --git a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch index dea23e744b75b..2eda46d2c5066 100644 --- a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch +++ b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch @@ -8,7 +8,7 @@ Chrome moved the SetCursor IPC message to mojo, which we use to tell OSR about ` Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172779 diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h -index c3032fa803f2f875b532e32167eaaf9133561065..8ba8c0ed7f7412c147c75b56ebf1dc7489f02ebc 100644 +index 24933acc8579ce057178ad36c42069c38df20581..483cdbe9abb299419afebe1f3abaf5d84372fadf 100644 --- a/content/browser/renderer_host/render_widget_host_delegate.h +++ b/content/browser/renderer_host/render_widget_host_delegate.h @@ -14,6 +14,7 @@ @@ -18,8 +18,8 @@ index c3032fa803f2f875b532e32167eaaf9133561065..8ba8c0ed7f7412c147c75b56ebf1dc74 +#include "content/common/cursors/webcursor.h" #include "content/public/common/drop_data.h" #include "services/metrics/public/cpp/ukm_recorder.h" - #include "third_party/blink/public/common/input/web_input_event.h" -@@ -255,6 +256,9 @@ class CONTENT_EXPORT RenderWidgetHostDelegate { + #include "third_party/abseil-cpp/absl/types/optional.h" +@@ -256,6 +257,9 @@ class CONTENT_EXPORT RenderWidgetHostDelegate { // Returns the associated RenderViewHostDelegateView*, if possible. virtual RenderViewHostDelegateView* GetDelegateView(); @@ -30,10 +30,10 @@ index c3032fa803f2f875b532e32167eaaf9133561065..8ba8c0ed7f7412c147c75b56ebf1dc74 // RenderWidgetHost on the main frame, and false otherwise. virtual bool IsWidgetForMainFrame(RenderWidgetHostImpl*); diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 738920fccc048d0a4471dac407619afde3811def..a75064854fb28a1b736f66c8dfa08435d7895e7b 100644 +index f25796e28c6381cc1a844026f9a81e0ce9ddef0f..158dcb7306dd41d8053b1d07780393d62e659df3 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -1946,6 +1946,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) { +@@ -1978,6 +1978,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) { void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) { if (view_) view_->UpdateCursor(WebCursor(cursor)); @@ -43,10 +43,10 @@ index 738920fccc048d0a4471dac407619afde3811def..a75064854fb28a1b736f66c8dfa08435 void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 04e320e1b0150dbf7edd42be88c3ab6ceaecf46f..e240f8a32b1f7f69afa992861c995e668695c51f 100644 +index 4728f584f537b6496a437511873028c0a454a1d2..6cbe9f509390367bf97bfbf1f2ebd58215e74db3 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4201,6 +4201,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { +@@ -4317,6 +4317,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { return text_input_manager_.get(); } @@ -59,10 +59,10 @@ index 04e320e1b0150dbf7edd42be88c3ab6ceaecf46f..e240f8a32b1f7f69afa992861c995e66 RenderWidgetHostImpl* render_widget_host) { return render_widget_host == GetMainFrame()->GetRenderWidgetHost(); diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h -index 6e731f45502bb6d8e2f65652fccb883978ad3260..5212e1547796cae0c2c2508e5c0fcdab18190895 100644 +index f5318f70def9bfd73983b8a91d7cd80e3b4fa61f..de9f77c4fe4dda9005e7211fba22c496008e6d98 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h -@@ -962,6 +962,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, +@@ -971,6 +971,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, blink::mojom::FrameVisibility visibility) override; void SendScreenRects() override; TextInputManager* GetTextInputManager() override; @@ -71,7 +71,7 @@ index 6e731f45502bb6d8e2f65652fccb883978ad3260..5212e1547796cae0c2c2508e5c0fcdab bool IsShowingContextMenuOnPage() const override; void DidChangeScreenOrientation() override; diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h -index 3ca079e32b4aeb83440625a7bf1efbde1369a99f..df6ae54d10efc4abbd2e3d87774977d1f593ac01 100644 +index 6c2b6e48f769ddd4b0e872287e0e654288ff2674..a0815fefbfdd9a9fec2af162e9721749e00a0f85 100644 --- a/content/public/browser/web_contents_observer.h +++ b/content/public/browser/web_contents_observer.h @@ -13,6 +13,7 @@ @@ -82,7 +82,7 @@ index 3ca079e32b4aeb83440625a7bf1efbde1369a99f..df6ae54d10efc4abbd2e3d87774977d1 #include "content/public/browser/allow_service_worker_result.h" #include "content/public/browser/cookie_access_details.h" #include "content/public/browser/navigation_controller.h" -@@ -413,6 +414,9 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { +@@ -423,6 +424,9 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { // Invoked every time the WebContents changes visibility. virtual void OnVisibilityChanged(Visibility visibility) {} diff --git a/patches/chromium/remove_usage_of_incognito_apis_in_the_spellchecker.patch b/patches/chromium/remove_usage_of_incognito_apis_in_the_spellchecker.patch index e3ab66611e5e9..74f18d7d81dfb 100644 --- a/patches/chromium/remove_usage_of_incognito_apis_in_the_spellchecker.patch +++ b/patches/chromium/remove_usage_of_incognito_apis_in_the_spellchecker.patch @@ -9,10 +9,10 @@ change to move more of //chrome spellchecker logic into //components so that we can further separate our dependency from //chrome. diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc -index 89edb0f8372b3606f2dd38980d5cc40d5b9d4a81..d511c9085253ebfba69ba37f41193d15638bb10f 100644 +index 1d426c35c539064e899b848d0ccc19306f1c4db8..2b7aa1add57dccbcbf8202cead5b7d2d5a174270 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.cc +++ b/chrome/browser/spellchecker/spellcheck_factory.cc -@@ -76,7 +76,10 @@ void SpellcheckServiceFactory::RegisterProfilePrefs( +@@ -71,7 +71,10 @@ void SpellcheckServiceFactory::RegisterProfilePrefs( content::BrowserContext* SpellcheckServiceFactory::GetBrowserContextToUse( content::BrowserContext* context) const { diff --git a/patches/chromium/render_widget_host_view_base.patch b/patches/chromium/render_widget_host_view_base.patch index 69020e4ee2984..1be3f7eda0ee4 100644 --- a/patches/chromium/render_widget_host_view_base.patch +++ b/patches/chromium/render_widget_host_view_base.patch @@ -6,7 +6,7 @@ Subject: render_widget_host_view_base.patch ... something to do with OSR? and maybe as well? terrifying. diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc -index d504e82794cb50fb81dd9a568644254115c03e5d..d67f775b1bb6ca12055aed68947e0ca1591d4cfc 100644 +index ec0d6b0acbc8945eaeddc24b1b7fc89cba575c5b..43412e27c8a515e3889f1639fd560537de35a403 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc @@ -664,6 +664,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( @@ -24,7 +24,7 @@ index d504e82794cb50fb81dd9a568644254115c03e5d..d67f775b1bb6ca12055aed68947e0ca1 const blink::WebMouseEvent& event, const ui::LatencyInfo& latency) { diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h -index 8cc591cfc75a02b371293b1edc6d9fad8d4ea36d..2fa7e2f5d1280e9b933bd0b2524ddea50f7b4de0 100644 +index 9e20702506673230590177add5845d09b2def665..31b167720f702576a42a169fd6c094635424ecfa 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -24,8 +24,10 @@ @@ -50,7 +50,7 @@ index 8cc591cfc75a02b371293b1edc6d9fad8d4ea36d..2fa7e2f5d1280e9b933bd0b2524ddea5 class WebCursor; class WebContentsAccessibility; class DelegatedFrameHost; -@@ -145,6 +149,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -137,6 +141,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { bool show_reason_unoccluded, bool show_reason_bfcache_restore) final; @@ -60,7 +60,7 @@ index 8cc591cfc75a02b371293b1edc6d9fad8d4ea36d..2fa7e2f5d1280e9b933bd0b2524ddea5 // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. gfx::PointF TransformPointToRootCoordSpaceF( -@@ -307,6 +314,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -299,6 +306,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void ProcessGestureEvent(const blink::WebGestureEvent& event, const ui::LatencyInfo& latency); diff --git a/patches/chromium/render_widget_host_view_mac.patch b/patches/chromium/render_widget_host_view_mac.patch index 9a776a953f02c..c0f78cde88c83 100644 --- a/patches/chromium/render_widget_host_view_mac.patch +++ b/patches/chromium/render_widget_host_view_mac.patch @@ -10,10 +10,10 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`. Additionally, disables usage of some private APIs in MAS builds. diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -index dd8c6b1d7e6a0ac5e7a069c96dcffe379c1b69bf..0d21dd75e419b482b1bd54fefaf07b96c795f71c 100644 +index e92152bde1b04ad5623c7f5684be80d211c7f20b..cf0be922f1054824103f626ddabc86e7e214f7ea 100644 --- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -@@ -152,6 +152,15 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -153,6 +153,15 @@ void ExtractUnderlines(NSAttributedString* string, } // namespace @@ -29,7 +29,7 @@ index dd8c6b1d7e6a0ac5e7a069c96dcffe379c1b69bf..0d21dd75e419b482b1bd54fefaf07b96 // These are not documented, so use only after checking -respondsToSelector:. @interface NSApplication (UndocumentedSpeechMethods) - (void)speakString:(NSString*)string; -@@ -574,6 +583,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { +@@ -575,6 +584,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { @@ -39,7 +39,7 @@ index dd8c6b1d7e6a0ac5e7a069c96dcffe379c1b69bf..0d21dd75e419b482b1bd54fefaf07b96 return [self acceptsMouseEventsWhenInactive]; } -@@ -649,6 +661,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent { +@@ -650,6 +662,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent { // its parent view. BOOL hitSelf = NO; while (view) { @@ -50,7 +50,7 @@ index dd8c6b1d7e6a0ac5e7a069c96dcffe379c1b69bf..0d21dd75e419b482b1bd54fefaf07b96 if (view == self) hitSelf = YES; if ([view isKindOfClass:[self class]] && ![view isEqual:self] && -@@ -997,6 +1013,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { +@@ -998,6 +1014,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { eventType == NSKeyDown && !(modifierFlags & NSCommandKeyMask); diff --git a/patches/chromium/resource_file_conflict.patch b/patches/chromium/resource_file_conflict.patch index 9c9d1451797ab..00d02a0c64b6d 100644 --- a/patches/chromium/resource_file_conflict.patch +++ b/patches/chromium/resource_file_conflict.patch @@ -52,10 +52,10 @@ Some alternatives to this patch: None of these options seems like a substantial maintainability win over this patch to me (@nornagon). diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index 931fb7579a9d5a7b6e378ddc2d823e81ce7b8a6a..59f3a36836d6dd3687e64b85198cd7100e8272f3 100644 +index 039bf6ff05e45e62e0e1595cedec6c816d8c72e5..75868925758560075e95b79a7473e635b23127d5 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -1531,7 +1531,7 @@ if (is_chrome_branded && !is_android) { +@@ -1534,7 +1534,7 @@ if (is_chrome_branded && !is_android) { } } @@ -64,7 +64,7 @@ index 931fb7579a9d5a7b6e378ddc2d823e81ce7b8a6a..59f3a36836d6dd3687e64b85198cd710 chrome_paks("packed_resources") { if (is_mac) { output_dir = "$root_gen_dir/repack" -@@ -1559,6 +1559,12 @@ if (!is_android) { +@@ -1562,6 +1562,12 @@ if (!is_android) { } } diff --git a/patches/chromium/revert_remove_contentrendererclient_shouldfork.patch b/patches/chromium/revert_remove_contentrendererclient_shouldfork.patch index 8e8dc1ba35bf1..c29972b8a1a99 100644 --- a/patches/chromium/revert_remove_contentrendererclient_shouldfork.patch +++ b/patches/chromium/revert_remove_contentrendererclient_shouldfork.patch @@ -9,10 +9,10 @@ for every navigation to keep Node.js working properly. Once Native Modules in th are required to be NAPI or context aware (Electron v11), this patch can be removed. diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc -index 2ac02aabeb0689e70f842a98eec132f220b9810f..ab9f4655933326cf2197a73a1672781792bfbcb4 100644 +index 21bc479c64b31293c498391da3ebcfdfe0bde9c8..f7e2abfa217c2e29ecee47c6884dab7754ba119f 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc -@@ -1300,6 +1300,24 @@ ChromeContentRendererClient::GetProtocolHandlerSecurityLevel() { +@@ -1312,6 +1312,24 @@ ChromeContentRendererClient::GetProtocolHandlerSecurityLevel() { #endif } @@ -88,10 +88,10 @@ index 529e597b572854cbf56bb45d9554549e51e519f4..f3dd10a3b30c89a02acc499279660d97 // |url|. If the function returns a valid |new_url|, the request must be // updated to use it. diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 0f13101c719e6f43cfc5d281d0f6f345d475744d..ba517758ddd044a32e9c364bd803e0090d19b8cb 100644 +index cfc895ca8ce72655df5862d917a3954009930c4c..5193c3f4b1832bf0ccb070b91aa6439cd7e56571 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4913,6 +4913,22 @@ void RenderFrameImpl::BeginNavigation( +@@ -5034,6 +5034,22 @@ void RenderFrameImpl::BeginNavigation( // we can do a per-frame check here rather than a process-wide check. bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) || (enabled_bindings_ & kWebUIBindingsPolicyMask); diff --git a/patches/chromium/scroll_bounce_flag.patch b/patches/chromium/scroll_bounce_flag.patch index dfd00c71a6f96..b219948c36504 100644 --- a/patches/chromium/scroll_bounce_flag.patch +++ b/patches/chromium/scroll_bounce_flag.patch @@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch Patch to make scrollBounce option work. diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc -index 57269d67faaf9ecb43759c8d489971c4c8ef3df3..3da6525282e19eb0ea229ea24b101171fdeb2391 100644 +index a61bf4dbeae9846b834372c734118119bf91e873..b504864915483ea4221945acd9a9e1fee2f72482 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1250,7 +1250,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { +@@ -1258,7 +1258,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { } bool RenderThreadImpl::IsElasticOverscrollEnabled() { diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index 15e7fcc3d7089..8112fe188c788 100644 --- a/patches/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it does touch a security-sensitive class. diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index ec0f47781d42d55e907afd039e961a74ed9c7c9c..c54084b7b1b7b3459a4b34f4afc0891db5cdb6a7 100644 +index 5de57bd4a08e586251d26ede70e6b51ad61d2c42..aa5b91076df81cf32f6aa1e128073c278234a684 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -392,10 +392,18 @@ class RendererSandboxedProcessLauncherDelegate +@@ -422,10 +422,18 @@ class RendererSandboxedProcessLauncherDelegate public: RendererSandboxedProcessLauncherDelegate() = default; @@ -44,7 +44,7 @@ index ec0f47781d42d55e907afd039e961a74ed9c7c9c..c54084b7b1b7b3459a4b34f4afc0891d const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); base::CommandLine::StringType renderer_prefix = -@@ -413,6 +421,11 @@ class RendererSandboxedProcessLauncherDelegate +@@ -443,6 +451,11 @@ class RendererSandboxedProcessLauncherDelegate sandbox::policy::SandboxType GetSandboxType() override { return sandbox::policy::SandboxType::kRenderer; } @@ -56,7 +56,7 @@ index ec0f47781d42d55e907afd039e961a74ed9c7c9c..c54084b7b1b7b3459a4b34f4afc0891d }; #if defined(OS_WIN) -@@ -423,6 +436,9 @@ class RendererSandboxedProcessLauncherDelegateWin +@@ -453,6 +466,9 @@ class RendererSandboxedProcessLauncherDelegateWin RendererSandboxedProcessLauncherDelegateWin(base::CommandLine* cmd_line) : renderer_code_integrity_enabled_( GetContentClient()->browser()->IsRendererCodeIntegrityEnabled()) { @@ -66,7 +66,7 @@ index ec0f47781d42d55e907afd039e961a74ed9c7c9c..c54084b7b1b7b3459a4b34f4afc0891d if (cmd_line->HasSwitch(switches::kJavaScriptFlags)) { std::string js_flags = cmd_line->GetSwitchValueASCII(switches::kJavaScriptFlags); -@@ -1887,9 +1903,15 @@ bool RenderProcessHostImpl::Init() { +@@ -1984,9 +2000,15 @@ bool RenderProcessHostImpl::Init() { std::unique_ptr sandbox_delegate = std::make_unique( cmd_line.get()); diff --git a/patches/chromium/support_runtime_configurable_key_storage_on_linux_os_crypto.patch b/patches/chromium/support_runtime_configurable_key_storage_on_linux_os_crypto.patch deleted file mode 100644 index 7d52895b6823c..0000000000000 --- a/patches/chromium/support_runtime_configurable_key_storage_on_linux_os_crypto.patch +++ /dev/null @@ -1,288 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Samuel Attard -Date: Mon, 10 May 2021 17:10:25 -0700 -Subject: support runtime configurable key storage on linux (os_crypto) - -This modifies the OsCrypt::Config struct used on linux to support -runtime configurable application names which are used in the Keyring and -LibSecret implementations of os_crypt on linux. - -Change-Id: Ifc287b589f118da8fcd5afaf39e5ba7ffe46f5fd - -diff --git a/components/os_crypt/key_storage_config_linux.h b/components/os_crypt/key_storage_config_linux.h -index a856604756aa65c52171a9eff84ba2b316d8609c..72c16682e5df615ab84f67af66cc36c2b76c30e3 100644 ---- a/components/os_crypt/key_storage_config_linux.h -+++ b/components/os_crypt/key_storage_config_linux.h -@@ -26,6 +26,12 @@ struct COMPONENT_EXPORT(OS_CRYPT) Config { - std::string store; - // The product name to use for permission prompts. - std::string product_name; -+ // The application name to store the key under. For Chromium/Chrome builds -+ // leave this unset and it will default correctly. This config option is -+ // for embedders to provide their application name in place of "Chromium". -+ // Only used when the allow_runtime_configurable_key_storage feature is -+ // enabled. -+ std::string application_name; - // A runner on the main thread for gnome-keyring to be called from. - // TODO(crbug/466975): Libsecret and KWallet don't need this. We can remove - // this when we stop supporting keyring. -diff --git a/components/os_crypt/key_storage_keyring.cc b/components/os_crypt/key_storage_keyring.cc -index 29720b8e8ff81791970e054050b37bbc5f338eb3..3ad654cf4a893f497ac4567aea77f8d1f2e1525f 100644 ---- a/components/os_crypt/key_storage_keyring.cc -+++ b/components/os_crypt/key_storage_keyring.cc -@@ -15,12 +15,6 @@ - - namespace { - --#if BUILDFLAG(GOOGLE_CHROME_BRANDING) --const char kApplicationName[] = "chrome"; --#else --const char kApplicationName[] = "chromium"; --#endif -- - const GnomeKeyringPasswordSchema kSchema = { - GNOME_KEYRING_ITEM_GENERIC_SECRET, - {{"application", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING}, {nullptr}}}; -@@ -28,8 +22,10 @@ const GnomeKeyringPasswordSchema kSchema = { - } // namespace - - KeyStorageKeyring::KeyStorageKeyring( -- scoped_refptr main_thread_runner) -- : main_thread_runner_(main_thread_runner) {} -+ scoped_refptr main_thread_runner, -+ std::string application_name) -+ : main_thread_runner_(main_thread_runner), -+ application_name_(std::move(application_name)) {} - - KeyStorageKeyring::~KeyStorageKeyring() {} - -@@ -49,7 +45,8 @@ absl::optional KeyStorageKeyring::GetKeyImpl() { - gchar* password_c = nullptr; - GnomeKeyringResult result = - GnomeKeyringLoader::gnome_keyring_find_password_sync_ptr( -- &kSchema, &password_c, "application", kApplicationName, nullptr); -+ &kSchema, &password_c, "application", application_name_.c_str(), -+ nullptr); - if (result == GNOME_KEYRING_RESULT_OK) { - password = password_c; - GnomeKeyringLoader::gnome_keyring_free_password_ptr(password_c); -@@ -71,7 +68,7 @@ absl::optional KeyStorageKeyring::AddRandomPasswordInKeyring() { - GnomeKeyringResult result = - GnomeKeyringLoader::gnome_keyring_store_password_sync_ptr( - &kSchema, nullptr /* default keyring */, KeyStorageLinux::kKey, -- password.c_str(), "application", kApplicationName, nullptr); -+ password.c_str(), "application", application_name_.c_str(), nullptr); - if (result != GNOME_KEYRING_RESULT_OK) { - VLOG(1) << "OSCrypt failed to store generated password to gnome-keyring"; - return absl::nullopt; -diff --git a/components/os_crypt/key_storage_keyring.h b/components/os_crypt/key_storage_keyring.h -index 26a3f587b49cdea3e4913ce0e08eeade6d1853a0..598c8b8ad35efa002a29dd98c9cba98453bef5ac 100644 ---- a/components/os_crypt/key_storage_keyring.h -+++ b/components/os_crypt/key_storage_keyring.h -@@ -20,8 +20,9 @@ class SingleThreadTaskRunner; - // Specialisation of KeyStorageLinux that uses Libsecret. - class COMPONENT_EXPORT(OS_CRYPT) KeyStorageKeyring : public KeyStorageLinux { - public: -- explicit KeyStorageKeyring( -- scoped_refptr main_thread_runner); -+ KeyStorageKeyring( -+ scoped_refptr main_thread_runner, -+ std::string application_name); - ~KeyStorageKeyring() override; - - protected: -@@ -37,6 +38,8 @@ class COMPONENT_EXPORT(OS_CRYPT) KeyStorageKeyring : public KeyStorageLinux { - // Keyring calls need to originate from the main thread. - scoped_refptr main_thread_runner_; - -+ const std::string application_name_; -+ - DISALLOW_COPY_AND_ASSIGN(KeyStorageKeyring); - }; - -diff --git a/components/os_crypt/key_storage_keyring_unittest.cc b/components/os_crypt/key_storage_keyring_unittest.cc -index aba31971dc33f4b60c2847fd037c419baf084eaa..93fc216d54168eb3fd7e9f1b23f71a77f6e6735d 100644 ---- a/components/os_crypt/key_storage_keyring_unittest.cc -+++ b/components/os_crypt/key_storage_keyring_unittest.cc -@@ -130,7 +130,7 @@ class GnomeKeyringTest : public testing::Test { - }; - - GnomeKeyringTest::GnomeKeyringTest() -- : task_runner_(new base::TestSimpleTaskRunner()), keyring_(task_runner_) { -+ : task_runner_(new base::TestSimpleTaskRunner()), keyring_(task_runner_, "chromium") { - MockGnomeKeyringLoader::ResetForOSCrypt(); - } - -diff --git a/components/os_crypt/key_storage_libsecret.cc b/components/os_crypt/key_storage_libsecret.cc -index 0857cc1874f4153541c7f21dd8cc6bdc1d59b39d..ccc60522791508f02dc759e55e781dbb9627967b 100644 ---- a/components/os_crypt/key_storage_libsecret.cc -+++ b/components/os_crypt/key_storage_libsecret.cc -@@ -14,12 +14,6 @@ - - namespace { - --#if BUILDFLAG(GOOGLE_CHROME_BRANDING) --const char kApplicationName[] = "chrome"; --#else --const char kApplicationName[] = "chromium"; --#endif -- - const SecretSchema kKeystoreSchemaV2 = { - "chrome_libsecret_os_crypt_password_v2", - SECRET_SCHEMA_DONT_MATCH_NAME, -@@ -64,6 +58,9 @@ void AnalyseKeyHistory(GList* secret_items) { - - } // namespace - -+KeyStorageLibsecret::KeyStorageLibsecret(std::string application_name) -+ : application_name_(std::move(application_name)) {} -+ - absl::optional - KeyStorageLibsecret::AddRandomPasswordInLibsecret() { - std::string password; -@@ -71,7 +68,7 @@ KeyStorageLibsecret::AddRandomPasswordInLibsecret() { - GError* error = nullptr; - bool success = LibsecretLoader::secret_password_store_sync( - &kKeystoreSchemaV2, nullptr, KeyStorageLinux::kKey, password.c_str(), -- nullptr, &error, "application", kApplicationName, nullptr); -+ nullptr, &error, "application", application_name_.c_str(), nullptr); - if (error) { - VLOG(1) << "Libsecret lookup failed: " << error->message; - g_error_free(error); -@@ -88,7 +85,7 @@ KeyStorageLibsecret::AddRandomPasswordInLibsecret() { - - absl::optional KeyStorageLibsecret::GetKeyImpl() { - LibsecretAttributesBuilder attrs; -- attrs.Append("application", kApplicationName); -+ attrs.Append("application", application_name_); - - LibsecretLoader::SearchHelper helper; - helper.Search(&kKeystoreSchemaV2, attrs.Get(), -diff --git a/components/os_crypt/key_storage_libsecret.h b/components/os_crypt/key_storage_libsecret.h -index 4759d076ea0017a41b398491dd24dde76a61e463..5292e21b8e7e1a873591e474571adb5b4ed8fe16 100644 ---- a/components/os_crypt/key_storage_libsecret.h -+++ b/components/os_crypt/key_storage_libsecret.h -@@ -15,7 +15,7 @@ - // Specialisation of KeyStorageLinux that uses Libsecret. - class COMPONENT_EXPORT(OS_CRYPT) KeyStorageLibsecret : public KeyStorageLinux { - public: -- KeyStorageLibsecret() = default; -+ explicit KeyStorageLibsecret(std::string application_name); - ~KeyStorageLibsecret() override = default; - - protected: -@@ -26,6 +26,8 @@ class COMPONENT_EXPORT(OS_CRYPT) KeyStorageLibsecret : public KeyStorageLinux { - private: - absl::optional AddRandomPasswordInLibsecret(); - -+ const std::string application_name_; -+ - DISALLOW_COPY_AND_ASSIGN(KeyStorageLibsecret); - }; - -diff --git a/components/os_crypt/key_storage_libsecret_unittest.cc b/components/os_crypt/key_storage_libsecret_unittest.cc -index ebe9a6b4bcbf748cd7f7e5fcf941b78ab1835749..a17bbc1f8061b33d55444919f546256d63bc809b 100644 ---- a/components/os_crypt/key_storage_libsecret_unittest.cc -+++ b/components/os_crypt/key_storage_libsecret_unittest.cc -@@ -236,7 +236,7 @@ class LibsecretTest : public testing::Test { - }; - - TEST_F(LibsecretTest, LibsecretRepeats) { -- KeyStorageLibsecret libsecret; -+ KeyStorageLibsecret libsecret("chromium"); - MockLibsecretLoader::ResetForOSCrypt(); - g_password_store.Pointer()->SetPassword("initial password"); - absl::optional password = libsecret.GetKey(); -@@ -248,7 +248,7 @@ TEST_F(LibsecretTest, LibsecretRepeats) { - } - - TEST_F(LibsecretTest, LibsecretCreatesRandomised) { -- KeyStorageLibsecret libsecret; -+ KeyStorageLibsecret libsecret("chromium"); - MockLibsecretLoader::ResetForOSCrypt(); - absl::optional password = libsecret.GetKey(); - MockLibsecretLoader::ResetForOSCrypt(); -diff --git a/components/os_crypt/key_storage_linux.cc b/components/os_crypt/key_storage_linux.cc -index 8feb147c96baa2f853a647eb648297b4b747f515..53b1903ff04043e2d058deda086e116a0e00fdca 100644 ---- a/components/os_crypt/key_storage_linux.cc -+++ b/components/os_crypt/key_storage_linux.cc -@@ -11,6 +11,7 @@ - #include "base/logging.h" - #include "base/metrics/histogram_macros.h" - #include "base/nix/xdg_util.h" -+#include "base/no_destructor.h" - #include "base/sequenced_task_runner.h" - #include "base/synchronization/waitable_event.h" - #include "base/task_runner_util.h" -@@ -147,12 +148,29 @@ std::unique_ptr KeyStorageLinux::CreateService( - std::unique_ptr KeyStorageLinux::CreateServiceInternal( - os_crypt::SelectedLinuxBackend selected_backend, - const os_crypt::Config& config) { -+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -+ static const base::NoDestructor kDefaultApplicationName("chrome"); -+#else -+ static const base::NoDestructor kDefaultApplicationName("chromium"); -+#endif -+ - std::unique_ptr key_storage; - -+#if defined(USE_LIBSECRET) || defined(USE_KEYRING) -+#if defined(ALLOW_RUNTIME_CONFIGURABLE_KEY_STORAGE) -+ std::string application_name = config.application_name; -+ if (application_name.empty()) { -+ application_name = *kDefaultApplicationName; -+ } -+#else -+ std::string application_name = *kDefaultApplicationName; -+#endif -+#endif -+ - #if defined(USE_LIBSECRET) - if (selected_backend == os_crypt::SelectedLinuxBackend::GNOME_ANY || - selected_backend == os_crypt::SelectedLinuxBackend::GNOME_LIBSECRET) { -- key_storage = std::make_unique(); -+ key_storage = std::make_unique(std::move(application_name)); - if (key_storage->WaitForInitOnTaskRunner()) { - VLOG(1) << "OSCrypt using Libsecret as backend."; - return key_storage; -@@ -164,8 +182,8 @@ std::unique_ptr KeyStorageLinux::CreateServiceInternal( - #if defined(USE_KEYRING) - if (selected_backend == os_crypt::SelectedLinuxBackend::GNOME_ANY || - selected_backend == os_crypt::SelectedLinuxBackend::GNOME_KEYRING) { -- key_storage = -- std::make_unique(config.main_thread_runner); -+ key_storage = std::make_unique(config.main_thread_runner, -+ std::move(application_name)); - if (key_storage->WaitForInitOnTaskRunner()) { - VLOG(1) << "OSCrypt using Keyring as backend."; - return key_storage; -diff --git a/services/network/network_service.cc b/services/network/network_service.cc -index 02c8af43258f6a31f3cc667e73f55f8f67330b51..bea06f626cc2b302ca8a25c753c37cea0d4c9e8c 100644 ---- a/services/network/network_service.cc -+++ b/services/network/network_service.cc -@@ -622,6 +622,7 @@ void NetworkService::SetCryptConfig(mojom::CryptConfigPtr crypt_config) { - auto config = std::make_unique(); - config->store = crypt_config->store; - config->product_name = crypt_config->product_name; -+ config->application_name = crypt_config->application_name; - config->main_thread_runner = base::ThreadTaskRunnerHandle::Get(); - config->should_use_preference = crypt_config->should_use_preference; - config->user_data_path = crypt_config->user_data_path; -diff --git a/services/network/public/mojom/network_service.mojom b/services/network/public/mojom/network_service.mojom -index 3a1abc4d1b64ad9480f5218cd1de8fd61a064f34..0edbe59d3a70b5bca759cd8a726baded6b81ea71 100644 ---- a/services/network/public/mojom/network_service.mojom -+++ b/services/network/public/mojom/network_service.mojom -@@ -99,6 +99,13 @@ struct CryptConfig { - // The product name to use for permission prompts. - string product_name; - -+ // The application name to store the crypto key against. For Chromium/Chrome -+ // builds leave this unset and it will default correctly. This config option -+ // is for embedders to provide their application name in place of "Chromium". -+ // Only used when the allow_runtime_configurable_key_storage feature is -+ // enabled -+ string application_name; -+ - // Controls whether preference on using or ignoring backends is used. - bool should_use_preference; - diff --git a/patches/chromium/ui_gtk_public_header.patch b/patches/chromium/ui_gtk_public_header.patch index fa69dec88f0f7..72fdf5111391d 100644 --- a/patches/chromium/ui_gtk_public_header.patch +++ b/patches/chromium/ui_gtk_public_header.patch @@ -6,7 +6,7 @@ Subject: ui_gtk_public_header.patch Allow electron to depend on //ui/gtk/gtk_util.h diff --git a/ui/gtk/BUILD.gn b/ui/gtk/BUILD.gn -index d83a80204cd6cb87333208d1d4edf9b355d1cdb8..7158a7d827255108a288708e51f99d9ad357c6ec 100644 +index 7bdb5a0e439ab931d0656265cedf298ca4a34d13..a0098d0ca4256f22138f857fad920725853f998d 100644 --- a/ui/gtk/BUILD.gn +++ b/ui/gtk/BUILD.gn @@ -39,7 +39,7 @@ generate_stubs("gtk_stubs") { diff --git a/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch b/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch index 88ea9287e275f..aef2f10cb1043 100644 --- a/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch +++ b/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch @@ -6,7 +6,7 @@ Subject: unsandboxed_ppapi_processes_skip_zygote.patch Unsandboxed ppapi processes should skip zygote. diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc -index 4493794a46154d870381de20b5cf49309c2102d2..733bb1b86c42e973a1dfea395749989859089024 100644 +index bebe91496db1822031001f00194952e694018c10..e59de720fb4270f33c8abf34cb2d684610ec1285 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -111,6 +111,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index c24dd6fd4ca0a..4685e8bfc81cf 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 87792fc94a84ed3336c70d431516150a91ec5928..15a8243ca9cfeca6b4eef631881564e0ba07e50d 100644 +index b21c2fa17d71a05a2b363cf31bbaaae82a3dc7aa..5659873ba2fc154eba45d55596c239b27912f509 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -2783,6 +2783,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2882,6 +2882,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { frame_tree_.Init(site_instance.get(), params.renderer_initiated_creation, params.main_frame_name); @@ -25,7 +25,7 @@ index 87792fc94a84ed3336c70d431516150a91ec5928..15a8243ca9cfeca6b4eef631881564e0 WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -2793,6 +2799,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2892,6 +2898,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { view_.reset(CreateWebContentsView(this, delegate, &render_view_host_delegate_view_)); } @@ -34,10 +34,10 @@ index 87792fc94a84ed3336c70d431516150a91ec5928..15a8243ca9cfeca6b4eef631881564e0 CHECK(view_.get()); diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index 84c271d015931322c4c3a259dc3db64655502bdf..3b7b5facc0cd2454a83f9034d63add1e684f438c 100644 +index 67006dfc4c4fab7494d54fee35ab72a38035d4ee..e4e70e4d378cf13eb00d7327b88e2501dcfc7f84 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h -@@ -84,10 +84,13 @@ class BrowserContext; +@@ -85,10 +85,13 @@ class BrowserContext; class BrowserPluginGuestDelegate; class RenderFrameHost; class RenderViewHost; @@ -51,7 +51,7 @@ index 84c271d015931322c4c3a259dc3db64655502bdf..3b7b5facc0cd2454a83f9034d63add1e class WebUI; struct DropData; struct MHTMLGenerationParams; -@@ -220,6 +223,10 @@ class WebContents : public PageNavigator, +@@ -221,6 +224,10 @@ class WebContents : public PageNavigator, // Sandboxing flags set on the new WebContents. network::mojom::WebSandboxFlags starting_sandbox_flags; diff --git a/patches/chromium/worker_context_will_destroy.patch b/patches/chromium/worker_context_will_destroy.patch index ffd7aab614277..403b4a04e9b3e 100644 --- a/patches/chromium/worker_context_will_destroy.patch +++ b/patches/chromium/worker_context_will_destroy.patch @@ -26,10 +26,10 @@ index 601633452b5f9afe64d98833057ac86de3a05650..529e597b572854cbf56bb45d9554549e // An empty URL is returned if the URL is not overriden. virtual GURL OverrideFlashEmbedWithHTML(const GURL& url); diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index d5ebc982f6cda74fd9a661d288168d92bdf7ba9f..370db9d18e3c5f26d8913cbc74edf3a66a19744b 100644 +index 074db7fba98fec0a31ee9474bf24647df3929a26..37a92ce1c7a17a2c1d141e71fe7ab97d47c241fc 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -924,6 +924,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { +@@ -944,6 +944,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread(); } @@ -43,10 +43,10 @@ index d5ebc982f6cda74fd9a661d288168d92bdf7ba9f..370db9d18e3c5f26d8913cbc74edf3a6 const v8::Local& worker) { GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index 4b739453cffc3ffc69536383adf9b0de3fe16b2a..a53ac812332257d775eded80c884b24ec68a5b89 100644 +index 6ce06a917f95d662954c60c9144a59c004bd6c9c..e38a96a3b9665cc832fe9c24493a335888253996 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -200,6 +200,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -205,6 +205,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void DidStartWorkerThread() override; void WillStopWorkerThread() override; void WorkerContextCreated(const v8::Local& worker) override; @@ -55,10 +55,10 @@ index 4b739453cffc3ffc69536383adf9b0de3fe16b2a..a53ac812332257d775eded80c884b24e 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 34308ebf0478b148e72c1c858e7aff180fa47248..aa5135f77b66188b435a5727c0c00da6ed6db99e 100644 +index 293b575414d01ed03e7de08175834dee98117d11..4e7767748d705c79ecd6d4cdf3982185e7bac3bd 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -715,6 +715,7 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -727,6 +727,7 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local& worker) {} @@ -67,7 +67,7 @@ index 34308ebf0478b148e72c1c858e7aff180fa47248..aa5135f77b66188b435a5727c0c00da6 const WebSecurityOrigin& script_origin) { return false; diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc -index f32e4fc35c6516c475f355086a1d3fb187ac6065..4381574047459ff8d88653e58ad8f3c088aaf138 100644 +index 13420144484a55dab439cf32475b6681b783cc10..b277c8632e17cbb7afcc60fddd0edd757c6580fd 100644 --- a/third_party/blink/renderer/core/workers/worker_thread.cc +++ b/third_party/blink/renderer/core/workers/worker_thread.cc @@ -737,6 +737,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() { 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 577acbc674221..565aa39b51115 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 @@ -35,10 +35,10 @@ index f3dd10a3b30c89a02acc499279660d975a9a2de8..7a016ffc9bcad177c25bc2ce4c388616 // from the worker thread. virtual void WillDestroyWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index 370db9d18e3c5f26d8913cbc74edf3a66a19744b..ca91d53e5dcf609b4e16204bf2c3a071cec1070b 100644 +index 37a92ce1c7a17a2c1d141e71fe7ab97d47c241fc..0880925d617745f36d39edde44f3a38ce220adb3 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -936,6 +936,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated( +@@ -956,6 +956,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated( worker); } @@ -52,10 +52,10 @@ index 370db9d18e3c5f26d8913cbc74edf3a66a19744b..ca91d53e5dcf609b4e16204bf2c3a071 const blink::WebSecurityOrigin& script_origin) { return GetContentClient()->renderer()->AllowScriptExtensionForServiceWorker( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index a53ac812332257d775eded80c884b24ec68a5b89..e16fa74db4a1bf2c375d8dea0f4f7e9cdae3fc61 100644 +index e38a96a3b9665cc832fe9c24493a335888253996..64c87952472dcab0db410ea7edb5fc4040d9b67b 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -200,6 +200,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -205,6 +205,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void DidStartWorkerThread() override; void WillStopWorkerThread() override; void WorkerContextCreated(const v8::Local& worker) override; @@ -65,10 +65,10 @@ index a53ac812332257d775eded80c884b24ec68a5b89..e16fa74db4a1bf2c375d8dea0f4f7e9c 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 aa5135f77b66188b435a5727c0c00da6ed6db99e..dd303df37def2053ffe253158a9e111704832cf8 100644 +index 4e7767748d705c79ecd6d4cdf3982185e7bac3bd..987e4f730522af851e241083e01404f8a6a16c93 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -715,6 +715,8 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -727,6 +727,8 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local& worker) {} diff --git a/patches/v8/build_gn.patch b/patches/v8/build_gn.patch index eccec28d1633b..8a09d63755f82 100644 --- a/patches/v8/build_gn.patch +++ b/patches/v8/build_gn.patch @@ -9,10 +9,10 @@ necessary for native modules to load. Also, some fixes relating to mksnapshot on ARM. diff --git a/BUILD.gn b/BUILD.gn -index 282a97a4c13d45cbc91190c7233927ddd96b1bc8..124e689e9ee13a4fd646de6ddaa014573d3fa40b 100644 +index b15b553587ced022b91c0594380117c6bd877e57..408d7d0a9bf0dc3c031d0fe9f4ea016d0aec2504 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -505,7 +505,7 @@ config("internal_config") { +@@ -521,7 +521,7 @@ config("internal_config") { ":cppgc_header_features", ] @@ -21,7 +21,7 @@ index 282a97a4c13d45cbc91190c7233927ddd96b1bc8..124e689e9ee13a4fd646de6ddaa01457 defines += [ "BUILDING_V8_SHARED" ] } } -@@ -5200,7 +5200,7 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -5232,7 +5232,7 @@ if (current_toolchain == v8_generator_toolchain) { "src/interpreter/bytecodes.h", ] @@ -30,7 +30,7 @@ index 282a97a4c13d45cbc91190c7233927ddd96b1bc8..124e689e9ee13a4fd646de6ddaa01457 deps = [ ":v8_libbase", -@@ -5238,6 +5238,8 @@ if (current_toolchain == v8_snapshot_toolchain) { +@@ -5270,6 +5270,8 @@ if (current_toolchain == v8_snapshot_toolchain) { configs = [ ":internal_config" ] diff --git a/patches/v8/dcheck.patch b/patches/v8/dcheck.patch index eb95a12dbc9e1..aa35381e59393 100644 --- a/patches/v8/dcheck.patch +++ b/patches/v8/dcheck.patch @@ -6,10 +6,10 @@ Subject: dcheck.patch https://github.com/auchenberg/volkswagen diff --git a/src/api/api.cc b/src/api/api.cc -index d66859cdc46fe7a7905438687b3654d463b52b65..827e4ba01f391ca700026603a6c74f5a7e053ec1 100644 +index e6c0d1efde22c28c2e2efa125912f000a83c5f58..f23047356bf46fa0075a225c4519b86aab9e1308 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -8758,7 +8758,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { +@@ -8763,7 +8763,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { } void Isolate::PerformMicrotaskCheckpoint() { @@ -19,10 +19,10 @@ index d66859cdc46fe7a7905438687b3654d463b52b65..827e4ba01f391ca700026603a6c74f5a isolate->default_microtask_queue()->PerformCheckpoint(this); } diff --git a/src/heap/heap.cc b/src/heap/heap.cc -index 51726fb85933cdc5341dcdc88b0d3410213e7818..57db36941b62a37b9e988dccaf3c5e3e9dcb1977 100644 +index 8ef5e4dfd4ac743c542b002fde08d38eca876b82..0c2145b84a2c7519a0dd3dd87bed7799f539e1a1 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc -@@ -5829,9 +5829,9 @@ void Heap::DeinitSharedSpaces() { +@@ -5834,9 +5834,9 @@ void Heap::DeinitSharedSpaces() { void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback, GCType gc_type, void* data) { DCHECK_NOT_NULL(callback); diff --git a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch index 02197340df134..a9e13f34b4864 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 aee9d655d521cd72856c32be29b16b38fbb186f2..e3f5ded1f477fdb9c894854ed0601535dce3f818 100644 +index 58f41e707ea385699330e185085c688cfa6a29d8..9f2b5437545dd6de90e95bc30ec06bed48723166 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -505,6 +505,10 @@ config("internal_config") { +@@ -521,6 +521,10 @@ config("internal_config") { ":cppgc_header_features", ] @@ -27,10 +27,10 @@ index aee9d655d521cd72856c32be29b16b38fbb186f2..e3f5ded1f477fdb9c894854ed0601535 defines += [ "BUILDING_V8_SHARED" ] } diff --git a/src/base/macros.h b/src/base/macros.h -index 49a06b87da5d4fa95ed52f5e0214ef4e9eba54f4..e878feb5c16b4b469de0a2c763681b5b63688bb7 100644 +index 99ccd28a1db58d0fa938025dbf28c5490e04ca15..b36cf6a2b43741b7b72aaa6896787ce621d09d9c 100644 --- a/src/base/macros.h +++ b/src/base/macros.h -@@ -388,13 +388,17 @@ bool is_inbounds(float_t v) { +@@ -381,13 +381,17 @@ bool is_inbounds(float_t v) { #ifdef V8_OS_WIN // Setup for Windows shared library export. diff --git a/patches/v8/expose_mksnapshot.patch b/patches/v8/expose_mksnapshot.patch index e4024897e6a8a..7964364cc6de7 100644 --- a/patches/v8/expose_mksnapshot.patch +++ b/patches/v8/expose_mksnapshot.patch @@ -6,10 +6,10 @@ Subject: expose_mksnapshot.patch Needed in order to target mksnapshot for mksnapshot zip. diff --git a/BUILD.gn b/BUILD.gn -index 124e689e9ee13a4fd646de6ddaa014573d3fa40b..aee9d655d521cd72856c32be29b16b38fbb186f2 100644 +index 408d7d0a9bf0dc3c031d0fe9f4ea016d0aec2504..58f41e707ea385699330e185085c688cfa6a29d8 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -5212,7 +5212,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -5244,7 +5244,6 @@ if (current_toolchain == v8_generator_toolchain) { if (current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index fca21717dbc94..f3a3bb40e8df6 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -14,7 +14,6 @@ #include "base/environment.h" #include "base/files/file_path.h" #include "base/files/file_util.h" -#include "base/optional.h" #include "base/path_service.h" #include "base/system/sys_info.h" #include "chrome/browser/browser_process.h" @@ -57,6 +56,7 @@ #include "shell/common/node_includes.h" #include "shell/common/options_switches.h" #include "shell/common/platform_util.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/gfx/image/image.h" #if defined(OS_WIN) @@ -918,7 +918,7 @@ void App::SetAppPath(const base::FilePath& app_path) { #if !defined(OS_MAC) void App::SetAppLogsPath(gin_helper::ErrorThrower thrower, - base::Optional custom_path) { + absl::optional custom_path) { if (custom_path.has_value()) { if (!custom_path->IsAbsolute()) { thrower.ThrowError("Path must be absolute"); @@ -953,7 +953,7 @@ base::FilePath App::GetPath(gin_helper::ErrorThrower thrower, // If users try to get the logs path before setting a logs path, // set the path to a sensible default and then try to get it again if (!succeed && name == "logs") { - SetAppLogsPath(thrower, base::Optional()); + SetAppLogsPath(thrower, absl::optional()); succeed = base::PathService::Get(key, &path); } diff --git a/shell/browser/api/electron_api_app.h b/shell/browser/api/electron_api_app.h index 4d866166e1366..b6a9391540520 100644 --- a/shell/browser/api/electron_api_app.h +++ b/shell/browser/api/electron_api_app.h @@ -174,7 +174,7 @@ class App : public ElectronBrowserClient::Delegate, void ChildProcessDisconnected(int pid); void SetAppLogsPath(gin_helper::ErrorThrower thrower, - base::Optional custom_path); + absl::optional custom_path); // Get/Set the pre-defined path in PathService. base::FilePath GetPath(gin_helper::ErrorThrower thrower, diff --git a/shell/browser/api/electron_api_app_mac.mm b/shell/browser/api/electron_api_app_mac.mm index 8a4458f9aed2b..5b87999eeebc8 100644 --- a/shell/browser/api/electron_api_app_mac.mm +++ b/shell/browser/api/electron_api_app_mac.mm @@ -16,7 +16,7 @@ namespace api { void App::SetAppLogsPath(gin_helper::ErrorThrower thrower, - base::Optional custom_path) { + absl::optional custom_path) { if (custom_path.has_value()) { if (!custom_path->IsAbsolute()) { thrower.ThrowError("Path must be absolute"); diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index ba551776aecd2..9c597d4683dc6 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -886,7 +886,7 @@ bool BaseWindow::GetWindowButtonVisibility() const { void BaseWindow::SetTrafficLightPosition(const gfx::Point& position) { // For backward compatibility we treat (0, 0) as resetting to default. if (position.IsOrigin()) - window_->SetTrafficLightPosition(base::nullopt); + window_->SetTrafficLightPosition(absl::nullopt); else window_->SetTrafficLightPosition(position); } diff --git a/shell/browser/api/electron_api_content_tracing.cc b/shell/browser/api/electron_api_content_tracing.cc index 32f9ed490c32a..b48daa90dbc15 100644 --- a/shell/browser/api/electron_api_content_tracing.cc +++ b/shell/browser/api/electron_api_content_tracing.cc @@ -7,7 +7,6 @@ #include #include "base/files/file_util.h" -#include "base/optional.h" #include "base/task/thread_pool.h" #include "base/threading/thread_restrictions.h" #include "base/trace_event/trace_config.h" @@ -18,6 +17,7 @@ #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/promise.h" #include "shell/common/node_includes.h" +#include "third_party/abseil-cpp/absl/types/optional.h" using content::TracingController; @@ -58,18 +58,18 @@ namespace { using CompletionCallback = base::OnceCallback; -base::Optional CreateTemporaryFileOnIO() { +absl::optional CreateTemporaryFileOnIO() { base::FilePath temp_file_path; if (!base::CreateTemporaryFile(&temp_file_path)) - return base::nullopt; - return base::make_optional(std::move(temp_file_path)); + return absl::nullopt; + return absl::make_optional(std::move(temp_file_path)); } void StopTracing(gin_helper::Promise promise, - base::Optional file_path) { + absl::optional file_path) { auto resolve_or_reject = base::AdaptCallbackForRepeating(base::BindOnce( [](gin_helper::Promise promise, - const base::FilePath& path, base::Optional error) { + const base::FilePath& path, absl::optional error) { if (error) { promise.RejectWithErrorMessage(error.value()); } else { @@ -79,14 +79,14 @@ void StopTracing(gin_helper::Promise promise, std::move(promise), *file_path)); if (file_path) { auto endpoint = TracingController::CreateFileEndpoint( - *file_path, base::BindRepeating(resolve_or_reject, base::nullopt)); + *file_path, base::BindRepeating(resolve_or_reject, absl::nullopt)); if (!TracingController::GetInstance()->StopTracing(endpoint)) { - resolve_or_reject.Run(base::make_optional( + resolve_or_reject.Run(absl::make_optional( "Failed to stop tracing (was a trace in progress?)")); } } else { resolve_or_reject.Run( - base::make_optional("Failed to create temporary file for trace data")); + absl::make_optional("Failed to create temporary file for trace data")); } } @@ -96,7 +96,7 @@ v8::Local StopRecording(gin_helper::Arguments* args) { base::FilePath path; if (args->GetNext(&path) && !path.empty()) { - StopTracing(std::move(promise), base::make_optional(path)); + StopTracing(std::move(promise), absl::make_optional(path)); } else { // use a temporary file. base::ThreadPool::PostTaskAndReplyWithResult( diff --git a/shell/browser/api/electron_api_cookies.cc b/shell/browser/api/electron_api_cookies.cc index c24546f454407..17f32d75b5aa3 100644 --- a/shell/browser/api/electron_api_cookies.cc +++ b/shell/browser/api/electron_api_cookies.cc @@ -132,10 +132,10 @@ bool MatchesCookie(const base::Value& filter, if ((str = filter.FindStringKey("domain")) && !MatchesDomain(*str, cookie.Domain())) return false; - base::Optional secure_filter = filter.FindBoolKey("secure"); + absl::optional secure_filter = filter.FindBoolKey("secure"); if (secure_filter && *secure_filter == cookie.IsSecure()) return false; - base::Optional session_filter = filter.FindBoolKey("session"); + absl::optional session_filter = filter.FindBoolKey("session"); if (session_filter && *session_filter != !cookie.IsPersistent()) return false; return true; @@ -163,7 +163,7 @@ void FilterCookieWithStatuses( } // Parse dictionary property to CanonicalCookie time correctly. -base::Time ParseTimeProperty(const base::Optional& value) { +base::Time ParseTimeProperty(const absl::optional& value) { if (!value) // empty time means ignoring the parameter return base::Time(); if (*value == 0) // FromDoubleT would convert 0 to empty Time diff --git a/shell/browser/api/electron_api_debugger.cc b/shell/browser/api/electron_api_debugger.cc index e3f400903a7b8..2569e24b3d390 100644 --- a/shell/browser/api/electron_api_debugger.cc +++ b/shell/browser/api/electron_api_debugger.cc @@ -165,7 +165,7 @@ v8::Local Debugger::SendCommand(gin::Arguments* args) { pending_requests_.emplace(request_id, std::move(promise)); request.SetInteger("id", request_id); request.SetString("method", method); - if (!command_params.empty()) { + if (!command_params.DictEmpty()) { request.Set("params", base::Value::ToUniquePtrValue(command_params.Clone())); } diff --git a/shell/browser/api/electron_api_global_shortcut.cc b/shell/browser/api/electron_api_global_shortcut.cc index 4caf6b95f00b4..edaf03707233e 100644 --- a/shell/browser/api/electron_api_global_shortcut.cc +++ b/shell/browser/api/electron_api_global_shortcut.cc @@ -7,6 +7,7 @@ #include #include +#include "base/containers/contains.h" #include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" #include "gin/dictionary.h" diff --git a/shell/browser/api/electron_api_net_log.cc b/shell/browser/api/electron_api_net_log.cc index 1140a75d3266a..1eddc557d730c 100644 --- a/shell/browser/api/electron_api_net_log.cc +++ b/shell/browser/api/electron_api_net_log.cc @@ -121,7 +121,7 @@ v8::Local NetLog::StartLogging(base::FilePath log_path, } pending_start_promise_ = - base::make_optional>(args->isolate()); + absl::make_optional>(args->isolate()); v8::Local handle = pending_start_promise_->GetHandle(); auto command_line_string = diff --git a/shell/browser/api/electron_api_net_log.h b/shell/browser/api/electron_api_net_log.h index dddea7c204204..a09904df88c34 100644 --- a/shell/browser/api/electron_api_net_log.h +++ b/shell/browser/api/electron_api_net_log.h @@ -10,12 +10,12 @@ #include #include "base/callback.h" -#include "base/optional.h" #include "base/values.h" #include "gin/handle.h" #include "gin/wrappable.h" #include "services/network/public/mojom/net_log.mojom.h" #include "shell/common/gin_helper/promise.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace gin { class Arguments; @@ -61,7 +61,7 @@ class NetLog : public gin::Wrappable { network::mojom::NetLogExporterPtr net_log_exporter_; - base::Optional> pending_start_promise_; + absl::optional> pending_start_promise_; scoped_refptr file_task_runner_; diff --git a/shell/browser/api/electron_api_session.cc b/shell/browser/api/electron_api_session.cc index 2e256938510e2..39fb441e41aeb 100644 --- a/shell/browser/api/electron_api_session.cc +++ b/shell/browser/api/electron_api_session.cc @@ -265,7 +265,7 @@ void DownloadIdCallback(content::DownloadManager* download_manager, uint32_t id) { download_manager->CreateDownloadItem( base::GenerateGUID(), id, path, path, url_chain, GURL(), GURL(), GURL(), - GURL(), base::nullopt, mime_type, mime_type, start_time, base::Time(), + GURL(), absl::nullopt, mime_type, mime_type, start_time, base::Time(), etag, last_modified, offset, length, std::string(), download::DownloadItem::INTERRUPTED, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, diff --git a/shell/browser/api/electron_api_tray.cc b/shell/browser/api/electron_api_tray.cc index 1ac892305763b..72cd816638bde 100644 --- a/shell/browser/api/electron_api_tray.cc +++ b/shell/browser/api/electron_api_tray.cc @@ -64,7 +64,7 @@ gin::WrapperInfo Tray::kWrapperInfo = {gin::kEmbedderNativeGin}; Tray::Tray(v8::Isolate* isolate, v8::Local image, - base::Optional guid) + absl::optional guid) : tray_icon_(TrayIcon::Create(guid)) { SetImage(isolate, image); tray_icon_->AddObserver(this); @@ -75,7 +75,7 @@ Tray::~Tray() = default; // static gin::Handle Tray::New(gin_helper::ErrorThrower thrower, v8::Local image, - base::Optional guid, + absl::optional guid, gin::Arguments* args) { if (!Browser::Get()->is_ready()) { thrower.ThrowError("Cannot create Tray before app is ready"); @@ -226,7 +226,7 @@ void Tray::SetToolTip(const std::string& tool_tip) { } void Tray::SetTitle(const std::string& title, - const base::Optional& options, + const absl::optional& options, gin::Arguments* args) { if (!CheckAlive()) return; diff --git a/shell/browser/api/electron_api_tray.h b/shell/browser/api/electron_api_tray.h index 9fde1b1434270..f3ce64ae5bd42 100644 --- a/shell/browser/api/electron_api_tray.h +++ b/shell/browser/api/electron_api_tray.h @@ -44,7 +44,7 @@ class Tray : public gin::Wrappable, // gin_helper::Constructible static gin::Handle New(gin_helper::ErrorThrower thrower, v8::Local image, - base::Optional guid, + absl::optional guid, gin::Arguments* args); static v8::Local FillObjectTemplate( v8::Isolate*, @@ -56,7 +56,7 @@ class Tray : public gin::Wrappable, private: Tray(v8::Isolate* isolate, v8::Local image, - base::Optional guid); + absl::optional guid); ~Tray() override; // TrayIconObserver: @@ -87,7 +87,7 @@ class Tray : public gin::Wrappable, void SetPressedImage(v8::Isolate* isolate, v8::Local image); void SetToolTip(const std::string& tool_tip); void SetTitle(const std::string& title, - const base::Optional& options, + const absl::optional& options, gin::Arguments* args); std::string GetTitle(); void SetIgnoreDoubleClickEvents(bool ignore); diff --git a/shell/browser/api/electron_api_url_loader.cc b/shell/browser/api/electron_api_url_loader.cc index a83c687b4993a..349705a242087 100644 --- a/shell/browser/api/electron_api_url_loader.cc +++ b/shell/browser/api/electron_api_url_loader.cc @@ -317,7 +317,7 @@ void SimpleURLLoaderWrapper::PinBodyGetter(v8::Local body_getter) { SimpleURLLoaderWrapper::~SimpleURLLoaderWrapper() = default; void SimpleURLLoaderWrapper::OnAuthRequired( - const base::Optional& window_id, + const absl::optional& window_id, uint32_t request_id, const GURL& url, bool first_auth_attempt, @@ -338,7 +338,7 @@ void SimpleURLLoaderWrapper::OnAuthRequired( gin::Arguments* args) { std::u16string username_str, password_str; if (!args->GetNext(&username_str) || !args->GetNext(&password_str)) { - auth_responder->OnAuthCredentials(base::nullopt); + auth_responder->OnAuthCredentials(absl::nullopt); return; } auth_responder->OnAuthCredentials( diff --git a/shell/browser/api/electron_api_url_loader.h b/shell/browser/api/electron_api_url_loader.h index e8e91e7808bcf..dac2c494845e4 100644 --- a/shell/browser/api/electron_api_url_loader.h +++ b/shell/browser/api/electron_api_url_loader.h @@ -68,7 +68,7 @@ class SimpleURLLoaderWrapper // network::mojom::URLLoaderNetworkServiceObserver: void OnAuthRequired( - const base::Optional& window_id, + const absl::optional& window_id, uint32_t request_id, const GURL& url, bool first_auth_attempt, @@ -82,7 +82,7 @@ class SimpleURLLoaderWrapper bool fatal, OnSSLCertificateErrorCallback response) override; void OnCertificateRequested( - const base::Optional& window_id, + const absl::optional& window_id, const scoped_refptr& cert_info, mojo::PendingRemote client_cert_responder) override {} diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 9f6b4c8d3675b..8f7c78fa2cd75 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -16,7 +16,6 @@ #include "base/files/file_util.h" #include "base/json/json_reader.h" #include "base/no_destructor.h" -#include "base/optional.h" #include "base/strings/utf_string_conversions.h" #include "base/task/current_thread.h" #include "base/task/post_task.h" @@ -122,6 +121,7 @@ #include "shell/common/process_util.h" #include "shell/common/v8_value_serializer.h" #include "storage/browser/file_system/isolated_context.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/common/input/web_input_event.h" #include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h" @@ -385,7 +385,7 @@ void OnCapturePageDone(gin_helper::Promise promise, promise.Resolve(gfx::Image::CreateFrom1xBitmap(bitmap)); } -base::Optional GetCursorBlinkInterval() { +absl::optional GetCursorBlinkInterval() { #if defined(OS_MAC) base::TimeDelta interval; if (ui::TextInsertionCaretBlinkPeriod(&interval)) @@ -401,7 +401,7 @@ base::Optional GetCursorBlinkInterval() { : base::TimeDelta::FromMilliseconds(system_msec); } #endif - return base::nullopt; + return absl::nullopt; } #if BUILDFLAG(ENABLE_PRINTING) diff --git a/shell/browser/api/electron_api_web_frame_main.cc b/shell/browser/api/electron_api_web_frame_main.cc index f650abc83543a..398bca9f8e91e 100644 --- a/shell/browser/api/electron_api_web_frame_main.cc +++ b/shell/browser/api/electron_api_web_frame_main.cc @@ -182,7 +182,7 @@ void WebFrameMain::OnRendererConnectionError() { void WebFrameMain::PostMessage(v8::Isolate* isolate, const std::string& channel, v8::Local message_value, - base::Optional> transfer) { + absl::optional> transfer) { blink::TransferableMessage transferable_message; if (!electron::SerializeV8Value(isolate, message_value, &transferable_message)) { diff --git a/shell/browser/api/electron_api_web_frame_main.h b/shell/browser/api/electron_api_web_frame_main.h index 0291c3284add6..8c98542719e27 100644 --- a/shell/browser/api/electron_api_web_frame_main.h +++ b/shell/browser/api/electron_api_web_frame_main.h @@ -13,6 +13,7 @@ #include "base/process/process.h" #include "gin/handle.h" #include "gin/wrappable.h" +#include "mojo/public/cpp/bindings/remote.h" #include "shell/common/gin_helper/constructible.h" #include "shell/common/gin_helper/pinnable.h" #include "third_party/blink/public/mojom/page/page_visibility_state.mojom-forward.h" @@ -88,7 +89,7 @@ class WebFrameMain : public gin::Wrappable, void PostMessage(v8::Isolate* isolate, const std::string& channel, v8::Local message_value, - base::Optional> transfer); + absl::optional> transfer); int FrameTreeNodeID() const; std::string Name() const; diff --git a/shell/browser/api/process_metric.cc b/shell/browser/api/process_metric.cc index 4ddbf14b39a5a..fd447fd43543c 100644 --- a/shell/browser/api/process_metric.cc +++ b/shell/browser/api/process_metric.cc @@ -7,7 +7,7 @@ #include #include -#include "base/optional.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #if defined(OS_WIN) #include @@ -34,14 +34,14 @@ mach_port_t TaskForPid(pid_t pid) { return task; } -base::Optional GetTaskInfo(mach_port_t task) { +absl::optional GetTaskInfo(mach_port_t task) { if (task == MACH_PORT_NULL) - return base::nullopt; + return absl::nullopt; mach_task_basic_info_data_t info = {}; mach_msg_type_number_t count = MACH_TASK_BASIC_INFO_COUNT; kern_return_t kr = task_info(task, MACH_TASK_BASIC_INFO, reinterpret_cast(&info), &count); - return (kr == KERN_SUCCESS) ? base::make_optional(info) : base::nullopt; + return (kr == KERN_SUCCESS) ? absl::make_optional(info) : absl::nullopt; } } // namespace diff --git a/shell/browser/badging/badge_manager.cc b/shell/browser/badging/badge_manager.cc index d99be915ca9e4..dcc06ceb74c00 100755 --- a/shell/browser/badging/badge_manager.cc +++ b/shell/browser/badging/badge_manager.cc @@ -68,7 +68,7 @@ void BadgeManager::BindServiceWorkerReceiver( std::move(context)); } -std::string BadgeManager::GetBadgeString(base::Optional badge_content) { +std::string BadgeManager::GetBadgeString(absl::optional badge_content) { if (!badge_content) return "•"; @@ -88,9 +88,9 @@ void BadgeManager::SetBadge(blink::mojom::BadgeValuePtr mojo_value) { return; } - base::Optional value = - mojo_value->is_flag() ? base::nullopt - : base::make_optional(mojo_value->get_number()); + absl::optional value = + mojo_value->is_flag() ? absl::nullopt + : absl::make_optional(mojo_value->get_number()); electron::Browser::Get()->SetBadgeCount(value); } diff --git a/shell/browser/badging/badge_manager.h b/shell/browser/badging/badge_manager.h index 5df9679b5d148..74083671490cd 100644 --- a/shell/browser/badging/badge_manager.h +++ b/shell/browser/badging/badge_manager.h @@ -11,9 +11,9 @@ #include #include "base/macros.h" -#include "base/optional.h" #include "components/keyed_service/core/keyed_service.h" #include "mojo/public/cpp/bindings/receiver_set.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/mojom/badging/badging.mojom.h" #include "url/gurl.h" @@ -43,7 +43,7 @@ class BadgeManager : public KeyedService, public blink::mojom::BadgeService { mojo::PendingReceiver receiver); // Determines the text to put on the badge based on some badge_content. - static std::string GetBadgeString(base::Optional badge_content); + static std::string GetBadgeString(absl::optional badge_content); private: // The BindingContext of a mojo request. Allows mojo calls to be tied back diff --git a/shell/browser/browser.h b/shell/browser/browser.h index 12e1f8876ba1c..682f5b1b771f7 100755 --- a/shell/browser/browser.h +++ b/shell/browser/browser.h @@ -109,7 +109,7 @@ class Browser : public WindowListObserver { #endif // Set/Get the badge count. - bool SetBadgeCount(base::Optional count); + bool SetBadgeCount(absl::optional count); int GetBadgeCount(); #if defined(OS_WIN) @@ -368,7 +368,7 @@ class Browser : public WindowListObserver { #if defined(OS_WIN) void UpdateBadgeContents(HWND hwnd, - const base::Optional& badge_content, + const absl::optional& badge_content, const std::string& badge_alt_string); // In charge of running taskbar related APIs. diff --git a/shell/browser/browser_linux.cc b/shell/browser/browser_linux.cc index 68af2f01a81e3..af2e99ec882e9 100644 --- a/shell/browser/browser_linux.cc +++ b/shell/browser/browser_linux.cc @@ -51,7 +51,7 @@ bool LaunchXdgUtility(const std::vector& argv, int* exit_code) { return process.WaitForExit(exit_code); } -base::Optional GetXdgAppOutput( +absl::optional GetXdgAppOutput( const std::vector& argv) { std::string reply; int success_code; @@ -60,9 +60,9 @@ base::Optional GetXdgAppOutput( &success_code); if (!ran_ok || success_code != EXIT_SUCCESS) - return base::Optional(); + return absl::optional(); - return base::make_optional(reply); + return absl::make_optional(reply); } bool SetDefaultWebClient(const std::string& protocol) { @@ -128,7 +128,7 @@ std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) { return base::ASCIIToUTF16(GetXdgAppOutput(argv).value_or(std::string())); } -bool Browser::SetBadgeCount(base::Optional count) { +bool Browser::SetBadgeCount(absl::optional count) { if (IsUnityRunning() && count.has_value()) { unity::SetDownloadCount(count.value()); badge_count_ = count.value(); diff --git a/shell/browser/browser_mac.mm b/shell/browser/browser_mac.mm index 03d5ae54dd664..e955a4c98a872 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -218,7 +218,7 @@ return app_display_name; } -bool Browser::SetBadgeCount(base::Optional count) { +bool Browser::SetBadgeCount(absl::optional count) { DockSetBadgeText(!count.has_value() || count.value() != 0 ? badging::BadgeManager::GetBadgeString(count) : ""); diff --git a/shell/browser/browser_win.cc b/shell/browser/browser_win.cc index e244f8b4c8b1c..1799b7acfe198 100755 --- a/shell/browser/browser_win.cc +++ b/shell/browser/browser_win.cc @@ -591,10 +591,10 @@ v8::Local Browser::GetApplicationInfoForProtocol( return handle; } -bool Browser::SetBadgeCount(base::Optional count) { - base::Optional badge_content; +bool Browser::SetBadgeCount(absl::optional count) { + absl::optional badge_content; if (count.has_value() && count.value() == 0) { - badge_content = base::nullopt; + badge_content = absl::nullopt; } else { badge_content = badging::BadgeManager::GetBadgeString(count); } @@ -635,7 +635,7 @@ bool Browser::SetBadgeCount(base::Optional count) { void Browser::UpdateBadgeContents( HWND hwnd, - const base::Optional& badge_content, + const absl::optional& badge_content, const std::string& badge_alt_string) { SkBitmap badge; if (badge_content) { diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index dcfd285d8551a..09c6cf2ad3709 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -790,7 +790,7 @@ bool ElectronBrowserClient::ArePersistentMediaDeviceIDsAllowed( content::BrowserContext* browser_context, const GURL& scope, const GURL& site_for_cookies, - const base::Optional& top_frame_origin) { + const absl::optional& top_frame_origin) { return true; } @@ -947,7 +947,7 @@ bool ElectronBrowserClient::HandleExternalProtocol( bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, - const base::Optional& initiating_origin, + const absl::optional& initiating_origin, mojo::PendingRemote* out_factory) { base::PostTask( FROM_HERE, {BrowserThread::UI}, @@ -1250,7 +1250,7 @@ void ElectronBrowserClient::CreateWebSocket( WebSocketFactory factory, const GURL& url, const net::SiteForCookies& site_for_cookies, - const base::Optional& user_agent, + const absl::optional& user_agent, mojo::PendingRemote handshake_client) { v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); @@ -1288,7 +1288,7 @@ bool ElectronBrowserClient::WillCreateURLLoaderFactory( int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, - base::Optional navigation_id, + absl::optional navigation_id, ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* diff --git a/shell/browser/electron_browser_client.h b/shell/browser/electron_browser_client.h index c4a089931cc3e..daff55a49ff36 100644 --- a/shell/browser/electron_browser_client.h +++ b/shell/browser/electron_browser_client.h @@ -187,7 +187,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient, WebSocketFactory factory, const GURL& url, const net::SiteForCookies& site_for_cookies, - const base::Optional& user_agent, + const absl::optional& user_agent, mojo::PendingRemote handshake_client) override; bool WillInterceptWebSocket(content::RenderFrameHost*) override; @@ -197,7 +197,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient, int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, - base::Optional navigation_id, + absl::optional navigation_id, ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* @@ -232,7 +232,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient, bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, - const base::Optional& initiating_origin, + const absl::optional& initiating_origin, mojo::PendingRemote* out_factory) override; std::unique_ptr CreateLoginDelegate( @@ -262,7 +262,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient, content::BrowserContext* browser_context, const GURL& scope, const GURL& site_for_cookies, - const base::Optional& top_frame_origin) override; + const absl::optional& top_frame_origin) override; // content::RenderProcessHostObserver: void RenderProcessHostDestroyed(content::RenderProcessHost* host) override; diff --git a/shell/browser/electron_browser_context.cc b/shell/browser/electron_browser_context.cc index 2d6902e773fca..e7dfaad07c363 100644 --- a/shell/browser/electron_browser_context.cc +++ b/shell/browser/electron_browser_context.cc @@ -154,7 +154,7 @@ ElectronBrowserContext::ElectronBrowserContext(const std::string& partition, ElectronBrowserContext::~ElectronBrowserContext() { DCHECK_CURRENTLY_ON(BrowserThread::UI); - NotifyWillBeDestroyed(this); + NotifyWillBeDestroyed(); // Notify any keyed services of browser context destruction. BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( this); @@ -334,7 +334,7 @@ ElectronBrowserContext::GetURLLoaderFactory() { ->WillCreateURLLoaderFactory( this, nullptr, -1, content::ContentBrowserClient::URLLoaderFactoryType::kNavigation, - url::Origin(), base::nullopt, ukm::kInvalidSourceIdObj, + url::Origin(), absl::nullopt, ukm::kInvalidSourceIdObj, &factory_receiver, &header_client, nullptr, nullptr, nullptr); network::mojom::URLLoaderFactoryParamsPtr params = diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index 9eab13aa24f03..73e6f1c303268 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -11,7 +11,6 @@ #include "base/base_switches.h" #include "base/command_line.h" #include "base/feature_list.h" -#include "base/optional.h" #include "base/path_service.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" @@ -48,6 +47,7 @@ #include "shell/common/gin_helper/trackable_object.h" #include "shell/common/node_bindings.h" #include "shell/common/node_includes.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/idle/idle.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/ui_base_switches.h" @@ -311,7 +311,7 @@ int ElectronBrowserMainParts::PreCreateThreads() { // We must set this env first to make ui::ResourceBundle accept the custom // locale. std::unique_ptr env(base::Environment::Create()); - base::Optional lc_all; + absl::optional lc_all; if (!locale.empty()) { std::string str; if (env->GetVar("LC_ALL", &str)) diff --git a/shell/browser/electron_browser_main_parts.h b/shell/browser/electron_browser_main_parts.h index f31d0099639e0..427229ea6dc08 100644 --- a/shell/browser/electron_browser_main_parts.h +++ b/shell/browser/electron_browser_main_parts.h @@ -11,7 +11,6 @@ #include "base/callback.h" #include "base/metrics/field_trial.h" -#include "base/optional.h" #include "base/timer/timer.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_main_parts.h" @@ -19,6 +18,7 @@ #include "electron/buildflags/buildflags.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/geolocation_control.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/views/layout/layout_provider.h" class BrowserProcess; @@ -145,7 +145,7 @@ class ElectronBrowserMainParts : public content::BrowserMainParts { // A place to remember the exit code once the message loop is ready. // Before then, we just exit() without any intermediate steps. - base::Optional exit_code_; + absl::optional exit_code_; std::unique_ptr js_env_; std::unique_ptr browser_; diff --git a/shell/browser/electron_download_manager_delegate.cc b/shell/browser/electron_download_manager_delegate.cc index 350db7ab7d63e..9c4af7e9aae4b 100644 --- a/shell/browser/electron_download_manager_delegate.cc +++ b/shell/browser/electron_download_manager_delegate.cc @@ -143,7 +143,7 @@ void ElectronDownloadManagerDelegate::OnDownloadPathGenerated( std::move(callback).Run(path, download::DownloadItem::TARGET_DISPOSITION_PROMPT, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - item->GetMixedContentStatus(), path, base::nullopt, + item->GetMixedContentStatus(), path, absl::nullopt, download::DOWNLOAD_INTERRUPT_REASON_NONE); } } @@ -183,7 +183,7 @@ void ElectronDownloadManagerDelegate::OnDownloadSaveDialogDone( std::move(download_callback) .Run(path, download::DownloadItem::TARGET_DISPOSITION_PROMPT, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - item->GetMixedContentStatus(), path, base::nullopt, + item->GetMixedContentStatus(), path, absl::nullopt, interrupt_reason); } @@ -203,7 +203,7 @@ bool ElectronDownloadManagerDelegate::DetermineDownloadTarget( download::DownloadItem::TARGET_DISPOSITION_OVERWRITE, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, download::DownloadItem::MixedContentStatus::UNKNOWN, - download->GetForcedFilePath(), base::nullopt, + download->GetForcedFilePath(), absl::nullopt, download::DOWNLOAD_INTERRUPT_REASON_NONE); return true; } @@ -216,7 +216,7 @@ bool ElectronDownloadManagerDelegate::DetermineDownloadTarget( save_path, download::DownloadItem::TARGET_DISPOSITION_OVERWRITE, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, download::DownloadItem::MixedContentStatus::UNKNOWN, save_path, - base::nullopt, download::DOWNLOAD_INTERRUPT_REASON_NONE); + absl::nullopt, download::DOWNLOAD_INTERRUPT_REASON_NONE); return true; } diff --git a/shell/browser/extensions/electron_component_extension_resource_manager.cc b/shell/browser/extensions/electron_component_extension_resource_manager.cc index 66e223bba7cc5..76a8c1caf7d1b 100644 --- a/shell/browser/extensions/electron_component_extension_resource_manager.cc +++ b/shell/browser/extensions/electron_component_extension_resource_manager.cc @@ -7,6 +7,7 @@ #include #include +#include "base/containers/contains.h" #include "base/logging.h" #include "base/path_service.h" #include "base/stl_util.h" diff --git a/shell/browser/extensions/electron_extensions_browser_client.cc b/shell/browser/extensions/electron_extensions_browser_client.cc index 5f44695b8170d..e7362fd389765 100644 --- a/shell/browser/extensions/electron_extensions_browser_client.cc +++ b/shell/browser/extensions/electron_extensions_browser_client.cc @@ -170,12 +170,11 @@ void ElectronExtensionsBrowserClient::LoadResourceFromResourceBundle( mojo::PendingReceiver loader, const base::FilePath& resource_relative_path, int resource_id, - const std::string& content_security_policy, - mojo::PendingRemote client, - bool send_cors_header) { + scoped_refptr headers, + mojo::PendingRemote client) { extensions::chrome_url_request_util::LoadResourceFromResourceBundle( request, std::move(loader), resource_relative_path, resource_id, - content_security_policy, std::move(client), send_cors_header); + std::move(headers), std::move(client)); } namespace { @@ -310,8 +309,8 @@ void ElectronExtensionsBrowserClient::BroadcastEventToRenderers( return; } - std::unique_ptr event( - new extensions::Event(histogram_value, event_name, std::move(args))); + auto event = std::make_unique(histogram_value, event_name, + args->TakeList()); auto& context_map = ElectronBrowserContext::browser_context_map(); for (auto const& entry : context_map) { if (entry.second) { diff --git a/shell/browser/extensions/electron_extensions_browser_client.h b/shell/browser/extensions/electron_extensions_browser_client.h index 067bc8ca1dd78..823998729fdce 100644 --- a/shell/browser/extensions/electron_extensions_browser_client.h +++ b/shell/browser/extensions/electron_extensions_browser_client.h @@ -66,9 +66,8 @@ class ElectronExtensionsBrowserClient mojo::PendingReceiver loader, const base::FilePath& resource_relative_path, int resource_id, - const std::string& content_security_policy, - mojo::PendingRemote client, - bool send_cors_header) override; + scoped_refptr headers, + mojo::PendingRemote client) override; bool AllowCrossRendererResourceLoad( const network::ResourceRequest& request, network::mojom::RequestDestination destination, diff --git a/shell/browser/login_handler.cc b/shell/browser/login_handler.cc index e0ac4458ff1e3..8d070af32c224 100644 --- a/shell/browser/login_handler.cc +++ b/shell/browser/login_handler.cc @@ -55,7 +55,7 @@ void LoginHandler::EmitEvent( api::WebContents* api_web_contents = api::WebContents::From(web_contents()); if (!api_web_contents) { - std::move(auth_required_callback_).Run(base::nullopt); + std::move(auth_required_callback_).Run(absl::nullopt); return; } @@ -74,7 +74,7 @@ void LoginHandler::EmitEvent( base::BindOnce(&LoginHandler::CallbackFromJS, weak_factory_.GetWeakPtr())); if (!default_prevented && auth_required_callback_) { - std::move(auth_required_callback_).Run(base::nullopt); + std::move(auth_required_callback_).Run(absl::nullopt); } } @@ -84,7 +84,7 @@ void LoginHandler::CallbackFromJS(gin::Arguments* args) { if (auth_required_callback_) { std::u16string username, password; if (!args->GetNext(&username) || !args->GetNext(&password)) { - std::move(auth_required_callback_).Run(base::nullopt); + std::move(auth_required_callback_).Run(absl::nullopt); return; } std::move(auth_required_callback_) diff --git a/shell/browser/native_window.h b/shell/browser/native_window.h index 4822a187b692e..fb77111c88b98 100644 --- a/shell/browser/native_window.h +++ b/shell/browser/native_window.h @@ -14,13 +14,13 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" -#include "base/optional.h" #include "base/supports_user_data.h" #include "base/values.h" #include "content/public/browser/desktop_media_id.h" #include "content/public/browser/web_contents_user_data.h" #include "extensions/browser/app_window/size_constraints.h" #include "shell/browser/native_window_observer.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/views/widget/widget_delegate.h" class SkRegion; @@ -208,8 +208,8 @@ class NativeWindow : public base::SupportsUserData, #if defined(OS_MAC) virtual void SetWindowButtonVisibility(bool visible) = 0; virtual bool GetWindowButtonVisibility() const = 0; - virtual void SetTrafficLightPosition(base::Optional position) = 0; - virtual base::Optional GetTrafficLightPosition() const = 0; + virtual void SetTrafficLightPosition(absl::optional position) = 0; + virtual absl::optional GetTrafficLightPosition() const = 0; virtual void RedrawTrafficLights() = 0; virtual void UpdateFrame() = 0; #endif diff --git a/shell/browser/native_window_mac.h b/shell/browser/native_window_mac.h index 0a43b87f0acf2..cf7e33b8c53f7 100644 --- a/shell/browser/native_window_mac.h +++ b/shell/browser/native_window_mac.h @@ -126,8 +126,8 @@ class NativeWindowMac : public NativeWindow, void SetVibrancy(const std::string& type) override; void SetWindowButtonVisibility(bool visible) override; bool GetWindowButtonVisibility() const override; - void SetTrafficLightPosition(base::Optional position) override; - base::Optional GetTrafficLightPosition() const override; + void SetTrafficLightPosition(absl::optional position) override; + absl::optional GetTrafficLightPosition() const override; void RedrawTrafficLights() override; void UpdateFrame() override; void SetTouchBar( @@ -197,7 +197,6 @@ class NativeWindowMac : public NativeWindow, protected: // views::WidgetDelegate: - bool CanResize() const override; views::View* GetContentsView() override; // ui::NativeThemeObserver: @@ -236,8 +235,7 @@ class NativeWindowMac : public NativeWindow, bool is_kiosk_ = false; bool zoom_to_page_width_ = false; - bool resizable_ = true; - base::Optional traffic_light_position_; + absl::optional traffic_light_position_; std::queue pending_transitions_; FullScreenTransitionState fullscreen_transition_state() const { @@ -259,7 +257,7 @@ class NativeWindowMac : public NativeWindow, // The visibility mode of window button controls when explicitly set through // setWindowButtonVisibility(). - base::Optional window_button_visibility_; + absl::optional window_button_visibility_; // Maximizable window state; necessary for persistence through redraws. bool maximizable_ = true; diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 7ea5fa7f61568..fc47a7ae03546 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -273,7 +273,8 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { round((NSHeight(main_screen_rect) - height) / 2), width, height); - options.Get(options::kResizable, &resizable_); + bool resizable = true; + options.Get(options::kResizable, &resizable); options.Get(options::kTitleBarStyle, &title_bar_style_); options.Get(options::kZoomToPageWidth, &zoom_to_page_width_); options.Get(options::kSimpleFullScreen, &always_simple_fullscreen_); @@ -328,7 +329,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { styleMask |= NSMiniaturizableWindowMask; if (closable) styleMask |= NSWindowStyleMaskClosable; - if (resizable_) + if (resizable) styleMask |= NSResizableWindowMask; if (!useStandardWindow || transparent() || !has_frame()) styleMask |= NSTexturedBackgroundWindowMask; @@ -342,6 +343,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { params.type = views::Widget::InitParams::TYPE_WINDOW; params.native_widget = new ElectronNativeWidgetMac(this, styleMask, widget()); widget()->Init(std::move(params)); + SetCanResize(resizable); window_ = static_cast( widget()->GetNativeWindow().GetNativeNSWindow()); @@ -780,6 +782,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { void NativeWindowMac::SetResizable(bool resizable) { SetStyleMask(resizable, NSWindowStyleMaskResizable); + SetCanResize(resizable); } bool NativeWindowMac::IsResizable() { @@ -1462,7 +1465,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { } void NativeWindowMac::SetTrafficLightPosition( - base::Optional position) { + absl::optional position) { traffic_light_position_ = std::move(position); if (buttons_view_) { [buttons_view_ setMargin:traffic_light_position_]; @@ -1470,7 +1473,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { } } -base::Optional NativeWindowMac::GetTrafficLightPosition() const { +absl::optional NativeWindowMac::GetTrafficLightPosition() const { return traffic_light_position_; } @@ -1701,10 +1704,6 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { SetMaximizable(was_maximizable); } -bool NativeWindowMac::CanResize() const { - return resizable_; -} - views::View* NativeWindowMac::GetContentsView() { return root_view_.get(); } diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index e905f97785f82..f5d335c0891e3 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -217,6 +217,9 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, #endif widget()->Init(std::move(params)); +#if defined(OS_WIN) + SetCanResize(resizable_); +#endif bool fullscreen = false; options.Get(options::kFullscreen, &fullscreen); @@ -715,6 +718,7 @@ void NativeWindowViews::SetResizable(bool resizable) { FlipWindowStyle(GetAcceleratedWidget(), resizable, WS_THICKFRAME); #endif resizable_ = resizable; + SetCanResize(resizable_); } bool NativeWindowViews::MoveAbove(const std::string& sourceId) { @@ -765,7 +769,7 @@ bool NativeWindowViews::IsResizable() { if (has_frame()) return ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME; #endif - return CanResize(); + return resizable_; } void NativeWindowViews::SetAspectRatio(double aspect_ratio, @@ -1484,10 +1488,6 @@ views::View* NativeWindowViews::GetInitiallyFocusedView() { return focused_view_; } -bool NativeWindowViews::CanResize() const { - return resizable_; -} - bool NativeWindowViews::CanMaximize() const { return resizable_ && maximizable_; } @@ -1527,7 +1527,7 @@ bool NativeWindowViews::ShouldDescendIntoChildForEventHandling( return false; // And the events on border for dragging resizable frameless window. - if (!has_frame() && CanResize()) { + if (!has_frame() && resizable_) { auto* frame = static_cast(widget()->non_client_view()->frame_view()); return frame->ResizingBorderHitTest(location) == HTNOWHERE; diff --git a/shell/browser/native_window_views.h b/shell/browser/native_window_views.h index 2a55908ad3b2d..88b70dc98dad9 100644 --- a/shell/browser/native_window_views.h +++ b/shell/browser/native_window_views.h @@ -186,7 +186,6 @@ class NativeWindowViews : public NativeWindow, // views::WidgetDelegate: void DeleteDelegate() override; views::View* GetInitiallyFocusedView() override; - bool CanResize() const override; bool CanMaximize() const override; bool CanMinimize() const override; std::u16string GetWindowTitle() const override; diff --git a/shell/browser/net/asar/asar_url_loader.cc b/shell/browser/net/asar/asar_url_loader.cc index 78f8fd694e2cd..10746c09dbb34 100644 --- a/shell/browser/net/asar/asar_url_loader.cc +++ b/shell/browser/net/asar/asar_url_loader.cc @@ -76,7 +76,7 @@ class AsarURLLoader : public network::mojom::URLLoader { const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const base::Optional& new_url) override {} + const absl::optional& new_url) override {} void SetPriority(net::RequestPriority priority, int32_t intra_priority_value) override {} void PauseReadingBodyFromNet() override {} diff --git a/shell/browser/net/cert_verifier_client.cc b/shell/browser/net/cert_verifier_client.cc index cb1bb2f617a1a..4c7e2e75be14b 100644 --- a/shell/browser/net/cert_verifier_client.cc +++ b/shell/browser/net/cert_verifier_client.cc @@ -25,7 +25,7 @@ void CertVerifierClient::Verify( const scoped_refptr& certificate, const std::string& hostname, int flags, - const base::Optional& ocsp_response, + const absl::optional& ocsp_response, VerifyCallback callback) { VerifyRequestParams params; params.hostname = hostname; diff --git a/shell/browser/net/cert_verifier_client.h b/shell/browser/net/cert_verifier_client.h index 42e6f651ee39e..db5e3a2edd44d 100644 --- a/shell/browser/net/cert_verifier_client.h +++ b/shell/browser/net/cert_verifier_client.h @@ -39,7 +39,7 @@ class CertVerifierClient : public network::mojom::CertVerifierClient { const scoped_refptr& certificate, const std::string& hostname, int flags, - const base::Optional& ocsp_response, + const absl::optional& ocsp_response, VerifyCallback callback) override; private: diff --git a/shell/browser/net/network_context_service.cc b/shell/browser/net/network_context_service.cc index aeaab36f1f5d9..12aea0f14ce81 100644 --- a/shell/browser/net/network_context_service.cc +++ b/shell/browser/net/network_context_service.cc @@ -45,7 +45,7 @@ void NetworkContextService::ConfigureNetworkContextParams( network_context_params->user_agent = browser_context_->GetUserAgent(); network_context_params->cors_origin_access_list = - content::BrowserContext::GetSharedCorsOriginAccessList(browser_context_) + browser_context_->GetSharedCorsOriginAccessList() ->GetOriginAccessList() .CreateCorsOriginAccessPatternsList(); diff --git a/shell/browser/net/node_stream_loader.h b/shell/browser/net/node_stream_loader.h index 03fec18aa2543..d193f085d0fd1 100644 --- a/shell/browser/net/node_stream_loader.h +++ b/shell/browser/net/node_stream_loader.h @@ -54,7 +54,7 @@ class NodeStreamLoader : public network::mojom::URLLoader { const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const base::Optional& new_url) override {} + const absl::optional& new_url) override {} void SetPriority(net::RequestPriority priority, int32_t intra_priority_value) override {} void PauseReadingBodyFromNet() override {} diff --git a/shell/browser/net/proxying_url_loader_factory.cc b/shell/browser/net/proxying_url_loader_factory.cc index e8897d22e44a6..7b63dc6ec235f 100644 --- a/shell/browser/net/proxying_url_loader_factory.cc +++ b/shell/browser/net/proxying_url_loader_factory.cc @@ -87,11 +87,11 @@ ProxyingURLLoaderFactory::InProgressRequest::~InProgressRequest() { } if (on_before_send_headers_callback_) { std::move(on_before_send_headers_callback_) - .Run(net::ERR_ABORTED, base::nullopt); + .Run(net::ERR_ABORTED, absl::nullopt); } if (on_headers_received_callback_) { std::move(on_headers_received_callback_) - .Run(net::ERR_ABORTED, base::nullopt, base::nullopt); + .Run(net::ERR_ABORTED, absl::nullopt, absl::nullopt); } } @@ -177,7 +177,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::FollowRedirect( const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const base::Optional& new_url) { + const absl::optional& new_url) { if (new_url) request_.url = new_url.value(); @@ -330,7 +330,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::OnBeforeSendHeaders( const net::HttpRequestHeaders& headers, OnBeforeSendHeadersCallback callback) { if (!current_request_uses_header_client_) { - std::move(callback).Run(net::OK, base::nullopt); + std::move(callback).Run(net::OK, absl::nullopt); return; } @@ -344,7 +344,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::OnHeadersReceived( const net::IPEndPoint& remote_endpoint, OnHeadersReceivedCallback callback) { if (!current_request_uses_header_client_) { - std::move(callback).Run(net::OK, base::nullopt, GURL()); + std::move(callback).Run(net::OK, absl::nullopt, GURL()); if (for_cors_preflight_) { // CORS preflight is supported only when "extraHeaders" is specified. @@ -536,7 +536,7 @@ void ProxyingURLLoaderFactory::InProgressRequest:: } DCHECK(on_headers_received_callback_); - base::Optional headers; + absl::optional headers; if (override_headers_) { headers = override_headers_->raw_headers(); if (current_request_uses_header_client_) { @@ -753,7 +753,7 @@ ProxyingURLLoaderFactory::ProxyingURLLoaderFactory( int view_routing_id, uint64_t* request_id_generator, std::unique_ptr navigation_ui_data, - base::Optional navigation_id, + absl::optional navigation_id, network::mojom::URLLoaderFactoryRequest loader_request, mojo::PendingRemote target_factory_remote, mojo::PendingReceiver diff --git a/shell/browser/net/proxying_url_loader_factory.h b/shell/browser/net/proxying_url_loader_factory.h index 0dce6ea553ec0..f2cf05a0f86f5 100644 --- a/shell/browser/net/proxying_url_loader_factory.h +++ b/shell/browser/net/proxying_url_loader_factory.h @@ -11,7 +11,6 @@ #include #include -#include "base/optional.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_frame_host.h" #include "extensions/browser/api/web_request/web_request_info.h" @@ -26,6 +25,7 @@ #include "shell/browser/api/electron_api_web_request.h" #include "shell/browser/net/electron_url_loader_factory.h" #include "shell/browser/net/web_request_api_interface.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace electron { @@ -69,7 +69,7 @@ class ProxyingURLLoaderFactory const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const base::Optional& new_url) override; + const absl::optional& new_url) override; void SetPriority(net::RequestPriority priority, int32_t intra_priority_value) override; void PauseReadingBodyFromNet() override; @@ -121,7 +121,7 @@ class ProxyingURLLoaderFactory ProxyingURLLoaderFactory* factory_; network::ResourceRequest request_; - const base::Optional original_initiator_; + const absl::optional original_initiator_; const uint64_t request_id_ = 0; const int32_t view_routing_id_ = MSG_ROUTING_NONE; const int32_t frame_routing_id_ = MSG_ROUTING_NONE; @@ -131,7 +131,7 @@ class ProxyingURLLoaderFactory mojo::Receiver proxied_loader_receiver_; mojo::Remote target_client_; - base::Optional info_; + absl::optional info_; network::mojom::URLResponseHeadPtr current_response_; scoped_refptr override_headers_; @@ -166,7 +166,7 @@ class ProxyingURLLoaderFactory std::vector removed_headers; net::HttpRequestHeaders modified_headers; net::HttpRequestHeaders modified_cors_exempt_headers; - base::Optional new_url; + absl::optional new_url; DISALLOW_COPY_AND_ASSIGN(FollowRedirectParams); }; @@ -185,7 +185,7 @@ class ProxyingURLLoaderFactory int view_routing_id, uint64_t* request_id_generator, std::unique_ptr navigation_ui_data, - base::Optional navigation_id, + absl::optional navigation_id, network::mojom::URLLoaderFactoryRequest loader_request, mojo::PendingRemote target_factory_remote, @@ -245,7 +245,7 @@ class ProxyingURLLoaderFactory const int view_routing_id_; uint64_t* request_id_generator_; // managed by ElectronBrowserClient std::unique_ptr navigation_ui_data_; - base::Optional navigation_id_; + absl::optional navigation_id_; mojo::ReceiverSet proxy_receivers_; mojo::Remote target_factory_; mojo::Receiver diff --git a/shell/browser/net/proxying_websocket.cc b/shell/browser/net/proxying_websocket.cc index 42357c0b08b79..d2fe4b6ee1ba9 100644 --- a/shell/browser/net/proxying_websocket.cc +++ b/shell/browser/net/proxying_websocket.cc @@ -44,17 +44,17 @@ ProxyingWebSocket::ProxyingWebSocket( /*is_download=*/false, /*is_async=*/true, /*is_service_worker_script=*/false, - /*navigation_id=*/base::nullopt, + /*navigation_id=*/absl::nullopt, /*ukm_source_id=*/ukm::kInvalidSourceIdObj)) {} ProxyingWebSocket::~ProxyingWebSocket() { if (on_before_send_headers_callback_) { std::move(on_before_send_headers_callback_) - .Run(net::ERR_ABORTED, base::nullopt); + .Run(net::ERR_ABORTED, absl::nullopt); } if (on_headers_received_callback_) { std::move(on_headers_received_callback_) - .Run(net::ERR_ABORTED, base::nullopt, GURL()); + .Run(net::ERR_ABORTED, absl::nullopt, GURL()); } } @@ -230,7 +230,7 @@ void ProxyingWebSocket::StartProxying( WebSocketFactory factory, const GURL& url, const GURL& site_for_cookies, - const base::Optional& user_agent, + const absl::optional& user_agent, mojo::PendingRemote handshake_client, bool has_extra_headers, @@ -359,11 +359,11 @@ void ProxyingWebSocket::OnHeadersReceivedComplete(int error_code) { } if (on_headers_received_callback_) { - base::Optional headers; + absl::optional headers; if (override_headers_) headers = override_headers_->raw_headers(); std::move(on_headers_received_callback_) - .Run(net::OK, headers, base::nullopt); + .Run(net::OK, headers, absl::nullopt); } if (override_headers_) { @@ -385,7 +385,7 @@ void ProxyingWebSocket::OnAuthRequiredComplete(AuthRequiredResponse rv) { switch (rv) { case AuthRequiredResponse::kNoAction: case AuthRequiredResponse::kCancelAuth: - std::move(auth_required_callback_).Run(base::nullopt); + std::move(auth_required_callback_).Run(absl::nullopt); break; case AuthRequiredResponse::kSetAuth: diff --git a/shell/browser/net/proxying_websocket.h b/shell/browser/net/proxying_websocket.h index 6caa8d33e06be..fe699dd2aeed5 100644 --- a/shell/browser/net/proxying_websocket.h +++ b/shell/browser/net/proxying_websocket.h @@ -10,7 +10,6 @@ #include #include -#include "base/optional.h" #include "content/public/browser/content_browser_client.h" #include "extensions/browser/api/web_request/web_request_info.h" #include "mojo/public/cpp/bindings/pending_receiver.h" @@ -20,6 +19,7 @@ #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/websocket.mojom.h" #include "shell/browser/net/web_request_api_interface.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "url/gurl.h" #include "url/origin.h" @@ -97,7 +97,7 @@ class ProxyingWebSocket : public network::mojom::WebSocketHandshakeClient, WebSocketFactory factory, const GURL& url, const GURL& site_for_cookies, - const base::Optional& user_agent, + const absl::optional& user_agent, mojo::PendingRemote handshake_client, bool has_extra_headers, diff --git a/shell/browser/net/resolve_proxy_helper.cc b/shell/browser/net/resolve_proxy_helper.cc index ae0195e3e4807..f74c856c5683d 100644 --- a/shell/browser/net/resolve_proxy_helper.cc +++ b/shell/browser/net/resolve_proxy_helper.cc @@ -52,7 +52,7 @@ void ResolveProxyHelper::StartPendingRequest() { receiver_.BindNewPipeAndPassRemote(); receiver_.set_disconnect_handler( base::BindOnce(&ResolveProxyHelper::OnProxyLookupComplete, - base::Unretained(this), net::ERR_ABORTED, base::nullopt)); + base::Unretained(this), net::ERR_ABORTED, absl::nullopt)); browser_context_->GetDefaultStoragePartition() ->GetNetworkContext() ->LookUpProxyForURL(pending_requests_.front().url, @@ -62,7 +62,7 @@ void ResolveProxyHelper::StartPendingRequest() { void ResolveProxyHelper::OnProxyLookupComplete( int32_t net_error, - const base::Optional& proxy_info) { + const absl::optional& proxy_info) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!pending_requests_.empty()); diff --git a/shell/browser/net/resolve_proxy_helper.h b/shell/browser/net/resolve_proxy_helper.h index be330bf2f12a5..ee14fde311472 100644 --- a/shell/browser/net/resolve_proxy_helper.h +++ b/shell/browser/net/resolve_proxy_helper.h @@ -9,9 +9,9 @@ #include #include "base/memory/ref_counted.h" -#include "base/optional.h" #include "mojo/public/cpp/bindings/receiver.h" #include "services/network/public/mojom/proxy_lookup_client.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "url/gurl.h" namespace electron { @@ -55,7 +55,7 @@ class ResolveProxyHelper // network::mojom::ProxyLookupClient implementation. void OnProxyLookupComplete( int32_t net_error, - const base::Optional& proxy_info) override; + const absl::optional& proxy_info) override; // Self-reference. Owned as long as there's an outstanding proxy lookup. scoped_refptr owned_self_; diff --git a/shell/browser/net/system_network_context_manager.h b/shell/browser/net/system_network_context_manager.h index 099045fe8b6ac..18ed57b5f0777 100644 --- a/shell/browser/net/system_network_context_manager.h +++ b/shell/browser/net/system_network_context_manager.h @@ -11,18 +11,14 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/optional.h" #include "chrome/browser/net/proxy_config_monitor.h" #include "mojo/public/cpp/bindings/remote.h" +#include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/network_service.mojom.h" - -namespace network { -namespace mojom { -class URLLoaderFactory; -} -class SharedURLLoaderFactory; -} // namespace network +#include "services/network/public/mojom/url_loader.mojom.h" +#include "services/network/public/mojom/url_loader_factory.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace net_log { class NetExportFileWriter; diff --git a/shell/browser/net/url_pipe_loader.h b/shell/browser/net/url_pipe_loader.h index 1b24325487ffa..14ebcd643e0f5 100644 --- a/shell/browser/net/url_pipe_loader.h +++ b/shell/browser/net/url_pipe_loader.h @@ -62,7 +62,7 @@ class URLPipeLoader : public network::mojom::URLLoader, const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const base::Optional& new_url) override {} + const absl::optional& new_url) override {} void SetPriority(net::RequestPriority priority, int32_t intra_priority_value) override {} void PauseReadingBodyFromNet() override {} diff --git a/shell/browser/osr/osr_render_widget_host_view.cc b/shell/browser/osr/osr_render_widget_host_view.cc index 6716d3863d407..679d878cfb125 100644 --- a/shell/browser/osr/osr_render_widget_host_view.cc +++ b/shell/browser/osr/osr_render_widget_host_view.cc @@ -12,7 +12,6 @@ #include "base/callback_helpers.h" #include "base/location.h" #include "base/memory/ptr_util.h" -#include "base/optional.h" #include "base/single_thread_task_runner.h" #include "base/task/post_task.h" #include "base/time/time.h" @@ -32,6 +31,7 @@ #include "content/public/browser/render_process_host.h" #include "gpu/command_buffer/client/gl_helper.h" #include "media/base/video_frame.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/common/input/web_input_event.h" #include "third_party/skia/include/core/SkCanvas.h" #include "ui/compositor/compositor.h" @@ -195,7 +195,7 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView( {display::Display(display::kDefaultDisplayId)}, display::kDefaultDisplayId, display::kDefaultDisplayId); } - display::Display current_display = *display_list_.GetCurrentDisplayIterator(); + display::Display current_display = display_list_.GetCurrentDisplay(); current_display.set_device_scale_factor(kDefaultScaleFactor); display_list_.UpdateDisplay(current_display); @@ -353,7 +353,7 @@ void OffScreenRenderWidgetHostView::SetBackgroundColor(SkColor color) { } } -base::Optional OffScreenRenderWidgetHostView::GetBackgroundColor() { +absl::optional OffScreenRenderWidgetHostView::GetBackgroundColor() { return background_color_; } @@ -498,9 +498,9 @@ gfx::Rect OffScreenRenderWidgetHostView::GetBoundsInRootWindow() { return gfx::Rect(size_); } -base::Optional +absl::optional OffScreenRenderWidgetHostView::GetDisplayFeature() { - return base::nullopt; + return absl::nullopt; } void OffScreenRenderWidgetHostView::SetDisplayFeatureForTesting( @@ -1001,7 +1001,7 @@ void OffScreenRenderWidgetHostView::ResizeRootLayer(bool force) { {display::Display(display::kDefaultDisplayId)}, display::kDefaultDisplayId, display::kDefaultDisplayId); } - display::Display current_display = *display_list_.GetCurrentDisplayIterator(); + display::Display current_display = display_list_.GetCurrentDisplay(); current_display.set_device_scale_factor(scaleFactor); display_list_.UpdateDisplay(current_display); diff --git a/shell/browser/osr/osr_render_widget_host_view.h b/shell/browser/osr/osr_render_widget_host_view.h index 49d24dfd9cc8d..6014d6296518e 100644 --- a/shell/browser/osr/osr_render_widget_host_view.h +++ b/shell/browser/osr/osr_render_widget_host_view.h @@ -88,7 +88,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, gfx::Size GetVisibleViewportSize() override; void SetInsets(const gfx::Insets&) override; void SetBackgroundColor(SkColor color) override; - base::Optional GetBackgroundColor() override; + absl::optional GetBackgroundColor() override; void UpdateBackgroundColor() override; blink::mojom::PointerLockResult LockMouse( bool request_unadjusted_movement) override; @@ -130,7 +130,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, void GetScreenInfo(blink::ScreenInfo* screen_info) override; void TransformPointToRootSurface(gfx::PointF* point) override; gfx::Rect GetBoundsInRootWindow(void) override; - base::Optional GetDisplayFeature() override; + absl::optional GetDisplayFeature() override; void SetDisplayFeatureForTesting( const content::DisplayFeature* display_feature) override; viz::SurfaceId GetCurrentSurfaceId() const override; diff --git a/shell/browser/osr/osr_video_consumer.cc b/shell/browser/osr/osr_video_consumer.cc index b87ef4a966205..5ddc883127239 100644 --- a/shell/browser/osr/osr_video_consumer.cc +++ b/shell/browser/osr/osr_video_consumer.cc @@ -111,7 +111,7 @@ void OffScreenVideoConsumer::OnFrameCaptured( new FramePinner{std::move(mapping), callbacks_remote.Unbind()}); bitmap.setImmutable(); - base::Optional update_rect = info->metadata.capture_update_rect; + absl::optional update_rect = info->metadata.capture_update_rect; if (!update_rect.has_value() || update_rect->IsEmpty()) { update_rect = content_rect; } diff --git a/shell/browser/plugins/plugin_utils.cc b/shell/browser/plugins/plugin_utils.cc index 206812717e79f..b3c7490e9d871 100644 --- a/shell/browser/plugins/plugin_utils.cc +++ b/shell/browser/plugins/plugin_utils.cc @@ -6,6 +6,7 @@ #include +#include "base/containers/contains.h" #include "base/values.h" #include "content/public/common/webplugininfo.h" #include "extensions/buildflags/buildflags.h" diff --git a/shell/browser/serial/serial_chooser_context.cc b/shell/browser/serial/serial_chooser_context.cc index 5497fb114bcd3..5887c06845d8d 100644 --- a/shell/browser/serial/serial_chooser_context.cc +++ b/shell/browser/serial/serial_chooser_context.cc @@ -7,6 +7,7 @@ #include #include "base/base64.h" +#include "base/containers/contains.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "content/public/browser/device_service.h" diff --git a/shell/browser/ui/accelerator_util.cc b/shell/browser/ui/accelerator_util.cc index 89f431f01f505..c9c5fb511e824 100644 --- a/shell/browser/ui/accelerator_util.cc +++ b/shell/browser/ui/accelerator_util.cc @@ -31,7 +31,7 @@ bool StringToAccelerator(const std::string& shortcut, // Now, parse it into an accelerator. int modifiers = ui::EF_NONE; ui::KeyboardCode key = ui::VKEY_UNKNOWN; - base::Optional shifted_char; + absl::optional shifted_char; for (const auto& token : tokens) { ui::KeyboardCode code = electron::KeyboardCodeFromStr(token, &shifted_char); if (shifted_char) diff --git a/shell/browser/ui/cocoa/window_buttons_view.h b/shell/browser/ui/cocoa/window_buttons_view.h index cc662bfc34508..0adb34ac1be36 100644 --- a/shell/browser/ui/cocoa/window_buttons_view.h +++ b/shell/browser/ui/cocoa/window_buttons_view.h @@ -8,7 +8,7 @@ #import #include "base/mac/scoped_nsobject.h" -#include "base/optional.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/gfx/geometry/point.h" // Custom Quit, Minimize and Full Screen button container for frameless @@ -22,8 +22,8 @@ base::scoped_nsobject tracking_area_; } -- (id)initWithMargin:(const base::Optional&)margin; -- (void)setMargin:(const base::Optional&)margin; +- (id)initWithMargin:(const absl::optional&)margin; +- (void)setMargin:(const absl::optional&)margin; - (void)setShowOnHover:(BOOL)yes; - (void)setNeedsDisplayForButtons; @end diff --git a/shell/browser/ui/cocoa/window_buttons_view.mm b/shell/browser/ui/cocoa/window_buttons_view.mm index f09054d615f06..5ed4a2d14c69d 100644 --- a/shell/browser/ui/cocoa/window_buttons_view.mm +++ b/shell/browser/ui/cocoa/window_buttons_view.mm @@ -23,7 +23,7 @@ @implementation WindowButtonsView -- (id)initWithMargin:(const base::Optional&)margin { +- (id)initWithMargin:(const absl::optional&)margin { self = [super initWithFrame:NSZeroRect]; [self setMargin:margin]; @@ -50,7 +50,7 @@ - (id)initWithMargin:(const base::Optional&)margin { return self; } -- (void)setMargin:(const base::Optional&)margin { +- (void)setMargin:(const absl::optional&)margin { margin_ = margin.value_or(gfx::Point(7, 3)); } diff --git a/shell/browser/ui/electron_menu_model.cc b/shell/browser/ui/electron_menu_model.cc index 7b91850160c0c..01e4f63ffd34e 100644 --- a/shell/browser/ui/electron_menu_model.cc +++ b/shell/browser/ui/electron_menu_model.cc @@ -98,7 +98,7 @@ void ElectronMenuModel::SetSharingItem(SharingItem item) { sharing_item_.emplace(std::move(item)); } -const base::Optional& +const absl::optional& ElectronMenuModel::GetSharingItem() const { return sharing_item_; } diff --git a/shell/browser/ui/electron_menu_model.h b/shell/browser/ui/electron_menu_model.h index bf8dbcb95fef2..9cec5ceccef43 100644 --- a/shell/browser/ui/electron_menu_model.h +++ b/shell/browser/ui/electron_menu_model.h @@ -13,7 +13,7 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/observer_list_types.h" -#include "base/optional.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/models/simple_menu_model.h" #include "url/gurl.h" @@ -28,9 +28,9 @@ class ElectronMenuModel : public ui::SimpleMenuModel { SharingItem(const SharingItem&) = delete; ~SharingItem(); - base::Optional> texts; - base::Optional> urls; - base::Optional> file_paths; + absl::optional> texts; + absl::optional> urls; + absl::optional> file_paths; }; #endif @@ -93,7 +93,7 @@ class ElectronMenuModel : public ui::SimpleMenuModel { bool GetSharingItemAt(int index, SharingItem* item) const; // Set/Get the SharingItem of this menu. void SetSharingItem(SharingItem item); - const base::Optional& GetSharingItem() const; + const absl::optional& GetSharingItem() const; #endif // ui::SimpleMenuModel: @@ -111,7 +111,7 @@ class ElectronMenuModel : public ui::SimpleMenuModel { Delegate* delegate_; // weak ref. #if defined(OS_MAC) - base::Optional sharing_item_; + absl::optional sharing_item_; #endif std::map toolTips_; // command id -> tooltip diff --git a/shell/browser/ui/file_dialog_gtk.cc b/shell/browser/ui/file_dialog_gtk.cc index beed2ba3c0aac..2456fcd7d1479 100644 --- a/shell/browser/ui/file_dialog_gtk.cc +++ b/shell/browser/ui/file_dialog_gtk.cc @@ -29,7 +29,7 @@ namespace file_dialog { static GModule* gtk_module; -static base::Optional supports_gtk_file_chooser_native; +static absl::optional supports_gtk_file_chooser_native; using dl_gtk_native_dialog_show_t = void (*)(void*); using dl_gtk_native_dialog_destroy_t = void (*)(void*); diff --git a/shell/browser/ui/tray_icon.h b/shell/browser/ui/tray_icon.h index 16f1ef05135d5..32463c2a35262 100644 --- a/shell/browser/ui/tray_icon.h +++ b/shell/browser/ui/tray_icon.h @@ -18,7 +18,7 @@ namespace electron { class TrayIcon { public: - static TrayIcon* Create(base::Optional guid); + static TrayIcon* Create(absl::optional guid); #if defined(OS_WIN) using ImageType = HICON; diff --git a/shell/browser/ui/tray_icon_cocoa.mm b/shell/browser/ui/tray_icon_cocoa.mm index 21e2cb346554b..93052daaf19c9 100644 --- a/shell/browser/ui/tray_icon_cocoa.mm +++ b/shell/browser/ui/tray_icon_cocoa.mm @@ -385,7 +385,7 @@ - (BOOL)performDragOperation:(id)sender { } // static -TrayIcon* TrayIcon::Create(base::Optional guid) { +TrayIcon* TrayIcon::Create(absl::optional guid) { return new TrayIconCocoa; } diff --git a/shell/browser/ui/tray_icon_gtk.cc b/shell/browser/ui/tray_icon_gtk.cc index a1205e27f78da..67dbe7c3c2384 100644 --- a/shell/browser/ui/tray_icon_gtk.cc +++ b/shell/browser/ui/tray_icon_gtk.cc @@ -66,7 +66,7 @@ bool TrayIconGtk::HasClickAction() { } // static -TrayIcon* TrayIcon::Create(base::Optional guid) { +TrayIcon* TrayIcon::Create(absl::optional guid) { return new TrayIconGtk; } diff --git a/shell/browser/ui/tray_icon_win.cc b/shell/browser/ui/tray_icon_win.cc index 8988d7cff2ca2..0f4e0059f897a 100644 --- a/shell/browser/ui/tray_icon_win.cc +++ b/shell/browser/ui/tray_icon_win.cc @@ -8,7 +8,7 @@ namespace electron { // static -TrayIcon* TrayIcon::Create(base::Optional guid) { +TrayIcon* TrayIcon::Create(absl::optional guid) { static NotifyIconHost host; return host.CreateNotifyIcon(guid); } diff --git a/shell/browser/ui/views/autofill_popup_view.cc b/shell/browser/ui/views/autofill_popup_view.cc index 99ba0d9f9962d..ef3799d0968ca 100644 --- a/shell/browser/ui/views/autofill_popup_view.cc +++ b/shell/browser/ui/views/autofill_popup_view.cc @@ -148,8 +148,8 @@ bool AutofillPopupView::CanStartDragForView(views::View*, } void AutofillPopupView::OnSelectedRowChanged( - base::Optional previous_row_selection, - base::Optional current_row_selection) { + absl::optional previous_row_selection, + absl::optional current_row_selection) { SchedulePaint(); if (current_row_selection) { @@ -442,7 +442,7 @@ void AutofillPopupView::AcceptSelection(const gfx::Point& point) { AcceptSelectedLine(); } -void AutofillPopupView::SetSelectedLine(base::Optional selected_line) { +void AutofillPopupView::SetSelectedLine(absl::optional selected_line) { if (!popup_) return; if (selected_line_ == selected_line) @@ -485,7 +485,7 @@ void AutofillPopupView::SelectPreviousLine() { } void AutofillPopupView::ClearSelection() { - SetSelectedLine(base::nullopt); + SetSelectedLine(absl::nullopt); } void AutofillPopupView::RemoveObserver() { diff --git a/shell/browser/ui/views/autofill_popup_view.h b/shell/browser/ui/views/autofill_popup_view.h index 1209bdd7a2aba..3afb70903e025 100644 --- a/shell/browser/ui/views/autofill_popup_view.h +++ b/shell/browser/ui/views/autofill_popup_view.h @@ -9,10 +9,10 @@ #include "shell/browser/ui/autofill_popup.h" -#include "base/optional.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/render_widget_host.h" #include "electron/buildflags/buildflags.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/accessibility/ax_node_data.h" #include "ui/views/drag_controller.h" #include "ui/views/focus/widget_focus_manager.h" @@ -80,8 +80,8 @@ class AutofillPopupView : public views::WidgetDelegateView, private: friend class AutofillPopup; - void OnSelectedRowChanged(base::Optional previous_row_selection, - base::Optional current_row_selection); + void OnSelectedRowChanged(absl::optional previous_row_selection, + absl::optional current_row_selection); // Draw the given autofill entry in |entry_rect|. void DrawAutofillEntry(gfx::Canvas* canvas, @@ -118,7 +118,7 @@ class AutofillPopupView : public views::WidgetDelegateView, void AcceptSuggestion(int index); bool AcceptSelectedLine(); void AcceptSelection(const gfx::Point& point); - void SetSelectedLine(base::Optional selected_line); + void SetSelectedLine(absl::optional selected_line); void SetSelection(const gfx::Point& point); void SelectNextLine(); void SelectPreviousLine(); @@ -137,7 +137,7 @@ class AutofillPopupView : public views::WidgetDelegateView, base::Time show_time_; // The index of the currently selected line - base::Optional selected_line_; + absl::optional selected_line_; #if BUILDFLAG(ENABLE_OSR) std::unique_ptr view_proxy_; diff --git a/shell/browser/ui/views/inspectable_web_contents_view_views.cc b/shell/browser/ui/views/inspectable_web_contents_view_views.cc index ba5702bb3af38..8fc428476f3ac 100644 --- a/shell/browser/ui/views/inspectable_web_contents_view_views.cc +++ b/shell/browser/ui/views/inspectable_web_contents_view_views.cc @@ -43,7 +43,6 @@ class DevToolsWindowDelegate : public views::ClientView, // views::WidgetDelegate: void DeleteDelegate() override { delete this; } views::View* GetInitiallyFocusedView() override { return view_; } - bool CanResize() const override { return true; } bool CanMaximize() const override { return true; } bool CanMinimize() const override { return true; } std::u16string GetWindowTitle() const override { return shell_->GetTitle(); } diff --git a/shell/browser/ui/webui/accessibility_ui.cc b/shell/browser/ui/webui/accessibility_ui.cc index 250e2ecd85a0b..ab5d881d9c1de 100644 --- a/shell/browser/ui/webui/accessibility_ui.cc +++ b/shell/browser/ui/webui/accessibility_ui.cc @@ -10,7 +10,6 @@ #include "base/callback_helpers.h" #include "base/command_line.h" #include "base/json/json_writer.h" -#include "base/optional.h" #include "base/strings/pattern.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -38,6 +37,7 @@ #include "net/base/escape.h" #include "shell/browser/native_window.h" #include "shell/browser/window_list.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/accessibility/platform/ax_platform_node.h" #include "ui/accessibility/platform/ax_platform_node_delegate.h" #include "ui/base/webui/web_ui_util.h" diff --git a/shell/browser/ui/win/notify_icon_host.cc b/shell/browser/ui/win/notify_icon_host.cc index 531bb0080ac94..bc6b7a2027799 100644 --- a/shell/browser/ui/win/notify_icon_host.cc +++ b/shell/browser/ui/win/notify_icon_host.cc @@ -87,7 +87,7 @@ NotifyIconHost::~NotifyIconHost() { delete ptr; } -NotifyIcon* NotifyIconHost::CreateNotifyIcon(base::Optional guid) { +NotifyIcon* NotifyIconHost::CreateNotifyIcon(absl::optional guid) { if (guid.has_value()) { for (NotifyIcons::const_iterator i(notify_icons_.begin()); i != notify_icons_.end(); ++i) { diff --git a/shell/browser/ui/win/notify_icon_host.h b/shell/browser/ui/win/notify_icon_host.h index f477f8344cabe..bbd40cf9b5486 100644 --- a/shell/browser/ui/win/notify_icon_host.h +++ b/shell/browser/ui/win/notify_icon_host.h @@ -10,8 +10,8 @@ #include #include "base/macros.h" -#include "base/optional.h" #include "shell/common/gin_converters/guid_converter.h" +#include "third_party/abseil-cpp/absl/types/optional.h" const GUID GUID_DEFAULT = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}; @@ -24,7 +24,7 @@ class NotifyIconHost { NotifyIconHost(); ~NotifyIconHost(); - NotifyIcon* CreateNotifyIcon(base::Optional guid); + NotifyIcon* CreateNotifyIcon(absl::optional guid); void Remove(NotifyIcon* notify_icon); private: diff --git a/shell/common/api/electron_api_clipboard.cc b/shell/common/api/electron_api_clipboard.cc index e67e846912e26..83ad6108c55cd 100644 --- a/shell/common/api/electron_api_clipboard.cc +++ b/shell/common/api/electron_api_clipboard.cc @@ -181,12 +181,12 @@ void Clipboard::WriteBookmark(const std::u16string& title, gfx::Image Clipboard::ReadImage(gin_helper::Arguments* args) { ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); - base::Optional image; + absl::optional image; clipboard->ReadImage( GetClipboardBuffer(args), /* data_dst = */ nullptr, base::BindOnce( - [](base::Optional* image, const SkBitmap& result) { + [](absl::optional* image, const SkBitmap& result) { image->emplace(gfx::Image::CreateFrom1xBitmap(result)); }, &image)); diff --git a/shell/common/api/electron_api_command_line.cc b/shell/common/api/electron_api_command_line.cc index fcabc8d53e591..0a944501365b8 100644 --- a/shell/common/api/electron_api_command_line.cc +++ b/shell/common/api/electron_api_command_line.cc @@ -6,6 +6,7 @@ #include "base/files/file_path.h" #include "base/strings/string_util.h" #include "services/network/public/cpp/network_switches.h" +#include "shell/common/gin_converters/base_converter.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/node_includes.h" @@ -41,18 +42,21 @@ void AppendSwitch(const std::string& switch_string, command_line->AppendSwitch(switch_string); } +void AppendArg(const std::string& arg) { + auto* command_line = base::CommandLine::ForCurrentProcess(); + + command_line->AppendArg(arg); +} + void Initialize(v8::Local exports, v8::Local unused, v8::Local context, void* priv) { - auto* command_line = base::CommandLine::ForCurrentProcess(); gin_helper::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("hasSwitch", &HasSwitch); dict.SetMethod("getSwitchValue", &GetSwitchValue); dict.SetMethod("appendSwitch", &AppendSwitch); - dict.SetMethod("appendArgument", - base::BindRepeating(&base::CommandLine::AppendArg, - base::Unretained(command_line))); + dict.SetMethod("appendArgument", &AppendArg); } } // namespace diff --git a/shell/common/api/electron_api_native_image.cc b/shell/common/api/electron_api_native_image.cc index 53dc5445048fd..eb2006ca33349 100644 --- a/shell/common/api/electron_api_native_image.cc +++ b/shell/common/api/electron_api_native_image.cc @@ -305,7 +305,7 @@ bool NativeImage::IsEmpty() { return image_.IsEmpty(); } -gfx::Size NativeImage::GetSize(const base::Optional scale_factor) { +gfx::Size NativeImage::GetSize(const absl::optional scale_factor) { float sf = scale_factor.value_or(1.0f); gfx::ImageSkiaRep image_rep = image_.AsImageSkia().GetRepresentation(sf); @@ -321,7 +321,7 @@ std::vector NativeImage::GetScaleFactors() { return scale_factors; } -float NativeImage::GetAspectRatio(const base::Optional scale_factor) { +float NativeImage::GetAspectRatio(const absl::optional scale_factor) { float sf = scale_factor.value_or(1.0f); gfx::Size size = GetSize(sf); if (size.IsEmpty()) diff --git a/shell/common/api/electron_api_native_image.h b/shell/common/api/electron_api_native_image.h index d98763c946125..76b13842036f8 100644 --- a/shell/common/api/electron_api_native_image.h +++ b/shell/common/api/electron_api_native_image.h @@ -114,8 +114,8 @@ class NativeImage : public gin::Wrappable { gin::Handle Crop(v8::Isolate* isolate, const gfx::Rect& rect); std::string ToDataURL(gin::Arguments* args); bool IsEmpty(); - gfx::Size GetSize(const base::Optional scale_factor); - float GetAspectRatio(const base::Optional scale_factor); + gfx::Size GetSize(const absl::optional scale_factor); + float GetAspectRatio(const absl::optional scale_factor); void AddRepresentation(const gin_helper::Dictionary& options); void AdjustAmountOfExternalAllocatedMemory(bool add); diff --git a/shell/common/asar/archive.cc b/shell/common/asar/archive.cc index 739931a28222d..92e71afdeeb90 100644 --- a/shell/common/asar/archive.cc +++ b/shell/common/asar/archive.cc @@ -191,7 +191,7 @@ bool Archive::Init() { return false; } - base::Optional value = base::JSONReader::Read(header); + absl::optional value = base::JSONReader::Read(header); if (!value || !value->is_dict()) { LOG(ERROR) << "Failed to parse header"; return false; diff --git a/shell/common/gin_converters/blink_converter.cc b/shell/common/gin_converters/blink_converter.cc index 94ce709b3e70e..8f7a25c0596f0 100644 --- a/shell/common/gin_converters/blink_converter.cc +++ b/shell/common/gin_converters/blink_converter.cc @@ -187,7 +187,7 @@ bool Converter::FromV8(v8::Isolate* isolate, if (!dict.Get("keyCode", &str)) return false; - base::Optional shifted_char; + absl::optional shifted_char; ui::KeyboardCode keyCode = electron::KeyboardCodeFromStr(str, &shifted_char); out->windows_key_code = keyCode; if (shifted_char) diff --git a/shell/common/gin_helper/dictionary.h b/shell/common/gin_helper/dictionary.h index 4ca241f3b91a8..c5c3acc735157 100644 --- a/shell/common/gin_helper/dictionary.h +++ b/shell/common/gin_helper/dictionary.h @@ -8,10 +8,10 @@ #include #include -#include "base/optional.h" #include "gin/dictionary.h" #include "shell/common/gin_converters/std_converter.h" #include "shell/common/gin_helper/function_template.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace gin_helper { @@ -61,9 +61,9 @@ class Dictionary : public gin::Dictionary { return !result.IsNothing() && result.FromJust(); } - // Like normal Get but put result in an base::Optional. + // Like normal Get but put result in an absl::optional. template - bool GetOptional(base::StringPiece key, base::Optional* out) const { + bool GetOptional(base::StringPiece key, absl::optional* out) const { T ret; if (Get(key, &ret)) { out->emplace(std::move(ret)); diff --git a/shell/common/gin_helper/function_template.h b/shell/common/gin_helper/function_template.h index 69b6ce3dfceb3..c9d457c372016 100644 --- a/shell/common/gin_helper/function_template.h +++ b/shell/common/gin_helper/function_template.h @@ -9,12 +9,12 @@ #include "base/bind.h" #include "base/callback.h" -#include "base/optional.h" #include "gin/arguments.h" #include "shell/common/gin_helper/arguments.h" #include "shell/common/gin_helper/destroyable.h" #include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/microtasks_scope.h" +#include "third_party/abseil-cpp/absl/types/optional.h" // This file is forked from gin/function_template.h with 2 differences: // 1. Support for additional types of arguments. @@ -95,13 +95,13 @@ bool GetNextArgument(gin::Arguments* args, } } -// Support base::Optional as output, which would be empty and do not throw error +// Support absl::optional as output, which would be empty and do not throw error // when conversion to T fails. template bool GetNextArgument(gin::Arguments* args, int create_flags, bool is_first, - base::Optional* result) { + absl::optional* result) { T converted; // Use gin::Arguments::GetNext which always advances |next| counter. if (args->GetNext(&converted)) diff --git a/shell/common/gin_helper/function_template_extensions.h b/shell/common/gin_helper/function_template_extensions.h index e4b118e4fd4c3..a83ad1c7eb804 100644 --- a/shell/common/gin_helper/function_template_extensions.h +++ b/shell/common/gin_helper/function_template_extensions.h @@ -16,12 +16,12 @@ // in the gin_helper namespace. namespace gin { -// Support base::Optional as an argument. +// Support absl::optional as an argument. template bool GetNextArgument(Arguments* args, const InvokerOptions& invoker_options, bool is_first, - base::Optional* result) { + absl::optional* result) { T converted; // Use gin::Arguments::GetNext which always advances |next| counter. if (args->GetNext(&converted)) diff --git a/shell/common/keyboard_util.cc b/shell/common/keyboard_util.cc index 597a10f040810..1bc2d665c6c49 100644 --- a/shell/common/keyboard_util.cc +++ b/shell/common/keyboard_util.cc @@ -17,7 +17,7 @@ namespace { // Return key code represented by |str|. ui::KeyboardCode KeyboardCodeFromKeyIdentifier( const std::string& s, - base::Optional* shifted_char) { + absl::optional* shifted_char) { std::string str = base::ToLowerASCII(s); if (str == "ctrl" || str == "control") { return ui::VKEY_CONTROL; @@ -321,7 +321,7 @@ ui::KeyboardCode KeyboardCodeFromCharCode(char16_t c, bool* shifted) { } ui::KeyboardCode KeyboardCodeFromStr(const std::string& str, - base::Optional* shifted_char) { + absl::optional* shifted_char) { if (str.size() == 1) { bool shifted = false; auto ret = KeyboardCodeFromCharCode(str[0], &shifted); diff --git a/shell/common/keyboard_util.h b/shell/common/keyboard_util.h index 29b740152e808..9469661841ae9 100644 --- a/shell/common/keyboard_util.h +++ b/shell/common/keyboard_util.h @@ -7,7 +7,7 @@ #include -#include "base/optional.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/events/keycodes/keyboard_codes.h" namespace electron { @@ -20,7 +20,7 @@ ui::KeyboardCode KeyboardCodeFromCharCode(char16_t c, bool* shifted); // for example + and /, set it in |shifted_char|. // pressed. ui::KeyboardCode KeyboardCodeFromStr(const std::string& str, - base::Optional* shifted_char); + absl::optional* shifted_char); } // namespace electron diff --git a/shell/renderer/api/electron_api_context_bridge.cc b/shell/renderer/api/electron_api_context_bridge.cc index 4cc4f0705e5a4..3de2e445e45b5 100644 --- a/shell/renderer/api/electron_api_context_bridge.cc +++ b/shell/renderer/api/electron_api_context_bridge.cc @@ -573,8 +573,8 @@ void ExposeAPIInMainWorld(v8::Isolate* isolate, return; } - v8::Local isolated_context = - frame->WorldScriptContext(args->isolate(), WorldIDs::ISOLATED_WORLD_ID); + v8::Local isolated_context = frame->GetScriptContextFromWorldId( + args->isolate(), WorldIDs::ISOLATED_WORLD_ID); { context_bridge::ObjectCache object_cache; diff --git a/shell/renderer/api/electron_api_ipc_renderer.cc b/shell/renderer/api/electron_api_ipc_renderer.cc index 34b899747318e..d080769254a3b 100644 --- a/shell/renderer/api/electron_api_ipc_renderer.cc +++ b/shell/renderer/api/electron_api_ipc_renderer.cc @@ -133,7 +133,7 @@ class IPCRenderer : public gin::Wrappable, gin_helper::ErrorThrower thrower, const std::string& channel, v8::Local message_value, - base::Optional> transfer) { + absl::optional> transfer) { if (!electron_browser_remote_) { thrower.ThrowError(kIPCMethodCalledAfterContextReleasedError); return; @@ -155,7 +155,7 @@ class IPCRenderer : public gin::Wrappable, std::vector ports; for (auto& transferable : transferables) { - base::Optional port = + absl::optional port = blink::WebMessagePortConverter:: DisentangleAndExtractMessagePortChannel(isolate, transferable); if (!port.has_value()) { diff --git a/shell/renderer/renderer_client_base.cc b/shell/renderer/renderer_client_base.cc index 8168b9e6d060d..eab9f352035e9 100644 --- a/shell/renderer/renderer_client_base.cc +++ b/shell/renderer/renderer_client_base.cc @@ -471,7 +471,8 @@ v8::Local RendererClientBase::GetContext( auto* render_frame = content::RenderFrame::FromWebFrame(frame); DCHECK(render_frame); if (render_frame && render_frame->GetBlinkPreferences().context_isolation) - return frame->WorldScriptContext(isolate, WorldIDs::ISOLATED_WORLD_ID); + return frame->GetScriptContextFromWorldId(isolate, + WorldIDs::ISOLATED_WORLD_ID); else return frame->MainWorldScriptContext(); } diff --git a/spec-main/api-browser-window-spec.ts b/spec-main/api-browser-window-spec.ts index a96c489180133..4eb8ba6d42c63 100644 --- a/spec-main/api-browser-window-spec.ts +++ b/spec-main/api-browser-window-spec.ts @@ -772,8 +772,10 @@ describe('BrowserWindow module', () => { expect(otherWindow.isFocused()).to.equal(true); const wFocused = emittedOnce(w, 'focus'); + const otherWindowBlurred = emittedOnce(otherWindow, 'blur'); w.focus(); await wFocused; + await otherWindowBlurred; expect(w.isFocused()).to.equal(true); otherWindow.moveTop(); diff --git a/spec-main/api-web-contents-spec.ts b/spec-main/api-web-contents-spec.ts index 31cb8769d5021..c52f831404853 100644 --- a/spec-main/api-web-contents-spec.ts +++ b/spec-main/api-web-contents-spec.ts @@ -521,12 +521,13 @@ describe('webContents module', () => { w.show(); await focused; expect(w.isFocused()).to.be.true(); + const blurred = emittedOnce(w, 'blur'); w.webContents.openDevTools({ mode: 'detach', activate: true }); await Promise.all([ emittedOnce(w.webContents, 'devtools-opened'), emittedOnce(w.webContents, 'devtools-focused') ]); - await delay(); + await blurred; expect(w.isFocused()).to.be.false(); });