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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #include "net/base/keygen_handler.h" | 66 #include "net/base/keygen_handler.h" |
67 #include "net/cookies/canonical_cookie.h" | 67 #include "net/cookies/canonical_cookie.h" |
68 #include "net/http/http_transaction_factory.h" | 68 #include "net/http/http_transaction_factory.h" |
69 #include "net/http/http_util.h" | 69 #include "net/http/http_util.h" |
70 #include "net/http/transport_security_persister.h" | 70 #include "net/http/transport_security_persister.h" |
71 #include "net/proxy/proxy_config_service_fixed.h" | 71 #include "net/proxy/proxy_config_service_fixed.h" |
72 #include "net/proxy/proxy_script_fetcher_impl.h" | 72 #include "net/proxy/proxy_script_fetcher_impl.h" |
73 #include "net/proxy/proxy_service.h" | 73 #include "net/proxy/proxy_service.h" |
74 #include "net/ssl/channel_id_service.h" | 74 #include "net/ssl/channel_id_service.h" |
75 #include "net/ssl/client_cert_store.h" | 75 #include "net/ssl/client_cert_store.h" |
| 76 #include "net/url_request/certificate_report_sender.h" |
76 #include "net/url_request/data_protocol_handler.h" | 77 #include "net/url_request/data_protocol_handler.h" |
77 #include "net/url_request/file_protocol_handler.h" | 78 #include "net/url_request/file_protocol_handler.h" |
78 #include "net/url_request/ftp_protocol_handler.h" | 79 #include "net/url_request/ftp_protocol_handler.h" |
79 #include "net/url_request/url_request.h" | 80 #include "net/url_request/url_request.h" |
80 #include "net/url_request/url_request_context.h" | 81 #include "net/url_request/url_request_context.h" |
81 #include "net/url_request/url_request_file_job.h" | 82 #include "net/url_request/url_request_file_job.h" |
82 #include "net/url_request/url_request_intercepting_job_factory.h" | 83 #include "net/url_request/url_request_intercepting_job_factory.h" |
83 #include "net/url_request/url_request_interceptor.h" | 84 #include "net/url_request/url_request_interceptor.h" |
84 #include "net/url_request/url_request_job_factory_impl.h" | 85 #include "net/url_request/url_request_job_factory_impl.h" |
85 | 86 |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 for (URLRequestContextMap::const_iterator it = | 634 for (URLRequestContextMap::const_iterator it = |
634 isolated_media_request_context_map_.begin(); | 635 isolated_media_request_context_map_.begin(); |
635 current_context < kMaxCachedContexts && | 636 current_context < kMaxCachedContexts && |
636 it != isolated_media_request_context_map_.end(); | 637 it != isolated_media_request_context_map_.end(); |
637 ++it, ++current_context) { | 638 ++it, ++current_context) { |
638 media_context_cache[current_context] = it->second; | 639 media_context_cache[current_context] = it->second; |
639 memcpy(&media_context_vtable_cache[current_context], | 640 memcpy(&media_context_vtable_cache[current_context], |
640 static_cast<void*>(it->second), sizeof(void*)); | 641 static_cast<void*>(it->second), sizeof(void*)); |
641 } | 642 } |
642 | 643 |
| 644 // Destroy certificate_report_sender_ before main_request_context_, |
| 645 // since the former has a reference to the latter. |
| 646 transport_security_state_->SetReportSender(nullptr); |
| 647 certificate_report_sender_.reset(); |
| 648 |
643 // TODO(ajwong): These AssertNoURLRequests() calls are unnecessary since they | 649 // TODO(ajwong): These AssertNoURLRequests() calls are unnecessary since they |
644 // are already done in the URLRequestContext destructor. | 650 // are already done in the URLRequestContext destructor. |
645 if (main_request_context_) | 651 if (main_request_context_) |
646 main_request_context_->AssertNoURLRequests(); | 652 main_request_context_->AssertNoURLRequests(); |
647 if (extensions_request_context_) | 653 if (extensions_request_context_) |
648 extensions_request_context_->AssertNoURLRequests(); | 654 extensions_request_context_->AssertNoURLRequests(); |
649 | 655 |
650 current_context = 0; | 656 current_context = 0; |
651 for (URLRequestContextMap::iterator it = app_request_context_map_.begin(); | 657 for (URLRequestContextMap::iterator it = app_request_context_map_.begin(); |
652 it != app_request_context_map_.end(); ++it) { | 658 it != app_request_context_map_.end(); ++it) { |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); | 1058 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); |
1053 transport_security_persister_.reset( | 1059 transport_security_persister_.reset( |
1054 new net::TransportSecurityPersister( | 1060 new net::TransportSecurityPersister( |
1055 transport_security_state_.get(), | 1061 transport_security_state_.get(), |
1056 profile_params_->path, | 1062 profile_params_->path, |
1057 pool->GetSequencedTaskRunnerWithShutdownBehavior( | 1063 pool->GetSequencedTaskRunnerWithShutdownBehavior( |
1058 pool->GetSequenceToken(), | 1064 pool->GetSequenceToken(), |
1059 base::SequencedWorkerPool::BLOCK_SHUTDOWN), | 1065 base::SequencedWorkerPool::BLOCK_SHUTDOWN), |
1060 IsOffTheRecord())); | 1066 IsOffTheRecord())); |
1061 | 1067 |
| 1068 certificate_report_sender_.reset(new net::CertificateReportSender( |
| 1069 main_request_context_.get(), |
| 1070 net::CertificateReportSender::DO_NOT_SEND_COOKIES)); |
| 1071 transport_security_state_->SetReportSender(certificate_report_sender_.get()); |
| 1072 |
1062 // Take ownership over these parameters. | 1073 // Take ownership over these parameters. |
1063 cookie_settings_ = profile_params_->cookie_settings; | 1074 cookie_settings_ = profile_params_->cookie_settings; |
1064 host_content_settings_map_ = profile_params_->host_content_settings_map; | 1075 host_content_settings_map_ = profile_params_->host_content_settings_map; |
1065 #if defined(ENABLE_EXTENSIONS) | 1076 #if defined(ENABLE_EXTENSIONS) |
1066 extension_info_map_ = profile_params_->extension_info_map; | 1077 extension_info_map_ = profile_params_->extension_info_map; |
1067 #endif | 1078 #endif |
1068 | 1079 |
1069 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); | 1080 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); |
1070 resource_context_->request_context_ = main_request_context_.get(); | 1081 resource_context_->request_context_ = main_request_context_.get(); |
1071 | 1082 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 new DevToolsNetworkTransactionFactory( | 1308 new DevToolsNetworkTransactionFactory( |
1298 network_controller_.get(), shared_session), | 1309 network_controller_.get(), shared_session), |
1299 shared_session->net_log(), backend)); | 1310 shared_session->net_log(), backend)); |
1300 } | 1311 } |
1301 | 1312 |
1302 void ProfileIOData::SetCookieSettingsForTesting( | 1313 void ProfileIOData::SetCookieSettingsForTesting( |
1303 content_settings::CookieSettings* cookie_settings) { | 1314 content_settings::CookieSettings* cookie_settings) { |
1304 DCHECK(!cookie_settings_.get()); | 1315 DCHECK(!cookie_settings_.get()); |
1305 cookie_settings_ = cookie_settings; | 1316 cookie_settings_ = cookie_settings; |
1306 } | 1317 } |
OLD | NEW |