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

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

Issue 2635543003: [GeometryInterface] add toJSON() function in DOMQuad (Closed)
Patch Set: [GeometryInterface] add toJson() function in DOMQuad Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMQuad.h ('k') | third_party/WebKit/Source/core/dom/DOMQuad.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/DOMQuad.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMQuad.cpp b/third_party/WebKit/Source/core/dom/DOMQuad.cpp
index 21952c05fc4e98398bfe04237ed7844cef614767..e93bce2293dbe2b0997b063edb1a09dad994b112 100644
--- a/third_party/WebKit/Source/core/dom/DOMQuad.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMQuad.cpp
@@ -4,6 +4,7 @@
#include "core/dom/DOMQuad.h"
+#include "bindings/core/v8/V8ObjectBuilder.h"
#include "core/dom/DOMPoint.h"
namespace blink {
@@ -24,4 +25,13 @@ DOMQuad::DOMQuad(const DOMPointInit& p1,
m_p3(DOMPoint::fromPoint(p3)),
m_p4(DOMPoint::fromPoint(p4)) {}
+ScriptValue DOMQuad::toJSONForBinding(ScriptState* scriptState) const {
+ V8ObjectBuilder result(scriptState);
+ result.add("p1", p1());
+ result.add("p2", p2());
+ result.add("p3", p3());
+ result.add("p4", p4());
+ return result.scriptValue();
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMQuad.h ('k') | third_party/WebKit/Source/core/dom/DOMQuad.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698