Index: ui/accelerated_widget_mac/window_resize_helper_mac.cc |
diff --git a/ui/accelerated_widget_mac/window_resize_helper_mac.cc b/ui/accelerated_widget_mac/window_resize_helper_mac.cc |
index b64e09b01d1f6cff4fe155e37a7b0c45ad40115f..2deedb5dfeab6e1df8ce200f905487c032528e49 100644 |
--- a/ui/accelerated_widget_mac/window_resize_helper_mac.cc |
+++ b/ui/accelerated_widget_mac/window_resize_helper_mac.cc |
@@ -31,7 +31,7 @@ typedef base::Callback<void(base::WaitableEvent*, base::TimeDelta)> |
// yet, to avoid running them twice. |
class WrappedTask { |
public: |
- WrappedTask(const base::Closure& closure, base::TimeDelta delay); |
+ WrappedTask(base::OnceClosure closure, base::TimeDelta delay); |
~WrappedTask(); |
bool ShouldRunBefore(const WrappedTask& other); |
void Run(); |
@@ -40,7 +40,7 @@ class WrappedTask { |
const base::TimeTicks& can_run_time() const { return can_run_time_; } |
private: |
- base::Closure closure_; |
+ base::OnceClosure closure_; |
base::TimeTicks can_run_time_; |
bool has_run_; |
uint64_t sequence_number_; |
@@ -73,11 +73,11 @@ class PumpableTaskRunner : public base::SingleThreadTaskRunner { |
// base::SingleThreadTaskRunner implementation: |
bool PostDelayedTask(const tracked_objects::Location& from_here, |
- const base::Closure& task, |
+ base::OnceClosure task, |
base::TimeDelta delay) override; |
bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
- const base::Closure& task, |
+ base::OnceClosure task, |
base::TimeDelta delay) override; |
bool RunsTasksOnCurrentThread() const override; |
@@ -113,8 +113,8 @@ base::LazyInstance<WindowResizeHelperMac>::Leaky g_window_resize_helper = |
//////////////////////////////////////////////////////////////////////////////// |
// WrappedTask |
-WrappedTask::WrappedTask(const base::Closure& closure, base::TimeDelta delay) |
- : closure_(closure), |
+WrappedTask::WrappedTask(base::OnceClosure closure, base::TimeDelta delay) |
+ : closure_(std::move(closure)), |
can_run_time_(base::TimeTicks::Now() + delay), |
has_run_(false), |
sequence_number_(0) {} |
@@ -142,7 +142,7 @@ void WrappedTask::Run() { |
return; |
RemoveFromTaskRunnerQueue(); |
has_run_ = true; |
- closure_.Run(); |
+ std::move(closure_).Run(); |
} |
void WrappedTask::AddToTaskRunnerQueue( |
@@ -259,15 +259,15 @@ bool PumpableTaskRunner::EnqueueAndPostWrappedTask( |
bool PumpableTaskRunner::PostDelayedTask( |
const tracked_objects::Location& from_here, |
- const base::Closure& task, |
+ base::OnceClosure task, |
base::TimeDelta delay) { |
- return EnqueueAndPostWrappedTask(from_here, new WrappedTask(task, delay), |
- delay); |
+ return EnqueueAndPostWrappedTask( |
+ from_here, new WrappedTask(std::move(task), delay), delay); |
} |
bool PumpableTaskRunner::PostNonNestableDelayedTask( |
const tracked_objects::Location& from_here, |
- const base::Closure& task, |
+ base::OnceClosure task, |
base::TimeDelta delay) { |
// The correctness of non-nestable events hasn't been proven for this |
// structure. |