Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: base/scoped_nsautorelease_pool.h

Issue 3805: autorelease message pumps (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/platform_test_mac.mm ('k') | base/scoped_nsautorelease_pool.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_SCOPED_NSAUTORELEASE_POOL_H_
6 #define BASE_SCOPED_NSAUTORELEASE_POOL_H_
7
8 #include "base/basictypes.h"
9
10 #if defined(OS_MACOSX)
11 #if defined(__OBJC__)
12 @class NSAutoreleasePool;
13 #else // __OBJC__
14 class NSAutoreleasePool;
15 #endif // __OBJC__
16 #endif // OS_MACOSX
17
18 namespace base {
19
20 // On the Mac, ScopedNSAutoreleasePool allocates an NSAutoreleasePool when
21 // instantiated and sends it a -drain message when destroyed. This allows an
22 // autorelease pool to be maintained in ordinary C++ code without bringing in
23 // any direct Objective-C dependency.
24 //
25 // On other platforms, ScopedNSAutoreleasePool is an empty object with no
26 // effects. This allows it to be used directly in cross-platform code without
27 // ugly #ifdefs.
28 class ScopedNSAutoreleasePool {
29 #if defined(OS_MACOSX)
30 public:
31 ScopedNSAutoreleasePool();
32 ~ScopedNSAutoreleasePool();
33
34 private:
35 NSAutoreleasePool* autorelease_pool_;
36 #endif // OS_MACOSX
37
38 private:
39 DISALLOW_COPY_AND_ASSIGN(ScopedNSAutoreleasePool);
40 };
41
42 } // namespace base
43
44 #endif // BASE_SCOPED_NSAUTORELEASE_POOL_H_
OLDNEW
« no previous file with comments | « base/platform_test_mac.mm ('k') | base/scoped_nsautorelease_pool.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698