Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Unified Diff: third_party/WebKit/Source/core/dom/ScriptedAnimationController.h

Issue 2536643002: Introduce animation frame tasks (Closed)
Patch Set: drop 'the' Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/ScriptedAnimationController.h
diff --git a/third_party/WebKit/Source/core/dom/ScriptedAnimationController.h b/third_party/WebKit/Source/core/dom/ScriptedAnimationController.h
index 1962092af2bb9b229ba880cf37b697916b47531f..3fa371f0b4947826e411b2841e34263198edbf38 100644
--- a/third_party/WebKit/Source/core/dom/ScriptedAnimationController.h
+++ b/third_party/WebKit/Source/core/dom/ScriptedAnimationController.h
@@ -43,7 +43,7 @@ class FrameRequestCallback;
class MediaQueryListListener;
class CORE_EXPORT ScriptedAnimationController
- : public GarbageCollected<ScriptedAnimationController> {
+ : public GarbageCollectedFinalized<ScriptedAnimationController> {
public:
static ScriptedAnimationController* create(Document* document) {
return new ScriptedAnimationController(document);
@@ -52,17 +52,26 @@ class CORE_EXPORT ScriptedAnimationController
DECLARE_TRACE();
void clearDocumentPointer() { m_document = nullptr; }
+ // Animation frame callbacks are used for requestAnimationFrame().
typedef int CallbackId;
-
- int registerCallback(FrameRequestCallback*);
+ CallbackId registerCallback(FrameRequestCallback*);
void cancelCallback(CallbackId);
- void serviceScriptedAnimations(double monotonicTimeNow);
+ // Animation frame events are used for resize events, scroll events, etc.
void enqueueEvent(Event*);
void enqueuePerFrameEvent(Event*);
+
+ // Animation frame tasks are used for Fullscreen.
+ void enqueueTask(std::unique_ptr<WTF::Closure>);
+
+ // Used for the MediaQueryList change event.
void enqueueMediaQueryChangeListeners(
HeapVector<Member<MediaQueryListListener>>&);
+ // Invokes callbacks, dispatches events, etc. The order is defined by HTML:
+ // https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model
+ void serviceScriptedAnimations(double monotonicTimeNow);
+
void suspend();
void resume();
@@ -73,6 +82,7 @@ class CORE_EXPORT ScriptedAnimationController
void scheduleAnimationIfNeeded();
+ void runTasks();
void dispatchEvents(
const AtomicString& eventInterfaceFilter = AtomicString());
void executeCallbacks(double monotonicTimeNow);
@@ -83,6 +93,7 @@ class CORE_EXPORT ScriptedAnimationController
Member<Document> m_document;
FrameRequestCallbackCollection m_callbackCollection;
int m_suspendCount;
+ Vector<std::unique_ptr<WTF::Closure>> m_taskQueue;
HeapVector<Member<Event>> m_eventQueue;
HeapListHashSet<std::pair<Member<const EventTarget>, const StringImpl*>>
m_perFrameEvents;
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698