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

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

Issue 2868953002: Stop accepting string constructor of DOMMatrix on workers (Closed)
Patch Set: x 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..b7e45a254475d8ac7e1c99b4eff15ad2e6ec1129 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->IsDocument()) {
+ exception_state.ThrowTypeError(
+ "DOMMatrix can't be constructed with strings on workers.");
+ return nullptr;
+ }
+
DOMMatrixReadOnly* matrix = new DOMMatrixReadOnly(TransformationMatrix());
matrix->SetMatrixValueFromString(init.getAsString(), exception_state);
return matrix;

Powered by Google App Engine
This is Rietveld 408576698