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

Unified Diff: third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp

Issue 2868953002: Stop accepting string constructor of DOMMatrix on workers (Closed)
Patch Set: Created 3 years, 7 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/core/geometry/DOMMatrixReadOnly.cpp
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
index 876729c9d273ea17eb17a8eaa8c750d523d9b25e..97e587e9009c2c9df8eb377df6dcf85d161deb14 100644
--- a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
+++ b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
@@ -92,14 +92,23 @@ bool DOMMatrixReadOnly::ValidateAndFixup(DOMMatrixInit& other,
return true;
}
-DOMMatrixReadOnly* DOMMatrixReadOnly::Create(ExceptionState& exception_state) {
+DOMMatrixReadOnly* DOMMatrixReadOnly::Create(
+ ExecutionContext* execution_context,
+ ExceptionState& exception_state) {
return new DOMMatrixReadOnly(TransformationMatrix());
}
DOMMatrixReadOnly* DOMMatrixReadOnly::Create(
+ ExecutionContext* execution_context,
StringOrUnrestrictedDoubleSequence& init,
ExceptionState& exception_state) {
if (init.isString()) {
+ if (execution_context->IsWorkerOrWorkletGlobalScope()) {
Justin Novosad 2017/05/09 15:28:19 The spec says to throw if the global object is not
fserb 2017/05/11 19:13:55 foolip got that! :)
+ exception_state.ThrowTypeError(
+ "String constructor can't be used on workers.");
Justin Novosad 2017/05/09 15:29:07 This message is unclear. Are we constructing a St
fserb 2017/05/11 19:13:55 changed.
+ return nullptr;
+ }
+
DOMMatrixReadOnly* matrix = new DOMMatrixReadOnly(TransformationMatrix());
matrix->SetMatrixValueFromString(init.getAsString(), exception_state);
return matrix;

Powered by Google App Engine
This is Rietveld 408576698