Chromium Code Reviews| 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/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 | 87 |
| 88 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() { | 88 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() { |
| 89 } | 89 } |
| 90 | 90 |
| 91 net::NetworkDelegate* ShellURLRequestContextGetter::CreateNetworkDelegate() { | 91 net::NetworkDelegate* ShellURLRequestContextGetter::CreateNetworkDelegate() { |
| 92 return new ShellNetworkDelegate; | 92 return new ShellNetworkDelegate; |
| 93 } | 93 } |
| 94 | 94 |
| 95 net::ProxyConfigService* ShellURLRequestContextGetter::GetProxyConfigService() { | 95 net::ProxyConfigService* ShellURLRequestContextGetter::GetProxyConfigService() { |
| 96 return net::ProxyService::CreateSystemProxyConfigService( | 96 return net::ProxyService::CreateSystemProxyConfigService( |
| 97 io_loop_->task_runner(), file_loop_->task_runner()); | 97 io_loop_->task_runner(), file_loop_->task_runner()) |
| 98 .get(); | |
|
Randy Smith (Not in Mondays)
2015/08/24 21:58:19
I think this is broken. What'll happen is the net
| |
| 98 } | 99 } |
| 99 | 100 |
| 100 net::ProxyService* ShellURLRequestContextGetter::GetProxyService() { | 101 net::ProxyService* ShellURLRequestContextGetter::GetProxyService() { |
| 101 // TODO(jam): use v8 if possible, look at chrome code. | 102 // TODO(jam): use v8 if possible, look at chrome code. |
| 102 return net::ProxyService::CreateUsingSystemProxyResolver( | 103 return net::ProxyService::CreateUsingSystemProxyResolver( |
| 103 proxy_config_service_.release(), 0, url_request_context_->net_log()); | 104 proxy_config_service_.Pass(), 0, url_request_context_->net_log()); |
| 104 } | 105 } |
| 105 | 106 |
| 106 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { | 107 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
| 107 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 108 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 108 | 109 |
| 109 if (!url_request_context_) { | 110 if (!url_request_context_) { |
| 110 const base::CommandLine& command_line = | 111 const base::CommandLine& command_line = |
| 111 *base::CommandLine::ForCurrentProcess(); | 112 *base::CommandLine::ForCurrentProcess(); |
| 112 | 113 |
| 113 url_request_context_.reset(new net::URLRequestContext()); | 114 url_request_context_.reset(new net::URLRequestContext()); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 scoped_refptr<base::SingleThreadTaskRunner> | 242 scoped_refptr<base::SingleThreadTaskRunner> |
| 242 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 243 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 243 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 244 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 244 } | 245 } |
| 245 | 246 |
| 246 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 247 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
| 247 return url_request_context_->host_resolver(); | 248 return url_request_context_->host_resolver(); |
| 248 } | 249 } |
| 249 | 250 |
| 250 } // namespace content | 251 } // namespace content |
| OLD | NEW |