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

Unified Diff: Source/platform/exported/WebSchedulerProxy.cpp

Issue 364873002: Introduce a basic Blink Scheduler (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleaned up includes + build fix. 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: Source/platform/exported/WebSchedulerProxy.cpp
diff --git a/Source/platform/exported/WebSchedulerProxy.cpp b/Source/platform/exported/WebSchedulerProxy.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..601d775a671adb2fe3f7e3ae308b44305c4485a1
--- /dev/null
+++ b/Source/platform/exported/WebSchedulerProxy.cpp
@@ -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.
+
+#include "config.h"
+
+#include "public/platform/WebSchedulerProxy.h"
+
+#include "platform/scheduler/Scheduler.h"
+#include "wtf/Assertions.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace blink {
+namespace {
+
+void runTask(PassOwnPtr<WebThread::Task> task)
+{
+ task->run();
+}
+
+} // namespace
+
+WebSchedulerProxy WebSchedulerProxy::create()
+{
+ return WebSchedulerProxy();
+}
+
+WebSchedulerProxy::WebSchedulerProxy()
+ : m_scheduler(WebCore::Scheduler::shared())
+{
+ ASSERT(m_scheduler);
+}
+
+WebSchedulerProxy::~WebSchedulerProxy()
+{
+}
+
+void WebSchedulerProxy::postInputTask(WebThread::Task* task)
+{
+ m_scheduler->postInputTask(bind(&runTask, adoptPtr(task)));
+}
+
+void WebSchedulerProxy::postCompositorTask(WebThread::Task* task)
+{
+ m_scheduler->postCompositorTask(bind(&runTask, adoptPtr(task)));
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698