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

Side by Side Diff: base/mac/scoped_nsobject.h

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « base/mac/memory_pressure_monitor_mac_unittest.cc ('k') | base/mac/sdk_forward_declarations.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef BASE_MAC_SCOPED_NSOBJECT_H_ 5 #ifndef BASE_MAC_SCOPED_NSOBJECT_H_
6 #define BASE_MAC_SCOPED_NSOBJECT_H_ 6 #define BASE_MAC_SCOPED_NSOBJECT_H_
7 7
8 #import <Foundation/Foundation.h> 8 // Include NSObject.h directly because Foundation.h pulls in many dependencies.
9 // (Approx 100k lines of code versus 1.5k for NSObject.h). scoped_nsobject gets
10 // singled out because it is most typically included from other header files.
11 #import <Foundation/NSObject.h>
12
9 #include "base/basictypes.h" 13 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
11 15
16 @class NSAutoreleasePool;
17
12 namespace base { 18 namespace base {
13 19
14 // scoped_nsobject<> is patterned after scoped_ptr<>, but maintains ownership 20 // scoped_nsobject<> is patterned after scoped_ptr<>, but maintains ownership
15 // of an NSObject subclass object. Style deviations here are solely for 21 // of an NSObject subclass object. Style deviations here are solely for
16 // compatibility with scoped_ptr<>'s interface, with which everyone is already 22 // compatibility with scoped_ptr<>'s interface, with which everyone is already
17 // familiar. 23 // familiar.
18 // 24 //
19 // scoped_nsobject<> takes ownership of an object (in the constructor or in 25 // scoped_nsobject<> takes ownership of an object (in the constructor or in
20 // reset()) by taking over the caller's existing ownership claim. The caller 26 // reset()) by taking over the caller's existing ownership claim. The caller
21 // must own the object it gives to scoped_nsobject<>, and relinquishes an 27 // must own the object it gives to scoped_nsobject<>, and relinquishes an
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 template<> 168 template<>
163 class scoped_nsobject<NSAutoreleasePool> { 169 class scoped_nsobject<NSAutoreleasePool> {
164 private: 170 private:
165 explicit scoped_nsobject(NSAutoreleasePool* object = nil); 171 explicit scoped_nsobject(NSAutoreleasePool* object = nil);
166 DISALLOW_COPY_AND_ASSIGN(scoped_nsobject); 172 DISALLOW_COPY_AND_ASSIGN(scoped_nsobject);
167 }; 173 };
168 174
169 } // namespace base 175 } // namespace base
170 176
171 #endif // BASE_MAC_SCOPED_NSOBJECT_H_ 177 #endif // BASE_MAC_SCOPED_NSOBJECT_H_
OLDNEW
« no previous file with comments | « base/mac/memory_pressure_monitor_mac_unittest.cc ('k') | base/mac/sdk_forward_declarations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698