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

Side by Side Diff: webrtc/api/notifier.h

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/mediastream.cc ('k') | webrtc/api/peerconnection.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 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2011 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 #ifndef WEBRTC_API_NOTIFIER_H_ 11 #ifndef WEBRTC_API_NOTIFIER_H_
12 #define WEBRTC_API_NOTIFIER_H_ 12 #define WEBRTC_API_NOTIFIER_H_
13 13
14 #include <list> 14 #include <list>
15 15
16 #include "webrtc/api/mediastreaminterface.h" 16 #include "webrtc/api/mediastreaminterface.h"
17 #include "webrtc/base/checks.h"
17 #include "webrtc/base/common.h" 18 #include "webrtc/base/common.h"
18 19
19 namespace webrtc { 20 namespace webrtc {
20 21
21 // Implement a template version of a notifier. 22 // Implement a template version of a notifier.
22 template <class T> 23 template <class T>
23 class Notifier : public T { 24 class Notifier : public T {
24 public: 25 public:
25 Notifier() { 26 Notifier() {
26 } 27 }
27 28
28 virtual void RegisterObserver(ObserverInterface* observer) { 29 virtual void RegisterObserver(ObserverInterface* observer) {
29 ASSERT(observer != NULL); 30 RTC_DCHECK(observer != NULL);
30 observers_.push_back(observer); 31 observers_.push_back(observer);
31 } 32 }
32 33
33 virtual void UnregisterObserver(ObserverInterface* observer) { 34 virtual void UnregisterObserver(ObserverInterface* observer) {
34 for (std::list<ObserverInterface*>::iterator it = observers_.begin(); 35 for (std::list<ObserverInterface*>::iterator it = observers_.begin();
35 it != observers_.end(); it++) { 36 it != observers_.end(); it++) {
36 if (*it == observer) { 37 if (*it == observer) {
37 observers_.erase(it); 38 observers_.erase(it);
38 break; 39 break;
39 } 40 }
(...skipping 11 matching lines...) Expand all
51 } 52 }
52 } 53 }
53 54
54 protected: 55 protected:
55 std::list<ObserverInterface*> observers_; 56 std::list<ObserverInterface*> observers_;
56 }; 57 };
57 58
58 } // namespace webrtc 59 } // namespace webrtc
59 60
60 #endif // WEBRTC_API_NOTIFIER_H_ 61 #endif // WEBRTC_API_NOTIFIER_H_
OLDNEW
« no previous file with comments | « webrtc/api/mediastream.cc ('k') | webrtc/api/peerconnection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698