Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/child/compositor_worker_scheduler.cc

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "public/platform/scheduler/child/compositor_worker_scheduler.h" 5 #include "public/platform/scheduler/child/compositor_worker_scheduler.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/threading/thread.h" 8 #include "base/threading/thread.h"
9 9
10 namespace blink { 10 namespace blink {
11 namespace scheduler { 11 namespace scheduler {
12 12
13 // TODO(scheduler-dev): Get rid of this asap! 13 // TODO(scheduler-dev): Get rid of this asap!
14 namespace { 14 namespace {
15 class CompositorWorkerTaskRunnerWrapper : public TaskQueue { 15 class CompositorWorkerTaskRunnerWrapper : public TaskQueue {
16 public: 16 public:
17 explicit CompositorWorkerTaskRunnerWrapper( 17 explicit CompositorWorkerTaskRunnerWrapper(
18 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 18 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
19 : task_runner_(task_runner) {} 19 : task_runner_(task_runner) {}
20 20
21 // TaskQueue implementation: 21 // TaskQueue implementation:
22 void UnregisterTaskQueue() override { NOTREACHED(); } 22 void UnregisterTaskQueue() override { NOTREACHED(); }
23 23
24 bool RunsTasksOnCurrentThread() const override { 24 bool RunsTasksOnCurrentThread() const override {
25 return task_runner_->RunsTasksOnCurrentThread(); 25 return task_runner_->RunsTasksOnCurrentThread();
26 } 26 }
27 27
28 bool PostDelayedTask(const tracked_objects::Location& from_here, 28 bool PostDelayedTask(const tracked_objects::Location& from_here,
29 const base::Closure& task, 29 base::OnceClosure task,
30 base::TimeDelta delay) override { 30 base::TimeDelta delay) override {
31 return task_runner_->PostDelayedTask(from_here, task, delay); 31 return task_runner_->PostDelayedTask(from_here, std::move(task), delay);
32 } 32 }
33 33
34 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 34 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
35 const base::Closure& task, 35 base::OnceClosure task,
36 base::TimeDelta delay) override { 36 base::TimeDelta delay) override {
37 return task_runner_->PostNonNestableDelayedTask(from_here, task, delay); 37 return task_runner_->PostNonNestableDelayedTask(
38 from_here, std::move(task), delay);
38 } 39 }
39 40
40 void SetQueueEnabled(bool enabled) override { NOTREACHED(); } 41 void SetQueueEnabled(bool enabled) override { NOTREACHED(); }
41 42
42 void InsertFence() override { NOTREACHED(); } 43 void InsertFence() override { NOTREACHED(); }
43 44
44 void RemoveFence() override { NOTREACHED(); } 45 void RemoveFence() override { NOTREACHED(); }
45 46
46 bool BlockedByFence() const override { 47 bool BlockedByFence() const override {
47 NOTREACHED(); 48 NOTREACHED();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // TODO(flackr): Return the next frame time as the deadline instead. 153 // TODO(flackr): Return the next frame time as the deadline instead.
153 // TODO(flackr): Ensure that oilpan GC does happen on the compositor thread 154 // TODO(flackr): Ensure that oilpan GC does happen on the compositor thread
154 // even though we will have no long idle periods. https://crbug.com/609531 155 // even though we will have no long idle periods. https://crbug.com/609531
155 return base::TimeTicks::Now() + base::TimeDelta::FromMillisecondsD(16.7); 156 return base::TimeTicks::Now() + base::TimeDelta::FromMillisecondsD(16.7);
156 } 157 }
157 158
158 void CompositorWorkerScheduler::DidProcessIdleTask() {} 159 void CompositorWorkerScheduler::DidProcessIdleTask() {}
159 160
160 } // namespace scheduler 161 } // namespace scheduler
161 } // namespace blink 162 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698