Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Document.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
| index 071ff8f9a928767f6c2c6724e99e7db0e5c0c96a..c8dbda8ede7f4bafe35cc819255c93c8a4c9ecbc 100644 |
| --- a/third_party/WebKit/Source/core/dom/Document.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp |
| @@ -48,6 +48,8 @@ |
| #include "core/animation/CompositorPendingAnimations.h" |
| #include "core/animation/DocumentAnimations.h" |
| #include "core/animation/DocumentTimeline.h" |
| +#include "core/animation/WorkletAnimationBase.h" |
| +#include "core/animation/WorkletAnimationController.h" |
| #include "core/css/CSSFontSelector.h" |
| #include "core/css/CSSStyleDeclaration.h" |
| #include "core/css/CSSStyleSheet.h" |
| @@ -582,6 +584,7 @@ Document::Document(const DocumentInit& initializer, |
| &Document::ElementDataCacheClearTimerFired), |
| timeline_(DocumentTimeline::Create(this)), |
| compositor_pending_animations_(new CompositorPendingAnimations(*this)), |
| + worklet_animation_controller_(new WorkletAnimationController), |
| template_document_host_(nullptr), |
| did_associate_form_controls_timer_( |
| TaskRunnerHelper::Get(TaskType::kUnspecedLoading, this), |
| @@ -6221,6 +6224,14 @@ void Document::ServiceScriptedAnimations( |
| monotonic_animation_start_time); |
| } |
| +void Document::RegisterWorkletAnimation(WorkletAnimationBase* animation) { |
| + worklet_animation_controller_->RegisterAnimation(animation); |
| +} |
|
majidvp
2017/06/06 16:04:27
Can we just expose worklet_animation_controller_ a
smcgruer
2017/06/07 18:23:25
Done.
|
| + |
| +void Document::DeregisterWorkletAnimation(WorkletAnimationBase* animation) { |
| + worklet_animation_controller_->DeregisterAnimation(animation); |
| +} |
| + |
| ScriptedIdleTaskController& Document::EnsureScriptedIdleTaskController() { |
| if (!scripted_idle_task_controller_) |
| scripted_idle_task_controller_ = ScriptedIdleTaskController::Create(this); |
| @@ -6785,6 +6796,7 @@ DEFINE_TRACE(Document) { |
| visitor->Trace(svg_extensions_); |
| visitor->Trace(timeline_); |
| visitor->Trace(compositor_pending_animations_); |
| + visitor->Trace(worklet_animation_controller_); |
| visitor->Trace(context_document_); |
| visitor->Trace(canvas_font_cache_); |
| visitor->Trace(intersection_observer_controller_); |