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

Side by Side Diff: net/ssl/ssl_platform_key_task_runner.h

Issue 2103883004: Remove dependency of SSLPlatformKeyTaskRunner on single-threaded SequencedWorkerPool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a2_hook
Patch Set: Clarify API further. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « net/ssl/ssl_platform_key_nss.cc ('k') | net/ssl/ssl_platform_key_task_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SSL_PLATFORM_KEY_TASK_RUNNER_H_ 5 #ifndef NET_SSL_SSL_PLATFORM_KEY_TASK_RUNNER_H_
6 #define NET_SSL_SSL_PLATFORM_KEY_TASK_RUNNER_H_ 6 #define NET_SSL_SSL_PLATFORM_KEY_TASK_RUNNER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/threading/sequenced_worker_pool.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/threading/thread.h"
11
12 namespace {
13 class SequencedTaskRunner;
14 }
10 15
11 namespace net { 16 namespace net {
12 17
13 // Serialize all the private key operations on a single background 18 // Serialize all the private key operations on a single background thread to
14 // thread to avoid problems with buggy smartcards. 19 // avoid problems with buggy smartcards. The exposed SingleThreadTaskRunner has
20 // CONTINUE_ON_SHUTDOWN semantics.
Ryan Sleevi 2016/07/01 01:09:30 Simply from reading this header, it's unclear what
gab 2016/07/05 15:40:42 The only definitions are on SequencedWorkerPool an
Ryan Sleevi 2016/07/06 18:57:07 While I agree people should be familiar with //bas
gab 2016/07/07 23:51:34 Makes sense, thanks
15 class SSLPlatformKeyTaskRunner { 21 class SSLPlatformKeyTaskRunner {
16 public: 22 public:
17 SSLPlatformKeyTaskRunner(); 23 SSLPlatformKeyTaskRunner();
18 ~SSLPlatformKeyTaskRunner();
19 24
20 scoped_refptr<base::SequencedTaskRunner> task_runner(); 25 // Ensure the instance is leaked to enforce CONTINUE_ON_SHUTDOWN semantics.
26 ~SSLPlatformKeyTaskRunner() = delete;
27
28 static scoped_refptr<base::SingleThreadTaskRunner> Get();
Ryan Sleevi 2016/07/01 01:09:30 DESIGN: From a design perspective, it should be an
gab 2016/07/05 15:40:42 I thought it was even weirder to have essentially
Ryan Sleevi 2016/07/06 18:57:06 Why? The two are very different statements about A
gab 2016/07/07 23:51:34 Done.
21 29
22 private: 30 private:
23 scoped_refptr<base::SequencedWorkerPool> worker_pool_; 31 base::Thread worker_thread_;
Ryan Sleevi 2016/07/01 01:09:30 Have you tested and run Chrome with this? With DCH
gab 2016/07/05 15:40:42 Yep, runs fine in a Debug build on Win10 corp: -
Ryan Sleevi 2016/07/06 18:57:06 Well, no, the ::Leaky doesn't address the concerns
gab 2016/07/07 23:51:34 Ah got it, makes sense. Well there doesn't appear
gab 2016/07/07 23:54:16 On that note though, it would probably be better t
24 scoped_refptr<base::SequencedTaskRunner> task_runner_;
25 32
26 DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyTaskRunner); 33 DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyTaskRunner);
27 }; 34 };
28 35
29 scoped_refptr<base::SequencedTaskRunner> GetSSLPlatformKeyTaskRunner();
30
31 } // namespace net 36 } // namespace net
32 37
33 #endif // NET_SSL_SSL_PLATFORM_KEY_TASK_RUNNER_H_ 38 #endif // NET_SSL_SSL_PLATFORM_KEY_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « net/ssl/ssl_platform_key_nss.cc ('k') | net/ssl/ssl_platform_key_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698