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.
7 #include "public/platform/WebSchedulerProxy.h"
9 #include "platform/TraceLocation.h"
10 #include "platform/scheduler/Scheduler.h"
11 #include "public/platform/WebTraceLocation.h"
12 #include "wtf/Assertions.h"
13 #include "wtf/PassOwnPtr.h"
18 void runTask(PassOwnPtr<WebThread::Task> task)
25 WebSchedulerProxy WebSchedulerProxy::create()
27 return WebSchedulerProxy();
30 WebSchedulerProxy::WebSchedulerProxy()
31 : m_scheduler(Scheduler::shared())
36 WebSchedulerProxy::~WebSchedulerProxy()
40 void WebSchedulerProxy::postInputTask(const WebTraceLocation& webLocation, WebThread::Task* task)
42 TraceLocation location(webLocation.functionName(), webLocation.fileName());
43 m_scheduler->postInputTask(location, bind(&runTask, adoptPtr(task)));
46 void WebSchedulerProxy::postCompositorTask(const WebTraceLocation& webLocation, WebThread::Task* task)
48 TraceLocation location(webLocation.functionName(), webLocation.fileName());
49 m_scheduler->postCompositorTask(location, bind(&runTask, adoptPtr(task)));
52 void WebSchedulerProxy::postIpcTask(const WebTraceLocation& webLocation, WebThread::Task* task)
54 TraceLocation location(webLocation.functionName(), webLocation.fileName());
55 m_scheduler->postIpcTask(location, bind(&runTask, adoptPtr(task)));
58 void WebSchedulerProxy::didReceiveInputEvent()
60 m_scheduler->didReceiveInputEvent();