Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef Animator_h | |
| 6 #define Animator_h | |
| 7 | |
| 8 #include "platform/bindings/ScopedPersistent.h" | |
| 9 #include "platform/heap/Handle.h" | |
| 10 #include "v8/include/v8.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class AnimatorDefinition; | |
| 15 | |
| 16 class Animator final : public GarbageCollectedFinalized<Animator> { | |
| 17 public: | |
| 18 static Animator* Create(v8::Isolate*, | |
| 19 AnimatorDefinition*, | |
| 20 v8::Local<v8::Object> instance); | |
| 21 ~Animator(); | |
| 22 DECLARE_TRACE(); | |
| 23 | |
| 24 private: | |
| 25 Animator(v8::Isolate*, AnimatorDefinition*, v8::Local<v8::Object> instance); | |
| 26 | |
| 27 // This object keeps the definition object, and animator instance alive. | |
| 28 // It needs to be destroyed to break a reference cycle between it and the | |
| 29 // AnimationWorkletGlobalScope. The reference cycle is broken at | |
| 30 // |AnimationWorkletGlobalScope::Dispose()|. | |
| 31 Member<AnimatorDefinition> m_definition; | |
| 32 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
| |
| 33 }; | |
| 34 | |
| 35 } // namespace blink | |
| 36 | |
| 37 #endif // Animator_h | |
| OLD | NEW |