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

Unified Diff: base/message_loop_proxy.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.cc ('k') | base/message_loop_proxy_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop_proxy.h
diff --git a/base/message_loop_proxy.h b/base/message_loop_proxy.h
index 646b2efcbcc86bb8559c3e2d130499a35652cbb5..9a856bf65ae3c5cecfb8c824344515aec340e2b6 100644
--- a/base/message_loop_proxy.h
+++ b/base/message_loop_proxy.h
@@ -17,9 +17,12 @@ namespace base {
struct MessageLoopProxyTraits;
// This class provides a thread-safe refcounted interface to the Post* methods
-// of a message loop. This class can outlive the target message loop. You can
-// obtain a MessageLoopProxy via Thread::message_loop_proxy() or
-// MessageLoopProxy::CreateForCurrentThread().
+// of a message loop. This class can outlive the target message loop.
+// MessageLoopProxy objects are constructed automatically for all MessageLoops.
+// So, to access them, you can use any of the following:
+// Thread::message_loop_proxy()
+// MessageLoop::current()->message_loop_proxy()
+// MessageLoopProxy::current()
class BASE_EXPORT MessageLoopProxy
: public base::RefCountedThreadSafe<MessageLoopProxy,
MessageLoopProxyTraits> {
@@ -78,9 +81,9 @@ class BASE_EXPORT MessageLoopProxy
return PostNonNestableTask(from_here, new ReleaseTask<T>(object));
}
- // Factory method for creating an implementation of MessageLoopProxy
- // for the current thread.
- static scoped_refptr<MessageLoopProxy> CreateForCurrentThread();
+ // Gets the MessageLoopProxy for the current message loop, creating one if
+ // needed.
+ static scoped_refptr<MessageLoopProxy> current();
protected:
friend class RefCountedThreadSafe<MessageLoopProxy, MessageLoopProxyTraits>;
« no previous file with comments | « base/message_loop.cc ('k') | base/message_loop_proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698