Bug 1383142 - Avoid the presshell AddRef() in Element::GetBindingURL(); r=heycam
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 21 Jul 2017 13:21:26 -0400
changeset 419085 8d7673f2fd2ffcc7abb23a8959f431381b9d6386
parent 419084 da7ad37975f1595ac109c3be10af4c2ba6ecd8fa
child 419086 fd310390a64affc366cc85759a7624a5e3f9f239
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1383142
milestone56.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 1383142 - Avoid the presshell AddRef() in Element::GetBindingURL(); r=heycam
dom/base/Element.cpp
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -488,17 +488,17 @@ Element::GetBindingURL(nsIDocument *aDoc
   // If we have a frame the frame has already loaded the binding.  And
   // otherwise, don't do anything else here unless we're dealing with
   // XUL or an HTML element that may have a plugin-related overlay
   // (i.e. object, embed, or applet).
   bool isXULorPluginElement = (IsXULElement() ||
                                IsHTMLElement(nsGkAtoms::object) ||
                                IsHTMLElement(nsGkAtoms::embed) ||
                                IsHTMLElement(nsGkAtoms::applet));
-  nsCOMPtr<nsIPresShell> shell = aDocument->GetShell();
+  nsIPresShell* shell = aDocument->GetShell();
   if (!shell || GetPrimaryFrame() || !isXULorPluginElement) {
     *aResult = nullptr;
     return true;
   }
 
   // Get the computed -moz-binding directly from the style context
   RefPtr<nsStyleContext> sc =
     nsComputedDOMStyle::GetStyleContextNoFlush(this, nullptr, shell);