| 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // any other thread, one of the other concrete subclasses is preferable. | 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" | |
| 36 | 35 |
| 37 #include <CoreFoundation/CoreFoundation.h> | 36 #include <CoreFoundation/CoreFoundation.h> |
| 38 | 37 |
| 38 #include "base/macros.h" |
| 39 #include "base/memory/weak_ptr.h" | 39 #include "base/memory/weak_ptr.h" |
| 40 #include "base/message_loop/timer_slack.h" | 40 #include "base/message_loop/timer_slack.h" |
| 41 #include "build/build_config.h" |
| 41 | 42 |
| 42 #if defined(__OBJC__) | 43 #if defined(__OBJC__) |
| 43 #if defined(OS_IOS) | 44 #if defined(OS_IOS) |
| 44 #import <Foundation/Foundation.h> | 45 #import <Foundation/Foundation.h> |
| 45 #else | 46 #else |
| 46 #import <AppKit/AppKit.h> | 47 #import <AppKit/AppKit.h> |
| 47 | 48 |
| 48 // Clients must subclass NSApplication and implement this protocol if they use | 49 // Clients must subclass NSApplication and implement this protocol if they use |
| 49 // MessagePumpMac. | 50 // MessagePumpMac. |
| 50 @protocol CrAppProtocol | 51 @protocol CrAppProtocol |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); | 345 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); |
| 345 }; | 346 }; |
| 346 | 347 |
| 347 // Tasks posted to the message loop are posted under this mode, as well | 348 // Tasks posted to the message loop are posted under this mode, as well |
| 348 // as kCFRunLoopCommonModes. | 349 // as kCFRunLoopCommonModes. |
| 349 extern const CFStringRef BASE_EXPORT kMessageLoopExclusiveRunLoopMode; | 350 extern const CFStringRef BASE_EXPORT kMessageLoopExclusiveRunLoopMode; |
| 350 | 351 |
| 351 } // namespace base | 352 } // namespace base |
| 352 | 353 |
| 353 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ | 354 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_ |
| OLD | NEW |