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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // error code. It will only be called on the task runner passed to the | 45 // error code. It will only be called on the task runner passed to the |
46 // owning ThreadedSSLPrivateKey. | 46 // owning ThreadedSSLPrivateKey. |
47 virtual Error SignDigest(Hash hash, | 47 virtual Error SignDigest(Hash hash, |
48 const base::StringPiece& input, | 48 const base::StringPiece& input, |
49 std::vector<uint8_t>* signature) = 0; | 49 std::vector<uint8_t>* signature) = 0; |
50 | 50 |
51 private: | 51 private: |
52 DISALLOW_COPY_AND_ASSIGN(Delegate); | 52 DISALLOW_COPY_AND_ASSIGN(Delegate); |
53 }; | 53 }; |
54 | 54 |
55 ThreadedSSLPrivateKey(std::unique_ptr<Delegate> delegate, | 55 ThreadedSSLPrivateKey( |
56 scoped_refptr<base::TaskRunner> task_runner); | 56 std::unique_ptr<Delegate> delegate, |
| 57 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
57 | 58 |
58 // SSLPrivateKey implementation. | 59 // SSLPrivateKey implementation. |
59 Type GetType() override; | 60 Type GetType() override; |
60 std::vector<SSLPrivateKey::Hash> GetDigestPreferences() override; | 61 std::vector<SSLPrivateKey::Hash> GetDigestPreferences() override; |
61 size_t GetMaxSignatureLengthInBytes() override; | 62 size_t GetMaxSignatureLengthInBytes() override; |
62 void SignDigest(Hash hash, | 63 void SignDigest(Hash hash, |
63 const base::StringPiece& input, | 64 const base::StringPiece& input, |
64 const SignCallback& callback) override; | 65 const SignCallback& callback) override; |
65 | 66 |
66 private: | 67 private: |
67 ~ThreadedSSLPrivateKey() override; | 68 ~ThreadedSSLPrivateKey() override; |
68 class Core; | 69 class Core; |
69 | 70 |
70 scoped_refptr<Core> core_; | 71 scoped_refptr<Core> core_; |
71 scoped_refptr<base::TaskRunner> task_runner_; | 72 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
72 base::WeakPtrFactory<ThreadedSSLPrivateKey> weak_factory_; | 73 base::WeakPtrFactory<ThreadedSSLPrivateKey> weak_factory_; |
73 | 74 |
74 DISALLOW_COPY_AND_ASSIGN(ThreadedSSLPrivateKey); | 75 DISALLOW_COPY_AND_ASSIGN(ThreadedSSLPrivateKey); |
75 }; | 76 }; |
76 | 77 |
77 } // namespace net | 78 } // namespace net |
78 | 79 |
79 #endif // NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ | 80 #endif // NET_SSL_THREADED_SSL_PRIVATE_KEY_H_ |
OLD | NEW |