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

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

Issue 2685093002: Switching some interfaces to use std::unique_ptr<>. (Closed)
Patch Set: 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
« no previous file with comments | « webrtc/media/engine/webrtcmediaengine.h ('k') | webrtc/pc/channelmanager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 21 matching lines...) Expand all
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. The ChannelManager takes
42 // ownership of these objects. 42 // ownership of the objects passed in as unique_ptrs.
pthatcher1 2017/02/10 18:21:25 Isn't that kind of assumed by a std::unique_ptr?
Taylor Brandstetter 2017/02/10 21:55:48 Removed.
43 ChannelManager(MediaEngineInterface* me, 43 ChannelManager(std::unique_ptr<MediaEngineInterface> me,
44 DataEngineInterface* dme, 44 std::unique_ptr<DataEngineInterface> dme,
45 rtc::Thread* worker_and_network); 45 rtc::Thread* worker_and_network);
46 // Same as above, but gives an easier default DataEngine. 46 // Same as above, but gives an easier default DataEngine.
47 ChannelManager(MediaEngineInterface* me, 47 ChannelManager(std::unique_ptr<MediaEngineInterface> me,
48 rtc::Thread* worker, 48 rtc::Thread* worker,
49 rtc::Thread* network); 49 rtc::Thread* network);
50 ~ChannelManager(); 50 ~ChannelManager();
51 51
52 // Accessors for the worker thread, allowing it to be set after construction, 52 // 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. 53 // but before Init. set_worker_thread will return false if called after Init.
54 rtc::Thread* worker_thread() const { return worker_thread_; } 54 rtc::Thread* worker_thread() const { return worker_thread_; }
55 bool set_worker_thread(rtc::Thread* thread) { 55 bool set_worker_thread(rtc::Thread* thread) {
56 if (initialized_) { 56 if (initialized_) {
57 return false; 57 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); 150 bool StartAecDump(rtc::PlatformFile file, int64_t max_size_bytes);
151 151
152 // Stops recording AEC dump. 152 // Stops recording AEC dump.
153 void StopAecDump(); 153 void StopAecDump();
154 154
155 private: 155 private:
156 typedef std::vector<VoiceChannel*> VoiceChannels; 156 typedef std::vector<VoiceChannel*> VoiceChannels;
157 typedef std::vector<VideoChannel*> VideoChannels; 157 typedef std::vector<VideoChannel*> VideoChannels;
158 typedef std::vector<RtpDataChannel*> RtpDataChannels; 158 typedef std::vector<RtpDataChannel*> RtpDataChannels;
159 159
160 void Construct(MediaEngineInterface* me, 160 void Construct(std::unique_ptr<MediaEngineInterface> me,
161 DataEngineInterface* dme, 161 std::unique_ptr<DataEngineInterface> dme,
162 rtc::Thread* worker_thread, 162 rtc::Thread* worker_thread,
163 rtc::Thread* network_thread); 163 rtc::Thread* network_thread);
164 bool InitMediaEngine_w(); 164 bool InitMediaEngine_w();
165 void DestructorDeletes_w(); 165 void DestructorDeletes_w();
166 void Terminate_w(); 166 void Terminate_w();
167 bool SetCryptoOptions_w(const rtc::CryptoOptions& crypto_options); 167 bool SetCryptoOptions_w(const rtc::CryptoOptions& crypto_options);
168 VoiceChannel* CreateVoiceChannel_w( 168 VoiceChannel* CreateVoiceChannel_w(
169 webrtc::MediaControllerInterface* media_controller, 169 webrtc::MediaControllerInterface* media_controller,
170 DtlsTransportInternal* rtp_transport, 170 DtlsTransportInternal* rtp_transport,
171 DtlsTransportInternal* rtcp_transport, 171 DtlsTransportInternal* rtcp_transport,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 bool enable_rtx_; 212 bool enable_rtx_;
213 rtc::CryptoOptions crypto_options_; 213 rtc::CryptoOptions crypto_options_;
214 214
215 bool capturing_; 215 bool capturing_;
216 }; 216 };
217 217
218 } // namespace cricket 218 } // namespace cricket
219 219
220 #endif // WEBRTC_PC_CHANNELMANAGER_H_ 220 #endif // WEBRTC_PC_CHANNELMANAGER_H_
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcmediaengine.h ('k') | webrtc/pc/channelmanager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698