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

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

Issue 1029093003: [WIP] IDL: Add limited serializer support and use for RTCIceCandidate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use V8ObjectBuilder in modules/crypto 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/RTCIceCandidate.cpp
diff --git a/Source/modules/mediastream/RTCIceCandidate.cpp b/Source/modules/mediastream/RTCIceCandidate.cpp
index ad987607afb496c3c1dba0ce342e362673814c43..07853664ecf94e6652090963779b35079e0a0afb 100644
--- a/Source/modules/mediastream/RTCIceCandidate.cpp
+++ b/Source/modules/mediastream/RTCIceCandidate.cpp
@@ -33,6 +33,7 @@
#include "bindings/core/v8/ExceptionMessages.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/V8ObjectBuilder.h"
#include "core/dom/ExceptionCode.h"
#include "modules/mediastream/RTCIceCandidateInit.h"
@@ -101,4 +102,11 @@ void RTCIceCandidate::setSdpMLineIndex(unsigned short sdpMLineIndex)
m_webCandidate.setSdpMLineIndex(sdpMLineIndex);
}
+void RTCIceCandidate::toJSONForBinding(V8ObjectBuilder& result)
+{
+ result.addString("candidate", m_webCandidate.candidate());
+ result.addString("sdpMid", m_webCandidate.sdpMid());
+ result.addNumber("sdpMLineIndex", m_webCandidate.sdpMLineIndex());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698