Bug 1417354 - Drop unused presshell and prescontext in nsGlobalWindowInner.cpp. r?smaug
MozReview-Commit-ID: Ok80ilFDsf
--- 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;