| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/imagebitmap/ImageBitmapSource.h" | 5 #include "core/imagebitmap/ImageBitmapSource.h" |
| 6 | 6 |
| 7 #include "core/frame/ImageBitmap.h" | 7 #include "core/frame/ImageBitmap.h" |
| 8 #include "core/imagebitmap/ImageBitmapOptions.h" | 8 #include "core/imagebitmap/ImageBitmapOptions.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 ScriptPromise ImageBitmapSource::fulfillImageBitmap(ScriptState* scriptState, Pa
ssRefPtrWillBeRawPtr<ImageBitmap> imageBitmap) | 12 ScriptPromise ImageBitmapSource::fulfillImageBitmap(ScriptState* scriptState, Ra
wPtr<ImageBitmap> imageBitmap) |
| 13 { | 13 { |
| 14 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; | 14 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
| 15 ScriptPromise promise = resolver->promise(); | 15 ScriptPromise promise = resolver->promise(); |
| 16 if (imageBitmap && imageBitmap->bitmapImage()) { | 16 if (imageBitmap && imageBitmap->bitmapImage()) { |
| 17 resolver->resolve(imageBitmap); | 17 resolver->resolve(imageBitmap); |
| 18 } else { | 18 } else { |
| 19 resolver->reject(ScriptValue(scriptState, v8::Null(scriptState->isolate(
)))); | 19 resolver->reject(ScriptValue(scriptState, v8::Null(scriptState->isolate(
)))); |
| 20 } | 20 } |
| 21 return promise; | 21 return promise; |
| 22 } | 22 } |
| 23 | 23 |
| 24 ScriptPromise ImageBitmapSource::createImageBitmap(ScriptState* scriptState, Eve
ntTarget& eventTarget, int sx, int sy, int sw, int sh, const ImageBitmapOptions&
options, ExceptionState& exceptionState) | 24 ScriptPromise ImageBitmapSource::createImageBitmap(ScriptState* scriptState, Eve
ntTarget& eventTarget, int sx, int sy, int sw, int sh, const ImageBitmapOptions&
options, ExceptionState& exceptionState) |
| 25 { | 25 { |
| 26 return ScriptPromise(); | 26 return ScriptPromise(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 } // namespace blink | 29 } // namespace blink |
| OLD | NEW |