Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp

Issue 1904973003: Revert of Make OffscreenCanvas Transferable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 435ba369368b3d0818c20fdaa42659c5d45bef5d..0aedca56e420feed6780983a749a355e6a8f3cd2 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp
@@ -35,21 +35,8 @@
m_size.setHeight(clampTo<int>(height));
}
-void OffscreenCanvas::setNeutered()
+OffscreenCanvasRenderingContext2D* OffscreenCanvas::getContext(const String& id, const CanvasContextCreationAttributes& attributes)
{
- ASSERT(!m_context);
- m_isNeutered = true;
- m_size.setWidth(0);
- m_size.setHeight(0);
-}
-
-OffscreenCanvasRenderingContext2D* OffscreenCanvas::getContext(const String& id, const CanvasContextCreationAttributes& attributes, ExceptionState& exceptionState)
-{
- if (m_isNeutered) {
- exceptionState.throwDOMException(InvalidStateError, "Cannot get context of a neutered OffscreenCanvas");
- return nullptr;
- }
-
OffscreenCanvasRenderingContext::ContextType contextType = OffscreenCanvasRenderingContext::contextTypeFromId(id);
// Unknown type.
@@ -77,10 +64,6 @@
ImageBitmap* OffscreenCanvas::transferToImageBitmap(ExceptionState& exceptionState)
{
- if (m_isNeutered) {
- exceptionState.throwDOMException(InvalidStateError, "Cannot transfer an ImageBitmap from a neutered OffscreenCanvas");
- return nullptr;
- }
if (!m_context) {
exceptionState.throwDOMException(InvalidStateError, "Cannot transfer an ImageBitmap from an OffscreenCanvas with no context");
return nullptr;
@@ -95,7 +78,6 @@
OffscreenCanvasRenderingContext2D* OffscreenCanvas::renderingContext() const
{
- ASSERT(!m_isNeutered);
// TODO: When there're more than one context type implemented in the future,
// the return type here should be changed to base class of all Offscreen
// context types.
@@ -125,6 +107,7 @@
DEFINE_TRACE(OffscreenCanvas)
{
visitor->trace(m_context);
+ visitor->trace(m_canvas);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698