| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 static LayoutSize sizeFor(HTMLImageElement* image) | 54 static LayoutSize sizeFor(HTMLImageElement* image) |
| 55 { | 55 { |
| 56 if (ImageResource* cachedImage = image->cachedImage()) | 56 if (ImageResource* cachedImage = image->cachedImage()) |
| 57 return cachedImage->imageSizeForLayoutObject(image->layoutObject(), 1.0f
); // FIXME: Not sure about this. | 57 return cachedImage->imageSizeForLayoutObject(image->layoutObject(), 1.0f
); // FIXME: Not sure about this. |
| 58 return LayoutSize(); | 58 return LayoutSize(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 static IntSize sizeFor(HTMLVideoElement* video) | 61 static IntSize sizeFor(HTMLVideoElement* video) |
| 62 { | 62 { |
| 63 if (blink::WebMediaPlayer* webMediaPlayer = video->webMediaPlayer()) | 63 if (WebMediaPlayer* webMediaPlayer = video->webMediaPlayer()) |
| 64 return webMediaPlayer->naturalSize(); | 64 return webMediaPlayer->naturalSize(); |
| 65 return IntSize(); | 65 return IntSize(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 static ScriptPromise fulfillImageBitmap(ScriptState* scriptState, PassRefPtrWill
BeRawPtr<ImageBitmap> imageBitmap) | 68 static ScriptPromise fulfillImageBitmap(ScriptState* scriptState, PassRefPtrWill
BeRawPtr<ImageBitmap> imageBitmap) |
| 69 { | 69 { |
| 70 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); | 70 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); |
| 71 ScriptPromise promise = resolver->promise(); | 71 ScriptPromise promise = resolver->promise(); |
| 72 if (imageBitmap) { | 72 if (imageBitmap) { |
| 73 resolver->resolve(imageBitmap); | 73 resolver->resolve(imageBitmap); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 rejectPromise(); | 332 rejectPromise(); |
| 333 } | 333 } |
| 334 | 334 |
| 335 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) | 335 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) |
| 336 { | 336 { |
| 337 visitor->trace(m_factory); | 337 visitor->trace(m_factory); |
| 338 visitor->trace(m_resolver); | 338 visitor->trace(m_resolver); |
| 339 } | 339 } |
| 340 | 340 |
| 341 } // namespace blink | 341 } // namespace blink |
| OLD | NEW |