OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #import "base/mac/bind_objc_block.h" | |
6 | |
7 #include "base/bind.h" | |
8 #include "base/memory/scoped_nsobject.h" | |
9 | |
10 namespace { | |
Mark Mentovai
2012/07/25 14:06:30
Blank line after this one, and another blank line
noyau (Ping after 24h)
2012/07/25 14:27:58
Done. I would point out however that the extra lin
| |
11 // Run the block contained in the parameter. | |
12 void RunBlock(scoped_nsobject<id> block) { | |
Mark Mentovai
2012/07/25 14:06:30
If RunBlock is never called, block is never freed.
noyau (Ping after 24h)
2012/07/25 14:27:58
I am not sure I follow. The block is retained by t
| |
13 void(^extracted_block)() = block.get(); | |
14 extracted_block(); | |
15 } | |
16 } // namespace | |
Mark Mentovai
2012/07/25 14:06:30
Blank line before this one.
noyau (Ping after 24h)
2012/07/25 14:27:58
Done.
| |
17 | |
18 namespace base { | |
19 | |
20 base::Closure BindBlock(void(^block)()) { | |
21 return base::Bind(&RunBlock, scoped_nsobject<id>([block copy])); | |
22 } | |
23 | |
24 } // namespace base | |
OLD | NEW |