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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/GeometryInterfaces.cpp

Issue 1709003002: Geometry: Reimplement DOMPoint using V8 extras. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/bindings/core/v8/GeometryInterfaces.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/GeometryInterfaces.cpp b/third_party/WebKit/Source/bindings/core/v8/GeometryInterfaces.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..da2d445d9f21f15fe2b001094f45c536b6d15dc1
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/core/v8/GeometryInterfaces.cpp
@@ -0,0 +1,42 @@
+// Copyright 2016 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/GeometryInterfaces.h"
+
+#include "bindings/core/v8/V8ScriptRunner.h"
+
+namespace blink {
+
+ScriptValue GeometryInterfaces::createDOMPoint(double x, double y, double z, double w)
+{
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope scope(isolate);
+
+ v8::Local<v8::Value> args[] = {
+ v8::Number::New(isolate, x),
+ v8::Number::New(isolate, y),
+ v8::Number::New(isolate, z),
+ v8::Number::New(isolate, w)
+ };
+ ScriptState* scriptState = ScriptState::current(isolate);
+ return ScriptValue(scriptState, V8ScriptRunner::callExtraOrCrash(scriptState, "createDOMPoint", args));
+}
+
+void GeometryInterfaces::updateDOMPoint(ScriptValue& scriptValue, double x, double y, double z, double w)
+{
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope scope(isolate);
+
+ v8::Local<v8::Value> args[] = {
+ scriptValue.v8Value(),
+ v8::Number::New(isolate, x),
+ v8::Number::New(isolate, y),
+ v8::Number::New(isolate, z),
+ v8::Number::New(isolate, w)
+ };
+ ScriptState* scriptState = ScriptState::current(isolate);
+ V8ScriptRunner::callExtraOrCrash(scriptState, "updateDOMPoint", args);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698