Backed out 2 changesets (bug 1138181, bug 1132874) for e10s crashes in browser_windowopen_reflows.js
authorPhil Ringnalda <philringnalda@gmail.com>
Sat, 07 Mar 2015 14:37:31 -0800
changeset 232412 c8fbb68f9fe1b482a3563692c90999ce4a53f044
parent 232411 48634beaa636fe659d3f9afc37bfeda279d8d863
child 232413 7bcbc6e198635fcbae36b48cb63d40ce69178d22
push id56547
push userphilringnalda@gmail.com
push dateSat, 07 Mar 2015 22:37:42 +0000
treeherdermozilla-inbound@c8fbb68f9fe1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1138181, 1132874
milestone39.0a1
backs outfdf4671db3242cd0b829e9d3f85b8a120f24ab4e
ddd5517ce7d271da291ebe4de1a1ee88a73e6e36
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
Backed out 2 changesets (bug 1138181, bug 1132874) for e10s crashes in browser_windowopen_reflows.js CLOSED TREE Backed out changeset fdf4671db324 (bug 1132874) Backed out changeset ddd5517ce7d2 (bug 1138181)
dom/plugins/ipc/PluginWidgetParent.cpp
dom/plugins/ipc/PluginWidgetParent.h
gfx/layers/ipc/CompositorChild.cpp
gfx/layers/ipc/CompositorParent.cpp
--- a/dom/plugins/ipc/PluginWidgetParent.cpp
+++ b/dom/plugins/ipc/PluginWidgetParent.cpp
@@ -65,17 +65,28 @@ PluginWidgetParent::PluginWidgetParent()
 
 PluginWidgetParent::~PluginWidgetParent()
 {
   PWLOG("PluginWidgetParent::~PluginWidgetParent()\n");
   MOZ_COUNT_DTOR(PluginWidgetParent);
   // A destroy call can actually get skipped if a widget is associated
   // with the last out-of-process page, make sure and cleanup any left
   // over widgets if we have them.
-  KillWidget();
+  if (mWidget) {
+#if defined(MOZ_WIDGET_GTK)
+    mWidget->SetNativeData(NS_NATIVE_PLUGIN_OBJECT_PTR, (uintptr_t)0);
+    mWrapper = nullptr;
+#elif defined(XP_WIN)
+    ::RemovePropW((HWND)mWidget->GetNativeData(NS_NATIVE_WINDOW),
+                  kPluginWidgetParentProperty);
+#endif
+    mWidget->UnregisterPluginWindowForRemoteUpdates();
+    mWidget->Destroy();
+    mWidget = nullptr;
+  }
 }
 
 mozilla::dom::TabParent*
 PluginWidgetParent::GetTabParent()
 {
   return static_cast<mozilla::dom::TabParent*>(Manager());
 }
 
@@ -176,48 +187,31 @@ PluginWidgetParent::RecvCreate(nsresult*
   // visibility updates from the compositor, which ships this data
   // over with corresponding layer updates.
   mWidget->RegisterPluginWindowForRemoteUpdates();
 
   return true;
 }
 
 void
-PluginWidgetParent::KillWidget()
-{
-  PWLOG("PluginWidgetParent::KillWidget() widget=%p\n", mWidget);
-  if (mWidget) {
-#if defined(MOZ_WIDGET_GTK)
-    mWidget->SetNativeData(NS_NATIVE_PLUGIN_OBJECT_PTR, (uintptr_t)0);
-    mWrapper = nullptr;
-#elif defined(XP_WIN)
-    ::RemovePropW((HWND)mWidget->GetNativeData(NS_NATIVE_WINDOW),
-                  kPluginWidgetParentProperty);
-#endif
-    mWidget->UnregisterPluginWindowForRemoteUpdates();
-    mWidget->Destroy();
-    mWidget = nullptr;
-  }
-}
-
-void
 PluginWidgetParent::Shutdown(ShutdownType aType)
 {
-  PWLOG("PluginWidgetParent::Shutdown(%s)\n", aType == TAB_CLOSURE ? "TAB_CLOSURE" : "CONTENT");
   if (mWidget) {
-    KillWidget();
+    mWidget->UnregisterPluginWindowForRemoteUpdates();
+    DebugOnly<nsresult> rv = mWidget->Destroy();
+    NS_ASSERTION(NS_SUCCEEDED(rv), "widget destroy failure");
+    mWidget = nullptr;
     unused << SendParentShutdown(aType);
   }
 }
 
 void
 PluginWidgetParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   PWLOG("PluginWidgetParent::ActorDestroy()\n");
-  KillWidget();
 }
 
 // Called by TabParent's Destroy() in response to an early tear down (Early
 // in that this is happening before layout in the child has had a chance
 // to destroy the child widget.) when the tab is closing.
 void
 PluginWidgetParent::ParentDestroy()
 {
--- a/dom/plugins/ipc/PluginWidgetParent.h
+++ b/dom/plugins/ipc/PluginWidgetParent.h
@@ -58,17 +58,16 @@ public:
   // Identifies the side of the connection that initiates shutdown.
   enum ShutdownType {
     TAB_CLOSURE = 1,
     CONTENT     = 2
   };
 
 private:
   void Shutdown(ShutdownType aType);
-  void KillWidget();
 
   // The chrome side native widget.
   nsCOMPtr<nsIWidget> mWidget;
 #if defined(MOZ_WIDGET_GTK)
   nsAutoPtr<nsPluginNativeWindowGtk> mWrapper;
 #endif
 };
 
--- a/gfx/layers/ipc/CompositorChild.cpp
+++ b/gfx/layers/ipc/CompositorChild.cpp
@@ -247,16 +247,18 @@ CompositorChild::RecvUpdatePluginConfigu
 
       // visible state - updated after clipping, prior to invalidating
       rv = widget->Show(isVisible);
       NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure");
 
       // Handle invalidation, this can be costly, avoid if it is not needed.
       if (isVisible) {
         // invalidate region (widget origin)
+        nsIntRect bounds = aPlugins[pluginsIdx].bounds();
+        nsIntRect rect(0, 0, bounds.width, bounds.height);
 #if defined(XP_WIN)
         // Work around for flash's crummy sandbox. See bug 762948. This call
         // digs down into the window hirearchy, invalidating regions on
         // windows owned by other processes.
         mozilla::widget::WinUtils::InvalidatePluginAsWorkaround(widget, visibleBounds);
 #else
         rv = widget->Invalidate(visibleBounds);
         NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure");
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -1813,30 +1813,30 @@ static void
 UpdatePluginWindowState(uint64_t aId)
 {
   CompositorParent::LayerTreeState& lts = sIndirectLayerTrees[aId];
   if (!lts.mPluginData.Length() && !lts.mUpdatedPluginDataAvailable) {
     return;
   }
 
   bool shouldComposePlugin = !!lts.mRoot &&
-                             !!lts.mRoot->GetParent();
+                             !!lts.mRoot->GetParent() &&
+                             lts.mUpdatedPluginDataAvailable;
 
   bool shouldHidePlugin = (!lts.mRoot ||
                            !lts.mRoot->GetParent()) &&
                           !lts.mUpdatedPluginDataAvailable;
   if (shouldComposePlugin) {
     if (!lts.mPluginData.Length()) {
       // We will pass through here in cases where the previous shadow layer
       // tree contained visible plugins and the new tree does not. All we need
       // to do here is hide the plugins for the old tree, so don't waste time
       // calculating clipping.
       nsTArray<uintptr_t> aVisibleIdList;
       unused << lts.mParent->SendUpdatePluginVisibility(aVisibleIdList);
-      lts.mUpdatedPluginDataAvailable = false;
       return;
     }
 
     // Retrieve the offset and visible region of the layer that hosts
     // the plugins, CompositorChild needs these in calculating proper
     // plugin clipping.
     LayerTransactionParent* layerTree = lts.mLayerTree;
     Layer* contentRoot = layerTree->GetRoot();