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; |