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