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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "platform/graphics/ImageSource.h" | 43 #include "platform/graphics/ImageSource.h" |
44 #include "platform/graphics/StaticBitmapImage.h" | 44 #include "platform/graphics/StaticBitmapImage.h" |
45 #include "public/platform/WebSize.h" | 45 #include "public/platform/WebSize.h" |
46 #include "third_party/skia/include/core/SkImage.h" | 46 #include "third_party/skia/include/core/SkImage.h" |
47 #include <v8.h> | 47 #include <v8.h> |
48 | 48 |
49 namespace blink { | 49 namespace blink { |
50 | 50 |
51 static ScriptPromise fulfillImageBitmap(ScriptState* scriptState, PassRefPtrWill
BeRawPtr<ImageBitmap> imageBitmap) | 51 static ScriptPromise fulfillImageBitmap(ScriptState* scriptState, PassRefPtrWill
BeRawPtr<ImageBitmap> imageBitmap) |
52 { | 52 { |
53 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); | 53 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
54 ScriptPromise promise = resolver->promise(); | 54 ScriptPromise promise = resolver->promise(); |
55 if (imageBitmap) { | 55 if (imageBitmap) { |
56 resolver->resolve(imageBitmap); | 56 resolver->resolve(imageBitmap); |
57 } else { | 57 } else { |
58 resolver->reject(ScriptValue(scriptState, v8::Null(scriptState->isolate(
)))); | 58 resolver->reject(ScriptValue(scriptState, v8::Null(scriptState->isolate(
)))); |
59 } | 59 } |
60 return promise; | 60 return promise; |
61 } | 61 } |
62 | 62 |
63 ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState,
EventTarget& eventTarget, Blob* blob, ExceptionState& exceptionState) | 63 ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState,
EventTarget& eventTarget, Blob* blob, ExceptionState& exceptionState) |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 rejectPromise(); | 208 rejectPromise(); |
209 } | 209 } |
210 | 210 |
211 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) | 211 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) |
212 { | 212 { |
213 visitor->trace(m_factory); | 213 visitor->trace(m_factory); |
214 visitor->trace(m_resolver); | 214 visitor->trace(m_resolver); |
215 } | 215 } |
216 | 216 |
217 } // namespace blink | 217 } // namespace blink |
OLD | NEW |