OLD | NEW |
---|---|
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/browser/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 #include "chrome/browser/net/dns_probe_service.h" | 33 #include "chrome/browser/net/dns_probe_service.h" |
34 #include "chrome/browser/net/http_pipelining_compatibility_client.h" | 34 #include "chrome/browser/net/http_pipelining_compatibility_client.h" |
35 #include "chrome/browser/net/load_time_stats.h" | 35 #include "chrome/browser/net/load_time_stats.h" |
36 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 36 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
37 #include "chrome/browser/net/proxy_service_factory.h" | 37 #include "chrome/browser/net/proxy_service_factory.h" |
38 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 38 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
39 #include "chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h" | 39 #include "chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h" |
40 #include "chrome/browser/policy/policy_service.h" | 40 #include "chrome/browser/policy/policy_service.h" |
41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
43 #include "chrome/common/url_constants.h" | |
43 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
44 #include "net/base/host_mapping_rules.h" | 45 #include "net/base/host_mapping_rules.h" |
45 #include "net/base/net_util.h" | 46 #include "net/base/net_util.h" |
46 #include "net/base/network_time_notifier.h" | 47 #include "net/base/network_time_notifier.h" |
47 #include "net/base/sdch_manager.h" | 48 #include "net/base/sdch_manager.h" |
48 #include "net/cert/cert_verifier.h" | 49 #include "net/cert/cert_verifier.h" |
49 #include "net/cookies/cookie_monster.h" | 50 #include "net/cookies/cookie_monster.h" |
50 #include "net/dns/host_cache.h" | 51 #include "net/dns/host_cache.h" |
51 #include "net/dns/host_resolver.h" | 52 #include "net/dns/host_resolver.h" |
52 #include "net/dns/mapped_host_resolver.h" | 53 #include "net/dns/mapped_host_resolver.h" |
54 #include "net/ftp/ftp_network_layer.h" | |
53 #include "net/http/http_auth_filter.h" | 55 #include "net/http/http_auth_filter.h" |
54 #include "net/http/http_auth_handler_factory.h" | 56 #include "net/http/http_auth_handler_factory.h" |
55 #include "net/http/http_network_layer.h" | 57 #include "net/http/http_network_layer.h" |
56 #include "net/http/http_server_properties_impl.h" | 58 #include "net/http/http_server_properties_impl.h" |
57 #include "net/proxy/proxy_config_service.h" | 59 #include "net/proxy/proxy_config_service.h" |
58 #include "net/proxy/proxy_script_fetcher_impl.h" | 60 #include "net/proxy/proxy_script_fetcher_impl.h" |
59 #include "net/proxy/proxy_service.h" | 61 #include "net/proxy/proxy_service.h" |
60 #include "net/socket/tcp_client_socket.h" | 62 #include "net/socket/tcp_client_socket.h" |
61 #include "net/spdy/spdy_session.h" | 63 #include "net/spdy/spdy_session.h" |
62 #include "net/ssl/default_server_bound_cert_store.h" | 64 #include "net/ssl/default_server_bound_cert_store.h" |
63 #include "net/ssl/server_bound_cert_service.h" | 65 #include "net/ssl/server_bound_cert_service.h" |
66 #include "net/url_request/data_protocol_handler.h" | |
67 #include "net/url_request/file_protocol_handler.h" | |
68 #include "net/url_request/ftp_protocol_handler.h" | |
64 #include "net/url_request/url_fetcher.h" | 69 #include "net/url_request/url_fetcher.h" |
70 #include "net/url_request/url_request_job_factory_impl.h" | |
65 #include "net/url_request/url_request_throttler_manager.h" | 71 #include "net/url_request/url_request_throttler_manager.h" |
66 #include "net/websockets/websocket_job.h" | 72 #include "net/websockets/websocket_job.h" |
67 | 73 |
68 #if defined(ENABLE_CONFIGURATION_POLICY) | 74 #if defined(ENABLE_CONFIGURATION_POLICY) |
69 #include "policy/policy_constants.h" | 75 #include "policy/policy_constants.h" |
70 #endif | 76 #endif |
71 | 77 |
72 #if defined(USE_NSS) || defined(OS_IOS) | 78 #if defined(USE_NSS) || defined(OS_IOS) |
73 #include "net/ocsp/nss_ocsp.h" | 79 #include "net/ocsp/nss_ocsp.h" |
74 #endif | 80 #endif |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 context->set_net_log(net_log); | 187 context->set_net_log(net_log); |
182 context->set_host_resolver(globals->host_resolver.get()); | 188 context->set_host_resolver(globals->host_resolver.get()); |
183 context->set_cert_verifier(globals->cert_verifier.get()); | 189 context->set_cert_verifier(globals->cert_verifier.get()); |
184 context->set_transport_security_state( | 190 context->set_transport_security_state( |
185 globals->transport_security_state.get()); | 191 globals->transport_security_state.get()); |
186 context->set_http_auth_handler_factory( | 192 context->set_http_auth_handler_factory( |
187 globals->http_auth_handler_factory.get()); | 193 globals->http_auth_handler_factory.get()); |
188 context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get()); | 194 context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get()); |
189 context->set_http_transaction_factory( | 195 context->set_http_transaction_factory( |
190 globals->proxy_script_fetcher_http_transaction_factory.get()); | 196 globals->proxy_script_fetcher_http_transaction_factory.get()); |
197 context->set_job_factory( | |
198 globals->proxy_script_fetcher_url_request_job_factory.get()); | |
191 context->set_cookie_store(globals->system_cookie_store.get()); | 199 context->set_cookie_store(globals->system_cookie_store.get()); |
192 context->set_server_bound_cert_service( | 200 context->set_server_bound_cert_service( |
193 globals->system_server_bound_cert_service.get()); | 201 globals->system_server_bound_cert_service.get()); |
194 context->set_network_delegate(globals->system_network_delegate.get()); | 202 context->set_network_delegate(globals->system_network_delegate.get()); |
195 context->set_http_user_agent_settings( | 203 context->set_http_user_agent_settings( |
196 globals->http_user_agent_settings.get()); | 204 globals->http_user_agent_settings.get()); |
197 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 205 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
198 // system URLRequestContext too. There's no reason this should be tied to a | 206 // system URLRequestContext too. There's no reason this should be tied to a |
199 // profile. | 207 // profile. |
200 return context; | 208 return context; |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 net::HttpNetworkSession::Params session_params; | 548 net::HttpNetworkSession::Params session_params; |
541 InitializeNetworkSessionParams(&session_params); | 549 InitializeNetworkSessionParams(&session_params); |
542 session_params.net_log = net_log_; | 550 session_params.net_log = net_log_; |
543 session_params.proxy_service = | 551 session_params.proxy_service = |
544 globals_->proxy_script_fetcher_proxy_service.get(); | 552 globals_->proxy_script_fetcher_proxy_service.get(); |
545 | 553 |
546 scoped_refptr<net::HttpNetworkSession> network_session( | 554 scoped_refptr<net::HttpNetworkSession> network_session( |
547 new net::HttpNetworkSession(session_params)); | 555 new net::HttpNetworkSession(session_params)); |
548 globals_->proxy_script_fetcher_http_transaction_factory.reset( | 556 globals_->proxy_script_fetcher_http_transaction_factory.reset( |
549 new net::HttpNetworkLayer(network_session)); | 557 new net::HttpNetworkLayer(network_session)); |
558 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | |
559 new net::URLRequestJobFactoryImpl()); | |
560 job_factory->SetProtocolHandler(chrome::kDataScheme, | |
561 new net::DataProtocolHandler()); | |
562 job_factory->SetProtocolHandler(chrome::kFileScheme, | |
563 new net::FileProtocolHandler()); | |
564 #if !defined(DISABLE_FTP_SUPPORT) | |
565 globals_->proxy_script_fetcher_ftp_transaction_factory.reset( | |
566 new net::FtpNetworkLayer(globals_->host_resolver.get())); | |
567 job_factory->SetProtocolHandler( | |
568 chrome::kFtpScheme, | |
569 new net::FtpProtocolHandler( | |
570 globals_->proxy_script_fetcher_ftp_transaction_factory.get())); | |
mmenke
2013/05/28 18:50:55
nit: Fix indent. (All 3 lines should be indented
| |
571 #endif | |
572 globals_->proxy_script_fetcher_url_request_job_factory = | |
573 job_factory.PassAs<net::URLRequestJobFactory>(); | |
550 | 574 |
551 globals_->throttler_manager.reset(new net::URLRequestThrottlerManager()); | 575 globals_->throttler_manager.reset(new net::URLRequestThrottlerManager()); |
552 globals_->throttler_manager->set_net_log(net_log_); | 576 globals_->throttler_manager->set_net_log(net_log_); |
553 // Always done in production, disabled only for unit tests. | 577 // Always done in production, disabled only for unit tests. |
554 globals_->throttler_manager->set_enable_thread_checks(true); | 578 globals_->throttler_manager->set_enable_thread_checks(true); |
555 | 579 |
556 globals_->proxy_script_fetcher_context.reset( | 580 globals_->proxy_script_fetcher_context.reset( |
557 ConstructProxyScriptFetcherContext(globals_, net_log_)); | 581 ConstructProxyScriptFetcherContext(globals_, net_log_)); |
558 | 582 |
559 globals_->network_time_notifier.reset( | 583 globals_->network_time_notifier.reset( |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
911 globals_->system_request_context.reset( | 935 globals_->system_request_context.reset( |
912 ConstructSystemRequestContext(globals_, net_log_)); | 936 ConstructSystemRequestContext(globals_, net_log_)); |
913 | 937 |
914 sdch_manager_->set_sdch_fetcher( | 938 sdch_manager_->set_sdch_fetcher( |
915 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); | 939 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); |
916 } | 940 } |
917 | 941 |
918 void IOThread::UpdateDnsClientEnabled() { | 942 void IOThread::UpdateDnsClientEnabled() { |
919 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); | 943 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); |
920 } | 944 } |
OLD | NEW |