0

Move permissions_policy.cc-used feature flags to the Network service

Permissions Policy code is being moved to the Network service so these
flags need to move as well.

Bug: 382291442
Low-Coverage-Reason: LARGE_SCALE_REFACTOR
Change-Id: I2d6135ef1350f21e08de9053c69c762bfb1fd7ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6287505
Owners-Override: Rick Byers <rbyers@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426039}
This commit is contained in:
Sandor Major
2025-02-27 16:12:04 -08:00
committed by Chromium LUCI CQ
parent 742a8664e7
commit f42e6bd64c
78 changed files with 416 additions and 346 deletions
android_webview/browser
chrome
components
content
services/network
third_party/blink
common
public
renderer
core
platform
tools
blinkpy

@ -131,7 +131,7 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
blink::features::kLowLatencyWebGLImageChromium);
// Disable Shared Storage on WebView.
aw_feature_overrides.DisableFeature(blink::features::kSharedStorageAPI);
aw_feature_overrides.DisableFeature(network::features::kSharedStorageAPI);
// Disable scrollbar-color on WebView.
aw_feature_overrides.DisableFeature(blink::features::kScrollbarColor);
@ -306,7 +306,7 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
base::features::kPartitionAllocMemoryTagging);
// Disable Topics on WebView.
aw_feature_overrides.DisableFeature(blink::features::kBrowsingTopics);
aw_feature_overrides.DisableFeature(network::features::kBrowsingTopics);
// Sharing ANGLE's Vulkan queue is not supported on WebView.
aw_feature_overrides.DisableFeature(::features::kVulkanFromANGLE);

@ -90,6 +90,7 @@
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/network/public/cpp/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
@ -2338,7 +2339,7 @@ class AutofillInteractiveFencedFrameTest
std::vector<base::test::FeatureRefAndParams> enabled;
std::vector<base::test::FeatureRef> disabled;
if (GetParam() != FrameType::kIFrame) {
enabled.push_back({blink::features::kBrowsingTopics, {}});
enabled.push_back({network::features::kBrowsingTopics, {}});
enabled.push_back({blink::features::kFencedFramesAPIChanges, {}});
scoped_feature_list_.InitWithFeaturesAndParameters(enabled, disabled);
fenced_frame_test_helper_ =

@ -486,13 +486,13 @@ class BrowsingDataModelBrowserTest
{features::kPrivacySandboxAdsAPIsOverride, {}},
{features::kIsolatedWebApps, {}},
{features::kIsolatedWebAppDevMode, {}},
{blink::features::kSharedStorageAPI, {}},
{blink::features::kInterestGroupStorage, {}},
{network::features::kSharedStorageAPI, {}},
{network::features::kInterestGroupStorage, {}},
{blink::features::kPrivateAggregationApi, {}},
{blink::features::kAdInterestGroupAPI, {}},
{blink::features::kFledge, {}},
{blink::features::kFencedFrames, {}},
{blink::features::kBrowsingTopics, {}},
{network::features::kBrowsingTopics, {}},
{net::features::kThirdPartyStoragePartitioning, {}},
{network::features::kCompressionDictionaryTransportBackend, {}},
{network::features::kCompressionDictionaryTransport, {}},

@ -28,6 +28,7 @@
#include "content/public/test/browsing_topics_test_util.h"
#include "content/public/test/fenced_frame_test_util.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/re2/src/re2/re2.h"
#include "ui/base/l10n/l10n_util.h"
@ -349,7 +350,7 @@ class BrowsingTopicsDisabledInternalsBrowserTest
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{},
/*disabled_features=*/{
blink::features::kBrowsingTopics,
network::features::kBrowsingTopics,
blink::features::kBrowsingTopicsParameters,
features::kPrivacySandboxAdsAPIsOverride,
});
@ -427,7 +428,7 @@ class BrowsingTopicsInternalsBrowserTest
{{blink::features::kBrowsingTopicsParameters,
{{"number_of_top_topics_per_epoch", "2"},
{"time_period_per_epoch", "15s"}}},
{blink::features::kBrowsingTopics, {}},
{network::features::kBrowsingTopics, {}},
{features::kPrivacySandboxAdsAPIsOverride, {}},
{privacy_sandbox::kPrivacySandboxSettings4,
{{"consent-required", "true"}}}},

@ -49,6 +49,7 @@
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/network/public/cpp/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/features.h"
@ -264,7 +265,7 @@ class BrowsingTopicsDisabledBrowserTest : public BrowsingTopicsBrowserTestBase {
BrowsingTopicsDisabledBrowserTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{},
/*disabled_features=*/{blink::features::kBrowsingTopics});
/*disabled_features=*/{network::features::kBrowsingTopics});
}
protected:
@ -294,7 +295,7 @@ class BrowsingTopicsAnnotationGoldenDataBrowserTest
BrowsingTopicsAnnotationGoldenDataBrowserTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/
{blink::features::kBrowsingTopics,
{network::features::kBrowsingTopics,
blink::features::kBrowsingTopicsBypassIPIsPubliclyRoutableCheck,
features::kPrivacySandboxAdsAPIsOverride},
/*disabled_features=*/{
@ -386,7 +387,7 @@ class BrowsingTopicsBrowserTest : public BrowsingTopicsBrowserTestBase {
// during tests where expiration is irrelevant.
scoped_feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"epoch_retention_duration", "3650000d"}}},
{blink::features::kBrowsingTopicsBypassIPIsPubliclyRoutableCheck, {}},

@ -24,6 +24,7 @@
#include "components/privacy_sandbox/privacy_sandbox_settings.h"
#include "content/public/browser/browsing_topics_site_data_manager.h"
#include "content/public/browser/storage_partition.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
@ -69,8 +70,9 @@ BrowsingTopicsServiceFactory::~BrowsingTopicsServiceFactory() = default;
std::unique_ptr<KeyedService>
BrowsingTopicsServiceFactory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const {
if (!base::FeatureList::IsEnabled(blink::features::kBrowsingTopics))
if (!base::FeatureList::IsEnabled(network::features::kBrowsingTopics)) {
return nullptr;
}
Profile* profile = Profile::FromBrowserContext(context);

@ -267,7 +267,7 @@ class DeclarativeNetRequestBrowserTest
DeclarativeNetRequestBrowserTest() {
feature_list_.InitWithFeatures(
/*enabled_features=*/
{blink::features::kInterestGroupStorage,
{network::features::kInterestGroupStorage,
blink::features::kAdInterestGroupAPI, blink::features::kFledge,
blink::features::kFencedFrames,
blink::features::kFencedFramesAPIChanges,

@ -24,6 +24,7 @@
#include "content/public/test/browser_test_utils.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
namespace interest_group {
@ -34,7 +35,7 @@ class InterestGroupPermissionsBrowserTest
InterestGroupPermissionsBrowserTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/
{blink::features::kInterestGroupStorage,
{network::features::kInterestGroupStorage,
blink::features::kAdInterestGroupAPI, blink::features::kFledge,
features::kPrivacySandboxAdsAPIsOverride},
/*disabled_features=*/
@ -217,7 +218,7 @@ class InterestGroupOffBrowserTest : public InterestGroupPermissionsBrowserTest {
public:
InterestGroupOffBrowserTest() {
scoped_feature_list_.InitWithFeatures(
{blink::features::kInterestGroupStorage},
{network::features::kInterestGroupStorage},
{blink::features::kAdInterestGroupAPI, blink::features::kFledge,
blink::features::kParakeet, features::kPrivacySandboxAdsAPIsOverride});
}
@ -239,7 +240,7 @@ class InterestGroupFledgeOnBrowserTest
public:
InterestGroupFledgeOnBrowserTest() {
scoped_feature_list_.InitWithFeatures(
{blink::features::kInterestGroupStorage, blink::features::kFledge,
{network::features::kInterestGroupStorage, blink::features::kFledge,
features::kPrivacySandboxAdsAPIsOverride},
{blink::features::kAdInterestGroupAPI, blink::features::kParakeet});
}
@ -262,7 +263,7 @@ class InterestGroupParakeetOnBrowserTest
public:
InterestGroupParakeetOnBrowserTest() {
scoped_feature_list_.InitWithFeatures(
{blink::features::kInterestGroupStorage, blink::features::kParakeet},
{network::features::kInterestGroupStorage, blink::features::kParakeet},
{blink::features::kAdInterestGroupAPI, blink::features::kFledge,
features::kPrivacySandboxAdsAPIsOverride});
}
@ -286,7 +287,7 @@ class InterestGroupAPIOnBrowserTest
public:
InterestGroupAPIOnBrowserTest() {
scoped_feature_list_.InitWithFeatures(
{blink::features::kInterestGroupStorage,
{network::features::kInterestGroupStorage,
blink::features::kAdInterestGroupAPI},
{blink::features::kParakeet, blink::features::kFledge,
features::kPrivacySandboxAdsAPIsOverride});
@ -381,7 +382,7 @@ class FledgePermissionBrowserTestBaseFeatureDisabled
FledgePermissionBrowserTestBaseFeatureDisabled() {
scoped_feature_list_.Reset();
scoped_feature_list_.InitAndDisableFeature(
blink::features::kInterestGroupStorage);
network::features::kInterestGroupStorage);
}
};

@ -40,6 +40,7 @@
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/fenced_frame/fenced_frame_utils.h"
@ -873,7 +874,7 @@ class PrivacySandboxSettingsAttestProtectedAudienceBrowserTest
PrivacySandboxSettingsAttestProtectedAudienceBrowserTest() {
feature_list_.InitWithFeatures(
/*enabled_features=*/
{blink::features::kInterestGroupStorage,
{network::features::kInterestGroupStorage,
blink::features::kAdInterestGroupAPI, blink::features::kFledge,
blink::features::kFledgeBiddingAndAuctionServer,
blink::features::kFencedFrames,

@ -195,7 +195,7 @@ class ProfileKeyedServiceBrowserTest : public InProcessBrowserTest {
features::kEnableCertManagementUIV2Write,
#endif
autofill::features::kAutofillAiWithDataSchema,
blink::features::kBrowsingTopics,
network::features::kBrowsingTopics,
blink::features::kBuiltInAIAPI,
extensions_features::kForceWebRequestProxyForTest,
net::features::kTopLevelTpcdOriginTrial,

@ -67,6 +67,7 @@
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "services/network/public/cpp/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
@ -399,7 +400,7 @@ class SharedStorageChromeBrowserTestBase : public PlatformBrowserTest {
base::test::TaskEnvironment task_environment;
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{blink::features::kSharedStorageAPI,
/*enabled_features=*/{network::features::kSharedStorageAPI,
features::kPrivacySandboxAdsAPIsOverride,
privacy_sandbox::
kOverridePrivacySandboxSettingsLocalTesting},
@ -823,7 +824,7 @@ class SharedStoragePrefBrowserTest
params["ExposeDebugMessageForSettingsStatus"] =
base::ToString(EnableDebugMessages());
shared_storage_feature_.InitAndEnableFeatureWithParameters(
blink::features::kSharedStorageAPI, params);
network::features::kSharedStorageAPI, params);
fenced_frame_api_change_feature_.InitWithFeatureState(
blink::features::kFencedFramesAPIChanges, ResolveSelectURLToConfig());
fenced_frame_feature_.InitAndEnableFeature(blink::features::kFencedFrames);
@ -4215,7 +4216,7 @@ class SharedStorageFencedFrameChromeBrowserTest
shared_storage_feature_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kSharedStorageAPI,
{{network::features::kSharedStorageAPI,
{{"SharedStorageBitBudget", base::NumberToString(kBudgetAllowed)}}}},
/*disabled_features=*/{});
@ -5123,7 +5124,7 @@ class SharedStorageExtensionBrowserTest
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/
{blink::features::kSharedStorageAPI,
{network::features::kSharedStorageAPI,
features::kPrivacySandboxAdsAPIsOverride,
privacy_sandbox::kOverridePrivacySandboxSettingsLocalTesting,
blink::features::kFencedFrames,

@ -49,6 +49,7 @@
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/dns/mock_host_resolver.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/interaction/element_tracker.h"
@ -685,7 +686,7 @@ class PageSpecificSiteDataDialogPrivacySandboxInteractiveUiTest
protected:
void SetUpFeatureList() override {
feature_list_.InitWithFeatures(
{blink::features::kSharedStorageAPI, blink::features::kFencedFrames,
{network::features::kSharedStorageAPI, blink::features::kFencedFrames,
features::kPrivacySandboxAdsAPIsOverride},
{});
}

@ -12,6 +12,7 @@
#include "components/browsing_topics/mojom/browsing_topics_internals.mojom.h"
#include "components/privacy_sandbox/privacy_sandbox_features.h"
#include "content/public/common/content_features.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
BrowsingTopicsInternalsPageHandler::BrowsingTopicsInternalsPageHandler(
@ -26,7 +27,7 @@ void BrowsingTopicsInternalsPageHandler::GetBrowsingTopicsConfiguration(
browsing_topics::mojom::PageHandler::GetBrowsingTopicsConfigurationCallback
callback) {
auto config = browsing_topics::mojom::WebUIBrowsingTopicsConfiguration::New(
base::FeatureList::IsEnabled(blink::features::kBrowsingTopics),
base::FeatureList::IsEnabled(network::features::kBrowsingTopics),
base::FeatureList::IsEnabled(features::kPrivacySandboxAdsAPIsOverride),
base::FeatureList::IsEnabled(
privacy_sandbox::kOverridePrivacySandboxSettingsLocalTesting),

@ -23,6 +23,7 @@
#include "content/public/test/test_navigation_observer.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
using content::WebContents;
@ -147,7 +148,7 @@ class InspectUISharedStorageTest : public InspectUITest {
public:
InspectUISharedStorageTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{blink::features::kSharedStorageAPI,
/*enabled_features=*/{network::features::kSharedStorageAPI,
features::kPrivacySandboxAdsAPIsOverride,
privacy_sandbox::
kOverridePrivacySandboxSettingsLocalTesting},

@ -999,11 +999,11 @@ bool BrowsingDataModel::IsBlockedByThirdPartyCookieBlocking(
void BrowsingDataModel::PopulateFromDisk(base::OnceClosure finished_callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
bool is_shared_storage_enabled =
base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI);
base::FeatureList::IsEnabled(network::features::kSharedStorageAPI);
bool is_shared_dictionary_enabled = base::FeatureList::IsEnabled(
network::features::kCompressionDictionaryTransportBackend);
bool is_interest_group_enabled =
base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage);
base::FeatureList::IsEnabled(network::features::kInterestGroupStorage);
bool is_attribution_reporting_enabled = base::FeatureList::IsEnabled(
attribution_reporting::features::kConversionMeasurement);
bool is_private_aggregation_enabled =

@ -10,6 +10,7 @@ include_rules = [
"+crypto",
"+net/base/registry_controlled_domains",
"+services/metrics/public/cpp",
"+services/network/public/cpp/features.h",
"+services/network/public/cpp/permissions_policy",
"+services/network/public/mojom/permissions_policy",
"+third_party/blink/public",

@ -24,6 +24,7 @@
#include "content/test/test_render_view_host.h"
#include "services/metrics/public/cpp/metrics_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/permissions_policy/origin_with_possible_wildcards.h"
#include "services/network/public/cpp/permissions_policy/permissions_policy_declaration.h"
#include "services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom-shared.h"
@ -35,7 +36,7 @@ class BrowsingTopicsPageLoadDataTrackerTest
public:
BrowsingTopicsPageLoadDataTrackerTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{blink::features::kBrowsingTopics},
/*enabled_features=*/{network::features::kBrowsingTopics},
/*disabled_features=*/{});
EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());

@ -7,6 +7,7 @@
#include "base/containers/contains.h"
#include "components/browsing_topics/browsing_topics_page_load_data_tracker.h"
#include "content/public/browser/navigation_handle.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
namespace browsing_topics {
@ -14,7 +15,7 @@ namespace browsing_topics {
// static
void BrowsingTopicsRedirectObserver::MaybeCreateForWebContents(
content::WebContents* web_contents) {
if (!base::FeatureList::IsEnabled(blink::features::kBrowsingTopics)) {
if (!base::FeatureList::IsEnabled(network::features::kBrowsingTopics)) {
return;
}

@ -15,6 +15,7 @@
#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "content/test/test_render_view_host.h"
#include "services/network/public/cpp/features.h"
namespace browsing_topics {
@ -23,7 +24,7 @@ class BrowsingTopicsRedirectObserverTest
public:
BrowsingTopicsRedirectObserverTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{blink::features::kBrowsingTopics},
/*enabled_features=*/{network::features::kBrowsingTopics},
/*disabled_features=*/{});
}

@ -40,6 +40,7 @@
#include "content/public/test/web_contents_tester.h"
#include "content/test/test_render_view_host.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/mojom/browsing_topics/browsing_topics.mojom.h"
namespace browsing_topics {
@ -183,7 +184,7 @@ class BrowsingTopicsServiceImplTest
// during tests where expiration is irrelevant.
scoped_feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"time_period_per_epoch",
base::StrCat({base::NumberToString(kEpoch.InSeconds()), "s"})},
@ -462,7 +463,7 @@ TEST_F(BrowsingTopicsServiceImplTest,
scoped_feature_list_.Reset();
scoped_feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"epoch_retention_duration",
base::StrCat(
@ -1506,7 +1507,7 @@ TEST_F(BrowsingTopicsServiceImplTest,
scoped_feature_list_.Reset();
scoped_feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"time_period_per_epoch",
base::StrCat({base::NumberToString(kEpoch.InSeconds()), "s"})},
@ -2738,7 +2739,7 @@ TEST_F(BrowsingTopicsServiceImplTest, BlockTopicWithFinch) {
scoped_feature_list_.Reset();
scoped_feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"time_period_per_epoch",
base::StrCat({base::NumberToString(kEpoch.InSeconds()), "s"})},

@ -16,6 +16,7 @@
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "components/browsing_topics/util.h"
#include "services/network/public/cpp/features.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
@ -78,7 +79,7 @@ class BrowsingTopicsStateTest : public testing::Test {
// during tests where expiration is irrelevant.
feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"epoch_retention_duration", "3650000d"}}}},
/*disabled_features=*/{});
@ -395,7 +396,7 @@ TEST_F(BrowsingTopicsStateTest, EpochsForSite_PhaseOutTime) {
feature_list_.Reset();
feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"epoch_retention_duration", "28d"}}}},
/*disabled_features=*/{});
@ -888,7 +889,7 @@ TEST_F(BrowsingTopicsStateTest, ScheduleEpochsExpiration) {
feature_list_.Reset();
feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"epoch_retention_duration", "28s"}}}},
/*disabled_features=*/{});
@ -947,7 +948,7 @@ TEST_F(BrowsingTopicsStateTest, AddEpochAndVerifyExpiration) {
feature_list_.Reset();
feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"epoch_retention_duration", "28s"}}}},
/*disabled_features=*/{});

@ -10,6 +10,7 @@
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "components/browsing_topics/util.h"
#include "services/network/public/cpp/features.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
@ -407,7 +408,7 @@ TEST_F(EpochTopicsTest,
TEST_F(EpochTopicsTest, ScheduleExpiration) {
feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kBrowsingTopics, {}},
{{network::features::kBrowsingTopics, {}},
{blink::features::kBrowsingTopicsParameters,
{{"epoch_retention_duration", "28s"}}}},
/*disabled_features=*/{});

@ -22,6 +22,7 @@
#include "components/page_load_metrics/browser/page_load_tracker.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
namespace page_load_metrics {
@ -56,7 +57,7 @@ void PageLoadMetricsEmbedderBase::RegisterCommonObservers(
std::make_unique<PrerenderPageLoadMetricsObserver>(is_incognito));
tracker->AddObserver(std::make_unique<SameOriginPageLoadMetricsObserver>());
tracker->AddObserver(std::make_unique<CrossOriginPageLoadMetricsObserver>());
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
tracker->AddObserver(
std::make_unique<SharedStoragePageLoadMetricsObserver>());
}

@ -4,6 +4,7 @@ include_rules = [
"+third_party/blink/public/common",
"+third_party/blink/public/mojom",
"+third_party/leveldatabase",
"+services/network/public/cpp/features.h",
"+services/network/public/cpp/shared_storage_utils.h",
"+sql",
"+storage/browser/quota/special_storage_policy.h",

@ -18,6 +18,7 @@
#include "components/services/storage/shared_storage/shared_storage_database.h"
#include "components/services/storage/shared_storage/shared_storage_options.h"
#include "components/services/storage/shared_storage/shared_storage_test_utils.h"
#include "services/network/public/cpp/features.h"
#include "sql/database.h"
#include "sql/statement.h"
#include "sql/test/test_helpers.h"
@ -48,7 +49,7 @@ class SharedStorageDatabaseMigrationsTest : public testing::Test {
void SetUp() override {
scoped_feature_list_.InitAndEnableFeatureWithParameters(
{blink::features::kSharedStorageAPI},
{network::features::kSharedStorageAPI},
{{"MaxSharedStorageInitTries", "2"}});
// Get a temporary directory for the test DB files.

@ -25,6 +25,7 @@
#include "components/services/storage/public/mojom/storage_usage_info.mojom.h"
#include "components/services/storage/shared_storage/shared_storage_options.h"
#include "components/services/storage/shared_storage/shared_storage_test_utils.h"
#include "services/network/public/cpp/features.h"
#include "sql/database.h"
#include "storage/browser/quota/special_storage_policy.h"
#include "storage/browser/test/mock_special_storage_policy.h"
@ -152,7 +153,7 @@ TEST_F(SharedStorageDatabaseTest, OptionsCreatedFromFeatures) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeatureWithParameters(
{blink::features::kSharedStorageAPI},
{network::features::kSharedStorageAPI},
{{"MaxSharedStoragePageSize", "2048"},
{"MaxSharedStorageCacheSize", "1024"},
{"MaxSharedStorageInitTries", "5"},

@ -32,6 +32,7 @@
#include "components/services/storage/shared_storage/shared_storage_database.h"
#include "components/services/storage/shared_storage/shared_storage_options.h"
#include "components/services/storage/shared_storage/shared_storage_test_utils.h"
#include "services/network/public/cpp/features.h"
#include "storage/browser/quota/special_storage_policy.h"
#include "storage/browser/test/mock_special_storage_policy.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
@ -405,7 +406,7 @@ class SharedStorageManagerTest : public testing::Test {
virtual void InitSharedStorageFeature() {
scoped_feature_list_.InitAndEnableFeatureWithParameters(
{blink::features::kSharedStorageAPI},
{network::features::kSharedStorageAPI},
// Set these intervals to be long enough not to interfere with the
// basic tests.
{{"SharedStorageStalePurgeInitialInterval",

@ -5,8 +5,8 @@
#include "components/services/storage/shared_storage/shared_storage_options.h"
#include "base/bits.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/shared_storage_utils.h"
#include "third_party/blink/public/common/features.h"
namespace storage {
@ -23,16 +23,16 @@ bool IsValidPageSize(int page_size) {
// static
std::unique_ptr<SharedStorageOptions> SharedStorageOptions::Create() {
return std::make_unique<SharedStorageOptions>(
blink::features::kMaxSharedStoragePageSize.Get(),
blink::features::kMaxSharedStorageCacheSize.Get(),
network::features::kMaxSharedStoragePageSize.Get(),
network::features::kMaxSharedStorageCacheSize.Get(),
network::kMaxSharedStorageBytesPerOrigin,
blink::features::kMaxSharedStorageInitTries.Get(),
blink::features::kMaxSharedStorageIteratorBatchSize.Get(),
blink::features::kSharedStorageBitBudget.Get(),
blink::features::kSharedStorageBudgetInterval.Get(),
blink::features::kSharedStorageStalePurgeInitialInterval.Get(),
blink::features::kSharedStorageStalePurgeRecurringInterval.Get(),
blink::features::kSharedStorageStalenessThreshold.Get());
network::features::kMaxSharedStorageInitTries.Get(),
network::features::kMaxSharedStorageIteratorBatchSize.Get(),
network::features::kSharedStorageBitBudget.Get(),
network::features::kSharedStorageBudgetInterval.Get(),
network::features::kSharedStorageStalePurgeInitialInterval.Get(),
network::features::kSharedStorageStalePurgeRecurringInterval.Get(),
network::features::kSharedStorageStalenessThreshold.Get());
}
SharedStorageOptions::SharedStorageOptions(

@ -122,10 +122,10 @@ class PrivacySandboxAdsAPIsM1OverrideBrowserTest
PrivacySandboxAdsAPIsM1OverrideBrowserTest() {
feature_list_.InitWithFeatures(
{features::kPrivacySandboxAdsAPIsM1Override,
blink::features::kBrowsingTopics,
network::features::kBrowsingTopics,
blink::features::kBrowsingTopicsDocumentAPI,
blink::features::kInterestGroupStorage, blink::features::kFencedFrames,
blink::features::kSharedStorageAPI},
network::features::kInterestGroupStorage,
blink::features::kFencedFrames, network::features::kSharedStorageAPI},
/*disabled_features=*/{});
}
@ -164,10 +164,10 @@ class PrivacySandboxAdsAPIsM1OverrideNoFeatureBrowserTest
feature_list_.InitWithFeatures(
{features::kPrivacySandboxAdsAPIsM1Override},
{attribution_reporting::features::kConversionMeasurement,
blink::features::kBrowsingTopics,
network::features::kBrowsingTopics,
blink::features::kBrowsingTopicsDocumentAPI,
blink::features::kInterestGroupStorage, blink::features::kFencedFrames,
blink::features::kSharedStorageAPI});
network::features::kInterestGroupStorage,
blink::features::kFencedFrames, network::features::kSharedStorageAPI});
}
private:

@ -114,6 +114,7 @@
#include "services/device/public/mojom/vibration_manager.mojom.h"
#include "services/metrics/public/mojom/ukm_interface.mojom.h"
#include "services/metrics/ukm_recorder_factory_impl.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "services/network/public/mojom/p2p.mojom.h"
#include "services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
@ -1201,7 +1202,7 @@ void PopulateBinderMapWithContext(
&EmptyBinderForFrame<blink::mojom::CredentialManager>));
map->Add<blink::mojom::LCPCriticalPathPredictorHost>(base::BindRepeating(
&EmptyBinderForFrame<blink::mojom::LCPCriticalPathPredictorHost>));
if (base::FeatureList::IsEnabled(blink::features::kBrowsingTopics) &&
if (base::FeatureList::IsEnabled(network::features::kBrowsingTopics) &&
base::FeatureList::IsEnabled(
blink::features::kBrowsingTopicsDocumentAPI)) {
map->Add<blink::mojom::BrowsingTopicsDocumentService>(
@ -1238,7 +1239,7 @@ void PopulateBinderMapWithContext(
base::BindRepeating(&ContentIndexServiceImpl::CreateForFrame));
map->Add<blink::mojom::KeyboardLockService>(
base::BindRepeating(&KeyboardLockServiceImpl::CreateMojoService));
if (base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage)) {
if (base::FeatureList::IsEnabled(network::features::kInterestGroupStorage)) {
map->Add<blink::mojom::AdAuctionService>(
base::BindRepeating(&AdAuctionServiceImpl::CreateMojoService));
}

@ -887,7 +887,7 @@ class BrowsingDataRemoverImplSharedStorageBrowserTest
: public BrowsingDataRemoverImplBrowserTest {
public:
BrowsingDataRemoverImplSharedStorageBrowserTest() {
feature_list_.InitAndEnableFeature(blink::features::kSharedStorageAPI);
feature_list_.InitAndEnableFeature(network::features::kSharedStorageAPI);
}
StoragePartition* storage_partition() {

@ -2000,7 +2000,7 @@ class BrowsingDataRemoverImplSharedStorageTest
: public BrowsingDataRemoverImplTest {
public:
BrowsingDataRemoverImplSharedStorageTest() {
feature_list_.InitAndEnableFeature(blink::features::kSharedStorageAPI);
feature_list_.InitAndEnableFeature(network::features::kSharedStorageAPI);
}
private:

@ -54,6 +54,7 @@
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "services/network/public/cpp/features.h"
#include "storage/browser/quota/quota_settings.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/features.h"
@ -1153,7 +1154,7 @@ class ClearSiteDataHandlerSharedStorageBrowserTest
: public ClearSiteDataHandlerBrowserTest {
public:
ClearSiteDataHandlerSharedStorageBrowserTest() {
feature_list_.InitAndEnableFeature(blink::features::kSharedStorageAPI);
feature_list_.InitAndEnableFeature(network::features::kSharedStorageAPI);
}
private:

@ -25,6 +25,7 @@
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/default_handlers.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "services/network/public/cpp/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
@ -87,7 +88,7 @@ class BrowsingTopicsBrowserTest : public ContentBrowserTest {
public:
BrowsingTopicsBrowserTest() {
feature_list_.InitWithFeatures({features::kPrivacySandboxAdsAPIsOverride,
blink::features::kBrowsingTopics},
network::features::kBrowsingTopics},
/*disabled_features=*/{});
}

@ -17,6 +17,7 @@
#include "content/test/test_render_view_host.h"
#include "mojo/public/cpp/system/functions.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/permissions_policy/origin_with_possible_wildcards.h"
#include "services/network/public/cpp/permissions_policy/permissions_policy_declaration.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
@ -113,7 +114,8 @@ class TopicsInterceptingContentBrowserClient : public ContentBrowserClient {
class BrowsingTopicsURLLoaderTest : public RenderViewHostTestHarness {
public:
BrowsingTopicsURLLoaderTest() {
scoped_feature_list_.InitAndEnableFeature(blink::features::kBrowsingTopics);
scoped_feature_list_.InitAndEnableFeature(
network::features::kBrowsingTopics);
}
void SetUp() override {

@ -83,6 +83,7 @@
#include "net/dns/public/util.h"
#include "net/test/ssl_test_util.h"
#include "net/test/test_doh_server.h"
#include "services/network/public/cpp/features.h"
#include "services/tracing/public/cpp/perfetto/perfetto_config.h"
#include "services/tracing/public/cpp/perfetto/perfetto_traced_process.h"
#include "services/tracing/public/cpp/tracing_features.h"
@ -4313,7 +4314,7 @@ class SharedStorageDevToolsProtocolTest : public DevToolsProtocolTest {
SharedStorageDevToolsProtocolTest() {
feature_list_
.InitWithFeaturesAndParameters(/*enabled_features=*/
{{blink::features::kSharedStorageAPI,
{{network::features::kSharedStorageAPI,
{{"SharedStorageBitBudget",
base::NumberToString(
kBudgetAllowed)}}},

@ -68,6 +68,7 @@
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/cors/cors.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest-spi.h"
@ -2551,7 +2552,7 @@ class FencedFrameParameterizedBrowserTest : public FencedFrameBrowserTestBase {
{{blink::features::kFencedFrames, {}},
{net::features::kThirdPartyStoragePartitioning, {}},
{features::kPrivacySandboxAdsAPIsOverride, {}},
{blink::features::kInterestGroupStorage, {}},
{network::features::kInterestGroupStorage, {}},
{blink::features::kAdInterestGroupAPI, {}},
{blink::features::kParakeet, {}},
{blink::features::kFledge, {}},

@ -27,6 +27,7 @@
#include "net/http/http_version.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/permissions_policy/origin_with_possible_wildcards.h"
#include "services/network/public/cpp/permissions_policy/permissions_policy_declaration.h"
#include "services/network/public/cpp/resource_request.h"
@ -106,7 +107,7 @@ class IsAdAuctionHeadersEligibleTest
public:
IsAdAuctionHeadersEligibleTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{blink::features::kInterestGroupStorage},
/*enabled_features=*/{network::features::kInterestGroupStorage},
/*disabled_features=*/{});
}
@ -226,7 +227,7 @@ class IsAdAuctionHeadersEligibleForNavigationTest
public:
IsAdAuctionHeadersEligibleForNavigationTest() {
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{blink::features::kInterestGroupStorage},
/*enabled_features=*/{network::features::kInterestGroupStorage},
/*disabled_features=*/{});
}

@ -849,7 +849,7 @@ class AdAuctionServiceImplTest : public RenderViewHostTestHarness {
base::test::TaskEnvironment::TimeSource::MOCK_TIME) {
feature_list_.InitWithFeatures(
/*enabled_features=*/
{blink::features::kInterestGroupStorage,
{network::features::kInterestGroupStorage,
blink::features::kAdInterestGroupAPI, blink::features::kFledge,
blink::features::kFledgeRealTimeReporting,
blink::features::kFledgeAuctionDealSupport},
@ -9600,7 +9600,7 @@ class AdAuctionServiceImplSharedStorageEnabledTest
: public AdAuctionServiceImplTest {
public:
AdAuctionServiceImplSharedStorageEnabledTest() {
feature_list_.InitAndEnableFeature(blink::features::kSharedStorageAPI);
feature_list_.InitAndEnableFeature(network::features::kSharedStorageAPI);
}
std::u16string SharedStorageGet(const url::Origin& context_origin,
@ -9830,7 +9830,7 @@ class AdAuctionServiceImplSharedStorageDisabledTest
: public AdAuctionServiceImplTest {
public:
AdAuctionServiceImplSharedStorageDisabledTest() {
feature_list_.InitAndDisableFeature(blink::features::kSharedStorageAPI);
feature_list_.InitAndDisableFeature(network::features::kSharedStorageAPI);
}
protected:

@ -50,6 +50,7 @@
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/interest_group/ad_auction_service.mojom-mojolpm.h"
#include "third_party/blink/public/mojom/interest_group/ad_auction_service.mojom.h"
@ -250,7 +251,7 @@ AdAuctionServiceTestcase::AdAuctionServiceTestcase(
: Testcase<ProtoTestcase, ProtoAction>(testcase) {
feature_list_.InitWithFeatures(
/*enabled_features=*/
{blink::features::kInterestGroupStorage,
{network::features::kInterestGroupStorage,
blink::features::kAdInterestGroupAPI, blink::features::kFledge},
/*disabled_features=*/{});
fenced_frame_feature_list_.InitAndEnableFeatureWithParameters(

@ -24,6 +24,7 @@
#include "mojo/public/cpp/system/functions.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/permissions_policy/origin_with_possible_wildcards.h"
#include "services/network/public/cpp/permissions_policy/permissions_policy_declaration.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
@ -158,10 +159,10 @@ class AdAuctionURLLoaderInterceptorTest : public RenderViewHostTestHarness {
// be handled via `SubresourceProxyingURLLoaderService` (i.e. sets
// browsing_topics but not ad_auction_headers).
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{blink::features::kInterestGroupStorage,
/*enabled_features=*/{network::features::kInterestGroupStorage,
blink::features::kFledgeBiddingAndAuctionServer,
blink::features::kAdAuctionSignals,
blink::features::kBrowsingTopics},
network::features::kBrowsingTopics},
/*disabled_features=*/{});
}

@ -49,6 +49,7 @@
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/client_security_state.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "url/gurl.h"
@ -1008,7 +1009,7 @@ AuctionWorkletManager::AuctionWorkletManager(
delegate_(delegate),
auction_network_events_proxy_(
std::make_unique<AuctionNetworkEventsProxy>(GetFrameTreeNodeID())) {
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
auction_shared_storage_host_ = std::make_unique<AuctionSharedStorageHost>(
static_cast<StoragePartitionImpl*>(
delegate_->GetFrame()->GetProcess()->GetStoragePartition()));

@ -744,7 +744,7 @@ class InterestGroupBrowserTest : public ContentBrowserTest {
InterestGroupBrowserTest() {
feature_list_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kInterestGroupStorage, {}},
{{network::features::kInterestGroupStorage, {}},
{blink::features::kFledgeBiddingAndAuctionServer, {}},
{features::kPrivacySandboxAdsAPIsOverride, {}},
{blink::features::kAdInterestGroupAPI, {}},
@ -20700,7 +20700,7 @@ class BiddingAndAuctionServerAPIsOriginTrialBrowserTest
BiddingAndAuctionServerAPIsOriginTrialBrowserTest() {
feature_list_.InitWithFeatures(
/*enabled_features=*/{blink::features::kFledge,
blink::features::kInterestGroupStorage,
network::features::kInterestGroupStorage,
blink::features::kFledgeBiddingAndAuctionServer},
{});
}

@ -46,6 +46,7 @@
#include "content/services/auction_worklet/public/mojom/bidder_worklet.mojom.h"
#include "crypto/sha2.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "services/network/public/cpp/features.h"
#include "sql/database.h"
#include "sql/error_delegate_util.h"
#include "sql/meta_table.h"
@ -5693,12 +5694,13 @@ InterestGroupStorage::InterestGroupStorage(const base::FilePath& path)
InterestGroupStorage::InterestGroupStorage(const base::FilePath& path,
base::TimeDelta idle_period)
: path_to_database_(DBPath(path)),
max_owners_(blink::features::kInterestGroupStorageMaxOwners.Get()),
max_owners_(network::features::kInterestGroupStorageMaxOwners.Get()),
max_owner_regular_interest_groups_(MaxOwnerRegularInterestGroups()),
max_owner_negative_interest_groups_(MaxOwnerNegativeInterestGroups()),
max_owner_storage_size_(MaxOwnerStorageSize()),
max_ops_before_maintenance_(
blink::features::kInterestGroupStorageMaxOpsBeforeMaintenance.Get()),
network::features::kInterestGroupStorageMaxOpsBeforeMaintenance
.Get()),
db_maintenance_timer_(FROM_HERE,
idle_period,
this,
@ -6363,17 +6365,18 @@ InterestGroupStorage::GetBiddingAndAuctionServerKeys(
// static
size_t InterestGroupStorage::MaxOwnerRegularInterestGroups() {
return blink::features::kInterestGroupStorageMaxGroupsPerOwner.Get();
return network::features::kInterestGroupStorageMaxGroupsPerOwner.Get();
}
// static
size_t InterestGroupStorage::MaxOwnerNegativeInterestGroups() {
return blink::features::kInterestGroupStorageMaxNegativeGroupsPerOwner.Get();
return network::features::kInterestGroupStorageMaxNegativeGroupsPerOwner
.Get();
}
// static
size_t InterestGroupStorage::MaxOwnerStorageSize() {
return blink::features::kInterestGroupStorageMaxStoragePerOwner.Get();
return network::features::kInterestGroupStorageMaxStoragePerOwner.Get();
}
base::Time InterestGroupStorage::GetLastMaintenanceTimeForTesting() const {

@ -37,6 +37,7 @@
#include "content/services/auction_worklet/public/mojom/bidder_worklet.mojom.h"
#include "crypto/sha2.h"
#include "services/network/network_service.h"
#include "services/network/public/cpp/features.h"
#include "sql/database.h"
#include "sql/meta_table.h"
#include "sql/test/scoped_error_expecter.h"
@ -75,7 +76,7 @@ class InterestGroupStorageTest : public testing::Test {
ASSERT_TRUE(temp_directory_.CreateUniqueTempDir());
scoped_feature_list_.InitWithFeaturesAndParameters(
{{
blink::features::kInterestGroupStorage,
network::features::kInterestGroupStorage,
{{"max_owners", "10"},
{"max_groups_per_owner", "10"},
{"max_negative_groups_per_owner", "30"},
@ -2212,7 +2213,7 @@ TEST_F(InterestGroupStorageTest, JoinTooManyRegularGroupNames) {
const url::Origin test_origin =
url::Origin::Create(GURL("https://owner.example.com"));
const size_t max_groups_per_owner =
blink::features::kInterestGroupStorageMaxGroupsPerOwner.Get();
network::features::kInterestGroupStorageMaxGroupsPerOwner.Get();
const size_t num_groups = max_groups_per_owner + kExcessOwners;
std::vector<std::string> added_groups;
@ -2268,7 +2269,7 @@ TEST_F(InterestGroupStorageTest, JoinTooManyNegativeGroupNames) {
const url::Origin test_origin =
url::Origin::Create(GURL("https://owner.example.com"));
const size_t max_negative_groups_per_owner =
blink::features::kInterestGroupStorageMaxNegativeGroupsPerOwner.Get();
network::features::kInterestGroupStorageMaxNegativeGroupsPerOwner.Get();
const size_t num_groups = max_negative_groups_per_owner + kExcessOwners;
std::vector<std::string> added_groups;
@ -2326,7 +2327,7 @@ TEST_F(InterestGroupStorageTest, JoinTooMuchStorage) {
url::Origin::Create(GURL("https://owner.example.com"));
const size_t kGroupSize = 800;
const size_t groups_before_full =
blink::features::kInterestGroupStorageMaxStoragePerOwner.Get() /
network::features::kInterestGroupStorageMaxStoragePerOwner.Get() /
kGroupSize;
std::vector<std::string> added_groups;
@ -2358,7 +2359,7 @@ TEST_F(InterestGroupStorageTest, JoinTooMuchStorage) {
// than `kGroupSize`, so that once this group is removed, one more group of
// `kGroupSize` can be stored.
size_t size_left_before_full =
blink::features::kInterestGroupStorageMaxStoragePerOwner.Get() -
network::features::kInterestGroupStorageMaxStoragePerOwner.Get() -
kGroupSize * (groups_before_full - 1);
big_group.user_bidding_signals =
std::string(size_left_before_full - big_group.EstimateSize() + 1, 'P');
@ -2417,9 +2418,9 @@ TEST_F(InterestGroupStorageTest, JoinTooMuchStorage) {
TEST_F(InterestGroupStorageTest, JoinTooManyGroupOwners) {
const size_t kExcessGroups = 10;
const size_t max_owners =
blink::features::kInterestGroupStorageMaxOwners.Get();
network::features::kInterestGroupStorageMaxOwners.Get();
const size_t max_ops =
blink::features::kInterestGroupStorageMaxOpsBeforeMaintenance.Get();
network::features::kInterestGroupStorageMaxOpsBeforeMaintenance.Get();
const size_t num_groups = max_owners + kExcessGroups;
std::vector<url::Origin> added_origins;
@ -2734,7 +2735,7 @@ class InterestGroupStorageWithNoIdleFastForwardTest
InterestGroupStorageTest::SetUp();
scoped_feature_list_.InitAndEnableFeatureWithParameters(
blink::features::kInterestGroupStorage,
network::features::kInterestGroupStorage,
{
{"max_ops_before_maintenance", "1000000000"} // 1 billion ops
});

@ -38,6 +38,7 @@
#include "content/shell/browser/shell.h"
#include "content/shell/common/shell_switches.h"
#include "net/dns/mock_host_resolver.h"
#include "services/network/public/cpp/features.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/interest_group/test_interest_group_builder.h"
@ -248,7 +249,7 @@ class AdjustableAuction : public ContentBrowserTest {
AdjustableAuction() {
feature_list_.InitWithFeatures(
/*enabled_features=*/
{blink::features::kInterestGroupStorage,
{network::features::kInterestGroupStorage,
blink::features::kAdInterestGroupAPI, blink::features::kFledge,
blink::features::kAllowURNsInIframes,
blink::features::kFledgeDirectFromSellerSignalsHeaderAdSlot},

@ -109,7 +109,7 @@ void SubresourceProxyingURLLoaderService::CreateLoaderAndStart(
}
if (resource_request_in.browsing_topics &&
!base::FeatureList::IsEnabled(blink::features::kBrowsingTopics)) {
!base::FeatureList::IsEnabled(network::features::kBrowsingTopics)) {
loader_factory_receivers_.ReportBadMessage(
"Unexpected `resource_request_in` in "
"SubresourceProxyingURLLoaderService::CreateLoaderAndStart(): "
@ -118,7 +118,7 @@ void SubresourceProxyingURLLoaderService::CreateLoaderAndStart(
}
if (resource_request_in.ad_auction_headers &&
!base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage)) {
!base::FeatureList::IsEnabled(network::features::kInterestGroupStorage)) {
loader_factory_receivers_.ReportBadMessage(
"Unexpected `resource_request_in` in "
"SubresourceProxyingURLLoaderService::CreateLoaderAndStart(): "

@ -1818,7 +1818,7 @@ NavigationRequest::NavigationRequest(
blink::kFencedFrameForcedSandboxFlags;
}
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
shared_storage_writable_opted_in_ =
frame_tree_node_->shared_storage_writable_opted_in();
shared_storage_writable_eligible_ =

@ -29,6 +29,7 @@
#include "content/test/test_web_contents.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
#include "services/network/public/cpp/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/navigation/navigation_params.h"
@ -479,7 +480,7 @@ TEST_F(NavigationRequestTest, WillFailRequestSetsSSLInfo) {
TEST_F(NavigationRequestTest, SharedStorageWritable) {
base::test::ScopedFeatureList feature_list;
feature_list.InitWithFeatures(
/*enabled_features=*/{blink::features::kSharedStorageAPI,
/*enabled_features=*/{network::features::kSharedStorageAPI,
blink::features::kFencedFrames},
/*disabled_features=*/{});

@ -9155,7 +9155,7 @@ void RenderFrameHostImpl::DidChangeIframeAttributes(
}
if (attributes->browsing_topics &&
!base::FeatureList::IsEnabled(blink::features::kBrowsingTopics)) {
!base::FeatureList::IsEnabled(network::features::kBrowsingTopics)) {
bad_message::ReceivedBadMessage(
GetProcess(),
bad_message::RFH_RECEIVED_INVALID_BROWSING_TOPICS_ATTRIBUTE);
@ -9163,7 +9163,7 @@ void RenderFrameHostImpl::DidChangeIframeAttributes(
}
if (attributes->shared_storage_writable_opted_in &&
(!base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI))) {
(!base::FeatureList::IsEnabled(network::features::kSharedStorageAPI))) {
bad_message::ReceivedBadMessage(
GetProcess(),
bad_message::RFH_RECEIVED_INVALID_SHARED_STORAGE_WRITABLE_ATTRIBUTE);

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include <memory>
#include <vector>
@ -23,6 +21,7 @@
#include "content/browser/renderer_host/back_forward_cache_impl.h"
#include "content/browser/renderer_host/page_lifecycle_state_manager.h"
#include "content/browser/renderer_host/render_frame_host_delegate.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/shared_storage/shared_storage_document_service_impl.h"
#include "content/common/dom_automation_controller.mojom.h"
@ -38,6 +37,7 @@
#include "net/base/features.h"
#include "ppapi/buildflags/buildflags.h"
#include "services/device/public/mojom/screen_orientation.mojom.h"
#include "services/network/public/cpp/features.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "services/service_manager/public/mojom/interface_provider.mojom.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
@ -220,7 +220,7 @@ void RenderFrameHostImpl::SetUpMojoConnection() {
},
base::Unretained(this)));
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
associated_registry_->AddInterface<
blink::mojom::SharedStorageDocumentService>(base::BindRepeating(
[](RenderFrameHostImpl* impl,

@ -48,6 +48,7 @@
#include "net/base/schemeful_site.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "services/network/public/cpp/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
@ -71,7 +72,7 @@ SharedStorageBrowserTestBase::SharedStorageBrowserTestBase() {
shared_storage_feature_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kSharedStorageAPI,
{{network::features::kSharedStorageAPI,
{
{"SharedStorageBitBudget", base::NumberToString(kBudgetAllowed)},
{"SharedStorageStalenessThreshold",

@ -22,6 +22,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_client.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "services/network/public/mojom/shared_storage.mojom.h"
#include "third_party/blink/public/common/features.h"
@ -90,12 +91,12 @@ const char kSharedStorageMethodFromInsecureContextMessage[] =
"Attempted to invoke a sharedStorage method from an insecure context";
// NOTE: To preserve user privacy, the default value of the
// `blink::features::kSharedStorageExposeDebugMessageForSettingsStatus`
// `network::features::kSharedStorageExposeDebugMessageForSettingsStatus`
// feature param MUST remain set to false (although the value can be overridden
// via the command line or in tests).
std::string GetSharedStorageErrorMessage(const std::string& debug_message,
const std::string& input_message) {
return blink::features::kSharedStorageExposeDebugMessageForSettingsStatus
return network::features::kSharedStorageExposeDebugMessageForSettingsStatus
.Get()
? base::StrCat({input_message, "\nDebug: ", debug_message})
: input_message;

@ -57,6 +57,7 @@
#include "net/base/schemeful_site.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "services/network/public/cpp/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
@ -1917,7 +1918,7 @@ class SharedStorageSelectURLNotAllowedInFencedFrameBrowserTest
SharedStorageSelectURLNotAllowedInFencedFrameBrowserTest() {
shared_storage_feature_.InitWithFeaturesAndParameters(
/*enabled_features=*/
{{blink::features::kSharedStorageAPI,
{{network::features::kSharedStorageAPI,
{{"SharedStorageBitBudget", base::NumberToString(kBudgetAllowed)},
{"SharedStorageMaxAllowedFencedFrameDepthForSelectURL", "0"}}}},
/*disabled_features=*/{});

@ -235,7 +235,7 @@ void SharedStorageHeaderObserver::HeaderReceived(
// "'Shared-Storage-Write: shared storage is disabled."
// 2. Send a non-null `out_debug_message` param and append it to the above
// error message if the value of
// `blink::features::kSharedStorageExposeDebugMessageForSettingsStatus`
// `network::features::kSharedStorageExposeDebugMessageForSettingsStatus`
// is true.
std::move(callback).Run();
return;

@ -28,6 +28,7 @@
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_shared_storage_header_observer.h"
#include "content/test/test_web_contents.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/permissions_policy/origin_with_possible_wildcards.h"
#include "services/network/public/cpp/permissions_policy/permissions_policy_declaration.h"
#include "services/network/public/cpp/shared_storage_utils.h"
@ -128,7 +129,7 @@ class SharedStorageHeaderObserverTest
public testing::WithParamInterface<TestCaseType> {
public:
SharedStorageHeaderObserverTest() {
feature_list_.InitAndEnableFeature(blink::features::kSharedStorageAPI);
feature_list_.InitAndEnableFeature(network::features::kSharedStorageAPI);
}
~SharedStorageHeaderObserverTest() override = default;

@ -38,6 +38,7 @@
#include "content/public/browser/browser_context.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "services/data_decoder/public/cpp/data_decoder.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/shared_storage.mojom.h"
#include "storage/browser/blob/blob_url_loader_factory.h"
@ -684,7 +685,7 @@ void SharedStorageWorkletHost::SelectURL(
DCHECK_LE(shared_storage_fenced_frame_root_count, fenced_frame_depth);
size_t max_allowed_fenced_frame_depth =
blink::features::kSharedStorageMaxAllowedFencedFrameDepthForSelectURL
network::features::kSharedStorageMaxAllowedFencedFrameDepthForSelectURL
.Get();
if (fenced_frame_depth > max_allowed_fenced_frame_depth) {

@ -1491,7 +1491,7 @@ void StoragePartitionImpl::Initialize(
this, path, special_storage_policy_);
}
if (base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage)) {
if (base::FeatureList::IsEnabled(network::features::kInterestGroupStorage)) {
// Auction worklets on non-Android use dedicated processes; on Android due
// to high cost of process launch they try to reuse renderers.
interest_group_manager_ = std::make_unique<InterestGroupManagerImpl>(
@ -1510,7 +1510,7 @@ void StoragePartitionImpl::Initialize(
// The Topics API is not available in Incognito mode.
if (!is_in_memory() &&
base::FeatureList::IsEnabled(blink::features::kBrowsingTopics)) {
base::FeatureList::IsEnabled(network::features::kBrowsingTopics)) {
browsing_topics_site_data_manager_ =
std::make_unique<BrowsingTopicsSiteDataManagerImpl>(path);
}
@ -1557,7 +1557,7 @@ void StoragePartitionImpl::Initialize(
}
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
base::FilePath shared_storage_path =
is_in_memory() ? base::FilePath()
: path.Append(storage::kSharedStoragePath);
@ -3039,7 +3039,7 @@ void StoragePartitionImpl::DataDeletionHelper::ClearDataOnUIThread(
CreateTaskCompletionClosure(TracingDataType::kPrivateAggregation)));
}
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI) &&
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI) &&
shared_storage_manager &&
(remove_mask_ & REMOVE_DATA_MASK_SHARED_STORAGE)) {
auto shared_storage_purge_callback = base::BindOnce(

@ -775,8 +775,8 @@ class StoragePartitionImplTest : public testing::Test {
: task_environment_(content::BrowserTaskEnvironment::IO_MAINLOOP,
base::test::TaskEnvironment::TimeSource::MOCK_TIME),
browser_context_(new TestBrowserContext()) {
feature_list_.InitWithFeatures({blink::features::kInterestGroupStorage,
blink::features::kSharedStorageAPI},
feature_list_.InitWithFeatures({network::features::kInterestGroupStorage,
network::features::kSharedStorageAPI},
{});
}
@ -2339,8 +2339,8 @@ class StoragePartitionImplSharedStorageTest : public StoragePartitionImplTest {
shared_storage_manager_(
static_cast<StoragePartitionImpl*>(storage_partition_)
->GetSharedStorageManager()) {
feature_list_.InitWithFeatures({blink::features::kInterestGroupStorage,
blink::features::kSharedStorageAPI},
feature_list_.InitWithFeatures({network::features::kInterestGroupStorage,
network::features::kSharedStorageAPI},
{});
}

@ -177,6 +177,7 @@
#include "partition_alloc/buildflags.h"
#include "ppapi/buildflags/buildflags.h"
#include "services/device/public/mojom/wake_lock.mojom.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/request_destination.h"
#include "services/network/public/cpp/web_sandbox_flags.h"
#include "services/network/public/mojom/network_context.mojom.h"
@ -1311,7 +1312,7 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
std::make_unique<ScreenChangeMonitor>(base::BindRepeating(
&WebContentsImpl::OnScreensChange, base::Unretained(this)));
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
SharedStorageBudgetCharger::CreateForWebContents(this);
}

@ -578,11 +578,11 @@ void ResolveInvalidConfigurations() {
// Topics API cannot be enabled without the support of the browser process.
// The Document API should be additionally gated by the
// `kBrowsingTopicsDocumentAPI` feature.
if (!base::FeatureList::IsEnabled(blink::features::kBrowsingTopics)) {
if (!base::FeatureList::IsEnabled(network::features::kBrowsingTopics)) {
LOG_IF(WARNING, WebRuntimeFeatures::IsTopicsAPIEnabled())
<< "Topics cannot be enabled in this configuration. Use --"
<< switches::kEnableFeatures << "="
<< blink::features::kBrowsingTopics.name << " in addition.";
<< network::features::kBrowsingTopics.name << " in addition.";
WebRuntimeFeatures::EnableTopicsAPI(false);
WebRuntimeFeatures::EnableTopicsDocumentAPI(false);
WebRuntimeFeatures::EnableTopicsImgAPI(false);
@ -599,12 +599,12 @@ void ResolveInvalidConfigurations() {
}
}
if (!base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (!base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
LOG_IF(WARNING, WebRuntimeFeatures::IsSharedStorageAPIEnabled())
<< "SharedStorage cannot be enabled in this "
"configuration. Use --"
<< switches::kEnableFeatures << "="
<< blink::features::kSharedStorageAPI.name << " in addition.";
<< network::features::kSharedStorageAPI.name << " in addition.";
WebRuntimeFeatures::EnableSharedStorageAPI(false);
}
@ -619,13 +619,13 @@ void ResolveInvalidConfigurations() {
WebRuntimeFeatures::EnableAttributionReporting(false);
}
if (!base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage)) {
if (!base::FeatureList::IsEnabled(network::features::kInterestGroupStorage)) {
LOG_IF(WARNING,
WebRuntimeFeatures::IsAdInterestGroupAPIEnabledByRuntimeFlag())
<< "AdInterestGroupAPI cannot be enabled in this "
"configuration. Use --"
<< switches::kEnableFeatures << "="
<< blink::features::kInterestGroupStorage.name << " in addition.";
<< network::features::kInterestGroupStorage.name << " in addition.";
WebRuntimeFeatures::EnableAdInterestGroupAPI(false);
WebRuntimeFeatures::EnableFledge(false);
}

@ -141,7 +141,7 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) {
std::cref(features::kPrivacySandboxAdsAPIsOverride),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
{switches::kEnablePrivacySandboxAdsApis,
std::cref(blink::features::kInterestGroupStorage),
std::cref(network::features::kInterestGroupStorage),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
{switches::kEnablePrivacySandboxAdsApis,
std::cref(blink::features::kFledge),
@ -150,7 +150,7 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) {
std::cref(blink::features::kAllowURNsInIframes),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
{switches::kEnablePrivacySandboxAdsApis,
std::cref(blink::features::kBrowsingTopics),
std::cref(network::features::kBrowsingTopics),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
{switches::kEnablePrivacySandboxAdsApis,
std::cref(attribution_reporting::features::kConversionMeasurement),
@ -159,7 +159,7 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) {
std::cref(blink::features::kFencedFrames),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
{switches::kEnablePrivacySandboxAdsApis,
std::cref(blink::features::kSharedStorageAPI),
std::cref(network::features::kSharedStorageAPI),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
{switches::kEnablePrivacySandboxAdsApis,
std::cref(blink::features::kPrivateAggregationApi),

@ -18,6 +18,7 @@
#include "content/public/test/test_frame_navigation_observer.h"
#include "content/test/fenced_frame_test_utils.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
@ -54,7 +55,7 @@ FencedFrameTestHelper::FencedFrameTestHelper() {
scoped_feature_list_.InitWithFeaturesAndParameters(
{{blink::features::kFencedFrames, {}},
{features::kPrivacySandboxAdsAPIsOverride, {}},
{blink::features::kInterestGroupStorage, {}},
{network::features::kInterestGroupStorage, {}},
{blink::features::kAdInterestGroupAPI, {}},
{blink::features::kFledge, {}},
{blink::features::kFencedFramesAPIChanges, {}},

@ -74,6 +74,7 @@
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/interest_group/ad_auction_constants.h"
@ -1267,7 +1268,7 @@ void BidderWorklet::V8State::ReportWin(
permissions_policy_state_->private_aggregation_allowed,
/*reserved_once_allowed=*/false);
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
context_recycler.AddSharedStorageBindings(
shared_storage_host_remote_.is_bound()
? shared_storage_host_remote_.get()
@ -2137,7 +2138,7 @@ BidderWorklet::V8State::CreateContextRecyclerAndRunTopLevelForGenerateBid(
/*reserved_once_allowed=*/true);
context_recycler->AddRealTimeReportingBindings();
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
context_recycler->AddSharedStorageBindings(
shared_storage_host_remote_.is_bound()
? shared_storage_host_remote_.get()

@ -53,6 +53,7 @@
#include "mojo/public/cpp/bindings/unique_receiver_set.h"
#include "net/http/http_status_code.h"
#include "net/third_party/quiche/src/quiche/oblivious_http/oblivious_http_gateway.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/shared_storage.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
@ -10682,7 +10683,7 @@ TEST_F(BidderWorkletTest, ReportWinRegisterAdBeaconLongUrl) {
class BidderWorkletSharedStorageAPIDisabledTest : public BidderWorkletTest {
public:
BidderWorkletSharedStorageAPIDisabledTest() {
feature_list_.InitAndDisableFeature(blink::features::kSharedStorageAPI);
feature_list_.InitAndDisableFeature(network::features::kSharedStorageAPI);
}
protected:
@ -10723,7 +10724,7 @@ class BidderWorkletSharedStorageAPIEnabledTest : public BidderWorkletTest {
public:
BidderWorkletSharedStorageAPIEnabledTest() {
feature_list_.InitWithFeatures(
/*enabled_features=*/{blink::features::kSharedStorageAPI,
/*enabled_features=*/{network::features::kSharedStorageAPI,
blink::features::kSharedStorageWebLocks},
/*disabled_features=*/{});

@ -59,6 +59,7 @@
#include "gin/dictionary.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/interest_group/ad_auction_currencies.h"
@ -923,7 +924,7 @@ SellerWorklet::V8State::CreateContextRecyclerAndRunTopLevel(
/*reserved_once_allowed=*/true);
context_recycler->AddRealTimeReportingBindings();
context_recycler->AddTextConversionHelpers();
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
context_recycler->AddSharedStorageBindings(
shared_storage_host_remote_.is_bound()
? shared_storage_host_remote_.get()
@ -1839,7 +1840,7 @@ void SellerWorklet::V8State::ReportResult(
permissions_policy_state_->private_aggregation_allowed,
/*reserved_once_allowed=*/false);
if (base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
if (base::FeatureList::IsEnabled(network::features::kSharedStorageAPI)) {
context_recycler.AddSharedStorageBindings(
shared_storage_host_remote_.is_bound()
? shared_storage_host_remote_.get()

@ -48,6 +48,7 @@
#include "mojo/public/cpp/bindings/unique_receiver_set.h"
#include "net/http/http_status_code.h"
#include "net/third_party/quiche/src/quiche/oblivious_http/oblivious_http_gateway.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/shared_storage.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
@ -6314,7 +6315,7 @@ INSTANTIATE_FEATURE_OVERRIDE_TEST_SUITE(ScoreAdBrowserSignalRenderSizeTest);
class SellerWorkletSharedStorageAPIDisabledTest : public SellerWorkletTest {
public:
SellerWorkletSharedStorageAPIDisabledTest() {
feature_list_.InitAndDisableFeature(blink::features::kSharedStorageAPI);
feature_list_.InitAndDisableFeature(network::features::kSharedStorageAPI);
}
protected:
@ -6352,7 +6353,7 @@ TEST_F(SellerWorkletSharedStorageAPIDisabledTest, SharedStorageNotExposed) {
class SellerWorkletSharedStorageAPIEnabledTest : public SellerWorkletTest {
public:
SellerWorkletSharedStorageAPIEnabledTest() {
feature_list_.InitAndEnableFeature(blink::features::kSharedStorageAPI);
feature_list_.InitAndEnableFeature(network::features::kSharedStorageAPI);
permissions_policy_state_ =
mojom::AuctionWorkletPermissionsPolicyState::New(
/*private_aggregation_allowed=*/true,

@ -416,4 +416,113 @@ BASE_FEATURE(kUpdateRequestForCorsRedirect,
"UpdateRequestForCorsRedirect",
base::FEATURE_ENABLED_BY_DEFAULT);
// https://github.com/patcg-individual-drafts/topics
// Kill switch for the Topics API.
BASE_FEATURE(kBrowsingTopics,
"BrowsingTopics",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enable the shared storage API. Note that enabling this feature does not
// automatically expose this API to the web, it only allows the element to be
// enabled by the runtime enabled feature, for origin trials.
// https://github.com/pythagoraskitty/shared-storage/blob/main/README.md
BASE_FEATURE(kSharedStorageAPI,
"SharedStorageAPI",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE_PARAM(size_t,
kSharedStorageURLSelectionOperationInputURLSizeLimit,
&kSharedStorageAPI,
"url_selection_operation_input_url_size_limit",
8);
BASE_FEATURE_PARAM(int,
kMaxSharedStoragePageSize,
&kSharedStorageAPI,
"MaxSharedStoragePageSize",
4096);
BASE_FEATURE_PARAM(int,
kMaxSharedStorageCacheSize,
&kSharedStorageAPI,
"MaxSharedStorageCacheSize",
1024);
BASE_FEATURE_PARAM(int,
kMaxSharedStorageInitTries,
&kSharedStorageAPI,
"MaxSharedStorageInitTries",
2);
BASE_FEATURE_PARAM(int,
kMaxSharedStorageIteratorBatchSize,
&kSharedStorageAPI,
"MaxSharedStorageIteratorBatchSize",
100);
BASE_FEATURE_PARAM(int,
kSharedStorageBitBudget,
&kSharedStorageAPI,
"SharedStorageBitBudget",
12);
BASE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageBudgetInterval,
&kSharedStorageAPI,
"SharedStorageBudgetInterval",
base::Hours(24));
BASE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageStalePurgeInitialInterval,
&kSharedStorageAPI,
"SharedStorageStalePurgeInitialInterval",
base::Minutes(2));
BASE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageStalePurgeRecurringInterval,
&kSharedStorageAPI,
"SharedStorageStalePurgeRecurringInterval",
base::Hours(2));
BASE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageStalenessThreshold,
&kSharedStorageAPI,
"SharedStorageStalenessThreshold",
base::Days(30));
BASE_FEATURE_PARAM(size_t,
kSharedStorageMaxAllowedFencedFrameDepthForSelectURL,
&kSharedStorageAPI,
"SharedStorageMaxAllowedFencedFrameDepthForSelectURL",
1);
// NOTE: To preserve user privacy, the
// `kSharedStorageExposeDebugMessageForSettingsStatus` feature param MUST remain
// false by default.
BASE_FEATURE_PARAM(bool,
kSharedStorageExposeDebugMessageForSettingsStatus,
&kSharedStorageAPI,
"ExposeDebugMessageForSettingsStatus",
false);
// Kill switch for the Interest Group API, i.e. if disabled, the
// API exposure will be disabled regardless of the OT config.
BASE_FEATURE(kInterestGroupStorage,
"InterestGroupStorage",
base::FEATURE_ENABLED_BY_DEFAULT);
// TODO(crbug.com/40176812): Adjust these limits in response to usage.
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxOwners,
&kInterestGroupStorage,
"max_owners",
1000);
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxStoragePerOwner,
&kInterestGroupStorage,
"max_storage_per_owner",
10 * 1024 * 1024);
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxGroupsPerOwner,
&kInterestGroupStorage,
"max_groups_per_owner",
2000);
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxNegativeGroupsPerOwner,
&kInterestGroupStorage,
"max_negative_groups_per_owner",
20000);
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxOpsBeforeMaintenance,
&kInterestGroupStorage,
"max_ops_before_maintenance",
1000);
} // namespace network::features

@ -178,6 +178,85 @@ BASE_DECLARE_FEATURE_PARAM(std::string, kDeprecateUnloadAllowlist);
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE(kUpdateRequestForCorsRedirect);
COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kBrowsingTopics);
COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kSharedStorageAPI);
// Maximum number of URLs allowed to be included in the input parameter for
// runURLSelectionOperation().
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(
size_t,
kSharedStorageURLSelectionOperationInputURLSizeLimit);
// Maximum database page size in bytes. Must be a power of two between
// 512 and 65536, inclusive.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kMaxSharedStoragePageSize);
// Maximum database in-memory cache size, in pages.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kMaxSharedStorageCacheSize);
// Maximum number of tries to initialize the database.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kMaxSharedStorageInitTries);
// Maximum number of keys or key-value pairs returned in each batch by
// the async `keys()` and `entries()` iterators, respectively.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kMaxSharedStorageIteratorBatchSize);
// Maximum number of bits of entropy allowed per origin to output via the Shared
// Storage API.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kSharedStorageBitBudget);
// Interval over which `kSharedStorageBitBudget` is defined.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(base::TimeDelta, kSharedStorageBudgetInterval);
// Initial interval from service startup after which
// SharedStorageManager first checks for any stale entries, purging any that it
// finds.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageStalePurgeInitialInterval);
// Second and subsequent intervals from service startup after
// which SharedStorageManager checks for any stale entries, purging any that it
// finds.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageStalePurgeRecurringInterval);
// Length of time between last key write access and key expiration. When an
// entry's data is older than this threshold, it will be auto-purged.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(base::TimeDelta, kSharedStorageStalenessThreshold);
// Maximum depth of fenced frame where sharedStorage.selectURL() is allowed to
// be invoked. The depth of a fenced frame is the number of the fenced frame
// boundaries above that frame (i.e. the outermost main frame's frame tree has
// fenced frame depth 0, a topmost fenced frame tree embedded in the outermost
// main frame has fenced frame depth 1, etc).
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(
size_t,
kSharedStorageMaxAllowedFencedFrameDepthForSelectURL);
// If enabled, sends additional details in the error message for the
// rejected promise when shared storage is disabled, for local troubleshooting
// and use in testing.
//
// NOTE: To preserve user privacy, this feature param MUST remain false by
// default.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(bool,
kSharedStorageExposeDebugMessageForSettingsStatus);
// Backend storage + kill switch for Interest Group API origin trials.
COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kInterestGroupStorage);
// Backend storage + kill switch for Interest Group API origin trials.
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kInterestGroupStorageMaxOwners);
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kInterestGroupStorageMaxStoragePerOwner);
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kInterestGroupStorageMaxGroupsPerOwner);
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kInterestGroupStorageMaxNegativeGroupsPerOwner);
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE_PARAM(int, kInterestGroupStorageMaxOpsBeforeMaintenance);
} // namespace network::features
#endif // SERVICES_NETWORK_PUBLIC_CPP_FEATURES_H_

@ -30,9 +30,9 @@ namespace network {
//
// Requests are eligible for shared storage when
// `ResourceRequest::shared_storage_writable` is true (which can only occur when
// `blink::features::kSharedStorageAPI` is enabled). When a request is eligible,
// `ProcessOutgoingRequest()` will add the "Sec-Shared-Storage-Writable" request
// header to the outgoing request.
// `network::features::kSharedStorageAPI` is enabled). When a request is
// eligible, `ProcessOutgoingRequest()` will add the
// "Sec-Shared-Storage-Writable" request header to the outgoing request.
//
// When "Shared-Storage-Write" response header(s) are received, if the request
// is eligible for shared storage, then `ProcessIncomingRequest()` will process

@ -12,7 +12,6 @@
#include "build/build_config.h"
#include "build/chromecast_buildflags.h"
#include "build/chromeos_buildflags.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features_generated.h"
#include "third_party/blink/public/common/forcedark/forcedark_switches.h"
#include "third_party/blink/public/common/interest_group/ad_auction_constants.h"
@ -233,12 +232,6 @@ BASE_FEATURE(kBoostNonRenderBlockingStyleLoadingTaskPriority,
"BoostNonRenderBlockingStyleLoadingTaskPriority",
base::FEATURE_ENABLED_BY_DEFAULT);
// https://github.com/patcg-individual-drafts/topics
// Kill switch for the Topics API.
BASE_FEATURE(kBrowsingTopics,
"BrowsingTopics",
base::FEATURE_ENABLED_BY_DEFAULT);
// If enabled, the check for whether the IP address is publicly routable will be
// bypassed when determining the eligibility for a page to be included in topics
// calculation. This is useful for developers to test in local environment.
@ -1155,38 +1148,6 @@ BASE_FEATURE(kInteractiveDetectorIgnoreFcp,
"InteractiveDetectorIgnoreFcp",
base::FEATURE_DISABLED_BY_DEFAULT);
// Kill switch for the Interest Group API, i.e. if disabled, the
// API exposure will be disabled regardless of the OT config.
BASE_FEATURE(kInterestGroupStorage,
"InterestGroupStorage",
base::FEATURE_ENABLED_BY_DEFAULT);
// TODO(crbug.com/1197209): Adjust these limits in response to usage.
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxOwners,
&kInterestGroupStorage,
"max_owners",
1000);
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxStoragePerOwner,
&kInterestGroupStorage,
"max_storage_per_owner",
10 * 1024 * 1024);
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxGroupsPerOwner,
&kInterestGroupStorage,
"max_groups_per_owner",
2000);
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxNegativeGroupsPerOwner,
&kInterestGroupStorage,
"max_negative_groups_per_owner",
20000);
BASE_FEATURE_PARAM(int,
kInterestGroupStorageMaxOpsBeforeMaintenance,
&kInterestGroupStorage,
"max_ops_before_maintenance",
1000);
// Allow process isolation of iframes with the 'sandbox' attribute set. Whether
// or not such an iframe will be isolated may depend on options specified with
// the attribute. Note: At present, only iframes with origin-restricted
@ -2313,77 +2274,6 @@ BASE_FEATURE(kSetIntervalWithoutClamp,
"SetIntervalWithoutClamp",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enable the shared storage API. Note that enabling this feature does not
// automatically expose this API to the web, it only allows the element to be
// enabled by the runtime enabled feature, for origin trials.
// https://github.com/pythagoraskitty/shared-storage/blob/main/README.md
BASE_FEATURE(kSharedStorageAPI,
"SharedStorageAPI",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE_PARAM(size_t,
kSharedStorageURLSelectionOperationInputURLSizeLimit,
&kSharedStorageAPI,
"url_selection_operation_input_url_size_limit",
8);
BASE_FEATURE_PARAM(int,
kMaxSharedStoragePageSize,
&kSharedStorageAPI,
"MaxSharedStoragePageSize",
4096);
BASE_FEATURE_PARAM(int,
kMaxSharedStorageCacheSize,
&kSharedStorageAPI,
"MaxSharedStorageCacheSize",
1024);
BASE_FEATURE_PARAM(int,
kMaxSharedStorageInitTries,
&kSharedStorageAPI,
"MaxSharedStorageInitTries",
2);
BASE_FEATURE_PARAM(int,
kMaxSharedStorageIteratorBatchSize,
&kSharedStorageAPI,
"MaxSharedStorageIteratorBatchSize",
100);
BASE_FEATURE_PARAM(int,
kSharedStorageBitBudget,
&kSharedStorageAPI,
"SharedStorageBitBudget",
12);
BASE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageBudgetInterval,
&kSharedStorageAPI,
"SharedStorageBudgetInterval",
base::Hours(24));
BASE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageStalePurgeInitialInterval,
&kSharedStorageAPI,
"SharedStorageStalePurgeInitialInterval",
base::Minutes(2));
BASE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageStalePurgeRecurringInterval,
&kSharedStorageAPI,
"SharedStorageStalePurgeRecurringInterval",
base::Hours(2));
BASE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageStalenessThreshold,
&kSharedStorageAPI,
"SharedStorageStalenessThreshold",
base::Days(30));
BASE_FEATURE_PARAM(size_t,
kSharedStorageMaxAllowedFencedFrameDepthForSelectURL,
&kSharedStorageAPI,
"SharedStorageMaxAllowedFencedFrameDepthForSelectURL",
1);
// NOTE: To preserve user privacy, the
// `kSharedStorageExposeDebugMessageForSettingsStatus` feature param MUST remain
// false by default.
BASE_FEATURE_PARAM(bool,
kSharedStorageExposeDebugMessageForSettingsStatus,
&kSharedStorageAPI,
"ExposeDebugMessageForSettingsStatus",
false);
BASE_FEATURE(kSharedStorageWorkletSharedBackingThreadImplementation,
"SharedStorageWorkletSharedBackingThreadImplementation",
base::FEATURE_DISABLED_BY_DEFAULT);

@ -8,6 +8,7 @@
#include "base/containers/map_util.h"
#include "base/memory/ptr_util.h"
#include "base/no_destructor.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/permissions_policy/client_hints_permissions_policy_mapping.h"
#include "services/network/public/cpp/permissions_policy/fenced_frame_permissions_policies.h"
#include "services/network/public/cpp/permissions_policy/origin_with_possible_wildcards.h"
@ -16,7 +17,6 @@
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
#include "services/network/public/mojom/web_sandbox_flags.mojom-shared.h"
#include "third_party/blink/public/common/features.h"
#include "url/gurl.h"
namespace blink {
@ -192,7 +192,7 @@ bool PermissionsPolicy::IsFeatureEnabledForSubresourceRequest(
// Derive the opt-in features from the request attributes.
std::set<network::mojom::PermissionsPolicyFeature> opt_in_features;
if (request.browsing_topics) {
DCHECK(base::FeatureList::IsEnabled(blink::features::kBrowsingTopics));
DCHECK(base::FeatureList::IsEnabled(network::features::kBrowsingTopics));
opt_in_features.insert(
network::mojom::PermissionsPolicyFeature::kBrowsingTopics);
@ -205,14 +205,14 @@ bool PermissionsPolicy::IsFeatureEnabledForSubresourceRequest(
// `network::ResourceRequest` is not available at the call site and
// `blink::ResourceRequest` should not be used in blink public APIs.
if (request.shared_storage_writable_eligible) {
DCHECK(base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI));
DCHECK(base::FeatureList::IsEnabled(network::features::kSharedStorageAPI));
opt_in_features.insert(
network::mojom::PermissionsPolicyFeature::kSharedStorage);
}
if (request.ad_auction_headers) {
DCHECK(
base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage));
base::FeatureList::IsEnabled(network::features::kInterestGroupStorage));
opt_in_features.insert(
network::mojom::PermissionsPolicyFeature::kRunAdAuction);

@ -2079,9 +2079,9 @@ TEST_F(PermissionsPolicyTest, TestUndefinedFeaturesInFramePolicy) {
TEST_F(PermissionsPolicyTest,
ProposedTestIsFeatureEnabledForSubresourceRequest) {
base::test::ScopedFeatureList feature_list;
feature_list.InitWithFeatures(
{blink::features::kBrowsingTopics, blink::features::kSharedStorageAPI},
/*disabled_features=*/{});
feature_list.InitWithFeatures({network::features::kBrowsingTopics,
network::features::kSharedStorageAPI},
/*disabled_features=*/{});
network::ResourceRequest request_without_any_opt_in;
@ -2457,7 +2457,7 @@ TEST_F(PermissionsPolicyTest,
TEST_F(PermissionsPolicyTest,
ProposedTestIsFeatureEnabledForSubresourceRequestAssumingOptIn) {
base::test::ScopedFeatureList feature_list;
feature_list.InitWithFeatures({blink::features::kSharedStorageAPI},
feature_list.InitWithFeatures({network::features::kSharedStorageAPI},
/*disabled_features=*/{});
{

@ -8,6 +8,7 @@
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_util.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
namespace blink {
@ -15,8 +16,8 @@ namespace blink {
bool IsValidSharedStorageURLsArrayLength(size_t length) {
return length != 0 &&
length <=
features::kSharedStorageURLSelectionOperationInputURLSizeLimit
.Get();
network::features::
kSharedStorageURLSelectionOperationInputURLSizeLimit.Get();
}
void LogSharedStorageWorkletError(SharedStorageWorkletErrorType error_type) {

@ -155,7 +155,6 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(
kBoostNonRenderBlockingStyleLoadingTaskPriority);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBrowsingTopics);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(
kBrowsingTopicsBypassIPIsPubliclyRoutableCheck);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBrowsingTopicsDocumentAPI);
@ -695,23 +694,6 @@ BLINK_COMMON_EXPORT extern const char
// Don't require FCP for the page to turn interactive. Useful for testing.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kInteractiveDetectorIgnoreFcp);
// Backend storage + kill switch for Interest Group API origin trials.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kInterestGroupStorage);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(int,
kInterestGroupStorageMaxOwners);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
int,
kInterestGroupStorageMaxStoragePerOwner);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
int,
kInterestGroupStorageMaxGroupsPerOwner);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
int,
kInterestGroupStorageMaxNegativeGroupsPerOwner);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
int,
kInterestGroupStorageMaxOpsBeforeMaintenance);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kIsolateSandboxedIframes);
enum class IsolateSandboxedIframesGrouping {
// In this grouping, all isolated sandboxed iframes whose URLs share the same
@ -1549,66 +1531,6 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSetLowPriorityForBeacon);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSetIntervalWithoutClamp);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kSharedStorageAPI);
// Maximum number of URLs allowed to be included in the input parameter for
// runURLSelectionOperation().
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
size_t,
kSharedStorageURLSelectionOperationInputURLSizeLimit);
// Maximum database page size in bytes. Must be a power of two between
// 512 and 65536, inclusive.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(int, kMaxSharedStoragePageSize);
// Maximum database in-memory cache size, in pages.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(int, kMaxSharedStorageCacheSize);
// Maximum number of tries to initialize the database.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(int, kMaxSharedStorageInitTries);
// Maximum number of keys or key-value pairs returned in each batch by
// the async `keys()` and `entries()` iterators, respectively.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
int,
kMaxSharedStorageIteratorBatchSize);
// Maximum number of bits of entropy allowed per origin to output via the Shared
// Storage API.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(int, kSharedStorageBitBudget);
// Interval over which `kSharedStorageBitBudget` is defined.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(base::TimeDelta,
kSharedStorageBudgetInterval);
// Initial interval from service startup after which
// SharedStorageManager first checks for any stale entries, purging any that it
// finds.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
base::TimeDelta,
kSharedStorageStalePurgeInitialInterval);
// Second and subsequent intervals from service startup after
// which SharedStorageManager checks for any stale entries, purging any that it
// finds.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
base::TimeDelta,
kSharedStorageStalePurgeRecurringInterval);
// Length of time between last key write access and key expiration. When an
// entry's data is older than this threshold, it will be auto-purged.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
base::TimeDelta,
kSharedStorageStalenessThreshold);
// Maximum depth of fenced frame where sharedStorage.selectURL() is allowed to
// be invoked. The depth of a fenced frame is the number of the fenced frame
// boundaries above that frame (i.e. the outermost main frame's frame tree has
// fenced frame depth 0, a topmost fenced frame tree embedded in the outermost
// main frame has fenced frame depth 1, etc).
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
size_t,
kSharedStorageMaxAllowedFencedFrameDepthForSelectURL);
// If enabled, sends additional details in the error message for the
// rejected promise when shared storage is disabled, for local troubleshooting
// and use in testing.
//
// NOTE: To preserve user privacy, this feature param MUST remain false by
// default.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE_PARAM(
bool,
kSharedStorageExposeDebugMessageForSettingsStatus);
// If enabled, the shared storage worklet threads (on the same renderer process)
// will share the same backing thread; otherwise, each will own a dedicated
// backing thread.

@ -514,7 +514,8 @@ void OriginTrialContext::AddForceEnabledTrials(
bool OriginTrialContext::CanEnableTrialFromName(const StringView& trial_name) {
if (trial_name == "FledgeBiddingAndAuctionServer") {
return base::FeatureList::IsEnabled(features::kInterestGroupStorage) &&
return base::FeatureList::IsEnabled(
network::features::kInterestGroupStorage) &&
base::FeatureList::IsEnabled(
features::kFledgeBiddingAndAuctionServer);
}
@ -522,8 +523,10 @@ bool OriginTrialContext::CanEnableTrialFromName(const StringView& trial_name) {
if (trial_name == "FencedFrames")
return base::FeatureList::IsEnabled(features::kFencedFrames);
if (trial_name == "AdInterestGroupAPI")
return base::FeatureList::IsEnabled(features::kInterestGroupStorage);
if (trial_name == "AdInterestGroupAPI") {
return base::FeatureList::IsEnabled(
network::features::kInterestGroupStorage);
}
if (trial_name == "SpeculationRulesPrefetchFuture") {
return base::FeatureList::IsEnabled(

@ -7,6 +7,7 @@
#include <memory>
#include "base/test/scoped_feature_list.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/permissions_policy/permissions_policy_declaration.h"
#include "services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
@ -79,9 +80,9 @@ TEST(ResourceRequestTest, UpgradeIfInsecureAcrossRedirects) {
// feature's default state.
TEST(ResourceRequestTest, IsFeatureEnabledForSubresourceRequestAssumingOptIn) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitWithFeatures(
{blink::features::kBrowsingTopics, blink::features::kSharedStorageAPI},
/*disabled_features=*/{});
scoped_feature_list.InitWithFeatures({network::features::kBrowsingTopics,
network::features::kSharedStorageAPI},
/*disabled_features=*/{});
ResourceRequest request_with_topics_opt_in;
request_with_topics_opt_in.SetBrowsingTopics(true);

@ -2391,9 +2391,13 @@ _CONFIG = [
},
{
'paths': [
'third_party/blink/common/permissions_policy/permissions_policy.cc',
'third_party/blink/public/common/permissions_policy/permissions_policy.h',
],
'allowed': [
'network::features::kBrowsingTopics',
'network::features::kInterestGroupStorage',
'network::features::kSharedStorageAPI',
'url::Origin',
]
},
@ -2473,6 +2477,16 @@ _CONFIG = [
'gfx::SkPixmapToWritableSpan',
]
},
{
'paths': [
'third_party/blink/common/features.cc',
],
'allowed': [
'network::features::kBrowsingTopics',
'network::features::kInterestGroupStorage',
'network::features::kSharedStorageAPI',
]
},
{
'paths': [
'third_party/blink/common/client_hints/client_hints.cc',