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

Unified Diff: base/stl_util.h

Issue 2565913002: [Onion Soup] Move WebBluetoothImpl from //content/renderer/bluetooth to Blink's bluetooth module (Closed)
Patch Set: check if binding is bound before close it Created 4 years 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
Index: base/stl_util.h
diff --git a/base/stl_util.h b/base/stl_util.h
index 016bb156450692415d9814f6a011446cf68ca591..56025ca0eddca00ac51bf470b4e8b3cc13391d45 100644
--- a/base/stl_util.h
+++ b/base/stl_util.h
@@ -10,6 +10,7 @@
#include <algorithm>
#include <functional>
#include <iterator>
+#include <memory>
#include <string>
#include <vector>
@@ -126,6 +127,15 @@ bool STLIncludes(const Arg1& a1, const Arg2& a2) {
a2.begin(), a2.end());
}
+// Means of generating a key for searching STL collections of std::unique_ptr
+// that avoids the side effect of deleting the pointer.
+template <class T>
+class FakeUniquePtr : public std::unique_ptr<T> {
+ public:
+ using std::unique_ptr<T>::unique_ptr;
+ ~FakeUniquePtr() { std::unique_ptr<T>::release(); }
+};
+
} // namespace base
#endif // BASE_STL_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698