OLD | NEW |
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 "webkit/child/worker_task_runner.h" | 8 #include "content/child/worker_task_runner.h" |
9 | |
10 using webkit_glue::WorkerTaskRunner; | |
11 | 9 |
12 namespace content { | 10 namespace content { |
13 | 11 |
14 WorkerThreadTaskRunner::WorkerThreadTaskRunner(int worker_thread_id) | 12 WorkerThreadTaskRunner::WorkerThreadTaskRunner(int worker_thread_id) |
15 : worker_thread_id_(worker_thread_id) { | 13 : worker_thread_id_(worker_thread_id) { |
16 } | 14 } |
17 | 15 |
18 scoped_refptr<WorkerThreadTaskRunner> WorkerThreadTaskRunner::current() { | 16 scoped_refptr<WorkerThreadTaskRunner> WorkerThreadTaskRunner::current() { |
19 int worker_thread_id = WorkerTaskRunner::Instance()->CurrentWorkerId(); | 17 int worker_thread_id = WorkerTaskRunner::Instance()->CurrentWorkerId(); |
20 if (!worker_thread_id) | 18 if (!worker_thread_id) |
(...skipping 10 matching lines...) Expand all Loading... |
31 return WorkerTaskRunner::Instance()->PostTask(worker_thread_id_, task); | 29 return WorkerTaskRunner::Instance()->PostTask(worker_thread_id_, task); |
32 } | 30 } |
33 | 31 |
34 bool WorkerThreadTaskRunner::RunsTasksOnCurrentThread() const { | 32 bool WorkerThreadTaskRunner::RunsTasksOnCurrentThread() const { |
35 return worker_thread_id_ == WorkerTaskRunner::Instance()->CurrentWorkerId(); | 33 return worker_thread_id_ == WorkerTaskRunner::Instance()->CurrentWorkerId(); |
36 } | 34 } |
37 | 35 |
38 WorkerThreadTaskRunner::~WorkerThreadTaskRunner() {} | 36 WorkerThreadTaskRunner::~WorkerThreadTaskRunner() {} |
39 | 37 |
40 } // namespace content | 38 } // namespace content |
OLD | NEW |