OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PtrUtil_h | 5 #ifndef PtrUtil_h |
6 #define PtrUtil_h | 6 #define PtrUtil_h |
7 | 7 |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "wtf/TypeTraits.h" | 9 #include "wtf/TypeTraits.h" |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 template <typename T> | 41 template <typename T> |
42 auto makeUnique(size_t size) -> decltype(base::MakeUnique<T>(size)) { | 42 auto makeUnique(size_t size) -> decltype(base::MakeUnique<T>(size)) { |
43 static_assert( | 43 static_assert( |
44 !WTF::IsGarbageCollectedType<T>::value, | 44 !WTF::IsGarbageCollectedType<T>::value, |
45 "Garbage collected types should not be stored in std::unique_ptr!"); | 45 "Garbage collected types should not be stored in std::unique_ptr!"); |
46 return base::MakeUnique<T>(size); | 46 return base::MakeUnique<T>(size); |
47 } | 47 } |
48 | 48 |
49 } // namespace WTF | 49 } // namespace WTF |
50 | 50 |
51 using WTF::makeUnique; | |
52 using WTF::wrapUnique; | |
53 using WTF::wrapArrayUnique; | 51 using WTF::wrapArrayUnique; |
54 | 52 |
55 #endif // PtrUtil_h | 53 #endif // PtrUtil_h |
OLD | NEW |