Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(946)

Side by Side Diff: content/shell/shell_url_request_context_getter.cc

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable test for chrome_frame_net_tests Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/speech/google_streaming_remote_engine.cc ('k') | net/net.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_split.h" 10 #include "base/string_split.h"
11 #include "base/string_util.h"
11 #include "base/threading/worker_pool.h" 12 #include "base/threading/worker_pool.h"
12 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
13 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
14 #include "content/shell/shell_network_delegate.h" 15 #include "content/shell/shell_network_delegate.h"
15 #include "net/base/cert_verifier.h" 16 #include "net/base/cert_verifier.h"
16 #include "net/base/default_server_bound_cert_store.h" 17 #include "net/base/default_server_bound_cert_store.h"
17 #include "net/base/host_resolver.h" 18 #include "net/base/host_resolver.h"
18 #include "net/base/mapped_host_resolver.h" 19 #include "net/base/mapped_host_resolver.h"
19 #include "net/base/server_bound_cert_service.h" 20 #include "net/base/server_bound_cert_service.h"
20 #include "net/base/ssl_config_service_defaults.h" 21 #include "net/base/ssl_config_service_defaults.h"
21 #include "net/cookies/cookie_monster.h" 22 #include "net/cookies/cookie_monster.h"
22 #include "net/http/http_auth_handler_factory.h" 23 #include "net/http/http_auth_handler_factory.h"
23 #include "net/http/http_cache.h" 24 #include "net/http/http_cache.h"
24 #include "net/http/http_network_session.h" 25 #include "net/http/http_network_session.h"
25 #include "net/http/http_server_properties_impl.h" 26 #include "net/http/http_server_properties_impl.h"
26 #include "net/proxy/proxy_service.h" 27 #include "net/proxy/proxy_service.h"
28 #include "net/url_request/static_http_user_agent_settings.h"
27 #include "net/url_request/url_request_context.h" 29 #include "net/url_request/url_request_context.h"
28 #include "net/url_request/url_request_context_storage.h" 30 #include "net/url_request/url_request_context_storage.h"
29 #include "net/url_request/url_request_job_factory_impl.h" 31 #include "net/url_request/url_request_job_factory_impl.h"
30 32
31 namespace content { 33 namespace content {
32 34
33 ShellURLRequestContextGetter::ShellURLRequestContextGetter( 35 ShellURLRequestContextGetter::ShellURLRequestContextGetter(
34 bool ignore_certificate_errors, 36 bool ignore_certificate_errors,
35 const FilePath& base_path, 37 const FilePath& base_path,
36 MessageLoop* io_loop, 38 MessageLoop* io_loop,
(...skipping 24 matching lines...) Expand all
61 63
62 url_request_context_.reset(new net::URLRequestContext()); 64 url_request_context_.reset(new net::URLRequestContext());
63 network_delegate_.reset(new ShellNetworkDelegate); 65 network_delegate_.reset(new ShellNetworkDelegate);
64 url_request_context_->set_network_delegate(network_delegate_.get()); 66 url_request_context_->set_network_delegate(network_delegate_.get());
65 storage_.reset( 67 storage_.reset(
66 new net::URLRequestContextStorage(url_request_context_.get())); 68 new net::URLRequestContextStorage(url_request_context_.get()));
67 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL)); 69 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL));
68 storage_->set_server_bound_cert_service(new net::ServerBoundCertService( 70 storage_->set_server_bound_cert_service(new net::ServerBoundCertService(
69 new net::DefaultServerBoundCertStore(NULL), 71 new net::DefaultServerBoundCertStore(NULL),
70 base::WorkerPool::GetTaskRunner(true))); 72 base::WorkerPool::GetTaskRunner(true)));
71 url_request_context_->set_accept_language("en-us,en"); 73 storage_->set_http_user_agent_settings(
72 url_request_context_->set_accept_charset("iso-8859-1,*,utf-8"); 74 new net::StaticHttpUserAgentSettings(
75 "en-us,en", "iso-8859-1,*,utf-8", EmptyString()));
73 76
74 scoped_ptr<net::HostResolver> host_resolver( 77 scoped_ptr<net::HostResolver> host_resolver(
75 net::HostResolver::CreateDefaultResolver(NULL)); 78 net::HostResolver::CreateDefaultResolver(NULL));
76 79
77 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); 80 storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
78 // TODO(jam): use v8 if possible, look at chrome code. 81 // TODO(jam): use v8 if possible, look at chrome code.
79 storage_->set_proxy_service( 82 storage_->set_proxy_service(
80 net::ProxyService::CreateUsingSystemProxyResolver( 83 net::ProxyService::CreateUsingSystemProxyResolver(
81 proxy_config_service_.release(), 84 proxy_config_service_.release(),
82 0, 85 0,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 scoped_refptr<base::SingleThreadTaskRunner> 153 scoped_refptr<base::SingleThreadTaskRunner>
151 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 154 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
152 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 155 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
153 } 156 }
154 157
155 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 158 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
156 return url_request_context_->host_resolver(); 159 return url_request_context_->host_resolver();
157 } 160 }
158 161
159 } // namespace content 162 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/speech/google_streaming_remote_engine.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698