| 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 #include "components/certificate_transparency/timestamped_leaf.h" |
| 6 |
| 7 TimestampedLeaf::TimestampedLeaf(const net::ct::MerkleTreeLeaf& leaf, |
| 8 const base::Time& seen_at) |
| 9 : leaf_(leaf), first_seen_(seen_at) {} |
| 10 |
| 11 TimestampedLeaf::TimestampedLeaf(const TimestampedLeaf& other) |
| 12 : leaf_(other.leaf_), |
| 13 first_seen_(other.first_seen_), |
| 14 leaf_index_(other.leaf_index_) {} |
| 15 |
| 16 TimestampedLeaf::~TimestampedLeaf() {} |
| 17 |
| 18 void TimestampedLeaf::SetLeafIndex(uint64_t index) { |
| 19 CHECK(!leaf_index_); |
| 20 leaf_index_ = index; |
| 21 } |
| 22 |
| 23 bool TimestampedLeaf::HasLeafIndex() { |
| 24 return bool(leaf_index_); |
| 25 } |
| 26 |
| 27 uint64_t TimestampedLeaf::GetLeafIndex() { |
| 28 return leaf_index_.value(); |
| 29 } |
| 30 |
| 31 net::ct::MerkleTreeLeaf TimestampedLeaf::GetLeaf() { |
| 32 return leaf_; |
| 33 } |
| 34 |
| 35 const net::ct::MerkleTreeLeaf& TimestampedLeaf::GetLeaf() const { |
| 36 return leaf_; |
| 37 } |
| OLD | NEW |