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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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 "config.h"
6
7 #include "public/platform/WebSchedulerProxy.h"
8
9 #include "platform/scheduler/Scheduler.h"
10 #include "wtf/Assertions.h"
11 #include "wtf/PassOwnPtr.h"
12
13 namespace blink {
14 namespace {
15
16 void runTask(PassOwnPtr<WebThread::Task> task)
17 {
18 task->run();
19 }
20
21 } // namespace
22
23 WebSchedulerProxy WebSchedulerProxy::create()
24 {
25 return WebSchedulerProxy();
26 }
27
28 WebSchedulerProxy::WebSchedulerProxy()
29 : m_scheduler(WebCore::Scheduler::shared())
30 {
31 ASSERT(m_scheduler);
32 }
33
34 WebSchedulerProxy::~WebSchedulerProxy()
35 {
36 }
37
38 void WebSchedulerProxy::postInputTask(WebThread::Task* task)
39 {
40 m_scheduler->postInputTask(bind(&runTask, adoptPtr(task)));
41 }
42
43 void WebSchedulerProxy::postCompositorTask(WebThread::Task* task)
44 {
45 m_scheduler->postCompositorTask(bind(&runTask, adoptPtr(task)));
46 }
47
48 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698