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

Unified Diff: third_party/WebKit/Source/core/geometry/DOMMatrix.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/DOMMatrix.cpp
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp
index b87df838606e3c2599dc4e4769fcdb35e2ca82b0..13a2e3c85056338869b3ae6eabd5b11a513c0618 100644
--- a/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp
+++ b/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp
@@ -6,13 +6,21 @@
namespace blink {
-DOMMatrix* DOMMatrix::Create(ExceptionState& exception_state) {
+DOMMatrix* DOMMatrix::Create(ExecutionContext* execution_context,
+ ExceptionState& exception_state) {
return new DOMMatrix(TransformationMatrix());
}
-DOMMatrix* DOMMatrix::Create(StringOrUnrestrictedDoubleSequence& init,
+DOMMatrix* DOMMatrix::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;
+ }
+
DOMMatrix* matrix = new DOMMatrix(TransformationMatrix());
matrix->SetMatrixValueFromString(init.getAsString(), exception_state);
return matrix;
« no previous file with comments | « third_party/WebKit/Source/core/geometry/DOMMatrix.h ('k') | third_party/WebKit/Source/core/geometry/DOMMatrix.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698