| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 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_DATABASE_FILTER_H_ |
| 6 #define NET_CERT_NSS_DATABASE_FILTER_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "crypto/scoped_nss_types.h" |
| 10 #include "net/base/crypto_module.h" |
| 11 #include "net/base/net_export.h" |
| 12 |
| 13 namespace net { |
| 14 |
| 15 class X509Certificate; |
| 16 |
| 17 class NET_EXPORT NSSDatabaseFilter |
| 18 : public base::RefCountedThreadSafe<NSSDatabaseFilter> { |
| 19 public: |
| 20 class CertNotAllowedPredicate { |
| 21 public: |
| 22 explicit CertNotAllowedPredicate( |
| 23 const scoped_refptr<NSSDatabaseFilter>& filter); |
| 24 bool operator()(const scoped_refptr<X509Certificate>& cert) const; |
| 25 |
| 26 private: |
| 27 scoped_refptr<NSSDatabaseFilter> filter_; |
| 28 }; |
| 29 |
| 30 class ModuleNotAllowedPredicate { |
| 31 public: |
| 32 explicit ModuleNotAllowedPredicate( |
| 33 const scoped_refptr<NSSDatabaseFilter>& filter); |
| 34 bool operator()(const scoped_refptr<CryptoModule>& module) const; |
| 35 |
| 36 private: |
| 37 scoped_refptr<NSSDatabaseFilter> filter_; |
| 38 }; |
| 39 |
| 40 NSSDatabaseFilter(); |
| 41 |
| 42 virtual bool IsModuleAllowed(CryptoModule::OSModuleHandle slot) const = 0; |
| 43 virtual bool IsCertAllowed( |
| 44 const scoped_refptr<X509Certificate>& cert) const = 0; |
| 45 |
| 46 protected: |
| 47 virtual ~NSSDatabaseFilter(); |
| 48 |
| 49 private: |
| 50 friend class base::RefCountedThreadSafe<NSSDatabaseFilter>; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(NSSDatabaseFilter); |
| 53 }; |
| 54 |
| 55 } // namespace net |
| 56 |
| 57 #endif // NET_CERT_NSS_DATABASE_FILTER_H_ |
| OLD | NEW |