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

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

Issue 547603002: Certificate Transparency: Code for unpacking EV cert hashes whitelist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoiding globals in favour of passing the SSLConfigService around Created 6 years, 3 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/ev_whitelist_component_installer.cc
diff --git a/chrome/browser/component_updater/ev_whitelist_component_installer.cc b/chrome/browser/component_updater/ev_whitelist_component_installer.cc
index 90580784c025ccc4d943dd78466e1ccad4291333..da8951d408185fdc6760b238459b5aa7f629138b 100644
--- a/chrome/browser/component_updater/ev_whitelist_component_installer.cc
+++ b/chrome/browser/component_updater/ev_whitelist_component_installer.cc
@@ -13,6 +13,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/path_service.h"
+#include "chrome/browser/net/packed_ct_ev_whitelist.h"
#include "components/component_updater/component_updater_paths.h"
#include "content/public/browser/browser_thread.h"
#include "net/ssl/ssl_config_service.h"
@@ -35,7 +36,12 @@ const uint8_t kPublicKeySHA256[32] = {
const char kEVWhitelistManifestName[] = "EV Certs CT whitelist";
-EVWhitelistComponentInstallerTraits::EVWhitelistComponentInstallerTraits() {
+EVWhitelistComponentInstallerTraits::EVWhitelistComponentInstallerTraits(
+ net::SSLConfigService* ssl_config_service)
+ : ssl_config_service_(ssl_config_service) {
+}
+
+EVWhitelistComponentInstallerTraits::~EVWhitelistComponentInstallerTraits() {
}
bool EVWhitelistComponentInstallerTraits::CanAutoUpdate() const {
@@ -65,16 +71,10 @@ void EVWhitelistComponentInstallerTraits::ComponentReady(
VLOG(1) << "Component ready, version " << version.GetString() << " in "
<< path.value();
- // TODO(eranm): Uncomment once https://codereview.chromium.org/462543002/
- // is in.
- /*
const base::FilePath whitelist_file = GetInstalledPath(path);
- base::Callback<void(void)> set_cb =
- base::Bind(&net::ct::SetEVWhitelistFromFile, whitelist_file);
content::BrowserThread::PostBlockingPoolTask(
FROM_HERE,
- set_cb);
- */
+ base::Bind(&SetEVWhitelistFromFile, whitelist_file, ssl_config_service_));
}
bool EVWhitelistComponentInstallerTraits::VerifyInstallation(
@@ -113,11 +113,12 @@ std::string EVWhitelistComponentInstallerTraits::GetName() const {
return kEVWhitelistManifestName;
}
-void RegisterEVWhitelistComponent(ComponentUpdateService* cus) {
+void RegisterEVWhitelistComponent(ComponentUpdateService* cus,
+ net::SSLConfigService* ssl_config_service) {
VLOG(1) << "Registering EV whitelist component.";
scoped_ptr<ComponentInstallerTraits> traits(
- new EVWhitelistComponentInstallerTraits());
+ new EVWhitelistComponentInstallerTraits(ssl_config_service));
// |cus| will take ownership of |installer| during installer->Register(cus).
DefaultComponentInstaller* installer =
new DefaultComponentInstaller(traits.Pass());

Powered by Google App Engine
This is Rietveld 408576698