From 673730130ec6935b364955ebdade5407a0dd7bea Mon Sep 17 00:00:00 2001 From: "dmaclach@chromium.org" Date: Thu, 5 Nov 2009 22:10:21 +0000 Subject: Added missing file to fix build. TEST=none BUG=none Review URL: http://codereview.chromium.org/371002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31141 0039d316-1c4b-4281-b951-d872f2087c98 --- base/message_pump_mac.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'base') diff --git a/base/message_pump_mac.h b/base/message_pump_mac.h index 3d06c17..3234000 100644 --- a/base/message_pump_mac.h +++ b/base/message_pump_mac.h @@ -35,11 +35,19 @@ #include #include +#if defined(__OBJC__) +@class NSAutoreleasePool; +#else // defined(__OBJC__) +class NSAutoreleasePool; +#endif // defined(__OBJC__) + namespace base { class Time; class MessagePumpCFRunLoopBase : public MessagePump { + // Needs access to CreateAutoreleasePool. + friend class MessagePumpScopedAutoreleasePool; public: MessagePumpCFRunLoopBase(); virtual ~MessagePumpCFRunLoopBase(); @@ -60,6 +68,12 @@ class MessagePumpCFRunLoopBase : public MessagePump { int nesting_level() const { return nesting_level_; } int run_nesting_level() const { return run_nesting_level_; } + // Return an autorelease pool to wrap around any work being performed. + // 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(); + private: // Timer callback scheduled by ScheduleDelayedWork. This does not do any // work, but it signals delayed_work_source_ so that delayed work can be @@ -229,6 +243,10 @@ class MessagePumpNSApplication : public MessagePumpCFRunLoopBase { virtual void DoRun(Delegate* delegate); virtual void Quit(); + protected: + // Returns nil if NSApp is currently in the middle of calling -sendEvent. + virtual NSAutoreleasePool* CreateAutoreleasePool(); + private: // False after Quit is called. bool keep_running_; -- cgit v1.1