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

Unified Diff: Source/modules/mediastream/RTCSessionDescription.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
Index: Source/modules/mediastream/RTCSessionDescription.cpp
diff --git a/Source/modules/mediastream/RTCSessionDescription.cpp b/Source/modules/mediastream/RTCSessionDescription.cpp
index 9ec76397308f91115c683ab25dd932275ab1b109..60db5834b2ef203bd7b5ca52a646fb6c06077304 100644
--- a/Source/modules/mediastream/RTCSessionDescription.cpp
+++ b/Source/modules/mediastream/RTCSessionDescription.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "modules/mediastream/RTCSessionDescription.h"
+#include "bindings/core/v8/ScriptValue.h"
+#include "bindings/core/v8/V8ObjectBuilder.h"
#include "modules/mediastream/RTCSessionDescriptionInit.h"
namespace blink {
@@ -78,6 +80,20 @@ void RTCSessionDescription::setSdp(const String& sdp)
m_webSessionDescription.setSDP(sdp);
}
+ScriptValue RTCSessionDescription::toJSONForBinding(ScriptState* scriptState)
+{
+ V8ObjectBuilder result(scriptState);
+ if (type().isNull())
+ result.addNull("type");
+ else
+ result.addString("type", type());
+ if (sdp().isNull())
+ result.addNull("sdp");
+ else
+ result.addString("sdp", sdp());
+ return result.scriptValue();
+}
+
WebRTCSessionDescription RTCSessionDescription::webSessionDescription()
{
return m_webSessionDescription;
« no previous file with comments | « Source/modules/mediastream/RTCSessionDescription.h ('k') | Source/modules/mediastream/RTCSessionDescription.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698