| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The basis for all native run loops on the Mac is the CFRunLoop. It can be | 5 // The basis for all native run loops on the Mac is the CFRunLoop. It can be |
| 6 // used directly, it can be used as the driving force behind the similar | 6 // used directly, it can be used as the driving force behind the similar |
| 7 // Foundation NSRunLoop, and it can be used to implement higher-level event | 7 // Foundation NSRunLoop, and it can be used to implement higher-level event |
| 8 // loops such as the NSApplication event loop. | 8 // loops such as the NSApplication event loop. |
| 9 // | 9 // |
| 10 // This file introduces a basic CFRunLoop-based implementation of the | 10 // This file introduces a basic CFRunLoop-based implementation of the |
| 11 // MessagePump interface called CFRunLoopBase. CFRunLoopBase contains all | 11 // MessagePump interface called CFRunLoopBase. CFRunLoopBase contains all |
| 12 // of the machinery necessary to dispatch events to a delegate, but does not | 12 // of the machinery necessary to dispatch events to a delegate, but does not |
| 13 // implement the specific run loop. Concrete subclasses must provide their | 13 // implement the specific run loop. Concrete subclasses must provide their |
| 14 // own DoRun and Quit implementations. | 14 // own DoRun and Quit implementations. |
| 15 // | 15 // |
| 16 // A concrete subclass that just runs a CFRunLoop loop is provided in | 16 // A concrete subclass that just runs a CFRunLoop loop is provided in |
| 17 // MessagePumpCFRunLoop. For an NSRunLoop, the similar MessagePumpNSRunLoop | 17 // MessagePumpCFRunLoop. For an NSRunLoop, the similar MessagePumpNSRunLoop |
| 18 // is provided. | 18 // is provided. |
| 19 // | 19 // |
| 20 // For the application's event loop, an implementation based on AppKit's | 20 // For the application's event loop, an implementation based on AppKit's |
| 21 // NSApplication event system is provided in MessagePumpNSApplication. | 21 // NSApplication event system is provided in MessagePumpNSApplication. |
| 22 // | 22 // |
| 23 // Typically, MessagePumpNSApplication only makes sense on a Cocoa | 23 // Typically, MessagePumpNSApplication only makes sense on a Cocoa |
| 24 // application's main thread. If a CFRunLoop-based message pump is needed on | 24 // application's main thread. If a CFRunLoop-based message pump is needed on |
| 25 // any other thread, one of the other concrete subclasses is preferrable. | 25 // any other thread, one of the other concrete subclasses is preferable. |
| 26 // MessagePumpMac::Create is defined, which returns a new NSApplication-based | 26 // MessagePumpMac::Create is defined, which returns a new NSApplication-based |
| 27 // or NSRunLoop-based MessagePump subclass depending on which thread it is | 27 // or NSRunLoop-based MessagePump subclass depending on which thread it is |
| 28 // called on. | 28 // called on. |
| 29 | 29 |
| 30 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ | 30 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ |
| 31 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ | 31 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ |
| 32 | 32 |
| 33 #include "base/message_loop/message_pump.h" | 33 #include "base/message_loop/message_pump.h" |
| 34 | 34 |
| 35 #include "base/basictypes.h" | 35 #include "base/basictypes.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); | 344 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); |
| 345 }; | 345 }; |
| 346 | 346 |
| 347 // Tasks posted to the message loop are posted under this mode, as well | 347 // Tasks posted to the message loop are posted under this mode, as well |
| 348 // as kCFRunLoopCommonModes. | 348 // as kCFRunLoopCommonModes. |
| 349 extern const CFStringRef BASE_EXPORT kMessageLoopExclusiveRunLoopMode; | 349 extern const CFStringRef BASE_EXPORT kMessageLoopExclusiveRunLoopMode; |
| 350 | 350 |
| 351 } // namespace base | 351 } // namespace base |
| 352 | 352 |
| 353 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ | 353 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ |
| OLD | NEW |