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

Side by Side Diff: webrtc/pc/channelmanager.h

Issue 2685093002: Switching some interfaces to use std::unique_ptr<>. (Closed)
Patch Set: Rebase onto master Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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 20 matching lines...) Expand all
31 // care of marshalling calls between threads. It also creates and keeps track of 31 // care of marshalling calls between threads. It also creates and keeps track of
32 // voice and video channels; by doing so, it can temporarily pause all the 32 // voice and video channels; by doing so, it can temporarily pause all the
33 // channels when a new audio or video device is chosen. The voice and video 33 // channels when a new audio or video device is chosen. The voice and video
34 // channels are stored in separate vectors, to easily allow operations on just 34 // channels are stored in separate vectors, to easily allow operations on just
35 // voice or just video channels. 35 // voice or just video channels.
36 // ChannelManager also allows the application to discover what devices it has 36 // ChannelManager also allows the application to discover what devices it has
37 // using device manager. 37 // using device manager.
38 class ChannelManager { 38 class ChannelManager {
39 public: 39 public:
40 // For testing purposes. Allows the media engine and data media 40 // For testing purposes. Allows the media engine and data media
41 // engine and dev manager to be mocks. The ChannelManager takes 41 // engine and dev manager to be mocks.
42 // ownership of these objects. 42 ChannelManager(std::unique_ptr<MediaEngineInterface> me,
43 ChannelManager(MediaEngineInterface* me, 43 std::unique_ptr<DataEngineInterface> dme,
44 DataEngineInterface* dme,
45 rtc::Thread* worker_and_network); 44 rtc::Thread* worker_and_network);
46 // Same as above, but gives an easier default DataEngine. 45 // Same as above, but gives an easier default DataEngine.
47 ChannelManager(MediaEngineInterface* me, 46 ChannelManager(std::unique_ptr<MediaEngineInterface> me,
48 rtc::Thread* worker, 47 rtc::Thread* worker,
49 rtc::Thread* network); 48 rtc::Thread* network);
50 ~ChannelManager(); 49 ~ChannelManager();
51 50
52 // Accessors for the worker thread, allowing it to be set after construction, 51 // Accessors for the worker thread, allowing it to be set after construction,
53 // but before Init. set_worker_thread will return false if called after Init. 52 // but before Init. set_worker_thread will return false if called after Init.
54 rtc::Thread* worker_thread() const { return worker_thread_; } 53 rtc::Thread* worker_thread() const { return worker_thread_; }
55 bool set_worker_thread(rtc::Thread* thread) { 54 bool set_worker_thread(rtc::Thread* thread) {
56 if (initialized_) { 55 if (initialized_) {
57 return false; 56 return false;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 bool StartAecDump(rtc::PlatformFile file, int64_t max_size_bytes); 149 bool StartAecDump(rtc::PlatformFile file, int64_t max_size_bytes);
151 150
152 // Stops recording AEC dump. 151 // Stops recording AEC dump.
153 void StopAecDump(); 152 void StopAecDump();
154 153
155 private: 154 private:
156 typedef std::vector<VoiceChannel*> VoiceChannels; 155 typedef std::vector<VoiceChannel*> VoiceChannels;
157 typedef std::vector<VideoChannel*> VideoChannels; 156 typedef std::vector<VideoChannel*> VideoChannels;
158 typedef std::vector<RtpDataChannel*> RtpDataChannels; 157 typedef std::vector<RtpDataChannel*> RtpDataChannels;
159 158
160 void Construct(MediaEngineInterface* me, 159 void Construct(std::unique_ptr<MediaEngineInterface> me,
161 DataEngineInterface* dme, 160 std::unique_ptr<DataEngineInterface> dme,
162 rtc::Thread* worker_thread, 161 rtc::Thread* worker_thread,
163 rtc::Thread* network_thread); 162 rtc::Thread* network_thread);
164 bool InitMediaEngine_w(); 163 bool InitMediaEngine_w();
165 void DestructorDeletes_w(); 164 void DestructorDeletes_w();
166 void Terminate_w(); 165 void Terminate_w();
167 bool SetCryptoOptions_w(const rtc::CryptoOptions& crypto_options); 166 bool SetCryptoOptions_w(const rtc::CryptoOptions& crypto_options);
168 VoiceChannel* CreateVoiceChannel_w( 167 VoiceChannel* CreateVoiceChannel_w(
169 webrtc::MediaControllerInterface* media_controller, 168 webrtc::MediaControllerInterface* media_controller,
170 DtlsTransportInternal* rtp_transport, 169 DtlsTransportInternal* rtp_transport,
171 DtlsTransportInternal* rtcp_transport, 170 DtlsTransportInternal* rtcp_transport,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 210
212 bool enable_rtx_; 211 bool enable_rtx_;
213 rtc::CryptoOptions crypto_options_; 212 rtc::CryptoOptions crypto_options_;
214 213
215 bool capturing_; 214 bool capturing_;
216 }; 215 };
217 216
218 } // namespace cricket 217 } // namespace cricket
219 218
220 #endif // WEBRTC_PC_CHANNELMANAGER_H_ 219 #endif // WEBRTC_PC_CHANNELMANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698