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

Unified Diff: base/memory/ref_counted_delete_on_message_loop.h

Issue 1100773004: base: Remove most uses of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 7b898ac00dd015d6b8faa0bc0de665bad2346ca6..89c17e9c88582a2c234a0151e42681790324e28c 100644
--- a/base/memory/ref_counted_delete_on_message_loop.h
+++ b/base/memory/ref_counted_delete_on_message_loop.h
@@ -8,17 +8,17 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
namespace base {
// RefCountedDeleteOnMessageLoop is similar to RefCountedThreadSafe, and ensures
-// that the object will be deleted on a specified message loop.
+// that the object will be deleted on a specified task runner.
//
// Sample usage:
// class Foo : public RefCountedDeleteOnMessageLoop<Foo> {
//
-// Foo(const scoped_refptr<MessageLoopProxy>& loop)
+// Foo(const scoped_refptr<SingleThreadTaskRunner>& loop)
// : RefCountedDeleteOnMessageLoop<Foo>(loop) {
// ...
// }
@@ -34,8 +34,9 @@ template <class T>
class RefCountedDeleteOnMessageLoop : public subtle::RefCountedThreadSafeBase {
public:
RefCountedDeleteOnMessageLoop(
danakj 2015/04/21 20:16:30 should this be renamed?
Sami 2015/04/23 17:48:24 Yes, I think it should but I wanted to do that sep
- const scoped_refptr<MessageLoopProxy>& proxy) : proxy_(proxy) {
- DCHECK(proxy_.get());
+ const scoped_refptr<SingleThreadTaskRunner>& task_runner)
+ : task_runner_(task_runner) {
+ DCHECK(task_runner_.get());
}
void AddRef() const {
@@ -53,13 +54,13 @@ class RefCountedDeleteOnMessageLoop : public subtle::RefCountedThreadSafeBase {
void DestructOnMessageLoop() const {
const T* t = static_cast<const T*>(this);
- if (proxy_->BelongsToCurrentThread())
+ if (task_runner_->BelongsToCurrentThread())
delete t;
else
- proxy_->DeleteSoon(FROM_HERE, t);
+ task_runner_->DeleteSoon(FROM_HERE, t);
}
- scoped_refptr<MessageLoopProxy> proxy_;
+ scoped_refptr<SingleThreadTaskRunner> task_runner_;
private:
DISALLOW_COPY_AND_ASSIGN(RefCountedDeleteOnMessageLoop);

Powered by Google App Engine
This is Rietveld 408576698