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

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

Issue 1301333002: make ProxyService::CreateSystemProxyConfigService return scoped_ptrs NOT FOR REVIEW (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try merging again... Created 5 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 BuildOSCpuInfo().c_str()); 90 BuildOSCpuInfo().c_str());
91 return user_agent; 91 return user_agent;
92 } 92 }
93 93
94 } // namespace 94 } // namespace
95 95
96 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter() 96 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter()
97 : user_agent_(MakeUserAgentForServiceProcess()), 97 : user_agent_(MakeUserAgentForServiceProcess()),
98 network_task_runner_(g_service_process->io_task_runner()) { 98 network_task_runner_(g_service_process->io_task_runner()) {
99 DCHECK(g_service_process); 99 DCHECK(g_service_process);
100 proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( 100 proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService(
101 g_service_process->io_task_runner(), 101 g_service_process->io_task_runner(),
102 g_service_process->file_task_runner())); 102 g_service_process->file_task_runner());
103 } 103 }
104 104
105 net::URLRequestContext* 105 net::URLRequestContext*
106 ServiceURLRequestContextGetter::GetURLRequestContext() { 106 ServiceURLRequestContextGetter::GetURLRequestContext() {
107 if (!url_request_context_.get()) { 107 if (!url_request_context_.get()) {
108 net::URLRequestContextBuilder builder; 108 net::URLRequestContextBuilder builder;
109 builder.set_user_agent(user_agent_); 109 builder.set_user_agent(user_agent_);
110 builder.set_accept_language("en-us,fr"); 110 builder.set_accept_language("en-us,fr");
111 builder.set_proxy_config_service(proxy_config_service_.Pass()); 111 builder.set_proxy_config_service(proxy_config_service_.Pass());
112 builder.set_throttling_enabled(true); 112 builder.set_throttling_enabled(true);
113 url_request_context_ = builder.Build().Pass(); 113 url_request_context_ = builder.Build().Pass();
114 } 114 }
115 return url_request_context_.get(); 115 return url_request_context_.get();
116 } 116 }
117 117
118 scoped_refptr<base::SingleThreadTaskRunner> 118 scoped_refptr<base::SingleThreadTaskRunner>
119 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { 119 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const {
120 return network_task_runner_; 120 return network_task_runner_;
121 } 121 }
122 122
123 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} 123 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {}
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | chromecast/browser/url_request_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698