Commit a957514d authored by cfredric's avatar cfredric Committed by Commit Bot

Move `kFirstPartySet` feature to net/base/features.h.

This enables usage of the feature flag in net/ code, since
services/network code can depend on net/ but not vice versa.

Bug: 1143756
Change-Id: I0f78a995cb14b2acd6a12991c1b6afedad12e0b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542813Reviewed-by: default avatarLily Chen <chlily@chromium.org>
Reviewed-by: default avatarMaksim Orlovich <morlovich@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828753}
parent 7b527937
......@@ -17,7 +17,7 @@
#include "base/version.h"
#include "components/component_updater/component_updater_paths.h"
#include "content/public/browser/network_service_instance.h"
#include "services/network/public/cpp/features.h"
#include "net/base/features.h"
#include "services/network/public/mojom/network_service.mojom.h"
using component_updater::ComponentUpdateService;
......@@ -148,7 +148,7 @@ std::vector<std::string> FirstPartySetsComponentInstallerPolicy::GetMimeTypes()
}
void RegisterFirstPartySetsComponent(ComponentUpdateService* cus) {
if (!base::FeatureList::IsEnabled(network::features::kFirstPartySets))
if (!base::FeatureList::IsEnabled(net::features::kFirstPartySets))
return;
VLOG(1) << "Registering First-Party Sets component.";
auto installer = base::MakeRefCounted<ComponentInstaller>(
......
......@@ -16,7 +16,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_browser_process.h"
#include "components/component_updater/mock_component_updater_service.h"
#include "services/network/public/cpp/features.h"
#include "net/base/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -40,7 +40,7 @@ class FirstPartySetsComponentInstallerTest : public ::testing::Test {
TEST_F(FirstPartySetsComponentInstallerTest, FeatureDisabled) {
base::test::ScopedFeatureList scoped_list;
scoped_list.InitAndDisableFeature(network::features::kFirstPartySets);
scoped_list.InitAndDisableFeature(net::features::kFirstPartySets);
auto service =
std::make_unique<component_updater::MockComponentUpdateService>();
EXPECT_CALL(*service, RegisterComponent(_)).Times(0);
......@@ -51,7 +51,7 @@ TEST_F(FirstPartySetsComponentInstallerTest, FeatureDisabled) {
TEST_F(FirstPartySetsComponentInstallerTest, LoadsSets) {
base::test::ScopedFeatureList scoped_list;
scoped_list.InitAndEnableFeature(network::features::kFirstPartySets);
scoped_list.InitAndEnableFeature(net::features::kFirstPartySets);
SEQUENCE_CHECKER(sequence_checker);
const std::string expectation = "some first party sets";
......
......@@ -193,5 +193,7 @@ extern const base::FeatureParam<base::TimeDelta> kTimeoutTcpConnectAttemptMax(
"TimeoutTcpConnectAttemptMax",
base::TimeDelta::FromSeconds(30));
constexpr base::Feature kFirstPartySets{"FirstPartySets",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace features
} // namespace net
......@@ -287,6 +287,9 @@ NET_EXPORT extern const base::FeatureParam<base::TimeDelta>
NET_EXPORT extern const base::FeatureParam<base::TimeDelta>
kTimeoutTcpConnectAttemptMax;
// Enables usage of First Party Sets to determine cookie availability.
NET_EXPORT extern const base::Feature kFirstPartySets;
} // namespace features
} // namespace net
......
......@@ -214,9 +214,5 @@ const base::FeatureParam<bool> kPlatformProvidedTrustTokenIssuance{
const base::Feature kWebSocketReassembleShortMessages{
"WebSocketReassembleShortMessages", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables usage of First Party Sets to determine cookie availability.
constexpr base::Feature kFirstPartySets{"FirstPartySets",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace features
} // namespace network
......@@ -81,9 +81,6 @@ extern const base::FeatureParam<bool> kPlatformProvidedTrustTokenIssuance;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kWebSocketReassembleShortMessages;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kFirstPartySets;
} // namespace features
} // namespace network
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment