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

Unified Diff: base/memory/ptr_util.h

Issue 2164503002: Do not delete blink::WebRTCCertificateCallback on non-main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +std::move, -auto, s/std::move/&/ Created 4 years, 5 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
Index: base/memory/ptr_util.h
diff --git a/base/memory/ptr_util.h b/base/memory/ptr_util.h
index 8747ac9463323865a28eb7d0baf9a6367ab7b5df..e975f6739ce556cb4edec3734ffd8994ec4cf07b 100644
--- a/base/memory/ptr_util.h
+++ b/base/memory/ptr_util.h
@@ -13,9 +13,9 @@ namespace base {
// Helper to transfer ownership of a raw pointer to a std::unique_ptr<T>.
// Note that std::unique_ptr<T> has very different semantics from
// std::unique_ptr<T[]>: do not use this helper for array allocations.
-template <typename T>
-std::unique_ptr<T> WrapUnique(T* ptr) {
- return std::unique_ptr<T>(ptr);
+template <typename T, typename D = std::default_delete<T>>
+std::unique_ptr<T, D> WrapUnique(T* ptr, D deleter = D()) {
dcheng 2016/07/22 07:29:00 We don't need the custom deleter argument anymore,
tzik 2016/07/22 08:14:53 Ah, right. Removed.
+ return std::unique_ptr<T, D>(ptr, std::move(deleter));
}
namespace internal {
« no previous file with comments | « base/base.gyp ('k') | base/memory/ptr_util_unittest.cc » ('j') | base/sequenced_task_runner.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698