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

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

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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/scoped_authorizationref.h ('k') | base/mac/scoped_launch_data.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_CFTYPEREF_H_ 5 #ifndef BASE_MAC_SCOPED_CFTYPEREF_H_
6 #define BASE_MAC_SCOPED_CFTYPEREF_H_ 6 #define BASE_MAC_SCOPED_CFTYPEREF_H_
7 7
8 #include <CoreFoundation/CoreFoundation.h> 8 #include <CoreFoundation/CoreFoundation.h>
9 9
10 #include "base/mac/scoped_typeref.h" 10 #include "base/mac/scoped_typeref.h"
11 11
12 namespace base { 12 namespace base {
13 13
14 // ScopedCFTypeRef<> is patterned after scoped_ptr<>, but maintains ownership 14 // ScopedCFTypeRef<> is patterned after std::unique_ptr<>, but maintains
15 // of a CoreFoundation object: any object that can be represented as a 15 // ownership of a CoreFoundation object: any object that can be represented
16 // CFTypeRef. Style deviations here are solely for compatibility with 16 // as a CFTypeRef. Style deviations here are solely for compatibility with
17 // scoped_ptr<>'s interface, with which everyone is already familiar. 17 // std::unique_ptr<>'s interface, with which everyone is already familiar.
18 // 18 //
19 // By default, ScopedCFTypeRef<> takes ownership of an object (in the 19 // By default, ScopedCFTypeRef<> takes ownership of an object (in the
20 // constructor or in reset()) by taking over the caller's existing ownership 20 // constructor or in reset()) by taking over the caller's existing ownership
21 // claim. The caller must own the object it gives to ScopedCFTypeRef<>, and 21 // claim. The caller must own the object it gives to ScopedCFTypeRef<>, and
22 // relinquishes an ownership claim to that object. ScopedCFTypeRef<> does not 22 // relinquishes an ownership claim to that object. ScopedCFTypeRef<> does not
23 // call CFRetain(). This behavior is parameterized by the |OwnershipPolicy| 23 // call CFRetain(). This behavior is parameterized by the |OwnershipPolicy|
24 // enum. If the value |RETAIN| is passed (in the constructor or in reset()), 24 // enum. If the value |RETAIN| is passed (in the constructor or in reset()),
25 // then ScopedCFTypeRef<> will call CFRetain() on the object, and the initial 25 // then ScopedCFTypeRef<> will call CFRetain() on the object, and the initial
26 // ownership is not changed. 26 // ownership is not changed.
27 27
(...skipping 13 matching lines...) Expand all
41 41
42 } // namespace internal 42 } // namespace internal
43 43
44 template<typename CFT> 44 template<typename CFT>
45 using ScopedCFTypeRef = 45 using ScopedCFTypeRef =
46 ScopedTypeRef<CFT, internal::ScopedCFTypeRefTraits<CFT>>; 46 ScopedTypeRef<CFT, internal::ScopedCFTypeRefTraits<CFT>>;
47 47
48 } // namespace base 48 } // namespace base
49 49
50 #endif // BASE_MAC_SCOPED_CFTYPEREF_H_ 50 #endif // BASE_MAC_SCOPED_CFTYPEREF_H_
OLDNEW
« no previous file with comments | « base/mac/scoped_authorizationref.h ('k') | base/mac/scoped_launch_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698