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

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

Issue 63843002: Add ChildMessageFilter, a base class for renderer/worker cross-thread MessageFilter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cross thread -> child message filter Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/child/worker_thread_task_runner.h"
6
7 #include "webkit/child/worker_task_runner.h"
8
9 using webkit_glue::WorkerTaskRunner;
10
11 namespace content {
12
13 WorkerThreadTaskRunner::WorkerThreadTaskRunner(int worker_thread_id)
14 : worker_thread_id_(worker_thread_id) {
15 }
16
17 scoped_refptr<WorkerThreadTaskRunner> WorkerThreadTaskRunner::current() {
18 int worker_thread_id = WorkerTaskRunner::Instance()->CurrentWorkerId();
19 if (!worker_thread_id)
20 return scoped_refptr<WorkerThreadTaskRunner>();
21 return make_scoped_refptr(new WorkerThreadTaskRunner(worker_thread_id));
22 }
23
24 bool WorkerThreadTaskRunner::PostDelayedTask(
25 const tracked_objects::Location& /* from_here */,
26 const base::Closure& task,
27 base::TimeDelta /* delay */) {
michaeln 2013/11/18 17:51:42 should we assert if delay != 0 for now?
kinuko 2013/11/19 04:51:34 Done.
28 return WorkerTaskRunner::Instance()->PostTask(worker_thread_id_, task);
29 }
30
31 bool WorkerThreadTaskRunner::RunsTasksOnCurrentThread() const {
32 return worker_thread_id_ == WorkerTaskRunner::Instance()->CurrentWorkerId();
33 }
34
35 WorkerThreadTaskRunner::~WorkerThreadTaskRunner() {}
36
37 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698