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

Side by Side Diff: third_party/WebKit/Source/platform/wtf/PtrUtil.h

Issue 2764833002: Move files in wtf/ to platform/wtf/ (Part 7). (Closed)
Patch Set: Rebase. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 "platform/wtf/TypeTraits.h"
10 10
11 #include <memory> 11 #include <memory>
12 12
13 namespace WTF { 13 namespace WTF {
14 14
15 template <typename T> 15 template <typename T>
16 std::unique_ptr<T> wrapUnique(T* ptr) { 16 std::unique_ptr<T> wrapUnique(T* ptr) {
17 static_assert( 17 static_assert(
18 !WTF::IsGarbageCollectedType<T>::value, 18 !WTF::IsGarbageCollectedType<T>::value,
19 "Garbage collected types should not be stored in std::unique_ptr!"); 19 "Garbage collected types should not be stored in std::unique_ptr!");
(...skipping 24 matching lines...) Expand all
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::wrapArrayUnique; 51 using WTF::wrapArrayUnique;
52 52
53 #endif // PtrUtil_h 53 #endif // PtrUtil_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/wtf/PassRefPtr.h ('k') | third_party/WebKit/Source/platform/wtf/RefCounted.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698