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

Unified Diff: net/cert/signed_tree_head.cc

Issue 1758823002: Certificate Transparency: Ensure timestamps over 32 bit are handled correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing review comments Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/signed_tree_head.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/signed_tree_head.cc
diff --git a/net/cert/signed_tree_head.cc b/net/cert/signed_tree_head.cc
index ef1ab708c7c9e18c5f938e58368ae3a66b719a7d..00fc1342d65a61825446d6d8542d170e8a21724e 100644
--- a/net/cert/signed_tree_head.cc
+++ b/net/cert/signed_tree_head.cc
@@ -6,6 +6,8 @@
#include <string.h>
+#include <iostream>
+
#include "base/strings/string_number_conversions.h"
namespace net {
@@ -29,17 +31,16 @@ SignedTreeHead::SignedTreeHead(Version version,
SignedTreeHead::~SignedTreeHead() {}
-std::ostream& operator<<(std::ostream& stream, const SignedTreeHead& sth) {
- return stream << "{\n"
- << "\t\"version\": " << sth.version << ",\n"
- << "\t\"timestamp\": " << sth.timestamp << ",\n"
- << "\t\"tree_size\": " << sth.tree_size << ",\n"
- << "\t\"sha256_root_hash\": \""
- << base::HexEncode(sth.sha256_root_hash, kSthRootHashLength)
- << "\",\n\t\"log_id\": \""
- << base::HexEncode(sth.log_id.data(), sth.log_id.size())
- << "\"\n"
- << "}";
+void PrintTo(const SignedTreeHead& sth, std::ostream* os) {
+ (*os) << "{\n"
+ << "\t\"version\": " << sth.version << ",\n"
+ << "\t\"timestamp\": " << sth.timestamp << ",\n"
+ << "\t\"tree_size\": " << sth.tree_size << ",\n"
+ << "\t\"sha256_root_hash\": \""
+ << base::HexEncode(sth.sha256_root_hash, kSthRootHashLength)
+ << "\",\n\t\"log_id\": \""
+ << base::HexEncode(sth.log_id.data(), sth.log_id.size()) << "\"\n"
+ << "}";
}
} // namespace ct
« no previous file with comments | « net/cert/signed_tree_head.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698