Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 CSSPaintImageGeneratorImpl_h | |
| 6 #define CSSPaintImageGeneratorImpl_h | |
| 7 | |
| 8 #include "bindings/core/v8/ScopedPersistent.h" | |
| 9 #include "core/css/CSSPaintImageGenerator.h" | |
| 10 #include "platform/geometry/IntSize.h" | |
| 11 #include "platform/heap/Handle.h" | |
| 12 #include <v8.h> | |
| 13 | |
| 14 namespace blink { | |
| 15 | |
| 16 class CSSPaintDefinition; | |
| 17 class Document; | |
| 18 class Image; | |
| 19 | |
| 20 class CSSPaintImageGeneratorImpl final : public CSSPaintImageGenerator { | |
| 21 public: | |
| 22 static CSSPaintImageGenerator* create(const String& name, Document&, Observe r*); | |
| 23 ~CSSPaintImageGeneratorImpl() override; | |
| 24 | |
| 25 PassRefPtr<Image> paint(const IntSize&) final; | |
| 26 | |
| 27 // Should be called from the PaintWorkletGlobalScope when a javascript class | |
| 28 // is registered with the same name. | |
| 29 void setDefinition(CSSPaintDefinition*); | |
| 30 | |
| 31 DECLARE_VIRTUAL_TRACE(); | |
| 32 | |
| 33 private: | |
| 34 CSSPaintImageGeneratorImpl(Observer*); | |
| 35 CSSPaintImageGeneratorImpl(CSSPaintDefinition*); | |
| 36 | |
| 37 Member<CSSPaintDefinition> m_definition; | |
| 38 Observer* m_observer; | |
|
haraken
2016/04/08 04:31:19
Can you make the Observer a GarbageCollectedMixin
ikilpatrick
2016/04/08 18:43:21
Made GarbageCollectedFinalized, see comment in CSS
| |
| 39 | |
| 40 // An instance of the paint class is owned and kept alive by this class. | |
| 41 ScopedPersistent<v8::Object> m_instance; | |
|
haraken
2016/04/08 04:31:19
Who clears out m_instance when the worklet dies? H
ikilpatrick
2016/04/08 18:43:21
Removed.
| |
| 42 }; | |
| 43 | |
| 44 } // namespace blink | |
| 45 | |
| 46 #endif // CSSPaintImageGeneratorImpl_h | |
| OLD | NEW |