| 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" |
| 48 #include "net/base/host_mapping_rules.h" | 49 #include "net/base/host_mapping_rules.h" |
| 49 #include "net/base/net_util.h" | 50 #include "net/base/net_util.h" |
| 50 #include "net/base/network_time_notifier.h" | 51 #include "net/base/network_time_notifier.h" |
| 51 #include "net/base/sdch_manager.h" | 52 #include "net/base/sdch_manager.h" |
| 52 #include "net/cert/cert_verifier.h" | 53 #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 = new net::CookieMonster(NULL, NULL); | 537 globals_->system_cookie_store = |
| 538 content::CreateCookieStore(content::CookieStoreConfig()); |
| 538 // In-memory server bound cert store. | 539 // In-memory server bound cert store. |
| 539 globals_->system_server_bound_cert_service.reset( | 540 globals_->system_server_bound_cert_service.reset( |
| 540 new net::ServerBoundCertService( | 541 new net::ServerBoundCertService( |
| 541 new net::DefaultServerBoundCertStore(NULL), | 542 new net::DefaultServerBoundCertStore(NULL), |
| 542 base::WorkerPool::GetTaskRunner(true))); | 543 base::WorkerPool::GetTaskRunner(true))); |
| 543 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); | 544 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); |
| 544 globals_->load_time_stats.reset(new chrome_browser_net::LoadTimeStats()); | 545 globals_->load_time_stats.reset(new chrome_browser_net::LoadTimeStats()); |
| 545 globals_->host_mapping_rules.reset(new net::HostMappingRules()); | 546 globals_->host_mapping_rules.reset(new net::HostMappingRules()); |
| 546 globals_->http_user_agent_settings.reset( | 547 globals_->http_user_agent_settings.reset( |
| 547 new BasicHttpUserAgentSettings(std::string())); | 548 new BasicHttpUserAgentSettings(std::string())); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 | 671 |
| 671 system_proxy_config_service_.reset(); | 672 system_proxy_config_service_.reset(); |
| 672 | 673 |
| 673 delete globals_; | 674 delete globals_; |
| 674 globals_ = NULL; | 675 globals_ = NULL; |
| 675 | 676 |
| 676 base::debug::LeakTracker<SystemURLRequestContextGetter>::CheckForLeaks(); | 677 base::debug::LeakTracker<SystemURLRequestContextGetter>::CheckForLeaks(); |
| 677 } | 678 } |
| 678 | 679 |
| 679 void IOThread::InitializeNetworkOptions(const CommandLine& command_line) { | 680 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 | |
| 686 // Only handle use-spdy command line flags if "spdy.disabled" preference is | 681 // Only handle use-spdy command line flags if "spdy.disabled" preference is |
| 687 // not disabled via policy. | 682 // not disabled via policy. |
| 688 if (!is_spdy_disabled_by_policy_) { | 683 if (!is_spdy_disabled_by_policy_) { |
| 689 if (command_line.HasSwitch(switches::kEnableIPPooling)) | 684 if (command_line.HasSwitch(switches::kEnableIPPooling)) |
| 690 globals_->enable_spdy_ip_pooling.set(true); | 685 globals_->enable_spdy_ip_pooling.set(true); |
| 691 | 686 |
| 692 if (command_line.HasSwitch(switches::kDisableIPPooling)) | 687 if (command_line.HasSwitch(switches::kDisableIPPooling)) |
| 693 globals_->enable_spdy_ip_pooling.set(false); | 688 globals_->enable_spdy_ip_pooling.set(false); |
| 694 | 689 |
| 695 if (command_line.HasSwitch(switches::kEnableSpdyCredentialFrames)) | 690 if (command_line.HasSwitch(switches::kEnableSpdyCredentialFrames)) |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 if (command_line.HasSwitch(switches::kDisableQuicHttps)) | 1010 if (command_line.HasSwitch(switches::kDisableQuicHttps)) |
| 1016 return false; | 1011 return false; |
| 1017 | 1012 |
| 1018 if (command_line.HasSwitch(switches::kEnableQuicHttps)) | 1013 if (command_line.HasSwitch(switches::kEnableQuicHttps)) |
| 1019 return true; | 1014 return true; |
| 1020 | 1015 |
| 1021 // HTTPS over QUIC should only be enabled if we are in the https | 1016 // HTTPS over QUIC should only be enabled if we are in the https |
| 1022 // field trial group. | 1017 // field trial group. |
| 1023 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; | 1018 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; |
| 1024 } | 1019 } |
| OLD | NEW |