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

Side by Side Diff: content/shell/browser/shell_url_request_context_getter.cc

Issue 1356933002: make ProxyService::CreateSystemProxyConfigService return scoped_ptrs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: proper namespacing 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_url_request_context_getter.h" 5 #include "content/shell/browser/shell_url_request_context_getter.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() { 89 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() {
90 } 90 }
91 91
92 scoped_ptr<net::NetworkDelegate> 92 scoped_ptr<net::NetworkDelegate>
93 ShellURLRequestContextGetter::CreateNetworkDelegate() { 93 ShellURLRequestContextGetter::CreateNetworkDelegate() {
94 return make_scoped_ptr(new ShellNetworkDelegate).Pass(); 94 return make_scoped_ptr(new ShellNetworkDelegate).Pass();
95 } 95 }
96 96
97 scoped_ptr<net::ProxyConfigService> 97 scoped_ptr<net::ProxyConfigService>
98 ShellURLRequestContextGetter::GetProxyConfigService() { 98 ShellURLRequestContextGetter::GetProxyConfigService() {
99 return make_scoped_ptr(net::ProxyService::CreateSystemProxyConfigService( 99 return net::ProxyService::CreateSystemProxyConfigService(
100 io_loop_->task_runner(), file_loop_->task_runner())); 100 io_loop_->task_runner(), file_loop_->task_runner());
101 } 101 }
102 102
103 scoped_ptr<net::ProxyService> ShellURLRequestContextGetter::GetProxyService() { 103 scoped_ptr<net::ProxyService> ShellURLRequestContextGetter::GetProxyService() {
104 // TODO(jam): use v8 if possible, look at chrome code. 104 // TODO(jam): use v8 if possible, look at chrome code.
105 return net::ProxyService::CreateUsingSystemProxyResolver( 105 return net::ProxyService::CreateUsingSystemProxyResolver(
106 proxy_config_service_.release(), 0, url_request_context_->net_log()); 106 proxy_config_service_.Pass(), 0, url_request_context_->net_log());
107 } 107 }
108 108
109 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { 109 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
110 DCHECK_CURRENTLY_ON(BrowserThread::IO); 110 DCHECK_CURRENTLY_ON(BrowserThread::IO);
111 111
112 if (!url_request_context_) { 112 if (!url_request_context_) {
113 const base::CommandLine& command_line = 113 const base::CommandLine& command_line =
114 *base::CommandLine::ForCurrentProcess(); 114 *base::CommandLine::ForCurrentProcess();
115 115
116 url_request_context_.reset(new net::URLRequestContext()); 116 url_request_context_.reset(new net::URLRequestContext());
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 scoped_refptr<base::SingleThreadTaskRunner> 244 scoped_refptr<base::SingleThreadTaskRunner>
245 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 245 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
246 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 246 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
247 } 247 }
248 248
249 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 249 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
250 return url_request_context_->host_resolver(); 250 return url_request_context_->host_resolver();
251 } 251 }
252 252
253 } // namespace content 253 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/resolve_proxy_msg_helper_unittest.cc ('k') | ios/chrome/browser/net/proxy_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698