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

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

Issue 22906002: Implement ImageBitmapFactories as a supplementary module. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add OWNERS file. Created 7 years, 4 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/core/page/ImageBitmapFactories.idl ('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/core/page/ImageBitmapFactories.h b/Source/modules/imagebitmap/ImageBitmapFactories.h
similarity index 55%
rename from Source/core/page/ImageBitmapFactories.h
rename to Source/modules/imagebitmap/ImageBitmapFactories.h
index 05feca4ffc17d90f247e869bd42b51f43ae72575..e8257c9b869d6e90a3d3316814e2ef70663f7e43 100644
--- a/Source/core/page/ImageBitmapFactories.h
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.h
@@ -32,10 +32,12 @@
#define ImageBitmapFactories_h
#include "bindings/v8/ScriptPromiseResolver.h"
+#include "core/platform/Supplementable.h"
namespace WebCore {
class CanvasRenderingContext2D;
+class DOMWindow;
class EventTarget;
class ExceptionState;
class HTMLCanvasElement;
@@ -44,22 +46,28 @@ class HTMLVideoElement;
class ImageBitmap;
class ImageData;
-namespace ImageBitmapFactories {
+class ImageBitmapFactories : public Supplement<DOMWindow> {
+public:
+ static ScriptObject createImageBitmap(EventTarget*, HTMLImageElement*, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, HTMLImageElement*, int sx, int sy, int sw, int sh, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, HTMLVideoElement*, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, HTMLVideoElement*, int sx, int sy, int sw, int sh, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, CanvasRenderingContext2D*, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, CanvasRenderingContext2D*, int sx, int sy, int sw, int sh, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, HTMLCanvasElement*, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, HTMLCanvasElement*, int sx, int sy, int sw, int sh, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, ImageData*, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, ImageData*, int sx, int sy, int sw, int sh, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, ImageBitmap*, ExceptionState&);
+ static ScriptObject createImageBitmap(EventTarget*, ImageBitmap*, int sx, int sy, int sw, int sh, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, HTMLImageElement*, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, HTMLImageElement*, int sx, int sy, int sw, int sh, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, HTMLVideoElement*, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, HTMLVideoElement*, int sx, int sy, int sw, int sh, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, CanvasRenderingContext2D*, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, CanvasRenderingContext2D*, int sx, int sy, int sw, int sh, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, HTMLCanvasElement*, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, HTMLCanvasElement*, int sx, int sy, int sw, int sh, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, ImageData*, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, ImageData*, int sx, int sy, int sw, int sh, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, ImageBitmap*, ExceptionState&);
-ScriptObject createImageBitmap(EventTarget*, ImageBitmap*, int sx, int sy, int sw, int sh, ExceptionState&);
+ virtual ~ImageBitmapFactories() { }
+ static ImageBitmapFactories* from(DOMWindow*);
+
+private:
+ static const char* supplementName();
+};
-} // namesapce ImageBitmapFactories
} // namespace WebCore
#endif // ImageBitmapFactories_h
« no previous file with comments | « Source/core/page/ImageBitmapFactories.idl ('k') | Source/modules/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698