Bug 1301488 - Remove an unneeded null check from nsWebShellWindow::Initialize; r=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 08 Sep 2016 14:33:22 -0400
changeset 313360 15ff27b2a1453e7445f19204f8c18d36e278425d
parent 313359 cfa4bfef55aa1f78bd6c51faa46cbc23d6643715
child 313361 f9efa46b30ba2d4b837ec0b0e45c233714824bb1
push id30679
push usercbook@mozilla.com
push dateFri, 09 Sep 2016 10:03:06 +0000
treeherdermozilla-central@feff79e5b137 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1301488
milestone51.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 1301488 - Remove an unneeded null check from nsWebShellWindow::Initialize; r=bzbarsky mDocShell is being checked before this part in the same function.
xpfe/appshell/nsWebShellWindow.cpp
--- a/xpfe/appshell/nsWebShellWindow.cpp
+++ b/xpfe/appshell/nsWebShellWindow.cpp
@@ -219,17 +219,17 @@ nsresult nsWebShellWindow::Initialize(ns
   if (nsContentUtils::IsInitialized()) { // Sometimes this happens really early  See bug 793370.
     MOZ_ASSERT(mDocShell->ItemType() == nsIDocShellTreeItem::typeChrome);
     nsCOMPtr<nsIPrincipal> principal = nsContentUtils::SubjectPrincipalOrSystemIfNativeCaller();
     if (nsContentUtils::IsExpandedPrincipal(principal)) {
       principal = nullptr;
     }
     rv = mDocShell->CreateAboutBlankContentViewer(principal);
     NS_ENSURE_SUCCESS(rv, rv);
-    nsCOMPtr<nsIDocument> doc = mDocShell ? mDocShell->GetDocument() : nullptr;
+    nsCOMPtr<nsIDocument> doc = mDocShell->GetDocument();
     NS_ENSURE_TRUE(!!doc, NS_ERROR_FAILURE);
     doc->SetIsInitialDocument(true);
   }
 
   if (nullptr != aUrl)  {
     nsCString tmpStr;
 
     rv = aUrl->GetSpec(tmpStr);