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

Side by Side Diff: net/cert/cert_verifier_cache_persister.h

Issue 1892033002: Cert - protobufs to serialize and deserialize CertVerifierCache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 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 // CertVerifierCachePersister maintains an in memory database containing the
6 // list of hosts whose cerificates have been verified. This singleton object
7 // deals with writing that data out to disk as needed and loading it at startup.
8 //
9 // At startup we need to load the certificate verification results from the
10 // disk and we deserialize the data and then pouplate
11 // MultiThreadedCertVerifier's cache.
12 //
13 // At shutdown, we serialize MultiThreadedCertVerifier's cache and then write
14 // that data to disk.
15
16 #ifndef NET_CERT_CERT_VERIFIER_CACHE_PERSISTER_H_
17 #define NET_CERT_CERT_VERIFIER_CACHE_PERSISTER_H_
18
19 #include <string>
20 #include <vector>
21
22 #include "base/compiler_specific.h"
23 #include "base/macros.h"
24 #include "net/base/net_export.h"
25
26 namespace net {
27
28 class MultiThreadedCertVerifier;
29
30 class NET_EXPORT_PRIVATE CertVerifierCachePersister {
31 public:
32 typedef std::vector<std::string> CertVector;
33
34 CertVerifierCachePersister(MultiThreadedCertVerifier* verifier);
35 ~CertVerifierCachePersister();
36
37 // Recursively iterate over this |verifier_|'s |cache_| and all children and
38 // write the hierarchical structure into |data|.
39 void SerializeCache(std::string* data);
40
41 // Populates MultiThreadedCertVerifier's |cache_|. Returns true if the |data|
42 // is deserialized correctly.
43 bool LoadCache(const std::string& data);
44
45 private:
46 // |verifier_| whose |cache_| will be serialized/deserialized.
47 MultiThreadedCertVerifier* verifier_;
48
49 DISALLOW_COPY_AND_ASSIGN(CertVerifierCachePersister);
50 };
51
52 } // namespace net
53
54 #endif // NET_CERT_CERT_VERIFIER_CACHE_PERSISTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698