Chromium Code Reviews

Side by Side Diff: webrtc/api/peerconnectionfactoryproxy.h

Issue 1861633002: Extended proxy abstraction, to call certain methods to the worker thread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 12 matching lines...)
23 BEGIN_PROXY_MAP(PeerConnectionFactory) 23 BEGIN_PROXY_MAP(PeerConnectionFactory)
24 PROXY_METHOD1(void, SetOptions, const Options&) 24 PROXY_METHOD1(void, SetOptions, const Options&)
25 // Can't use PROXY_METHOD5 because scoped_ptr must be moved. 25 // Can't use PROXY_METHOD5 because scoped_ptr must be moved.
26 // TODO(tommi,hbos): Use of templates to support scoped_ptr? 26 // TODO(tommi,hbos): Use of templates to support scoped_ptr?
27 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( 27 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
28 const PeerConnectionInterface::RTCConfiguration& a1, 28 const PeerConnectionInterface::RTCConfiguration& a1,
29 const MediaConstraintsInterface* a2, 29 const MediaConstraintsInterface* a2,
30 rtc::scoped_ptr<cricket::PortAllocator> a3, 30 rtc::scoped_ptr<cricket::PortAllocator> a3,
31 rtc::scoped_ptr<DtlsIdentityStoreInterface> a4, 31 rtc::scoped_ptr<DtlsIdentityStoreInterface> a4,
32 PeerConnectionObserver* a5) override { 32 PeerConnectionObserver* a5) override {
33 return owner_thread_->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>( 33 return signal_thread_->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>(
34 rtc::Bind(&PeerConnectionFactoryProxy::CreatePeerConnection_ot, this, 34 rtc::Bind(&PeerConnectionFactoryProxy::CreatePeerConnection_ot, this,
35 a1, a2, a3.release(), a4.release(), a5)); 35 a1, a2, a3.release(), a4.release(), a5));
36 } 36 }
37 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( 37 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
38 const PeerConnectionInterface::RTCConfiguration& a1, 38 const PeerConnectionInterface::RTCConfiguration& a1,
39 rtc::scoped_ptr<cricket::PortAllocator> a3, 39 rtc::scoped_ptr<cricket::PortAllocator> a3,
40 rtc::scoped_ptr<DtlsIdentityStoreInterface> a4, 40 rtc::scoped_ptr<DtlsIdentityStoreInterface> a4,
41 PeerConnectionObserver* a5) override { 41 PeerConnectionObserver* a5) override {
42 return owner_thread_->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>( 42 return signal_thread_->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>(
43 rtc::Bind(&PeerConnectionFactoryProxy::CreatePeerConnection_ot, this, 43 rtc::Bind(&PeerConnectionFactoryProxy::CreatePeerConnection_ot, this,
44 a1, a3.release(), a4.release(), a5)); 44 a1, a3.release(), a4.release(), a5));
45 } 45 }
46 PROXY_METHOD1(rtc::scoped_refptr<MediaStreamInterface>, 46 PROXY_METHOD1(rtc::scoped_refptr<MediaStreamInterface>,
47 CreateLocalMediaStream, const std::string&) 47 CreateLocalMediaStream, const std::string&)
48 PROXY_METHOD1(rtc::scoped_refptr<AudioSourceInterface>, 48 PROXY_METHOD1(rtc::scoped_refptr<AudioSourceInterface>,
49 CreateAudioSource, const MediaConstraintsInterface*) 49 CreateAudioSource, const MediaConstraintsInterface*)
50 PROXY_METHOD1(rtc::scoped_refptr<AudioSourceInterface>, 50 PROXY_METHOD1(rtc::scoped_refptr<AudioSourceInterface>,
51 CreateAudioSource, 51 CreateAudioSource,
52 const cricket::AudioOptions&) 52 const cricket::AudioOptions&)
(...skipping 36 matching lines...)
89 rtc::scoped_ptr<cricket::PortAllocator> ptr_a3(a3); 89 rtc::scoped_ptr<cricket::PortAllocator> ptr_a3(a3);
90 rtc::scoped_ptr<DtlsIdentityStoreInterface> ptr_a4(a4); 90 rtc::scoped_ptr<DtlsIdentityStoreInterface> ptr_a4(a4);
91 return c_->CreatePeerConnection(a1, std::move(ptr_a3), std::move(ptr_a4), 91 return c_->CreatePeerConnection(a1, std::move(ptr_a3), std::move(ptr_a4),
92 a5); 92 a5);
93 } 93 }
94 END_PROXY() 94 END_PROXY()
95 95
96 } // namespace webrtc 96 } // namespace webrtc
97 97
98 #endif // WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_ 98 #endif // WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectionfactory.cc ('k') | webrtc/api/proxy.h » ('j') | webrtc/api/proxy.h » ('J')

Powered by Google App Engine