OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "bindings/core/v8/GeometryInterfaces.h" |
| 6 |
| 7 #include "bindings/core/v8/V8ScriptRunner.h" |
| 8 |
| 9 namespace blink { |
| 10 |
| 11 ScriptValue GeometryInterfaces::createDOMPoint(double x, double y, double z, dou
ble w) |
| 12 { |
| 13 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 14 v8::HandleScope scope(isolate); |
| 15 |
| 16 v8::Local<v8::Value> args[] = { |
| 17 v8::Number::New(isolate, x), |
| 18 v8::Number::New(isolate, y), |
| 19 v8::Number::New(isolate, z), |
| 20 v8::Number::New(isolate, w) |
| 21 }; |
| 22 ScriptState* scriptState = ScriptState::current(isolate); |
| 23 return ScriptValue(scriptState, V8ScriptRunner::callExtraOrCrash(scriptState
, "createDOMPoint", args)); |
| 24 } |
| 25 |
| 26 void GeometryInterfaces::updateDOMPoint(ScriptValue& scriptValue, double x, doub
le y, double z, double w) |
| 27 { |
| 28 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 29 v8::HandleScope scope(isolate); |
| 30 |
| 31 v8::Local<v8::Value> args[] = { |
| 32 scriptValue.v8Value(), |
| 33 v8::Number::New(isolate, x), |
| 34 v8::Number::New(isolate, y), |
| 35 v8::Number::New(isolate, z), |
| 36 v8::Number::New(isolate, w) |
| 37 }; |
| 38 ScriptState* scriptState = ScriptState::current(isolate); |
| 39 V8ScriptRunner::callExtraOrCrash(scriptState, "updateDOMPoint", args); |
| 40 } |
| 41 |
| 42 } // namespace blink |
OLD | NEW |