Bug 1323203 - Devirtualize nsPIDOMWindow::IsRunningTimeout(); r=bkelly
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 13 Dec 2016 10:24:44 -0500
changeset 325765 056dd99b0478b4cd09a26949f7b544345e18cf90
parent 325764 8529b942c88344d0f62c40512007cc46878d1b89
child 325766 5cb21793896161601a065eb0aa21dbfe570fe4f3
push id31073
push userphilringnalda@gmail.com
push dateWed, 14 Dec 2016 03:25:19 +0000
treeherdermozilla-central@1ea0c60db5d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1323203
milestone53.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 1323203 - Devirtualize nsPIDOMWindow::IsRunningTimeout(); r=bkelly
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/base/nsPIDOMWindow.h
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -3930,16 +3930,22 @@ nsPIDOMWindowInner::HasAudioContexts() c
 }
 
 mozilla::dom::TimeoutManager&
 nsPIDOMWindowInner::TimeoutManager()
 {
   return *mTimeoutManager;
 }
 
+bool
+nsPIDOMWindowInner::IsRunningTimeout()
+{
+  return TimeoutManager().IsRunningTimeout();
+}
+
 SuspendTypes
 nsPIDOMWindowOuter::GetMediaSuspend() const
 {
   if (IsInnerWindow()) {
     return mOuterWindow->GetMediaSuspend();
   }
 
   return mMediaSuspend;
@@ -12091,23 +12097,16 @@ nsGlobalWindow::FireDelayedDOMEvents()
         win->FireDelayedDOMEvents();
       }
     }
   }
 
   return NS_OK;
 }
 
-bool
-nsGlobalWindow::IsRunningTimeout()
-{
-  MOZ_ASSERT(IsInnerWindow());
-  return mTimeoutManager->IsRunningTimeout();
-}
-
 //*****************************************************************************
 // nsGlobalWindow: Window Control Functions
 //*****************************************************************************
 
 nsPIDOMWindowOuter*
 nsGlobalWindow::GetParentInternal()
 {
   if (IsInnerWindow()) {
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -390,17 +390,16 @@ public:
   virtual void Resume();
   virtual bool IsSuspended() const override;
   virtual void Freeze();
   virtual void Thaw();
   virtual bool IsFrozen() const override;
   virtual void SyncStateFromParentWindow();
 
   virtual nsresult FireDelayedDOMEvents() override;
-  virtual bool IsRunningTimeout() override;
 
   // Outer windows only.
   virtual bool WouldReuseInnerWindow(nsIDocument* aNewDocument) override;
 
   virtual void SetDocShell(nsIDocShell* aDocShell) override;
   virtual void DetachFromDocShell() override;
   virtual nsresult SetNewDocument(nsIDocument *aDocument,
                                   nsISupports *aState,
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -183,18 +183,16 @@ public:
   nsIDocument* GetDoc()
   {
     if (!mDoc) {
       MaybeCreateDoc();
     }
     return mDoc;
   }
 
-  virtual bool IsRunningTimeout() = 0;
-
 protected:
   // Lazily instantiate an about:blank document if necessary, and if
   // we have what it takes to do so.
   void MaybeCreateDoc();
 
 public:
   // Check whether a document is currently loading
   inline bool IsLoading() const;
@@ -850,16 +848,18 @@ public:
   // Apply the parent window's suspend, freeze, and modal state to the current
   // window.
   void SyncStateFromParentWindow();
 
   bool HasAudioContexts() const;
 
   mozilla::dom::TimeoutManager& TimeoutManager();
 
+  bool IsRunningTimeout();
+
 protected:
   void CreatePerformanceObjectIfNeeded();
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowInner, NS_PIDOMWINDOWINNER_IID)
 
 // NB: It's very very important that these two classes have identical vtables
 // and memory layout!