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/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
11 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
12 #include "base/threading/sequenced_worker_pool.h" | 13 #include "base/threading/sequenced_worker_pool.h" |
13 #include "base/threading/worker_pool.h" | 14 #include "base/threading/worker_pool.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/cookie_store_factory.h" | 16 #include "content/public/browser/cookie_store_factory.h" |
16 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
17 #include "content/shell/browser/shell_network_delegate.h" | 18 #include "content/shell/browser/shell_network_delegate.h" |
18 #include "content/shell/common/shell_content_client.h" | 19 #include "content/shell/common/shell_content_client.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 87 |
87 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() { | 88 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() { |
88 } | 89 } |
89 | 90 |
90 net::NetworkDelegate* ShellURLRequestContextGetter::CreateNetworkDelegate() { | 91 net::NetworkDelegate* ShellURLRequestContextGetter::CreateNetworkDelegate() { |
91 return new ShellNetworkDelegate; | 92 return new ShellNetworkDelegate; |
92 } | 93 } |
93 | 94 |
94 net::ProxyConfigService* ShellURLRequestContextGetter::GetProxyConfigService() { | 95 net::ProxyConfigService* ShellURLRequestContextGetter::GetProxyConfigService() { |
95 return net::ProxyService::CreateSystemProxyConfigService( | 96 return net::ProxyService::CreateSystemProxyConfigService( |
96 io_loop_->message_loop_proxy(), file_loop_->message_loop_proxy()); | 97 io_loop_->task_runner(), file_loop_->task_runner()); |
97 } | 98 } |
98 | 99 |
99 net::ProxyService* ShellURLRequestContextGetter::GetProxyService() { | 100 net::ProxyService* ShellURLRequestContextGetter::GetProxyService() { |
100 // TODO(jam): use v8 if possible, look at chrome code. | 101 // TODO(jam): use v8 if possible, look at chrome code. |
101 return net::ProxyService::CreateUsingSystemProxyResolver( | 102 return net::ProxyService::CreateUsingSystemProxyResolver( |
102 proxy_config_service_.release(), 0, url_request_context_->net_log()); | 103 proxy_config_service_.release(), 0, url_request_context_->net_log()); |
103 } | 104 } |
104 | 105 |
105 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { | 106 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
106 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 107 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 scoped_refptr<base::SingleThreadTaskRunner> | 241 scoped_refptr<base::SingleThreadTaskRunner> |
241 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 242 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
242 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 243 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
243 } | 244 } |
244 | 245 |
245 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 246 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
246 return url_request_context_->host_resolver(); | 247 return url_request_context_->host_resolver(); |
247 } | 248 } |
248 | 249 |
249 } // namespace content | 250 } // namespace content |
OLD | NEW |