OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 HEAP_STUBS_H_ | 5 #ifndef HEAP_STUBS_H_ |
6 #define HEAP_STUBS_H_ | 6 #define HEAP_STUBS_H_ |
7 | 7 |
8 #include "stddef.h" | 8 #include "stddef.h" |
9 | 9 |
10 #define WTF_MAKE_FAST_ALLOCATED \ | 10 #define WTF_MAKE_FAST_ALLOCATED \ |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 typename KeyArg, | 111 typename KeyArg, |
112 typename MappedArg, | 112 typename MappedArg, |
113 typename HashArg = void, | 113 typename HashArg = void, |
114 typename KeyTraitsArg = void, | 114 typename KeyTraitsArg = void, |
115 typename MappedTraitsArg = void, | 115 typename MappedTraitsArg = void, |
116 typename Allocator = DefaultAllocator> | 116 typename Allocator = DefaultAllocator> |
117 class HashMap {}; | 117 class HashMap {}; |
118 | 118 |
119 } | 119 } |
120 | 120 |
| 121 // Empty namespace declaration to exercise internal |
| 122 // handling of namespace equality. |
| 123 namespace std { |
| 124 /* empty */ |
| 125 } |
| 126 |
| 127 namespace std { |
| 128 |
| 129 template<typename T> class unique_ptr { |
| 130 public: |
| 131 ~unique_ptr() { } |
| 132 operator T*() const { return 0; } |
| 133 T* operator->() { return 0; } |
| 134 }; |
| 135 |
| 136 } |
| 137 |
121 namespace blink { | 138 namespace blink { |
122 | 139 |
123 using namespace WTF; | 140 using namespace WTF; |
124 | 141 |
125 #define DISALLOW_ALLOCATION() \ | 142 #define DISALLOW_ALLOCATION() \ |
126 private: \ | 143 private: \ |
127 void* operator new(size_t) = delete; \ | 144 void* operator new(size_t) = delete; \ |
128 void* operator new(size_t, void*) = delete; | 145 void* operator new(size_t, void*) = delete; |
129 | 146 |
130 #define STACK_ALLOCATED() \ | 147 #define STACK_ALLOCATED() \ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 bool operator!() const { return false; } | 188 bool operator!() const { return false; } |
172 }; | 189 }; |
173 | 190 |
174 template<typename T> class Persistent { | 191 template<typename T> class Persistent { |
175 public: | 192 public: |
176 operator T*() const { return 0; } | 193 operator T*() const { return 0; } |
177 T* operator->() { return 0; } | 194 T* operator->() { return 0; } |
178 bool operator!() const { return false; } | 195 bool operator!() const { return false; } |
179 }; | 196 }; |
180 | 197 |
| 198 template<typename T> class WeakPersistent { |
| 199 public: |
| 200 operator T*() const { return 0; } |
| 201 T* operator->() { return 0; } |
| 202 bool operator!() const { return false; } |
| 203 }; |
| 204 |
| 205 template<typename T> class CrossThreadPersistent { |
| 206 public: |
| 207 operator T*() const { return 0; } |
| 208 T* operator->() { return 0; } |
| 209 bool operator!() const { return false; } |
| 210 }; |
| 211 |
| 212 template<typename T> class CrossThreadWeakPersistent { |
| 213 public: |
| 214 operator T*() const { return 0; } |
| 215 T* operator->() { return 0; } |
| 216 bool operator!() const { return false; } |
| 217 }; |
| 218 |
181 class HeapAllocator { | 219 class HeapAllocator { |
182 public: | 220 public: |
183 static const bool isGarbageCollected = true; | 221 static const bool isGarbageCollected = true; |
184 }; | 222 }; |
185 | 223 |
186 template<typename T, size_t inlineCapacity = 0> | 224 template<typename T, size_t inlineCapacity = 0> |
187 class HeapVector : public Vector<T, inlineCapacity, HeapAllocator> { }; | 225 class HeapVector : public Vector<T, inlineCapacity, HeapAllocator> { }; |
188 | 226 |
189 template<typename T, size_t inlineCapacity = 0> | 227 template<typename T, size_t inlineCapacity = 0> |
190 class HeapDeque : public Vector<T, inlineCapacity, HeapAllocator> { }; | 228 class HeapDeque : public Vector<T, inlineCapacity, HeapAllocator> { }; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 namespace WTF { | 286 namespace WTF { |
249 | 287 |
250 template<typename T> | 288 template<typename T> |
251 struct VectorTraits<blink::Member<T> > { | 289 struct VectorTraits<blink::Member<T> > { |
252 static const bool needsDestruction = false; | 290 static const bool needsDestruction = false; |
253 }; | 291 }; |
254 | 292 |
255 } | 293 } |
256 | 294 |
257 #endif | 295 #endif |
OLD | NEW |