Chromium Code Reviews| Index: third_party/WebKit/Source/core/animation/WorkletAnimationController.cpp |
| diff --git a/third_party/WebKit/Source/core/animation/WorkletAnimationController.cpp b/third_party/WebKit/Source/core/animation/WorkletAnimationController.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e943d3e1f459bd43255034d756e2c733d31ef83f |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/animation/WorkletAnimationController.cpp |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "core/animation/WorkletAnimationController.h" |
| + |
| +#include "core/animation/WorkletAnimationBase.h" |
| + |
| +namespace blink { |
| + |
| +WorkletAnimationController::WorkletAnimationController() {} |
| + |
| +WorkletAnimationController::~WorkletAnimationController() {} |
| + |
| +void WorkletAnimationController::RegisterAnimation( |
| + WorkletAnimationBase* animation) { |
| + animations_.insert(animation); |
|
majidvp
2017/06/06 16:04:27
nit: may be a good idea to add a DCHECK for animat
smcgruer
2017/06/07 18:23:24
Done.
|
| +} |
| + |
| +void WorkletAnimationController::DeregisterAnimation( |
| + WorkletAnimationBase* animation) { |
| + animations_.erase(animation); |
| +} |
| + |
| +void WorkletAnimationController::Update() { |
| + for (const auto& animation : animations_) { |
| + animation->Update(); |
| + } |
| +} |
| + |
| +DEFINE_TRACE(WorkletAnimationController) { |
| + visitor->Trace(animations_); |
| +} |
| + |
| +} // namespace |