Chromium Code Reviews| Index: net/cert/nss_profile_filter_chromeos.h |
| diff --git a/net/cert/nss_profile_filter_chromeos.h b/net/cert/nss_profile_filter_chromeos.h |
| index d5ff8186888495c78bf8831a1dd0e1ab4eab194f..a77247a1a6eb7058de2673b0fdca10967f0bc942 100644 |
| --- a/net/cert/nss_profile_filter_chromeos.h |
| +++ b/net/cert/nss_profile_filter_chromeos.h |
| @@ -2,26 +2,23 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef NET_CERT_NSS_PROFILE_FILTER_CHROMEOS |
| -#define NET_CERT_NSS_PROFILE_FILTER_CHROMEOS |
| +#ifndef NET_CERT_NSS_PROFILE_FILTER_CHROMEOS_H_ |
| +#define NET_CERT_NSS_PROFILE_FILTER_CHROMEOS_H_ |
| -#include "base/callback_forward.h" |
| +#include "base/memory/ref_counted.h" |
| #include "crypto/scoped_nss_types.h" |
| #include "net/base/crypto_module.h" |
| -#include "net/cert/x509_certificate.h" |
| - |
| -namespace content { |
| -class ResourceContext; |
| -} // namespace content |
| +#include "net/base/net_export.h" |
| namespace net { |
| -class NET_EXPORT NSSProfileFilterChromeOS { |
| +class X509Certificate; |
| + |
| +class NET_EXPORT NSSProfileFilterChromeOS |
| + : public base::RefCountedThreadSafe<NSSProfileFilterChromeOS> { |
|
Ryan Sleevi
2014/01/29 02:24:20
NACK on making this ref-counted as part of the int
tbarzic
2014/01/29 20:50:52
I prefer having a CreateCopy method instead, but i
Ryan Sleevi
2014/01/30 04:16:30
I'm not a terrible fan of design patterns that for
|
| public: |
| NSSProfileFilterChromeOS(); |
| - ~NSSProfileFilterChromeOS(); |
| - // Initialize with slot handles. |
| void Init(crypto::ScopedPK11Slot public_slot, |
| crypto::ScopedPK11Slot private_slot); |
| @@ -31,24 +28,28 @@ class NET_EXPORT NSSProfileFilterChromeOS { |
| class CertNotAllowedForProfilePredicate { |
| public: |
| explicit CertNotAllowedForProfilePredicate( |
| - const NSSProfileFilterChromeOS& filter); |
| + const scoped_refptr<NSSProfileFilterChromeOS>& filter); |
| bool operator()(const scoped_refptr<X509Certificate>& cert) const; |
| private: |
| - const NSSProfileFilterChromeOS& filter_; |
| + scoped_refptr<NSSProfileFilterChromeOS> filter_; |
| }; |
| class ModuleNotAllowedForProfilePredicate { |
| public: |
| explicit ModuleNotAllowedForProfilePredicate( |
| - const NSSProfileFilterChromeOS& filter); |
| + const scoped_refptr<NSSProfileFilterChromeOS>& filter); |
| bool operator()(const scoped_refptr<CryptoModule>& module) const; |
| private: |
| - const NSSProfileFilterChromeOS& filter_; |
| + scoped_refptr<NSSProfileFilterChromeOS> filter_; |
| }; |
| private: |
| + friend class base::RefCountedThreadSafe<NSSProfileFilterChromeOS>; |
| + |
| + virtual ~NSSProfileFilterChromeOS(); |
| + |
| crypto::ScopedPK11Slot public_slot_; |
| crypto::ScopedPK11Slot private_slot_; |
| @@ -57,4 +58,4 @@ class NET_EXPORT NSSProfileFilterChromeOS { |
| } // namespace net |
| -#endif // NET_CERT_NSS_PROFILE_FILTER_CHROMEOS |
| +#endif // NET_CERT_NSS_PROFILE_FILTER_CHROMEOS_H_ |