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
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 18 Mar 2013 16:00:21 +0100
changeset 125238 9c6474e8d3c84451d9f3626162728278bad6e189
parent 125237 5e9fe5a74270fa2948656ee3e1c6379a4c560b2a
child 125239 a7ea5daa2dc952af25407605a8498dbe3838a4cc
push id24827
push userbsmedberg@mozilla.com
push dateMon, 18 Mar 2013 15:36:05 +0000
treeherdermozilla-inbound@9c6474e8d3c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs831768
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/plugins/ipc/PluginInstanceChild.cpp
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -2708,28 +2708,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)
 {