Chromium Code Reviews| Index: chrome/browser/profiles/profile_io_data.cc |
| diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc |
| index 39ec7628594b68bd18c44e8c8817c982a3eb6202..a3351d8df2a4cdce3709ac0ea30def182119d5c3 100644 |
| --- a/chrome/browser/profiles/profile_io_data.cc |
| +++ b/chrome/browser/profiles/profile_io_data.cc |
| @@ -58,6 +58,7 @@ |
| #include "chrome/common/pref_names.h" |
| #include "chrome/common/url_constants.h" |
| #include "components/about_handler/about_protocol_handler.h" |
| +#include "components/certificate_transparency/tree_state_tracker.h" |
| #include "components/content_settings/core/browser/content_settings_provider.h" |
| #include "components/content_settings/core/browser/cookie_settings.h" |
| #include "components/content_settings/core/browser/host_content_settings_map.h" |
| @@ -82,6 +83,7 @@ |
| #include "net/base/keygen_handler.h" |
| #include "net/base/network_quality_estimator.h" |
| #include "net/cert/cert_verifier.h" |
| +#include "net/cert/ct_observer.h" |
| #include "net/cert/multi_log_ct_verifier.h" |
| #include "net/cookies/canonical_cookie.h" |
| #include "net/http/http_network_session.h" |
| @@ -1139,8 +1141,19 @@ void ProfileIOData::Init( |
| new net::MultiLogCTVerifier()); |
| ct_verifier->AddLogs(io_thread_globals->ct_logs); |
| main_request_context_->set_cert_transparency_verifier(ct_verifier.get()); |
| + |
| + cert_transparency_observer_.reset( |
| + new certificate_transparency::TreeStateTracker( |
| + io_thread_globals->ct_logs)); |
| + ct_verifier->SetObserver(cert_transparency_observer_.get()); |
| cert_transparency_verifier_ = std::move(ct_verifier); |
| + io_thread->RegisterSTHObserver(cert_transparency_observer_.get()); |
| + |
| + cert_transparency_observer_unregistration_ = |
| + base::Bind(&IOThread::UnregisterSTHObserver, base::Unretained(io_thread), |
| + 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
|
| + |
| InitializeInternal(std::move(network_delegate), profile_params_.get(), |
| protocol_handlers, std::move(request_interceptors)); |
| @@ -1287,6 +1300,12 @@ void ProfileIOData::set_channel_id_service( |
| void ProfileIOData::DestroyResourceContext() { |
| resource_context_.reset(); |
| + // Prevent the cert_transparency_observer_ from getting any more |
| + // notifications by severing the link between it and the |
| + // cert_transparency_verifier_ and unregistering it from new STH |
| + // notifications. |
| + cert_transparency_verifier_->SetObserver(nullptr); |
| + cert_transparency_observer_unregistration_.Run(); |
| } |
| std::unique_ptr<net::HttpNetworkSession> |