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

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

Issue 2021433004: Cert - protobufs to serialize and deserialize CertVerifierCache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Add_support_for_walking_1999733002
Patch Set: Added histogram for cache size Created 4 years, 6 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.
Ryan Sleevi 2016/05/30 18:37:19 1) The first sentence isn't accurate - the CertVer
ramant (doing other things) 2016/06/01 16:29:22 Done.
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 // CachingCertVerifier's cache.
12 //
13 // At shutdown, we serialize CachingCertVerifier's cache and then write
14 // that data to disk.
Ryan Sleevi 2016/05/30 18:37:19 Lines 9 - 14 are a clear layering violation - you
ramant (doing other things) 2016/06/01 16:29:21 Done.
15
16 #ifndef NET_EXTRAS_CERT_CERT_VERIFIER_CACHE_PERSISTER_H_
17 #define NET_EXTRAS_CERT_CERT_VERIFIER_CACHE_PERSISTER_H_
18
19 #include <string>
20 #include <vector>
Ryan Sleevi 2016/05/30 18:37:19 Unused
ramant (doing other things) 2016/06/01 16:29:22 Done.
21
22 #include "base/compiler_specific.h"
Ryan Sleevi 2016/05/30 18:37:19 What's being used from this header?
ramant (doing other things) 2016/06/01 16:29:22 Done.
23 #include "base/macros.h"
24 #include "net/base/net_export.h"
25
26 namespace net {
27
28 class CachingCertVerifier;
29
30 class NET_EXPORT_PRIVATE CertVerifierCachePersister {
31 public:
32 typedef std::vector<std::string> CertVector;
Ryan Sleevi 2016/05/30 18:37:18 Unused.
ramant (doing other things) 2016/06/01 16:29:22 Done.
33
34 CertVerifierCachePersister(CachingCertVerifier* 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 CachingCertVerifier's |cache_|. Returns true if the |data| is
42 // deserialized correctly.
43 bool LoadCache(const std::string& data);
44
45 private:
46 // |verifier_| whose |cache_| will be serialized/deserialized.
47 CachingCertVerifier* verifier_; // owned
48
49 DISALLOW_COPY_AND_ASSIGN(CertVerifierCachePersister);
50 };
51
52 } // namespace net
53
54 #endif // NET_EXTRAS_CERT_CERT_VERIFIER_CACHE_PERSISTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698