| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_MESSAGE_PUMP_GLIB_H_ | 5 #ifndef BASE_MESSAGE_PUMP_GLIB_H_ |
| 6 #define BASE_MESSAGE_PUMP_GLIB_H_ | 6 #define BASE_MESSAGE_PUMP_GLIB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_pump.h" | 10 #include "base/message_pump.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void HandleDispatch(); | 57 void HandleDispatch(); |
| 58 | 58 |
| 59 // Adds an Observer, which will start receiving notifications immediately. | 59 // Adds an Observer, which will start receiving notifications immediately. |
| 60 void AddObserver(MessagePumpObserver* observer); | 60 void AddObserver(MessagePumpObserver* observer); |
| 61 | 61 |
| 62 // Removes an Observer. It is safe to call this method while an Observer is | 62 // Removes an Observer. It is safe to call this method while an Observer is |
| 63 // receiving a notification callback. | 63 // receiving a notification callback. |
| 64 void RemoveObserver(MessagePumpObserver* observer); | 64 void RemoveObserver(MessagePumpObserver* observer); |
| 65 | 65 |
| 66 // Overridden from MessagePump: | 66 // Overridden from MessagePump: |
| 67 virtual void Run(Delegate* delegate); | 67 virtual void Run(Delegate* delegate) OVERRIDE; |
| 68 virtual void Quit(); | 68 virtual void Quit() OVERRIDE; |
| 69 virtual void ScheduleWork(); | 69 virtual void ScheduleWork() OVERRIDE; |
| 70 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time); | 70 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE; |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 // Returns the dispatcher for the current run state (|state_->dispatcher|). | 73 // Returns the dispatcher for the current run state (|state_->dispatcher|). |
| 74 MessagePumpDispatcher* GetDispatcher(); | 74 MessagePumpDispatcher* GetDispatcher(); |
| 75 | 75 |
| 76 ObserverList<MessagePumpObserver>& observers() { return observers_; } | 76 ObserverList<MessagePumpObserver>& observers() { return observers_; } |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 // We may make recursive calls to Run, so we save state that needs to be | 79 // We may make recursive calls to Run, so we save state that needs to be |
| 80 // separate between them in this structure type. | 80 // separate between them in this structure type. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 105 | 105 |
| 106 // List of observers. | 106 // List of observers. |
| 107 ObserverList<MessagePumpObserver> observers_; | 107 ObserverList<MessagePumpObserver> observers_; |
| 108 | 108 |
| 109 DISALLOW_COPY_AND_ASSIGN(MessagePumpGlib); | 109 DISALLOW_COPY_AND_ASSIGN(MessagePumpGlib); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace base | 112 } // namespace base |
| 113 | 113 |
| 114 #endif // BASE_MESSAGE_PUMP_GLIB_H_ | 114 #endif // BASE_MESSAGE_PUMP_GLIB_H_ |
| OLD | NEW |