| 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_LOOP_H_ | 5 #ifndef BASE_MESSAGE_LOOP_H_ |
| 6 #define BASE_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // MessageLoop::current()->SetNestableTasksAllowed(old_state); | 77 // MessageLoop::current()->SetNestableTasksAllowed(old_state); |
| 78 // // Process hr (the result returned by DoDragDrop(). | 78 // // Process hr (the result returned by DoDragDrop(). |
| 79 // | 79 // |
| 80 // Please be SURE your task is reentrant (nestable) and all global variables | 80 // Please be SURE your task is reentrant (nestable) and all global variables |
| 81 // are stable and accessible before calling SetNestableTasksAllowed(true). | 81 // are stable and accessible before calling SetNestableTasksAllowed(true). |
| 82 // | 82 // |
| 83 class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate { | 83 class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate { |
| 84 public: | 84 public: |
| 85 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
| 86 typedef base::MessagePumpWin::Dispatcher Dispatcher; | 86 typedef base::MessagePumpWin::Dispatcher Dispatcher; |
| 87 typedef base::MessagePumpForUI::Observer Observer; | 87 typedef base::MessagePumpObserver Observer; |
| 88 #elif !defined(OS_MACOSX) && !defined(OS_ANDROID) | 88 #elif !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 89 typedef base::MessagePumpDispatcher Dispatcher; | 89 typedef base::MessagePumpDispatcher Dispatcher; |
| 90 typedef base::MessagePumpObserver Observer; | 90 typedef base::MessagePumpObserver Observer; |
| 91 #endif | 91 #endif |
| 92 | 92 |
| 93 // A MessageLoop has a particular type, which indicates the set of | 93 // A MessageLoop has a particular type, which indicates the set of |
| 94 // asynchronous events it may process in addition to tasks and timers. | 94 // asynchronous events it may process in addition to tasks and timers. |
| 95 // | 95 // |
| 96 // TYPE_DEFAULT | 96 // TYPE_DEFAULT |
| 97 // This type of ML only supports tasks and timers. | 97 // This type of ML only supports tasks and timers. |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 #endif // defined(OS_POSIX) | 706 #endif // defined(OS_POSIX) |
| 707 }; | 707 }; |
| 708 | 708 |
| 709 // Do not add any member variables to MessageLoopForIO! This is important b/c | 709 // Do not add any member variables to MessageLoopForIO! This is important b/c |
| 710 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 710 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
| 711 // data that you need should be stored on the MessageLoop's pump_ instance. | 711 // data that you need should be stored on the MessageLoop's pump_ instance. |
| 712 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 712 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
| 713 MessageLoopForIO_should_not_have_extra_member_variables); | 713 MessageLoopForIO_should_not_have_extra_member_variables); |
| 714 | 714 |
| 715 #endif // BASE_MESSAGE_LOOP_H_ | 715 #endif // BASE_MESSAGE_LOOP_H_ |
| OLD | NEW |