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

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

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: add some layout tests Created 3 years, 8 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 fbce2ad2d2ae5c912c00567fb5290af5a00cd883..d0a1054be0d8e24eb588aad154fc7031214d052b 100644
--- a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
+++ b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
@@ -115,27 +115,31 @@ DOMMatrixReadOnly* DOMMatrixReadOnly::create(Vector<double> sequence,
}
DOMMatrixReadOnly* DOMMatrixReadOnly::fromFloat32Array(
- DOMFloat32Array* float32Array,
+ NotShared<DOMFloat32Array> float32Array,
ExceptionState& exceptionState) {
- if (float32Array->length() != 6 && float32Array->length() != 16) {
+ if (float32Array.view()->length() != 6 &&
+ float32Array.view()->length() != 16) {
exceptionState.throwTypeError(
"The sequence must contain 6 elements for a 2D matrix or 16 elements a "
"for 3D matrix.");
return nullptr;
}
- return new DOMMatrixReadOnly(float32Array->data(), float32Array->length());
+ return new DOMMatrixReadOnly(float32Array.view()->data(),
+ float32Array.view()->length());
}
DOMMatrixReadOnly* DOMMatrixReadOnly::fromFloat64Array(
- DOMFloat64Array* float64Array,
+ NotShared<DOMFloat64Array> float64Array,
ExceptionState& exceptionState) {
- if (float64Array->length() != 6 && float64Array->length() != 16) {
+ if (float64Array.view()->length() != 6 &&
+ float64Array.view()->length() != 16) {
exceptionState.throwTypeError(
"The sequence must contain 6 elements for a 2D matrix or 16 elements "
"for a 3D matrix.");
return nullptr;
}
- return new DOMMatrixReadOnly(float64Array->data(), float64Array->length());
+ return new DOMMatrixReadOnly(float64Array.view()->data(),
+ float64Array.view()->length());
}
DOMMatrixReadOnly* DOMMatrixReadOnly::fromMatrix(
@@ -275,7 +279,7 @@ DOMMatrixReadOnly::DOMMatrixReadOnly(const TransformationMatrix& matrix,
m_is2D = is2D;
}
-DOMFloat32Array* DOMMatrixReadOnly::toFloat32Array() const {
+NotShared<DOMFloat32Array> DOMMatrixReadOnly::toFloat32Array() const {
float array[] = {
static_cast<float>(m_matrix->m11()), static_cast<float>(m_matrix->m12()),
static_cast<float>(m_matrix->m13()), static_cast<float>(m_matrix->m14()),
@@ -286,17 +290,17 @@ DOMFloat32Array* DOMMatrixReadOnly::toFloat32Array() const {
static_cast<float>(m_matrix->m41()), static_cast<float>(m_matrix->m42()),
static_cast<float>(m_matrix->m43()), static_cast<float>(m_matrix->m44())};
- return DOMFloat32Array::create(array, 16);
+ return NotShared<DOMFloat32Array>(DOMFloat32Array::create(array, 16));
}
-DOMFloat64Array* DOMMatrixReadOnly::toFloat64Array() const {
+NotShared<DOMFloat64Array> DOMMatrixReadOnly::toFloat64Array() const {
double array[] = {
m_matrix->m11(), m_matrix->m12(), m_matrix->m13(), m_matrix->m14(),
m_matrix->m21(), m_matrix->m22(), m_matrix->m23(), m_matrix->m24(),
m_matrix->m31(), m_matrix->m32(), m_matrix->m33(), m_matrix->m34(),
m_matrix->m41(), m_matrix->m42(), m_matrix->m43(), m_matrix->m44()};
- return DOMFloat64Array::create(array, 16);
+ return NotShared<DOMFloat64Array>(DOMFloat64Array::create(array, 16));
}
const String DOMMatrixReadOnly::toString() const {

Powered by Google App Engine
This is Rietveld 408576698