Commit 301d265e authored by John Abd-El-Malek's avatar John Abd-El-Malek Committed by Commit Bot

Remove some kNetworkService checks in the code.

Bug: 934009
Change-Id: If1af2ec4d66ead9c3fa2f7f36ccabfb726bbec7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739110
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarClark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684430}
parent 3cd045bd
...@@ -5,12 +5,10 @@ ...@@ -5,12 +5,10 @@
#include "android_webview/browser/aw_browser_context.h" #include "android_webview/browser/aw_browser_context.h"
#include "android_webview/browser/aw_browser_process.h" #include "android_webview/browser/aw_browser_process.h"
#include "android_webview/browser/aw_feature_list_creator.h" #include "android_webview/browser/aw_feature_list_creator.h"
#include "base/test/scoped_feature_list.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_content_client_initializer.h" #include "content/public/test/test_content_client_initializer.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"
namespace android_webview { namespace android_webview {
...@@ -19,7 +17,6 @@ class AwBrowserContextTest : public testing::Test { ...@@ -19,7 +17,6 @@ class AwBrowserContextTest : public testing::Test {
protected: protected:
void SetUp() override { void SetUp() override {
mojo::core::Init(); mojo::core::Init();
feature_list_.InitAndEnableFeature(network::features::kNetworkService);
test_content_client_initializer_ = test_content_client_initializer_ =
new content::TestContentClientInitializer(); new content::TestContentClientInitializer();
...@@ -30,7 +27,6 @@ class AwBrowserContextTest : public testing::Test { ...@@ -30,7 +27,6 @@ class AwBrowserContextTest : public testing::Test {
void TearDown() override { delete test_content_client_initializer_; } void TearDown() override { delete test_content_client_initializer_; }
base::test::ScopedFeatureList feature_list_;
// Create the TestBrowserThreads. // Create the TestBrowserThreads.
content::TestBrowserThreadBundle thread_bundle_; content::TestBrowserThreadBundle thread_bundle_;
content::TestContentClientInitializer* test_content_client_initializer_; content::TestContentClientInitializer* test_content_client_initializer_;
......
...@@ -95,7 +95,6 @@ ...@@ -95,7 +95,6 @@
#include "net/ssl/ssl_cert_request_info.h" #include "net/ssl/ssl_cert_request_info.h"
#include "net/ssl/ssl_info.h" #include "net/ssl/ssl_info.h"
#include "services/network/network_service.h" #include "services/network/network_service.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/cookie_manager.mojom-forward.h" #include "services/network/public/mojom/cookie_manager.mojom-forward.h"
#include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/binder_registry.h"
...@@ -949,7 +948,6 @@ bool AwContentBrowserClient::WillCreateURLLoaderFactory( ...@@ -949,7 +948,6 @@ bool AwContentBrowserClient::WillCreateURLLoaderFactory(
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver, mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client, network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,
bool* bypass_redirect_checks) { bool* bypass_redirect_checks) {
DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService));
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto proxied_receiver = std::move(*factory_receiver); auto proxied_receiver = std::move(*factory_receiver);
...@@ -968,7 +966,6 @@ bool AwContentBrowserClient::WillCreateURLLoaderFactory( ...@@ -968,7 +966,6 @@ bool AwContentBrowserClient::WillCreateURLLoaderFactory(
void AwContentBrowserClient::WillCreateURLLoaderFactoryForAppCacheSubresource( void AwContentBrowserClient::WillCreateURLLoaderFactoryForAppCacheSubresource(
int render_process_id, int render_process_id,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* pending_factory) { mojo::PendingRemote<network::mojom::URLLoaderFactory>* pending_factory) {
DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService));
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto pending_proxy = std::move(*pending_factory); auto pending_proxy = std::move(*pending_factory);
......
...@@ -5,10 +5,8 @@ ...@@ -5,10 +5,8 @@
#include "android_webview/browser/aw_content_browser_client.h" #include "android_webview/browser/aw_content_browser_client.h"
#include "android_webview/browser/aw_feature_list_creator.h" #include "android_webview/browser/aw_feature_list_creator.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.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"
namespace android_webview { namespace android_webview {
...@@ -17,11 +15,9 @@ class AwContentBrowserClientTest : public testing::Test { ...@@ -17,11 +15,9 @@ class AwContentBrowserClientTest : public testing::Test {
protected: protected:
void SetUp() override { void SetUp() override {
mojo::core::Init(); mojo::core::Init();
feature_list_.InitAndEnableFeature(network::features::kNetworkService);
} }
base::test::ScopedTaskEnvironment scoped_task_environment_; base::test::ScopedTaskEnvironment scoped_task_environment_;
base::test::ScopedFeatureList feature_list_;
}; };
TEST_F(AwContentBrowserClientTest, DisableCreatingThreadPool) { TEST_F(AwContentBrowserClientTest, DisableCreatingThreadPool) {
......
...@@ -6,13 +6,11 @@ ...@@ -6,13 +6,11 @@
#include "android_webview/browser/input_stream.h" #include "android_webview/browser/input_stream.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
#include "content/public/common/resource_type.h" #include "content/public/common/resource_type.h"
#include "mojo/core/embedder/embedder.h" #include "mojo/core/embedder/embedder.h"
#include "net/http/http_request_headers.h" #include "net/http/http_request_headers.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/features.h"
#include "services/network/test/test_url_loader_client.h" #include "services/network/test/test_url_loader_client.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -161,7 +159,6 @@ class AndroidStreamReaderURLLoaderTest : public ::testing::Test { ...@@ -161,7 +159,6 @@ class AndroidStreamReaderURLLoaderTest : public ::testing::Test {
void SetUp() override { void SetUp() override {
mojo::core::Init(); mojo::core::Init();
feature_list_.InitAndEnableFeature(network::features::kNetworkService);
} }
network::ResourceRequest CreateRequest(const GURL& url) { network::ResourceRequest CreateRequest(const GURL& url) {
...@@ -236,7 +233,6 @@ class AndroidStreamReaderURLLoaderTest : public ::testing::Test { ...@@ -236,7 +233,6 @@ class AndroidStreamReaderURLLoaderTest : public ::testing::Test {
return std::string(buffer.data(), buffer.size()); return std::string(buffer.data(), buffer.size());
} }
base::test::ScopedFeatureList feature_list_;
base::test::ScopedTaskEnvironment scoped_task_environment_; base::test::ScopedTaskEnvironment scoped_task_environment_;
DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLLoaderTest); DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLLoaderTest);
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "components/data_reduction_proxy/proto/data_store.pb.h" #include "components/data_reduction_proxy/proto/data_store.pb.h"
#include "components/data_use_measurement/core/data_use_measurement.h" #include "components/data_use_measurement/core/data_use_measurement.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "services/network/public/cpp/features.h"
namespace data_reduction_proxy { namespace data_reduction_proxy {
...@@ -70,8 +69,7 @@ DataReductionProxyService::DataReductionProxyService( ...@@ -70,8 +69,7 @@ DataReductionProxyService::DataReductionProxyService(
} }
network_quality_tracker_->AddEffectiveConnectionTypeObserver(this); network_quality_tracker_->AddEffectiveConnectionTypeObserver(this);
network_quality_tracker_->AddRTTAndThroughputEstimatesObserver(this); network_quality_tracker_->AddRTTAndThroughputEstimatesObserver(this);
if (base::FeatureList::IsEnabled(network::features::kNetworkService) && if (data_use_measurement_) { // null in unit tests.
data_use_measurement_) { // null in unit tests.
data_use_measurement_->AddServicesDataUseObserver(this); data_use_measurement_->AddServicesDataUseObserver(this);
} }
...@@ -90,8 +88,7 @@ DataReductionProxyService::~DataReductionProxyService() { ...@@ -90,8 +88,7 @@ DataReductionProxyService::~DataReductionProxyService() {
network_connection_tracker_->RemoveNetworkConnectionObserver(this); network_connection_tracker_->RemoveNetworkConnectionObserver(this);
compression_stats_.reset(); compression_stats_.reset();
db_task_runner_->DeleteSoon(FROM_HERE, db_data_owner_.release()); db_task_runner_->DeleteSoon(FROM_HERE, db_data_owner_.release());
if (base::FeatureList::IsEnabled(network::features::kNetworkService) && if (data_use_measurement_) { // null in unit tests.
data_use_measurement_) { // null in unit tests.
data_use_measurement_->RemoveServicesDataUseObserver(this); data_use_measurement_->RemoveServicesDataUseObserver(this);
} }
} }
...@@ -384,7 +381,6 @@ void DataReductionProxyService::OnServicesDataUse(int32_t service_hash_code, ...@@ -384,7 +381,6 @@ void DataReductionProxyService::OnServicesDataUse(int32_t service_hash_code,
if (compression_stats_) { if (compression_stats_) {
// Record non-content initiated traffic to the Other bucket for data saver // Record non-content initiated traffic to the Other bucket for data saver
// site-breakdown. // site-breakdown.
DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService));
compression_stats_->RecordDataUseByHost( compression_stats_->RecordDataUseByHost(
util::GetSiteBreakdownOtherHostName(), sent_bytes, sent_bytes, util::GetSiteBreakdownOtherHostName(), sent_bytes, sent_bytes,
base::Time::Now()); base::Time::Now());
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "net/base/network_change_notifier.h" #include "net/base/network_change_notifier.h"
#include "net/http/http_request_headers.h" #include "net/http/http_request_headers.h"
#include "services/network/public/cpp/features.h"
namespace { namespace {
...@@ -142,8 +141,7 @@ void DataReductionProxySettings::SetDataSaverEnabledForTesting( ...@@ -142,8 +141,7 @@ void DataReductionProxySettings::SetDataSaverEnabledForTesting(
} }
bool DataReductionProxySettings::IsDataReductionProxyEnabled() const { bool DataReductionProxySettings::IsDataReductionProxyEnabled() const {
if (base::FeatureList::IsEnabled(network::features::kNetworkService) && if (!params::IsEnabledWithNetworkService()) {
!params::IsEnabledWithNetworkService()) {
return false; return false;
} }
return IsDataSaverEnabledByUser(GetOriginalProfilePrefs()); return IsDataSaverEnabledByUser(GetOriginalProfilePrefs());
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "net/base/host_port_pair.h" #include "net/base/host_port_pair.h"
#include "net/base/proxy_server.h" #include "net/base/proxy_server.h"
#include "net/http/http_status_code.h" #include "net/http/http_status_code.h"
#include "services/network/public/cpp/features.h"
#include "url/url_constants.h" #include "url/url_constants.h"
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
...@@ -364,9 +363,8 @@ GURL GetSecureProxyCheckURL() { ...@@ -364,9 +363,8 @@ GURL GetSecureProxyCheckURL() {
bool IsEnabledWithNetworkService() { bool IsEnabledWithNetworkService() {
return base::FeatureList::IsEnabled( return base::FeatureList::IsEnabled(
data_reduction_proxy::features:: data_reduction_proxy::features::
kDataReductionProxyEnabledWithNetworkService) && kDataReductionProxyEnabledWithNetworkService);
base::FeatureList::IsEnabled(network::features::kNetworkService);
} }
base::Optional<DataReductionProxyTypeInfo> FindConfiguredProxyInVector( base::Optional<DataReductionProxyTypeInfo> FindConfiguredProxyInVector(
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_thread.h"
#include "services/network/public/cpp/features.h"
#include "services/service_manager/public/cpp/interface_provider.h" #include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/blink/public/common/loader/url_loader_factory_bundle.h" #include "third_party/blink/public/common/loader/url_loader_factory_bundle.h"
#include "third_party/blink/public/platform/web_isolated_world_info.h" #include "third_party/blink/public/platform/web_isolated_world_info.h"
...@@ -292,10 +291,8 @@ void TranslateHelper::Translate( ...@@ -292,10 +291,8 @@ void TranslateHelper::Translate(
url::Origin translate_origin = url::Origin translate_origin =
url::Origin::Create(GetTranslateSecurityOrigin()); url::Origin::Create(GetTranslateSecurityOrigin());
if (base::FeatureList::IsEnabled(network::features::kNetworkService)) { render_frame()->MarkInitiatorAsRequiringSeparateURLLoaderFactory(
render_frame()->MarkInitiatorAsRequiringSeparateURLLoaderFactory( translate_origin, std::move(loader_factory_for_translate_script));
translate_origin, std::move(loader_factory_for_translate_script));
}
WebLocalFrame* main_frame = render_frame()->GetWebFrame(); WebLocalFrame* main_frame = render_frame()->GetWebFrame();
if (!main_frame) { if (!main_frame) {
......
...@@ -292,9 +292,6 @@ void SetIndividualRuntimeFeatures( ...@@ -292,9 +292,6 @@ void SetIndividualRuntimeFeatures(
if (base::FeatureList::IsEnabled(features::kServiceWorkerPaymentApps)) if (base::FeatureList::IsEnabled(features::kServiceWorkerPaymentApps))
WebRuntimeFeatures::EnablePaymentApp(true); WebRuntimeFeatures::EnablePaymentApp(true);
WebRuntimeFeatures::EnableNetworkService(
base::FeatureList::IsEnabled(network::features::kNetworkService));
if (base::FeatureList::IsEnabled(features::kCompositeOpaqueFixedPosition)) if (base::FeatureList::IsEnabled(features::kCompositeOpaqueFixedPosition))
WebRuntimeFeatures::EnableFeatureFromString("CompositeOpaqueFixedPosition", WebRuntimeFeatures::EnableFeatureFromString("CompositeOpaqueFixedPosition",
true); true);
......
...@@ -123,7 +123,6 @@ class WebRuntimeFeatures { ...@@ -123,7 +123,6 @@ class WebRuntimeFeatures {
bool); bool);
BLINK_PLATFORM_EXPORT static void EnableNavigatorContentUtils(bool); BLINK_PLATFORM_EXPORT static void EnableNavigatorContentUtils(bool);
BLINK_PLATFORM_EXPORT static void EnableNetInfoDownlinkMax(bool); BLINK_PLATFORM_EXPORT static void EnableNetInfoDownlinkMax(bool);
BLINK_PLATFORM_EXPORT static void EnableNetworkService(bool);
BLINK_PLATFORM_EXPORT static void EnableUpdateHoverAtBeginFrame(bool); BLINK_PLATFORM_EXPORT static void EnableUpdateHoverAtBeginFrame(bool);
BLINK_PLATFORM_EXPORT static void EnableNotificationConstructor(bool); BLINK_PLATFORM_EXPORT static void EnableNotificationConstructor(bool);
BLINK_PLATFORM_EXPORT static void EnableNotificationContentImage(bool); BLINK_PLATFORM_EXPORT static void EnableNotificationContentImage(bool);
......
...@@ -272,10 +272,6 @@ void WebRuntimeFeatures::EnableNetInfoDownlinkMax(bool enable) { ...@@ -272,10 +272,6 @@ void WebRuntimeFeatures::EnableNetInfoDownlinkMax(bool enable) {
RuntimeEnabledFeatures::SetNetInfoDownlinkMaxEnabled(enable); RuntimeEnabledFeatures::SetNetInfoDownlinkMaxEnabled(enable);
} }
void WebRuntimeFeatures::EnableNetworkService(bool enable) {
RuntimeEnabledFeatures::SetNetworkServiceEnabled(enable);
}
void WebRuntimeFeatures::EnableOnDeviceChange(bool enable) { void WebRuntimeFeatures::EnableOnDeviceChange(bool enable) {
RuntimeEnabledFeatures::SetOnDeviceChangeEnabled(enable); RuntimeEnabledFeatures::SetOnDeviceChangeEnabled(enable);
} }
......
...@@ -1036,9 +1036,6 @@ ...@@ -1036,9 +1036,6 @@
// Only Android, ChromeOS support NetInfo downlinkMax, type and ontypechange now // Only Android, ChromeOS support NetInfo downlinkMax, type and ontypechange now
status: {"Android": "stable", "ChromeOS": "stable"}, status: {"Android": "stable", "ChromeOS": "stable"},
}, },
{
name: "NetworkService",
},
// Not a web exposed feature, enabled from the command line. // Not a web exposed feature, enabled from the command line.
{ {
name: "NewRemotePlaybackPipeline", name: "NewRemotePlaybackPipeline",
......
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