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

Unified Diff: third_party/WebKit/Source/core/dom/DOMPointReadOnly.cpp

Issue 2587743002: The DOMPointReadOnly interface requires serializer. (Closed)
Patch Set: The DOMPointReadOnly interface requires serializer. Created 4 years 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/dom/DOMPointReadOnly.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMPointReadOnly.cpp b/third_party/WebKit/Source/core/dom/DOMPointReadOnly.cpp
index e62791e37598756a2fffdb02bcf8ad953ebd1ee7..024d0626c98c9684c0996b9f31aea04f610d5466 100644
--- a/third_party/WebKit/Source/core/dom/DOMPointReadOnly.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMPointReadOnly.cpp
@@ -4,6 +4,9 @@
#include "core/dom/DOMPointReadOnly.h"
+#include "bindings/core/v8/ScriptValue.h"
+#include "bindings/core/v8/V8ObjectBuilder.h"
+
namespace blink {
DOMPointReadOnly* DOMPointReadOnly::create(double x,
@@ -13,6 +16,16 @@ DOMPointReadOnly* DOMPointReadOnly::create(double x,
return new DOMPointReadOnly(x, y, z, w);
}
+ScriptValue DOMPointReadOnly::toJSONForBinding(
+ ScriptState* scriptState) const {
+ V8ObjectBuilder result(scriptState);
+ result.addNumber("x", x());
+ result.addNumber("y", y());
+ result.addNumber("z", z());
+ result.addNumber("w", w());
+ return result.scriptValue();
+}
+
DOMPointReadOnly::DOMPointReadOnly(double x, double y, double z, double w)
: m_x(x), m_y(y), m_z(z), m_w(w) {}
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMPointReadOnly.h ('k') | third_party/WebKit/Source/core/dom/DOMPointReadOnly.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698