| Index: components/certificate_transparency/timestamped_leaf.cc
|
| diff --git a/components/certificate_transparency/timestamped_leaf.cc b/components/certificate_transparency/timestamped_leaf.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e1bd9f7673ba2a86f76226e7a10159046108e723
|
| --- /dev/null
|
| +++ b/components/certificate_transparency/timestamped_leaf.cc
|
| @@ -0,0 +1,37 @@
|
| +// 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.
|
| +
|
| +#include "components/certificate_transparency/timestamped_leaf.h"
|
| +
|
| +TimestampedLeaf::TimestampedLeaf(const net::ct::MerkleTreeLeaf& leaf,
|
| + const base::Time& seen_at)
|
| + : leaf_(leaf), first_seen_(seen_at) {}
|
| +
|
| +TimestampedLeaf::TimestampedLeaf(const TimestampedLeaf& other)
|
| + : leaf_(other.leaf_),
|
| + first_seen_(other.first_seen_),
|
| + leaf_index_(other.leaf_index_) {}
|
| +
|
| +TimestampedLeaf::~TimestampedLeaf() {}
|
| +
|
| +void TimestampedLeaf::SetLeafIndex(uint64_t index) {
|
| + CHECK(!leaf_index_);
|
| + leaf_index_ = index;
|
| +}
|
| +
|
| +bool TimestampedLeaf::HasLeafIndex() {
|
| + return bool(leaf_index_);
|
| +}
|
| +
|
| +uint64_t TimestampedLeaf::GetLeafIndex() {
|
| + return leaf_index_.value();
|
| +}
|
| +
|
| +net::ct::MerkleTreeLeaf TimestampedLeaf::GetLeaf() {
|
| + return leaf_;
|
| +}
|
| +
|
| +const net::ct::MerkleTreeLeaf& TimestampedLeaf::GetLeaf() const {
|
| + return leaf_;
|
| +}
|
|
|