Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: Source/modules/imagebitmap/ImageBitmapFactories.h

Issue 212933005: Oilpan: turn DOMWindow into a heap supplementable. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make use of DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED() Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/crypto/DOMWindowCrypto.cpp ('k') | Source/modules/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/imagebitmap/ImageBitmapFactories.h
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.h b/Source/modules/imagebitmap/ImageBitmapFactories.h
index 5a10b766279866b3dc93ce02bfccaa802be53b4f..72337dc7fbf54f97975cb25671731b5fd0685cf4 100644
--- a/Source/modules/imagebitmap/ImageBitmapFactories.h
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.h
@@ -54,9 +54,8 @@ class ImageBitmap;
class ImageData;
class ExecutionContext;
-class ImageBitmapFactories : public Supplement<DOMWindow> {
-
-class ImageBitmapLoader;
+class ImageBitmapFactories FINAL : public NoBaseWillBeGarbageCollectedFinalized<ImageBitmapFactories>, public WillBeHeapSupplement<DOMWindow>, public WillBeHeapSupplement<WorkerGlobalScope> {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageBitmapFactories);
public:
static ScriptPromise createImageBitmap(EventTarget&, HTMLImageElement*, ExceptionState&);
@@ -74,10 +73,10 @@ public:
static ScriptPromise createImageBitmap(EventTarget&, ImageBitmap*, ExceptionState&);
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 +112,15 @@ private:
static ImageBitmapFactories& from(EventTarget&);
- static ImageBitmapFactories& fromInternal(DOMWindow&);
+ template<class GlobalObject>
+ static ImageBitmapFactories& fromInternal(GlobalObject&);
void addLoader(PassRefPtr<ImageBitmapLoader>);
+ void didFinishLoading(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
« no previous file with comments | « Source/modules/crypto/DOMWindowCrypto.cpp ('k') | Source/modules/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698