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

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

Issue 1917733004: Reland of: Make OffscreenCanvas Transferable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: works! 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/OffscreenCanvasModules.cpp
diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasModules.cpp b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasModules.cpp
index 2979dcbabdb74c80e0c7286a410af02a12fa8a23..a88ff6a5088d18410dcb489605501c3fdb4337e3 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasModules.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasModules.cpp
@@ -10,8 +10,13 @@
namespace blink {
-OffscreenCanvasRenderingContext2D* OffscreenCanvasModules::getContext(OffscreenCanvas& offscreenCanvas, const String& id, const CanvasContextCreationAttributes& attributes)
+OffscreenCanvasRenderingContext2D* OffscreenCanvasModules::getContext(OffscreenCanvas& offscreenCanvas, const String& id, const CanvasContextCreationAttributes& attributes, ExceptionState& exceptionState)
{
+ if (offscreenCanvas.isNeutered()) {
+ exceptionState.throwDOMException(InvalidStateError, "Cannot get context of a neutered OffscreenCanvas");
Justin Novosad 2016/04/26 20:08:32 Message: "OffscreenCanvas object is detached"
xidachen 2016/04/26 20:40:59 Done.
+ return nullptr;
+ }
+
CanvasRenderingContext* context = offscreenCanvas.getCanvasRenderingContext(id, attributes);
if (!context)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698