| 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 namespace std { | |
| 122 | |
| 123 template<typename T> class unique_ptr { | |
| 124 public: | |
| 125 ~unique_ptr() { } | |
| 126 operator T*() const { return 0; } | |
| 127 T* operator->() { return 0; } | |
| 128 }; | |
| 129 | |
| 130 } | |
| 131 | |
| 132 namespace blink { | 121 namespace blink { |
| 133 | 122 |
| 134 using namespace WTF; | 123 using namespace WTF; |
| 135 | 124 |
| 136 #define DISALLOW_ALLOCATION() \ | 125 #define DISALLOW_ALLOCATION() \ |
| 137 private: \ | 126 private: \ |
| 138 void* operator new(size_t) = delete; \ | 127 void* operator new(size_t) = delete; \ |
| 139 void* operator new(size_t, void*) = delete; | 128 void* operator new(size_t, void*) = delete; |
| 140 | 129 |
| 141 #define STACK_ALLOCATED() \ | 130 #define STACK_ALLOCATED() \ |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 bool operator!() const { return false; } | 171 bool operator!() const { return false; } |
| 183 }; | 172 }; |
| 184 | 173 |
| 185 template<typename T> class Persistent { | 174 template<typename T> class Persistent { |
| 186 public: | 175 public: |
| 187 operator T*() const { return 0; } | 176 operator T*() const { return 0; } |
| 188 T* operator->() { return 0; } | 177 T* operator->() { return 0; } |
| 189 bool operator!() const { return false; } | 178 bool operator!() const { return false; } |
| 190 }; | 179 }; |
| 191 | 180 |
| 192 template<typename T> class WeakPersistent { | |
| 193 public: | |
| 194 operator T*() const { return 0; } | |
| 195 T* operator->() { return 0; } | |
| 196 bool operator!() const { return false; } | |
| 197 }; | |
| 198 | |
| 199 template<typename T> class CrossThreadPersistent { | |
| 200 public: | |
| 201 operator T*() const { return 0; } | |
| 202 T* operator->() { return 0; } | |
| 203 bool operator!() const { return false; } | |
| 204 }; | |
| 205 | |
| 206 template<typename T> class CrossThreadWeakPersistent { | |
| 207 public: | |
| 208 operator T*() const { return 0; } | |
| 209 T* operator->() { return 0; } | |
| 210 bool operator!() const { return false; } | |
| 211 }; | |
| 212 | |
| 213 class HeapAllocator { | 181 class HeapAllocator { |
| 214 public: | 182 public: |
| 215 static const bool isGarbageCollected = true; | 183 static const bool isGarbageCollected = true; |
| 216 }; | 184 }; |
| 217 | 185 |
| 218 template<typename T, size_t inlineCapacity = 0> | 186 template<typename T, size_t inlineCapacity = 0> |
| 219 class HeapVector : public Vector<T, inlineCapacity, HeapAllocator> { }; | 187 class HeapVector : public Vector<T, inlineCapacity, HeapAllocator> { }; |
| 220 | 188 |
| 221 template<typename T, size_t inlineCapacity = 0> | 189 template<typename T, size_t inlineCapacity = 0> |
| 222 class HeapDeque : public Vector<T, inlineCapacity, HeapAllocator> { }; | 190 class HeapDeque : public Vector<T, inlineCapacity, HeapAllocator> { }; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 namespace WTF { | 248 namespace WTF { |
| 281 | 249 |
| 282 template<typename T> | 250 template<typename T> |
| 283 struct VectorTraits<blink::Member<T> > { | 251 struct VectorTraits<blink::Member<T> > { |
| 284 static const bool needsDestruction = false; | 252 static const bool needsDestruction = false; |
| 285 }; | 253 }; |
| 286 | 254 |
| 287 } | 255 } |
| 288 | 256 |
| 289 #endif | 257 #endif |
| OLD | NEW |