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

Unified Diff: webrtc/examples/peerconnection/client/conductor.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/win32window.cc ('k') | webrtc/examples/peerconnection/client/linux/main_wnd.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/peerconnection/client/conductor.cc
diff --git a/webrtc/examples/peerconnection/client/conductor.cc b/webrtc/examples/peerconnection/client/conductor.cc
index fbee576f957558d53b3140c612af3b0cf95d278a..81431b88f6517baa60670e070fcb615f1ae2c5c5 100644
--- a/webrtc/examples/peerconnection/client/conductor.cc
+++ b/webrtc/examples/peerconnection/client/conductor.cc
@@ -64,7 +64,7 @@ Conductor::Conductor(PeerConnectionClient* client, MainWindow* main_wnd)
}
Conductor::~Conductor() {
- ASSERT(peer_connection_.get() == NULL);
+ RTC_DCHECK(peer_connection_.get() == NULL);
}
bool Conductor::connection_active() const {
@@ -77,8 +77,8 @@ void Conductor::Close() {
}
bool Conductor::InitializePeerConnection() {
- ASSERT(peer_connection_factory_.get() == NULL);
- ASSERT(peer_connection_.get() == NULL);
+ RTC_DCHECK(peer_connection_factory_.get() == NULL);
+ RTC_DCHECK(peer_connection_.get() == NULL);
peer_connection_factory_ = webrtc::CreatePeerConnectionFactory();
@@ -112,8 +112,8 @@ bool Conductor::ReinitializePeerConnectionForLoopback() {
}
bool Conductor::CreatePeerConnection(bool dtls) {
- ASSERT(peer_connection_factory_.get() != NULL);
- ASSERT(peer_connection_.get() == NULL);
+ RTC_DCHECK(peer_connection_factory_.get() != NULL);
+ RTC_DCHECK(peer_connection_.get() == NULL);
webrtc::PeerConnectionInterface::RTCConfiguration config;
webrtc::PeerConnectionInterface::IceServer server;
@@ -145,7 +145,7 @@ void Conductor::DeletePeerConnection() {
}
void Conductor::EnsureStreamingUI() {
- ASSERT(peer_connection_.get() != NULL);
+ RTC_DCHECK(peer_connection_.get() != NULL);
if (main_wnd_->IsWindow()) {
if (main_wnd_->current_ui() != MainWindow::STREAMING)
main_wnd_->SwitchToStreamingUI();
@@ -231,11 +231,11 @@ void Conductor::OnPeerDisconnected(int id) {
}
void Conductor::OnMessageFromPeer(int peer_id, const std::string& message) {
- ASSERT(peer_id_ == peer_id || peer_id_ == -1);
- ASSERT(!message.empty());
+ RTC_DCHECK(peer_id_ == peer_id || peer_id_ == -1);
+ RTC_DCHECK(!message.empty());
if (!peer_connection_.get()) {
- ASSERT(peer_id_ == -1);
+ RTC_DCHECK(peer_id_ == -1);
peer_id_ = peer_id;
if (!InitializePeerConnection()) {
@@ -244,7 +244,7 @@ void Conductor::OnMessageFromPeer(int peer_id, const std::string& message) {
return;
}
} else if (peer_id != peer_id_) {
- ASSERT(peer_id_ != -1);
+ RTC_DCHECK(peer_id_ != -1);
LOG(WARNING) << "Received a message from unknown peer while already in a "
"conversation with a different peer.";
return;
@@ -350,8 +350,8 @@ void Conductor::DisconnectFromServer() {
}
void Conductor::ConnectToPeer(int peer_id) {
- ASSERT(peer_id_ == -1);
- ASSERT(peer_id != -1);
+ RTC_DCHECK(peer_id_ == -1);
+ RTC_DCHECK(peer_id != -1);
if (peer_connection_.get()) {
main_wnd_->MessageBox("Error",
@@ -444,7 +444,7 @@ void Conductor::UIThreadCallback(int msg_id, void* data) {
LOG(INFO) << "PEER_CONNECTION_CLOSED";
DeletePeerConnection();
- ASSERT(active_streams_.empty());
+ RTC_DCHECK(active_streams_.empty());
if (main_wnd_->IsWindow()) {
if (client_->is_connected()) {
« no previous file with comments | « webrtc/base/win32window.cc ('k') | webrtc/examples/peerconnection/client/linux/main_wnd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698