| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 { | 311 { |
| 312 } | 312 } |
| 313 | 313 |
| 314 void ImageBitmapFactories::ImageBitmapLoader::loadBlobAsync(ScriptExecutionConte
xt* context, Blob* blob) | 314 void ImageBitmapFactories::ImageBitmapLoader::loadBlobAsync(ScriptExecutionConte
xt* context, Blob* blob) |
| 315 { | 315 { |
| 316 m_loader.start(context, *blob); | 316 m_loader.start(context, *blob); |
| 317 } | 317 } |
| 318 | 318 |
| 319 void ImageBitmapFactories::ImageBitmapLoader::rejectPromise() | 319 void ImageBitmapFactories::ImageBitmapLoader::rejectPromise() |
| 320 { | 320 { |
| 321 v8::Isolate* isolate = m_scriptState->isolate(); |
| 321 ScriptScope scope(m_scriptState); | 322 ScriptScope scope(m_scriptState); |
| 322 m_resolver->reject(ScriptValue::createNull()); | 323 m_resolver->reject(ScriptValue(v8::Null(isolate), isolate)); |
| 323 m_factory->didFinishLoading(this); | 324 m_factory->didFinishLoading(this); |
| 324 } | 325 } |
| 325 | 326 |
| 326 void ImageBitmapFactories::ImageBitmapLoader::didFinishLoading() | 327 void ImageBitmapFactories::ImageBitmapLoader::didFinishLoading() |
| 327 { | 328 { |
| 328 if (!m_loader.arrayBufferResult()) { | 329 if (!m_loader.arrayBufferResult()) { |
| 329 rejectPromise(); | 330 rejectPromise(); |
| 330 return; | 331 return; |
| 331 } | 332 } |
| 332 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create((char*)m_loader.arr
ayBufferResult()->data(), m_loader.arrayBufferResult()->byteLength()); | 333 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create((char*)m_loader.arr
ayBufferResult()->data(), m_loader.arrayBufferResult()->byteLength()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 354 m_resolver->fulfill(imageBitmap.release()); | 355 m_resolver->fulfill(imageBitmap.release()); |
| 355 m_factory->didFinishLoading(this); | 356 m_factory->didFinishLoading(this); |
| 356 } | 357 } |
| 357 | 358 |
| 358 void ImageBitmapFactories::ImageBitmapLoader::didFail(FileError::ErrorCode) | 359 void ImageBitmapFactories::ImageBitmapLoader::didFail(FileError::ErrorCode) |
| 359 { | 360 { |
| 360 rejectPromise(); | 361 rejectPromise(); |
| 361 } | 362 } |
| 362 | 363 |
| 363 } // namespace WebCore | 364 } // namespace WebCore |
| OLD | NEW |