Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4177)

Unified Diff: base/memory/ref_counted_delete_on_message_loop.h

Issue 1800743003: base: Remove some unnecessary const scoped_refptr<>&. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/memory/ref_counted_delete_on_message_loop.h
diff --git a/base/memory/ref_counted_delete_on_message_loop.h b/base/memory/ref_counted_delete_on_message_loop.h
index 84f80d8d8f2918f7e37e07687846d1ca149a4c21..de194e847918549cfda873253d896edf92a80da1 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_);
}

Powered by Google App Engine
This is Rietveld 408576698