OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/ios/crb_protocol_observers.h" | 5 #import "base/ios/crb_protocol_observers.h" |
6 | 6 |
7 #include <objc/runtime.h> | 7 #include <objc/runtime.h> |
| 8 #include <stddef.h> |
8 #include <algorithm> | 9 #include <algorithm> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
13 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
14 | 15 |
15 @interface CRBProtocolObservers () { | 16 @interface CRBProtocolObservers () { |
16 base::scoped_nsobject<Protocol> _protocol; | 17 base::scoped_nsobject<Protocol> _protocol; |
17 // ivars declared here are private to the implementation but must be | 18 // ivars declared here are private to the implementation but must be |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 182 |
182 #pragma mark - Private | 183 #pragma mark - Private |
183 | 184 |
184 - (void)compact { | 185 - (void)compact { |
185 DCHECK(!_invocationDepth); | 186 DCHECK(!_invocationDepth); |
186 _observers.erase(std::remove(_observers.begin(), _observers.end(), nil), | 187 _observers.erase(std::remove(_observers.begin(), _observers.end(), nil), |
187 _observers.end()); | 188 _observers.end()); |
188 } | 189 } |
189 | 190 |
190 @end | 191 @end |
OLD | NEW |