| 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
|
|
|