| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 static ImageBitmapLoader* create(ImageBitmapFactories& factory, const In
tRect& cropRect, ScriptState* scriptState) | 74 static ImageBitmapLoader* create(ImageBitmapFactories& factory, const In
tRect& cropRect, ScriptState* scriptState) |
| 75 { | 75 { |
| 76 return new ImageBitmapLoader(factory, cropRect, scriptState); | 76 return new ImageBitmapLoader(factory, cropRect, scriptState); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void loadBlobAsync(ExecutionContext*, Blob*); | 79 void loadBlobAsync(ExecutionContext*, Blob*); |
| 80 ScriptPromise promise() { return m_resolver->promise(); } | 80 ScriptPromise promise() { return m_resolver->promise(); } |
| 81 | 81 |
| 82 DECLARE_TRACE(); | 82 DECLARE_TRACE(); |
| 83 | 83 |
| 84 virtual ~ImageBitmapLoader() { } | 84 ~ImageBitmapLoader() override { } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 ImageBitmapLoader(ImageBitmapFactories&, const IntRect&, ScriptState*); | 87 ImageBitmapLoader(ImageBitmapFactories&, const IntRect&, ScriptState*); |
| 88 | 88 |
| 89 void rejectPromise(); | 89 void rejectPromise(); |
| 90 | 90 |
| 91 // FileReaderLoaderClient | 91 // FileReaderLoaderClient |
| 92 virtual void didStartLoading() override { } | 92 void didStartLoading() override { } |
| 93 virtual void didReceiveData() override { } | 93 void didReceiveData() override { } |
| 94 virtual void didFinishLoading() override; | 94 void didFinishLoading() override; |
| 95 virtual void didFail(FileError::ErrorCode) override; | 95 void didFail(FileError::ErrorCode) override; |
| 96 | 96 |
| 97 FileReaderLoader m_loader; | 97 FileReaderLoader m_loader; |
| 98 RawPtrWillBeMember<ImageBitmapFactories> m_factory; | 98 RawPtrWillBeMember<ImageBitmapFactories> m_factory; |
| 99 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; | 99 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; |
| 100 IntRect m_cropRect; | 100 IntRect m_cropRect; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 static ImageBitmapFactories& from(EventTarget&); | 103 static ImageBitmapFactories& from(EventTarget&); |
| 104 | 104 |
| 105 template<class GlobalObject> | 105 template<class GlobalObject> |
| 106 static ImageBitmapFactories& fromInternal(GlobalObject&); | 106 static ImageBitmapFactories& fromInternal(GlobalObject&); |
| 107 | 107 |
| 108 void addLoader(ImageBitmapLoader*); | 108 void addLoader(ImageBitmapLoader*); |
| 109 void didFinishLoading(ImageBitmapLoader*); | 109 void didFinishLoading(ImageBitmapLoader*); |
| 110 | 110 |
| 111 PersistentHeapHashSetWillBeHeapHashSet<Member<ImageBitmapLoader>> m_pendingL
oaders; | 111 PersistentHeapHashSetWillBeHeapHashSet<Member<ImageBitmapLoader>> m_pendingL
oaders; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace blink | 114 } // namespace blink |
| 115 | 115 |
| 116 #endif // ImageBitmapFactories_h | 116 #endif // ImageBitmapFactories_h |
| OLD | NEW |