diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 22:10:21 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 22:10:21 +0000 |
commit | 673730130ec6935b364955ebdade5407a0dd7bea (patch) | |
tree | a41cfa10498f8c334cfaeec065395e8506b79dec /base | |
parent | 0573473017cc091aae847b5b37cd3991c8d9801b (diff) | |
download | chromium_src-673730130ec6935b364955ebdade5407a0dd7bea.zip chromium_src-673730130ec6935b364955ebdade5407a0dd7bea.tar.gz chromium_src-673730130ec6935b364955ebdade5407a0dd7bea.tar.bz2 |
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
Diffstat (limited to 'base')
-rw-r--r-- | base/message_pump_mac.h | 18 |
1 files changed, 18 insertions, 0 deletions
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 <CoreFoundation/CoreFoundation.h> #include <IOKit/IOKitLib.h> +#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_; |