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

Unified Diff: base/message_loop_proxy_impl.h

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 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
« no previous file with comments | « base/message_loop_proxy.h ('k') | base/message_loop_proxy_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop_proxy_impl.h
diff --git a/base/message_loop_proxy_impl.h b/base/message_loop_proxy_impl.h
index 57896ffc0ffc24e09854f2faa806d253c08ac37b..29663940c5467db839392b2521ea41051fab713b 100644
--- a/base/message_loop_proxy_impl.h
+++ b/base/message_loop_proxy_impl.h
@@ -13,12 +13,11 @@
namespace base {
-// A stock implementation of MessageLoopProxy that takes in a MessageLoop
-// and keeps track of its lifetime using the MessageLoop DestructionObserver.
-// For now a MessageLoopProxyImpl can only be created for the current thread.
+// A stock implementation of MessageLoopProxy that is created and managed by a
+// MessageLoop. For now a MessageLoopProxyImpl can only be created as part of a
+// MessageLoop.
class BASE_EXPORT MessageLoopProxyImpl
- : public MessageLoopProxy,
- public MessageLoop::DestructionObserver {
+ : public MessageLoopProxy {
public:
virtual ~MessageLoopProxyImpl();
@@ -47,9 +46,6 @@ class BASE_EXPORT MessageLoopProxyImpl
int64 delay_ms);
virtual bool BelongsToCurrentThread();
- // MessageLoop::DestructionObserver implementation
- virtual void WillDestroyCurrentMessageLoop();
-
protected:
// Override OnDestruct so that we can delete the object on the target message
// loop if it still exists.
@@ -57,6 +53,11 @@ class BASE_EXPORT MessageLoopProxyImpl
private:
MessageLoopProxyImpl();
+
+ // Called directly by MessageLoop::~MessageLoop.
+ virtual void WillDestroyCurrentMessageLoop();
+
+
// TODO(ajwong): Remove this after we've fully migrated to base::Closure.
bool PostTaskHelper(const tracked_objects::Location& from_here,
Task* task,
@@ -67,8 +68,8 @@ class BASE_EXPORT MessageLoopProxyImpl
int64 delay_ms,
bool nestable);
- // For the factory method to work
- friend class MessageLoopProxy;
+ // Allow the messageLoop to create a MessageLoopProxyImpl.
+ friend class ::MessageLoop;
// The lock that protects access to target_message_loop_.
mutable base::Lock message_loop_lock_;
« no previous file with comments | « base/message_loop_proxy.h ('k') | base/message_loop_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698