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

Side by Side Diff: content/public/browser/sct_store.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 unified diff | Download patch
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/common/ssl_status.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 #ifndef CONTENT_PUBLIC_BROWSER_SCT_STORE_H_
6 #define CONTENT_PUBLIC_BROWSER_SCT_STORE_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "content/common/content_export.h"
10
11 namespace net {
12 namespace ct {
13 class SignedCertificateTimestamp;
14 } // namespace ct
15 } // namespace net
16
17 namespace content {
18
19 // The purpose of the SignedCertificateTimestampStore is to provide an easy way
20 // to store/retrieve SignedCertificateTimestamp objects. When stored,
21 // SignedCertificateTimestamp objects are associated with a RenderProcessHost.
22 // If all the RenderProcessHosts associated with the SCT have exited, the SCT
23 // is removed from the store. This class is used by the SSLManager to keep
24 // track of the SCTs associated to loaded resources. It can be accessed from
25 // the UI and IO threads (it is thread-safe). Note that the SCT ids will
26 // overflow if we register more than 2^32 - 1 SCTs in 1 browsing session (which
27 // is highly unlikely to happen).
28 class SignedCertificateTimestampStore {
29 public:
30 // Returns the singleton instance of the SignedCertificateTimestampStore.
31 CONTENT_EXPORT static SignedCertificateTimestampStore* GetInstance();
32
33 // Stores the specified SCT and returns the id associated with it. The SCT
34 // is associated to the specified RenderProcessHost.
35 // When all the RenderProcessHosts associated with a SCT have exited, the
36 // SCT is removed from the store.
37 // Note: ids starts at 1.
38 virtual int StoreSignedCertificateTimestamp(
39 net::ct::SignedCertificateTimestamp* sct, int render_process_host_id) = 0;
40
41 // Tries to retrieve the previously stored SCT associated with the specified
42 // |sct_id|. Returns whether the SCT could be found, and, if |sct| is
43 // non-NULL, copies it in.
44 virtual bool RetrieveSignedCertificateTimestamp(int sct_id,
45 scoped_refptr<net::ct::SignedCertificateTimestamp>* sct) = 0;
46
47 protected:
48 virtual ~SignedCertificateTimestampStore() {}
49 };
50
51 } // namespace content
52
53 #endif // CONTENT_PUBLIC_BROWSER_SCT_STORE_H_
OLDNEW
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/common/ssl_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698