OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "public/platform/WebSchedulerProxy.h" | 7 #include "public/platform/WebSchedulerProxy.h" |
8 | 8 |
9 #include "platform/scheduler/Scheduler.h" | 9 #include "platform/scheduler/Scheduler.h" |
10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 namespace { | 14 namespace { |
15 | 15 |
16 void runTask(PassOwnPtr<WebThread::Task> task) | 16 void runTask(PassOwnPtr<WebThread::Task> task) |
17 { | 17 { |
18 task->run(); | 18 task->run(); |
19 } | 19 } |
20 | 20 |
21 } // namespace | 21 } // namespace |
22 | 22 |
23 WebSchedulerProxy WebSchedulerProxy::create() | 23 WebSchedulerProxy WebSchedulerProxy::create() |
24 { | 24 { |
25 return WebSchedulerProxy(); | 25 return WebSchedulerProxy(); |
26 } | 26 } |
27 | 27 |
28 WebSchedulerProxy::WebSchedulerProxy() | 28 WebSchedulerProxy::WebSchedulerProxy() |
29 : m_scheduler(WebCore::Scheduler::shared()) | 29 : m_scheduler(blink::Scheduler::shared()) |
30 { | 30 { |
31 ASSERT(m_scheduler); | 31 ASSERT(m_scheduler); |
32 } | 32 } |
33 | 33 |
34 WebSchedulerProxy::~WebSchedulerProxy() | 34 WebSchedulerProxy::~WebSchedulerProxy() |
35 { | 35 { |
36 } | 36 } |
37 | 37 |
38 void WebSchedulerProxy::postInputTask(WebThread::Task* task) | 38 void WebSchedulerProxy::postInputTask(WebThread::Task* task) |
39 { | 39 { |
40 m_scheduler->postInputTask(bind(&runTask, adoptPtr(task))); | 40 m_scheduler->postInputTask(bind(&runTask, adoptPtr(task))); |
41 } | 41 } |
42 | 42 |
43 void WebSchedulerProxy::postCompositorTask(WebThread::Task* task) | 43 void WebSchedulerProxy::postCompositorTask(WebThread::Task* task) |
44 { | 44 { |
45 m_scheduler->postCompositorTask(bind(&runTask, adoptPtr(task))); | 45 m_scheduler->postCompositorTask(bind(&runTask, adoptPtr(task))); |
46 } | 46 } |
47 | 47 |
48 } // namespace blink | 48 } // namespace blink |
OLD | NEW |