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

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: add TODO 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
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"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 62
62 url_request_context_.reset(new net::URLRequestContext()); 63 url_request_context_.reset(new net::URLRequestContext());
63 network_delegate_.reset(new ShellNetworkDelegate); 64 network_delegate_.reset(new ShellNetworkDelegate);
64 url_request_context_->set_network_delegate(network_delegate_.get()); 65 url_request_context_->set_network_delegate(network_delegate_.get());
65 storage_.reset( 66 storage_.reset(
66 new net::URLRequestContextStorage(url_request_context_.get())); 67 new net::URLRequestContextStorage(url_request_context_.get()));
67 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL)); 68 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL));
68 storage_->set_server_bound_cert_service(new net::ServerBoundCertService( 69 storage_->set_server_bound_cert_service(new net::ServerBoundCertService(
69 new net::DefaultServerBoundCertStore(NULL), 70 new net::DefaultServerBoundCertStore(NULL),
70 base::WorkerPool::GetTaskRunner(true))); 71 base::WorkerPool::GetTaskRunner(true)));
71 url_request_context_->set_accept_language("en-us,en"); 72 storage_->set_http_user_agent_settings(
72 url_request_context_->set_accept_charset("iso-8859-1,*,utf-8"); 73 new net::StaticHttpUserAgentSettings(
74 "en-us,en", "iso-8859-1,*,utf-8", EmptyString()));
73 75
74 scoped_ptr<net::HostResolver> host_resolver( 76 scoped_ptr<net::HostResolver> host_resolver(
75 net::HostResolver::CreateDefaultResolver(NULL)); 77 net::HostResolver::CreateDefaultResolver(NULL));
76 78
77 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); 79 storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
78 // TODO(jam): use v8 if possible, look at chrome code. 80 // TODO(jam): use v8 if possible, look at chrome code.
79 storage_->set_proxy_service( 81 storage_->set_proxy_service(
80 net::ProxyService::CreateUsingSystemProxyResolver( 82 net::ProxyService::CreateUsingSystemProxyResolver(
81 proxy_config_service_.release(), 83 proxy_config_service_.release(),
82 0, 84 0,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 scoped_refptr<base::SingleThreadTaskRunner> 152 scoped_refptr<base::SingleThreadTaskRunner>
151 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 153 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
152 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 154 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
153 } 155 }
154 156
155 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 157 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
156 return url_request_context_->host_resolver(); 158 return url_request_context_->host_resolver();
157 } 159 }
158 160
159 } // namespace content 161 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698