| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 class EventTarget; | 47 class EventTarget; |
| 48 class ExceptionState; | 48 class ExceptionState; |
| 49 class ExecutionContext; | 49 class ExecutionContext; |
| 50 class ImageBitmapSource; | 50 class ImageBitmapSource; |
| 51 class ImageBitmapOptions; | 51 class ImageBitmapOptions; |
| 52 class ImageSource; | 52 class ImageSource; |
| 53 class WebTaskRunner; | 53 class WebTaskRunner; |
| 54 | 54 |
| 55 typedef HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrBlobOrImageDataOr
ImageBitmap ImageBitmapSourceUnion; | 55 typedef HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrBlobOrImageDataOr
ImageBitmap ImageBitmapSourceUnion; |
| 56 | 56 |
| 57 class ImageBitmapFactories final : public NoBaseWillBeGarbageCollectedFinalized<
ImageBitmapFactories>, public WillBeHeapSupplement<LocalDOMWindow>, public WillB
eHeapSupplement<WorkerGlobalScope> { | 57 class ImageBitmapFactories final : public GarbageCollectedFinalized<ImageBitmapF
actories>, public HeapSupplement<LocalDOMWindow>, public HeapSupplement<WorkerGl
obalScope> { |
| 58 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageBitmapFactories); | 58 USING_GARBAGE_COLLECTED_MIXIN(ImageBitmapFactories); |
| 59 USING_FAST_MALLOC_WILL_BE_REMOVED(ImageBitmapFactories); | |
| 60 | |
| 61 public: | 59 public: |
| 62 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, ExceptionState&); | 60 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, ExceptionState&); |
| 63 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, const ImageBitmapOptions&, ExceptionState&); | 61 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, const ImageBitmapOptions&, ExceptionState&); |
| 64 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, int sx, int sy, int sw, int sh, ExceptionState&); | 62 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, int sx, int sy, int sw, int sh, ExceptionState&); |
| 65 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, int sx, int sy, int sw, int sh, const ImageBitmapOptions&,
ExceptionState&); | 63 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima
geBitmapSourceUnion&, int sx, int sy, int sw, int sh, const ImageBitmapOptions&,
ExceptionState&); |
| 66 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, ImageBitm
apSource*, int sx, int sy, int sw, int sh, const ImageBitmapOptions&, ExceptionS
tate&); | 64 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, ImageBitm
apSource*, int sx, int sy, int sw, int sh, const ImageBitmapOptions&, ExceptionS
tate&); |
| 67 | 65 |
| 68 virtual ~ImageBitmapFactories() { } | 66 virtual ~ImageBitmapFactories() { } |
| 69 | 67 |
| 70 DECLARE_TRACE(); | 68 DECLARE_TRACE(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 96 void decodeImageOnDecoderThread(WebTaskRunner*); | 94 void decodeImageOnDecoderThread(WebTaskRunner*); |
| 97 void resolvePromiseOnOriginalThread(PassOwnPtr<ImageSource>); | 95 void resolvePromiseOnOriginalThread(PassOwnPtr<ImageSource>); |
| 98 | 96 |
| 99 // FileReaderLoaderClient | 97 // FileReaderLoaderClient |
| 100 void didStartLoading() override { } | 98 void didStartLoading() override { } |
| 101 void didReceiveData() override { } | 99 void didReceiveData() override { } |
| 102 void didFinishLoading() override; | 100 void didFinishLoading() override; |
| 103 void didFail(FileError::ErrorCode) override; | 101 void didFail(FileError::ErrorCode) override; |
| 104 | 102 |
| 105 FileReaderLoader m_loader; | 103 FileReaderLoader m_loader; |
| 106 RawPtrWillBeMember<ImageBitmapFactories> m_factory; | 104 Member<ImageBitmapFactories> m_factory; |
| 107 Member<ScriptPromiseResolver> m_resolver; | 105 Member<ScriptPromiseResolver> m_resolver; |
| 108 IntRect m_cropRect; | 106 IntRect m_cropRect; |
| 109 ImageBitmapOptions m_options; | 107 ImageBitmapOptions m_options; |
| 110 }; | 108 }; |
| 111 | 109 |
| 112 static ImageBitmapFactories& from(EventTarget&); | 110 static ImageBitmapFactories& from(EventTarget&); |
| 113 | 111 |
| 114 template<class GlobalObject> | 112 template<class GlobalObject> |
| 115 static ImageBitmapFactories& fromInternal(GlobalObject&); | 113 static ImageBitmapFactories& fromInternal(GlobalObject&); |
| 116 | 114 |
| 117 void addLoader(ImageBitmapLoader*); | 115 void addLoader(ImageBitmapLoader*); |
| 118 void didFinishLoading(ImageBitmapLoader*); | 116 void didFinishLoading(ImageBitmapLoader*); |
| 119 | 117 |
| 120 PersistentHeapHashSetWillBeHeapHashSet<Member<ImageBitmapLoader>> m_pendingL
oaders; | 118 HeapHashSet<Member<ImageBitmapLoader>> m_pendingLoaders; |
| 121 }; | 119 }; |
| 122 | 120 |
| 123 } // namespace blink | 121 } // namespace blink |
| 124 | 122 |
| 125 #endif // ImageBitmapFactories_h | 123 #endif // ImageBitmapFactories_h |
| OLD | NEW |