Index: Source/modules/imagebitmap/ImageBitmapFactories.h |
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.h b/Source/modules/imagebitmap/ImageBitmapFactories.h |
index 5a10b766279866b3dc93ce02bfccaa802be53b4f..6419d733ad83b805a8d001fa6a8f0d5c368347a3 100644 |
--- a/Source/modules/imagebitmap/ImageBitmapFactories.h |
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.h |
@@ -54,8 +54,10 @@ class ImageBitmap; |
class ImageData; |
class ExecutionContext; |
-class ImageBitmapFactories : public Supplement<DOMWindow> { |
+class ImageBitmapFactories FINAL : public NoBaseWillBeGarbageCollectedFinalized<ImageBitmapFactories>, public WillBeHeapSupplement<DOMWindow>, public WillBeHeapSupplement<WorkerGlobalScope> { |
haraken
2014/03/27 00:59:03
Ditto.
sof
2014/03/27 07:25:51
No, we need to release the HashSet on finalization
|
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageBitmapFactories); |
+private: |
class ImageBitmapLoader; |
haraken
2014/03/27 00:59:03
Nit: I think you can just move this to the above l
sof
2014/03/27 07:25:51
It's a local class. But the forward decl is avoida
|
public: |
@@ -75,9 +77,10 @@ public: |
static ScriptPromise createImageBitmap(EventTarget&, ImageBitmap*, int sx, int sy, int sw, int sh, ExceptionState&); |
void didFinishLoading(ImageBitmapLoader*); |
- |
virtual ~ImageBitmapFactories() { } |
+ void trace(Visitor*) { } |
+ |
protected: |
static const char* supplementName(); |
@@ -113,26 +116,14 @@ private: |
static ImageBitmapFactories& from(EventTarget&); |
- static ImageBitmapFactories& fromInternal(DOMWindow&); |
+ template<class GlobalObject> |
+ static ImageBitmapFactories& fromInternal(GlobalObject&); |
void addLoader(PassRefPtr<ImageBitmapLoader>); |
HashSet<RefPtr<ImageBitmapLoader> > m_pendingLoaders; |
}; |
-// FIXME: oilpan: remove once DOMWindow and its Supplementable becomes heap allocated. |
-class WorkerGlobalScopeImageBitmapFactories FINAL : public NoBaseWillBeGarbageCollectedFinalized<WorkerGlobalScopeImageBitmapFactories>, public ImageBitmapFactories, public WillBeHeapSupplement<WorkerGlobalScope> { |
- WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WorkerGlobalScopeImageBitmapFactories); |
-public: |
- virtual ~WorkerGlobalScopeImageBitmapFactories() { } |
- |
- virtual void trace(Visitor*); |
- |
-private: |
- friend class ImageBitmapFactories; |
- static ImageBitmapFactories& fromInternal(WorkerGlobalScope&); |
-}; |
- |
} // namespace WebCore |
#endif // ImageBitmapFactories_h |