Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LOOP_MESSAGE_LOOP_H_ | 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
| 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 // hr = DoDragDrop(...); // Implicitly runs a modal message loop. | 83 // hr = DoDragDrop(...); // Implicitly runs a modal message loop. |
| 84 // } | 84 // } |
| 85 // // Process |hr| (the result returned by DoDragDrop()). | 85 // // Process |hr| (the result returned by DoDragDrop()). |
| 86 // | 86 // |
| 87 // Please be SURE your task is reentrant (nestable) and all global variables | 87 // Please be SURE your task is reentrant (nestable) and all global variables |
| 88 // are stable and accessible before calling SetNestableTasksAllowed(true). | 88 // are stable and accessible before calling SetNestableTasksAllowed(true). |
| 89 // | 89 // |
| 90 class BASE_EXPORT MessageLoop : public MessagePump::Delegate { | 90 class BASE_EXPORT MessageLoop : public MessagePump::Delegate { |
| 91 public: | 91 public: |
| 92 | 92 |
| 93 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 93 #if defined(TOOLKIT_GTK) |
| 94 typedef void* Dispatcher; | |
|
ccameron
2013/09/03 23:35:49
This is the only area where we'd have difficulty -
| |
| 95 typedef MessagePumpGdkObserver Observer; | |
| 96 #elif !defined(OS_MACOSX) && !defined(OS_ANDROID) | |
| 94 typedef MessagePumpDispatcher Dispatcher; | 97 typedef MessagePumpDispatcher Dispatcher; |
| 95 typedef MessagePumpObserver Observer; | 98 typedef MessagePumpObserver Observer; |
| 96 #endif | 99 #endif |
| 97 | 100 |
| 98 // A MessageLoop has a particular type, which indicates the set of | 101 // A MessageLoop has a particular type, which indicates the set of |
| 99 // asynchronous events it may process in addition to tasks and timers. | 102 // asynchronous events it may process in addition to tasks and timers. |
| 100 // | 103 // |
| 101 // TYPE_DEFAULT | 104 // TYPE_DEFAULT |
| 102 // This type of ML only supports tasks and timers. | 105 // This type of ML only supports tasks and timers. |
| 103 // | 106 // |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 710 | 713 |
| 711 // Do not add any member variables to MessageLoopForIO! This is important b/c | 714 // Do not add any member variables to MessageLoopForIO! This is important b/c |
| 712 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 715 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
| 713 // data that you need should be stored on the MessageLoop's pump_ instance. | 716 // data that you need should be stored on the MessageLoop's pump_ instance. |
| 714 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 717 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
| 715 MessageLoopForIO_should_not_have_extra_member_variables); | 718 MessageLoopForIO_should_not_have_extra_member_variables); |
| 716 | 719 |
| 717 } // namespace base | 720 } // namespace base |
| 718 | 721 |
| 719 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 722 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
| OLD | NEW |