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

Side by Side Diff: net/cert/sth_observer.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, 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 unified diff | Download patch
« no previous file with comments | « net/cert/sth_distributor.cc ('k') | net/cert/sth_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_CERT_STH_OBSERVER_H_
6 #define NET_CERT_STH_OBSERVER_H_
7
8 #include <set>
9
10 #include "net/base/net_export.h"
11
12 namespace net {
13
14 namespace ct {
15
16 struct SignedTreeHead;
17
18 class NET_EXPORT STHObserver {
19 public:
20 virtual ~STHObserver() {}
21
22 virtual void NewSTHObserved(const SignedTreeHead& sth) = 0;
23 };
24
25 class NET_EXPORT STHReporter {
26 public:
27 virtual ~STHReporter() {}
28
29 virtual void RegisterObserver(STHObserver* observer) = 0;
30 virtual void UnregisterObserver(STHObserver* observer) = 0;
31 };
32
33 class NET_EXPORT STHReporterRegistrar {
34 public:
35 STHReporterRegistrar();
36 ~STHReporterRegistrar();
37
38 // Stores the |observer| for later registration when a reporter
39 // is provided, or registers it immediately if one was already
40 // provided via AssignReporter.
41 void SignUpForRegistration(STHObserver* observer);
42 // Can only be called once; Calls STHReporter::RegisterObserver
43 // for each of the observers registered with SignUpForRegistration
44 void AssignReporter(STHReporter* reporter);
45 // Calls STHReporter::UnregisterObserver for all observers
46 // registered with SignUpForRegistration
47 void UnregisterAll();
48 // Unregisters an individual reporter.
49 void UnregisterObserver(STHObserver* observer);
50
51 private:
52 STHReporter* reporter_;
53 std::set<STHObserver*> pending_observers_;
54 };
55
56 } // namespace ct
57
58 } // namespace net
59
60 #endif // NET_CERT_STH_OBSERVER_H_
OLDNEW
« no previous file with comments | « net/cert/sth_distributor.cc ('k') | net/cert/sth_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698