OLD | NEW |
---|---|
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 #ifndef BASE_MESSAGE_PUMP_MAC_H_ | 30 #ifndef BASE_MESSAGE_PUMP_MAC_H_ |
31 #define BASE_MESSAGE_PUMP_MAC_H_ | 31 #define BASE_MESSAGE_PUMP_MAC_H_ |
32 #pragma once | 32 #pragma once |
33 | 33 |
34 #include "base/message_pump.h" | 34 #include "base/message_pump.h" |
35 | 35 |
36 #include <CoreFoundation/CoreFoundation.h> | 36 #include <CoreFoundation/CoreFoundation.h> |
37 #include <IOKit/IOKitLib.h> | 37 #include <IOKit/IOKitLib.h> |
38 | 38 |
39 #if defined(__OBJC__) | 39 #if !defined(__OBJC__) |
40 @class NSAutoreleasePool; | |
41 #else // defined(__OBJC__) | |
42 class NSAutoreleasePool; | 40 class NSAutoreleasePool; |
43 #endif // defined(__OBJC__) | 41 #else // !defined(__OBJC__) |
42 #import <AppKit/AppKit.h> | |
43 | |
44 class NSAutoreleasePool; | |
Mark Mentovai
2010/12/17 17:31:38
Since you just #imported AppKit.h, this is unneces
Nico
2010/12/18 01:14:28
Removed.
| |
45 // Clients must subclass NSApplication and implement this protocol if they use | |
46 // MessagePumpMac. | |
47 @protocol CrAppProtocol | |
48 // Must return true if -[NSApplication sendEvent:] is currently on the stack. | |
49 // See the comment for |CreateAutoreleasePool()| in the cc file for why this is | |
50 // necessary. | |
51 - (BOOL)isHandlingSendEvent; | |
52 @end | |
53 #endif // !defined(__OBJC__) | |
44 | 54 |
45 namespace base { | 55 namespace base { |
46 | 56 |
47 class TimeTicks; | 57 class TimeTicks; |
48 | 58 |
49 class MessagePumpCFRunLoopBase : public MessagePump { | 59 class MessagePumpCFRunLoopBase : public MessagePump { |
50 // Needs access to CreateAutoreleasePool. | 60 // Needs access to CreateAutoreleasePool. |
51 friend class MessagePumpScopedAutoreleasePool; | 61 friend class MessagePumpScopedAutoreleasePool; |
52 public: | 62 public: |
53 MessagePumpCFRunLoopBase(); | 63 MessagePumpCFRunLoopBase(); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 // thread. Otherwise, returns a new instance of MessagePumpNSRunLoop. | 277 // thread. Otherwise, returns a new instance of MessagePumpNSRunLoop. |
268 static MessagePump* Create(); | 278 static MessagePump* Create(); |
269 | 279 |
270 private: | 280 private: |
271 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); | 281 DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac); |
272 }; | 282 }; |
273 | 283 |
274 } // namespace base | 284 } // namespace base |
275 | 285 |
276 #endif // BASE_MESSAGE_PUMP_MAC_H_ | 286 #endif // BASE_MESSAGE_PUMP_MAC_H_ |
OLD | NEW |