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

Unified Diff: base/memory/weak_ptr.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 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 | « base/memory/weak_ptr.h ('k') | base/synchronization/waitable_event_watcher_posix.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 9dec8fd6db9c29956673a79326efa4b22af2f3ad..673da6192ece3aaa0bb47eebd48849ae5bc1c909 100644
--- a/base/memory/weak_ptr.cc
+++ b/base/memory/weak_ptr.cc
@@ -35,7 +35,7 @@ WeakReference::~WeakReference() {
}
bool WeakReference::is_valid() const {
- return flag_ && flag_->IsValid();
+ return flag_.get() && flag_->IsValid();
}
WeakReferenceOwner::WeakReferenceOwner() {
@@ -50,11 +50,11 @@ WeakReference WeakReferenceOwner::GetRef() const {
// have gone away.
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/synchronization/waitable_event_watcher_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698