Index: talk/app/webrtc/peerconnectionfactoryproxy.h |
diff --git a/talk/app/webrtc/peerconnectionfactoryproxy.h b/talk/app/webrtc/peerconnectionfactoryproxy.h |
index 2f5ddd68924e8c7ad5574cb15174032b2f1cbd2e..4a8cd8758c487e9d450bfb44779505b68c54b044 100644 |
--- a/talk/app/webrtc/peerconnectionfactoryproxy.h |
+++ b/talk/app/webrtc/peerconnectionfactoryproxy.h |
@@ -32,18 +32,24 @@ |
#include "talk/app/webrtc/peerconnectioninterface.h" |
#include "talk/app/webrtc/proxy.h" |
+#include "webrtc/base/bind.h" |
namespace webrtc { |
BEGIN_PROXY_MAP(PeerConnectionFactory) |
PROXY_METHOD1(void, SetOptions, const Options&) |
- PROXY_METHOD5(rtc::scoped_refptr<PeerConnectionInterface>, |
- CreatePeerConnection, |
- const PeerConnectionInterface::RTCConfiguration&, |
- const MediaConstraintsInterface*, |
- PortAllocatorFactoryInterface*, |
- DTLSIdentityServiceInterface*, |
- PeerConnectionObserver*) |
+ // Can't use PROXY_METHOD5 because scoped_ptr must be Pass()ed. |
+ // TODO(tommi,hbos): Use of templates to support scoped_ptr? |
+ rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( |
+ const PeerConnectionInterface::RTCConfiguration& a1, |
+ const MediaConstraintsInterface* a2, |
+ PortAllocatorFactoryInterface* a3, |
+ rtc::scoped_ptr<DtlsIdentityStoreInterface> a4, |
+ PeerConnectionObserver* a5) override { |
+ return owner_thread_->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>( |
+ rtc::Bind(&PeerConnectionFactoryProxy::CreatePeerConnection_ot, this, |
+ a1, a2, a3, a4.release(), a5)); |
+ } |
PROXY_METHOD1(rtc::scoped_refptr<MediaStreamInterface>, |
CreateLocalMediaStream, const std::string&) |
PROXY_METHOD1(rtc::scoped_refptr<AudioSourceInterface>, |
@@ -56,6 +62,17 @@ BEGIN_PROXY_MAP(PeerConnectionFactory) |
PROXY_METHOD2(rtc::scoped_refptr<AudioTrackInterface>, |
CreateAudioTrack, const std::string&, AudioSourceInterface*) |
PROXY_METHOD1(bool, StartAecDump, rtc::PlatformFile) |
+ |
+ private: |
+ rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection_ot( |
+ const PeerConnectionInterface::RTCConfiguration& a1, |
+ const MediaConstraintsInterface* a2, |
+ PortAllocatorFactoryInterface* a3, |
+ DtlsIdentityStoreInterface* a4, |
+ PeerConnectionObserver* a5) { |
+ rtc::scoped_ptr<DtlsIdentityStoreInterface> ptr_a4(a4); |
+ return c_->CreatePeerConnection(a1, a2, a3, ptr_a4.Pass(), a5); |
+ } |
END_PROXY() |
} // namespace webrtc |