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

Unified Diff: webrtc/base/scoped_ptr.h

Issue 1702983002: Replace scoped_ptr with unique_ptr in webrtc/voice_engine/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/test/mock_voice_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/scoped_ptr.h
diff --git a/webrtc/base/scoped_ptr.h b/webrtc/base/scoped_ptr.h
index d6aedfc1982b5c976b1d5855a47f200433e7cd4b..955bcfeab4907d3f45a64e2e0b50b98dd18addc6 100644
--- a/webrtc/base/scoped_ptr.h
+++ b/webrtc/base/scoped_ptr.h
@@ -88,6 +88,7 @@
#include <algorithm> // For std::swap().
#include <cstddef>
+#include <memory>
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/deprecation.h"
@@ -605,6 +606,16 @@ void swap(rtc::scoped_ptr<T, D>& p1, rtc::scoped_ptr<T, D>& p2) {
p1.swap(p2);
}
+// Convert between the most common kinds of scoped_ptr and unique_ptr.
+template <typename T>
+std::unique_ptr<T> ScopedToUnique(scoped_ptr<T> sp) {
+ return std::unique_ptr<T>(sp.release());
+}
+template <typename T>
+scoped_ptr<T> UniqueToScoped(std::unique_ptr<T> up) {
+ return scoped_ptr<T>(up.release());
+}
+
} // namespace rtc
template <class T, class D>
« no previous file with comments | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/test/mock_voice_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698