Commit 648a6fed authored by John Abd-El-Malek's avatar John Abd-El-Malek Committed by Commit Bot

Rename the network service flag on desktop.

The old code path doesn't work anymore, but we still need the feature flag because WebView hasn't launched yet. Rename the flag on desktop, so that users with shortcuts that disable the feature still get it enabled.

Bug: 970183
Change-Id: I089a17b0fced1fc0fa246fe91ddd37d49274c9f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1643416
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666165}
parent 341911bb
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "chrome/test/base/chrome_unit_test_suite.h" #include "chrome/test/base/chrome_unit_test_suite.h"
#include "content/public/test/unittest_test_suite.h" #include "content/public/test/unittest_test_suite.h"
#include "mojo/core/embedder/scoped_ipc_support.h" #include "mojo/core/embedder/scoped_ipc_support.h"
#include "services/network/public/cpp/features.h"
#if defined(OS_WIN) #if defined(OS_WIN)
#include "chrome/install_static/test/scoped_install_details.h" #include "chrome/install_static/test/scoped_install_details.h"
...@@ -21,8 +22,9 @@ int main(int argc, char **argv) { ...@@ -21,8 +22,9 @@ int main(int argc, char **argv) {
// unit_tests don't currently work with the Network Service enabled. // unit_tests don't currently work with the Network Service enabled.
// https://crbug.com/966633. // https://crbug.com/966633.
content::UnitTestTestSuite test_suite(new ChromeUnitTestSuite(argc, argv), content::UnitTestTestSuite test_suite(
"NetworkService"); new ChromeUnitTestSuite(argc, argv),
network::features::kNetworkServiceFeatureName);
base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart);
mojo::core::ScopedIPCSupport ipc_support( mojo::core::ScopedIPCSupport ipc_support(
......
...@@ -6,6 +6,7 @@ include_rules = [ ...@@ -6,6 +6,7 @@ include_rules = [
"+jni", "+jni",
"+media", "+media",
"+net", "+net",
"+services/network/public/cpp",
"+ui", "+ui",
] ]
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "build/buildflag.h" #include "build/buildflag.h"
#include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/content_settings_pattern.h"
#include "mojo/core/embedder/embedder.h" #include "mojo/core/embedder/embedder.h"
#include "services/network/public/cpp/features.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
...@@ -145,7 +146,8 @@ base::RunTestSuiteCallback GetLaunchCallback(int argc, char** argv) { ...@@ -145,7 +146,8 @@ base::RunTestSuiteCallback GetLaunchCallback(int argc, char** argv) {
// components_unittests don't currently work with the Network Service enabled. // components_unittests don't currently work with the Network Service enabled.
// https://crbug.com/966633. // https://crbug.com/966633.
auto test_suite = std::make_unique<content::UnitTestTestSuite>( auto test_suite = std::make_unique<content::UnitTestTestSuite>(
new ComponentsTestSuite(argc, argv), "NetworkService"); new ComponentsTestSuite(argc, argv),
network::features::kNetworkServiceFeatureName);
#else #else
auto test_suite = std::make_unique<ComponentsTestSuite>(argc, argv); auto test_suite = std::make_unique<ComponentsTestSuite>(argc, argv);
#endif #endif
......
...@@ -9,6 +9,15 @@ ...@@ -9,6 +9,15 @@
namespace network { namespace network {
namespace features { namespace features {
const char kNetworkServiceFeatureName[] =
#if defined(OS_ANDROID)
"NetworkService";
#else
// Rename the flag so that shortcuts with the old name don't work.
// This codepath doesn't work anymore on desktop.
"NetworkServiceNotSupported";
#endif
// Enables Expect CT reporting, which sends reports for opted-in sites // Enables Expect CT reporting, which sends reports for opted-in sites
// that don't serve sufficient Certificate Transparency information. // that don't serve sufficient Certificate Transparency information.
const base::Feature kExpectCTReporting{"ExpectCTReporting", const base::Feature kExpectCTReporting{"ExpectCTReporting",
...@@ -17,7 +26,7 @@ const base::Feature kExpectCTReporting{"ExpectCTReporting", ...@@ -17,7 +26,7 @@ const base::Feature kExpectCTReporting{"ExpectCTReporting",
const base::Feature kNetworkErrorLogging{"NetworkErrorLogging", const base::Feature kNetworkErrorLogging{"NetworkErrorLogging",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Enables the network service. // Enables the network service.
const base::Feature kNetworkService{"NetworkService", const base::Feature kNetworkService{kNetworkServiceFeatureName,
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Out of Blink CORS // Out of Blink CORS
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
namespace network { namespace network {
namespace features { namespace features {
COMPONENT_EXPORT(NETWORK_CPP)
extern const char kNetworkServiceFeatureName[];
COMPONENT_EXPORT(NETWORK_CPP) COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kExpectCTReporting; extern const base::Feature kExpectCTReporting;
COMPONENT_EXPORT(NETWORK_CPP) COMPONENT_EXPORT(NETWORK_CPP)
......
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