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

Side by Side Diff: Source/wtf/VectorTraits.h

Issue 319593004: Oilpan:Allow custom handling of classes that contain weak pointers that are embedded in collections. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove 'typename' that Win compiler does not like Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/wtf/Vector.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 27 matching lines...) Expand all
38 static const bool needsDestruction = !IsPod<T>::value; 38 static const bool needsDestruction = !IsPod<T>::value;
39 static const bool canInitializeWithMemset = IsPod<T>::value; 39 static const bool canInitializeWithMemset = IsPod<T>::value;
40 static const bool canMoveWithMemcpy = IsPod<T>::value; 40 static const bool canMoveWithMemcpy = IsPod<T>::value;
41 static const bool canCopyWithMemcpy = IsPod<T>::value; 41 static const bool canCopyWithMemcpy = IsPod<T>::value;
42 static const bool canFillWithMemset = IsPod<T>::value && (sizeof(T) == s izeof(char)); 42 static const bool canFillWithMemset = IsPod<T>::value && (sizeof(T) == s izeof(char));
43 static const bool canCompareWithMemcmp = IsPod<T>::value; 43 static const bool canCompareWithMemcmp = IsPod<T>::value;
44 template<typename U = void> 44 template<typename U = void>
45 struct NeedsTracingLazily { 45 struct NeedsTracingLazily {
46 static const bool value = NeedsTracing<T>::value; 46 static const bool value = NeedsTracing<T>::value;
47 }; 47 };
48 static const bool isWeak = IsWeak<T>::value; 48 static const WeakHandlingFlag weakHandlingFlag = NoWeakHandlingInCollect ions; // We don't support weak handling in vectors.
49 }; 49 };
50 50
51 template<typename T> 51 template<typename T>
52 struct VectorTraits : VectorTraitsBase<T> { }; 52 struct VectorTraits : VectorTraitsBase<T> { };
53 53
54 // Classes marked with SimpleVectorTraits will use memmov, memcpy, memcmp 54 // Classes marked with SimpleVectorTraits will use memmov, memcpy, memcmp
55 // instead of constructors, copy operators, etc for initialization, move 55 // instead of constructors, copy operators, etc for initialization, move
56 // and comparison. 56 // and comparison.
57 template<typename T> 57 template<typename T>
58 struct SimpleClassVectorTraits : VectorTraitsBase<T> 58 struct SimpleClassVectorTraits : VectorTraitsBase<T>
(...skipping 21 matching lines...) Expand all
80 static const bool needsDestruction = FirstTraits::needsDestruction || Se condTraits::needsDestruction; 80 static const bool needsDestruction = FirstTraits::needsDestruction || Se condTraits::needsDestruction;
81 static const bool canInitializeWithMemset = FirstTraits::canInitializeWi thMemset && SecondTraits::canInitializeWithMemset; 81 static const bool canInitializeWithMemset = FirstTraits::canInitializeWi thMemset && SecondTraits::canInitializeWithMemset;
82 static const bool canMoveWithMemcpy = FirstTraits::canMoveWithMemcpy && SecondTraits::canMoveWithMemcpy; 82 static const bool canMoveWithMemcpy = FirstTraits::canMoveWithMemcpy && SecondTraits::canMoveWithMemcpy;
83 static const bool canCopyWithMemcpy = FirstTraits::canCopyWithMemcpy && SecondTraits::canCopyWithMemcpy; 83 static const bool canCopyWithMemcpy = FirstTraits::canCopyWithMemcpy && SecondTraits::canCopyWithMemcpy;
84 static const bool canFillWithMemset = false; 84 static const bool canFillWithMemset = false;
85 static const bool canCompareWithMemcmp = FirstTraits::canCompareWithMemc mp && SecondTraits::canCompareWithMemcmp; 85 static const bool canCompareWithMemcmp = FirstTraits::canCompareWithMemc mp && SecondTraits::canCompareWithMemcmp;
86 template <typename U = void> 86 template <typename U = void>
87 struct NeedsTracingLazily { 87 struct NeedsTracingLazily {
88 static const bool value = ShouldBeTraced<FirstTraits>::value || Shou ldBeTraced<SecondTraits>::value; 88 static const bool value = ShouldBeTraced<FirstTraits>::value || Shou ldBeTraced<SecondTraits>::value;
89 }; 89 };
90 static const bool isWeak = FirstTraits::isWeak || SecondTraits::isWeak; 90 static const WeakHandlingFlag weakHandlingFlag = NoWeakHandlingInCollect ions; // We don't support weak handling in vectors.
91 }; 91 };
92 92
93 } // namespace WTF 93 } // namespace WTF
94 94
95 #define WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(ClassName) \ 95 #define WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(ClassName) \
96 namespace WTF { \ 96 namespace WTF { \
97 template<> \ 97 template<> \
98 struct VectorTraits<ClassName> : SimpleClassVectorTraits<ClassName> { }; \ 98 struct VectorTraits<ClassName> : SimpleClassVectorTraits<ClassName> { }; \
99 } 99 }
100 100
(...skipping 13 matching lines...) Expand all
114 struct VectorTraits<ClassName> : VectorTraitsBase<ClassName> \ 114 struct VectorTraits<ClassName> : VectorTraitsBase<ClassName> \
115 { \ 115 { \
116 static const bool canInitializeWithMemset = true; \ 116 static const bool canInitializeWithMemset = true; \
117 }; \ 117 }; \
118 } 118 }
119 119
120 using WTF::VectorTraits; 120 using WTF::VectorTraits;
121 using WTF::SimpleClassVectorTraits; 121 using WTF::SimpleClassVectorTraits;
122 122
123 #endif // WTF_VectorTraits_h 123 #endif // WTF_VectorTraits_h
OLDNEW
« no previous file with comments | « Source/wtf/Vector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698