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

Unified Diff: net/cert/signed_certificate_timestamp.cc

Issue 72333007: Add an SignedCertificateTimetampStore, making SignedCertificateTimestamp be refcounted to aid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@piecewise
Patch Set: fwd. decl fix Created 7 years, 1 month 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_certificate_timestamp.h ('k') | net/test/ct_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/signed_certificate_timestamp.cc
diff --git a/net/cert/signed_certificate_timestamp.cc b/net/cert/signed_certificate_timestamp.cc
index 0be511d41dbb64cde0fe151d0ee41f40e664eb3d..d801315703b8e3ea18be30813c9a2de093ee1345 100644
--- a/net/cert/signed_certificate_timestamp.cc
+++ b/net/cert/signed_certificate_timestamp.cc
@@ -8,6 +8,30 @@ namespace net {
namespace ct {
+bool SignedCertificateTimestamp::LessThan::operator()(
+ const scoped_refptr<SignedCertificateTimestamp>& lhs,
+ const scoped_refptr<SignedCertificateTimestamp>& rhs) const {
+ if (lhs.get() == rhs.get())
+ return false;
+ if (lhs->signature.signature_data < rhs->signature.signature_data)
+ return true;
+ if (lhs->signature.signature_data == rhs->signature.signature_data) {
+ if (lhs->log_id < rhs->log_id)
+ return true;
+ if (lhs->log_id == rhs->log_id) {
+ if (lhs->timestamp < rhs->timestamp)
+ return true;
+ if (lhs->timestamp == rhs->timestamp) {
+ if (lhs->extensions < rhs->extensions)
+ return true;
+ if (lhs->extensions == rhs->extensions)
+ return lhs->version < rhs->version;
+ }
+ }
+ }
+ return false;
wtc 2013/11/21 03:13:47 Thanks for implementing this. This is more compli
alcutter 2013/11/21 10:56:39 That's a much more pleasing way of doing it, thank
+}
+
SignedCertificateTimestamp::SignedCertificateTimestamp() {}
SignedCertificateTimestamp::~SignedCertificateTimestamp() {}
« no previous file with comments | « net/cert/signed_certificate_timestamp.h ('k') | net/test/ct_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698