alloy: Avoid initialization of privacy sandbox and identity manager (fixes issue #3434, fixes issue #3401)

This commit is contained in:
Marshall Greenblatt 2023-01-06 12:06:46 -05:00
parent 7209750d46
commit f77a7a7336
2 changed files with 48 additions and 4 deletions

View File

@ -441,6 +441,9 @@ patches = [
# - Fix cache directory structure ("C:\temp\cache\cache\Cache" should be
# "C:\temp\cache\Cache").
# https://bitbucket.org/chromiumembedded/cef/issues/2622
#
# alloy: Avoid initialization of privacy sandbox and identity manager.
# https://bitbucket.org/chromiumembedded/cef/issues/3434
'name': 'services_network_2622',
},
{

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc
index 8221b46c59df3..eca1b2040dd4c 100644
index 8221b46c59df3..736e703efa276 100644
--- chrome/browser/net/profile_network_context_service.cc
+++ chrome/browser/net/profile_network_context_service.cc
@@ -22,6 +22,7 @@
@ -10,7 +10,20 @@ index 8221b46c59df3..eca1b2040dd4c 100644
#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_content_browser_client.h"
@@ -304,7 +305,9 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
@@ -263,8 +264,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
base::Unretained(this)));
cookie_settings_ = CookieSettingsFactory::GetForProfile(profile);
cookie_settings_observation_.Observe(cookie_settings_.get());
- privacy_sandbox_settings_observer_.Observe(
- PrivacySandboxSettingsFactory::GetForProfile(profile));
+ if (!cef::IsAlloyRuntimeEnabled()) {
+ privacy_sandbox_settings_observer_.Observe(
+ PrivacySandboxSettingsFactory::GetForProfile(profile));
+ }
DisableQuicIfNotAllowed();
@@ -304,7 +307,9 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
base::Unretained(this)));
#if BUILDFLAG(ENABLE_EXTENSIONS)
@ -21,7 +34,7 @@ index 8221b46c59df3..eca1b2040dd4c 100644
#endif
}
@@ -796,7 +799,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
@@ -796,7 +801,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
// Configure on-disk storage for non-OTR profiles. OTR profiles just use
// default behavior (in memory storage, default sizes).
@ -42,7 +55,7 @@ index 8221b46c59df3..eca1b2040dd4c 100644
PrefService* local_state = g_browser_process->local_state();
// Configure the HTTP cache path and size.
base::FilePath base_cache_path;
@@ -809,7 +824,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
@@ -809,7 +826,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
base_cache_path.Append(chrome::kCacheDirname);
network_context_params->http_cache_max_size =
local_state->GetInteger(prefs::kDiskCacheSize);
@ -52,6 +65,34 @@ index 8221b46c59df3..eca1b2040dd4c 100644
network_context_params->file_paths =
::network::mojom::NetworkContextFilePaths::New();
@@ -1009,6 +1028,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
network_context_params->require_network_isolation_key = true;
network_context_params->block_trust_tokens =
+ cef::IsAlloyRuntimeEnabled() ||
!PrivacySandboxSettingsFactory::GetForProfile(profile_)
->IsTrustTokensAllowed();
diff --git chrome/browser/signin/identity_manager_factory.cc chrome/browser/signin/identity_manager_factory.cc
index ff1d5b905b050..911e4b13f91e1 100644
--- chrome/browser/signin/identity_manager_factory.cc
+++ chrome/browser/signin/identity_manager_factory.cc
@@ -11,6 +11,7 @@
#include "base/observer_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/image_fetcher/image_decoder_impl.h"
#include "chrome/browser/profiles/profile.h"
@@ -82,6 +83,7 @@ IdentityManagerFactory::~IdentityManagerFactory() {
// static
signin::IdentityManager* IdentityManagerFactory::GetForProfile(
Profile* profile) {
+ DCHECK(!cef::IsAlloyRuntimeEnabled());
return static_cast<signin::IdentityManager*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc
index 13911f2bd786d..832308e34a303 100644
--- net/cookies/cookie_monster.cc