| Index: third_party/WebKit/Source/bindings/core/v8/custom/V8DOMMatrixReadOnlyCustom.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8DOMMatrixReadOnlyCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8DOMMatrixReadOnlyCustom.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..44a0ccd4015c09ccadf838239c9981aeb933d2f9
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8DOMMatrixReadOnlyCustom.cpp
|
| @@ -0,0 +1,47 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "bindings/core/v8/V8DOMMatrixReadOnly.h"
|
| +
|
| +#include "bindings/core/v8/V8DOMMatrixInit.h"
|
| +#include "core/dom/DOMMatrix.h"
|
| +#include "core/dom/DOMMatrixInit.h"
|
| +
|
| +namespace blink {
|
| +
|
| +void V8DOMMatrixReadOnly::multiplyMethodCustom(
|
| + const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| + ExceptionState exceptionState(info.GetIsolate(),
|
| + ExceptionState::ExecutionContext,
|
| + "DOMMatrixReadOnly", "multiply");
|
| +
|
| + DOMMatrixReadOnly* impl = V8DOMMatrixReadOnly::toImpl(info.Holder());
|
| +
|
| + if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
|
| + exceptionState.throwTypeError("parameter 1 ('other') is not an object.");
|
| +
|
| + return;
|
| + }
|
| +
|
| + if (DOMMatrixReadOnly* otherMatrix = V8DOMMatrixReadOnly::toImplWithTypeCheck(
|
| + info.GetIsolate(), info[0])) {
|
| + v8SetReturnValue(info,
|
| + DOMMatrix::create(impl->matrix() * otherMatrix->matrix()));
|
| + return;
|
| + }
|
| +
|
| + DOMMatrixInit other;
|
| + V8DOMMatrixInit::toImpl(info.GetIsolate(), info[0], other, exceptionState);
|
| + if (exceptionState.hadException()) {
|
| + return;
|
| + }
|
| +
|
| + DOMMatrix* result = impl->multiply(other, exceptionState);
|
| + if (exceptionState.hadException()) {
|
| + return;
|
| + }
|
| + v8SetReturnValue(info, result);
|
| +}
|
| +
|
| +} // namespace blink
|
|
|