chore: make it possible to turn on NetworkService with cmd flag (#17729)

This commit is contained in:
Cheng Zhao 2019-04-11 08:51:17 +09:00 committed by GitHub
parent e7c48922e7
commit 748632d655
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 2 deletions

View file

@ -208,8 +208,7 @@ void AtomBrowserMainParts::InitializeFeatureList() {
// Can be reenabled when our site instance policy is aligned with chromium
// when node integration is enabled.
disable_features +=
std::string(",") + features::kSpareRendererForSitePerProcess.name +
std::string(",") + network::features::kNetworkService.name;
std::string(",") + features::kSpareRendererForSitePerProcess.name;
auto feature_list = std::make_unique<base::FeatureList>();
feature_list->InitializeFromCommandLine(enable_features, disable_features);
base::FeatureList::SetInstance(std::move(feature_list));

View file

@ -72,3 +72,4 @@ fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch
fix_disable_usage_of_setapplicationisdaemon_and.patch
disable_custom_libcxx_on_windows.patch
fix_retain_compatibility_with_msvc.patch
disable_network_services_by_default.patch

View file

@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Tue, 9 April 2019 14:57:02 -0700
Subject: disable_network_services_by_default.patch
Disable NetworkService by default.
This allows us to enable NetworkService with command line flags, which makes it
easier to work on NetworkService migration.
We should remove this patch after all Electron's code has been migrated to the
NetworkService.
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
index 5276ed9798d9..9d4d6421c75a 100644
--- a/services/network/public/cpp/features.cc
+++ b/services/network/public/cpp/features.cc
@@ -21,7 +21,7 @@ const base::Feature kNetworkService {
"NetworkService",
#if defined(OS_WIN) || defined(OS_MACOSX) || \
(defined(OS_LINUX) && !defined(IS_CHROMECAST))
- base::FEATURE_ENABLED_BY_DEFAULT
+ base::FEATURE_DISABLED_BY_DEFAULT
};
#else
base::FEATURE_DISABLED_BY_DEFAULT