diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-04-19 13:35:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-19 13:35:14 +0200 |
commit | 493d7334f885bd4e79eedcba5037c7c4b65c8fc5 (patch) | |
tree | 69e364c791717f2b0bdf2994531a7b045f273542 /dom/base/nsGlobalWindow.h | |
parent | d7df65954a585e97ccee21fa9cb50cb116efddcc (diff) | |
parent | b873b2495a4408c43368bbf5a5e1e8f9966e0593 (diff) | |
download | UXP-493d7334f885bd4e79eedcba5037c7c4b65c8fc5.tar UXP-493d7334f885bd4e79eedcba5037c7c4b65c8fc5.tar.gz UXP-493d7334f885bd4e79eedcba5037c7c4b65c8fc5.tar.lz UXP-493d7334f885bd4e79eedcba5037c7c4b65c8fc5.tar.xz UXP-493d7334f885bd4e79eedcba5037c7c4b65c8fc5.zip |
Merge pull request #207 from janekptacijarabaci/js_dom_window_requestIdleCallback_1
moebius#73: DOM - window.requestIdleCallback - improvements
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; |