| OLD | NEW |
| (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 |
| OLD | NEW |