OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "ios/chrome/app/deferred_initialization_runner.h" | 5 #import "ios/chrome/app/deferred_initialization_runner.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
9 | 11 |
10 // An object encapsulating the deferred execution of a block of initialization | 12 // An object encapsulating the deferred execution of a block of initialization |
11 // code. | 13 // code. |
12 @interface DeferredInitializationBlock : NSObject { | 14 @interface DeferredInitializationBlock : NSObject { |
13 // A string to reference the initialization block. | 15 // A string to reference the initialization block. |
14 base::scoped_nsobject<NSString> _name; | 16 base::scoped_nsobject<NSString> _name; |
15 // A block of code to execute. | 17 // A block of code to execute. |
16 base::scoped_nsprotocol<ProceduralBlock> _runBlock; | 18 base::scoped_nsprotocol<ProceduralBlock> _runBlock; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 DCHECK(name); | 113 DCHECK(name); |
112 [[_runBlocks objectForKey:name] cancel]; | 114 [[_runBlocks objectForKey:name] cancel]; |
113 [_runBlocks removeObjectForKey:name]; | 115 [_runBlocks removeObjectForKey:name]; |
114 } | 116 } |
115 | 117 |
116 - (NSUInteger)numberOfBlocksRemaining { | 118 - (NSUInteger)numberOfBlocksRemaining { |
117 return [_runBlocks count]; | 119 return [_runBlocks count]; |
118 } | 120 } |
119 | 121 |
120 @end | 122 @end |
OLD | NEW |