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/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 #include "chrome/browser/net/chrome_net_log.h" | 33 #include "chrome/browser/net/chrome_net_log.h" |
34 #include "chrome/browser/net/chrome_network_delegate.h" | 34 #include "chrome/browser/net/chrome_network_delegate.h" |
35 #include "chrome/browser/net/connect_interceptor.h" | 35 #include "chrome/browser/net/connect_interceptor.h" |
36 #include "chrome/browser/net/dns_probe_service.h" | 36 #include "chrome/browser/net/dns_probe_service.h" |
37 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 37 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
38 #include "chrome/browser/net/proxy_service_factory.h" | 38 #include "chrome/browser/net/proxy_service_factory.h" |
39 #include "chrome/common/chrome_content_client.h" | 39 #include "chrome/common/chrome_content_client.h" |
40 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
41 #include "chrome/common/chrome_version_info.h" | 41 #include "chrome/common/chrome_version_info.h" |
42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
43 #include "components/certificate_transparency/log_proofs_fetcher.h" | |
44 #include "components/certificate_transparency/new_scts_observer.h" | |
43 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" | 45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" |
44 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" | 46 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" |
45 #include "components/policy/core/common/policy_service.h" | 47 #include "components/policy/core/common/policy_service.h" |
46 #include "components/variations/variations_associated_data.h" | 48 #include "components/variations/variations_associated_data.h" |
47 #include "content/public/browser/browser_thread.h" | 49 #include "content/public/browser/browser_thread.h" |
48 #include "content/public/browser/cookie_store_factory.h" | 50 #include "content/public/browser/cookie_store_factory.h" |
49 #include "net/base/host_mapping_rules.h" | 51 #include "net/base/host_mapping_rules.h" |
50 #include "net/base/net_util.h" | 52 #include "net/base/net_util.h" |
51 #include "net/base/sdch_manager.h" | 53 #include "net/base/sdch_manager.h" |
52 #include "net/cert/cert_policy_enforcer.h" | 54 #include "net/cert/cert_policy_enforcer.h" |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
731 size_t delim_pos = curr_log.find(":"); | 733 size_t delim_pos = curr_log.find(":"); |
732 CHECK(delim_pos != std::string::npos) | 734 CHECK(delim_pos != std::string::npos) |
733 << "CT log description not provided (switch format" | 735 << "CT log description not provided (switch format" |
734 " is 'description:base64_key')"; | 736 " is 'description:base64_key')"; |
735 std::string log_description(curr_log.substr(0, delim_pos)); | 737 std::string log_description(curr_log.substr(0, delim_pos)); |
736 std::string ct_public_key_data; | 738 std::string ct_public_key_data; |
737 CHECK(base::Base64Decode(curr_log.substr(delim_pos + 1), | 739 CHECK(base::Base64Decode(curr_log.substr(delim_pos + 1), |
738 &ct_public_key_data)) | 740 &ct_public_key_data)) |
739 << "Unable to decode CT public key."; | 741 << "Unable to decode CT public key."; |
740 scoped_ptr<net::CTLogVerifier> external_log_verifier( | 742 scoped_ptr<net::CTLogVerifier> external_log_verifier( |
741 net::CTLogVerifier::Create(ct_public_key_data, log_description)); | 743 net::CTLogVerifier::Create(ct_public_key_data, log_description, "")); |
Ryan Sleevi
2015/04/24 10:42:05
s/""/std::string()/
Eran Messeri
2015/06/18 15:18:40
Obsolete.
| |
742 CHECK(external_log_verifier) << "Unable to parse CT public key."; | 744 CHECK(external_log_verifier) << "Unable to parse CT public key."; |
743 VLOG(1) << "Adding log with description " << log_description; | 745 VLOG(1) << "Adding log with description " << log_description; |
744 ct_verifier->AddLog(external_log_verifier.Pass()); | 746 ct_verifier->AddLog(external_log_verifier.Pass()); |
745 } | 747 } |
746 } | 748 } |
747 | 749 |
748 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 750 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
749 // is fixed. | 751 // is fixed. |
750 tracked_objects::ScopedTracker tracking_profile10( | 752 tracked_objects::ScopedTracker tracking_profile10( |
751 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 753 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
889 globals_->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); | 891 globals_->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); |
890 | 892 |
891 globals_->throttler_manager.reset(new net::URLRequestThrottlerManager()); | 893 globals_->throttler_manager.reset(new net::URLRequestThrottlerManager()); |
892 globals_->throttler_manager->set_net_log(net_log_); | 894 globals_->throttler_manager->set_net_log(net_log_); |
893 // Always done in production, disabled only for unit tests. | 895 // Always done in production, disabled only for unit tests. |
894 globals_->throttler_manager->set_enable_thread_checks(true); | 896 globals_->throttler_manager->set_enable_thread_checks(true); |
895 | 897 |
896 globals_->proxy_script_fetcher_context.reset( | 898 globals_->proxy_script_fetcher_context.reset( |
897 ConstructProxyScriptFetcherContext(globals_, net_log_)); | 899 ConstructProxyScriptFetcherContext(globals_, net_log_)); |
898 | 900 |
901 certificate_transparency::NewSCTsObserver* scts_observer = | |
Ryan Sleevi
2015/04/24 10:42:05
LEAK/DESIGN: Where does this ever get deleted?
If
Eran Messeri
2015/06/18 15:18:40
Per design discussion over email, the observer is
| |
902 new certificate_transparency::NewSCTsObserver( | |
903 new certificate_transparency::LogProofsFetcher( | |
904 globals_->system_request_context.get())); | |
905 ct_verifier->AddObserver(scts_observer); | |
906 | |
899 #if defined(OS_MACOSX) && !defined(OS_IOS) | 907 #if defined(OS_MACOSX) && !defined(OS_IOS) |
900 // Start observing Keychain events. This needs to be done on the UI thread, | 908 // Start observing Keychain events. This needs to be done on the UI thread, |
901 // as Keychain services requires a CFRunLoop. | 909 // as Keychain services requires a CFRunLoop. |
902 BrowserThread::PostTask(BrowserThread::UI, | 910 BrowserThread::PostTask(BrowserThread::UI, |
903 FROM_HERE, | 911 FROM_HERE, |
904 base::Bind(&ObserveKeychainEvents)); | 912 base::Bind(&ObserveKeychainEvents)); |
905 #endif | 913 #endif |
906 | 914 |
907 // InitSystemRequestContext turns right around and posts a task back | 915 // InitSystemRequestContext turns right around and posts a task back |
908 // to the IO thread, so we can't let it run until we know the IO | 916 // to the IO thread, so we can't let it run until we know the IO |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1625 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1633 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1626 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1634 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1627 net::QuicVersion version = supported_versions[i]; | 1635 net::QuicVersion version = supported_versions[i]; |
1628 if (net::QuicVersionToString(version) == quic_version) { | 1636 if (net::QuicVersionToString(version) == quic_version) { |
1629 return version; | 1637 return version; |
1630 } | 1638 } |
1631 } | 1639 } |
1632 | 1640 |
1633 return net::QUIC_VERSION_UNSUPPORTED; | 1641 return net::QUIC_VERSION_UNSUPPORTED; |
1634 } | 1642 } |
OLD | NEW |