OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "content/renderer/scheduler/deadline_task_runner.h" | 5 #include "components/scheduler/renderer/deadline_task_runner.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 | 8 |
9 namespace content { | 9 namespace scheduler { |
10 | 10 |
11 DeadlineTaskRunner::DeadlineTaskRunner( | 11 DeadlineTaskRunner::DeadlineTaskRunner( |
12 const base::Closure& callback, | 12 const base::Closure& callback, |
13 scoped_refptr<base::SingleThreadTaskRunner> task_runner) | 13 scoped_refptr<base::SingleThreadTaskRunner> task_runner) |
14 : callback_(callback), task_runner_(task_runner) { | 14 : callback_(callback), task_runner_(task_runner) { |
15 cancelable_run_internal_.Reset( | 15 cancelable_run_internal_.Reset( |
16 base::Bind(&DeadlineTaskRunner::RunInternal, base::Unretained(this))); | 16 base::Bind(&DeadlineTaskRunner::RunInternal, base::Unretained(this))); |
17 } | 17 } |
18 | 18 |
19 DeadlineTaskRunner::~DeadlineTaskRunner() { | 19 DeadlineTaskRunner::~DeadlineTaskRunner() { |
(...skipping 10 matching lines...) Expand all Loading... |
30 task_runner_->PostDelayedTask(from_here, | 30 task_runner_->PostDelayedTask(from_here, |
31 cancelable_run_internal_.callback(), delay); | 31 cancelable_run_internal_.callback(), delay); |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
35 void DeadlineTaskRunner::RunInternal() { | 35 void DeadlineTaskRunner::RunInternal() { |
36 deadline_ = base::TimeTicks(); | 36 deadline_ = base::TimeTicks(); |
37 callback_.Run(); | 37 callback_.Run(); |
38 } | 38 } |
39 | 39 |
40 } // namespace content | 40 } // namespace scheduler |
OLD | NEW |