Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(978)

Side by Side Diff: chrome/service/net/service_url_request_context_getter.cc

Issue 540593002: Use scoped_refptr<SingleThreadTaskRunner> when initializing ProxyConfigService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/service/net/service_url_request_context_getter.h" 5 #include "chrome/service/net/service_url_request_context_getter.h"
6 6
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) 7 #if defined(OS_POSIX) && !defined(OS_MACOSX)
8 #include <sys/utsname.h> 8 #include <sys/utsname.h>
9 #endif 9 #endif
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } // namespace 98 } // namespace
99 99
100 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter() 100 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter()
101 : user_agent_(MakeUserAgentForServiceProcess()), 101 : user_agent_(MakeUserAgentForServiceProcess()),
102 network_task_runner_( 102 network_task_runner_(
103 g_service_process->io_thread()->message_loop_proxy()) { 103 g_service_process->io_thread()->message_loop_proxy()) {
104 // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a 104 // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a
105 // MessageLoopProxy* instead of MessageLoop*. 105 // MessageLoopProxy* instead of MessageLoop*.
106 DCHECK(g_service_process); 106 DCHECK(g_service_process);
107 proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( 107 proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService(
108 g_service_process->io_thread()->message_loop_proxy().get(), 108 g_service_process->io_thread()->message_loop_proxy(),
109 g_service_process->file_thread()->message_loop())); 109 g_service_process->file_thread()->message_loop_proxy()));
110 } 110 }
111 111
112 net::URLRequestContext* 112 net::URLRequestContext*
113 ServiceURLRequestContextGetter::GetURLRequestContext() { 113 ServiceURLRequestContextGetter::GetURLRequestContext() {
114 if (!url_request_context_.get()) { 114 if (!url_request_context_.get()) {
115 net::URLRequestContextBuilder builder; 115 net::URLRequestContextBuilder builder;
116 builder.set_user_agent(user_agent_); 116 builder.set_user_agent(user_agent_);
117 builder.set_accept_language("en-us,fr"); 117 builder.set_accept_language("en-us,fr");
118 builder.set_proxy_config_service(proxy_config_service_.release()); 118 builder.set_proxy_config_service(proxy_config_service_.release());
119 builder.set_throttling_enabled(true); 119 builder.set_throttling_enabled(true);
120 url_request_context_.reset(builder.Build()); 120 url_request_context_.reset(builder.Build());
121 } 121 }
122 return url_request_context_.get(); 122 return url_request_context_.get();
123 } 123 }
124 124
125 scoped_refptr<base::SingleThreadTaskRunner> 125 scoped_refptr<base::SingleThreadTaskRunner>
126 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { 126 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const {
127 return network_task_runner_; 127 return network_task_runner_;
128 } 128 }
129 129
130 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} 130 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {}
OLDNEW
« no previous file with comments | « chrome/browser/net/proxy_service_factory.cc ('k') | content/shell/browser/shell_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698