Chromium Code Reviews| Index: net/cert/sth_distributor.cc |
| diff --git a/net/cert/sth_distributor.cc b/net/cert/sth_distributor.cc |
| index 0b8df2606660cd0e60a47b9756bc7d3d3b5a95fa..9c5bef16d577687fe214fccd764c9c30cd077e94 100644 |
| --- a/net/cert/sth_distributor.cc |
| +++ b/net/cert/sth_distributor.cc |
| @@ -18,12 +18,22 @@ namespace net { |
| namespace ct { |
| +namespace internal { |
| + |
| +bool STHLogIDComparator::operator()(const SignedTreeHead& first, |
| + const SignedTreeHead& second) { |
| + return first.log_id < second.log_id; |
| +} |
| + |
| +} // namespace internal |
| + |
| STHDistributor::STHDistributor() |
| : observer_list_(base::ObserverList<STHObserver>::NOTIFY_EXISTING_ONLY) {} |
| STHDistributor::~STHDistributor() {} |
| void STHDistributor::NewSTHObserved(const SignedTreeHead& sth) { |
| + observed_sths_.insert(sth); |
| FOR_EACH_OBSERVER(STHObserver, observer_list_, NewSTHObserved(sth)); |
| if (sth.log_id.compare(0, sth.log_id.size(), kPilotLogID, |
| @@ -38,6 +48,8 @@ void STHDistributor::NewSTHObserved(const SignedTreeHead& sth) { |
| void STHDistributor::RegisterObserver(STHObserver* observer) { |
| observer_list_.AddObserver(observer); |
| + for (const SignedTreeHead& sth : observed_sths_) |
|
Ryan Sleevi
2016/05/12 19:51:28
const auto& is fine here.
Eran Messeri
2016/05/13 09:04:08
Done.
|
| + observer->NewSTHObserved(sth); |
| } |
| void STHDistributor::UnregisterObserver(STHObserver* observer) { |