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

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

Issue 2695343002: Handle OffscreenCanvas.convertToBlob exceptions: EncodingError & InvalidStateError (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ea7dd1d06b1bde620311c0cc754ef06399d5fa75..a41f0c69a83ff962d9490753f956682b135ca320 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
@@ -305,7 +305,9 @@ ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState,
imageData = this->renderingContext()->toImageData(SnapshotReasonUnknown);
}
if (!imageData) {
- return ScriptPromise();
+ exceptionState.throwDOMException(
+ InvalidStateError, "OffscreenCanvas object has no rendering contexts");
+ return exceptionState.reject(scriptState);
}
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
« no previous file with comments | « third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698