diff options
Diffstat (limited to 'base/memory/ref_counted_delete_on_message_loop.h')
-rw-r--r-- | base/memory/ref_counted_delete_on_message_loop.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/base/memory/ref_counted_delete_on_message_loop.h b/base/memory/ref_counted_delete_on_message_loop.h index 84f80d8..de194e8 100644 --- a/base/memory/ref_counted_delete_on_message_loop.h +++ b/base/memory/ref_counted_delete_on_message_loop.h @@ -19,10 +19,8 @@ namespace base { // Sample usage: // class Foo : public RefCountedDeleteOnMessageLoop<Foo> { // -// Foo(const scoped_refptr<SingleThreadTaskRunner>& loop) -// : RefCountedDeleteOnMessageLoop<Foo>(loop) { -// ... -// } +// Foo(scoped_refptr<SingleThreadTaskRunner> loop) +// : RefCountedDeleteOnMessageLoop<Foo>(std::move(loop)) {} // ... // private: // friend class RefCountedDeleteOnMessageLoop<Foo>; @@ -40,8 +38,8 @@ class RefCountedDeleteOnMessageLoop : public subtle::RefCountedThreadSafeBase { // MessageLoop on the current thread can be acquired by calling // MessageLoop::current()->task_runner(). RefCountedDeleteOnMessageLoop( - const scoped_refptr<SingleThreadTaskRunner>& task_runner) - : task_runner_(task_runner) { + scoped_refptr<SingleThreadTaskRunner> task_runner) + : task_runner_(std::move(task_runner)) { DCHECK(task_runner_); } |