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

Unified Diff: chrome/browser/io_thread.cc

Issue 1100003006: Certificate Transparency: Fetching of Signed Tree Heads (DRAFT) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BUILD.gn file fixes per review comments Created 5 years, 4 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_impl_io_data.cc » ('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 f5d30e33c119380c722346919143ffdbb04a3a25..2f9b0382b760a6aedf3a080fd20d81ba5b7432b4 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -40,6 +40,8 @@
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
+#include "components/certificate_transparency/log_proof_fetcher.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/policy/core/common/policy_service.h"
@@ -710,6 +712,8 @@ void IOThread::Init() {
}
}
+ globals_->ct_logs.assign(ct_logs.begin(), ct_logs.end());
+
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
// is fixed.
tracked_objects::ScopedTracker tracking_profile9(
@@ -723,7 +727,7 @@ void IOThread::Init() {
net::MultiLogCTVerifier* ct_verifier = new net::MultiLogCTVerifier();
globals_->cert_transparency_verifier.reset(ct_verifier);
// Add built-in logs
- ct_verifier->AddLogs(ct_logs);
+ ct_verifier->AddLogs(globals_->ct_logs);
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
// is fixed.
@@ -910,6 +914,7 @@ void IOThread::CleanUp() {
// Release objects that the net::URLRequestContext could have been pointing
// to.
+ globals()->cert_transparency_verifier->SetObserver(nullptr);
// Shutdown the HistogramWatcher on the IO thread.
net::NetworkChangeNotifier::ShutdownHistogramWatcher();
@@ -1237,6 +1242,21 @@ void IOThread::InitSystemRequestContextOnIOThread() {
globals_->ssl_config_service.get());
globals_->system_request_context->set_http_server_properties(
globals_->http_server_properties->GetWeakPtr());
+
+ VLOG(1) << "Creating TreeStateTracker observer on IOThread.";
+ scoped_ptr<certificate_transparency::LogProofFetcher> proof_fetcher(
+ new certificate_transparency::LogProofFetcher(
+ globals_->system_request_context.get()));
+
+ certificate_transparency::TreeStateTracker* scts_observer(
+ new certificate_transparency::TreeStateTracker(proof_fetcher.Pass(),
+ globals_->ct_logs));
+ globals_->cert_transparency_observer.reset(scts_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() {
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/profiles/profile_impl_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698