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

Side by Side Diff: chrome/service/net/service_url_request_context.cc

Issue 311393002: Add URLRequestJobFactories to URLRequestContexts without one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 6 years, 6 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
« no previous file with comments | « chrome/browser/net/connection_tester_unittest.cc ('k') | net/spdy/spdy_test_util_common.cc » ('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 "chrome/service/net/service_url_request_context.h" 5 #include "chrome/service/net/service_url_request_context.h"
6 6
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) 7 #if defined(OS_POSIX) && !defined(OS_MACOSX)
8 #include <sys/utsname.h> 8 #include <sys/utsname.h>
9 #endif 9 #endif
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/message_loop/message_loop_proxy.h" 12 #include "base/message_loop/message_loop_proxy.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/sys_info.h" 14 #include "base/sys_info.h"
15 #include "chrome/common/chrome_version_info.h" 15 #include "chrome/common/chrome_version_info.h"
16 #include "chrome/service/service_process.h" 16 #include "chrome/service/service_process.h"
17 #include "net/cert/cert_verifier.h" 17 #include "net/cert/cert_verifier.h"
18 #include "net/cookies/cookie_monster.h" 18 #include "net/cookies/cookie_monster.h"
19 #include "net/dns/host_resolver.h" 19 #include "net/dns/host_resolver.h"
20 #include "net/http/http_auth_handler_factory.h" 20 #include "net/http/http_auth_handler_factory.h"
21 #include "net/http/http_cache.h" 21 #include "net/http/http_cache.h"
22 #include "net/http/http_network_session.h" 22 #include "net/http/http_network_session.h"
23 #include "net/http/http_server_properties_impl.h" 23 #include "net/http/http_server_properties_impl.h"
24 #include "net/proxy/proxy_config_service.h" 24 #include "net/proxy/proxy_config_service.h"
25 #include "net/proxy/proxy_service.h" 25 #include "net/proxy/proxy_service.h"
26 #include "net/ssl/ssl_config_service_defaults.h" 26 #include "net/ssl/ssl_config_service_defaults.h"
27 #include "net/url_request/static_http_user_agent_settings.h" 27 #include "net/url_request/static_http_user_agent_settings.h"
28 #include "net/url_request/url_request_job_factory_impl.h"
28 #include "net/url_request/url_request_throttler_manager.h" 29 #include "net/url_request/url_request_throttler_manager.h"
29 30
30 namespace { 31 namespace {
31 // Copied from webkit/glue/user_agent.cc. We don't want to pull in a dependency 32 // Copied from webkit/glue/user_agent.cc. We don't want to pull in a dependency
32 // on webkit/glue which also pulls in the renderer. Also our user-agent is 33 // on webkit/glue which also pulls in the renderer. Also our user-agent is
33 // totally different from the user-agent used by the browser, just the 34 // totally different from the user-agent used by the browser, just the
34 // OS-specific parts are common. 35 // OS-specific parts are common.
35 std::string BuildOSCpuInfo() { 36 std::string BuildOSCpuInfo() {
36 std::string os_cpu; 37 std::string os_cpu;
37 38
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 session_params.proxy_service = proxy_service(); 130 session_params.proxy_service = proxy_service();
130 session_params.ssl_config_service = ssl_config_service(); 131 session_params.ssl_config_service = ssl_config_service();
131 session_params.http_auth_handler_factory = http_auth_handler_factory(); 132 session_params.http_auth_handler_factory = http_auth_handler_factory();
132 session_params.http_server_properties = http_server_properties(); 133 session_params.http_server_properties = http_server_properties();
133 scoped_refptr<net::HttpNetworkSession> network_session( 134 scoped_refptr<net::HttpNetworkSession> network_session(
134 new net::HttpNetworkSession(session_params)); 135 new net::HttpNetworkSession(session_params));
135 storage_.set_http_transaction_factory(new net::HttpCache( 136 storage_.set_http_transaction_factory(new net::HttpCache(
136 network_session.get(), net::HttpCache::DefaultBackend::InMemory(0))); 137 network_session.get(), net::HttpCache::DefaultBackend::InMemory(0)));
137 // In-memory cookie store. 138 // In-memory cookie store.
138 storage_.set_cookie_store(new net::CookieMonster(NULL, NULL)); 139 storage_.set_cookie_store(new net::CookieMonster(NULL, NULL));
140 storage_.set_job_factory(new net::URLRequestJobFactoryImpl());
139 storage_.set_http_user_agent_settings(new net::StaticHttpUserAgentSettings( 141 storage_.set_http_user_agent_settings(new net::StaticHttpUserAgentSettings(
140 "en-us,fr", user_agent)); 142 "en-us,fr", user_agent));
141 } 143 }
142 144
143 ServiceURLRequestContext::~ServiceURLRequestContext() { 145 ServiceURLRequestContext::~ServiceURLRequestContext() {
144 } 146 }
145 147
146 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter() 148 ServiceURLRequestContextGetter::ServiceURLRequestContextGetter()
147 : network_task_runner_( 149 : network_task_runner_(
148 g_service_process->io_thread()->message_loop_proxy()) { 150 g_service_process->io_thread()->message_loop_proxy()) {
(...skipping 16 matching lines...) Expand all
165 proxy_config_service_.release())); 167 proxy_config_service_.release()));
166 return url_request_context_.get(); 168 return url_request_context_.get();
167 } 169 }
168 170
169 scoped_refptr<base::SingleThreadTaskRunner> 171 scoped_refptr<base::SingleThreadTaskRunner>
170 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { 172 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const {
171 return network_task_runner_; 173 return network_task_runner_;
172 } 174 }
173 175
174 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} 176 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {}
OLDNEW
« no previous file with comments | « chrome/browser/net/connection_tester_unittest.cc ('k') | net/spdy/spdy_test_util_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698