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

Unified Diff: base/win/message_window.cc

Issue 2824533002: Migrate Bind to BindOnce or BindRepeating in //base/message_loop (Closed)
Patch Set: Created 3 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
« no previous file with comments | « base/win/message_window.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/message_window.cc
diff --git a/base/win/message_window.cc b/base/win/message_window.cc
index 155047e4aeeeecb66ad5b4d046e728cd162cfe6f..97dd78128285678955c4355a2d371aff869e5b2a 100644
--- a/base/win/message_window.cc
+++ b/base/win/message_window.cc
@@ -81,13 +81,13 @@ MessageWindow::~MessageWindow() {
}
}
-bool MessageWindow::Create(const MessageCallback& message_callback) {
- return DoCreate(message_callback, NULL);
+bool MessageWindow::Create(MessageCallback message_callback) {
+ return DoCreate(std::move(message_callback), NULL);
dcheng 2017/04/17 17:59:30 Actually, I do have one question here: this avoid
tzik 2017/04/18 05:20:29 I believe the pass-by-value of Callback is lightwe
}
-bool MessageWindow::CreateNamed(const MessageCallback& message_callback,
+bool MessageWindow::CreateNamed(MessageCallback message_callback,
const string16& window_name) {
- return DoCreate(message_callback, window_name.c_str());
+ return DoCreate(std::move(message_callback), window_name.c_str());
}
// static
@@ -96,13 +96,13 @@ HWND MessageWindow::FindWindow(const string16& window_name) {
window_name.c_str());
}
-bool MessageWindow::DoCreate(const MessageCallback& message_callback,
+bool MessageWindow::DoCreate(MessageCallback message_callback,
const wchar_t* window_name) {
DCHECK(CalledOnValidThread());
DCHECK(message_callback_.is_null());
DCHECK(!window_);
- message_callback_ = message_callback;
+ message_callback_ = std::move(message_callback);
WindowClass& window_class = g_window_class.Get();
window_ = CreateWindow(MAKEINTATOM(window_class.atom()), window_name, 0, 0, 0,
« no previous file with comments | « base/win/message_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698