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

Unified Diff: Source/modules/mediastream/RTCIceCandidate.cpp

Issue 1033983002: Add serializers to RTCIceCandidate and RTCSessionDescription (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-serializer
Patch Set: fix global-interface-listing expectation Created 5 years, 9 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 | « Source/modules/mediastream/RTCIceCandidate.h ('k') | Source/modules/mediastream/RTCIceCandidate.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediastream/RTCIceCandidate.cpp
diff --git a/Source/modules/mediastream/RTCIceCandidate.cpp b/Source/modules/mediastream/RTCIceCandidate.cpp
index ad987607afb496c3c1dba0ce342e362673814c43..ea90f289ebf46678b66915665196c5a2710c4a0d 100644
--- a/Source/modules/mediastream/RTCIceCandidate.cpp
+++ b/Source/modules/mediastream/RTCIceCandidate.cpp
@@ -33,6 +33,8 @@
#include "bindings/core/v8/ExceptionMessages.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/ScriptValue.h"
+#include "bindings/core/v8/V8ObjectBuilder.h"
#include "core/dom/ExceptionCode.h"
#include "modules/mediastream/RTCIceCandidateInit.h"
@@ -101,4 +103,13 @@ void RTCIceCandidate::setSdpMLineIndex(unsigned short sdpMLineIndex)
m_webCandidate.setSdpMLineIndex(sdpMLineIndex);
}
+ScriptValue RTCIceCandidate::toJSONForBinding(ScriptState* scriptState)
+{
+ V8ObjectBuilder result(scriptState);
+ result.addString("candidate", m_webCandidate.candidate());
+ result.addString("sdpMid", m_webCandidate.sdpMid());
+ result.addNumber("sdpMLineIndex", m_webCandidate.sdpMLineIndex());
+ return result.scriptValue();
+}
+
} // namespace blink
« no previous file with comments | « Source/modules/mediastream/RTCIceCandidate.h ('k') | Source/modules/mediastream/RTCIceCandidate.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698