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

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

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
Index: chrome/browser/component_updater/sth_set_component_installer.h
diff --git a/chrome/browser/component_updater/ev_whitelist_component_installer.h b/chrome/browser/component_updater/sth_set_component_installer.h
similarity index 50%
copy from chrome/browser/component_updater/ev_whitelist_component_installer.h
copy to chrome/browser/component_updater/sth_set_component_installer.h
index 9e765d80ddd5f9da9bf3a86282d49d4a0400a0a3..ccd0b74a8c91b26c706bbac4bc4a040c1230b295 100644
--- a/chrome/browser/component_updater/ev_whitelist_component_installer.h
+++ b/chrome/browser/component_updater/sth_set_component_installer.h
@@ -1,9 +1,9 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_
-#define CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_
+#ifndef CHROME_BROWSER_COMPONENT_UPDATER_STH_SET_COMPONENT_INSTALLER_H_
+#define CHROME_BROWSER_COMPONENT_UPDATER_STH_SET_COMPONENT_INSTALLER_H_
#include <stdint.h>
#include <string>
@@ -11,21 +11,25 @@
#include "base/files/file_path.h"
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "components/component_updater/default_component_installer.h"
+#include "net/cert/sth_distributor.h"
namespace base {
class FilePath;
+class Value;
} // namespace base
namespace component_updater {
class ComponentUpdateService;
-class EVWhitelistComponentInstallerTraits : public ComponentInstallerTraits {
+class STHSetComponentInstallerTraits : public ComponentInstallerTraits {
public:
- EVWhitelistComponentInstallerTraits() {}
- ~EVWhitelistComponentInstallerTraits() override {}
+ STHSetComponentInstallerTraits(
+ scoped_ptr<net::ct::STHDistributor> sth_distributor);
+ ~STHSetComponentInstallerTraits() override;
private:
// The following methods override ComponentInstallerTraits.
@@ -43,14 +47,26 @@ class EVWhitelistComponentInstallerTraits : public ComponentInstallerTraits {
static base::FilePath GetInstalledPath(const base::FilePath& base);
- DISALLOW_COPY_AND_ASSIGN(EVWhitelistComponentInstallerTraits);
+ // Reads and parses the on-disk json.
+ void LoadSTHsFromDisk(const base::FilePath& sths_file_path,
+ const base::Version& version);
+
+ // Handle successful parsing of JSON by distributing the new STH.
+ void OnJsonParseSuccess(scoped_ptr<base::Value> parsed_json);
+
+ // STH parsing failed - do nothing.
+ void OnJsonParseError(const std::string& error);
+
+ scoped_ptr<net::ct::STHDistributor> sth_distributor_;
+
+ DISALLOW_COPY_AND_ASSIGN(STHSetComponentInstallerTraits);
};
-// Call once during startup to make the component update service aware of
-// the EV whitelist.
-void RegisterEVWhitelistComponent(ComponentUpdateService* cus,
- const base::FilePath& user_data_dir);
+void RegisterSTHSetComponent(
+ ComponentUpdateService* cus,
+ const base::FilePath& user_data_dir,
+ scoped_ptr<net::ct::STHDistributor> sth_distributor);
} // namespace component_updater
-#endif // CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_
+#endif // CHROME_BROWSER_COMPONENT_UPDATER_STH_SET_COMPONENT_INSTALLER_H_
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/component_updater/sth_set_component_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698