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

Side by Side Diff: ios/web/net/cert_store_impl.h

Issue 2327433002: Stop using CertStore which is not compatible with PlzNavigate. (Closed)
Patch Set: remove cert_store on ios Created 4 years, 3 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
« no previous file with comments | « ios/web/ios_web.gyp ('k') | ios/web/net/cert_store_impl.cc » ('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 2015 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 IOS_WEB_NET_CERT_STORE_IMPL_H_
6 #define IOS_WEB_NET_CERT_STORE_IMPL_H_
7
8 #include "base/macros.h"
9 #include "base/memory/singleton.h"
10 #include "ios/web/net/request_tracker_data_memoizing_store.h"
11 #include "ios/web/public/cert_store.h"
12 #include "net/cert/x509_certificate.h"
13
14 namespace web {
15
16 class CertStoreImpl : public CertStore {
17 public:
18 // Returns the singleton instance of the CertStore.
19 static CertStoreImpl* GetInstance();
20
21 // CertStore implementation:
22 int StoreCert(net::X509Certificate* cert, int group_id) override;
23 bool RetrieveCert(int cert_id,
24 scoped_refptr<net::X509Certificate>* cert) override;
25 void RemoveCertsForGroup(int group_id) override;
26
27 protected:
28 CertStoreImpl();
29 ~CertStoreImpl() override;
30
31 private:
32 friend struct base::DefaultSingletonTraits<CertStoreImpl>;
33
34 // Utility structure that allows memoization to be based on the
35 // hash of |cert|'s certificate chain, to avoid needing to compare
36 // every certificate individually. This is purely an optimization.
37 class HashAndCert : public base::RefCountedThreadSafe<HashAndCert> {
38 public:
39 HashAndCert();
40
41 // Comparator for RendererDataMemoizingStore.
42 struct LessThan {
43 bool operator()(const scoped_refptr<HashAndCert>& lhs,
44 const scoped_refptr<HashAndCert>& rhs) const;
45 };
46
47 net::SHA256HashValue chain_hash;
48 scoped_refptr<net::X509Certificate> cert;
49
50 private:
51 friend class base::RefCountedThreadSafe<HashAndCert>;
52
53 ~HashAndCert();
54 };
55 RequestTrackerDataMemoizingStore<HashAndCert> store_;
56
57 DISALLOW_COPY_AND_ASSIGN(CertStoreImpl);
58 };
59
60 } // namespace web
61
62 #endif // IOS_WEB_NET_CERT_STORE_IMPL_H_
OLDNEW
« no previous file with comments | « ios/web/ios_web.gyp ('k') | ios/web/net/cert_store_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698