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

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

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android webview init fix merged in. Created 7 years, 3 months 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 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"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/threading/sequenced_worker_pool.h" 12 #include "base/threading/sequenced_worker_pool.h"
13 #include "base/threading/worker_pool.h" 13 #include "base/threading/worker_pool.h"
14 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
15 #include "content/public/browser/cookie_store_factory.h"
15 #include "content/public/common/content_switches.h" 16 #include "content/public/common/content_switches.h"
16 #include "content/public/common/url_constants.h" 17 #include "content/public/common/url_constants.h"
17 #include "content/shell/browser/shell_network_delegate.h" 18 #include "content/shell/browser/shell_network_delegate.h"
18 #include "content/shell/common/shell_switches.h" 19 #include "content/shell/common/shell_switches.h"
19 #include "net/base/cache_type.h" 20 #include "net/base/cache_type.h"
20 #include "net/cert/cert_verifier.h" 21 #include "net/cert/cert_verifier.h"
21 #include "net/cookies/cookie_monster.h" 22 #include "net/cookies/cookie_monster.h"
22 #include "net/dns/host_resolver.h" 23 #include "net/dns/host_resolver.h"
23 #include "net/dns/mapped_host_resolver.h" 24 #include "net/dns/mapped_host_resolver.h"
24 #include "net/http/http_auth_handler_factory.h" 25 #include "net/http/http_auth_handler_factory.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 95 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
95 96
96 url_request_context_.reset(new net::URLRequestContext()); 97 url_request_context_.reset(new net::URLRequestContext());
97 url_request_context_->set_net_log(net_log_); 98 url_request_context_->set_net_log(net_log_);
98 network_delegate_.reset(new ShellNetworkDelegate); 99 network_delegate_.reset(new ShellNetworkDelegate);
99 if (command_line.HasSwitch(switches::kDumpRenderTree)) 100 if (command_line.HasSwitch(switches::kDumpRenderTree))
100 ShellNetworkDelegate::SetAcceptAllCookies(false); 101 ShellNetworkDelegate::SetAcceptAllCookies(false);
101 url_request_context_->set_network_delegate(network_delegate_.get()); 102 url_request_context_->set_network_delegate(network_delegate_.get());
102 storage_.reset( 103 storage_.reset(
103 new net::URLRequestContextStorage(url_request_context_.get())); 104 new net::URLRequestContextStorage(url_request_context_.get()));
104 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL)); 105 storage_->set_cookie_store(
106 content::CreateCookieStore(content::CookieStoreConfig()));
105 storage_->set_server_bound_cert_service(new net::ServerBoundCertService( 107 storage_->set_server_bound_cert_service(new net::ServerBoundCertService(
106 new net::DefaultServerBoundCertStore(NULL), 108 new net::DefaultServerBoundCertStore(NULL),
107 base::WorkerPool::GetTaskRunner(true))); 109 base::WorkerPool::GetTaskRunner(true)));
108 storage_->set_http_user_agent_settings( 110 storage_->set_http_user_agent_settings(
109 new net::StaticHttpUserAgentSettings("en-us,en", EmptyString())); 111 new net::StaticHttpUserAgentSettings("en-us,en", EmptyString()));
110 112
111 scoped_ptr<net::HostResolver> host_resolver( 113 scoped_ptr<net::HostResolver> host_resolver(
112 net::HostResolver::CreateDefaultResolver( 114 net::HostResolver::CreateDefaultResolver(
113 url_request_context_->net_log())); 115 url_request_context_->net_log()));
114 116
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 scoped_refptr<base::SingleThreadTaskRunner> 224 scoped_refptr<base::SingleThreadTaskRunner>
223 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 225 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
224 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 226 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
225 } 227 }
226 228
227 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 229 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
228 return url_request_context_->host_resolver(); 230 return url_request_context_->host_resolver();
229 } 231 }
230 232
231 } // namespace content 233 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_browser_context.cc ('k') | content/test/test_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698