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

Unified Diff: cc/trees/main_thread_task_runner.h

Issue 363383002: Forward input tasks to the Blink scheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. DefaultMainThreadTaskRunner now dispatches properly. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/main_thread_task_runner.h
diff --git a/cc/trees/main_thread_task_runner.h b/cc/trees/main_thread_task_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..19416de493c96d22c33fcca7889404aeb167f7b4
--- /dev/null
+++ b/cc/trees/main_thread_task_runner.h
@@ -0,0 +1,48 @@
+// Copyright 2014 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 CC_TREES_MAIN_THREAD_TASK_RUNNER_H_
+#define CC_TREES_MAIN_THREAD_TASK_RUNNER_H_
+
+#include "base/single_thread_task_runner.h"
+#include "cc/base/cc_export.h"
+
+namespace cc {
+
+class CC_EXPORT MainThreadTaskRunner : public base::SingleThreadTaskRunner {
+ public:
+ virtual void PostBeginMainFrameTask(
+ const tracked_objects::Location& from_here, const base::Closure& task,
+ double frame_time, double deadline, double interval) = 0;
+
+ virtual bool PostDelayedTask(
+ const tracked_objects::Location& from_here, const base::Closure& task,
+ base::TimeDelta delay) OVERRIDE;
+
+ virtual bool PostNonNestableDelayedTask(
+ const tracked_objects::Location& from_here, const base::Closure& task,
+ base::TimeDelta delay) OVERRIDE;
+
+ virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+
+ protected:
+ virtual ~MainThreadTaskRunner() {}
+};
+
+class CC_EXPORT DefaultMainThreadTaskRunner : public MainThreadTaskRunner {
+ public:
+ virtual bool PostDelayedTask(
+ const tracked_objects::Location& from_here, const base::Closure& task,
+ base::TimeDelta delay) OVERRIDE;
+
+ virtual void PostBeginMainFrameTask(
+ const tracked_objects::Location& from_here, const base::Closure& task,
+ double frame_time, double deadline, double interval) OVERRIDE;
+ protected:
+ virtual ~DefaultMainThreadTaskRunner() {}
+};
+
+} // namespace cc
+
+#endif // CC_TREES_MAIN_THREAD_TASK_RUNNER_H_

Powered by Google App Engine
This is Rietveld 408576698