Bug 1182247 - Only RegisterPluginForGeometryUpdates in nsPluginFrame::EndSwapDocShells if mInstanceOwner is non-null. r?tnikkel draft
authorL. David Baron <dbaron@dbaron.org>
Thu, 17 Mar 2016 17:57:53 -0700
changeset 341907 d5247705447d85f9fdbe703e0994fa56a6e3a37d
parent 341377 fd6c1f7f3e4eef20b5f08106b8ac73599bdc8c88
child 516491 ce9a1d288b6e9e352b7fadfcf9e6539c11297bc5
push id13319
push userdbaron@mozilla.com
push dateFri, 18 Mar 2016 00:58:07 +0000
reviewerstnikkel
bugs1182247
milestone48.0a1
Bug 1182247 - Only RegisterPluginForGeometryUpdates in nsPluginFrame::EndSwapDocShells if mInstanceOwner is non-null. r?tnikkel Having a non-null mInstanceOwner corresponds to when registration normally happens (from nsPluginInstanceOwner::SetFrame), and it's disconnecting the instance owner that leads to unregistration. MozReview-Commit-ID: 3X15t9zoXIj
layout/generic/nsPluginFrame.cpp
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -1860,17 +1860,19 @@ nsPluginFrame::EndSwapDocShells(nsISuppo
     widget->SetParent(parent);
     nsWeakFrame weakFrame(objectFrame);
     objectFrame->CallSetWindow();
     if (!weakFrame.IsAlive()) {
       return;
     }
   }
 
-  objectFrame->RegisterPluginForGeometryUpdates();
+  if (objectFrame->mInstanceOwner) {
+    objectFrame->RegisterPluginForGeometryUpdates();
+  }
 }
 
 nsIFrame*
 NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsPluginFrame(aContext);
 }