diff --git a/DEPS b/DEPS index c8d954f3f2..479009576a 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ gclient_gn_args_from = 'src' vars = { 'chromium_version': - '140.0.7339.24', + '140.0.7339.41', 'node_version': 'v22.18.0', 'nan_version': diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 799c5b1774..990ca6ed9b 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -135,5 +135,4 @@ build_partial_revert_mac_fullscreen_top_chrome_mouse_events.patch build_set_mac_sdk_minimum_to_10.patch fix_add_macos_memory_query_fallback_to_avoid_crash.patch fix_resolve_dynamic_background_material_update_issue_on_windows_11.patch -chore_restore_some_deprecated_wrapper_utility_in_gin.patch feat_add_support_for_embedder_snapshot_validation.patch diff --git a/patches/chromium/chore_restore_some_deprecated_wrapper_utility_in_gin.patch b/patches/chromium/chore_restore_some_deprecated_wrapper_utility_in_gin.patch deleted file mode 100644 index 551f3b0524..0000000000 --- a/patches/chromium/chore_restore_some_deprecated_wrapper_utility_in_gin.patch +++ /dev/null @@ -1,174 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: deepak1556 -Date: Tue, 5 Aug 2025 02:26:29 +0900 -Subject: chore: restore some deprecated wrapper utility in gin - -Restores part of https://chromium-review.googlesource.com/c/chromium/src/+/6799157 - -Patch can be removed once cppgc migration is complete -https://github.com/electron/electron/issues/47922 - -diff --git a/gin/object_template_builder.cc b/gin/object_template_builder.cc -index 5a31687bbd0fca61db3a7c41ed73d938340d6446..b84f5fd336bc4b61b2cd0b2fc92382b00e928701 100644 ---- a/gin/object_template_builder.cc -+++ b/gin/object_template_builder.cc -@@ -141,7 +141,7 @@ ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate, - : "Objects of this type cannot be created using the " - "constructor"))), - template_(constructor_template_->InstanceTemplate()) { -- template_->SetInternalFieldCount(0); -+ template_->SetInternalFieldCount(kNumberOfInternalFields); - } - - ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate, -diff --git a/gin/per_isolate_data.cc b/gin/per_isolate_data.cc -index 884990426f13a6abca22a60dd8cc0685f8435b23..64ac0a64a05105532f3cda898aeac68c21338e60 100644 ---- a/gin/per_isolate_data.cc -+++ b/gin/per_isolate_data.cc -@@ -68,12 +68,32 @@ PerIsolateData* PerIsolateData::From(Isolate* isolate) { - return static_cast(isolate->GetData(kEmbedderNativeGin)); - } - -+void PerIsolateData::DeprecatedSetObjectTemplate(DeprecatedWrapperInfo* info, -+ Local templ) { -+ deprecated_object_templates_[info] = Eternal(isolate_, templ); -+} -+ - void PerIsolateData::SetObjectTemplate( - const WrapperInfo* info, - Local templ) { - object_templates_[info] = Eternal(isolate_, templ); - } - -+void PerIsolateData::SetFunctionTemplate(DeprecatedWrapperInfo* info, -+ Local templ) { -+ function_templates_[info] = Eternal(isolate_, templ); -+} -+ -+v8::Local PerIsolateData::DeprecatedGetObjectTemplate( -+ DeprecatedWrapperInfo* info) { -+ DeprecatedObjectTemplateMap::iterator it = -+ deprecated_object_templates_.find(info); -+ if (it == deprecated_object_templates_.end()) { -+ return v8::Local(); -+ } -+ return it->second.Get(isolate_); -+} -+ - v8::Local PerIsolateData::GetObjectTemplate( - const WrapperInfo* info) { - ObjectTemplateMap::iterator it = object_templates_.find(info); -@@ -83,6 +103,15 @@ v8::Local PerIsolateData::GetObjectTemplate( - return it->second.Get(isolate_); - } - -+v8::Local PerIsolateData::GetFunctionTemplate( -+ DeprecatedWrapperInfo* info) { -+ FunctionTemplateMap::iterator it = function_templates_.find(info); -+ if (it == function_templates_.end()) { -+ return v8::Local(); -+ } -+ return it->second.Get(isolate_); -+} -+ - void PerIsolateData::AddDisposeObserver(DisposeObserver* observer) { - dispose_observers_.AddObserver(observer); - } -diff --git a/gin/per_isolate_data.h b/gin/per_isolate_data.h -index bce889749415da341e6e6e4082ac06bbeb4bb80a..d748c1cf8cef7da90686686f1b8072bcd530541d 100644 ---- a/gin/per_isolate_data.h -+++ b/gin/per_isolate_data.h -@@ -51,11 +51,24 @@ class GIN_EXPORT PerIsolateData { - - static PerIsolateData* From(v8::Isolate* isolate); - -+ void DeprecatedSetObjectTemplate( -+ DeprecatedWrapperInfo* info, -+ v8::Local object_template); -+ - void SetObjectTemplate(const WrapperInfo* info, - v8::Local object_template); - -+ void SetFunctionTemplate(DeprecatedWrapperInfo* info, -+ v8::Local function_template); -+ -+ v8::Local DeprecatedGetObjectTemplate( -+ DeprecatedWrapperInfo* info); -+ - v8::Local GetObjectTemplate(const WrapperInfo* info); - -+ v8::Local GetFunctionTemplate( -+ DeprecatedWrapperInfo* info); -+ - void AddDisposeObserver(DisposeObserver* observer); - void RemoveDisposeObserver(DisposeObserver* observer); - void NotifyBeforeDispose(); -@@ -74,14 +87,20 @@ class GIN_EXPORT PerIsolateData { - } - - private: -+ typedef std::map> -+ DeprecatedObjectTemplateMap; - typedef std::map> - ObjectTemplateMap; -+ typedef std::map> -+ FunctionTemplateMap; - - // PerIsolateData doesn't actually own |isolate_|. Instead, the isolate is - // owned by the IsolateHolder, which also owns the PerIsolateData. - raw_ptr isolate_; - raw_ptr allocator_; -+ DeprecatedObjectTemplateMap deprecated_object_templates_; - ObjectTemplateMap object_templates_; -+ FunctionTemplateMap function_templates_; - base::ObserverList dispose_observers_; - std::shared_ptr task_runner_; - std::shared_ptr user_visible_task_runner_; -diff --git a/gin/public/wrapper_info.h b/gin/public/wrapper_info.h -index 34b5f1c30c05152122f23708a1df62f00296fcd6..dac3459dc822db1b242288293605ab4c4a6cf76f 100644 ---- a/gin/public/wrapper_info.h -+++ b/gin/public/wrapper_info.h -@@ -13,6 +13,17 @@ - - namespace gin { - -+enum InternalFields { -+ kWrapperInfoIndex, -+ kEncodedValueIndex, -+ kNumberOfInternalFields, -+}; -+ -+struct GIN_EXPORT DeprecatedWrapperInfo { -+ static DeprecatedWrapperInfo* From(v8::Local object); -+ const GinEmbedder embedder; -+}; -+ - struct GIN_EXPORT WrapperInfo : v8::Object::WrapperTypeInfo { - const WrappablePointerTag pointer_tag; - }; -diff --git a/gin/wrappable.cc b/gin/wrappable.cc -index 803b5648e1c3ec3621149e98850bebfbf7f2de75..dd49202103993ee03379acd6873b92bc8fccb786 100644 ---- a/gin/wrappable.cc -+++ b/gin/wrappable.cc -@@ -48,7 +48,7 @@ v8::MaybeLocal WrappableBase::GetWrapper(v8::Isolate* isolate) { - CHECK(!templ.IsEmpty()); - data->SetObjectTemplate(info, templ); - } -- CHECK_EQ(0, templ->InternalFieldCount()); -+ CHECK_EQ(kNumberOfInternalFields, templ->InternalFieldCount()); - v8::Local wrapper; - // |wrapper| may be empty in some extreme cases, e.g., when - // Object.prototype.constructor is overwritten. -@@ -56,6 +56,12 @@ v8::MaybeLocal WrappableBase::GetWrapper(v8::Isolate* isolate) { - return {}; - } - -+ // Delete the internal fields once gin_helper::DeprecatedWrappable does -+ // not exist anymore. -+ int indices[] = {kWrapperInfoIndex, kEncodedValueIndex}; -+ void* values[] = {nullptr, nullptr}; -+ wrapper->SetAlignedPointerInInternalFields(2, indices, values); -+ - AssociateWithWrapper(isolate, wrapper); - return wrapper; - } diff --git a/patches/chromium/feat_allow_passing_of_objecttemplate_to_objecttemplatebuilder.patch b/patches/chromium/feat_allow_passing_of_objecttemplate_to_objecttemplatebuilder.patch index dbf3c5da46..b3f38261de 100644 --- a/patches/chromium/feat_allow_passing_of_objecttemplate_to_objecttemplatebuilder.patch +++ b/patches/chromium/feat_allow_passing_of_objecttemplate_to_objecttemplatebuilder.patch @@ -10,11 +10,11 @@ Electron needs this constructor, namely for gin_helper::Constructible objects. diff --git a/gin/object_template_builder.cc b/gin/object_template_builder.cc -index 9f9ae85ad432ce71f308d6c56265a96985f42766..5a31687bbd0fca61db3a7c41ed73d938340d6446 100644 +index a694f7dc4da4f1bba579ab8c032eea21d8459995..8aaaba327166b1d3b884fe390a389c0c50890af9 100644 --- a/gin/object_template_builder.cc +++ b/gin/object_template_builder.cc -@@ -144,6 +144,13 @@ ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate, - template_->SetInternalFieldCount(0); +@@ -146,6 +146,13 @@ ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate, + template_->SetInternalFieldCount(kNumberOfInternalFields); } +ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate, @@ -28,10 +28,10 @@ index 9f9ae85ad432ce71f308d6c56265a96985f42766..5a31687bbd0fca61db3a7c41ed73d938 const ObjectTemplateBuilder& other) = default; diff --git a/gin/object_template_builder.h b/gin/object_template_builder.h -index cf4f1ae6598fdede655d33baccda254965566ea5..a4c16dc0ec3ff16413fc2a04225a2401989a084b 100644 +index 9d8f6e5de793ea419875d99a0b46898f2e40ead5..c803363b8050f4084c9250fce9b5b8b171082703 100644 --- a/gin/object_template_builder.h +++ b/gin/object_template_builder.h -@@ -48,6 +48,9 @@ class GIN_EXPORT ObjectTemplateBuilder { +@@ -46,6 +46,9 @@ class GIN_EXPORT ObjectTemplateBuilder { public: explicit ObjectTemplateBuilder(v8::Isolate* isolate); ObjectTemplateBuilder(v8::Isolate* isolate, const char* type_name); diff --git a/patches/chromium/feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch b/patches/chromium/feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch index f5e7abc1fb..b2dbcae77f 100644 --- a/patches/chromium/feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch +++ b/patches/chromium/feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch @@ -317,10 +317,10 @@ index 7e17594c30ac3cf8cb484b53563b03fc75bd2e0b..0e4a68f2fd8179640f877cb258b40496 // Although ScreenCaptureKit is available in 12.3 there were some bugs that diff --git a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc -index a5bc6f63c771fdf68ed9251285eac9d2c91acdc0..f719ff68e18093791bf13e434f40a3d1a9626dca 100644 +index cedd951a80e055a6af8aa17460d77e1b3e76fff3..997c239f337f5c049a75518809a56480a5abf9f3 100644 --- a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc +++ b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc -@@ -321,8 +321,16 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync( +@@ -323,8 +323,16 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync( break; } @@ -338,7 +338,7 @@ index a5bc6f63c771fdf68ed9251285eac9d2c91acdc0..f719ff68e18093791bf13e434f40a3d1 // For the other capturers, when a bug reports the type of capture it's // easy enough to determine which capturer was used, but it's a little // fuzzier with window capture. -@@ -338,13 +346,15 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync( +@@ -340,13 +348,15 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync( } #endif // defined(USE_AURA) || BUILDFLAG(IS_MAC) diff --git a/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch b/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch index db91ce151a..6aa256ef2d 100644 --- a/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch +++ b/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch @@ -28,10 +28,10 @@ The patch should be removed in favor of either: Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397. diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc -index 24d2fc92266d1d398ee43e08a56cc05d9ff6eca3..748d041e518350f49c6aef88275893c19616d014 100644 +index 4288bf261741e4260b7a3117618fa19d39b20d2c..981aaaf9510d4354e02381266cf629a98c4d6ef6 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -11374,6 +11374,11 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryUnchecked() { +@@ -11376,6 +11376,11 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryUnchecked() { target_rph_id); } diff --git a/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch b/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch index b1397ea51f..281a9fdeda 100644 --- a/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch +++ b/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch @@ -582,7 +582,7 @@ index 2d5cad5d7a4ab9292a5f966123687dee06f4512b..ae798fc8f923a9b590c0d9ed703946a2 return kAttributes; } diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index adce27e6feaed7172cac9bdcd1b2e83930eb0a77..d912bdedc246503bb4114393baee14fc95c54eb9 100644 +index dfc54c87eabbb33277ed145e78f8eef592da9ea2..5024ea32655edd62c02565a5e9e1d802c348c663 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -345,6 +345,7 @@ source_set("browser") { diff --git a/patches/chromium/revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch b/patches/chromium/revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch index 13f620d11d..d47195526d 100644 --- a/patches/chromium/revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch +++ b/patches/chromium/revert_views_remove_desktopwindowtreehostwin_window_enlargement.patch @@ -10,10 +10,10 @@ on Windows. We should refactor our code so that this patch isn't necessary. diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json -index 8d6d0963ac818a16ce63b41f61dd91325fd81c53..5f7449c93a9fd21838d6765e06ddd3362808d418 100644 +index e887bbb4792382d4aa2ceaed018c492e258d00fe..98f1270a3f74f9a1ce641f629e5ae6100fefec13 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json -@@ -24885,6 +24885,21 @@ +@@ -24897,6 +24897,21 @@ ] } ],