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

Unified Diff: webrtc/base/scoped_ref_ptr.h

Issue 2718663005: Replace NULL with nullptr or null in webrtc/base/. (Closed)
Patch Set: Fixing Windows and formatting issues. Created 3 years, 10 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/scoped_autorelease_pool.h ('k') | webrtc/base/sharedexclusivelock_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/scoped_ref_ptr.h
diff --git a/webrtc/base/scoped_ref_ptr.h b/webrtc/base/scoped_ref_ptr.h
index df669121dcf77ecdc36b43e86906412e7d66e024..26aff03504ac5d71de40b28a79b038e31b790844 100644
--- a/webrtc/base/scoped_ref_ptr.h
+++ b/webrtc/base/scoped_ref_ptr.h
@@ -30,7 +30,7 @@
// void some_other_function() {
// scoped_refptr<MyFoo> foo = new MyFoo();
// ...
-// foo = NULL; // explicitly releases |foo|
+// foo = nullptr; // explicitly releases |foo|
// ...
// if (foo)
// foo->Method(param);
@@ -45,7 +45,7 @@
// scoped_refptr<MyFoo> b;
//
// b.swap(a);
-// // now, |b| references the MyFoo object, and |a| references NULL.
+// // now, |b| references the MyFoo object, and |a| references null.
// }
//
// To make both |a| and |b| in the above example reference the same MyFoo
@@ -70,8 +70,7 @@ namespace rtc {
template <class T>
class scoped_refptr {
public:
- scoped_refptr() : ptr_(NULL) {
- }
+ scoped_refptr() : ptr_(nullptr) {}
scoped_refptr(T* p) : ptr_(p) {
if (ptr_)
@@ -106,12 +105,12 @@ class scoped_refptr {
// Release a pointer.
// The return value is the current pointer held by this object.
- // If this object holds a NULL pointer, the return value is NULL.
- // After this operation, this object will hold a NULL pointer,
+ // If this object holds a null pointer, the return value is null.
+ // After this operation, this object will hold a null pointer,
// and will not own the object any more.
T* release() {
T* retVal = ptr_;
- ptr_ = NULL;
+ ptr_ = nullptr;
return retVal;
}
« no previous file with comments | « webrtc/base/scoped_autorelease_pool.h ('k') | webrtc/base/sharedexclusivelock_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698