Index: third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp |
diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp |
index 0aedca56e420feed6780983a749a355e6a8f3cd2..2d2070332e5829d683c7d9bfebbb00dfd6bb023e 100644 |
--- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp |
+++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp |
@@ -14,7 +14,8 @@ |
namespace blink { |
OffscreenCanvas::OffscreenCanvas(const IntSize& size) |
- : m_size(size) |
+ : m_canvasId(-1) // DOMNodeIds starts from 0, using -1 to indicate no associated canvas element. |
+ , m_size(size) |
{ } |
OffscreenCanvas::~OffscreenCanvas() |
@@ -35,6 +36,13 @@ void OffscreenCanvas::setHeight(unsigned height) |
m_size.setHeight(clampTo<int>(height)); |
} |
+void OffscreenCanvas::setNeutered() |
+{ |
+ m_isNeutered = true; |
Justin Novosad
2016/04/12 18:10:23
Add "ASSERT(!m_context);"
xidachen
2016/04/12 19:35:14
Done.
|
+ m_size.setWidth(0); |
Justin Novosad
2016/04/12 18:10:23
Why do we need to reset m_size? This has observabl
xidachen
2016/04/12 19:35:14
When an offscreenCanvas gets transferred to worker
|
+ m_size.setHeight(0); |
+} |
+ |
OffscreenCanvasRenderingContext2D* OffscreenCanvas::getContext(const String& id, const CanvasContextCreationAttributes& attributes) |
Justin Novosad
2016/04/12 18:10:23
This method need to throw an InvalidStateError exc
xidachen
2016/04/12 19:35:14
Done.
|
{ |
OffscreenCanvasRenderingContext::ContextType contextType = OffscreenCanvasRenderingContext::contextTypeFromId(id); |
@@ -107,7 +115,6 @@ void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<OffscreenCanvas |
DEFINE_TRACE(OffscreenCanvas) |
{ |
visitor->trace(m_context); |
- visitor->trace(m_canvas); |
} |
} // namespace blink |