Bug 833823. We need to register for plugin updates even if we don't have a widget. r=mats
authorTimothy Nikkel <tnikkel@gmail.com>
Thu, 28 Feb 2013 13:16:03 -0600
changeset 123376 d4c21d0df6467390031b1967d84e2b4b58681bb7
parent 123375 31fce81d3394ba49559f7a4a9a370d75311d85b8
child 123377 e0be1d5500f26ef01369ff98183cdf9383ea0f80
push id24380
push userryanvm@gmail.com
push dateFri, 01 Mar 2013 03:27:49 +0000
treeherdermozilla-central@993d7aff3109 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs833823
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 833823. We need to register for plugin updates even if we don't have a widget. r=mats Also add a weak frame check here since we could destroy the frame. This problem existed before this patch, so we are fixing two things here.
layout/generic/nsObjectFrame.cpp
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -2204,21 +2204,30 @@ nsObjectFrame::EndSwapDocShells(nsIConte
   nsRootPresContext* rootPC = objectFrame->PresContext()->GetRootPresContext();
   NS_ASSERTION(rootPC, "unable to register the plugin frame");
   nsIWidget* widget = objectFrame->mWidget;
   if (widget) {
     // Reparent the widget.
     nsIWidget* parent =
       rootPC->PresShell()->GetRootFrame()->GetNearestWidget();
     widget->SetParent(parent);
+    nsWeakFrame weakFrame(objectFrame);
     objectFrame->CallSetWindow();
+    if (!weakFrame.IsAlive()) {
+      return;
+    }
+  }
 
-    // Register for geometry updates and make a request.
+#ifdef XP_MACOSX
+  if (objectFrame->mWidget) {
     objectFrame->RegisterPluginForGeometryUpdates();
   }
+#else
+  objectFrame->RegisterPluginForGeometryUpdates();
+#endif
 }
 
 nsIFrame*
 NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsObjectFrame(aContext);
 }