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

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

Issue 2520973002: Fix a small error in exception handling in convertToBlob (Closed)
Patch Set: address comments. Created 4 years, 1 month 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/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-convertToBlob.html ('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 550ae97f7812703f3bfd86bc1fb93d68371313ce..74d2988faa73344dbc3d3a83d460da634de4f2ea 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
@@ -204,7 +204,9 @@ ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState,
}
if (!this->isPaintable()) {
- return ScriptPromise();
+ exceptionState.throwDOMException(
+ IndexSizeError, "The size of the OffscreenCanvas is zero.");
+ return exceptionState.reject(scriptState);
}
double startTime = WTF::monotonicallyIncreasingTime();
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-convertToBlob.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698