| OLD | NEW |
| (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 COMPONENTS_CERTIFICATE_TRANSPARENCY_TREE_STATE_TRACKER_H_ |
| 6 #define COMPONENTS_CERTIFICATE_TRANSPARENCY_TREE_STATE_TRACKER_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "net/cert/ct_observer.h" |
| 15 |
| 16 namespace net { |
| 17 class CTLogVerifier; |
| 18 class X509Certificate; |
| 19 |
| 20 namespace ct { |
| 21 struct SignedCertificateTimestamp; |
| 22 struct SignedTreeHead; |
| 23 } // namespace ct |
| 24 |
| 25 } // namespace net |
| 26 |
| 27 namespace certificate_transparency { |
| 28 |
| 29 // Entry point for handling notification of new STHs/SCTs for a particular |
| 30 // browsing session. |
| 31 // TODO(eranm): Export the inclusion check status of SCTs+Certs so it can |
| 32 // be used in the DevTools Security panel, for example - crbug.com/506227 |
| 33 class TreeStateTracker : public net::ct::CTObserver { |
| 34 public: |
| 35 explicit TreeStateTracker( |
| 36 std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs); |
| 37 ~TreeStateTracker() override; |
| 38 |
| 39 // net::ct::CTVerifier::Observer implementation. |
| 40 // Delegates to the tree tracker corresponding to the log that issued the SCT. |
| 41 void OnSCTVerified(net::X509Certificate* cert, |
| 42 const net::ct::SignedCertificateTimestamp* sct) override; |
| 43 |
| 44 // net::ct::STHObserver implementation. |
| 45 // Delegates to the tree tracker corresponding to the log that issued the STH. |
| 46 void NewSTHObserved(const net::ct::SignedTreeHead& sth) override; |
| 47 |
| 48 private: |
| 49 // Holds the SingleTreeTracker for each log |
| 50 std::map<std::string, scoped_ptr<net::ct::CTObserver>> tree_trackers_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(TreeStateTracker); |
| 53 }; |
| 54 |
| 55 } // namespace certificate_transparency |
| 56 |
| 57 #endif // COMPONENTS_CERTIFICATE_TRANSPARENCY_TREE_STATE_TRACKER_H_ |
| OLD | NEW |