Chromium Code Reviews| 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/base/network_quality_estimator.h" | 84 #include "net/base/network_quality_estimator.h" |
| 84 #include "net/cert/cert_verifier.h" | 85 #include "net/cert/cert_verifier.h" |
| 86 #include "net/cert/ct_observer.h" | |
| 85 #include "net/cert/multi_log_ct_verifier.h" | 87 #include "net/cert/multi_log_ct_verifier.h" |
| 86 #include "net/cookies/canonical_cookie.h" | 88 #include "net/cookies/canonical_cookie.h" |
| 87 #include "net/http/http_network_session.h" | 89 #include "net/http/http_network_session.h" |
| 88 #include "net/http/http_transaction_factory.h" | 90 #include "net/http/http_transaction_factory.h" |
| 89 #include "net/http/http_util.h" | 91 #include "net/http/http_util.h" |
| 90 #include "net/http/transport_security_persister.h" | 92 #include "net/http/transport_security_persister.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" |
| 94 #include "net/ssl/channel_id_service.h" | 96 #include "net/ssl/channel_id_service.h" |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1132 // Install the New Tab Page Interceptor. | 1134 // Install the New Tab Page Interceptor. |
| 1133 if (profile_params_->new_tab_page_interceptor.get()) { | 1135 if (profile_params_->new_tab_page_interceptor.get()) { |
| 1134 request_interceptors.push_back( | 1136 request_interceptors.push_back( |
| 1135 profile_params_->new_tab_page_interceptor.release()); | 1137 profile_params_->new_tab_page_interceptor.release()); |
| 1136 } | 1138 } |
| 1137 | 1139 |
| 1138 std::unique_ptr<net::MultiLogCTVerifier> ct_verifier( | 1140 std::unique_ptr<net::MultiLogCTVerifier> ct_verifier( |
| 1139 new net::MultiLogCTVerifier()); | 1141 new net::MultiLogCTVerifier()); |
| 1140 ct_verifier->AddLogs(io_thread_globals->ct_logs); | 1142 ct_verifier->AddLogs(io_thread_globals->ct_logs); |
| 1141 main_request_context_->set_cert_transparency_verifier(ct_verifier.get()); | 1143 main_request_context_->set_cert_transparency_verifier(ct_verifier.get()); |
| 1144 | |
| 1145 cert_transparency_observer_.reset( | |
| 1146 new certificate_transparency::TreeStateTracker( | |
| 1147 io_thread_globals->ct_logs)); | |
| 1148 ct_verifier->SetObserver(cert_transparency_observer_.get()); | |
| 1142 cert_transparency_verifier_ = std::move(ct_verifier); | 1149 cert_transparency_verifier_ = std::move(ct_verifier); |
| 1143 | 1150 |
| 1151 io_thread->RegisterSTHObserver(cert_transparency_observer_.get()); | |
| 1152 | |
| 1153 cert_transparency_observer_unregistration_ = | |
| 1154 base::Bind(&IOThread::UnregisterSTHObserver, base::Unretained(io_thread), | |
| 1155 cert_transparency_observer_.get()); | |
|
Ryan Sleevi
2016/04/21 14:05:16
Seems entirely unnecessary to bundle this in a cal
Eran Messeri
2016/04/25 14:50:59
In ProfileIOData::DestroyResourceContext I no long
| |
| 1156 | |
| 1144 InitializeInternal(std::move(network_delegate), profile_params_.get(), | 1157 InitializeInternal(std::move(network_delegate), profile_params_.get(), |
| 1145 protocol_handlers, std::move(request_interceptors)); | 1158 protocol_handlers, std::move(request_interceptors)); |
| 1146 | 1159 |
| 1147 profile_params_.reset(); | 1160 profile_params_.reset(); |
| 1148 initialized_ = true; | 1161 initialized_ = true; |
| 1149 } | 1162 } |
| 1150 | 1163 |
| 1151 void ProfileIOData::ApplyProfileParamsToContext( | 1164 void ProfileIOData::ApplyProfileParamsToContext( |
| 1152 net::URLRequestContext* context) const { | 1165 net::URLRequestContext* context) const { |
| 1153 context->set_http_user_agent_settings( | 1166 context->set_http_user_agent_settings( |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1280 delete this; | 1293 delete this; |
| 1281 } | 1294 } |
| 1282 | 1295 |
| 1283 void ProfileIOData::set_channel_id_service( | 1296 void ProfileIOData::set_channel_id_service( |
| 1284 net::ChannelIDService* channel_id_service) const { | 1297 net::ChannelIDService* channel_id_service) const { |
| 1285 channel_id_service_.reset(channel_id_service); | 1298 channel_id_service_.reset(channel_id_service); |
| 1286 } | 1299 } |
| 1287 | 1300 |
| 1288 void ProfileIOData::DestroyResourceContext() { | 1301 void ProfileIOData::DestroyResourceContext() { |
| 1289 resource_context_.reset(); | 1302 resource_context_.reset(); |
| 1303 // Prevent the cert_transparency_observer_ from getting any more | |
| 1304 // notifications by severing the link between it and the | |
| 1305 // cert_transparency_verifier_ and unregistering it from new STH | |
| 1306 // notifications. | |
| 1307 cert_transparency_verifier_->SetObserver(nullptr); | |
| 1308 cert_transparency_observer_unregistration_.Run(); | |
| 1290 } | 1309 } |
| 1291 | 1310 |
| 1292 std::unique_ptr<net::HttpNetworkSession> | 1311 std::unique_ptr<net::HttpNetworkSession> |
| 1293 ProfileIOData::CreateHttpNetworkSession( | 1312 ProfileIOData::CreateHttpNetworkSession( |
| 1294 const ProfileParams& profile_params) const { | 1313 const ProfileParams& profile_params) const { |
| 1295 net::URLRequestContext* context = main_request_context(); | 1314 net::URLRequestContext* context = main_request_context(); |
| 1296 | 1315 |
| 1297 IOThread* const io_thread = profile_params.io_thread; | 1316 IOThread* const io_thread = profile_params.io_thread; |
| 1298 | 1317 |
| 1299 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams()); | 1318 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams()); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1327 base::WrapUnique(new DevToolsNetworkTransactionFactory( | 1346 base::WrapUnique(new DevToolsNetworkTransactionFactory( |
| 1328 network_controller_handle_.GetController(), shared_session)), | 1347 network_controller_handle_.GetController(), shared_session)), |
| 1329 std::move(backend), true /* set_up_quic_server_info */)); | 1348 std::move(backend), true /* set_up_quic_server_info */)); |
| 1330 } | 1349 } |
| 1331 | 1350 |
| 1332 void ProfileIOData::SetCookieSettingsForTesting( | 1351 void ProfileIOData::SetCookieSettingsForTesting( |
| 1333 content_settings::CookieSettings* cookie_settings) { | 1352 content_settings::CookieSettings* cookie_settings) { |
| 1334 DCHECK(!cookie_settings_.get()); | 1353 DCHECK(!cookie_settings_.get()); |
| 1335 cookie_settings_ = cookie_settings; | 1354 cookie_settings_ = cookie_settings; |
| 1336 } | 1355 } |
| OLD | NEW |