OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef ImageBitmapFactories_h | 31 #ifndef ImageBitmapFactories_h |
32 #define ImageBitmapFactories_h | 32 #define ImageBitmapFactories_h |
33 | 33 |
34 #include "bindings/core/v8/ScriptPromise.h" | 34 #include "bindings/core/v8/ScriptPromise.h" |
35 #include "bindings/core/v8/ScriptPromiseResolver.h" | 35 #include "bindings/core/v8/ScriptPromiseResolver.h" |
36 #include "bindings/core/v8/ScriptState.h" | 36 #include "bindings/core/v8/ScriptState.h" |
| 37 #include "bindings/core/v8/UnionTypesCore.h" |
37 #include "core/fileapi/FileReaderLoader.h" | 38 #include "core/fileapi/FileReaderLoader.h" |
38 #include "core/fileapi/FileReaderLoaderClient.h" | 39 #include "core/fileapi/FileReaderLoaderClient.h" |
39 #include "platform/Supplementable.h" | 40 #include "platform/Supplementable.h" |
40 #include "platform/geometry/IntRect.h" | 41 #include "platform/geometry/IntRect.h" |
41 #include "wtf/Forward.h" | |
42 #include "wtf/HashSet.h" | |
43 | 42 |
44 namespace blink { | 43 namespace blink { |
45 | 44 |
| 45 class ImageBitmapSource; |
46 class Blob; | 46 class Blob; |
47 class EventTarget; | 47 class EventTarget; |
48 class ExceptionState; | 48 class ExceptionState; |
49 class ImageBitmap; | |
50 class ImageData; | |
51 class ExecutionContext; | 49 class ExecutionContext; |
52 | 50 |
| 51 typedef HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrBlobOrImageDataOr
ImageBitmap ImageBitmapSourceUnion; |
| 52 |
53 class ImageBitmapFactories final : public NoBaseWillBeGarbageCollectedFinalized<
ImageBitmapFactories>, public WillBeHeapSupplement<LocalDOMWindow>, public WillB
eHeapSupplement<WorkerGlobalScope> { | 53 class ImageBitmapFactories final : public NoBaseWillBeGarbageCollectedFinalized<
ImageBitmapFactories>, public WillBeHeapSupplement<LocalDOMWindow>, public WillB
eHeapSupplement<WorkerGlobalScope> { |
54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageBitmapFactories); | 54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageBitmapFactories); |
55 USING_FAST_MALLOC_WILL_BE_REMOVED(ImageBitmapFactories); | 55 USING_FAST_MALLOC_WILL_BE_REMOVED(ImageBitmapFactories); |
56 | 56 |
57 public: | 57 public: |
58 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, Blob*, Ex
ceptionState&); | 58 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, ExceptionState&); |
59 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, Blob*, in
t sx, int sy, int sw, int sh, ExceptionState&); | 59 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, int sx, int sy, int sw, int sh, ExceptionState&); |
60 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, ImageData
*, ExceptionState&); | 60 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, ImageBitm
apSource*, int sx, int sy, int sw, int sh, ExceptionState&); |
61 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, ImageData
*, int sx, int sy, int sw, int sh, ExceptionState&); | |
62 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, ImageBitm
ap*, ExceptionState&); | |
63 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, ImageBitm
ap*, int sx, int sy, int sw, int sh, ExceptionState&); | |
64 | 61 |
65 virtual ~ImageBitmapFactories() { } | 62 virtual ~ImageBitmapFactories() { } |
66 | 63 |
67 DECLARE_TRACE(); | 64 DECLARE_TRACE(); |
68 | 65 |
69 protected: | 66 protected: |
70 static const char* supplementName(); | 67 static const char* supplementName(); |
71 | 68 |
72 private: | 69 private: |
73 class ImageBitmapLoader final : public GarbageCollectedFinalized<ImageBitmap
Loader>, public FileReaderLoaderClient { | 70 class ImageBitmapLoader final : public GarbageCollectedFinalized<ImageBitmap
Loader>, public FileReaderLoaderClient { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 105 |
109 void addLoader(ImageBitmapLoader*); | 106 void addLoader(ImageBitmapLoader*); |
110 void didFinishLoading(ImageBitmapLoader*); | 107 void didFinishLoading(ImageBitmapLoader*); |
111 | 108 |
112 PersistentHeapHashSetWillBeHeapHashSet<Member<ImageBitmapLoader>> m_pendingL
oaders; | 109 PersistentHeapHashSetWillBeHeapHashSet<Member<ImageBitmapLoader>> m_pendingL
oaders; |
113 }; | 110 }; |
114 | 111 |
115 } // namespace blink | 112 } // namespace blink |
116 | 113 |
117 #endif // ImageBitmapFactories_h | 114 #endif // ImageBitmapFactories_h |
OLD | NEW |