Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 2014573002: Certificate Transparency: Wire the TreeStateTracker up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Lei's comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d69437db98ac0239b1d83a140b76b32399954476..43a4dfad005490877c306f3ccde20b46b6961337 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"
@@ -81,6 +82,7 @@
#include "content/public/browser/resource_context.h"
#include "net/base/keygen_handler.h"
#include "net/cert/cert_verifier.h"
+#include "net/cert/ct_log_verifier.h"
#include "net/cert/multi_log_ct_verifier.h"
#include "net/cookies/canonical_cookie.h"
#include "net/http/http_network_session.h"
@@ -1146,7 +1148,16 @@ void ProfileIOData::Init(
new net::MultiLogCTVerifier());
ct_verifier->AddLogs(io_thread_globals->ct_logs);
main_request_context_->set_cert_transparency_verifier(ct_verifier.get());
+
+ ct_tree_tracker_.reset(new certificate_transparency::TreeStateTracker(
+ io_thread_globals->ct_logs));
+ ct_verifier->SetObserver(ct_tree_tracker_.get());
+
cert_transparency_verifier_ = std::move(ct_verifier);
+ io_thread->RegisterSTHObserver(ct_tree_tracker_.get());
+ ct_tree_tracker_unregistration_ =
+ base::Bind(&IOThread::UnregisterSTHObserver, base::Unretained(io_thread),
+ ct_tree_tracker_.get());
InitializeInternal(std::move(network_delegate), profile_params_.get(),
protocol_handlers, std::move(request_interceptors));
@@ -1295,6 +1306,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);
+ ct_tree_tracker_unregistration_.Run();
}
std::unique_ptr<net::HttpNetworkSession>
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698