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

Unified Diff: net/cert/nss_database_filter.h

Issue 144423007: Make NSSCertDatabase::ListCerts work async on a worker thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: aa Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: net/cert/nss_database_filter.h
diff --git a/net/cert/nss_database_filter.h b/net/cert/nss_database_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..1482686c1a5fa68022737920c6dc16d7d877e0ac
--- /dev/null
+++ b/net/cert/nss_database_filter.h
@@ -0,0 +1,57 @@
+// Copyright 2014 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.
+
+#ifndef NET_CERT_NSS_DATABASE_FILTER_H_
+#define NET_CERT_NSS_DATABASE_FILTER_H_
+
+#include "base/memory/ref_counted.h"
+#include "crypto/scoped_nss_types.h"
+#include "net/base/crypto_module.h"
+#include "net/base/net_export.h"
+
+namespace net {
+
+class X509Certificate;
+
+class NET_EXPORT NSSDatabaseFilter
+ : public base::RefCountedThreadSafe<NSSDatabaseFilter> {
+ public:
+ class CertNotAllowedPredicate {
+ public:
+ explicit CertNotAllowedPredicate(
+ const scoped_refptr<NSSDatabaseFilter>& filter);
+ bool operator()(const scoped_refptr<X509Certificate>& cert) const;
+
+ private:
+ scoped_refptr<NSSDatabaseFilter> filter_;
+ };
+
+ class ModuleNotAllowedPredicate {
+ public:
+ explicit ModuleNotAllowedPredicate(
+ const scoped_refptr<NSSDatabaseFilter>& filter);
+ bool operator()(const scoped_refptr<CryptoModule>& module) const;
+
+ private:
+ scoped_refptr<NSSDatabaseFilter> filter_;
+ };
+
+ NSSDatabaseFilter();
+
+ virtual bool IsModuleAllowed(CryptoModule::OSModuleHandle slot) const = 0;
+ virtual bool IsCertAllowed(
+ const scoped_refptr<X509Certificate>& cert) const = 0;
+
+ protected:
+ virtual ~NSSDatabaseFilter();
+
+ private:
+ friend class base::RefCountedThreadSafe<NSSDatabaseFilter>;
+
+ DISALLOW_COPY_AND_ASSIGN(NSSDatabaseFilter);
+};
+
+} // namespace net
+
+#endif // NET_CERT_NSS_DATABASE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698