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

Unified Diff: content/public/browser/browser_thread.h

Issue 10198042: Expose PostTaskAndReplyWithResult in BrowserThread (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/browser_thread.h
diff --git a/content/public/browser/browser_thread.h b/content/public/browser/browser_thread.h
index 6930f081cc41be1fd67abdd70ae26867be103f16..0ac582b7c00221da876dd8729c2a6edf23032c61 100644
--- a/content/public/browser/browser_thread.h
+++ b/content/public/browser/browser_thread.h
@@ -12,6 +12,7 @@
#include "base/callback.h"
#include "base/location.h"
#include "base/message_loop_proxy.h"
+#include "base/task_runner_util.h"
#include "base/time.h"
#include "content/common/content_export.h"
@@ -134,6 +135,18 @@ class CONTENT_EXPORT BrowserThread {
const base::Closure& task,
const base::Closure& reply);
+ template <typename ReturnType>
+ static bool PostTaskAndReplyWithResult(
+ ID identifier,
+ const tracked_objects::Location& from_here,
+ const base::Callback<ReturnType(void)>& task,
+ const base::Callback<void(ReturnType)>& reply) {
+ scoped_refptr<base::MessageLoopProxy> message_loop_proxy =
+ GetMessageLoopProxyForThread(identifier);
+ return base::PostTaskAndReplyWithResult<ReturnType>(
+ message_loop_proxy.get(), from_here, task, reply);
+ }
+
template <class T>
static bool DeleteSoon(ID identifier,
const tracked_objects::Location& from_here,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698