[email protected] | 7f18b7c4 | 2012-02-24 09:13:09 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 2c69139 | 2013-04-25 20:47:18 | [diff] [blame] | 5 | // Weak pointers are pointers to an object that do not affect its lifetime, |
| 6 | // and which may be invalidated (i.e. reset to NULL) by the object, or its |
| 7 | // owner, at any time, most commonly when the object is about to be deleted. |
| 8 | |
| 9 | // Weak pointers are useful when an object needs to be accessed safely by one |
| 10 | // or more objects other than its owner, and those callers can cope with the |
| 11 | // object vanishing and e.g. tasks posted to it being silently dropped. |
| 12 | // Reference-counting such an object would complicate the ownership graph and |
| 13 | // make it harder to reason about the object's lifetime. |
| 14 | |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 15 | // EXAMPLE: |
| 16 | // |
[email protected] | 2c69139 | 2013-04-25 20:47:18 | [diff] [blame] | 17 | // class Controller { |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 18 | // public: |
[email protected] | 2c69139 | 2013-04-25 20:47:18 | [diff] [blame] | 19 | // void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); } |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 20 | // void WorkComplete(const Result& result) { ... } |
[email protected] | 2c69139 | 2013-04-25 20:47:18 | [diff] [blame] | 21 | // private: |
[email protected] | ed3f6734 | 2013-05-29 08:04:32 | [diff] [blame] | 22 | // // Member variables should appear before the WeakPtrFactory, to ensure |
| 23 | // // that any WeakPtrs to Controller are invalidated before its members |
| 24 | // // variable's destructors are executed, rendering them invalid. |
[email protected] | 2c69139 | 2013-04-25 20:47:18 | [diff] [blame] | 25 | // WeakPtrFactory<Controller> weak_factory_; |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 26 | // }; |
| 27 | // |
| 28 | // class Worker { |
| 29 | // public: |
| 30 | // static void StartNew(const WeakPtr<Controller>& controller) { |
| 31 | // Worker* worker = new Worker(controller); |
| 32 | // // Kick off asynchronous processing... |
| 33 | // } |
| 34 | // private: |
| 35 | // Worker(const WeakPtr<Controller>& controller) |
| 36 | // : controller_(controller) {} |
| 37 | // void DidCompleteAsynchronousProcessing(const Result& result) { |
| 38 | // if (controller_) |
| 39 | // controller_->WorkComplete(result); |
| 40 | // } |
| 41 | // WeakPtr<Controller> controller_; |
| 42 | // }; |
| 43 | // |
[email protected] | 2c69139 | 2013-04-25 20:47:18 | [diff] [blame] | 44 | // With this implementation a caller may use SpawnWorker() to dispatch multiple |
| 45 | // Workers and subsequently delete the Controller, without waiting for all |
| 46 | // Workers to have completed. |
| 47 | |
| 48 | // ------------------------- IMPORTANT: Thread-safety ------------------------- |
| 49 | |
[email protected] | ed3f6734 | 2013-05-29 08:04:32 | [diff] [blame] | 50 | // Weak pointers may be passed safely between threads, but must always be |
davidben | e58877e | 2014-10-22 18:37:11 | [diff] [blame^] | 51 | // dereferenced and invalidated on the same SequencedTaskRunner otherwise |
| 52 | // checking the pointer would be racey. |
[email protected] | ed3f6734 | 2013-05-29 08:04:32 | [diff] [blame] | 53 | // |
| 54 | // To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory |
| 55 | // is dereferenced, the factory and its WeakPtrs become bound to the calling |
davidben | e58877e | 2014-10-22 18:37:11 | [diff] [blame^] | 56 | // thread or current SequencedWorkerPool token, and cannot be dereferenced or |
| 57 | // invalidated on any other task runner. Bound WeakPtrs can still be handed |
| 58 | // off to other task runners, e.g. to use to post tasks back to object on the |
| 59 | // bound sequence. |
[email protected] | ed3f6734 | 2013-05-29 08:04:32 | [diff] [blame] | 60 | // |
davidben | e58877e | 2014-10-22 18:37:11 | [diff] [blame^] | 61 | // Invalidating the factory's WeakPtrs un-binds it from the sequence, allowing |
| 62 | // it to be passed for a different sequence to use or delete it. |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 63 | |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 64 | #ifndef BASE_MEMORY_WEAK_PTR_H_ |
| 65 | #define BASE_MEMORY_WEAK_PTR_H_ |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 66 | |
[email protected] | 4c44b844 | 2012-06-15 16:36:12 | [diff] [blame] | 67 | #include "base/basictypes.h" |
[email protected] | 0bea725 | 2011-08-05 15:34:00 | [diff] [blame] | 68 | #include "base/base_export.h" |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 69 | #include "base/logging.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 70 | #include "base/memory/ref_counted.h" |
[email protected] | d52426c | 2013-07-30 19:26:40 | [diff] [blame] | 71 | #include "base/sequence_checker.h" |
[email protected] | 4c44b844 | 2012-06-15 16:36:12 | [diff] [blame] | 72 | #include "base/template_util.h" |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 73 | |
| 74 | namespace base { |
| 75 | |
[email protected] | 4c44b844 | 2012-06-15 16:36:12 | [diff] [blame] | 76 | template <typename T> class SupportsWeakPtr; |
| 77 | template <typename T> class WeakPtr; |
| 78 | |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 79 | namespace internal { |
| 80 | // These classes are part of the WeakPtr implementation. |
| 81 | // DO NOT USE THESE CLASSES DIRECTLY YOURSELF. |
| 82 | |
[email protected] | 0bea725 | 2011-08-05 15:34:00 | [diff] [blame] | 83 | class BASE_EXPORT WeakReference { |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 84 | public: |
davidben | e58877e | 2014-10-22 18:37:11 | [diff] [blame^] | 85 | // Although Flag is bound to a specific SequencedTaskRunner, it may be |
| 86 | // deleted from another via base::WeakPtr::~WeakPtr(). |
[email protected] | a827a56 | 2014-06-11 00:37:42 | [diff] [blame] | 87 | class BASE_EXPORT Flag : public RefCountedThreadSafe<Flag> { |
[email protected] | d52e970 | 2009-09-17 00:31:09 | [diff] [blame] | 88 | public: |
[email protected] | 1edefc4 | 2011-08-26 17:32:29 | [diff] [blame] | 89 | Flag(); |
[email protected] | 59326aac | 2009-09-25 23:34:34 | [diff] [blame] | 90 | |
[email protected] | 6aacd8d | 2011-03-10 19:56:53 | [diff] [blame] | 91 | void Invalidate(); |
| 92 | bool IsValid() const; |
[email protected] | 59326aac | 2009-09-25 23:34:34 | [diff] [blame] | 93 | |
| 94 | private: |
[email protected] | 05b1cd61 | 2011-04-11 20:47:25 | [diff] [blame] | 95 | friend class base::RefCountedThreadSafe<Flag>; |
| 96 | |
| 97 | ~Flag(); |
| 98 | |
[email protected] | d52426c | 2013-07-30 19:26:40 | [diff] [blame] | 99 | SequenceChecker sequence_checker_; |
[email protected] | 1edefc4 | 2011-08-26 17:32:29 | [diff] [blame] | 100 | bool is_valid_; |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 101 | }; |
| 102 | |
[email protected] | 3a3d4747 | 2010-07-15 21:03:54 | [diff] [blame] | 103 | WeakReference(); |
[email protected] | 1edefc4 | 2011-08-26 17:32:29 | [diff] [blame] | 104 | explicit WeakReference(const Flag* flag); |
[email protected] | 20136647 | 2010-07-16 17:22:49 | [diff] [blame] | 105 | ~WeakReference(); |
[email protected] | 59326aac | 2009-09-25 23:34:34 | [diff] [blame] | 106 | |
[email protected] | 3a3d4747 | 2010-07-15 21:03:54 | [diff] [blame] | 107 | bool is_valid() const; |
[email protected] | 59326aac | 2009-09-25 23:34:34 | [diff] [blame] | 108 | |
| 109 | private: |
[email protected] | 1edefc4 | 2011-08-26 17:32:29 | [diff] [blame] | 110 | scoped_refptr<const Flag> flag_; |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 111 | }; |
| 112 | |
[email protected] | 0bea725 | 2011-08-05 15:34:00 | [diff] [blame] | 113 | class BASE_EXPORT WeakReferenceOwner { |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 114 | public: |
[email protected] | 3a3d4747 | 2010-07-15 21:03:54 | [diff] [blame] | 115 | WeakReferenceOwner(); |
| 116 | ~WeakReferenceOwner(); |
[email protected] | 59326aac | 2009-09-25 23:34:34 | [diff] [blame] | 117 | |
[email protected] | 3a3d4747 | 2010-07-15 21:03:54 | [diff] [blame] | 118 | WeakReference GetRef() const; |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 119 | |
[email protected] | 59326aac | 2009-09-25 23:34:34 | [diff] [blame] | 120 | bool HasRefs() const { |
[email protected] | 1edefc4 | 2011-08-26 17:32:29 | [diff] [blame] | 121 | return flag_.get() && !flag_->HasOneRef(); |
[email protected] | 59326aac | 2009-09-25 23:34:34 | [diff] [blame] | 122 | } |
| 123 | |
[email protected] | 3a3d4747 | 2010-07-15 21:03:54 | [diff] [blame] | 124 | void Invalidate(); |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 125 | |
| 126 | private: |
[email protected] | 1edefc4 | 2011-08-26 17:32:29 | [diff] [blame] | 127 | mutable scoped_refptr<WeakReference::Flag> flag_; |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 128 | }; |
| 129 | |
| 130 | // This class simplifies the implementation of WeakPtr's type conversion |
| 131 | // constructor by avoiding the need for a public accessor for ref_. A |
| 132 | // WeakPtr<T> cannot access the private members of WeakPtr<U>, so this |
| 133 | // base class gives us a way to access ref_ in a protected fashion. |
[email protected] | 0bea725 | 2011-08-05 15:34:00 | [diff] [blame] | 134 | class BASE_EXPORT WeakPtrBase { |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 135 | public: |
[email protected] | 3a3d4747 | 2010-07-15 21:03:54 | [diff] [blame] | 136 | WeakPtrBase(); |
[email protected] | 20136647 | 2010-07-16 17:22:49 | [diff] [blame] | 137 | ~WeakPtrBase(); |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 138 | |
| 139 | protected: |
[email protected] | 4c44b844 | 2012-06-15 16:36:12 | [diff] [blame] | 140 | explicit WeakPtrBase(const WeakReference& ref); |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 141 | |
| 142 | WeakReference ref_; |
| 143 | }; |
| 144 | |
[email protected] | 4c44b844 | 2012-06-15 16:36:12 | [diff] [blame] | 145 | // This class provides a common implementation of common functions that would |
| 146 | // otherwise get instantiated separately for each distinct instantiation of |
| 147 | // SupportsWeakPtr<>. |
| 148 | class SupportsWeakPtrBase { |
| 149 | public: |
| 150 | // A safe static downcast of a WeakPtr<Base> to WeakPtr<Derived>. This |
| 151 | // conversion will only compile if there is exists a Base which inherits |
| 152 | // from SupportsWeakPtr<Base>. See base::AsWeakPtr() below for a helper |
| 153 | // function that makes calling this easier. |
| 154 | template<typename Derived> |
| 155 | static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) { |
| 156 | typedef |
| 157 | is_convertible<Derived, internal::SupportsWeakPtrBase&> convertible; |
| 158 | COMPILE_ASSERT(convertible::value, |
| 159 | AsWeakPtr_argument_inherits_from_SupportsWeakPtr); |
| 160 | return AsWeakPtrImpl<Derived>(t, *t); |
| 161 | } |
| 162 | |
| 163 | private: |
| 164 | // This template function uses type inference to find a Base of Derived |
| 165 | // which is an instance of SupportsWeakPtr<Base>. We can then safely |
| 166 | // static_cast the Base* to a Derived*. |
| 167 | template <typename Derived, typename Base> |
| 168 | static WeakPtr<Derived> AsWeakPtrImpl( |
| 169 | Derived* t, const SupportsWeakPtr<Base>&) { |
| 170 | WeakPtr<Base> ptr = t->Base::AsWeakPtr(); |
| 171 | return WeakPtr<Derived>(ptr.ref_, static_cast<Derived*>(ptr.ptr_)); |
| 172 | } |
| 173 | }; |
| 174 | |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 175 | } // namespace internal |
| 176 | |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 177 | template <typename T> class WeakPtrFactory; |
| 178 | |
| 179 | // The WeakPtr class holds a weak reference to |T*|. |
| 180 | // |
| 181 | // This class is designed to be used like a normal pointer. You should always |
| 182 | // null-test an object of this class before using it or invoking a method that |
| 183 | // may result in the underlying object being destroyed. |
| 184 | // |
| 185 | // EXAMPLE: |
| 186 | // |
| 187 | // class Foo { ... }; |
| 188 | // WeakPtr<Foo> foo; |
| 189 | // if (foo) |
| 190 | // foo->method(); |
| 191 | // |
| 192 | template <typename T> |
| 193 | class WeakPtr : public internal::WeakPtrBase { |
| 194 | public: |
| 195 | WeakPtr() : ptr_(NULL) { |
| 196 | } |
| 197 | |
[email protected] | c33acdb | 2013-03-02 02:31:45 | [diff] [blame] | 198 | // Allow conversion from U to T provided U "is a" T. Note that this |
| 199 | // is separate from the (implicit) copy constructor. |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 200 | template <typename U> |
[email protected] | c33acdb | 2013-03-02 02:31:45 | [diff] [blame] | 201 | WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other), ptr_(other.ptr_) { |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | T* get() const { return ref_.is_valid() ? ptr_ : NULL; } |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 205 | |
[email protected] | f1836f4 | 2012-02-29 06:59:03 | [diff] [blame] | 206 | T& operator*() const { |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 207 | DCHECK(get() != NULL); |
[email protected] | f1836f4 | 2012-02-29 06:59:03 | [diff] [blame] | 208 | return *get(); |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 209 | } |
| 210 | T* operator->() const { |
| 211 | DCHECK(get() != NULL); |
| 212 | return get(); |
| 213 | } |
| 214 | |
[email protected] | 380b139 | 2013-06-06 05:32:37 | [diff] [blame] | 215 | // Allow WeakPtr<element_type> to be used in boolean expressions, but not |
| 216 | // implicitly convertible to a real bool (which is dangerous). |
| 217 | // |
| 218 | // Note that this trick is only safe when the == and != operators |
| 219 | // are declared explicitly, as otherwise "weak_ptr1 == weak_ptr2" |
| 220 | // will compile but do the wrong thing (i.e., convert to Testable |
| 221 | // and then do the comparison). |
| 222 | private: |
| 223 | typedef T* WeakPtr::*Testable; |
| 224 | |
| 225 | public: |
| 226 | operator Testable() const { return get() ? &WeakPtr::ptr_ : NULL; } |
| 227 | |
[email protected] | f103ab7 | 2009-09-02 17:10:59 | [diff] [blame] | 228 | void reset() { |
| 229 | ref_ = internal::WeakReference(); |
| 230 | ptr_ = NULL; |
| 231 | } |
| 232 | |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 233 | private: |
[email protected] | 380b139 | 2013-06-06 05:32:37 | [diff] [blame] | 234 | // Explicitly declare comparison operators as required by the bool |
| 235 | // trick, but keep them private. |
| 236 | template <class U> bool operator==(WeakPtr<U> const&) const; |
| 237 | template <class U> bool operator!=(WeakPtr<U> const&) const; |
| 238 | |
[email protected] | 4c44b844 | 2012-06-15 16:36:12 | [diff] [blame] | 239 | friend class internal::SupportsWeakPtrBase; |
[email protected] | c33acdb | 2013-03-02 02:31:45 | [diff] [blame] | 240 | template <typename U> friend class WeakPtr; |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 241 | friend class SupportsWeakPtr<T>; |
| 242 | friend class WeakPtrFactory<T>; |
| 243 | |
| 244 | WeakPtr(const internal::WeakReference& ref, T* ptr) |
[email protected] | 5d6688f | 2012-07-11 21:39:03 | [diff] [blame] | 245 | : WeakPtrBase(ref), |
| 246 | ptr_(ptr) { |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | // This pointer is only valid when ref_.is_valid() is true. Otherwise, its |
| 250 | // value is undefined (as opposed to NULL). |
| 251 | T* ptr_; |
| 252 | }; |
| 253 | |
[email protected] | 2c69139 | 2013-04-25 20:47:18 | [diff] [blame] | 254 | // A class may be composed of a WeakPtrFactory and thereby |
| 255 | // control how it exposes weak pointers to itself. This is helpful if you only |
| 256 | // need weak pointers within the implementation of a class. This class is also |
| 257 | // useful when working with primitive types. For example, you could have a |
| 258 | // WeakPtrFactory<bool> that is used to pass around a weak reference to a bool. |
| 259 | template <class T> |
| 260 | class WeakPtrFactory { |
| 261 | public: |
| 262 | explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { |
| 263 | } |
| 264 | |
| 265 | ~WeakPtrFactory() { |
| 266 | ptr_ = NULL; |
| 267 | } |
| 268 | |
| 269 | WeakPtr<T> GetWeakPtr() { |
| 270 | DCHECK(ptr_); |
| 271 | return WeakPtr<T>(weak_reference_owner_.GetRef(), ptr_); |
| 272 | } |
| 273 | |
| 274 | // Call this method to invalidate all existing weak pointers. |
| 275 | void InvalidateWeakPtrs() { |
| 276 | DCHECK(ptr_); |
| 277 | weak_reference_owner_.Invalidate(); |
| 278 | } |
| 279 | |
| 280 | // Call this method to determine if any weak pointers exist. |
| 281 | bool HasWeakPtrs() const { |
| 282 | DCHECK(ptr_); |
| 283 | return weak_reference_owner_.HasRefs(); |
| 284 | } |
| 285 | |
[email protected] | 2c69139 | 2013-04-25 20:47:18 | [diff] [blame] | 286 | private: |
| 287 | internal::WeakReferenceOwner weak_reference_owner_; |
| 288 | T* ptr_; |
| 289 | DISALLOW_IMPLICIT_CONSTRUCTORS(WeakPtrFactory); |
| 290 | }; |
| 291 | |
| 292 | // A class may extend from SupportsWeakPtr to let others take weak pointers to |
| 293 | // it. This avoids the class itself implementing boilerplate to dispense weak |
| 294 | // pointers. However, since SupportsWeakPtr's destructor won't invalidate |
| 295 | // weak pointers to the class until after the derived class' members have been |
| 296 | // destroyed, its use can lead to subtle use-after-destroy issues. |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 297 | template <class T> |
[email protected] | 4c44b844 | 2012-06-15 16:36:12 | [diff] [blame] | 298 | class SupportsWeakPtr : public internal::SupportsWeakPtrBase { |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 299 | public: |
| 300 | SupportsWeakPtr() {} |
| 301 | |
| 302 | WeakPtr<T> AsWeakPtr() { |
| 303 | return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(this)); |
| 304 | } |
| 305 | |
[email protected] | cb93248 | 2012-06-26 06:23:00 | [diff] [blame] | 306 | protected: |
| 307 | ~SupportsWeakPtr() {} |
| 308 | |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 309 | private: |
| 310 | internal::WeakReferenceOwner weak_reference_owner_; |
| 311 | DISALLOW_COPY_AND_ASSIGN(SupportsWeakPtr); |
| 312 | }; |
| 313 | |
[email protected] | 4c44b844 | 2012-06-15 16:36:12 | [diff] [blame] | 314 | // Helper function that uses type deduction to safely return a WeakPtr<Derived> |
| 315 | // when Derived doesn't directly extend SupportsWeakPtr<Derived>, instead it |
| 316 | // extends a Base that extends SupportsWeakPtr<Base>. |
| 317 | // |
| 318 | // EXAMPLE: |
| 319 | // class Base : public base::SupportsWeakPtr<Producer> {}; |
| 320 | // class Derived : public Base {}; |
| 321 | // |
| 322 | // Derived derived; |
| 323 | // base::WeakPtr<Derived> ptr = base::AsWeakPtr(&derived); |
| 324 | // |
| 325 | // Note that the following doesn't work (invalid type conversion) since |
| 326 | // Derived::AsWeakPtr() is WeakPtr<Base> SupportsWeakPtr<Base>::AsWeakPtr(), |
| 327 | // and there's no way to safely cast WeakPtr<Base> to WeakPtr<Derived> at |
| 328 | // the caller. |
| 329 | // |
| 330 | // base::WeakPtr<Derived> ptr = derived.AsWeakPtr(); // Fails. |
| 331 | |
| 332 | template <typename Derived> |
| 333 | WeakPtr<Derived> AsWeakPtr(Derived* t) { |
| 334 | return internal::SupportsWeakPtrBase::StaticAsWeakPtr<Derived>(t); |
| 335 | } |
| 336 | |
[email protected] | 3125d646 | 2009-09-01 20:50:17 | [diff] [blame] | 337 | } // namespace base |
| 338 | |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 339 | #endif // BASE_MEMORY_WEAK_PTR_H_ |