From 3a4b2d1ad07c4e79ab2923d6a571846d64f9f1f1 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Tue, 3 Feb 2015 20:10:42 -0500 Subject: [PATCH] webcrypto: Get task-runner for worker-thread from base::ThreadTaskRunnerHandle Both main-thread and worker-threads have their own message-loops. So use base::ThreadTaskRunnerHandle::Get() to get the task-runner in both main and worker threads. BUG=none R=eroman@chromium.org Review URL: https://codereview.chromium.org/900703002 Cr-Commit-Position: refs/heads/master@{#314457} --- content/child/webcrypto/webcrypto_impl.cc | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/content/child/webcrypto/webcrypto_impl.cc b/content/child/webcrypto/webcrypto_impl.cc index 9a3924b9aa9d..3270fbc00639 100644 --- a/content/child/webcrypto/webcrypto_impl.cc +++ b/content/child/webcrypto/webcrypto_impl.cc @@ -20,7 +20,6 @@ #include "content/child/webcrypto/generate_key_result.h" #include "content/child/webcrypto/status.h" #include "content/child/webcrypto/webcrypto_util.h" -#include "content/child/worker_thread_task_runner.h" #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" #include "third_party/WebKit/public/platform/WebString.h" @@ -135,19 +134,10 @@ void CompleteWithKeyOrError(const Status& status, } } -// Gets a task runner for the current thread. The current thread is either: -// -// * The main Blink thread -// * A Blink web worker thread -// -// A different mechanism is needed for posting to these threads. The main -// thread has an associated message loop and can simply use -// base::ThreadTaskRunnerHandle. Whereas the web worker threads are managed by -// Blink and need to be indirected through WorkerThreadTaskRunner. +// Gets a task runner for the current thread. scoped_refptr GetCurrentBlinkThread() { - if (base::ThreadTaskRunnerHandle::IsSet()) - return base::ThreadTaskRunnerHandle::Get(); - return WorkerThreadTaskRunner::current(); + DCHECK(base::ThreadTaskRunnerHandle::IsSet()); + return base::ThreadTaskRunnerHandle::Get(); } // -------------------------------------------------------------------- -- 2.11.4.GIT