OLD | NEW |
---|---|
(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 NET_CERT_NSS_PROFILE_FILTER_CHROMEOS | |
6 #define NET_CERT_NSS_PROFILE_FILTER_CHROMEOS | |
7 | |
8 #include "base/callback_forward.h" | |
9 #include "crypto/scoped_nss_types.h" | |
10 #include "net/base/crypto_module.h" | |
11 #include "net/cert/x509_certificate.h" | |
12 | |
13 namespace content { | |
14 class ResourceContext; | |
15 } // namespace content | |
16 | |
17 namespace net { | |
18 | |
19 class NET_EXPORT NSSProfileFilterChromeOS { | |
20 public: | |
21 NSSProfileFilterChromeOS(); | |
22 ~NSSProfileFilterChromeOS(); | |
23 | |
24 // Initialize with slot handles. | |
25 void Init(crypto::ScopedPK11Slot public_slot, | |
26 crypto::ScopedPK11Slot private_slot); | |
27 | |
28 bool IsModuleAllowed(PK11SlotInfo* slot) const; | |
29 bool IsCertAllowed(const scoped_refptr<X509Certificate>& cert) const; | |
30 // Predicate that can be used with remove_if. The operator() returns | |
Ryan Sleevi
2013/12/11 06:52:50
nit: add linebreak
mattm
2013/12/12 00:45:22
Done.
| |
31 // !IsCertAllowed(cert) or !IsModuleAllowed(module->os_module_handle()). | |
32 class Predicate { | |
Ryan Sleevi
2013/12/11 06:52:50
naming nit: The naming here isn't very clear, and
mattm
2013/12/12 00:45:22
Renamed and split into two.
| |
33 public: | |
34 Predicate(const NSSProfileFilterChromeOS& filter); | |
35 bool operator()(const scoped_refptr<CryptoModule>& module) const; | |
36 bool operator()(const scoped_refptr<X509Certificate>& cert) const; | |
37 private: | |
Ryan Sleevi
2013/12/11 06:52:50
style nit: line break
mattm
2013/12/12 00:45:22
Done.
| |
38 const NSSProfileFilterChromeOS& filter_; | |
39 }; | |
40 | |
41 private: | |
42 crypto::ScopedPK11Slot public_slot_; | |
43 crypto::ScopedPK11Slot private_slot_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(NSSProfileFilterChromeOS); | |
46 }; | |
47 | |
48 } // namespace net | |
49 | |
50 #endif // NET_CERT_NSS_PROFILE_FILTER_CHROMEOS | |
OLD | NEW |