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 524770 685feec7f812c0d56b6e3ac49c5a8517ba90f46f
parent 524769 e5f1bcb6046e604bfd884b419827061405c8cadd
child 524771 8541dfa55436ca1ad01d3fe056832b41438ef33e
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [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),