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

Unified Diff: chrome/browser/io_thread.cc

Issue 1845113003: Certificate Transparency: Start tracking logs' state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/io_thread.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 7ba293b4aa722777912079c517dc83c48885599d..98ce37ea538b68d1fe6c682558b69c84fb9b9178 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -42,6 +42,7 @@
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
+#include "components/certificate_transparency/tree_state_tracker.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prefs.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/data_usage/core/data_use_aggregator.h"
@@ -871,6 +872,10 @@ void IOThread::CleanUp() {
// Release objects that the net::URLRequestContext could have been pointing
// to.
+ globals()->cert_transparency_verifier->SetObserver(nullptr);
+
+ VLOG(1) << "XXX: IOThread::CleanUp";
+ globals()->sth_observers_registrar.UnregisterAll();
// Shutdown the HistogramWatcher on the IO thread.
net::NetworkChangeNotifier::ShutdownHistogramWatcher();
@@ -1213,6 +1218,23 @@ void IOThread::InitSystemRequestContextOnIOThread() {
globals_->system_request_context.reset(
ConstructSystemRequestContext(globals_, net_log_));
+
+ VLOG(1) << "Creating TreeStateTracker observer on IOThread.";
+ // TODO(eranm): Clean up the order of pointer creation and
+ // moving around. This should be a scoped_ptr until ownership
+ // is transferred to globals_->cert_transparency_observer
+ certificate_transparency::TreeStateTracker* scts_observer(
+ new certificate_transparency::TreeStateTracker(globals_->ct_logs));
+ globals_->cert_transparency_observer.reset(scts_observer);
+ globals_->sth_observers_registrar.SignUpForRegistration(
+ globals_->cert_transparency_observer.get());
+ VLOG(1)
+ << "XXX IOThread::InitSystemRequestContextOnIOThread, created observer.";
+ // The |cert_transparency_verifier| is the same one held by
+ // the |proxy_script_fetcher_context| and |system_request_context|,
+ // so no need to set the observer in their cert_transparency_verifiers.
+ globals_->cert_transparency_verifier->SetObserver(scts_observer);
+ VLOG(1) << "TreeStateTracker observer on IOThread created.";
}
void IOThread::UpdateDnsClientEnabled() {
@@ -1406,6 +1428,16 @@ bool IOThread::ShouldEnableQuicPortSelection(
return false; // Default to disabling port selection on all channels.
}
+void IOThread::RegisterWithSTHObserver(net::ct::STHReporter* reporter) {
+ DCHECK(globals());
+ // Just a sanity check to make sure it was created by now.
+ DCHECK(globals()->cert_transparency_observer.get());
+
+ VLOG(1) << "XXX IOThread::RegisterWithSTHObserver";
+
+ globals()->sth_observers_registrar.AssignReporter(reporter);
+}
+
net::QuicTagVector IOThread::GetQuicConnectionOptions(
const base::CommandLine& command_line,
const VariationParameters& quic_trial_params) {
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698