OLD | NEW |
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 Loading... |
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 scoped_ptr<net::NetworkDelegate>(new ShellNetworkDelegate); | 94 return scoped_ptr<net::NetworkDelegate>(new ShellNetworkDelegate); |
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()).Pass(); |
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 scoped_refptr<base::SingleThreadTaskRunner> | 243 scoped_refptr<base::SingleThreadTaskRunner> |
244 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 244 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
245 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 245 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
246 } | 246 } |
247 | 247 |
248 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 248 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
249 return url_request_context_->host_resolver(); | 249 return url_request_context_->host_resolver(); |
250 } | 250 } |
251 | 251 |
252 } // namespace content | 252 } // namespace content |
OLD | NEW |