Bug 1419144 - Part 10: Move PushPopupControlState and PopPopupControlState into nsGlobalWindowOuter.cpp, r=smaug
authorNika Layzell <nika@thelayzells.com>
Fri, 17 Nov 2017 16:47:59 -0500
changeset 437892 0f9298059e508007a387fc47e9a1f709e029dd4a
parent 437891 f44b0454c43efb8d02ce0cebe8fc2d72716c801f
child 437893 dcb748bda9704eb6dcd8d1c1000d9eef73cf1539
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewerssmaug
bugs1419144
milestone59.0a1
Bug 1419144 - Part 10: Move PushPopupControlState and PopPopupControlState into nsGlobalWindowOuter.cpp, r=smaug MozReview-Commit-ID: 7AhgZLIvcZ5
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindowOuter.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -352,38 +352,16 @@ nsPIDOMWindow<T>::nsPIDOMWindow(nsPIDOMW
     mTimeoutManager =
       MakeUnique<mozilla::dom::TimeoutManager>(*nsGlobalWindowInner::Cast(AsInner()));
   }
 }
 
 template<class T>
 nsPIDOMWindow<T>::~nsPIDOMWindow() {}
 
-PopupControlState
-PushPopupControlState(PopupControlState aState, bool aForce)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  PopupControlState oldState = gPopupControlState;
-
-  if (aState < gPopupControlState || aForce) {
-    gPopupControlState = aState;
-  }
-
-  return oldState;
-}
-
-void
-PopPopupControlState(PopupControlState aState)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  gPopupControlState = aState;
-}
-
 template <class T>
 nsIURI*
 nsPIDOMWindow<T>::GetDocumentURI() const
 {
   return mDoc ? mDoc->GetDocumentURI() : mDocumentURI.get();
 }
 
 template <class T>
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -1417,23 +1417,45 @@ nsGlobalWindowOuter::SetInitialPrincipal
     // Ensure that if someone plays with this document they will get
     // layout happening.
     nsRect r = shell->GetPresContext()->GetVisibleArea();
     shell->Initialize(r.Width(), r.Height());
   }
 }
 
 PopupControlState
+PushPopupControlState(PopupControlState aState, bool aForce)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+
+  PopupControlState oldState = gPopupControlState;
+
+  if (aState < gPopupControlState || aForce) {
+    gPopupControlState = aState;
+  }
+
+  return oldState;
+}
+
+PopupControlState
 nsGlobalWindowOuter::PushPopupControlState(PopupControlState aState,
                                            bool aForce) const
 {
   return ::PushPopupControlState(aState, aForce);
 }
 
 void
+PopPopupControlState(PopupControlState aState)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+
+  gPopupControlState = aState;
+}
+
+void
 nsGlobalWindowOuter::PopPopupControlState(PopupControlState aState) const
 {
   ::PopPopupControlState(aState);
 }
 
 PopupControlState
 nsGlobalWindowOuter::GetPopupControlState() const
 {