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 27 matching lines...) Expand all Loading... |
38 #include "chrome/browser/net/load_time_stats.h" | 38 #include "chrome/browser/net/load_time_stats.h" |
39 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 39 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
40 #include "chrome/browser/net/proxy_service_factory.h" | 40 #include "chrome/browser/net/proxy_service_factory.h" |
41 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 41 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
42 #include "chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h" | 42 #include "chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h" |
43 #include "chrome/browser/policy/policy_service.h" | 43 #include "chrome/browser/policy/policy_service.h" |
44 #include "chrome/common/chrome_switches.h" | 44 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/pref_names.h" | 45 #include "chrome/common/pref_names.h" |
46 #include "chrome/common/url_constants.h" | 46 #include "chrome/common/url_constants.h" |
47 #include "content/public/browser/browser_thread.h" | 47 #include "content/public/browser/browser_thread.h" |
48 #include "content/public/browser/cookie_store_factory.h" | |
49 #include "net/base/host_mapping_rules.h" | 48 #include "net/base/host_mapping_rules.h" |
50 #include "net/base/net_util.h" | 49 #include "net/base/net_util.h" |
51 #include "net/base/network_time_notifier.h" | 50 #include "net/base/network_time_notifier.h" |
52 #include "net/base/sdch_manager.h" | 51 #include "net/base/sdch_manager.h" |
53 #include "net/cert/cert_verifier.h" | 52 #include "net/cert/cert_verifier.h" |
| 53 #include "net/cookies/cookie_monster.h" |
54 #include "net/dns/host_cache.h" | 54 #include "net/dns/host_cache.h" |
55 #include "net/dns/host_resolver.h" | 55 #include "net/dns/host_resolver.h" |
56 #include "net/dns/mapped_host_resolver.h" | 56 #include "net/dns/mapped_host_resolver.h" |
57 #include "net/ftp/ftp_network_layer.h" | 57 #include "net/ftp/ftp_network_layer.h" |
58 #include "net/http/http_auth_filter.h" | 58 #include "net/http/http_auth_filter.h" |
59 #include "net/http/http_auth_handler_factory.h" | 59 #include "net/http/http_auth_handler_factory.h" |
60 #include "net/http/http_network_layer.h" | 60 #include "net/http/http_network_layer.h" |
61 #include "net/http/http_server_properties_impl.h" | 61 #include "net/http/http_server_properties_impl.h" |
62 #include "net/proxy/proxy_config_service.h" | 62 #include "net/proxy/proxy_config_service.h" |
63 #include "net/proxy/proxy_script_fetcher_impl.h" | 63 #include "net/proxy/proxy_script_fetcher_impl.h" |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 spdyproxy_auth_origin_ = SPDY_PROXY_AUTH_ORIGIN; | 527 spdyproxy_auth_origin_ = SPDY_PROXY_AUTH_ORIGIN; |
528 #endif | 528 #endif |
529 } | 529 } |
530 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( | 530 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( |
531 globals_->host_resolver.get())); | 531 globals_->host_resolver.get())); |
532 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); | 532 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); |
533 // For the ProxyScriptFetcher, we use a direct ProxyService. | 533 // For the ProxyScriptFetcher, we use a direct ProxyService. |
534 globals_->proxy_script_fetcher_proxy_service.reset( | 534 globals_->proxy_script_fetcher_proxy_service.reset( |
535 net::ProxyService::CreateDirectWithNetLog(net_log_)); | 535 net::ProxyService::CreateDirectWithNetLog(net_log_)); |
536 // In-memory cookie store. | 536 // In-memory cookie store. |
537 globals_->system_cookie_store = | 537 globals_->system_cookie_store = new net::CookieMonster(NULL, NULL); |
538 content::CreateCookieStore(content::CookieStoreConfig()); | |
539 // In-memory server bound cert store. | 538 // In-memory server bound cert store. |
540 globals_->system_server_bound_cert_service.reset( | 539 globals_->system_server_bound_cert_service.reset( |
541 new net::ServerBoundCertService( | 540 new net::ServerBoundCertService( |
542 new net::DefaultServerBoundCertStore(NULL), | 541 new net::DefaultServerBoundCertStore(NULL), |
543 base::WorkerPool::GetTaskRunner(true))); | 542 base::WorkerPool::GetTaskRunner(true))); |
544 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); | 543 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); |
545 globals_->load_time_stats.reset(new chrome_browser_net::LoadTimeStats()); | 544 globals_->load_time_stats.reset(new chrome_browser_net::LoadTimeStats()); |
546 globals_->host_mapping_rules.reset(new net::HostMappingRules()); | 545 globals_->host_mapping_rules.reset(new net::HostMappingRules()); |
547 globals_->http_user_agent_settings.reset( | 546 globals_->http_user_agent_settings.reset( |
548 new BasicHttpUserAgentSettings(std::string())); | 547 new BasicHttpUserAgentSettings(std::string())); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 | 670 |
672 system_proxy_config_service_.reset(); | 671 system_proxy_config_service_.reset(); |
673 | 672 |
674 delete globals_; | 673 delete globals_; |
675 globals_ = NULL; | 674 globals_ = NULL; |
676 | 675 |
677 base::debug::LeakTracker<SystemURLRequestContextGetter>::CheckForLeaks(); | 676 base::debug::LeakTracker<SystemURLRequestContextGetter>::CheckForLeaks(); |
678 } | 677 } |
679 | 678 |
680 void IOThread::InitializeNetworkOptions(const CommandLine& command_line) { | 679 void IOThread::InitializeNetworkOptions(const CommandLine& command_line) { |
| 680 if (command_line.HasSwitch(switches::kEnableFileCookies)) { |
| 681 // Enable cookie storage for file:// URLs. Must do this before the first |
| 682 // Profile (and therefore the first CookieMonster) is created. |
| 683 net::CookieMonster::EnableFileScheme(); |
| 684 } |
| 685 |
681 // Only handle use-spdy command line flags if "spdy.disabled" preference is | 686 // Only handle use-spdy command line flags if "spdy.disabled" preference is |
682 // not disabled via policy. | 687 // not disabled via policy. |
683 if (!is_spdy_disabled_by_policy_) { | 688 if (!is_spdy_disabled_by_policy_) { |
684 if (command_line.HasSwitch(switches::kEnableIPPooling)) | 689 if (command_line.HasSwitch(switches::kEnableIPPooling)) |
685 globals_->enable_spdy_ip_pooling.set(true); | 690 globals_->enable_spdy_ip_pooling.set(true); |
686 | 691 |
687 if (command_line.HasSwitch(switches::kDisableIPPooling)) | 692 if (command_line.HasSwitch(switches::kDisableIPPooling)) |
688 globals_->enable_spdy_ip_pooling.set(false); | 693 globals_->enable_spdy_ip_pooling.set(false); |
689 | 694 |
690 if (command_line.HasSwitch(switches::kEnableSpdyCredentialFrames)) | 695 if (command_line.HasSwitch(switches::kEnableSpdyCredentialFrames)) |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 if (command_line.HasSwitch(switches::kDisableQuicHttps)) | 1015 if (command_line.HasSwitch(switches::kDisableQuicHttps)) |
1011 return false; | 1016 return false; |
1012 | 1017 |
1013 if (command_line.HasSwitch(switches::kEnableQuicHttps)) | 1018 if (command_line.HasSwitch(switches::kEnableQuicHttps)) |
1014 return true; | 1019 return true; |
1015 | 1020 |
1016 // HTTPS over QUIC should only be enabled if we are in the https | 1021 // HTTPS over QUIC should only be enabled if we are in the https |
1017 // field trial group. | 1022 // field trial group. |
1018 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; | 1023 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; |
1019 } | 1024 } |
OLD | NEW |