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

Unified Diff: chrome/browser/component_updater/sth_set_component_installer.cc

Issue 1845113003: Certificate Transparency: Start tracking logs' state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing review comments Created 4 years, 8 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
Index: chrome/browser/component_updater/sth_set_component_installer.cc
diff --git a/chrome/browser/component_updater/sth_set_component_installer.cc b/chrome/browser/component_updater/sth_set_component_installer.cc
index d26c8784b5498cdeacd1ec042a967b6a31e8b055..604b5303576eec9c265677c930ead722eaa9dc13 100644
--- a/chrome/browser/component_updater/sth_set_component_installer.cc
+++ b/chrome/browser/component_updater/sth_set_component_installer.cc
@@ -15,6 +15,8 @@
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "base/version.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/io_thread.h"
#include "components/component_updater/component_updater_paths.h"
#include "components/safe_json/safe_json_parser.h"
#include "content/public/browser/browser_thread.h"
@@ -185,11 +187,16 @@ void RegisterSTHSetComponent(ComponentUpdateService* cus,
const base::FilePath& user_data_dir) {
DVLOG(1) << "Registering STH Set fetcher component.";
- // TODO(eranm): The next step in auditing CT logs (crbug.com/506227) is to
- // pass the distributor to the IOThread so it can be used in a per-profile
- // context for checking inclusion of SCTs.
scoped_ptr<net::ct::STHDistributor> distributor(
new net::ct::STHDistributor());
+ // Register the distributor as the STHReporter for the IOThread (see
+ // crbug.com/506227 for details).
+ DCHECK(g_browser_process->io_thread());
Ryan Sleevi 2016/04/21 14:05:15 This defeats the abstraction of lines 195-196 (con
Eran Messeri 2016/04/25 14:50:59 Apologies, but I am not sure I understand this com
Ryan Sleevi 2016/04/27 23:05:58 Yes. The point of using content::BrowserThread::P
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&IOThread::RegisterSTHReporter,
+ base::Unretained(g_browser_process->io_thread()),
Ryan Sleevi 2016/04/21 14:05:15 g_browser_process has an incredibly high bar to ju
Eran Messeri 2016/04/25 14:50:59 I'm trying to share an STHDistributor instance bet
Ryan Sleevi 2016/04/27 23:05:58 Having objects live on multiple threads - whether
Sorin Jianu 2016/05/05 00:32:03 I have a minor concern regarding a coupling issue
+ distributor.get()));
scoped_ptr<ComponentInstallerTraits> traits(
new STHSetComponentInstallerTraits(std::move(distributor)));
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/io_thread.h » ('j') | chrome/browser/io_thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698