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
|
2024-04-30 03:09:17 +02:00
|
|
|
index 3a8e63a3bcbdd..3fded53efc474 100644
|
2023-01-30 18:43:54 +01:00
|
|
|
--- 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"
|
2024-04-30 03:09:17 +02:00
|
|
|
@@ -357,6 +358,11 @@ bool ContentAnalysisDelegate::IsEnabled(Profile* profile,
|
2023-05-30 10:55:32 +02:00
|
|
|
GURL url,
|
|
|
|
Data* data,
|
|
|
|
AnalysisConnector connector) {
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2023-01-30 18:43:54 +01:00
|
|
|
+ if (cef::IsAlloyRuntimeEnabled())
|
|
|
|
+ return false;
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
2023-01-30 18:43:54 +01:00
|
|
|
+
|
2023-05-30 10:55:32 +02:00
|
|
|
auto* service = ConnectorsServiceFactory::GetForBrowserContext(profile);
|
|
|
|
// If the corresponding Connector policy isn't set, don't perform scans.
|
|
|
|
if (!service || !service->IsConnectorEnabled(connector))
|
2024-02-13 21:34:50 +01:00
|
|
|
diff --git chrome/browser/first_party_sets/first_party_sets_policy_service.cc chrome/browser/first_party_sets/first_party_sets_policy_service.cc
|
2024-04-23 22:06:00 +02:00
|
|
|
index e6d8a41c10f3a..18df8a6311d0a 100644
|
2024-02-13 21:34:50 +01:00
|
|
|
--- chrome/browser/first_party_sets/first_party_sets_policy_service.cc
|
|
|
|
+++ chrome/browser/first_party_sets/first_party_sets_policy_service.cc
|
|
|
|
@@ -275,6 +275,12 @@ void FirstPartySetsPolicyService::OnProfileConfigReady(
|
|
|
|
|
|
|
|
// Representation of the current profile to be persisted on disk.
|
|
|
|
const std::string browser_context_id = profile->GetBaseName().AsUTF8Unsafe();
|
|
|
|
+ if (browser_context_id.empty()) {
|
|
|
|
+ // CEF/Alloy incognito profiles have empty cache path.
|
|
|
|
+ OnReadyToNotifyDelegates(std::move(config),
|
|
|
|
+ net::FirstPartySetsCacheFilter());
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
base::RepeatingCallback<content::BrowserContext*()> browser_context_getter =
|
|
|
|
base::BindRepeating(
|
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
|
2024-04-30 03:09:17 +02:00
|
|
|
index 77d18bd28eeaf..395c62cc348df 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
|
2024-04-23 22:06:00 +02:00
|
|
|
@@ -25,6 +25,7 @@
|
2022-05-19 12:28:44 +02:00
|
|
|
#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"
|
2023-04-04 20:00:13 +02:00
|
|
|
#include "chrome/browser/content_settings/cookie_settings_factory.h"
|
2024-04-30 03:09:17 +02:00
|
|
|
@@ -266,9 +267,16 @@ void UpdateCookieSettings(Profile* profile, ContentSettingsType type) {
|
2024-04-23 22:06:00 +02:00
|
|
|
// occurs in this class is unsynchronized, so it would be racy to rely on
|
|
|
|
// this update finishing before calling the context's callback.) This
|
|
|
|
// unfortunately triggers a double-update here.
|
|
|
|
- if (FederatedIdentityPermissionContext* fedcm_context =
|
|
|
|
- FederatedIdentityPermissionContextFactory::GetForProfile(profile);
|
|
|
|
- fedcm_context) {
|
|
|
|
+ FederatedIdentityPermissionContext* fedcm_context = nullptr;
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2024-04-23 22:06:00 +02:00
|
|
|
+ if (!cef::IsAlloyRuntimeEnabled()) {
|
2024-04-30 03:09:17 +02:00
|
|
|
+ #endif
|
2024-04-23 22:06:00 +02:00
|
|
|
+ fedcm_context =
|
|
|
|
+ FederatedIdentityPermissionContextFactory::GetForProfile(profile);
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2024-04-23 22:06:00 +02:00
|
|
|
+ }
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
2024-04-23 22:06:00 +02:00
|
|
|
+ if (fedcm_context) {
|
|
|
|
settings = fedcm_context->GetSharingPermissionGrantsAsContentSettings();
|
|
|
|
}
|
|
|
|
} else {
|
2024-04-30 03:09:17 +02:00
|
|
|
@@ -323,8 +331,14 @@ 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));
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2023-01-06 18:06:46 +01:00
|
|
|
+ if (!cef::IsAlloyRuntimeEnabled()) {
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
2023-01-06 18:06:46 +01:00
|
|
|
+ privacy_sandbox_settings_observer_.Observe(
|
|
|
|
+ PrivacySandboxSettingsFactory::GetForProfile(profile));
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2023-01-06 18:06:46 +01:00
|
|
|
+ }
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
2023-01-06 18:06:46 +01:00
|
|
|
|
|
|
|
DisableQuicIfNotAllowed();
|
|
|
|
|
2024-04-30 03:09:17 +02:00
|
|
|
@@ -826,9 +840,16 @@ ProfileNetworkContextService::CreateCookieManagerParams(
|
2024-04-23 22:06:00 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (type == ContentSettingsType::FEDERATED_IDENTITY_SHARING) {
|
|
|
|
- if (FederatedIdentityPermissionContext* fedcm_context =
|
|
|
|
- FederatedIdentityPermissionContextFactory::GetForProfile(profile);
|
|
|
|
- fedcm_context) {
|
|
|
|
+ FederatedIdentityPermissionContext* fedcm_context = nullptr;
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2024-04-23 22:06:00 +02:00
|
|
|
+ if (!cef::IsAlloyRuntimeEnabled()) {
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
2024-04-23 22:06:00 +02:00
|
|
|
+ fedcm_context =
|
|
|
|
+ FederatedIdentityPermissionContextFactory::GetForProfile(profile);
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2024-04-23 22:06:00 +02:00
|
|
|
+ }
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
2024-04-23 22:06:00 +02:00
|
|
|
+ if (fedcm_context) {
|
|
|
|
out->content_settings[type] =
|
|
|
|
fedcm_context->GetSharingPermissionGrantsAsContentSettings();
|
|
|
|
} else {
|
2024-04-30 03:09:17 +02:00
|
|
|
@@ -1082,9 +1103,32 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
|
2023-07-21 00:11:34 +02:00
|
|
|
network_context_params->cookie_manager_params =
|
|
|
|
CreateCookieManagerParams(profile_, *cookie_settings_);
|
2019-04-24 04:50:25 +02:00
|
|
|
|
2023-07-21 00:11:34 +02:00
|
|
|
+ if (!in_memory) {
|
|
|
|
+ network_context_params->file_paths =
|
|
|
|
+ ::network::mojom::NetworkContextFilePaths::New();
|
|
|
|
+ }
|
|
|
|
+
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
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());
|
2023-07-21 00:11:34 +02:00
|
|
|
+ network_context_params->file_paths->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
|
|
|
+ }
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif // BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2020-06-25 04:34:12 +02:00
|
|
|
+
|
2024-04-30 03:09:17 +02:00
|
|
|
+ if (!in_memory
|
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
|
|
|
+ && !cef::IsAlloyRuntimeEnabled()
|
|
|
|
+#endif
|
|
|
|
+ ) {
|
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;
|
2024-04-30 03:09:17 +02:00
|
|
|
@@ -1093,15 +1137,14 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
|
2023-07-21 00:11:34 +02:00
|
|
|
local_state->GetFilePath(prefs::kDiskCacheDir);
|
|
|
|
if (!disk_cache_dir.empty())
|
|
|
|
base_cache_path = disk_cache_dir.Append(base_cache_path.BaseName());
|
|
|
|
+ network_context_params->file_paths->http_cache_directory =
|
|
|
|
+ base_cache_path.Append(chrome::kCacheDirname);
|
2023-06-26 12:13:38 +02:00
|
|
|
const int disk_cache_size = local_state->GetInteger(prefs::kDiskCacheSize);
|
|
|
|
network_context_params->http_cache_max_size = disk_cache_size;
|
|
|
|
network_context_params->shared_dictionary_cache_max_size = disk_cache_size;
|
2020-06-25 04:34:12 +02:00
|
|
|
+ }
|
2019-10-01 15:55:16 +02:00
|
|
|
|
2023-07-21 00:11:34 +02:00
|
|
|
- network_context_params->file_paths =
|
|
|
|
- ::network::mojom::NetworkContextFilePaths::New();
|
|
|
|
-
|
|
|
|
- network_context_params->file_paths->http_cache_directory =
|
|
|
|
- base_cache_path.Append(chrome::kCacheDirname);
|
2020-06-25 04:34:12 +02:00
|
|
|
+ if (!in_memory) {
|
2023-07-21 00:11:34 +02:00
|
|
|
network_context_params->file_paths->data_directory =
|
|
|
|
path.Append(chrome::kNetworkDataDirname);
|
|
|
|
network_context_params->file_paths->unsandboxed_data_path = path;
|
2024-04-30 03:09:17 +02:00
|
|
|
@@ -1276,6 +1319,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
|
2023-10-19 20:08:48 +02:00
|
|
|
network_context_params->first_party_sets_access_delegate_params =
|
|
|
|
network::mojom::FirstPartySetsAccessDelegateParams::New();
|
|
|
|
network_context_params->first_party_sets_access_delegate_params->enabled =
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2024-02-13 21:34:50 +01:00
|
|
|
+ cef::IsAlloyRuntimeEnabled() ? false :
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
2024-02-13 21:34:50 +01:00
|
|
|
PrivacySandboxSettingsFactory::GetForProfile(profile_)
|
|
|
|
->AreRelatedWebsiteSetsEnabled();
|
2023-10-19 20:08:48 +02:00
|
|
|
|
|
|
|
diff --git chrome/browser/net/profile_network_context_service_factory.cc chrome/browser/net/profile_network_context_service_factory.cc
|
2024-04-30 03:09:17 +02:00
|
|
|
index 14ac2ce8b90c5..c22f8a7a57c69 100644
|
2023-10-19 20:08:48 +02:00
|
|
|
--- chrome/browser/net/profile_network_context_service_factory.cc
|
|
|
|
+++ chrome/browser/net/profile_network_context_service_factory.cc
|
|
|
|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
|
|
#include "build/build_config.h"
|
|
|
|
#include "build/chromeos_buildflags.h"
|
|
|
|
+#include "cef/libcef/features/runtime.h"
|
|
|
|
#include "chrome/browser/first_party_sets/first_party_sets_policy_service_factory.h"
|
|
|
|
#include "chrome/browser/net/profile_network_context_service.h"
|
|
|
|
#include "chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.h"
|
2024-04-30 03:09:17 +02:00
|
|
|
@@ -52,8 +53,14 @@ ProfileNetworkContextServiceFactory::ProfileNetworkContextServiceFactory()
|
|
|
|
#endif
|
2023-10-19 20:08:48 +02:00
|
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
|
|
|
DependsOn(chromeos::CertificateProviderServiceFactory::GetInstance());
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2023-10-19 20:08:48 +02:00
|
|
|
+ if (!cef::IsAlloyRuntimeEnabled()) {
|
2024-04-30 03:09:17 +02:00
|
|
|
#endif
|
2023-10-19 20:08:48 +02:00
|
|
|
DependsOn(PrivacySandboxSettingsFactory::GetInstance());
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2024-02-13 21:34:50 +01:00
|
|
|
+ }
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
2023-10-19 20:08:48 +02:00
|
|
|
DependsOn(
|
|
|
|
first_party_sets::FirstPartySetsPolicyServiceFactory::GetInstance());
|
|
|
|
}
|
2023-01-06 18:06:46 +01:00
|
|
|
diff --git chrome/browser/signin/identity_manager_factory.cc chrome/browser/signin/identity_manager_factory.cc
|
2024-04-30 03:09:17 +02:00
|
|
|
index a635c32482ce0..e478ee670c239 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"
|
2024-04-30 03:09:17 +02:00
|
|
|
@@ -97,6 +98,9 @@ IdentityManagerFactory::~IdentityManagerFactory() {
|
2023-01-06 18:06:46 +01:00
|
|
|
// static
|
|
|
|
signin::IdentityManager* IdentityManagerFactory::GetForProfile(
|
|
|
|
Profile* profile) {
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2023-01-06 18:06:46 +01:00
|
|
|
+ DCHECK(!cef::IsAlloyRuntimeEnabled());
|
2024-04-30 03:09:17 +02:00
|
|
|
+#endif
|
2023-01-06 18:06:46 +01:00
|
|
|
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
|
2024-04-23 22:06:00 +02:00
|
|
|
index f59e2c8fa8d92..f31ad539a8b36 100644
|
2019-06-05 16:15:45 +02:00
|
|
|
--- net/cookies/cookie_monster.cc
|
|
|
|
+++ net/cookies/cookie_monster.cc
|
2024-04-23 22:06:00 +02:00
|
|
|
@@ -630,6 +630,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
|
2024-04-23 22:06:00 +02:00
|
|
|
index e302feb355db4..98449151f2d52 100644
|
2019-06-05 16:15:45 +02:00
|
|
|
--- net/cookies/cookie_monster.h
|
|
|
|
+++ net/cookies/cookie_monster.h
|
2024-03-19 22:11:42 +01:00
|
|
|
@@ -209,6 +209,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;
|
2024-02-22 19:36:15 +01:00
|
|
|
std::optional<bool> SiteHasCookieInOtherPartition(
|
2022-11-15 18:50:53 +01:00
|
|
|
const net::SchemefulSite& site,
|
2024-02-22 19:36:15 +01:00
|
|
|
const std::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
|
2024-02-22 19:36:15 +01:00
|
|
|
index 3f0be99e0e145..0462ebbe9bedc 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
|
2024-04-23 22:06:00 +02:00
|
|
|
index c251939593cd2..d54817a03066c 100644
|
2019-06-05 16:15:45 +02:00
|
|
|
--- services/network/cookie_manager.cc
|
|
|
|
+++ services/network/cookie_manager.cc
|
2024-04-23 22:06:00 +02:00
|
|
|
@@ -313,14 +313,9 @@ void CookieManager::AllowFileSchemeCookies(
|
2019-06-05 16:15:45 +02:00
|
|
|
AllowFileSchemeCookiesCallback callback) {
|
2023-07-21 00:11:34 +02:00
|
|
|
OnSettingsWillChange();
|
|
|
|
|
2019-06-05 16:15:45 +02:00
|
|
|
- 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
|
2024-04-23 22:06:00 +02:00
|
|
|
index 5fb60171d3fa8..97e0446856491 100644
|
2019-04-24 04:50:25 +02:00
|
|
|
--- services/network/network_context.cc
|
|
|
|
+++ services/network/network_context.cc
|
2024-04-23 22:06:00 +02:00
|
|
|
@@ -2424,16 +2424,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-04-26 21:55:59 +02:00
|
|
|
if (base::FeatureList::IsEnabled(features::kPrivateStateTokens) ||
|
|
|
|
base::FeatureList::IsEnabled(features::kFledgePst)) {
|
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
|
2024-04-23 22:06:00 +02:00
|
|
|
index 96943808c6290..c61de0ffd1c4d 100644
|
2019-04-24 04:50:25 +02:00
|
|
|
--- services/network/public/mojom/network_context.mojom
|
|
|
|
+++ services/network/public/mojom/network_context.mojom
|
2024-02-22 19:36:15 +01:00
|
|
|
@@ -359,6 +359,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.
|