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

Unified Diff: content/child/worker_thread_task_runner.h

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: RemoveFilter fix 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 side-by-side diff with in-line comments
Download patch
Index: content/child/worker_thread_task_runner.h
diff --git a/content/child/worker_thread_task_runner.h b/content/child/worker_thread_task_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..a4fbc913bdffa4e9d6ae6239ec77d3af37081149
--- /dev/null
+++ b/content/child/worker_thread_task_runner.h
@@ -0,0 +1,39 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_CHILD_WORKER_THREAD_TASK_RUNNER_H_
+#define CONTENT_CHILD_WORKER_THREAD_TASK_RUNNER_H_
+
+#include "base/task_runner.h"
+
+namespace content {
+
+// A task runner that runs tasks on a single webkit worker thread which
+// is managed by webkit_glue::WorkerTaskRunner.
+// Note that this implementation ignores the delay duration for PostDelayedTask
+// and have it behave the same as PostTask.
+class WorkerThreadTaskRunner : public base::TaskRunner {
+ public:
+ explicit WorkerThreadTaskRunner(int worker_thread_id);
+
+ // Gets the WorkerThreadTaskRunner for the current worker thread.
+ // This returns non-null value only when it is called on a worker thread.
+ static scoped_refptr<WorkerThreadTaskRunner> current();
+
+ // TaskRunner overrides.
+ virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) OVERRIDE;
+ virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+
+ protected:
+ virtual ~WorkerThreadTaskRunner();
+
+ private:
+ const int worker_thread_id_;
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_WORKER_THREAD_TASK_RUNNER_H_
« no previous file with comments | « content/child/service_worker/service_worker_message_filter.cc ('k') | content/child/worker_thread_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698