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

Unified Diff: base/memory/ref_counted.h

Issue 2723083004: Remove a scoped_refptr<>::swap overload (Closed)
Patch Set: avoid to use std::swap 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »
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 ff46e6d6e5a9c87782b449474fbbebc4e0865454..37012de0a6bcd3a548db9c4f5c1fe19c26582fef 100644
--- a/base/memory/ref_counted.h
+++ b/base/memory/ref_counted.h
@@ -354,14 +354,10 @@ class scoped_refptr {
return *this;
}
- void swap(T** pp) {
- T* p = ptr_;
- ptr_ = *pp;
- *pp = p;
- }
-
void swap(scoped_refptr<T>& r) {
- swap(&r.ptr_);
+ T* tmp = ptr_;
+ ptr_ = r.ptr_;
+ r.ptr_ = tmp;
}
explicit operator bool() const { return ptr_ != nullptr; }
« no previous file with comments | « no previous file | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698