Chromium Code Reviews| Index: net/extras/cert/cert_verifier_cache_persister.h |
| diff --git a/net/extras/cert/cert_verifier_cache_persister.h b/net/extras/cert/cert_verifier_cache_persister.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4304ee62a1a28826c84138f40af21637d673b88d |
| --- /dev/null |
| +++ b/net/extras/cert/cert_verifier_cache_persister.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// CertVerifierCachePersister provides API calls to serialize and deserialize |
| +// CachingCertVerifier's cache. |
| +// |
| +// WARNING: This is experimental code, please don't use it. |
| + |
| +#ifndef NET_EXTRAS_CERT_CERT_VERIFIER_CACHE_PERSISTER_H_ |
| +#define NET_EXTRAS_CERT_CERT_VERIFIER_CACHE_PERSISTER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "net/base/net_export.h" |
| + |
| +namespace net { |
| + |
| +class CachingCertVerifier; |
| + |
| +class NET_EXPORT_PRIVATE CertVerifierCachePersister { |
|
Ryan Sleevi
2016/06/08 21:38:10
This doesn't seem like it needs to be a class anym
ramant (doing other things)
2016/06/09 00:51:39
Done.
|
| + public: |
| + CertVerifierCachePersister(CachingCertVerifier* verifier); |
|
Ryan Sleevi
2016/06/08 21:38:10
STYLE: Explicit
ramant (doing other things)
2016/06/09 00:51:39
Deleted the class.
|
| + ~CertVerifierCachePersister(); |
| + |
| + // Recursively iterate over this |verifier_|'s |cache_| and all children and |
| + // write the hierarchical structure into |data|. |
|
Ryan Sleevi
2016/06/08 21:38:10
|cache_| is not a recursive structure.
Also, you'
ramant (doing other things)
2016/06/09 00:51:39
Done.
|
| + void SerializeCache(std::string* data); |
| + |
| + // Populates CachingCertVerifier's |cache_|. Returns true if the |data| is |
| + // deserialized correctly. |
| + bool LoadCache(const std::string& data); |
| + |
| + private: |
| + // |verifier_| whose |cache_| will be serialized/deserialized. |
| + CachingCertVerifier* verifier_; // Owned by the caller. |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CertVerifierCachePersister); |
| +}; |
| + |
| +} // namespace net |
| + |
| +#endif // NET_EXTRAS_CERT_CERT_VERIFIER_CACHE_PERSISTER_H_ |