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

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

Issue 2103883004: Remove dependency of SSLPlatformKeyTaskRunner on single-threaded SequencedWorkerPool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a2_hook
Patch Set: fix fwd-decls Created 4 years, 4 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_task_runner.h ('k') | net/ssl/threaded_ssl_private_key.h » ('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 #include "net/ssl/ssl_platform_key_task_runner.h"
6
5 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
6 #include "net/ssl/ssl_platform_key_task_runner.h"
7 8
8 namespace net { 9 namespace net {
9 10
10 SSLPlatformKeyTaskRunner::SSLPlatformKeyTaskRunner() { 11 SSLPlatformKeyTaskRunner::SSLPlatformKeyTaskRunner()
11 worker_pool_ = new base::SequencedWorkerPool(1, "Platform Key Thread"); 12 : worker_thread_("Platform Key Thread") {
12 task_runner_ = worker_pool_->GetSequencedTaskRunnerWithShutdownBehavior( 13 base::Thread::Options options;
13 worker_pool_->GetSequenceToken(), 14 options.joinable = false;
14 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); 15 worker_thread_.StartWithOptions(options);
15 } 16 }
16 17
17 SSLPlatformKeyTaskRunner::~SSLPlatformKeyTaskRunner() {} 18 SSLPlatformKeyTaskRunner::~SSLPlatformKeyTaskRunner() = default;
18 19
19 scoped_refptr<base::SequencedTaskRunner> 20 scoped_refptr<base::SingleThreadTaskRunner>
20 SSLPlatformKeyTaskRunner::task_runner() { 21 SSLPlatformKeyTaskRunner::task_runner() {
21 return task_runner_; 22 return worker_thread_.task_runner();
22 } 23 }
23 24
24 base::LazyInstance<SSLPlatformKeyTaskRunner>::Leaky g_platform_key_task_runner = 25 base::LazyInstance<SSLPlatformKeyTaskRunner>::Leaky g_platform_key_task_runner =
25 LAZY_INSTANCE_INITIALIZER; 26 LAZY_INSTANCE_INITIALIZER;
26 27
27 scoped_refptr<base::SequencedTaskRunner> GetSSLPlatformKeyTaskRunner() { 28 scoped_refptr<base::SingleThreadTaskRunner> GetSSLPlatformKeyTaskRunner() {
28 return g_platform_key_task_runner.Get().task_runner(); 29 return g_platform_key_task_runner.Get().task_runner();
29 } 30 }
30 31
31 } // namespace net 32 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_platform_key_task_runner.h ('k') | net/ssl/threaded_ssl_private_key.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698