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

Side by Side Diff: webrtc/api/peerconnectionfactory.cc

Issue 2620303003: Replace ASSERT by RTC_DCHECK in all non-test code. (Closed)
Patch Set: Address final nits. Created 3 years, 11 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/api/peerconnection.cc ('k') | webrtc/api/rtpsender.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
11 #include "webrtc/api/peerconnectionfactory.h" 11 #include "webrtc/api/peerconnectionfactory.h"
12 12
13 #include <utility> 13 #include <utility>
14 14
15 #include "webrtc/api/audiotrack.h" 15 #include "webrtc/api/audiotrack.h"
16 #include "webrtc/api/localaudiosource.h" 16 #include "webrtc/api/localaudiosource.h"
17 #include "webrtc/api/mediaconstraintsinterface.h" 17 #include "webrtc/api/mediaconstraintsinterface.h"
18 #include "webrtc/api/mediastream.h" 18 #include "webrtc/api/mediastream.h"
19 #include "webrtc/api/mediastreamproxy.h" 19 #include "webrtc/api/mediastreamproxy.h"
20 #include "webrtc/api/mediastreamtrackproxy.h" 20 #include "webrtc/api/mediastreamtrackproxy.h"
21 #include "webrtc/api/peerconnection.h" 21 #include "webrtc/api/peerconnection.h"
22 #include "webrtc/api/peerconnectionfactoryproxy.h" 22 #include "webrtc/api/peerconnectionfactoryproxy.h"
23 #include "webrtc/api/peerconnectionproxy.h" 23 #include "webrtc/api/peerconnectionproxy.h"
24 #include "webrtc/api/videocapturertracksource.h" 24 #include "webrtc/api/videocapturertracksource.h"
25 #include "webrtc/api/videosourceproxy.h" 25 #include "webrtc/api/videosourceproxy.h"
26 #include "webrtc/api/videotrack.h" 26 #include "webrtc/api/videotrack.h"
27 #include "webrtc/base/bind.h" 27 #include "webrtc/base/bind.h"
28 #include "webrtc/base/checks.h"
28 #include "webrtc/media/engine/webrtcmediaengine.h" 29 #include "webrtc/media/engine/webrtcmediaengine.h"
29 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" 30 #include "webrtc/media/engine/webrtcvideodecoderfactory.h"
30 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" 31 #include "webrtc/media/engine/webrtcvideoencoderfactory.h"
31 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" 32 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
32 #include "webrtc/modules/audio_device/include/audio_device.h" 33 #include "webrtc/modules/audio_device/include/audio_device.h"
33 #include "webrtc/p2p/base/basicpacketsocketfactory.h" 34 #include "webrtc/p2p/base/basicpacketsocketfactory.h"
34 #include "webrtc/p2p/client/basicportallocator.h" 35 #include "webrtc/p2p/client/basicportallocator.h"
35 36
36 namespace webrtc { 37 namespace webrtc {
37 38
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 default_adm_(default_adm), 123 default_adm_(default_adm),
123 audio_decoder_factory_(audio_decoder_factory), 124 audio_decoder_factory_(audio_decoder_factory),
124 video_encoder_factory_(video_encoder_factory), 125 video_encoder_factory_(video_encoder_factory),
125 video_decoder_factory_(video_decoder_factory), 126 video_decoder_factory_(video_decoder_factory),
126 external_audio_mixer_(audio_mixer) { 127 external_audio_mixer_(audio_mixer) {
127 RTC_DCHECK(network_thread); 128 RTC_DCHECK(network_thread);
128 RTC_DCHECK(worker_thread); 129 RTC_DCHECK(worker_thread);
129 RTC_DCHECK(signaling_thread); 130 RTC_DCHECK(signaling_thread);
130 // TODO: Currently there is no way creating an external adm in 131 // TODO: Currently there is no way creating an external adm in
131 // libjingle source tree. So we can 't currently assert if this is NULL. 132 // libjingle source tree. So we can 't currently assert if this is NULL.
132 // ASSERT(default_adm != NULL); 133 // RTC_DCHECK(default_adm != NULL);
133 } 134 }
134 135
135 PeerConnectionFactory::~PeerConnectionFactory() { 136 PeerConnectionFactory::~PeerConnectionFactory() {
136 RTC_DCHECK(signaling_thread_->IsCurrent()); 137 RTC_DCHECK(signaling_thread_->IsCurrent());
137 channel_manager_.reset(nullptr); 138 channel_manager_.reset(nullptr);
138 139
139 // Make sure |worker_thread_| and |signaling_thread_| outlive 140 // Make sure |worker_thread_| and |signaling_thread_| outlive
140 // |default_socket_factory_| and |default_network_manager_|. 141 // |default_socket_factory_| and |default_network_manager_|.
141 default_socket_factory_ = nullptr; 142 default_socket_factory_ = nullptr;
142 default_network_manager_ = nullptr; 143 default_network_manager_ = nullptr;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 rtc::Thread* PeerConnectionFactory::worker_thread() { 339 rtc::Thread* PeerConnectionFactory::worker_thread() {
339 RTC_DCHECK(signaling_thread_->IsCurrent()); 340 RTC_DCHECK(signaling_thread_->IsCurrent());
340 return worker_thread_; 341 return worker_thread_;
341 } 342 }
342 343
343 rtc::Thread* PeerConnectionFactory::network_thread() { 344 rtc::Thread* PeerConnectionFactory::network_thread() {
344 return network_thread_; 345 return network_thread_;
345 } 346 }
346 347
347 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { 348 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() {
348 ASSERT(worker_thread_ == rtc::Thread::Current()); 349 RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
349 return cricket::WebRtcMediaEngineFactory::Create( 350 return cricket::WebRtcMediaEngineFactory::Create(
350 default_adm_.get(), audio_decoder_factory_, video_encoder_factory_.get(), 351 default_adm_.get(), audio_decoder_factory_, video_encoder_factory_.get(),
351 video_decoder_factory_.get(), external_audio_mixer_); 352 video_decoder_factory_.get(), external_audio_mixer_);
352 } 353 }
353 354
354 } // namespace webrtc 355 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/api/rtpsender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698