Commit d8ee4019 authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Replace two references to io_task_runner in net's proxy config code.

The system ProxyConfigService is now created on Chrome's UI thread, so
the references were outdated.  Also, net/ really shouldn't know about
content/'s threads.

Bug: 823063
Change-Id: I399bdc13fa46b89f45111cafb393e2c9cd735bdd
Reviewed-on: https://chromium-review.googlesource.com/978386
Commit-Queue: Eric Roman <eroman@chromium.org>
Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545614}
parent dcb8cd53
...@@ -299,9 +299,9 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService { ...@@ -299,9 +299,9 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
void SetupAndFetchInitialConfig( void SetupAndFetchInitialConfig(
const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner,
const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, const scoped_refptr<base::SequencedTaskRunner>& main_task_runner,
const NetworkTrafficAnnotationTag& traffic_annotation) { const NetworkTrafficAnnotationTag& traffic_annotation) {
delegate_->SetUpAndFetchInitialConfig(glib_task_runner, io_task_runner, delegate_->SetUpAndFetchInitialConfig(glib_task_runner, main_task_runner,
traffic_annotation); traffic_annotation);
} }
void OnCheckProxyConfigSettings() { void OnCheckProxyConfigSettings() {
......
...@@ -1483,7 +1483,7 @@ void ProxyResolutionService::ForceReloadProxyConfig() { ...@@ -1483,7 +1483,7 @@ void ProxyResolutionService::ForceReloadProxyConfig() {
// static // static
std::unique_ptr<ProxyConfigService> std::unique_ptr<ProxyConfigService>
ProxyResolutionService::CreateSystemProxyConfigService( ProxyResolutionService::CreateSystemProxyConfigService(
const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) { const scoped_refptr<base::SequencedTaskRunner>& main_task_runner) {
#if defined(OS_WIN) #if defined(OS_WIN)
return std::make_unique<ProxyConfigServiceWin>( return std::make_unique<ProxyConfigServiceWin>(
kSystemProxyConfigTrafficAnnotation); kSystemProxyConfigTrafficAnnotation);
...@@ -1492,7 +1492,7 @@ ProxyResolutionService::CreateSystemProxyConfigService( ...@@ -1492,7 +1492,7 @@ ProxyResolutionService::CreateSystemProxyConfigService(
kSystemProxyConfigTrafficAnnotation); kSystemProxyConfigTrafficAnnotation);
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
return std::make_unique<ProxyConfigServiceMac>( return std::make_unique<ProxyConfigServiceMac>(
io_task_runner, kSystemProxyConfigTrafficAnnotation); main_task_runner, kSystemProxyConfigTrafficAnnotation);
#elif defined(OS_CHROMEOS) #elif defined(OS_CHROMEOS)
LOG(ERROR) << "ProxyConfigService for ChromeOS should be created in " LOG(ERROR) << "ProxyConfigService for ChromeOS should be created in "
<< "profile_io_data.cc::CreateProxyConfigService and this should " << "profile_io_data.cc::CreateProxyConfigService and this should "
...@@ -1513,13 +1513,13 @@ ProxyResolutionService::CreateSystemProxyConfigService( ...@@ -1513,13 +1513,13 @@ ProxyResolutionService::CreateSystemProxyConfigService(
// either |glib_default_loop| or an internal sequenced task runner) to // either |glib_default_loop| or an internal sequenced task runner) to
// keep us updated when the proxy config changes. // keep us updated when the proxy config changes.
linux_config_service->SetupAndFetchInitialConfig( linux_config_service->SetupAndFetchInitialConfig(
glib_thread_task_runner, io_task_runner, glib_thread_task_runner, main_task_runner,
kSystemProxyConfigTrafficAnnotation); kSystemProxyConfigTrafficAnnotation);
return std::move(linux_config_service); return std::move(linux_config_service);
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
return std::make_unique<ProxyConfigServiceAndroid>( return std::make_unique<ProxyConfigServiceAndroid>(
io_task_runner, base::ThreadTaskRunnerHandle::Get()); main_task_runner, base::ThreadTaskRunnerHandle::Get());
#else #else
LOG(WARNING) << "Failed to choose a system proxy settings fetcher " LOG(WARNING) << "Failed to choose a system proxy settings fetcher "
"for this platform."; "for this platform.";
......
...@@ -272,9 +272,14 @@ class NET_EXPORT ProxyResolutionService ...@@ -272,9 +272,14 @@ class NET_EXPORT ProxyResolutionService
const NetworkTrafficAnnotationTag& traffic_annotation); const NetworkTrafficAnnotationTag& traffic_annotation);
// Creates a config service appropriate for this platform that fetches the // Creates a config service appropriate for this platform that fetches the
// system proxy settings. // system proxy settings. |main_task_runner| is the thread where the consumer
// of the ProxyConfigService will live.
//
// TODO(mmenke): Should this be a member of ProxyConfigService?
// The ProxyResolutionService may not even be in the same process as the
// system ProxyConfigService.
static std::unique_ptr<ProxyConfigService> CreateSystemProxyConfigService( static std::unique_ptr<ProxyConfigService> CreateSystemProxyConfigService(
const scoped_refptr<base::SequencedTaskRunner>& io_task_runner); const scoped_refptr<base::SequencedTaskRunner>& main_task_runner);
// This method should only be used by unit tests. // This method should only be used by unit tests.
void set_stall_proxy_auto_config_delay(base::TimeDelta delay) { void set_stall_proxy_auto_config_delay(base::TimeDelta delay) {
......
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