OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef NET_SSL_SSL_PLATFORM_KEY_TASK_RUNNER_H_ | |
6 #define NET_SSL_SSL_PLATFORM_KEY_TASK_RUNNER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "base/threading/thread.h" | |
11 | |
12 namespace base { | |
13 class SingleThreadTaskRunner; | |
14 } | |
15 | |
16 namespace net { | |
17 | |
18 // Serialize all the private key operations on a single background thread to | |
19 // avoid problems with buggy smartcards. Its underlying Thread is non-joinable | |
20 // and as such provides TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN semantics. | |
21 class SSLPlatformKeyTaskRunner { | |
22 public: | |
23 SSLPlatformKeyTaskRunner(); | |
24 ~SSLPlatformKeyTaskRunner(); | |
25 | |
26 scoped_refptr<base::SingleThreadTaskRunner> task_runner(); | |
27 | |
28 private: | |
29 base::Thread worker_thread_; | |
30 | |
31 DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyTaskRunner); | |
32 }; | |
33 | |
34 scoped_refptr<base::SingleThreadTaskRunner> GetSSLPlatformKeyTaskRunner(); | |
35 | |
36 } // namespace net | |
37 | |
38 #endif // NET_SSL_SSL_PLATFORM_KEY_TASK_RUNNER_H_ | |
OLD | NEW |