2023-01-30 18:43:54 +01:00
|
|
|
diff --git chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
|
|
|
|
index 53383355d6646..d7a713017e16d 100644
|
|
|
|
--- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
|
|
|
|
+++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc
|
|
|
|
@@ -23,6 +23,7 @@
|
|
|
|
#include "base/strings/utf_string_conversions.h"
|
|
|
|
#include "base/time/time.h"
|
|
|
|
#include "build/build_config.h"
|
|
|
|
+#include "cef/libcef/features/runtime.h"
|
|
|
|
#include "chrome/browser/browser_process.h"
|
|
|
|
#include "chrome/browser/enterprise/connectors/analysis/analysis_settings.h"
|
|
|
|
#include "chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h"
|
|
|
|
@@ -232,6 +233,9 @@ bool ContentAnalysisDelegate::IsEnabled(
|
|
|
|
GURL url,
|
|
|
|
Data* data,
|
|
|
|
enterprise_connectors::AnalysisConnector connector) {
|
|
|
|
+ if (cef::IsAlloyRuntimeEnabled())
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
auto* service =
|
|
|
|
enterprise_connectors::ConnectorsServiceFactory::GetForBrowserContext(
|
|
|
|
profile);
|
2019-04-24 04:50:25 +02:00
|
|
|
diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
index 99fb0211efd6b..5f4a4c2d7c977 100644
|
2019-04-24 04:50:25 +02:00
|
|
|
--- chrome/browser/net/profile_network_context_service.cc
|
|
|
|
+++ chrome/browser/net/profile_network_context_service.cc
|
2022-05-19 12:28:44 +02:00
|
|
|
@@ -22,6 +22,7 @@
|
|
|
|
#include "base/trace_event/trace_event.h"
|
2022-01-25 21:26:51 +01:00
|
|
|
#include "build/build_config.h"
|
2021-01-28 00:13:12 +01:00
|
|
|
#include "build/chromeos_buildflags.h"
|
2020-06-28 20:29:44 +02:00
|
|
|
+#include "cef/libcef/features/runtime.h"
|
2021-10-19 00:17:16 +02:00
|
|
|
#include "chrome/browser/browser_features.h"
|
2019-05-02 20:50:59 +02:00
|
|
|
#include "chrome/browser/browser_process.h"
|
2022-09-26 21:30:45 +02:00
|
|
|
#include "chrome/browser/chrome_content_browser_client.h"
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -283,8 +284,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
|
2023-01-06 18:06:46 +01:00
|
|
|
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();
|
|
|
|
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -324,7 +327,9 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
|
2023-01-05 19:55:00 +01:00
|
|
|
base::Unretained(this)));
|
|
|
|
|
|
|
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
|
|
|
- registry_observation_.Observe(extensions::ExtensionRegistry::Get(profile_));
|
|
|
|
+ if (auto extension_registry = extensions::ExtensionRegistry::Get(profile_)) {
|
|
|
|
+ registry_observation_.Observe(extension_registry);
|
|
|
|
+ }
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -828,7 +833,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// Configure on-disk storage for non-OTR profiles. OTR profiles just use
|
|
|
|
// default behavior (in memory storage, default sizes).
|
2020-06-25 04:34:12 +02:00
|
|
|
- if (!in_memory) {
|
2020-06-28 20:29:44 +02:00
|
|
|
+ if (!in_memory && cef::IsAlloyRuntimeEnabled()) {
|
2019-10-01 15:55:16 +02:00
|
|
|
+ PrefService* prefs = profile_->GetPrefs();
|
|
|
|
+ // Configure the HTTP cache path and size.
|
|
|
|
+ const base::FilePath& base_cache_path =
|
|
|
|
+ prefs->GetFilePath(prefs::kDiskCacheDir);
|
2019-05-02 20:50:59 +02:00
|
|
|
+ DCHECK(!base_cache_path.empty());
|
2022-04-21 20:58:48 +02:00
|
|
|
+ network_context_params->http_cache_directory =
|
2019-10-01 15:55:16 +02:00
|
|
|
+ base_cache_path.Append(chrome::kCacheDirname);
|
|
|
|
+ network_context_params->http_cache_max_size =
|
|
|
|
+ prefs->GetInteger(prefs::kDiskCacheSize);
|
2020-06-25 04:34:12 +02:00
|
|
|
+ }
|
|
|
|
+
|
2020-06-28 20:29:44 +02:00
|
|
|
+ if (!in_memory && !cef::IsAlloyRuntimeEnabled()) {
|
2019-10-01 15:55:16 +02:00
|
|
|
PrefService* local_state = g_browser_process->local_state();
|
|
|
|
// Configure the HTTP cache path and size.
|
|
|
|
base::FilePath base_cache_path;
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -841,7 +858,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
|
2022-02-21 23:23:40 +01:00
|
|
|
base_cache_path.Append(chrome::kCacheDirname);
|
|
|
|
network_context_params->http_cache_max_size =
|
|
|
|
local_state->GetInteger(prefs::kDiskCacheSize);
|
2020-06-25 04:34:12 +02:00
|
|
|
+ }
|
2019-10-01 15:55:16 +02:00
|
|
|
|
2020-06-25 04:34:12 +02:00
|
|
|
+ if (!in_memory) {
|
2021-09-20 11:06:23 +02:00
|
|
|
network_context_params->file_paths =
|
|
|
|
::network::mojom::NetworkContextFilePaths::New();
|
|
|
|
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -1039,6 +1058,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
|
2023-01-06 18:06:46 +01:00
|
|
|
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
|
2023-01-30 18:43:54 +01:00
|
|
|
index 0f92e4682eee9..ea6e6ed6f1e05 100644
|
2023-01-06 18:06:46 +01:00
|
|
|
--- 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));
|
|
|
|
}
|
2019-06-05 16:15:45 +02:00
|
|
|
diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
index 44f52e0c14355..6b380a5bfe3c8 100644
|
2019-06-05 16:15:45 +02:00
|
|
|
--- net/cookies/cookie_monster.cc
|
|
|
|
+++ net/cookies/cookie_monster.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -554,6 +554,25 @@ void CookieMonster::SetCookieableSchemes(
|
2019-06-05 16:15:45 +02:00
|
|
|
MaybeRunCookieCallback(std::move(callback), true);
|
|
|
|
}
|
|
|
|
|
|
|
|
+void CookieMonster::AddCookieableSchemes(
|
|
|
|
+ const std::vector<std::string>& schemes,
|
|
|
|
+ SetCookieableSchemesCallback callback) {
|
2022-10-17 19:27:40 +02:00
|
|
|
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
2019-06-05 16:15:45 +02:00
|
|
|
+
|
|
|
|
+ // Calls to this method will have no effect if made after a WebView or
|
|
|
|
+ // CookieManager instance has been created.
|
|
|
|
+ if (initialized_) {
|
|
|
|
+ MaybeRunCookieCallback(std::move(callback), false);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!schemes.empty()) {
|
|
|
|
+ cookieable_schemes_.insert(cookieable_schemes_.begin(), schemes.begin(),
|
|
|
|
+ schemes.end());
|
|
|
|
+ }
|
|
|
|
+ MaybeRunCookieCallback(std::move(callback), true);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
// This function must be called before the CookieMonster is used.
|
|
|
|
void CookieMonster::SetPersistSessionCookies(bool persist_session_cookies) {
|
2022-10-17 19:27:40 +02:00
|
|
|
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
2019-06-05 16:15:45 +02:00
|
|
|
diff --git net/cookies/cookie_monster.h net/cookies/cookie_monster.h
|
2023-01-30 18:43:54 +01:00
|
|
|
index 8a896a86b58b0..08077ffeebc3e 100644
|
2019-06-05 16:15:45 +02:00
|
|
|
--- net/cookies/cookie_monster.h
|
|
|
|
+++ net/cookies/cookie_monster.h
|
2022-11-15 18:50:53 +01:00
|
|
|
@@ -208,6 +208,8 @@ class NET_EXPORT CookieMonster : public CookieStore {
|
2019-06-05 16:15:45 +02:00
|
|
|
CookieChangeDispatcher& GetChangeDispatcher() override;
|
|
|
|
void SetCookieableSchemes(const std::vector<std::string>& schemes,
|
|
|
|
SetCookieableSchemesCallback callback) override;
|
|
|
|
+ void AddCookieableSchemes(const std::vector<std::string>& schemes,
|
|
|
|
+ SetCookieableSchemesCallback callback) override;
|
2022-11-15 18:50:53 +01:00
|
|
|
absl::optional<bool> SiteHasCookieInOtherPartition(
|
|
|
|
const net::SchemefulSite& site,
|
|
|
|
const absl::optional<CookiePartitionKey>& partition_key) const override;
|
2019-06-05 16:15:45 +02:00
|
|
|
diff --git net/cookies/cookie_store.h net/cookies/cookie_store.h
|
2023-01-30 18:43:54 +01:00
|
|
|
index 61fd008fc067e..73909be088278 100644
|
2019-06-05 16:15:45 +02:00
|
|
|
--- net/cookies/cookie_store.h
|
|
|
|
+++ net/cookies/cookie_store.h
|
2022-03-26 02:12:30 +01:00
|
|
|
@@ -163,6 +163,11 @@ class NET_EXPORT CookieStore {
|
2019-11-12 17:11:44 +01:00
|
|
|
// Transfer ownership of a CookieAccessDelegate.
|
|
|
|
void SetCookieAccessDelegate(std::unique_ptr<CookieAccessDelegate> delegate);
|
2019-06-05 16:15:45 +02:00
|
|
|
|
|
|
|
+ // Adds to the list of cookieable schemes. Does nothing if called after first
|
|
|
|
+ // use of the instance (i.e. after the instance initialization process).
|
|
|
|
+ virtual void AddCookieableSchemes(const std::vector<std::string>& schemes,
|
|
|
|
+ SetCookieableSchemesCallback callback) = 0;
|
|
|
|
+
|
2021-09-20 11:06:23 +02:00
|
|
|
// This may be null if no delegate has been set yet, or the delegate has been
|
|
|
|
// reset to null.
|
|
|
|
const CookieAccessDelegate* cookie_access_delegate() const {
|
2019-06-05 16:15:45 +02:00
|
|
|
diff --git services/network/cookie_manager.cc services/network/cookie_manager.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
index 5b4fe64a4374a..780c9726a03d3 100644
|
2019-06-05 16:15:45 +02:00
|
|
|
--- services/network/cookie_manager.cc
|
|
|
|
+++ services/network/cookie_manager.cc
|
2022-10-17 19:27:40 +02:00
|
|
|
@@ -283,14 +283,9 @@ void CookieManager::FlushCookieStore(FlushCookieStoreCallback callback) {
|
2019-06-05 16:15:45 +02:00
|
|
|
void CookieManager::AllowFileSchemeCookies(
|
|
|
|
bool allow,
|
|
|
|
AllowFileSchemeCookiesCallback callback) {
|
|
|
|
- std::vector<std::string> cookieable_schemes(
|
|
|
|
- net::CookieMonster::kDefaultCookieableSchemes,
|
|
|
|
- net::CookieMonster::kDefaultCookieableSchemes +
|
|
|
|
- net::CookieMonster::kDefaultCookieableSchemesCount);
|
|
|
|
- if (allow) {
|
|
|
|
- cookieable_schemes.push_back(url::kFileScheme);
|
|
|
|
- }
|
|
|
|
- cookie_store_->SetCookieableSchemes(cookieable_schemes, std::move(callback));
|
|
|
|
+ if (!allow)
|
|
|
|
+ return;
|
|
|
|
+ cookie_store_->AddCookieableSchemes({url::kFileScheme}, std::move(callback));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CookieManager::SetForceKeepSessionState() {
|
2019-04-24 04:50:25 +02:00
|
|
|
diff --git services/network/network_context.cc services/network/network_context.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
index 47bba434b56d8..92060d40e0a84 100644
|
2019-04-24 04:50:25 +02:00
|
|
|
--- services/network/network_context.cc
|
|
|
|
+++ services/network/network_context.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -2252,16 +2252,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
2020-12-02 23:31:49 +01:00
|
|
|
network_service_->network_quality_estimator());
|
2019-04-24 04:50:25 +02:00
|
|
|
}
|
|
|
|
|
2022-01-25 21:26:51 +01:00
|
|
|
- if (session_cleanup_cookie_store) {
|
2019-04-24 04:50:25 +02:00
|
|
|
- std::unique_ptr<net::CookieMonster> cookie_store =
|
2022-10-17 19:27:40 +02:00
|
|
|
- std::make_unique<net::CookieMonster>(session_cleanup_cookie_store.get(),
|
|
|
|
- net_log);
|
2022-01-25 21:26:51 +01:00
|
|
|
- if (params_->persist_session_cookies)
|
|
|
|
- cookie_store->SetPersistSessionCookies(true);
|
|
|
|
+ std::unique_ptr<net::CookieMonster> cookie_store =
|
2022-10-17 19:27:40 +02:00
|
|
|
+ std::make_unique<net::CookieMonster>(session_cleanup_cookie_store.get(),
|
|
|
|
+ net_log);
|
2022-01-25 21:26:51 +01:00
|
|
|
+ if (session_cleanup_cookie_store && params_->persist_session_cookies)
|
|
|
|
+ cookie_store->SetPersistSessionCookies(true);
|
2020-12-02 23:31:49 +01:00
|
|
|
|
2019-10-01 15:55:16 +02:00
|
|
|
- builder.SetCookieStore(std::move(cookie_store));
|
2019-05-03 00:23:57 +02:00
|
|
|
+ if (params_->cookieable_schemes.has_value()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
+ cookie_store->SetCookieableSchemes(
|
2019-05-03 00:23:57 +02:00
|
|
|
+ *params_->cookieable_schemes,
|
2019-04-24 04:50:25 +02:00
|
|
|
+ net::CookieStore::SetCookieableSchemesCallback());
|
2020-03-30 22:13:42 +02:00
|
|
|
}
|
|
|
|
|
2019-10-01 15:55:16 +02:00
|
|
|
+ builder.SetCookieStore(std::move(cookie_store));
|
2019-04-24 04:50:25 +02:00
|
|
|
+
|
2023-01-03 00:34:43 +01:00
|
|
|
if (base::FeatureList::IsEnabled(features::kPrivateStateTokens)) {
|
2020-04-14 21:31:00 +02:00
|
|
|
trust_token_store_ = std::make_unique<PendingTrustTokenStore>();
|
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom
|
2023-01-30 18:43:54 +01:00
|
|
|
index b2254b765c313..9d7da9a963f40 100644
|
2019-04-24 04:50:25 +02:00
|
|
|
--- services/network/public/mojom/network_context.mojom
|
|
|
|
+++ services/network/public/mojom/network_context.mojom
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -347,6 +347,9 @@ struct NetworkContextParams {
|
2019-04-24 04:50:25 +02:00
|
|
|
// cookies. Otherwise it should be false.
|
|
|
|
bool persist_session_cookies = false;
|
|
|
|
|
|
|
|
+ // Schemes that will be passed to CookieMonster::SetCookieableSchemes.
|
2019-05-03 00:23:57 +02:00
|
|
|
+ array<string>? cookieable_schemes;
|
2019-04-24 04:50:25 +02:00
|
|
|
+
|
|
|
|
// True if an HTTP cache should be used.
|
|
|
|
bool http_cache_enabled = true;
|
|
|
|
// Maximum size of the HTTP cache. 0 means to use the default size.
|