Files
electron/patches/chromium/resource_file_conflict.patch
electron-roller[bot] fe477ce3aa chore: bump chromium to 145.0.7568.0 (main) (#49145)
* chore: bump chromium in DEPS to 145.0.7562.0

* fix(patch-conflict): update code cache patch for PersistentCache refactor

Upstream refactored code cache to use PersistentCache with new class-based
implementation (NoopCodeCacheHost, LocalCodeCacheHost, CodeCacheWithPersistentCacheHost).
Updated patch to integrate custom scheme support into the new structure while
preserving ProcessLockURLIsCodeCacheScheme checks for embedder-registered schemes.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7044986

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(patch-conflict): update dialog patch for RequestXdgDesktopPortal API

Upstream changed from SetSystemdScopeUnitNameForXdgPortal to RequestXdgDesktopPortal
API pattern. Updated OnServiceStarted signature and kept OnSystemdUnitStarted callback
that calls Electron's file_dialog::StartPortalAvailabilityTestInBackground().

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7204285

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(patch-conflict): remove reference to deleted AbortByPlaceholderLayout flag

Upstream removed the AbortByPlaceholderLayout runtime flag from
runtime_enabled_features.json5. Updated patch to only add ElectronCSSCornerSmoothing
without the removed flag reference.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7226494

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* chore: update patch hunk headers

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(build): guard media_file_system_registry for ChromeOS only

Upstream CL https://chromium-review.googlesource.com/c/chromium/src/+/7100719
moved media_file_system_registry to be ChromeOS-only since Media
Galleries is a Chrome Apps API and Chrome Apps are only available
on Chrome OS now.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(build): update VideoPixelFormat API for SharedImageFormat

Upstream CL https://chromium-review.googlesource.com/c/chromium/src/+/7207153
removed VideoPixelFormatToGfxBufferFormat as part of migration to
SharedImageFormat. Update to use VideoPixelFormatToSharedImageFormat
which directly returns the SharedImageFormat.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(build): extend profile methods patch for ShouldEnableXfaForms

The ShouldEnableXfaForms function uses Profile::FromBrowserContext()
which is not available in Electron. Wrap the profile-dependent code
in #if 0 to fall through to the feature flag default.

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: bump chromium in DEPS to 145.0.7563.0

* chore: bump chromium in DEPS to 145.0.7565.0

* chore: bump chromium in DEPS to 145.0.7567.0

* chore: bump chromium in DEPS to 145.0.7568.0

* fix(patch-conflict): update content_main_delegate.h context for IsInitFeatureListEarly

Upstream added a new IsInitFeatureListEarly() virtual method to ContentMainDelegate
just before where our GetBrowserV8SnapshotFilename() method is added. Updated patch
context to account for this new method.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7092856

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* chore: update patch hunk headers

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(patch-update): include v8-cppgc.h for CppHeap complete type

The std::unique_ptr<v8::CppHeap> default argument in node.h requires
the complete CppHeap type definition for the destructor. Added the
v8-cppgc.h include to provide the full type definition.

Ref: Unable to locate CL - libc++ unique_ptr requires complete type for destructor

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* chore: update patch hunk headers

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(build): move NativeAppWindowFrameViewMacClient before constructor

The std::unique_ptr<NativeAppWindowFrameViewMacClient> member requires
the complete type definition to be visible at the point of the constructor
because the unique_ptr destructor may be instantiated during exception
handling. Moved the class definition before the NativeWindowMac constructor.

Ref: Unable to locate CL - libc++ unique_ptr requires complete type for destructor

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

* fix(patch-conflict): update create_browser_v8_snapshot_file_name_fuse context for IsInitFeatureListEarly

The upstream added IsInitFeatureListEarly() virtual method declaration to
ContentMainDelegate class. Updated the patch context to account for this
new function being present before the GetBrowserV8SnapshotFilename()
declaration we add.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7092856

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update patch hunk headers

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(patch-update): remove reverted IsInitFeatureListEarly from v8 snapshot patch

The upstream added IsInitFeatureListEarly() was reverted, so the patch should
not include this declaration. Only GetBrowserV8SnapshotFilename() should be
added by the create_browser_v8_snapshot_file_name_fuse patch.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7230430

Co-Authored-By: Claude <noreply@anthropic.com>

* 6171655: include single_thread_task_runner.h for complete type

Added include for base/task/single_thread_task_runner.h in osr_converter.cc
to resolve incomplete type error when using
base::SingleThreadTaskRunner::GetCurrentDefault().

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/6171655

Co-Authored-By: Claude <noreply@anthropic.com>

* 7224136: use CHROMIUM_GIT_REVISION directly instead of removed function

Upstream removed GetChromiumGitRevision() function from embedder_support.
Updated to use CHROMIUM_GIT_REVISION macro directly via
build/util/chromium_git_revision.h as recommended in the Chromium CL.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7224136

Co-Authored-By: Claude <noreply@anthropic.com>

* fixup! 7224136: use CHROMIUM_GIT_REVISION directly instead of removed function

* fix(build): add missing include

`components/dbus/xdg/systemd.h` for `void OnSystemdUnitStarted(dbus_xdg::SystemdUnitStatus)` in the same patch.

* fix(build): adapt to string-view-ification change in windows jump_list.cc

7186922: Fix unsafe buffer usage in base/win/win_util.cc
https://chromium-review.googlesource.com/c/chromium/src/+/7186922

* chore: update libc++ filenames

* fixup! fix(build): add missing include

* fixup! fix(build): extend profile methods patch for ShouldEnableXfaForms

* fixup! fix(build): guard media_file_system_registry for ChromeOS only

* fixup! fixup! fix(build): extend profile methods patch for ShouldEnableXfaForms

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: clavin <clavin@electronjs.org>
2025-12-10 10:28:31 -05:00

80 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Thu, 20 Sep 2018 17:48:59 -0700
Subject: resource_file_conflict.patch
Resolve conflict between //chrome's .pak files and //electron's. The paths
that chrome code hardcodes require that we generate resources at these
paths, but GN throws errors if there are multiple targets that generate the
same files.
This is due to the hardcoded names here:
https://chromium.googlesource.com/chromium/src/+/69.0.3497.106/ui/base/resource/resource_bundle.cc#780
and here:
https://chromium.googlesource.com/chromium/src/+/69.0.3497.106/ui/base/resource/resource_bundle_mac.mm#50
This isn't needed on Mac because resource files are copied into the app bundle,
and are built in `$root_out_dir/electron_repack` (while Chromium's resources
target `$root_out_dir/repack`), but on Windows and Linux, the resource files go
directly in `$root_out_dir`, and so they conflict.
We don't actually ever generate Chromium's resource paks, but without this
patch, GN refuses to generate the ninja files:
ERROR at //tools/grit/repack.gni:35:3: Duplicate output file.
action(_repack_target_name) {
^----------------------------
Two or more targets generate the same output:
chrome_100_percent.pak
This is can often be fixed by changing one of the target names, or by
setting an output_name on one of them.
Collisions:
//chrome:packed_resources_100_percent
//electron:packed_resources_100_percent
See //tools/grit/repack.gni:35:3: Collision.
action(_repack_target_name) {
^----------------------------
Some alternatives to this patch:
1. Refactor upstream in such a way that the "chrome" pak names were
configurable, for instance by adding a method to ResourceBundle::Delegate that
LoadChromeResources would check.
2. Pass a Delegate that overrides `GetPathForResourcePack`, check for the
`chrome_{100,200}_percent.pak` filenames, and rewrite them to
`electron_{100,200}_percent.pak`.
3. Initialize the resource bundle with DO_NOT_LOAD_COMMON_RESOURCES and load
the paks ourselves.
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 5549dad7d160cfa0185ee47f427800699d44dee8..02876ca62dc50566fb15a1bd0e3b8415f0b1dd10 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1538,7 +1538,7 @@ if (is_chrome_branded && !is_android) {
}
}
-if (!is_android) {
+if (!is_android && !is_electron_build) {
chrome_paks("packed_resources") {
if (is_mac) {
output_dir = "$root_gen_dir/repack"
@@ -1584,6 +1584,12 @@ repack("browser_tests_pak") {
deps = [ "//chrome/test/data/webui:resources" ]
}
+if (is_electron_build) {
+ group("packed_resources") {
+ public_deps = [ "//electron:packed_resources" ]
+ }
+}
+
group("strings") {
public_deps = [
"//chrome/app:branded_strings",