Chromium Code Reviews| Index: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
| diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
| index aeb3b6dfd4a28e8d2ea848aa57f0f2f5e6c083fa..52eb1071f75301c5a5850e6c3ffba3c3e8104834 100644 |
| --- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
| +++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
| @@ -32,8 +32,20 @@ void OffscreenCanvas::setHeight(unsigned height) |
| m_size.setHeight(clampTo<int>(height)); |
| } |
| +void OffscreenCanvas::setNeutered() |
| +{ |
| + ASSERT(!m_context); |
| + m_isNeutered = true; |
| + m_size.setWidth(0); |
| + m_size.setHeight(0); |
| +} |
| + |
| ImageBitmap* OffscreenCanvas::transferToImageBitmap(ExceptionState& exceptionState) |
| { |
| + if (m_isNeutered) { |
| + exceptionState.throwDOMException(InvalidStateError, "Cannot transfer an ImageBitmap from a neutered OffscreenCanvas"); |
|
Justin Novosad
2016/04/26 20:08:31
The spec has cleaned up it vocabulare and uses "de
xidachen
2016/04/26 20:40:59
Will have another CL that change the word "neutere
|
| + return nullptr; |
| + } |
| if (!m_context) { |
| exceptionState.throwDOMException(InvalidStateError, "Cannot transfer an ImageBitmap from an OffscreenCanvas with no context"); |
| return nullptr; |
| @@ -93,7 +105,6 @@ void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<CanvasRendering |
| DEFINE_TRACE(OffscreenCanvas) |
| { |
| visitor->trace(m_context); |
| - visitor->trace(m_canvas); |
| } |
| } // namespace blink |