| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 return ScriptPromise(); | 334 return ScriptPromise(); |
| 335 } | 335 } |
| 336 if (readyState() <= HTMLMediaElement::HAVE_METADATA) { | 336 if (readyState() <= HTMLMediaElement::HAVE_METADATA) { |
| 337 exceptionState.throwDOMException(InvalidStateError, "The provided elemen
t's player has no current data."); | 337 exceptionState.throwDOMException(InvalidStateError, "The provided elemen
t's player has no current data."); |
| 338 return ScriptPromise(); | 338 return ScriptPromise(); |
| 339 } | 339 } |
| 340 if (!sw || !sh) { | 340 if (!sw || !sh) { |
| 341 exceptionState.throwDOMException(IndexSizeError, String::format("The sou
rce %s provided is 0.", sw ? "height" : "width")); | 341 exceptionState.throwDOMException(IndexSizeError, String::format("The sou
rce %s provided is 0.", sw ? "height" : "width")); |
| 342 return ScriptPromise(); | 342 return ScriptPromise(); |
| 343 } | 343 } |
| 344 if (!hasSingleSecurityOrigin()) { | 344 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, IntRect(sx, sy, sw, sh), |
| 345 exceptionState.throwSecurityError("The source video contains image data
from multiple origins."); | 345 !(!hasSingleSecurityOrigin() |
| 346 return ScriptPromise(); | 346 || (!webMediaPlayer()->didPassCORSAccessCheck() |
| 347 } | 347 && eventTarget.toDOMWindow()->document()->securityOrigin()->taintsCanvas(cur
rentSrc()))))); |
| 348 if (!webMediaPlayer()->didPassCORSAccessCheck() | |
| 349 && eventTarget.toDOMWindow()->document()->securityOrigin()->taintsCanvas
(currentSrc())) { | |
| 350 exceptionState.throwSecurityError("Cross-origin access to the source vid
eo is denied."); | |
| 351 return ScriptPromise(); | |
| 352 } | |
| 353 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, IntRect(sx, sy, sw, sh))); | |
| 354 } | 348 } |
| 355 | 349 |
| 356 } // namespace blink | 350 } // namespace blink |
| OLD | NEW |