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/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "chrome/browser/profiles/profile_manager.h" | 51 #include "chrome/browser/profiles/profile_manager.h" |
52 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h" | 52 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h" |
53 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" | 53 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" |
54 #include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h" | 54 #include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h" |
55 #include "chrome/common/chrome_paths.h" | 55 #include "chrome/common/chrome_paths.h" |
56 #include "chrome/common/chrome_switches.h" | 56 #include "chrome/common/chrome_switches.h" |
57 #include "chrome/common/features.h" | 57 #include "chrome/common/features.h" |
58 #include "chrome/common/pref_names.h" | 58 #include "chrome/common/pref_names.h" |
59 #include "chrome/common/url_constants.h" | 59 #include "chrome/common/url_constants.h" |
60 #include "components/about_handler/about_protocol_handler.h" | 60 #include "components/about_handler/about_protocol_handler.h" |
| 61 #include "components/certificate_transparency/tree_state_tracker.h" |
61 #include "components/content_settings/core/browser/content_settings_provider.h" | 62 #include "components/content_settings/core/browser/content_settings_provider.h" |
62 #include "components/content_settings/core/browser/cookie_settings.h" | 63 #include "components/content_settings/core/browser/cookie_settings.h" |
63 #include "components/content_settings/core/browser/host_content_settings_map.h" | 64 #include "components/content_settings/core/browser/host_content_settings_map.h" |
64 #include "components/cookie_config/cookie_store_util.h" | 65 #include "components/cookie_config/cookie_store_util.h" |
65 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 66 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
66 #include "components/dom_distiller/core/url_constants.h" | 67 #include "components/dom_distiller/core/url_constants.h" |
67 #include "components/metrics/metrics_pref_names.h" | 68 #include "components/metrics/metrics_pref_names.h" |
68 #include "components/metrics/metrics_service.h" | 69 #include "components/metrics/metrics_service.h" |
69 #include "components/net_log/chrome_net_log.h" | 70 #include "components/net_log/chrome_net_log.h" |
70 #include "components/policy/core/browser/url_blacklist_manager.h" | 71 #include "components/policy/core/browser/url_blacklist_manager.h" |
71 #include "components/policy/core/common/cloud/policy_header_io_helper.h" | 72 #include "components/policy/core/common/cloud/policy_header_io_helper.h" |
72 #include "components/policy/core/common/cloud/policy_header_service.h" | 73 #include "components/policy/core/common/cloud/policy_header_service.h" |
73 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | 74 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
74 #include "components/prefs/pref_service.h" | 75 #include "components/prefs/pref_service.h" |
75 #include "components/signin/core/common/signin_pref_names.h" | 76 #include "components/signin/core/common/signin_pref_names.h" |
76 #include "components/sync_driver/pref_names.h" | 77 #include "components/sync_driver/pref_names.h" |
77 #include "components/url_formatter/url_fixer.h" | 78 #include "components/url_formatter/url_fixer.h" |
78 #include "content/public/browser/browser_thread.h" | 79 #include "content/public/browser/browser_thread.h" |
79 #include "content/public/browser/host_zoom_map.h" | 80 #include "content/public/browser/host_zoom_map.h" |
80 #include "content/public/browser/notification_service.h" | 81 #include "content/public/browser/notification_service.h" |
81 #include "content/public/browser/resource_context.h" | 82 #include "content/public/browser/resource_context.h" |
82 #include "net/base/keygen_handler.h" | 83 #include "net/base/keygen_handler.h" |
83 #include "net/cert/cert_verifier.h" | 84 #include "net/cert/cert_verifier.h" |
| 85 #include "net/cert/ct_log_verifier.h" |
84 #include "net/cert/multi_log_ct_verifier.h" | 86 #include "net/cert/multi_log_ct_verifier.h" |
85 #include "net/cookies/canonical_cookie.h" | 87 #include "net/cookies/canonical_cookie.h" |
86 #include "net/http/http_network_session.h" | 88 #include "net/http/http_network_session.h" |
87 #include "net/http/http_transaction_factory.h" | 89 #include "net/http/http_transaction_factory.h" |
88 #include "net/http/http_util.h" | 90 #include "net/http/http_util.h" |
89 #include "net/http/transport_security_persister.h" | 91 #include "net/http/transport_security_persister.h" |
90 #include "net/nqe/network_quality_estimator.h" | 92 #include "net/nqe/network_quality_estimator.h" |
91 #include "net/proxy/proxy_config_service_fixed.h" | 93 #include "net/proxy/proxy_config_service_fixed.h" |
92 #include "net/proxy/proxy_script_fetcher_impl.h" | 94 #include "net/proxy/proxy_script_fetcher_impl.h" |
93 #include "net/proxy/proxy_service.h" | 95 #include "net/proxy/proxy_service.h" |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 // Install the New Tab Page Interceptor. | 1139 // Install the New Tab Page Interceptor. |
1138 if (profile_params_->new_tab_page_interceptor.get()) { | 1140 if (profile_params_->new_tab_page_interceptor.get()) { |
1139 request_interceptors.push_back( | 1141 request_interceptors.push_back( |
1140 profile_params_->new_tab_page_interceptor.release()); | 1142 profile_params_->new_tab_page_interceptor.release()); |
1141 } | 1143 } |
1142 | 1144 |
1143 std::unique_ptr<net::MultiLogCTVerifier> ct_verifier( | 1145 std::unique_ptr<net::MultiLogCTVerifier> ct_verifier( |
1144 new net::MultiLogCTVerifier()); | 1146 new net::MultiLogCTVerifier()); |
1145 ct_verifier->AddLogs(io_thread_globals->ct_logs); | 1147 ct_verifier->AddLogs(io_thread_globals->ct_logs); |
1146 main_request_context_->set_cert_transparency_verifier(ct_verifier.get()); | 1148 main_request_context_->set_cert_transparency_verifier(ct_verifier.get()); |
| 1149 |
| 1150 ct_tree_tracker_.reset(new certificate_transparency::TreeStateTracker( |
| 1151 io_thread_globals->ct_logs)); |
| 1152 ct_verifier->SetObserver(ct_tree_tracker_.get()); |
| 1153 |
1147 cert_transparency_verifier_ = std::move(ct_verifier); | 1154 cert_transparency_verifier_ = std::move(ct_verifier); |
| 1155 io_thread->RegisterSTHObserver(ct_tree_tracker_.get()); |
| 1156 ct_tree_tracker_unregistration_ = |
| 1157 base::Bind(&IOThread::UnregisterSTHObserver, base::Unretained(io_thread), |
| 1158 ct_tree_tracker_.get()); |
1148 | 1159 |
1149 InitializeInternal(std::move(network_delegate), profile_params_.get(), | 1160 InitializeInternal(std::move(network_delegate), profile_params_.get(), |
1150 protocol_handlers, std::move(request_interceptors)); | 1161 protocol_handlers, std::move(request_interceptors)); |
1151 | 1162 |
1152 profile_params_.reset(); | 1163 profile_params_.reset(); |
1153 initialized_ = true; | 1164 initialized_ = true; |
1154 } | 1165 } |
1155 | 1166 |
1156 void ProfileIOData::ApplyProfileParamsToContext( | 1167 void ProfileIOData::ApplyProfileParamsToContext( |
1157 net::URLRequestContext* context) const { | 1168 net::URLRequestContext* context) const { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 delete this; | 1296 delete this; |
1286 } | 1297 } |
1287 | 1298 |
1288 void ProfileIOData::set_channel_id_service( | 1299 void ProfileIOData::set_channel_id_service( |
1289 net::ChannelIDService* channel_id_service) const { | 1300 net::ChannelIDService* channel_id_service) const { |
1290 channel_id_service_.reset(channel_id_service); | 1301 channel_id_service_.reset(channel_id_service); |
1291 } | 1302 } |
1292 | 1303 |
1293 void ProfileIOData::DestroyResourceContext() { | 1304 void ProfileIOData::DestroyResourceContext() { |
1294 resource_context_.reset(); | 1305 resource_context_.reset(); |
| 1306 // Prevent the cert_transparency_observer_ from getting any more |
| 1307 // notifications by severing the link between it and the |
| 1308 // cert_transparency_verifier_ and unregistering it from new STH |
| 1309 // notifications. |
| 1310 cert_transparency_verifier_->SetObserver(nullptr); |
| 1311 ct_tree_tracker_unregistration_.Run(); |
1295 } | 1312 } |
1296 | 1313 |
1297 std::unique_ptr<net::HttpNetworkSession> | 1314 std::unique_ptr<net::HttpNetworkSession> |
1298 ProfileIOData::CreateHttpNetworkSession( | 1315 ProfileIOData::CreateHttpNetworkSession( |
1299 const ProfileParams& profile_params) const { | 1316 const ProfileParams& profile_params) const { |
1300 net::URLRequestContext* context = main_request_context(); | 1317 net::URLRequestContext* context = main_request_context(); |
1301 | 1318 |
1302 IOThread* const io_thread = profile_params.io_thread; | 1319 IOThread* const io_thread = profile_params.io_thread; |
1303 | 1320 |
1304 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams()); | 1321 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 void ProfileIOData::SetCookieSettingsForTesting( | 1354 void ProfileIOData::SetCookieSettingsForTesting( |
1338 content_settings::CookieSettings* cookie_settings) { | 1355 content_settings::CookieSettings* cookie_settings) { |
1339 DCHECK(!cookie_settings_.get()); | 1356 DCHECK(!cookie_settings_.get()); |
1340 cookie_settings_ = cookie_settings; | 1357 cookie_settings_ = cookie_settings; |
1341 } | 1358 } |
1342 | 1359 |
1343 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( | 1360 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( |
1344 const GURL& url) const { | 1361 const GURL& url) const { |
1345 return url_blacklist_manager_->GetURLBlacklistState(url); | 1362 return url_blacklist_manager_->GetURLBlacklistState(url); |
1346 } | 1363 } |
OLD | NEW |