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

Side by Side Diff: webrtc/pc/mediasession.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/pc/mediamonitor.cc ('k') | webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 } 358 }
359 359
360 private: 360 private:
361 // Returns the first unused id in reverse order. 361 // Returns the first unused id in reverse order.
362 // This hopefully reduce the risk of more collisions. We want to change the 362 // This hopefully reduce the risk of more collisions. We want to change the
363 // default ids as little as possible. 363 // default ids as little as possible.
364 int FindUnusedId() { 364 int FindUnusedId() {
365 while (IsIdUsed(next_id_) && next_id_ >= min_allowed_id_) { 365 while (IsIdUsed(next_id_) && next_id_ >= min_allowed_id_) {
366 --next_id_; 366 --next_id_;
367 } 367 }
368 ASSERT(next_id_ >= min_allowed_id_); 368 RTC_DCHECK(next_id_ >= min_allowed_id_);
369 return next_id_; 369 return next_id_;
370 } 370 }
371 371
372 bool IsIdUsed(int new_id) { 372 bool IsIdUsed(int new_id) {
373 return id_set_.find(new_id) != id_set_.end(); 373 return id_set_.find(new_id) != id_set_.end();
374 } 374 }
375 375
376 void SetIdUsed(int new_id) { 376 void SetIdUsed(int new_id) {
377 id_set_.insert(new_id); 377 id_set_.insert(new_id);
378 } 378 }
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 if (!AddAudioContentForAnswer(offer, options, current_description, 1463 if (!AddAudioContentForAnswer(offer, options, current_description,
1464 &current_streams, answer.get())) { 1464 &current_streams, answer.get())) {
1465 return NULL; 1465 return NULL;
1466 } 1466 }
1467 } else if (IsMediaContentOfType(&*it, MEDIA_TYPE_VIDEO)) { 1467 } else if (IsMediaContentOfType(&*it, MEDIA_TYPE_VIDEO)) {
1468 if (!AddVideoContentForAnswer(offer, options, current_description, 1468 if (!AddVideoContentForAnswer(offer, options, current_description,
1469 &current_streams, answer.get())) { 1469 &current_streams, answer.get())) {
1470 return NULL; 1470 return NULL;
1471 } 1471 }
1472 } else { 1472 } else {
1473 ASSERT(IsMediaContentOfType(&*it, MEDIA_TYPE_DATA)); 1473 RTC_DCHECK(IsMediaContentOfType(&*it, MEDIA_TYPE_DATA));
1474 if (!AddDataContentForAnswer(offer, options, current_description, 1474 if (!AddDataContentForAnswer(offer, options, current_description,
1475 &current_streams, answer.get())) { 1475 &current_streams, answer.get())) {
1476 return NULL; 1476 return NULL;
1477 } 1477 }
1478 } 1478 }
1479 } 1479 }
1480 } 1480 }
1481 1481
1482 // If the offer supports BUNDLE, and we want to use it too, create a BUNDLE 1482 // If the offer supports BUNDLE, and we want to use it too, create a BUNDLE
1483 // group in the answer with the appropriate content names. 1483 // group in the answer with the appropriate content names.
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
2187 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO)); 2187 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO));
2188 } 2188 }
2189 2189
2190 DataContentDescription* GetFirstDataContentDescription( 2190 DataContentDescription* GetFirstDataContentDescription(
2191 SessionDescription* sdesc) { 2191 SessionDescription* sdesc) {
2192 return static_cast<DataContentDescription*>( 2192 return static_cast<DataContentDescription*>(
2193 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA)); 2193 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA));
2194 } 2194 }
2195 2195
2196 } // namespace cricket 2196 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/pc/mediamonitor.cc ('k') | webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698