Index: base/message_loop/message_pump_mac.h |
diff --git a/base/message_loop/message_pump_mac.h b/base/message_loop/message_pump_mac.h |
index 424cb70938d058a90288ceb5314bf73c8ae3200c..47095fe8f50c10898adb3cefa4d76ae508147f6b 100644 |
--- a/base/message_loop/message_pump_mac.h |
+++ b/base/message_loop/message_pump_mac.h |
@@ -38,9 +38,7 @@ |
#include "base/memory/weak_ptr.h" |
-#if !defined(__OBJC__) |
-class NSAutoreleasePool; |
-#else // !defined(__OBJC__) |
+#if defined(__OBJC__) |
#if defined(OS_IOS) |
#import <Foundation/Foundation.h> |
#else |
@@ -55,7 +53,7 @@ class NSAutoreleasePool; |
- (BOOL)isHandlingSendEvent; |
@end |
#endif // !defined(OS_IOS) |
-#endif // !defined(__OBJC__) |
+#endif // defined(__OBJC__) |
namespace base { |
@@ -63,6 +61,12 @@ class MessagePumpInstrumentation; |
class RunLoop; |
class TimeTicks; |
+#if !defined(__OBJC__) || __has_feature(objc_arc) |
+class AutoreleasePool; |
Mark Mentovai
2014/04/28 21:12:12
Call this AutoreleasePoolType so that it doesn’t l
|
+#else // !defined(__OBJC__) || __has_feature(objc_arc) |
+typedef NSAutoreleasePool AutoreleasePool; |
+#endif // !defined(__OBJC__) || __has_feature(objc_arc) |
+ |
class MessagePumpCFRunLoopBase : public MessagePump { |
// Needs access to CreateAutoreleasePool. |
friend class MessagePumpScopedAutoreleasePool; |
@@ -94,7 +98,7 @@ class MessagePumpCFRunLoopBase : public MessagePump { |
// In some cases, CreateAutoreleasePool may return nil intentionally to |
// preventing an autorelease pool from being created, allowing any |
// objects autoreleased by work to fall into the current autorelease pool. |
- virtual NSAutoreleasePool* CreateAutoreleasePool(); |
+ virtual AutoreleasePool* CreateAutoreleasePool(); |
// Enables instrumentation of the MessagePump. See MessagePumpInstrumentation |
// in the implementation for details. |
@@ -296,7 +300,7 @@ class MessagePumpCrApplication : public MessagePumpNSApplication { |
protected: |
// Returns nil if NSApp is currently in the middle of calling |
// -sendEvent. Requires NSApp implementing CrAppProtocol. |
- virtual NSAutoreleasePool* CreateAutoreleasePool() OVERRIDE; |
+ virtual AutoreleasePool* CreateAutoreleasePool() OVERRIDE; |
private: |
DISALLOW_COPY_AND_ASSIGN(MessagePumpCrApplication); |