Replace MessageLoop::DeleteSoon implementation with one that uses base::Bind.
BUG=none
TEST=none
TBR=willchan,brettw,tony
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=115997
Review URL: http://codereview.chromium.org/9004051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116026 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/message_loop.h b/base/message_loop.h
index 18333e2..573e712 100644
--- a/base/message_loop.h
+++ b/base/message_loop.h
@@ -14,6 +14,7 @@
#include "base/callback_forward.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
+#include "base/message_loop_helpers.h"
#include "base/message_loop_proxy.h"
#include "base/message_pump.h"
#include "base/observer_list.h"
@@ -228,7 +229,8 @@
// from RefCountedThreadSafe<T>!
template <class T>
void DeleteSoon(const tracked_objects::Location& from_here, const T* object) {
- PostNonNestableTask(from_here, new DeleteTask<T>(object));
+ base::subtle::DeleteHelperInternal<T, void>::DeleteOnMessageLoop(
+ this, from_here, object);
}
// A variant on PostTask that releases the given reference counted object
@@ -552,6 +554,12 @@
scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
private:
+ template <class T, class R> friend class base::subtle::DeleteHelperInternal;
+
+ void DeleteSoonInternal(const tracked_objects::Location& from_here,
+ void(*deleter)(const void*),
+ const void* object);
+
DISALLOW_COPY_AND_ASSIGN(MessageLoop);
};