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

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: 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
« net/cert/signed_tree_head.h ('K') | « 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..76bf68f02f152bc0533c1951acd9f955e3ef2bea 100644
--- a/net/cert/signed_tree_head.cc
+++ b/net/cert/signed_tree_head.cc
@@ -5,6 +5,7 @@
#include "net/cert/signed_tree_head.h"
#include <string.h>
davidben 2016/03/02 17:30:39 Nit: I think this wants newline here? At least, th
Eran Messeri 2016/03/04 11:28:30 Done.
+#include <sstream>
#include "base/strings/string_number_conversions.h"
@@ -29,17 +30,18 @@ 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"
- << "}";
+std::string DebugString(const SignedTreeHead& sth) {
+ std::ostringstream stream;
+ 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"
+ << "}";
+ return stream.str();
}
} // namespace ct
« net/cert/signed_tree_head.h ('K') | « net/cert/signed_tree_head.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698