Bug 1419144 - Part 4: Remove RemoveIdleCallback from outer window, r=farre
authorNika Layzell <nika@thelayzells.com>
Fri, 17 Nov 2017 16:25:00 -0500
changeset 437886 4435161ad0bc16e619a7a5413e38eb65a0183385
parent 437885 61d666efd2823ca3838ba98f89f640a2a22c0098
child 437887 98490bf58d1b663edaca0fe607b03a1cc2f912cb
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersfarre
bugs1419144
milestone59.0a1
Bug 1419144 - Part 4: Remove RemoveIdleCallback from outer window, r=farre MozReview-Commit-ID: KxJgYeOQPyH
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsGlobalWindowOuter.h
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -74,40 +74,16 @@ DialogValueHolder::Get(JSContext* aCx, J
 {
   if (aSubject->Subsumes(mOrigin)) {
     aError = nsContentUtils::XPConnect()->VariantToJS(aCx, aScope,
                                                       mValue, aResult);
   } else {
     aResult.setUndefined();
   }
 }
-void
-nsGlobalWindowOuter::RemoveIdleCallback(mozilla::dom::IdleRequest* aRequest)
-{
-  AssertIsOnMainThread();
-
-  if (aRequest->HasTimeout()) {
-    mTimeoutManager->ClearTimeout(aRequest->GetTimeoutHandle(),
-                                  Timeout::Reason::eIdleCallbackTimeout);
-  }
-
-  aRequest->removeFrom(mIdleRequestCallbacks);
-  aRequest->Release();
-}
-
-nsresult
-nsGlobalWindowOuter::RunIdleRequest(IdleRequest* aRequest,
-                                    DOMHighResTimeStamp aDeadline,
-                                    bool aDidTimeout)
-{
-  AssertIsOnMainThread();
-  RefPtr<IdleRequest> request(aRequest);
-  RemoveIdleCallback(request);
-  return request->IdleRun(AsInner(), aDeadline, aDidTimeout);
-}
 
 bool
 nsGlobalWindowOuter::IsBackgroundInternal() const
 {
   return !mOuterWindow || mOuterWindow->IsBackground();
 }
 
 /* static */
--- a/dom/base/nsGlobalWindowOuter.h
+++ b/dom/base/nsGlobalWindowOuter.h
@@ -1167,23 +1167,19 @@ public:
 
   virtual nsISerialEventTarget*
   EventTargetFor(mozilla::TaskCategory aCategory) const override;
 
   virtual mozilla::AbstractThread*
   AbstractMainThreadFor(mozilla::TaskCategory aCategory) override;
 
   uint32_t LastIdleRequestHandle() const { return mIdleRequestCallbackCounter - 1; }
-  nsresult RunIdleRequest(mozilla::dom::IdleRequest* aRequest,
-                          DOMHighResTimeStamp aDeadline, bool aDidTimeout);
 
   typedef mozilla::LinkedList<mozilla::dom::IdleRequest> IdleRequests;
 
-  void RemoveIdleCallback(mozilla::dom::IdleRequest* aRequest);
-
 protected:
   // These members are only used on outer window objects. Make sure
   // you never set any of these on an inner object!
   bool                          mFullScreen : 1;
   bool                          mFullscreenMode : 1;
   bool                          mIsClosed : 1;
   bool                          mInClose : 1;
   // mHavePendingClose means we've got a termination function set to