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

Unified Diff: net/cert/signed_certificate_timestamp.h

Issue 71633002: Convert SignedCertificateClass to be ref_counted, and add an SCTStore in which to store them. Add S… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: few lint fixes 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/sct_status_flags.h ('k') | net/cert/signed_certificate_timestamp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/signed_certificate_timestamp.h
diff --git a/net/cert/signed_certificate_timestamp.h b/net/cert/signed_certificate_timestamp.h
index 6ed225ca4b4870f394bcc1877ce12d374f8f234b..a541e964ae1de809704bbb2b1d4470ae3544c9d5 100644
--- a/net/cert/signed_certificate_timestamp.h
+++ b/net/cert/signed_certificate_timestamp.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "net/base/hash_value.h"
#include "net/base/net_export.h"
@@ -69,7 +70,16 @@ struct NET_EXPORT_PRIVATE DigitallySigned {
};
// SignedCertificateTimestamp struct in RFC 6962, Section 3.2.
-struct NET_EXPORT SignedCertificateTimestamp {
+struct NET_EXPORT SignedCertificateTimestamp
+ : public base::RefCountedThreadSafe<SignedCertificateTimestamp> {
+ // Predicate functor used in maps when SignedCertificateTimestamp is used as
+ // the key.
+ struct NET_EXPORT LessThan {
+ bool operator()(const scoped_refptr<SignedCertificateTimestamp>& lhs,
+ const scoped_refptr<SignedCertificateTimestamp>& rhs) const;
+
+ };
+
// Version enum in RFC 6962, Section 3.2.
enum Version {
SCT_VERSION_1 = 0,
@@ -83,7 +93,6 @@ struct NET_EXPORT SignedCertificateTimestamp {
};
SignedCertificateTimestamp();
- ~SignedCertificateTimestamp();
Version version;
std::string log_id;
@@ -93,6 +102,11 @@ struct NET_EXPORT SignedCertificateTimestamp {
// The origin should not participate in equality checks
// as the same SCT can be provided from multiple sources.
Origin origin;
+
+ private:
+ ~SignedCertificateTimestamp();
+ friend class base::RefCountedThreadSafe<SignedCertificateTimestamp>;
+ DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestamp);
};
} // namespace ct
« no previous file with comments | « net/cert/sct_status_flags.h ('k') | net/cert/signed_certificate_timestamp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698