Index: base/message_loop_proxy.h |
diff --git a/base/message_loop_proxy.h b/base/message_loop_proxy.h |
index aac11b9eaf0de17d9c58ac96785d83ee655cdb92..738f39fac112c9ddbaca05003facea6a76ff6827 100644 |
--- a/base/message_loop_proxy.h |
+++ b/base/message_loop_proxy.h |
@@ -10,6 +10,7 @@ |
#include "base/basictypes.h" |
#include "base/callback_forward.h" |
#include "base/memory/ref_counted.h" |
+#include "base/message_loop_helpers.h" |
#include "base/task.h" |
namespace tracked_objects { |
@@ -121,8 +122,9 @@ class BASE_EXPORT MessageLoopProxy |
template <class T> |
bool DeleteSoon(const tracked_objects::Location& from_here, |
- T* object) { |
- return PostNonNestableTask(from_here, new DeleteTask<T>(object)); |
+ const T* object) { |
+ return base::subtle::DeleteHelperInternal<T, bool>::DeleteOnMessageLoop( |
+ this, from_here, object); |
} |
template <class T> |
bool ReleaseSoon(const tracked_objects::Location& from_here, |
@@ -135,6 +137,7 @@ class BASE_EXPORT MessageLoopProxy |
static scoped_refptr<MessageLoopProxy> current(); |
protected: |
+ template <class T, class R> friend class subtle::DeleteHelperInternal; |
friend class RefCountedThreadSafe<MessageLoopProxy, MessageLoopProxyTraits>; |
friend struct MessageLoopProxyTraits; |
@@ -144,6 +147,10 @@ class BASE_EXPORT MessageLoopProxy |
// Called when the proxy is about to be deleted. Subclasses can override this |
// to provide deletion on specific threads. |
virtual void OnDestruct() const; |
+ |
+ bool DeleteSoonInternal(const tracked_objects::Location& from_here, |
+ void(*deleter)(const void*), |
+ const void* object); |
}; |
struct MessageLoopProxyTraits { |