Bug 831768 - Delay async painting calls so that they never nest within RPC calls. The Adobe Flash implementation doesn't expect this reentry and sometimes deadlocks. The Apple Java stub doesn't expect this reentry and corrupts NPRuntime objects. r=gfritzsche, a=bajaj
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 18 Mar 2013 16:00:21 +0100
changeset 132525 5d85c1b25bcce43702e74e0353d01c47316df462
parent 132524 28ff0e110387aa0d6b4855f23f87bcf0200e6c4b
child 132526 90661ab654d71c39da551889898266f3da2b7e7d
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche, bajaj
bugs831768
milestone21.0a2
Bug 831768 - Delay async painting calls so that they never nest within RPC calls. The Adobe Flash implementation doesn't expect this reentry and sometimes deadlocks. The Apple Java stub doesn't expect this reentry and corrupts NPRuntime objects. r=gfritzsche, a=bajaj
dom/plugins/ipc/PluginInstanceChild.cpp
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -2705,28 +2705,26 @@ PluginInstanceChild::RecvAsyncSetWindow(
 
     NS_ASSERTION(!aWindow.window, "Remote window should be null.");
 
     if (mCurrentAsyncSetWindowTask) {
         mCurrentAsyncSetWindowTask->Cancel();
         mCurrentAsyncSetWindowTask = nullptr;
     }
 
-    if (mPendingPluginCall) {
-        // We shouldn't process this now. Run it later.
-        mCurrentAsyncSetWindowTask =
-            NewRunnableMethod<PluginInstanceChild,
-                              void (PluginInstanceChild::*)(const gfxSurfaceType&, const NPRemoteWindow&, bool),
-                              gfxSurfaceType, NPRemoteWindow, bool>
-                (this, &PluginInstanceChild::DoAsyncSetWindow,
-                 aSurfaceType, aWindow, true);
-        MessageLoop::current()->PostTask(FROM_HERE, mCurrentAsyncSetWindowTask);
-    } else {
-        DoAsyncSetWindow(aSurfaceType, aWindow, false);
-    }
+    // We shouldn't process this now because it may be received within a nested
+    // RPC call, and both Flash and Java don't expect to receive setwindow calls
+    // at arbitrary times.
+    mCurrentAsyncSetWindowTask =
+        NewRunnableMethod<PluginInstanceChild,
+                          void (PluginInstanceChild::*)(const gfxSurfaceType&, const NPRemoteWindow&, bool),
+                          gfxSurfaceType, NPRemoteWindow, bool>
+        (this, &PluginInstanceChild::DoAsyncSetWindow,
+         aSurfaceType, aWindow, true);
+    MessageLoop::current()->PostTask(FROM_HERE, mCurrentAsyncSetWindowTask);
 
     return true;
 }
 
 bool
 PluginInstanceChild::AnswerHandleKeyEvent(const nsKeyEvent& aKeyEvent,
                                           bool* handled)
 {