Bug 1417354 - Drop unused presshell and prescontext in nsGlobalWindowInner.cpp. r?smaug draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 21 Feb 2018 06:15:22 +0900
changeset 757578 b8651cc632300b7d102fc5b489c6ac82f537b730
parent 757574 861067332bac96a44bbf41ef366f58a30476057b
child 757579 ef66c919361be11f649c49824e64ee6ac0d2fc64
child 757655 30d32a79d3632fa4ceb2ab8e431f029575a0e265
push id99784
push userhikezoe@mozilla.com
push dateTue, 20 Feb 2018 21:16:55 +0000
reviewerssmaug
bugs1417354
milestone60.0a1
Bug 1417354 - Drop unused presshell and prescontext in nsGlobalWindowInner.cpp. r?smaug MozReview-Commit-ID: Ok80ilFDsf
dom/base/nsGlobalWindowInner.cpp
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -4788,22 +4788,16 @@ nsGlobalWindowInner::FireHashchange(cons
   // Don't do anything if the window is frozen.
   if (IsFrozen()) {
     return NS_OK;
   }
 
   // Get a presentation shell for use in creating the hashchange event.
   NS_ENSURE_STATE(IsCurrentInnerWindow());
 
-  nsIPresShell *shell = mDoc->GetShell();
-  RefPtr<nsPresContext> presContext;
-  if (shell) {
-    presContext = shell->GetPresContext();
-  }
-
   HashChangeEventInit init;
   init.mBubbles = true;
   init.mCancelable = false;
   init.mNewURL = aNewURL;
   init.mOldURL = aOldURL;
 
   RefPtr<HashChangeEvent> event =
     HashChangeEvent::Constructor(this, NS_LITERAL_STRING("hashchange"),
@@ -4830,23 +4824,16 @@ nsGlobalWindowInner::DispatchSyncPopStat
 
   // Get the document's pending state object -- it contains the data we're
   // going to send along with the popstate event.  The object is serialized
   // using structured clone.
   nsCOMPtr<nsIVariant> stateObj;
   rv = mDoc->GetStateObject(getter_AddRefs(stateObj));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // Obtain a presentation shell for use in creating a popstate event.
-  nsIPresShell *shell = mDoc->GetShell();
-  RefPtr<nsPresContext> presContext;
-  if (shell) {
-    presContext = shell->GetPresContext();
-  }
-
   bool result = true;
   AutoJSAPI jsapi;
   result = jsapi.Init(this);
   NS_ENSURE_TRUE(result, NS_ERROR_FAILURE);
 
   JSContext* cx = jsapi.cx();
   JS::Rooted<JS::Value> stateJSValue(cx, JS::NullValue());
   result = stateObj ? VariantToJsval(cx, stateObj, &stateJSValue) : true;