Replace WTF::bind() uses in RTCPeerConnection with C++11 lambdas
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Feb 2014 09:45:25 +0000 (09:45 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Feb 2014 09:45:25 +0000 (09:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=129001

Reviewed by Eric Carlson.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::setLocalDescription): Pass a lambda function to
callOnMainThread() instead of using WTF::bind().
(WebCore::RTCPeerConnection::setRemoteDescription): Ditto.

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

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

index 4b5303d..b8dc1e2 100644 (file)
@@ -1,3 +1,15 @@
+2014-02-19  Zan Dobersek  <zdobersek@igalia.com>
+
+        Replace WTF::bind() uses in RTCPeerConnection with C++11 lambdas
+        https://bugs.webkit.org/show_bug.cgi?id=129001
+
+        Reviewed by Eric Carlson.
+
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::setLocalDescription): Pass a lambda function to
+        callOnMainThread() instead of using WTF::bind().
+        (WebCore::RTCPeerConnection::setRemoteDescription): Ditto.
+
 2014-02-19  Dan Bernstein  <mitz@apple.com>
 
         Simplify PLATFORM(MAC) && !PLATFORM(IOS) and similar expressions
index bb895c9..8a3e274 100644 (file)
@@ -62,7 +62,6 @@
 #include "RTCVoidRequestImpl.h"
 #include "ScriptExecutionContext.h"
 #include "VoidCallback.h"
-#include <wtf/Functional.h>
 #include <wtf/MainThread.h>
 
 namespace WebCore {
@@ -250,8 +249,10 @@ void RTCPeerConnection::setLocalDescription(PassRefPtr<RTCSessionDescription> pr
     }
 
     if (!checkStateForLocalDescription(sessionDescription.get())) {
-        RefPtr<DOMError> error = DOMError::create(RTCPeerConnectionHandler::invalidSessionDescriptionErrorName());
-        callOnMainThread(bind(&RTCPeerConnectionErrorCallback::handleEvent, errorCallback.get(), error.release()));
+        callOnMainThread([=] {
+            RefPtr<DOMError> error = DOMError::create(RTCPeerConnectionHandler::invalidSessionDescriptionErrorName());
+            errorCallback->handleEvent(error.get());
+        });
         return;
     }
 
@@ -285,8 +286,10 @@ void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> p
     }
 
     if (!checkStateForRemoteDescription(sessionDescription.get())) {
-        RefPtr<DOMError> error = DOMError::create(RTCPeerConnectionHandler::invalidSessionDescriptionErrorName());
-        callOnMainThread(bind(&RTCPeerConnectionErrorCallback::handleEvent, errorCallback.get(), error.release()));
+        callOnMainThread([=] {
+            RefPtr<DOMError> error = DOMError::create(RTCPeerConnectionHandler::invalidSessionDescriptionErrorName());
+            errorCallback->handleEvent(error.get());
+        });
         return;
     }