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

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

Issue 2715103002: Replace NULL with nullptr or null in webrtc/api/. (Closed)
Patch Set: merge with master Created 3 years, 9 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/mediastreaminterface.h ('k') | webrtc/api/peerconnectioninterface.h » ('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/checks.h"
18 18
19 namespace webrtc { 19 namespace webrtc {
20 20
21 // Implements a template version of a notifier. 21 // Implements a template version of a notifier.
22 // TODO(deadbeef): This is an implementation detail; move out of api/. 22 // TODO(deadbeef): This is an implementation detail; move out of api/.
23 template <class T> 23 template <class T>
24 class Notifier : public T { 24 class Notifier : public T {
25 public: 25 public:
26 Notifier() { 26 Notifier() {
27 } 27 }
28 28
29 virtual void RegisterObserver(ObserverInterface* observer) { 29 virtual void RegisterObserver(ObserverInterface* observer) {
30 RTC_DCHECK(observer != NULL); 30 RTC_DCHECK(observer != nullptr);
31 observers_.push_back(observer); 31 observers_.push_back(observer);
32 } 32 }
33 33
34 virtual void UnregisterObserver(ObserverInterface* observer) { 34 virtual void UnregisterObserver(ObserverInterface* observer) {
35 for (std::list<ObserverInterface*>::iterator it = observers_.begin(); 35 for (std::list<ObserverInterface*>::iterator it = observers_.begin();
36 it != observers_.end(); it++) { 36 it != observers_.end(); it++) {
37 if (*it == observer) { 37 if (*it == observer) {
38 observers_.erase(it); 38 observers_.erase(it);
39 break; 39 break;
40 } 40 }
(...skipping 11 matching lines...) Expand all
52 } 52 }
53 } 53 }
54 54
55 protected: 55 protected:
56 std::list<ObserverInterface*> observers_; 56 std::list<ObserverInterface*> observers_;
57 }; 57 };
58 58
59 } // namespace webrtc 59 } // namespace webrtc
60 60
61 #endif // WEBRTC_API_NOTIFIER_H_ 61 #endif // WEBRTC_API_NOTIFIER_H_
OLDNEW
« no previous file with comments | « webrtc/api/mediastreaminterface.h ('k') | webrtc/api/peerconnectioninterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698