Chromium Code Reviews| Index: base/memory/weak_ptr.h |
| diff --git a/base/memory/weak_ptr.h b/base/memory/weak_ptr.h |
| index 33d1e473624583d9c7ec7e7c84afbe844608187f..25de4ed718df3891cc33f06a48cd0337e852d830 100644 |
| --- a/base/memory/weak_ptr.h |
| +++ b/base/memory/weak_ptr.h |
| @@ -272,6 +272,9 @@ class WeakPtrFactory { |
| ptr_ = NULL; |
| } |
| + // Returns a new WeakPtr. This is not thread-safe - in general callers should |
|
dcheng
2016/02/19 20:45:00
"in general" is only true for code that wants a we
Wez
2016/03/01 23:20:28
I've reworded the comment to be more explicit abou
|
| + // take and store a WeakPtr to pass to code that needs to post tasks rather |
| + // than call GetWeakPtr() from different threads. |
| WeakPtr<T> GetWeakPtr() { |
| DCHECK(ptr_); |
| return WeakPtr<T>(weak_reference_owner_.GetRef(), ptr_); |