| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "modules/imagebitmap/ImageBitmapFactories.h" | 32 #include "modules/imagebitmap/ImageBitmapFactories.h" |
| 33 | 33 |
| 34 #include "RuntimeEnabledFeatures.h" | 34 #include "RuntimeEnabledFeatures.h" |
| 35 #include "V8ImageBitmap.h" | 35 #include "V8ImageBitmap.h" |
| 36 #include "bindings/v8/ExceptionMessages.h" | 36 #include "bindings/v8/ExceptionMessages.h" |
| 37 #include "bindings/v8/ExceptionState.h" | 37 #include "bindings/v8/ExceptionState.h" |
| 38 #include "bindings/v8/ScriptScope.h" | 38 #include "bindings/v8/ScriptScope.h" |
| 39 #include "bindings/v8/ScriptState.h" | 39 #include "bindings/v8/ScriptState.h" |
| 40 #include "core/fileapi/Blob.h" |
| 40 #include "core/html/HTMLCanvasElement.h" | 41 #include "core/html/HTMLCanvasElement.h" |
| 41 #include "core/html/HTMLImageElement.h" | 42 #include "core/html/HTMLImageElement.h" |
| 42 #include "core/html/HTMLVideoElement.h" | 43 #include "core/html/HTMLVideoElement.h" |
| 43 #include "core/html/ImageData.h" | 44 #include "core/html/ImageData.h" |
| 44 #include "core/html/canvas/CanvasRenderingContext2D.h" | 45 #include "core/html/canvas/CanvasRenderingContext2D.h" |
| 45 #include "core/frame/DOMWindow.h" | 46 #include "core/frame/DOMWindow.h" |
| 46 #include "core/frame/ImageBitmap.h" | 47 #include "core/frame/ImageBitmap.h" |
| 47 #include "core/workers/WorkerGlobalScope.h" | 48 #include "core/workers/WorkerGlobalScope.h" |
| 48 #include "platform/SharedBuffer.h" | 49 #include "platform/SharedBuffer.h" |
| 49 #include "core/platform/graphics/BitmapImage.h" | 50 #include "core/platform/graphics/BitmapImage.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 : m_loader(FileReaderLoader::ReadAsArrayBuffer, this) | 309 : m_loader(FileReaderLoader::ReadAsArrayBuffer, this) |
| 309 , m_scriptState(ScriptState::current()) | 310 , m_scriptState(ScriptState::current()) |
| 310 , m_factory(factory) | 311 , m_factory(factory) |
| 311 , m_resolver(resolver) | 312 , m_resolver(resolver) |
| 312 , m_cropRect(cropRect) | 313 , m_cropRect(cropRect) |
| 313 { | 314 { |
| 314 } | 315 } |
| 315 | 316 |
| 316 void ImageBitmapFactories::ImageBitmapLoader::loadBlobAsync(ExecutionContext* co
ntext, Blob* blob) | 317 void ImageBitmapFactories::ImageBitmapLoader::loadBlobAsync(ExecutionContext* co
ntext, Blob* blob) |
| 317 { | 318 { |
| 318 m_loader.start(context, *blob); | 319 m_loader.start(context, blob->blobDataHandle()); |
| 319 } | 320 } |
| 320 | 321 |
| 321 void ImageBitmapFactories::ImageBitmapLoader::rejectPromise() | 322 void ImageBitmapFactories::ImageBitmapLoader::rejectPromise() |
| 322 { | 323 { |
| 323 v8::Isolate* isolate = m_scriptState->isolate(); | 324 v8::Isolate* isolate = m_scriptState->isolate(); |
| 324 ScriptScope scope(m_scriptState); | 325 ScriptScope scope(m_scriptState); |
| 325 m_resolver->reject(ScriptValue(v8::Null(isolate), isolate)); | 326 m_resolver->reject(ScriptValue(v8::Null(isolate), isolate)); |
| 326 m_factory->didFinishLoading(this); | 327 m_factory->didFinishLoading(this); |
| 327 } | 328 } |
| 328 | 329 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 357 m_resolver->fulfill(imageBitmap.release()); | 358 m_resolver->fulfill(imageBitmap.release()); |
| 358 m_factory->didFinishLoading(this); | 359 m_factory->didFinishLoading(this); |
| 359 } | 360 } |
| 360 | 361 |
| 361 void ImageBitmapFactories::ImageBitmapLoader::didFail(FileError::ErrorCode) | 362 void ImageBitmapFactories::ImageBitmapLoader::didFail(FileError::ErrorCode) |
| 362 { | 363 { |
| 363 rejectPromise(); | 364 rejectPromise(); |
| 364 } | 365 } |
| 365 | 366 |
| 366 } // namespace WebCore | 367 } // namespace WebCore |
| OLD | NEW |