| Index: third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
|
| diff --git a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
|
| index 83227e68047d8112b0a028632c1852916ea0ce21..f73c6f8756e1cdce3c7499d270b833d1a088e5aa 100644
|
| --- a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
|
| +++ b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
|
| @@ -27,12 +27,19 @@ void ImageBitmapRenderingContext::setCanvasGetContextResult(
|
| }
|
|
|
| void ImageBitmapRenderingContext::transferFromImageBitmap(
|
| - ImageBitmap* imageBitmap) {
|
| + ImageBitmap* imageBitmap,
|
| + ExceptionState& exceptionState) {
|
| if (!imageBitmap) {
|
| m_image.release();
|
| return;
|
| }
|
|
|
| + if (imageBitmap->isNeutered()) {
|
| + exceptionState.throwDOMException(InvalidStateError,
|
| + "The input ImageBitmap has been detached");
|
| + return;
|
| + }
|
| +
|
| m_image = imageBitmap->bitmapImage();
|
| if (!m_image)
|
| return;
|
| @@ -53,6 +60,7 @@ void ImageBitmapRenderingContext::transferFromImageBitmap(
|
| }
|
| canvas()->didDraw(
|
| FloatRect(FloatPoint(), FloatSize(m_image->width(), m_image->height())));
|
| + imageBitmap->close();
|
| }
|
|
|
| bool ImageBitmapRenderingContext::paint(GraphicsContext& gc, const IntRect& r) {
|
|
|