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

Unified Diff: remoting/host/setup/daemon_controller_delegate_mac.mm

Issue 1064863004: Use base::ResetAndReturn() in remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/setup/daemon_controller_delegate_mac.mm
diff --git a/remoting/host/setup/daemon_controller_delegate_mac.mm b/remoting/host/setup/daemon_controller_delegate_mac.mm
index 2fd7daaa660ac4aea21d964d73a72af8b9fff585..9821f868a347791b1834ff5c5c1adf9f97ef9bbd 100644
--- a/remoting/host/setup/daemon_controller_delegate_mac.mm
+++ b/remoting/host/setup/daemon_controller_delegate_mac.mm
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/bind.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -175,12 +176,10 @@ void DaemonControllerDelegateMac::PreferencePaneCallbackDelegate(
return;
}
- DCHECK(!current_callback_.is_null());
- DaemonController::CompletionCallback done = current_callback_;
- current_callback_.Reset();
- done.Run(result);
-
DeregisterForPreferencePaneNotifications();
+
+ DCHECK(!current_callback_.is_null());
+ base::ResetAndReturn(&current_callback_).Run(result);
}
// static

Powered by Google App Engine
This is Rietveld 408576698