electron/patches/chromium/chore_patch_out_profile_methods.patch
electron-roller[bot] 6779769d22
chore: bump chromium to 139.0.7219.0 (main) (#47348)
* chore: bump chromium in DEPS to 139.0.7205.0

* 6543986: Mac: decouple deserializing and applying sandbox policy

Refs 6543986

* 6580079: Reland 'Remove the third-party blocking feature'
Refs 6580079

* 6505716: guest-contents: Add components/guest_contents
Refs 6505716

* 6572556: Move LogMessageManager out of gpu_service_impl.cc.
Refs 6572556

* 6566111: Change UtilityProcessHost to manage its instance internally
Refs 6566111

* 6550237: Rename ReconnectEventObserver to ConnectionChangeObserverClient
Refs 6550237

* 6565918: Validate path is valid UTF8 in SelectFileDialogLinuxPortal
Refs 6565918

* 6579713: Remove base::NotFatalUntil::M130 usage
6566111: Change UtilityProcessHost to manage its instance internally
Refs
6579713
6566111

* chore: update chromium patches

* chore: update remaining patches

* fixup! 6566111: Change UtilityProcessHost to manage its instance internally Refs 6566111

* 6577970: Remove superfluous includes for base/strings/stringprintf.h in headers
Refs 6577970

* 6568811: Add FunctionCall structured metrics event for DevTools
Refs 6568811

* [PDF Ink Signatures] Support PdfAnnotationsEnabled policy
6558970

* build: disable libcxx modules for rbe

* chore: bump chromium in DEPS to 139.0.7217.0

* chore: bump chromium in DEPS to 139.0.7218.0

* chore: update patches

fix_use_delegated_generic_capturer_when_available.patch was updated to handle a small change:
6582142: Use content::Create*Capturer in DesktopCaptureDevice. | 6582142

* chore: bump chromium in DEPS to 139.0.7219.0

* chore: update patches

* 6594615: Change Chromium's deployment target to macOS 12
6594615

Updated the assertion message to match the docs structure now too. I removed the callout to the supported versions doc because it has moved and doesn't contain minimum platform version information.

* 6606232: [views] Remove DesktopWindowTreeHostWin::window_enlargement_
6606232

|NativeWindow::GetContentMinimumSize| and |NativeWindow::GetContentMaximumSize| may be good opportunities for a refactor now.

* add squirrel.mac patch for removed function

This was triggered by the macOS 12.0 deployment upgrade change.

See: https://developer.apple.com/documentation/coreservices/1444079-uttypeconformsto?language=objc

* 6582142: Use content::Create*Capturer in DesktopCaptureDevice.
6582142

* 6579732: Two minor API "quality of life" cleanups in OSCrypt Async
6579732

* chore: add include for base::SingleThreadTaskRunner

Not sure what change caused this, I expect it would be a removed include somewhere else, but it's likely not important to track down.

* chore: update libcxx filenames

* chore: update CI build-tools commit target for macOS SDK 15.4

The following change uses an API that was added in the macOS 15.4 SDK. Support for that SDK version was added later than the current build-tools commit target.

6575804: Use a quick-and-dirty solution to avoid glitching with paste-and-go | 6575804

See: https://developer.apple.com/documentation/appkit/nspasteboard/accessbehavior-swift.enum?language=objc

* fixup! 6606232: [views] Remove DesktopWindowTreeHostWin::window_enlargement_ 6606232

* chore: bump chromium in DEPS to 139.0.7220.0

* chore: update patches

Minor changes due to:

6613978: pwa: let events fall through in the transparent area of TopContainerView | 6613978
6614778: Refactor auto pip tab observer for Android support | 6614778

* 6543986: Mac: decouple deserializing and applying sandbox policy
6543986

The DecodeVarInt and DecodeString functions look benign from a MAS perspective. I suspect they were patched out to avoid "unused function" errors. Their complements for encoding are unpatched, supporting this idea.

The code that uses these functions was refactored out of the section that we patch out. Instead of patching out that new function, I decided to treat it the same as the serialization function that is unpatched.

* chore: bump chromium in DEPS to 139.0.7222.0

* chore: bump chromium in DEPS to 139.0.7224.0

* chore: bump chromium in DEPS to 139.0.7226.0

* chore: bump chromium in DEPS to 139.0.7228.0

* chore: update patches

* Don't use static variable for UseExternalPopupMenus

6534657

* Reland "Roll libc++ from a01c02c9d4ac to a9cc573e7c59

6607589

* chore: bump chromium in DEPS to 139.0.7219.0

* chore: update patches

* revert Don't use static variable for UseExternalPopupMenus

* tls: remove deprecated tls.createSecurePair and SecurePair

https://github.com/nodejs/node/pull/57361

* Revert "Reland "Roll libc++ from a01c02c9d4ac to a9cc573e7c59"

This reverts commit 33e1436a0c598ffa8cd308d08de481ed9cd22168.

* test: cleanup api-desktop-capturer-spec.ts

* test: more cleanup of api-desktop-capturer-spec.ts

* chore: debug dcheck error in webrtc on linux

* fixup patch

* add debugging to desktop capturer spec

* test: fixup api-desktop-capturer-spec.ts for linux

* chore: remove debugging patch

* Revert "fixup! 6606232: [views] Remove DesktopWindowTreeHostWin::window_enlargement_ 6606232"

This reverts commit 32e75651c14512572d322e819c98ab1469663bb6.

* Revert "6606232: [views] Remove DesktopWindowTreeHostWin::window_enlargement_"

This reverts commit 89c51aa1c7771fd7f1d634486bc77f493f1d2ea9.

* [views] Remove DesktopWindowTreeHostWin::window_enlargement_

6606232

Reverting as we need this functionality for now.

* fixup: remove patch that was accidentally added back

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-06-16 12:46:06 -05:00

126 lines
5.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <charles@charleskerr.com>
Date: Wed, 17 May 2023 14:42:09 -0500
Subject: chore: patch out Profile methods
Electron does not support Profiles, so we need to patch it out of any
code that we use.
diff --git a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
index e3b9f14a4cf2167064ce6716053e663adffa1542..65f13a4607c8145858fd47d81cb9960c44272d79 100644
--- a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
+++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
@@ -45,6 +45,7 @@ namespace {
// hierarchy is: enterprise policy > user choice > finch experiment.
bool ShouldEnableSkiaRenderer(content::WebContents* contents) {
CHECK(contents);
+#if 0
const PrefService* prefs =
Profile::FromBrowserContext(contents->GetBrowserContext())->GetPrefs();
@@ -52,6 +53,7 @@ bool ShouldEnableSkiaRenderer(content::WebContents* contents) {
if (prefs->IsManagedPreference(prefs::kPdfUseSkiaRendererEnabled)) {
return prefs->GetBoolean(prefs::kPdfUseSkiaRendererEnabled);
}
+#endif
// When the enterprise policy is not set, use finch/feature flag choice.
return base::FeatureList::IsEnabled(
diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
index e7badbe6add4865001e1c0a43ab0aa3fcdbe5043..9748c20048363cb349229cd2315f22da1da56395 100644
--- a/chrome/browser/pdf/pdf_extension_util.cc
+++ b/chrome/browser/pdf/pdf_extension_util.cc
@@ -245,10 +245,13 @@ bool IsPrintingEnabled(content::BrowserContext* context) {
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(ENABLE_PDF_INK2)
bool IsPdfAnnotationsEnabledByPolicy(content::BrowserContext* context) {
+# if 0
PrefService* prefs =
context ? Profile::FromBrowserContext(context)->GetPrefs() : nullptr;
return !prefs || !prefs->IsManagedPreference(prefs::kPdfAnnotationsEnabled) ||
prefs->GetBoolean(prefs::kPdfAnnotationsEnabled);
+#endif
+ return true;
}
#endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(ENABLE_PDF_INK2)
diff --git a/chrome/browser/profiles/profile_selections.cc b/chrome/browser/profiles/profile_selections.cc
index bc0bad82ebcdceadc505e912ff27202b452fefab..6b77c57fccc4619a1df3b4ed661d2bdd60960228 100644
--- a/chrome/browser/profiles/profile_selections.cc
+++ b/chrome/browser/profiles/profile_selections.cc
@@ -13,6 +13,7 @@
#endif // BUILDFLAG(IS_CHROMEOS)
bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile) {
+#if 0
// By default disable all services for System Profile.
// Even though having no services is also the default value for Guest Profile,
// this is not really the case in practice because a lot of Service Factories
@@ -20,7 +21,7 @@ bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile) {
if (profile && profile->IsSystemProfile()) {
return true;
}
-
+#endif
return false;
}
@@ -104,6 +105,7 @@ ProfileSelections ProfileSelections::BuildRedirectedInIncognito() {
}
Profile* ProfileSelections::ApplyProfileSelection(Profile* profile) const {
+#if 0
CHECK(profile);
ProfileSelection selection = GetProfileSelection(profile);
@@ -119,6 +121,9 @@ Profile* ProfileSelections::ApplyProfileSelection(Profile* profile) const {
case ProfileSelection::kOffTheRecordOnly:
return profile->IsOffTheRecord() ? profile : nullptr;
}
+#else
+ return nullptr;
+#endif
}
ProfileSelection ProfileSelections::GetProfileSelection(
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index 4c52386f9ddf13f1453903cda3954b6c596028f2..8fbb2025d157e58c90c701f9e3478f6c99b88aa1 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -21,8 +21,10 @@
#include "base/synchronization/waitable_event.h"
#include "base/values.h"
#include "build/build_config.h"
+#if 0
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profiles_state.h"
+#endif
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"
#include "components/language/core/browser/pref_names.h"
@@ -67,7 +69,10 @@ SpellcheckService::SpellCheckerBinder& GetSpellCheckerBinderOverride() {
// Only record spelling-configuration metrics for profiles in which the user
// can configure spelling.
bool RecordSpellingConfigurationMetrics(content::BrowserContext* context) {
+#if 0
return profiles::IsRegularUserProfile(Profile::FromBrowserContext(context));
+#endif
+ return true;
}
} // namespace
diff --git a/chrome/browser/win/titlebar_config.cc b/chrome/browser/win/titlebar_config.cc
index 7898ea88ca529660e52c1f9e2517d6f016b740a5..114046912999f4ca9d21f7d5859d14ecaaab9f56 100644
--- a/chrome/browser/win/titlebar_config.cc
+++ b/chrome/browser/win/titlebar_config.cc
@@ -12,8 +12,10 @@
bool ShouldBrowserCustomDrawTitlebar(BrowserView* browser_view) {
return !ShouldDefaultThemeUseMicaTitlebar() ||
+#if 0
!ThemeServiceFactory::GetForProfile(browser_view->GetProfile())
->UsingSystemTheme() ||
+#endif
(!browser_view->browser()->is_type_normal() &&
!browser_view->browser()->is_type_popup() &&
!browser_view->browser()->is_type_devtools());