diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-18 15:15:49 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-18 15:15:49 +0200 |
commit | c559e3e30f79843f0096332334c81ee0d93029f8 (patch) | |
tree | 07ee668e9f82976e2d00912e818b632ea4470170 /dom/base/nsGlobalWindow.h | |
parent | 29de8de78c3260aad1e7844933d5b3cf1033627c (diff) | |
download | UXP-c559e3e30f79843f0096332334c81ee0d93029f8.tar UXP-c559e3e30f79843f0096332334c81ee0d93029f8.tar.gz UXP-c559e3e30f79843f0096332334c81ee0d93029f8.tar.lz UXP-c559e3e30f79843f0096332334c81ee0d93029f8.tar.xz UXP-c559e3e30f79843f0096332334c81ee0d93029f8.zip |
moebius#73: DOM - window.requestIdleCallback - improvements (basic)
https://github.com/MoonchildProductions/moebius/pull/73
Diffstat (limited to 'dom/base/nsGlobalWindow.h')
-rw-r--r-- | dom/base/nsGlobalWindow.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index dbceeab74..78bee63a1 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -102,6 +102,8 @@ struct nsRect; class nsWindowSizes; +class IdleRequestExecutor; + namespace mozilla { class DOMEventTargetHelper; class ThrottledEventQueue; @@ -118,6 +120,7 @@ class Gamepad; enum class ImageBitmapFormat : uint32_t; class IdleRequest; class IdleRequestCallback; +class IncrementalRunnable; class Location; class MediaQueryList; class MozSelfSupport; @@ -1097,7 +1100,6 @@ public: mozilla::ErrorResult& aError); void CancelIdleCallback(uint32_t aHandle); - #ifdef MOZ_WEBSPEECH mozilla::dom::SpeechSynthesis* GetSpeechSynthesis(mozilla::ErrorResult& aError); @@ -1762,6 +1764,21 @@ private: mozilla::dom::TabGroup* TabGroupInner(); mozilla::dom::TabGroup* TabGroupOuter(); +public: + void DisableIdleCallbackRequests(); + uint32_t IdleRequestHandle() const { return mIdleRequestCallbackCounter; } + nsresult RunIdleRequest(mozilla::dom::IdleRequest* aRequest, + DOMHighResTimeStamp aDeadline, bool aDidTimeout); + nsresult ExecuteIdleRequest(TimeStamp aDeadline); + void ScheduleIdleRequestDispatch(); + void SuspendIdleRequests(); + void ResumeIdleRequests(); + + typedef mozilla::LinkedList<mozilla::dom::IdleRequest> IdleRequests; + void InsertIdleCallback(mozilla::dom::IdleRequest* aRequest); + + 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! @@ -1912,21 +1929,12 @@ protected: uint32_t mSerial; - void DisableIdleCallbackRequests(); - void UnthrottleIdleCallbackRequests(); - - void PostThrottledIdleCallback(); - - typedef mozilla::LinkedList<mozilla::dom::IdleRequest> IdleRequests; - static void InsertIdleCallbackIntoList(mozilla::dom::IdleRequest* aRequest, - IdleRequests& aList); - // The current idle request callback timeout handle uint32_t mIdleCallbackTimeoutCounter; // The current idle request callback handle uint32_t mIdleRequestCallbackCounter; IdleRequests mIdleRequestCallbacks; - IdleRequests mThrottledIdleRequestCallbacks; + RefPtr<IdleRequestExecutor> mIdleRequestExecutor; #ifdef DEBUG bool mSetOpenerWindowCalled; @@ -2002,6 +2010,7 @@ protected: friend class nsDOMWindowUtils; friend class mozilla::dom::PostMessageEvent; friend class DesktopNotification; + friend class IdleRequestExecutor; static WindowByIdTable* sWindowsById; static bool sWarnedAboutWindowInternal; |