Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: components/certificate_transparency/timestamped_leaf.cc

Issue 2017563002: Add Certificate Transparency logs auditing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switching to TimestampedLeaf Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698