OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ | 5 #ifndef NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ |
6 #define NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ | 6 #define NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 virtual Error SignDigest(Hash hash, | 45 virtual Error SignDigest(Hash hash, |
46 const base::StringPiece& input, | 46 const base::StringPiece& input, |
47 std::vector<uint8_t>* signature) = 0; | 47 std::vector<uint8_t>* signature) = 0; |
48 | 48 |
49 private: | 49 private: |
50 DISALLOW_COPY_AND_ASSIGN(Delegate); | 50 DISALLOW_COPY_AND_ASSIGN(Delegate); |
51 }; | 51 }; |
52 | 52 |
53 ThreadedSSLPrivateKey(scoped_ptr<Delegate> delegate, | 53 ThreadedSSLPrivateKey(scoped_ptr<Delegate> delegate, |
54 scoped_refptr<base::TaskRunner> task_runner); | 54 scoped_refptr<base::TaskRunner> task_runner); |
55 ~ThreadedSSLPrivateKey() override; | |
56 | 55 |
57 // SSLPrivateKey implementation. | 56 // SSLPrivateKey implementation. |
58 Type GetType() override; | 57 Type GetType() override; |
59 std::vector<SSLPrivateKey::Hash> GetDigestPreferences() override; | 58 std::vector<SSLPrivateKey::Hash> GetDigestPreferences() override; |
60 size_t GetMaxSignatureLengthInBytes() override; | 59 size_t GetMaxSignatureLengthInBytes() override; |
61 void SignDigest(Hash hash, | 60 void SignDigest(Hash hash, |
62 const base::StringPiece& input, | 61 const base::StringPiece& input, |
63 const SignCallback& callback) override; | 62 const SignCallback& callback) override; |
64 | 63 |
65 private: | 64 private: |
| 65 ~ThreadedSSLPrivateKey() override; |
66 class Core; | 66 class Core; |
67 | 67 |
68 scoped_refptr<Core> core_; | 68 scoped_refptr<Core> core_; |
69 scoped_refptr<base::TaskRunner> task_runner_; | 69 scoped_refptr<base::TaskRunner> task_runner_; |
70 base::WeakPtrFactory<ThreadedSSLPrivateKey> weak_factory_; | 70 base::WeakPtrFactory<ThreadedSSLPrivateKey> weak_factory_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(ThreadedSSLPrivateKey); | 72 DISALLOW_COPY_AND_ASSIGN(ThreadedSSLPrivateKey); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace net | 75 } // namespace net |
76 | 76 |
77 #endif // NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ | 77 #endif // NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ |
OLD | NEW |