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

Unified Diff: net/ssl/ssl_private_key.h

Issue 1422573008: Plumbing SSLPrivateKey (//net) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing un-needed forward decl. Created 5 years, 1 month 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
« no previous file with comments | « net/ssl/ssl_platform_key_win.cc ('k') | net/ssl/threaded_ssl_private_key.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/ssl_private_key.h
diff --git a/net/ssl/ssl_private_key.h b/net/ssl/ssl_private_key.h
index d1aa09951d77377f6b8f05c9a7fcd9593ce023ee..0771c188734ffd00a8c7e04ac10591f186f14362 100644
--- a/net/ssl/ssl_private_key.h
+++ b/net/ssl/ssl_private_key.h
@@ -11,14 +11,14 @@
#include "base/callback_forward.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ref_counted.h"
#include "base/strings/string_piece.h"
#include "net/base/net_errors.h"
namespace net {
// An interface for a private key for use with SSL client authentication.
-class SSLPrivateKey {
+class SSLPrivateKey : public base::RefCountedThreadSafe<SSLPrivateKey> {
public:
using SignCallback = base::Callback<void(Error, const std::vector<uint8_t>&)>;
@@ -36,7 +36,6 @@ class SSLPrivateKey {
};
SSLPrivateKey() {}
- virtual ~SSLPrivateKey() {}
// Returns whether the key is an RSA key or an ECDSA key. Although the signing
// interface is type-agnositic and type tags in interfaces are discouraged,
@@ -62,7 +61,11 @@ class SSLPrivateKey {
const base::StringPiece& input,
const SignCallback& callback) = 0;
+ protected:
+ virtual ~SSLPrivateKey() {}
+
private:
+ friend class base::RefCountedThreadSafe<SSLPrivateKey>;
DISALLOW_COPY_AND_ASSIGN(SSLPrivateKey);
};
« no previous file with comments | « net/ssl/ssl_platform_key_win.cc ('k') | net/ssl/threaded_ssl_private_key.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698