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

Unified Diff: base/memory/ref_counted.h

Issue 2723083004: Remove a scoped_refptr<>::swap overload (Closed)
Patch Set: fix 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 | « no previous file | media/filters/ffmpeg_audio_decoder.cc » ('j') | media/filters/ffmpeg_audio_decoder.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 784a1788a81a07808be26e82c830eeea59acc1b8..fbfd12c26b013192a0a6dc2247cf07259bd83cf9 100644
--- a/base/memory/ref_counted.h
+++ b/base/memory/ref_counted.h
@@ -7,6 +7,7 @@
#include <stddef.h>
+#include <algorithm>
#include <cassert>
#include <iosfwd>
#include <type_traits>
@@ -354,15 +355,7 @@ 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_);
- }
+ void swap(scoped_refptr<T>& r) { std::swap(ptr_, r.ptr_); }
explicit operator bool() const { return ptr_ != nullptr; }
« no previous file with comments | « no previous file | media/filters/ffmpeg_audio_decoder.cc » ('j') | media/filters/ffmpeg_audio_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698