WebRTC: Expose RTCPeerConnectionInternals functions to JS builtins.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Nov 2015 14:15:12 +0000 (14:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Nov 2015 14:15:12 +0000 (14:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151302

Patch by Sebastian Dröge <sebastian@centricular.com> on 2015-11-16
Reviewed by Youenn Fablet.

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::finishCreation):
Expose RTCPeerConnectionInternals functions to JS builtins.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192470 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowBase.cpp

index c91734c..1e1419b 100644 (file)
@@ -1,3 +1,14 @@
+2015-11-16  Sebastian Dröge  <sebastian@centricular.com>
+
+        WebRTC: Expose RTCPeerConnectionInternals functions to JS builtins.
+        https://bugs.webkit.org/show_bug.cgi?id=151302
+
+        Reviewed by Youenn Fablet.
+
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::finishCreation):
+        Expose RTCPeerConnectionInternals functions to JS builtins.
+
 2015-11-16  Xabier Rodriguez Calvar  <calvaris@igalia.com>
 
         [Streams API] Update the implementation up to spec of Nov 11 2015
index 827ca99..310855f 100644 (file)
 #include "WritableStreamInternalsBuiltins.h"
 #endif
 
+#if ENABLE(MEDIA_STREAM)
+#include "RTCPeerConnectionInternalsBuiltins.h"
+#endif
+
 using namespace JSC;
 
 namespace WebCore {
@@ -85,7 +89,7 @@ void JSDOMWindowBase::finishCreation(VM& vm, JSDOMWindowShell* shell)
 
     m_privateFunctions.init(*this);
 
-#if ENABLE(STREAMS_API)
+#if ENABLE(STREAMS_API) || ENABLE(MEDIA_STREAM)
     JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
 #endif
 
@@ -117,6 +121,13 @@ void JSDOMWindowBase::finishCreation(VM& vm, JSDOMWindowShell* shell)
         WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
 #undef DECLARE_GLOBAL_STATIC
 #endif
+#if ENABLE(MEDIA_STREAM)
+#define DECLARE_GLOBAL_STATIC(name)\
+        GlobalPropertyInfo(\
+            clientData.builtinFunctions().rTCPeerConnectionInternalsBuiltins().name##PrivateName(), m_privateFunctions.rTCPeerConnectionInternals().m_##name##Function.get() , DontDelete | ReadOnly),
+        WEBCORE_FOREACH_RTCPEERCONNECTIONINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
+#undef DECLARE_GLOBAL_STATIC
+#endif
     };
 
     addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));