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

Unified Diff: net/cert/sth_distributor.h

Issue 1968053002: Certificate Transparency: Notify STH Observers of known STHs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final operator, test changes Created 4 years, 7 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 | « net/cert/signed_tree_head.cc ('k') | net/cert/sth_distributor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/sth_distributor.h
diff --git a/net/cert/sth_distributor.h b/net/cert/sth_distributor.h
index 3d9691cc56c029a47c627f6aee0987d7e2b5c3cf..fee3a62dd9bc1fcc3e35c8644f36622050dbe936 100644
--- a/net/cert/sth_distributor.h
+++ b/net/cert/sth_distributor.h
@@ -5,6 +5,8 @@
#ifndef NET_CERT_STH_DISTRIBUTOR_H_
#define NET_CERT_STH_DISTRIBUTOR_H_
+#include <vector>
+
#include "base/observer_list.h"
#include "net/base/net_export.h"
#include "net/cert/sth_observer.h"
@@ -14,6 +16,8 @@ namespace net {
namespace ct {
+struct SignedTreeHead;
+
// A proxy for delegating new STH notifications to all registered
// observers.
// For each |observer| registered with RegisterObserver, the
@@ -28,10 +32,20 @@ class NET_EXPORT STHDistributor : public STHObserver, public STHReporter {
void NewSTHObserved(const SignedTreeHead& sth) override;
// STHReporter implementation
+ // Registers |observer| for new STH notifications. On registration,
+ // the |observer| will be notified of the latest STH for each log tha the
+ // STHDistributor has observed.
void RegisterObserver(STHObserver* observer) override;
+
+ // Unregisters |observer|, which must have been previously
+ // registered via RegisterObserver()
void UnregisterObserver(STHObserver* observer) override;
private:
+ // STHs from logs, one for each log.
+ std::vector<SignedTreeHead> observed_sths_;
+
+ // The observers for new STH notifications.
base::ObserverList<STHObserver> observer_list_;
};
« no previous file with comments | « net/cert/signed_tree_head.cc ('k') | net/cert/sth_distributor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698