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

Unified Diff: base/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: 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
Index: base/message_pump_win.h
diff --git a/base/message_pump_win.h b/base/message_pump_win.h
index a76bcfb78ff9f106bcf1ef047e3815b2c738c59c..82744e829c34621d707d4d6106613553743a70dc 100644
--- a/base/message_pump_win.h
+++ b/base/message_pump_win.h
@@ -26,7 +26,7 @@ namespace base {
// controlling the lifetime of the message pump.
class BASE_EXPORT MessagePumpWin : public MessagePump {
public:
- MessagePumpWin() : have_work_(0), state_(NULL) {}
+ MessagePumpWin();
virtual ~MessagePumpWin() {}
// Add an Observer, which will start receiving notifications immediately.
@@ -68,13 +68,16 @@ class BASE_EXPORT MessagePumpWin : public MessagePump {
// The time at which delayed work should run.
TimeTicks delayed_work_time_;
- // A boolean value used to indicate if there is a kMsgDoWork message pending
- // in the Windows Message queue. There is at most one such message, and it
- // can drive execution of tasks when a native message pump is running.
- LONG have_work_;
+ // Used to indicate if there is a kMsgDoWork message pending in the Windows
+ // Message queue. There is at most one such message, and it can drive
+ // execution of tasks when a native message pump is running.
+ LONG pump_state_;
// State for the current invocation of Run.
RunState* state_;
+
+ // Used to post an APC to the thread running the message pump.
+ win::ScopedHandle thread_;
};
//-----------------------------------------------------------------------------
@@ -166,8 +169,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 WillDestroyCurrentMessageLoop() 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

Powered by Google App Engine
This is Rietveld 408576698