Chromium Code Reviews| Index: third_party/WebKit/Source/modules/compositorworker/Animator.h |
| diff --git a/third_party/WebKit/Source/modules/compositorworker/Animator.h b/third_party/WebKit/Source/modules/compositorworker/Animator.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7cfe288a17103cb86bd3a4e7661b5ed61aba13e8 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/compositorworker/Animator.h |
| @@ -0,0 +1,37 @@ |
| +// 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. |
| + |
| +#ifndef Animator_h |
| +#define Animator_h |
| + |
| +#include "platform/bindings/ScopedPersistent.h" |
| +#include "platform/heap/Handle.h" |
| +#include "v8/include/v8.h" |
| + |
| +namespace blink { |
| + |
| +class AnimatorDefinition; |
| + |
| +class Animator final : public GarbageCollectedFinalized<Animator> { |
| + public: |
| + static Animator* Create(v8::Isolate*, |
| + AnimatorDefinition*, |
| + v8::Local<v8::Object> instance); |
| + ~Animator(); |
| + DECLARE_TRACE(); |
| + |
| + private: |
| + Animator(v8::Isolate*, AnimatorDefinition*, v8::Local<v8::Object> instance); |
| + |
| + // This object keeps the definition object, and animator instance alive. |
| + // It needs to be destroyed to break a reference cycle between it and the |
| + // AnimationWorkletGlobalScope. The reference cycle is broken at |
| + // |AnimationWorkletGlobalScope::Dispose()|. |
| + Member<AnimatorDefinition> m_definition; |
| + ScopedPersistent<v8::Object> m_instance; |
|
haraken
2017/05/20 00:35:29
Can we use the wrapper tracing? You can trace m_in
majidvp
2017/05/24 14:24:16
That makes sense. I didn't know we have wrapper tr
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // Animator_h |