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

Unified Diff: base/win/message_window.h

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
Index: base/win/message_window.h
diff --git a/base/win/message_window.h b/base/win/message_window.h
index 950d03a90e56c2795d3d4dc19ee63ead832ca3ef..97cc8d49dd04265e6d66d49d66793ffc20be2ccd 100644
--- a/base/win/message_window.h
+++ b/base/win/message_window.h
@@ -26,20 +26,18 @@ class BASE_EXPORT MessageWindow : public base::NonThreadSafe {
// Implement this callback to handle messages received by the message window.
// If the callback returns |false|, the first four parameters are passed to
// DefWindowProc(). Otherwise, |*result| is returned by the window procedure.
- typedef base::Callback<bool(UINT message,
- WPARAM wparam,
- LPARAM lparam,
- LRESULT* result)> MessageCallback;
+ using MessageCallback = base::RepeatingCallback<
+ bool(UINT message, WPARAM wparam, LPARAM lparam, LRESULT* result)>;
MessageWindow();
~MessageWindow();
// Creates a message-only window. The incoming messages will be passed by
// |message_callback|. |message_callback| must outlive |this|.
- bool Create(const MessageCallback& message_callback);
+ bool Create(MessageCallback message_callback);
// Same as Create() but assigns the name to the created window.
- bool CreateNamed(const MessageCallback& message_callback,
+ bool CreateNamed(MessageCallback message_callback,
const string16& window_name);
HWND hwnd() const { return window_; }
@@ -53,8 +51,7 @@ class BASE_EXPORT MessageWindow : public base::NonThreadSafe {
friend class WindowClass;
// Contains the actual window creation code.
- bool DoCreate(const MessageCallback& message_callback,
- const wchar_t* window_name);
+ bool DoCreate(MessageCallback message_callback, const wchar_t* window_name);
// Invoked by the OS to process incoming window messages.
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wparam,

Powered by Google App Engine
This is Rietveld 408576698