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

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: don't attempt to re-lock 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..055b2abfe8f80e8f3b1ca317bdae46257ff7f8cf 100644
--- a/ppapi/shared_impl/tracked_callback.cc
+++ b/ppapi/shared_impl/tracked_callback.cc
@@ -167,7 +167,12 @@ void TrackedCallback::PostRun(int32_t result) {
base::Closure callback_closure(
RunWhileLocked(base::Bind(&TrackedCallback::Run, this, result)));
bbudge 2013/09/04 22:31:45 We should probably move this into the 'else' claus
- if (!target_loop_.get()) {
+ if (is_blocking()) {
+ // We might not have a MessageLoop to post to, so we must call Run()
+ // directly. Since we don't want to attempt to re-acquire the lock, we
+ // don't use the locking closure.
+ Run(result);
+ } else if (!target_loop_.get()) {
// 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