Chromium Code Reviews| Index: net/cert/sth_observer.h |
| diff --git a/net/cert/sth_observer.h b/net/cert/sth_observer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2fc4ef0d1ee7a1be75ca9e5c359274aae6308187 |
| --- /dev/null |
| +++ b/net/cert/sth_observer.h |
| @@ -0,0 +1,41 @@ |
| +// 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 NET_CERT_STH_OBSERVER_H_ |
| +#define NET_CERT_STH_OBSERVER_H_ |
| + |
| +#include <set> |
| + |
| +#include "net/base/net_export.h" |
| + |
| +namespace net { |
| + |
| +namespace ct { |
| + |
| +struct SignedTreeHead; |
| + |
| +// Interface for receiving notifications of new STHs observed. |
| +class NET_EXPORT STHObserver { |
| + public: |
| + virtual ~STHObserver() {} |
| + |
| + // Called with a new |sth| when one is observed. |
| + // Expected to be called on the IO thread. |
| + virtual void NewSTHObserved(const SignedTreeHead& sth) = 0; |
| +}; |
| + |
| +// Interface for registering/unregistering observers. |
| +class NET_EXPORT STHReporter { |
|
Ryan Sleevi
2016/04/06 18:32:51
Shouldn't this be in its own header? STHDistributo
Eran Messeri
2016/04/07 11:38:03
You're right, I've separated them into different h
|
| + public: |
| + virtual ~STHReporter() {} |
| + |
| + virtual void RegisterObserver(STHObserver* observer) = 0; |
| + virtual void UnregisterObserver(STHObserver* observer) = 0; |
| +}; |
| + |
| +} // namespace ct |
| + |
| +} // namespace net |
| + |
| +#endif // NET_CERT_STH_OBSERVER_H_ |