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

Unified Diff: base/message_loop/message_pump_win.h

Issue 15709015: Make sure that the UI window created by base::MessagePumpForUI is destoyed on the same thread (Wind… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 6 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/message_loop/message_pump_mac.mm ('k') | base/message_loop/message_pump_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_pump_win.h
diff --git a/base/message_loop/message_pump_win.h b/base/message_loop/message_pump_win.h
index dbb41bd527c9d1c8f16de3cf073613bbecc0bbfe..b492678dc32b5c44b5d460f703e82dba13556596 100644
--- a/base/message_loop/message_pump_win.h
+++ b/base/message_loop/message_pump_win.h
@@ -16,6 +16,7 @@
#include "base/message_loop/message_pump_dispatcher.h"
#include "base/message_loop/message_pump_observer.h"
#include "base/observer_list.h"
+#include "base/synchronization/lock.h"
#include "base/time.h"
#include "base/win/scoped_handle.h"
@@ -45,8 +46,8 @@ class BASE_EXPORT MessagePumpWin : public MessagePump {
void RunWithDispatcher(Delegate* delegate, MessagePumpDispatcher* dispatcher);
// MessagePump methods:
- virtual void Run(Delegate* delegate) { RunWithDispatcher(delegate, NULL); }
- virtual void Quit();
+ virtual void Run(Delegate* delegate) OVERRIDE;
+ virtual void Quit() OVERRIDE;
protected:
struct RunState {
@@ -166,8 +167,9 @@ class BASE_EXPORT MessagePumpForUI : public MessagePumpWin {
void SetMessageFilter(scoped_ptr<MessageFilter> message_filter);
// MessagePump methods:
- virtual void ScheduleWork();
- virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time);
+ virtual void ScheduleWork() OVERRIDE;
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
+ virtual void Shutdown() OVERRIDE;
// Applications can call this to encourage us to process all pending WM_PAINT
// messages. This method will process all paint messages the Windows Message
@@ -194,6 +196,9 @@ class BASE_EXPORT MessagePumpForUI : public MessagePumpWin {
// A hidden message-only window.
HWND message_hwnd_;
+ // Protectes access to |message_hwnd_|.
+ base::Lock message_hwnd_lock_;
+
scoped_ptr<MessageFilter> message_filter_;
};
@@ -327,6 +332,7 @@ class BASE_EXPORT MessagePumpForIO : public MessagePumpWin {
// MessagePump methods:
virtual void ScheduleWork();
virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time);
+ virtual void Shutdown() OVERRIDE;
// Register the handler to be used when asynchronous IO for the given file
// completes. The registration persists as long as |file_handle| is valid, so
« no previous file with comments | « base/message_loop/message_pump_mac.mm ('k') | base/message_loop/message_pump_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698