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 |