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

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

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

Powered by Google App Engine
This is Rietveld 408576698