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

Side by Side Diff: content/child/worker_thread_task_runner.cc

Issue 898803003: workers: Remove dead code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « content/child/worker_thread_task_runner.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/child/worker_thread_task_runner.h" 5 #include "content/child/worker_thread_task_runner.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/child/worker_task_runner.h" 8 #include "content/child/worker_task_runner.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 WorkerThreadTaskRunner::WorkerThreadTaskRunner(int worker_thread_id) 12 WorkerThreadTaskRunner::WorkerThreadTaskRunner(int worker_thread_id)
13 : worker_thread_id_(worker_thread_id) { 13 : worker_thread_id_(worker_thread_id) {
14 } 14 }
15 15
16 scoped_refptr<WorkerThreadTaskRunner> WorkerThreadTaskRunner::current() {
17 int worker_thread_id = WorkerTaskRunner::Instance()->CurrentWorkerId();
18 if (!worker_thread_id)
19 return scoped_refptr<WorkerThreadTaskRunner>();
20 return make_scoped_refptr(new WorkerThreadTaskRunner(worker_thread_id));
21 }
22
23 bool WorkerThreadTaskRunner::PostDelayedTask( 16 bool WorkerThreadTaskRunner::PostDelayedTask(
24 const tracked_objects::Location& /* from_here */, 17 const tracked_objects::Location& /* from_here */,
25 const base::Closure& task, 18 const base::Closure& task,
26 base::TimeDelta delay) { 19 base::TimeDelta delay) {
27 // Currently non-zero delay is not supported. 20 // Currently non-zero delay is not supported.
28 DCHECK(!delay.ToInternalValue()); 21 DCHECK(!delay.ToInternalValue());
29 return WorkerTaskRunner::Instance()->PostTask(worker_thread_id_, task); 22 return WorkerTaskRunner::Instance()->PostTask(worker_thread_id_, task);
30 } 23 }
31 24
32 bool WorkerThreadTaskRunner::RunsTasksOnCurrentThread() const { 25 bool WorkerThreadTaskRunner::RunsTasksOnCurrentThread() const {
33 return worker_thread_id_ == WorkerTaskRunner::Instance()->CurrentWorkerId(); 26 return worker_thread_id_ == WorkerTaskRunner::Instance()->CurrentWorkerId();
34 } 27 }
35 28
36 WorkerThreadTaskRunner::~WorkerThreadTaskRunner() {} 29 WorkerThreadTaskRunner::~WorkerThreadTaskRunner() {}
37 30
38 } // namespace content 31 } // namespace content
OLDNEW
« no previous file with comments | « content/child/worker_thread_task_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698