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

Unified Diff: base/memory/ref_counted.h

Issue 2446403006: Member initialization for scoped_refptr<T>::ptr_. (Closed)
Patch Set: {} instead of default? Created 4 years, 2 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 | « no previous file | base/memory/ref_counted_unittest.cc » ('j') | base/memory/ref_counted_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/ref_counted.h
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h
index f629d5fa8b6da644963ac984f2b486e7b0bb76c7..17528da1f69459e47a9e35df816f3127eac960ea 100644
--- a/base/memory/ref_counted.h
+++ b/base/memory/ref_counted.h
@@ -31,9 +31,9 @@ class BASE_EXPORT RefCountedBase {
RefCountedBase()
: ref_count_(0)
#if DCHECK_IS_ON()
- , in_dtor_(false)
+ , in_dtor_(false)
#endif
- {
+ {
}
~RefCountedBase() {
@@ -269,8 +269,7 @@ class scoped_refptr {
public:
typedef T element_type;
- scoped_refptr() : ptr_(nullptr) {
- }
+ scoped_refptr() {}
scoped_refptr(T* p) : ptr_(p) {
if (ptr_)
@@ -380,7 +379,7 @@ class scoped_refptr {
}
protected:
- T* ptr_;
+ T* ptr_ = nullptr;
private:
// Friend required for move constructors that set r.ptr_ to null.
« no previous file with comments | « no previous file | base/memory/ref_counted_unittest.cc » ('j') | base/memory/ref_counted_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698