Home | History | Annotate | Download | only in memory

Lines Matching refs:WeakPtr

31 //    static void StartNew(const WeakPtr<Controller>& controller) {
36 // Worker(const WeakPtr<Controller>& controller)
42 // WeakPtr<Controller> controller_;
55 // To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory
62 // If all WeakPtr objects are destroyed or invalidated then the factory is
64 // destroyed, or new WeakPtr objects may be used, from a different sequence.
66 // Thus, at least one WeakPtr object must exist and have been dereferenced on
67 // the correct thread to enforce that other WeakPtr objects will enforce they
83 template <typename T> class WeakPtr;
86 // These classes are part of the WeakPtr implementation.
92 // deleted from another via base::WeakPtr::~WeakPtr().
136 // This class simplifies the implementation of WeakPtr's type conversion
138 // WeakPtr<T> cannot access the private members of WeakPtr<U>, so this
156 // A safe static downcast of a WeakPtr<Base> to WeakPtr<Derived>. This
161 static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
174 static WeakPtr<Derived> AsWeakPtrImpl(
176 WeakPtr<Base> ptr = t->Base::AsWeakPtr();
177 return WeakPtr<Derived>(ptr.ref_, static_cast<Derived*>(ptr.ptr_));
185 // The WeakPtr class holds a weak reference to |T*|.
194 // WeakPtr<Foo> foo;
199 class WeakPtr : public internal::WeakPtrBase {
201 WeakPtr() : ptr_(NULL) {
207 WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other), ptr_(other.ptr_) {
221 // Allow WeakPtr<element_type> to be used in boolean expressions, but not
229 typedef T* WeakPtr::*Testable;
232 operator Testable() const { return get() ? &WeakPtr::ptr_ : NULL; }
242 template <class U> bool operator==(WeakPtr<U> const&) const;
243 template <class U> bool operator!=(WeakPtr<U> const&) const;
246 template <typename U> friend class WeakPtr;
250 WeakPtr(const internal::WeakReference& ref, T* ptr)
275 WeakPtr<T> GetWeakPtr() {
277 return WeakPtr<T>(weak_reference_owner_.GetRef(), ptr_);
308 WeakPtr<T> AsWeakPtr() {
309 return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(this));
320 // Helper function that uses type deduction to safely return a WeakPtr<Derived>
329 // base::WeakPtr<Derived> ptr = base::AsWeakPtr(&derived);
332 // Derived::AsWeakPtr() is WeakPtr<Base> SupportsWeakPtr<Base>::AsWeakPtr(),
333 // and there's no way to safely cast WeakPtr<Base> to WeakPtr<Derived> at
336 // base::WeakPtr<Derived> ptr = derived.AsWeakPtr(); // Fails.
339 WeakPtr<Derived> AsWeakPtr(Derived* t) {