OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell_url_request_context_getter.h" | 5 #include "content/shell/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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 if (command_line.HasSwitch(switches::kDumpRenderTree)) | 87 if (command_line.HasSwitch(switches::kDumpRenderTree)) |
88 ShellNetworkDelegate::SetAcceptAllCookies(false); | 88 ShellNetworkDelegate::SetAcceptAllCookies(false); |
89 url_request_context_->set_network_delegate(network_delegate_.get()); | 89 url_request_context_->set_network_delegate(network_delegate_.get()); |
90 storage_.reset( | 90 storage_.reset( |
91 new net::URLRequestContextStorage(url_request_context_.get())); | 91 new net::URLRequestContextStorage(url_request_context_.get())); |
92 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL)); | 92 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL)); |
93 storage_->set_server_bound_cert_service(new net::ServerBoundCertService( | 93 storage_->set_server_bound_cert_service(new net::ServerBoundCertService( |
94 new net::DefaultServerBoundCertStore(NULL), | 94 new net::DefaultServerBoundCertStore(NULL), |
95 base::WorkerPool::GetTaskRunner(true))); | 95 base::WorkerPool::GetTaskRunner(true))); |
96 storage_->set_http_user_agent_settings( | 96 storage_->set_http_user_agent_settings( |
97 new net::StaticHttpUserAgentSettings( | 97 new net::StaticHttpUserAgentSettings("en-us,en", EmptyString())); |
98 "en-us,en", "iso-8859-1,*,utf-8", EmptyString())); | |
99 | 98 |
100 scoped_ptr<net::HostResolver> host_resolver( | 99 scoped_ptr<net::HostResolver> host_resolver( |
101 net::HostResolver::CreateDefaultResolver(NULL)); | 100 net::HostResolver::CreateDefaultResolver(NULL)); |
102 | 101 |
103 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); | 102 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); |
104 if (command_line.HasSwitch(switches::kDumpRenderTree)) { | 103 if (command_line.HasSwitch(switches::kDumpRenderTree)) { |
105 storage_->set_proxy_service(net::ProxyService::CreateDirect()); | 104 storage_->set_proxy_service(net::ProxyService::CreateDirect()); |
106 } else { | 105 } else { |
107 // TODO(jam): use v8 if possible, look at chrome code. | 106 // TODO(jam): use v8 if possible, look at chrome code. |
108 storage_->set_proxy_service( | 107 storage_->set_proxy_service( |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 scoped_refptr<base::SingleThreadTaskRunner> | 196 scoped_refptr<base::SingleThreadTaskRunner> |
198 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 197 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
199 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 198 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
200 } | 199 } |
201 | 200 |
202 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 201 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
203 return url_request_context_->host_resolver(); | 202 return url_request_context_->host_resolver(); |
204 } | 203 } |
205 | 204 |
206 } // namespace content | 205 } // namespace content |
OLD | NEW |