Lines Matching defs:WeakPtr

30 //    static void StartNew(const WeakPtr<Controller>& controller) {
35 // Worker(const WeakPtr<Controller>& controller)
41 // WeakPtr<Controller> controller_;
54 // To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory
76 template <typename T> class WeakPtr;
79 // These classes are part of the WeakPtr implementation.
85 // via base::WeakPtr::~WeakPtr().
129 // This class simplifies the implementation of WeakPtr's type conversion
131 // WeakPtr<T> cannot access the private members of WeakPtr<U>, so this
149 // A safe static downcast of a WeakPtr<Base> to WeakPtr<Derived>. This
154 static WeakPtr<Derived> StaticAsWeakPtr(Derived* t) {
167 static WeakPtr<Derived> AsWeakPtrImpl(
169 WeakPtr<Base> ptr = t->Base::AsWeakPtr();
170 return WeakPtr<Derived>(ptr.ref_, static_cast<Derived*>(ptr.ptr_));
178 // The WeakPtr class holds a weak reference to |T*|.
187 // WeakPtr<Foo> foo;
192 class WeakPtr : public internal::WeakPtrBase {
194 WeakPtr() : ptr_(NULL) {
200 WeakPtr(const WeakPtr<U>& other) : WeakPtrBase(other), ptr_(other.ptr_) {
214 // Allow WeakPtr<element_type> to be used in boolean expressions, but not
222 typedef T* WeakPtr::*Testable;
225 operator Testable() const { return get() ? &WeakPtr::ptr_ : NULL; }
235 template <class U> bool operator==(WeakPtr<U> const&) const;
236 template <class U> bool operator!=(WeakPtr<U> const&) const;
239 template <typename U> friend class WeakPtr;
243 WeakPtr(const internal::WeakReference& ref, T* ptr)
268 WeakPtr<T> GetWeakPtr() {
270 return WeakPtr<T>(weak_reference_owner_.GetRef(), ptr_);
301 WeakPtr<T> AsWeakPtr() {
302 return WeakPtr<T>(weak_reference_owner_.GetRef(), static_cast<T*>(this));
313 // Helper function that uses type deduction to safely return a WeakPtr<Derived>
322 // base::WeakPtr<Derived> ptr = base::AsWeakPtr(&derived);
325 // Derived::AsWeakPtr() is WeakPtr<Base> SupportsWeakPtr<Base>::AsWeakPtr(),
326 // and there's no way to safely cast WeakPtr<Base> to WeakPtr<Derived> at
329 // base::WeakPtr<Derived> ptr = derived.AsWeakPtr(); // Fails.
332 WeakPtr<Derived> AsWeakPtr(Derived* t) {