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

Unified Diff: content/browser/browser_thread.cc

Issue 7210053: Implementation of PostTaskAndReply() in MessageLoopProxy and BrowserThread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu 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
« base/message_loop_proxy.cc ('K') | « content/browser/browser_thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_thread.cc
diff --git a/content/browser/browser_thread.cc b/content/browser/browser_thread.cc
index b4d95ce32f93f4c71be291cb1bd697abc90eb2f7..09d71860cdd939a26d32612bc4dd50ea12b0df8d 100644
--- a/content/browser/browser_thread.cc
+++ b/content/browser/browser_thread.cc
@@ -4,6 +4,7 @@
#include "content/browser/browser_thread.h"
+#include "base/bind.h"
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
#include "base/threading/thread_restrictions.h"
@@ -221,6 +222,20 @@ bool BrowserThread::PostNonNestableDelayedTask(
}
// static
+bool BrowserThread::PostTaskAndReply(
+ ID identifier,
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ const base::Closure& reply) {
+ using base::internal::PostTaskAndReplyRelay;
+ PostTaskAndReplyRelay* relay =
+ new PostTaskAndReplyRelay(from_here, task, reply);
+ return PostTask(identifier, from_here,
+ base::Bind(&PostTaskAndReplyRelay::Run,
darin (slow to review) 2011/08/17 17:20:39 It almost seems like there could be room for a sta
awong 2011/08/17 18:46:46 Good point...especially considering I *just* made
+ base::Unretained(relay)));
+}
+
+// static
bool BrowserThread::GetCurrentThreadIdentifier(ID* identifier) {
// We shouldn't use MessageLoop::current() since it uses LazyInstance which
// may be deleted by ~AtExitManager when a WorkerPool thread calls this
« base/message_loop_proxy.cc ('K') | « content/browser/browser_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698