Skip to content

Commit

Permalink
update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed May 16, 2024
1 parent dfbcf8d commit 6f6fff5
Show file tree
Hide file tree
Showing 17 changed files with 176 additions and 156 deletions.
2 changes: 1 addition & 1 deletion patches/chromium/blink_local_frame.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 0a742bbbd5e8e1eb3610cc32f785f779e8907e75..26967019244d409dadf4533405d4d5d27c75b73c 100644
index 0e21d9c3194198e7540c7b3a84e8aed691821cbb..c0f5d92f8613ca380295cca7f55456d6fbcd6d1f 100644
--- a/third_party/blink/renderer/core/frame/frame.cc
+++ b/third_party/blink/renderer/core/frame/frame.cc
@@ -125,14 +125,6 @@ bool Frame::Detach(FrameDetachType type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ index c13bf8667c6996ec8ad4a3149993b266cea446bf..da2704e283bbaad9110ca57fb5bef786
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 3d63a3ec448750356e5dbd500e89c6a515d2bc0a..a1132b35b7fd015eacd7e3bef17a89361acd94f8 100644
index c9ff70a8f2f718de759c1c5c6d6b598ecd62a695..422d2127bf7c73ba3fda37e1268c09934e2e6773 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4919,7 +4919,7 @@ static_library("browser") {
@@ -4921,7 +4921,7 @@ static_library("browser") {

# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
Expand All @@ -46,10 +46,10 @@ index 3d63a3ec448750356e5dbd500e89c6a515d2bc0a..a1132b35b7fd015eacd7e3bef17a8936
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 39afd0c6f9f94c48e15c024079f34933f8461ca0..869e7d7c5fff8b80952a14bab1ce38b99ce4a9b8 100644
index 415c81d75610d326fb51f38a5fda9de33f99f72e..6526efc533498e51a28947a2c59dfffac4e92191 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -7308,9 +7308,12 @@ test("unit_tests") {
@@ -7318,9 +7318,12 @@ test("unit_tests") {
"//chrome/browser/safe_browsing/incident_reporting/verifier_test:verifier_test_dll_2",
]

Expand All @@ -63,7 +63,7 @@ index 39afd0c6f9f94c48e15c024079f34933f8461ca0..869e7d7c5fff8b80952a14bab1ce38b9
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -8308,6 +8311,10 @@ test("unit_tests") {
@@ -8319,6 +8322,10 @@ test("unit_tests") {
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
]

Expand All @@ -74,7 +74,7 @@ index 39afd0c6f9f94c48e15c024079f34933f8461ca0..869e7d7c5fff8b80952a14bab1ce38b9
sources += [
# The importer code is not used on Android.
"../common/importer/firefox_importer_utils_unittest.cc",
@@ -8384,7 +8391,6 @@ test("unit_tests") {
@@ -8395,7 +8402,6 @@ test("unit_tests") {
}

deps += [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ index 28cd699814f32a7a569d63936b9544567a66d9c4..fd461fa448d983481dc4c0c7d03b1945
}

diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 01a2f84595514eea61b3328ae911c9300f85d31a..08b27a2a1e0af9ca1f1bb562de548e524310ffdf 100644
index a1d50c2e470564578413c79b90d4f0493bd77e4f..3cd7799304c4e47e539973376d979e3b10ca968c 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1971,12 +1971,11 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -1978,12 +1978,11 @@ bool Browser::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
Expand All @@ -99,10 +99,10 @@ index 01a2f84595514eea61b3328ae911c9300f85d31a..08b27a2a1e0af9ca1f1bb562de548e52

WebContents* Browser::CreateCustomWebContents(
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 4b2647bd47862f0dc75bc72f0b09dc5ad70d04a8..c23e2b182c18038711959c6ddf0ac137859f95f9 100644
index af562dfe079090a2f9cbcdfa4bbd9ee7a3bb38f0..171dd773a6ba004eda9392efbd4eecd8bae90efb 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -960,8 +960,7 @@ class Browser : public TabStripModelObserver,
@@ -961,8 +961,7 @@ class Browser : public TabStripModelObserver,
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.

diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index 3ee750502ed8b58fc04e6fa89fe3916341f7362e..a8c99a1afe2ea100a6dd98797e7505bf9070c8e0 100644
index 98de040583e1148fbadd6e666006164156515bb9..5fe52240c556c9eb3163330f1d22585a5fdff5be 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -40,6 +40,7 @@
Expand Down Expand Up @@ -102,10 +102,10 @@ index 2b0919b9a56bd37a398109777dfd199d777a9f74..823f44ab0303ccd6c7502ec65560ddb5
friend class ContentClientCreator;
friend class ContentClientInitializer;
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index ef90742c78529a883a12c582c5950a7511cf5de0..900d45483b9df3d45633497daf82fbebbb764c68 100644
index ee73fad76593c8af5c8cef2ec1da56a77933e113..eb94184ab6cad33075093028581c2122d5e467d4 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -592,8 +592,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
@@ -584,8 +584,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,

#if defined(V8_USE_EXTERNAL_STARTUP_DATA)

Expand All @@ -115,7 +115,7 @@ index ef90742c78529a883a12c582c5950a7511cf5de0..900d45483b9df3d45633497daf82fbeb
if (g_mapped_snapshot) {
// TODO(crbug.com/40558459): Confirm not loading different type of snapshot
// files in a process.
@@ -602,10 +601,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
@@ -594,10 +593,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {

base::MemoryMappedFile::Region file_region;
base::File file =
Expand Down
18 changes: 8 additions & 10 deletions patches/chromium/feat_allow_code_cache_in_custom_schemes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ index 8fc176cfd3a0411521c0f5e4f60b70ca333f60c8..e43f09d80bc9472a027bb11325803aab
- DCHECK(resource_url.SchemeIsHTTPOrHTTPS() ||
- resource_url_is_chrome_or_chrome_untrusted ||
- blink::CommonSchemeRegistry::IsExtensionScheme(resource_url.scheme()));
-
- // |origin_lock| should be either empty or should have
- // Http/Https/chrome/chrome-untrusted schemes and it should not be a URL with
- // opaque origin. Empty origin_locks are allowed when the renderer is not
- // locked to an origin.
- bool origin_lock_is_chrome_or_chrome_untrusted =
+
+ const bool resource_url_embedder =
+ base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme());
+ DCHECK(resource_url_http || resource_url_webui || resource_url_embedder);
Expand All @@ -81,16 +80,15 @@ index 8fc176cfd3a0411521c0f5e4f60b70ca333f60c8..e43f09d80bc9472a027bb11325803aab
- origin_lock_is_chrome_or_chrome_untrusted ||
- blink::CommonSchemeRegistry::IsExtensionScheme(origin_lock.scheme())) &&
- !url::Origin::Create(origin_lock).opaque()));
-
+ const bool origin_lock_for_embedder =
+ base::Contains(url::GetCodeCacheSchemes(), origin_lock.scheme());

- // The chrome and chrome-untrusted schemes are only used with the WebUI
- // code cache type.
- DCHECK_EQ(origin_lock_is_chrome_or_chrome_untrusted,
- cache_type == GeneratedCodeCache::kWebUIJavaScript);
- DCHECK_EQ(resource_url_is_chrome_or_chrome_untrusted,
- cache_type == GeneratedCodeCache::kWebUIJavaScript);
+ const bool origin_lock_for_embedder =
+ base::Contains(url::GetCodeCacheSchemes(), origin_lock.scheme());
+
+ DCHECK(origin_lock_empty || ((origin_lock_for_http || origin_lock_for_webui ||
+ origin_lock_for_embedder) &&
+ !url::Origin::Create(origin_lock).opaque()));
Expand Down Expand Up @@ -407,11 +405,11 @@ index 9dc2d5a33858da7c31fd87bbbabe3899301fa52d..ebf0bb23b9aedb7bf9eb8af52b4756db
std::vector<std::string> extension_schemes;
// Registers a URL scheme with a predefined default custom handler.
diff --git a/url/url_util.cc b/url/url_util.cc
index fd6de92945bf1a98700fdf5fc83872180b628b62..f98ed81866daf40943d83fdab4c0d95d617885b8 100644
index 3191f87472acd7b2356f59b132803befa2561cdf..638ce775ecfbef3a3bb20a5224711f37903266a4 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -116,6 +116,9 @@ struct SchemeRegistry {
kAboutScheme,
@@ -123,6 +123,9 @@ struct SchemeRegistry {
kAndroidScheme,
};

+ // Embedder schemes that have V8 code cache enabled in js and wasm scripts.
Expand All @@ -420,7 +418,7 @@ index fd6de92945bf1a98700fdf5fc83872180b628b62..f98ed81866daf40943d83fdab4c0d95d
// Schemes with a predefined default custom handler.
std::vector<SchemeWithHandler> predefined_handler_schemes;

@@ -683,6 +686,15 @@ const std::vector<std::string>& GetEmptyDocumentSchemes() {
@@ -704,6 +707,15 @@ const std::vector<std::string>& GetEmptyDocumentSchemes() {
return GetSchemeRegistry().empty_document_schemes;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ index ceced82cbd23b2dcd7fabf7d63028423f86e05c3..27d0b61a7b67d1c9d7e0699e287b7833

PictureInPictureOcclusionTracker*
diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
index 28d3689be10469fa9f6bd8e608717c4d13a92620..9497277742369bfc53d14462ab354c31799b967e 100644
index ecabd4e26fa4eca960cdd890d6b174d1505471a7..9224005d825ce4095c47c367b45a5de1569e2aca 100644
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
@@ -343,11 +343,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
@@ -344,11 +344,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
input_scope);
#endif // BUILDFLAG(IS_WIN)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ index fa65331f40b90d812b71a489fd560e9359152d2b..390714d631dc88ef92d59ef9618a5706
const mojom::blink::UserActivationOption user_activation_option_;
const mojom::blink::LoadEventBlockingOption blocking_option_;
diff --git a/third_party/blink/renderer/core/frame/web_frame_test.cc b/third_party/blink/renderer/core/frame/web_frame_test.cc
index 161ed4eebbe8a70f454b090e91b820fb0e735a90..362362f463ea5868a7fc4a300cca800cfe8d1e5a 100644
index 0fc6dddb724333c6f948b724c1d5fd68f0c3b8d6..12fc1ff9c6bd5809b1197886e1a2bf7eda64ec36 100644
--- a/third_party/blink/renderer/core/frame/web_frame_test.cc
+++ b/third_party/blink/renderer/core/frame/web_frame_test.cc
@@ -289,6 +289,7 @@ void ExecuteScriptsInMainWorld(
Expand All @@ -216,10 +216,10 @@ index 161ed4eebbe8a70f454b090e91b820fb0e735a90..362362f463ea5868a7fc4a300cca800c
mojom::blink::WantResultOption::kWantResult, wait_for_promise);
}
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 236e713bf25da95c67f18b2c7102ed14dd3b0abe..26d9c24d30c903f842b2f63d7f88d1b579e20f97 100644
index 2af87b7d7dcebf7a682cd55a771e152c9390f0ef..c5e01a6e09e2b3d9bafa3df2e7359e64a27917fe 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
@@ -1095,14 +1095,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
@@ -1089,14 +1089,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
mojom::blink::EvaluationTiming evaluation_timing,
mojom::blink::LoadEventBlockingOption blocking_option,
WebScriptExecutionCallback callback,
Expand Down
6 changes: 3 additions & 3 deletions patches/chromium/gin_enable_disable_v8_platform.patch
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ index c19eb72e8d37fe8145b813d07875addf793e12dc..a5db8841773618814ac90f740201d4d7
// Returns whether `Initialize` has already been invoked in the process.
// Initialization is a one-way operation (i.e., this method cannot return
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index f8d4be9d5bb00b4c66a53a7e26aee910bd2f7827..ef90742c78529a883a12c582c5950a7511cf5de0 100644
index f407288fea875cf712e4d3128d02237d2014ce4e..ee73fad76593c8af5c8cef2ec1da56a77933e113 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -480,7 +480,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
@@ -472,7 +472,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
// static
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
const std::string js_command_line_flags,
Expand All @@ -51,7 +51,7 @@ index f8d4be9d5bb00b4c66a53a7e26aee910bd2f7827..ef90742c78529a883a12c582c5950a75
static bool v8_is_initialized = false;
if (v8_is_initialized)
return;
@@ -490,7 +491,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
@@ -482,7 +483,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
// See https://crbug.com/v8/11043
SetFlags(mode, js_command_line_flags);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ index 39e18820db0d0c1b57f4375e01d269e53c839e4e..ea4da67a9b7798822d1d5dd90d09597a
properties->supports_global_application_menus = true;
properties->app_modal_dialogs_use_event_blocker = true;
diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
index 9d6534449f04baa7ebfc8604286b7d5f230e259a..cf23a05ee0a49f397b3605fb1e4510a86b40885d 100644
index bc3dce09be325a1a1754da3311f15681f74ce88d..b02e0295ecd35844d3e40b03c73955f8a64cdd9c 100644
--- a/ui/ozone/public/ozone_platform.h
+++ b/ui/ozone/public/ozone_platform.h
@@ -122,6 +122,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
@@ -121,6 +121,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
// Linux only: determines if Skia can fall back to the X11 output device.
bool skia_can_fall_back_to_x11 = false;

Expand Down
2 changes: 1 addition & 1 deletion patches/chromium/load_v8_snapshot_in_browser_process.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ but due to the nature of electron, we need to load the v8 snapshot
in the browser process.

diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index 547791ed0b7a176d3049a71fd1f90e35f29c0f9b..3ee750502ed8b58fc04e6fa89fe3916341f7362e 100644
index 5e4c1f8d6c87299ec2f79b652e335e63c39b655f..98de040583e1148fbadd6e666006164156515bb9 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -283,11 +283,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ system font by checking if it's kCTFontPriorityAttribute is set to
system priority.

diff --git a/base/BUILD.gn b/base/BUILD.gn
index 7af70d486bfef1be6265d4f7136b73bc371dd92e..8747282d74b9418e509bca4cdc3399b3ba1bae44 100644
index 575149b2f3246c1bcc88b046fb1ae2dbeaa3b2a2..704ff05b8ec8475ad215bbde4ee6ab587a61c818 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1068,6 +1068,7 @@ component("base") {
Expand Down Expand Up @@ -1260,7 +1260,7 @@ index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..dc30306f2c5d20503399fc3a8860773a

} // namespace sandbox
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
index 9f1346108a24fdc93147eb31411d94c1f9064a44..238405c2f811d80ab58673d69b7a16e201e51818 100644
index 4feaed1ede9739cb92860c995c1f9730ff0abe84..8110ad78d07b1ebb8234865e619ab45551a1c6f0 100644
--- a/third_party/blink/renderer/core/BUILD.gn
+++ b/third_party/blink/renderer/core/BUILD.gn
@@ -317,6 +317,7 @@ component("core") {
Expand Down
2 changes: 1 addition & 1 deletion patches/chromium/notification_provenance.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pass RenderFrameHost through to PlatformNotificationService
so Electron can identify which renderer a notification came from.

diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index 738563f512ac818c0c05b6617bd90ac40a50bf37..08dd8bd95b6beaf30f65bda0d0ca0e799fee1cf8 100644
index 37fb69de336c0051fab2db74054ea632c0a66586..c629cd02f868372d80657926e59ed099b6b7317a 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -198,6 +198,7 @@ bool PlatformNotificationServiceImpl::WasClosedProgrammatically(
Expand Down
6 changes: 3 additions & 3 deletions patches/chromium/picture-in-picture.patch
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ index 0d38b25bcb43f0bbedc1e71508e840a862c28a3c..94a36af528dfa220cfae6b9b1b0be131
ui::ImageModel::FromVectorIcon(*icon, kColorPipWindowForeground,
kCloseButtonIconSize));
diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
index 8110f1c5909e8996b1d847267f0aab3eff8339fa..28d3689be10469fa9f6bd8e608717c4d13a92620 100644
index f94dc33f7ffbc13fd9846c5b62f5de3ac80d03ba..ecabd4e26fa4eca960cdd890d6b174d1505471a7 100644
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
@@ -17,9 +17,11 @@
Expand All @@ -54,7 +54,7 @@ index 8110f1c5909e8996b1d847267f0aab3eff8339fa..28d3689be10469fa9f6bd8e608717c4d
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/overlay/back_to_tab_label_button.h"
#include "chrome/browser/ui/views/overlay/close_image_button.h"
@@ -58,7 +60,7 @@
@@ -59,7 +61,7 @@
#include "ui/aura/window.h"
#endif

Expand All @@ -63,7 +63,7 @@ index 8110f1c5909e8996b1d847267f0aab3eff8339fa..28d3689be10469fa9f6bd8e608717c4d
#include "chrome/browser/shell_integration_win.h"
#include "content/public/browser/render_widget_host_view.h"
#include "ui/aura/window.h"
@@ -310,7 +312,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
@@ -311,7 +313,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
overlay_window->Init(std::move(params));
overlay_window->OnRootViewReady();

Expand Down
Loading

0 comments on commit 6f6fff5

Please sign in to comment.