Bug 1535105 - Two very minor cleanups in nsGlobalWindowOuter.cpp. r=nika
authorAndrew McCreight <continuation@gmail.com>
Wed, 13 Mar 2019 20:37:08 +0000
changeset 521772 685feec7f812
parent 521771 e5f1bcb6046e
child 521773 8541dfa55436
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1535105
milestone67.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 1535105 - Two very minor cleanups in nsGlobalWindowOuter.cpp. r=nika mDocShell is now a strong reference, and it does not need to be explicitly initialized in the constructor because it is an nsCOMPtr. Differential Revision: https://phabricator.services.mozilla.com/D23376
dom/base/nsGlobalWindowOuter.cpp
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -2370,17 +2370,17 @@ void nsGlobalWindowOuter::ClearStatus() 
 
 void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) {
   MOZ_ASSERT(aDocShell);
 
   if (aDocShell == mDocShell) {
     return;
   }
 
-  mDocShell = aDocShell;  // Weak Reference
+  mDocShell = aDocShell;
   mBrowsingContext = aDocShell->GetBrowsingContext();
 
   nsCOMPtr<nsPIDOMWindowOuter> parentWindow = GetScriptableParentOrNull();
   MOZ_RELEASE_ASSERT(!parentWindow || !mTabGroup ||
                      mTabGroup ==
                          nsGlobalWindowOuter::Cast(parentWindow)->mTabGroup);
 
   mTopLevelOuterContentWindow =
@@ -2463,17 +2463,17 @@ void nsGlobalWindowOuter::DetachFromDocS
     // param. We also trigger a full GC for chrome windows.
     nsJSContext::PokeGC(JS::GCReason::SET_DOC_SHELL,
                         (mTopLevelOuterContentWindow || mIsChrome)
                             ? nullptr
                             : GetWrapperPreserveColor());
     mContext = nullptr;
   }
 
-  mDocShell = nullptr;  // Weak Reference
+  mDocShell = nullptr;
 
   if (mFrames) {
     mFrames->SetDocShell(nullptr);
   }
 
   MaybeForgiveSpamCount();
   CleanUp();
 }
@@ -7801,17 +7801,16 @@ mozilla::dom::DocGroup* nsPIDOMWindowOut
   if (doc) {
     return doc->GetDocGroup();
   }
   return nullptr;
 }
 
 nsPIDOMWindowOuter::nsPIDOMWindowOuter(uint64_t aWindowID)
     : mFrameElement(nullptr),
-      mDocShell(nullptr),
       mModalStateDepth(0),
       mIsActive(false),
       mIsBackground(false),
       mMediaSuspend(
           Preferences::GetBool("media.block-autoplay-until-in-foreground", true)
               ? nsISuspendedTypes::SUSPENDED_BLOCK
               : nsISuspendedTypes::NONE_SUSPENDED),
       mAudioMuted(false),