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/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 77 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
78 | 78 |
79 std::swap(protocol_handlers_, *protocol_handlers); | 79 std::swap(protocol_handlers_, *protocol_handlers); |
80 | 80 |
81 // We must create the proxy config service on the UI loop on Linux because it | 81 // We must create the proxy config service on the UI loop on Linux because it |
82 // must synchronously run on the glib message loop. This will be passed to | 82 // must synchronously run on the glib message loop. This will be passed to |
83 // the URLRequestContextStorage on the IO thread in GetURLRequestContext(). | 83 // the URLRequestContextStorage on the IO thread in GetURLRequestContext(). |
84 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { | 84 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
85 proxy_config_service_.reset( | 85 proxy_config_service_.reset( |
86 net::ProxyService::CreateSystemProxyConfigService( | 86 net::ProxyService::CreateSystemProxyConfigService( |
87 io_loop_->message_loop_proxy().get(), file_loop_)); | 87 io_loop_->message_loop_proxy(), file_loop_->message_loop_proxy())); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() { | 91 ShellURLRequestContextGetter::~ShellURLRequestContextGetter() { |
92 } | 92 } |
93 | 93 |
94 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { | 94 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
96 | 96 |
97 if (!url_request_context_) { | 97 if (!url_request_context_) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 scoped_refptr<base::SingleThreadTaskRunner> | 239 scoped_refptr<base::SingleThreadTaskRunner> |
240 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 240 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
241 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 241 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
242 } | 242 } |
243 | 243 |
244 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 244 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
245 return url_request_context_->host_resolver(); | 245 return url_request_context_->host_resolver(); |
246 } | 246 } |
247 | 247 |
248 } // namespace content | 248 } // namespace content |
OLD | NEW |