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 <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 21 matching lines...) Loading... |
32 #include "base/trace_event/trace_event.h" | 32 #include "base/trace_event/trace_event.h" |
33 #include "build/build_config.h" | 33 #include "build/build_config.h" |
34 #include "chrome/browser/browser_process.h" | 34 #include "chrome/browser/browser_process.h" |
35 #include "chrome/browser/data_usage/tab_id_annotator.h" | 35 #include "chrome/browser/data_usage/tab_id_annotator.h" |
36 #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h" | 36 #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h" |
37 #include "chrome/browser/net/async_dns_field_trial.h" | 37 #include "chrome/browser/net/async_dns_field_trial.h" |
38 #include "chrome/browser/net/chrome_network_delegate.h" | 38 #include "chrome/browser/net/chrome_network_delegate.h" |
39 #include "chrome/browser/net/dns_probe_service.h" | 39 #include "chrome/browser/net/dns_probe_service.h" |
40 #include "chrome/browser/net/proxy_service_factory.h" | 40 #include "chrome/browser/net/proxy_service_factory.h" |
41 #include "chrome/browser/net/sth_distributor_provider.h" | 41 #include "chrome/browser/net/sth_distributor_provider.h" |
| 42 #include "chrome/browser/ssl/ignore_errors_cert_verifier.h" |
42 #include "chrome/common/channel_info.h" | 43 #include "chrome/common/channel_info.h" |
43 #include "chrome/common/chrome_content_client.h" | 44 #include "chrome/common/chrome_content_client.h" |
44 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
46 #include "components/certificate_transparency/tree_state_tracker.h" | 47 #include "components/certificate_transparency/tree_state_tracker.h" |
47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" | 48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" |
48 #include "components/data_usage/core/data_use_aggregator.h" | 49 #include "components/data_usage/core/data_use_aggregator.h" |
49 #include "components/data_usage/core/data_use_amortizer.h" | 50 #include "components/data_usage/core/data_use_amortizer.h" |
50 #include "components/data_usage/core/data_use_annotator.h" | 51 #include "components/data_usage/core/data_use_annotator.h" |
51 #include "components/data_use_measurement/core/data_use_ascriber.h" | 52 #include "components/data_use_measurement/core/data_use_ascriber.h" |
(...skipping 522 matching lines...) Loading... |
574 std::move(external_estimate_provider), network_quality_estimator_params, | 575 std::move(external_estimate_provider), network_quality_estimator_params, |
575 net_log_)); | 576 net_log_)); |
576 | 577 |
577 UpdateDnsClientEnabled(); | 578 UpdateDnsClientEnabled(); |
578 #if defined(OS_CHROMEOS) | 579 #if defined(OS_CHROMEOS) |
579 // Creates a CertVerifyProc that doesn't allow any profile-provided certs. | 580 // Creates a CertVerifyProc that doesn't allow any profile-provided certs. |
580 globals_->cert_verifier = base::MakeUnique<net::CachingCertVerifier>( | 581 globals_->cert_verifier = base::MakeUnique<net::CachingCertVerifier>( |
581 base::MakeUnique<net::MultiThreadedCertVerifier>( | 582 base::MakeUnique<net::MultiThreadedCertVerifier>( |
582 new chromeos::CertVerifyProcChromeOS())); | 583 new chromeos::CertVerifyProcChromeOS())); |
583 #else | 584 #else |
584 globals_->cert_verifier = net::CertVerifier::CreateDefault(); | 585 if (command_line.HasSwitch(switches::kUserDataDir) && |
| 586 command_line.HasSwitch(switches::kIgnoreCertificateErrorsSPKIList)) { |
| 587 auto spki_list = |
| 588 base::SplitString(command_line.GetSwitchValueASCII( |
| 589 switches::kIgnoreCertificateErrorsSPKIList), |
| 590 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 591 globals_->cert_verifier = base::MakeUnique<IgnoreErrorsCertVerifier>( |
| 592 net::CertVerifier::CreateDefault(), |
| 593 IgnoreErrorsCertVerifier::MakeWhitelist(spki_list)); |
| 594 } else { |
| 595 globals_->cert_verifier = net::CertVerifier::CreateDefault(); |
| 596 } |
| 597 UMA_HISTOGRAM_BOOLEAN( |
| 598 "Net.Certificate.kIgnoreCertificateErrorsSPKIList", |
| 599 command_line.HasSwitch(switches::kIgnoreCertificateErrorsSPKIList)); |
585 #endif | 600 #endif |
586 | 601 |
587 globals_->transport_security_state.reset(new net::TransportSecurityState()); | 602 globals_->transport_security_state.reset(new net::TransportSecurityState()); |
588 | 603 |
589 std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs( | 604 std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs( |
590 net::ct::CreateLogVerifiersForKnownLogs()); | 605 net::ct::CreateLogVerifiersForKnownLogs()); |
591 | 606 |
592 globals_->ct_logs.assign(ct_logs.begin(), ct_logs.end()); | 607 globals_->ct_logs.assign(ct_logs.begin(), ct_logs.end()); |
593 | 608 |
594 net::MultiLogCTVerifier* ct_verifier = new net::MultiLogCTVerifier(); | 609 net::MultiLogCTVerifier* ct_verifier = new net::MultiLogCTVerifier(); |
(...skipping 517 matching lines...) Loading... |
1112 | 1127 |
1113 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1128 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1114 // system URLRequestContext too. There's no reason this should be tied to a | 1129 // system URLRequestContext too. There's no reason this should be tied to a |
1115 // profile. | 1130 // profile. |
1116 return context; | 1131 return context; |
1117 } | 1132 } |
1118 | 1133 |
1119 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { | 1134 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { |
1120 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); | 1135 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); |
1121 } | 1136 } |
OLD | NEW |