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