OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_IOS_WEAK_NSOBJECT_H_ | 5 #ifndef BASE_IOS_WEAK_NSOBJECT_H_ |
6 #define BASE_IOS_WEAK_NSOBJECT_H_ | 6 #define BASE_IOS_WEAK_NSOBJECT_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 #import <objc/runtime.h> | 9 #import <objc/runtime.h> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/threading/non_thread_safe.h" | |
15 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
16 | 15 |
17 // WeakNSObject<> is patterned after scoped_nsobject<>, but instead of | 16 // WeakNSObject<> is patterned after scoped_nsobject<>, but instead of |
18 // maintaining ownership of an NSObject subclass object, it will nil itself out | 17 // maintaining ownership of an NSObject subclass object, it will nil itself out |
19 // when the object is deallocated. | 18 // when the object is deallocated. |
20 // | 19 // |
21 // WeakNSProtocol<> has the same behavior as WeakNSObject, but can be used | 20 // WeakNSProtocol<> has the same behavior as WeakNSObject, but can be used |
22 // with protocols. | 21 // with protocols. |
23 // | 22 // |
24 // Example usage (base::WeakNSObject<T>): | 23 // Example usage (base::WeakNSObject<T>): |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 178 |
180 WeakNSObject& operator=(const WeakNSObject<id>& that) { | 179 WeakNSObject& operator=(const WeakNSObject<id>& that) { |
181 WeakNSProtocol<id>::operator=(that); | 180 WeakNSProtocol<id>::operator=(that); |
182 return *this; | 181 return *this; |
183 } | 182 } |
184 }; | 183 }; |
185 | 184 |
186 } // namespace base | 185 } // namespace base |
187 | 186 |
188 #endif // BASE_IOS_WEAK_NSOBJECT_H_ | 187 #endif // BASE_IOS_WEAK_NSOBJECT_H_ |
OLD | NEW |