Chromium Code Reviews| 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 { |