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

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

Issue 2520973002: Fix a small error in exception handling in convertToBlob (Closed)
Patch Set: 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..d04a4cd040075225594278e464eb9b30780d408e 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
@@ -203,6 +203,12 @@ ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState,
return exceptionState.reject(scriptState);
}
+ if (!width() || !height()) {
+ exceptionState.throwDOMException(
+ IndexSizeError, "Zero-sized OffscreenCanvas cannot be transferred.");
xlai (Olivia) 2016/11/21 16:34:00 Also, change the error msg. I think it has nothing
xidachen 2016/11/21 16:40:28 Done.
+ return exceptionState.reject(scriptState);
+ }
+
if (!this->isPaintable()) {
return ScriptPromise();
xlai (Olivia) 2016/11/21 16:34:00 Actually, the third case is already handled in thi
xidachen 2016/11/21 16:40:28 Done, makes perfect sense.
}
« 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