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

Unified Diff: ppapi/shared_impl/tracked_callback.cc

Issue 23706006: PPAPI: Blocking callbacks shouldn't need a target_loop_ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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: ppapi/shared_impl/tracked_callback.cc
diff --git a/ppapi/shared_impl/tracked_callback.cc b/ppapi/shared_impl/tracked_callback.cc
index 1a3ac21adb5610b332f617b3c10b13f1ec74acf2..f7192df3c450782d4adc6b3fa9368c49e87caa67 100644
--- a/ppapi/shared_impl/tracked_callback.cc
+++ b/ppapi/shared_impl/tracked_callback.cc
@@ -167,7 +167,11 @@ void TrackedCallback::PostRun(int32_t result) {
base::Closure callback_closure(
RunWhileLocked(base::Bind(&TrackedCallback::Run, this, result)));
- if (!target_loop_.get()) {
+ if (is_blocking()) {
+ // We might not have a MessageLoop to post to, so we must call Run()
+ // directly.
+ callback_closure.Run();
+ } else if (!target_loop_.get()) {
bbudge 2013/09/04 22:29:19 It seems like the most common case is last. Do you
// We must be running in-process and on the main thread (the Enter
// classes protect against having a null target_loop_ otherwise).
DCHECK(IsMainThread());
« 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