Roll src/third_party/WebKit 605a979:06cb9e9 (svn 202556:202558)
[chromium-blink-merge.git] / components / scheduler / child / web_task_runner_impl.h
blob8bf5ee828fb38d57a38cdeb5f02ff22a1f18e3b1
1 // Copyright 2015 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.
5 #ifndef COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_
6 #define COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "components/scheduler/scheduler_export.h"
12 #include "third_party/WebKit/public/platform/WebTaskRunner.h"
14 namespace base {
15 class SingleThreadTaskRunner;
16 } // namespace base
18 namespace scheduler {
20 class SCHEDULER_EXPORT WebTaskRunnerImpl : public blink::WebTaskRunner {
21 public:
22 explicit WebTaskRunnerImpl(
23 scoped_refptr<base::SingleThreadTaskRunner> task_runner);
25 ~WebTaskRunnerImpl() override;
27 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner() const {
28 return task_runner_;
31 // blink::WebTaskRunner implementation:
32 virtual void postTask(const blink::WebTraceLocation& web_location,
33 blink::WebTaskRunner::Task* task);
34 // TODO(alexclarke): Remove this when possible.
35 virtual void postDelayedTask(const blink::WebTraceLocation& web_location,
36 blink::WebTaskRunner::Task* task,
37 long long delayMs);
38 virtual void postDelayedTask(const blink::WebTraceLocation& web_location,
39 blink::WebTaskRunner::Task* task,
40 double delayMs);
42 private:
43 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
45 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl);
48 } // namespace scheduler
50 #endif // COMPONENTS_SCHEDULER_CHILD_WEB_TASK_RUNNER_H_