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

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

Issue 1855483004: [iOS/OS X] Allow base::scoped_nsobject<> to be used when ARC is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes to build/config/compiler/BUILD.gn 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
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_BIND_OBJC_BLOCK_H_ 5 #ifndef BASE_MAC_BIND_OBJC_BLOCK_H_
6 #define BASE_MAC_BIND_OBJC_BLOCK_H_ 6 #define BASE_MAC_BIND_OBJC_BLOCK_H_
7 7
8 #include <Block.h> 8 #include <Block.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 28 matching lines...) Expand all
39 return extracted_block(args...); 39 return extracted_block(args...);
40 } 40 }
41 41
42 } // namespace internal 42 } // namespace internal
43 43
44 // Construct a callback from an objective-C block with up to six arguments (see 44 // Construct a callback from an objective-C block with up to six arguments (see
45 // note above). 45 // note above).
46 template<typename R, typename... Args> 46 template<typename R, typename... Args>
47 base::Callback<R(Args...)> BindBlock(R(^block)(Args...)) { 47 base::Callback<R(Args...)> BindBlock(R(^block)(Args...)) {
48 return base::Bind(&base::internal::RunBlock<R, Args...>, 48 return base::Bind(&base::internal::RunBlock<R, Args...>,
49 base::mac::ScopedBlock<R(^)(Args...)>(Block_copy(block))); 49 base::mac::ScopedBlock<R (^)(Args...)>(
50 base::mac::internal::ScopedBlockTraitsRetain(block)));
50 } 51 }
51 52
52 } // namespace base 53 } // namespace base
53 54
54 #endif // BASE_MAC_BIND_OBJC_BLOCK_H_ 55 #endif // BASE_MAC_BIND_OBJC_BLOCK_H_
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/mac/scoped_block.h » ('j') | base/mac/scoped_block.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698