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

Unified Diff: base/memory/weak_ptr.cc

Issue 16160015: Update base/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « base/memory/weak_ptr.h ('k') | base/message_loop_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/weak_ptr.cc
diff --git a/base/memory/weak_ptr.cc b/base/memory/weak_ptr.cc
index 321b0576b2555ed995ac8a39c74bd40d944f155f..a22f61aa2ba47e0a8417e40734a23353c96b2eb6 100644
--- a/base/memory/weak_ptr.cc
+++ b/base/memory/weak_ptr.cc
@@ -40,9 +40,7 @@ WeakReference::WeakReference(const Flag* flag) : flag_(flag) {
WeakReference::~WeakReference() {
}
-bool WeakReference::is_valid() const {
- return flag_ && flag_->IsValid();
-}
+bool WeakReference::is_valid() const { return flag_.get() && flag_->IsValid(); }
WeakReferenceOwner::WeakReferenceOwner() {
}
@@ -56,11 +54,11 @@ WeakReference WeakReferenceOwner::GetRef() const {
if (!HasRefs())
flag_ = new WeakReference::Flag();
- return WeakReference(flag_);
+ return WeakReference(flag_.get());
}
void WeakReferenceOwner::Invalidate() {
- if (flag_) {
+ if (flag_.get()) {
flag_->Invalidate();
flag_ = NULL;
}
« no previous file with comments | « base/memory/weak_ptr.h ('k') | base/message_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698