| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 net::ProxyService* ShellURLRequestContextGetter::GetProxyService() { | 99 net::ProxyService* ShellURLRequestContextGetter::GetProxyService() { |
| 100 // TODO(jam): use v8 if possible, look at chrome code. | 100 // TODO(jam): use v8 if possible, look at chrome code. |
| 101 return net::ProxyService::CreateUsingSystemProxyResolver( | 101 return net::ProxyService::CreateUsingSystemProxyResolver( |
| 102 proxy_config_service_.release(), 0, url_request_context_->net_log()); | 102 proxy_config_service_.release(), 0, url_request_context_->net_log()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { | 105 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
| 106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 107 | 107 |
| 108 if (!url_request_context_) { | 108 if (!url_request_context_) { |
| 109 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 109 const base::CommandLine& command_line = |
| 110 *base::CommandLine::ForCurrentProcess(); |
| 110 | 111 |
| 111 url_request_context_.reset(new net::URLRequestContext()); | 112 url_request_context_.reset(new net::URLRequestContext()); |
| 112 url_request_context_->set_net_log(net_log_); | 113 url_request_context_->set_net_log(net_log_); |
| 113 network_delegate_.reset(CreateNetworkDelegate()); | 114 network_delegate_.reset(CreateNetworkDelegate()); |
| 114 url_request_context_->set_network_delegate(network_delegate_.get()); | 115 url_request_context_->set_network_delegate(network_delegate_.get()); |
| 115 storage_.reset( | 116 storage_.reset( |
| 116 new net::URLRequestContextStorage(url_request_context_.get())); | 117 new net::URLRequestContextStorage(url_request_context_.get())); |
| 117 storage_->set_cookie_store(CreateCookieStore(CookieStoreConfig())); | 118 storage_->set_cookie_store(CreateCookieStore(CookieStoreConfig())); |
| 118 storage_->set_channel_id_service(new net::ChannelIDService( | 119 storage_->set_channel_id_service(new net::ChannelIDService( |
| 119 new net::DefaultChannelIDStore(NULL), | 120 new net::DefaultChannelIDStore(NULL), |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 scoped_refptr<base::SingleThreadTaskRunner> | 240 scoped_refptr<base::SingleThreadTaskRunner> |
| 240 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 241 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 241 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 242 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 242 } | 243 } |
| 243 | 244 |
| 244 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 245 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
| 245 return url_request_context_->host_resolver(); | 246 return url_request_context_->host_resolver(); |
| 246 } | 247 } |
| 247 | 248 |
| 248 } // namespace content | 249 } // namespace content |
| OLD | NEW |