Commit 9c3e4679 authored by Ayu Ishii's avatar Ayu Ishii Committed by Commit Bot

Convert base::Bind and base::Callback in components/remote_cocoa to Once/Repeating

Bug: 1007723
Change-Id: I833820b7f1175799464efb63684d680c7825ff95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1937573Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719441}
parent 33c299e6
...@@ -40,7 +40,7 @@ class CocoaWindowMoveLoop { ...@@ -40,7 +40,7 @@ class CocoaWindowMoveLoop {
// Pointer to a stack variable holding the exit reason. // Pointer to a stack variable holding the exit reason.
LoopExitReason* exit_reason_ref_ = nullptr; LoopExitReason* exit_reason_ref_ = nullptr;
base::Closure quit_closure_; base::OnceClosure quit_closure_;
// WeakPtrFactory for event monitor safety. // WeakPtrFactory for event monitor safety.
base::WeakPtrFactory<CocoaWindowMoveLoop> weak_factory_; base::WeakPtrFactory<CocoaWindowMoveLoop> weak_factory_;
......
...@@ -60,7 +60,7 @@ CocoaWindowMoveLoop::~CocoaWindowMoveLoop() { ...@@ -60,7 +60,7 @@ CocoaWindowMoveLoop::~CocoaWindowMoveLoop() {
// Handle the pathological case, where |this| is destroyed while running. // Handle the pathological case, where |this| is destroyed while running.
if (exit_reason_ref_) { if (exit_reason_ref_) {
*exit_reason_ref_ = WINDOW_DESTROYED; *exit_reason_ref_ = WINDOW_DESTROYED;
quit_closure_.Run(); std::move(quit_closure_).Run();
} }
owner_ = nullptr; owner_ = nullptr;
...@@ -110,7 +110,7 @@ bool CocoaWindowMoveLoop::Run() { ...@@ -110,7 +110,7 @@ bool CocoaWindowMoveLoop::Run() {
DCHECK_EQ([event type], NSLeftMouseUp); DCHECK_EQ([event type], NSLeftMouseUp);
*strong->exit_reason_ref_ = MOUSE_UP; *strong->exit_reason_ref_ = MOUSE_UP;
strong->quit_closure_.Run(); std::move(strong->quit_closure_).Run();
return event; // Process the MouseUp. return event; // Process the MouseUp.
}; };
id monitor = [NSEvent addLocalMonitorForEventsMatchingMask:mask id monitor = [NSEvent addLocalMonitorForEventsMatchingMask:mask
...@@ -132,7 +132,7 @@ void CocoaWindowMoveLoop::End() { ...@@ -132,7 +132,7 @@ void CocoaWindowMoveLoop::End() {
DCHECK_EQ(*exit_reason_ref_, ENDED_EXTERNALLY); DCHECK_EQ(*exit_reason_ref_, ENDED_EXTERNALLY);
// Ensure the destructor doesn't replace the reason. // Ensure the destructor doesn't replace the reason.
exit_reason_ref_ = nullptr; exit_reason_ref_ = nullptr;
quit_closure_.Run(); std::move(quit_closure_).Run();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment