| 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 |
| 121 namespace blink { | 132 namespace blink { |
| 122 | 133 |
| 123 using namespace WTF; | 134 using namespace WTF; |
| 124 | 135 |
| 125 #define DISALLOW_ALLOCATION() \ | 136 #define DISALLOW_ALLOCATION() \ |
| 126 private: \ | 137 private: \ |
| 127 void* operator new(size_t) = delete; \ | 138 void* operator new(size_t) = delete; \ |
| 128 void* operator new(size_t, void*) = delete; | 139 void* operator new(size_t, void*) = delete; |
| 129 | 140 |
| 130 #define STACK_ALLOCATED() \ | 141 #define STACK_ALLOCATED() \ |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 bool operator!() const { return false; } | 182 bool operator!() const { return false; } |
| 172 }; | 183 }; |
| 173 | 184 |
| 174 template<typename T> class Persistent { | 185 template<typename T> class Persistent { |
| 175 public: | 186 public: |
| 176 operator T*() const { return 0; } | 187 operator T*() const { return 0; } |
| 177 T* operator->() { return 0; } | 188 T* operator->() { return 0; } |
| 178 bool operator!() const { return false; } | 189 bool operator!() const { return false; } |
| 179 }; | 190 }; |
| 180 | 191 |
| 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 |
| 181 class HeapAllocator { | 213 class HeapAllocator { |
| 182 public: | 214 public: |
| 183 static const bool isGarbageCollected = true; | 215 static const bool isGarbageCollected = true; |
| 184 }; | 216 }; |
| 185 | 217 |
| 186 template<typename T, size_t inlineCapacity = 0> | 218 template<typename T, size_t inlineCapacity = 0> |
| 187 class HeapVector : public Vector<T, inlineCapacity, HeapAllocator> { }; | 219 class HeapVector : public Vector<T, inlineCapacity, HeapAllocator> { }; |
| 188 | 220 |
| 189 template<typename T, size_t inlineCapacity = 0> | 221 template<typename T, size_t inlineCapacity = 0> |
| 190 class HeapDeque : public Vector<T, inlineCapacity, HeapAllocator> { }; | 222 class HeapDeque : public Vector<T, inlineCapacity, HeapAllocator> { }; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 namespace WTF { | 289 namespace WTF { |
| 258 | 290 |
| 259 template<typename T> | 291 template<typename T> |
| 260 struct VectorTraits<blink::Member<T> > { | 292 struct VectorTraits<blink::Member<T> > { |
| 261 static const bool needsDestruction = false; | 293 static const bool needsDestruction = false; |
| 262 }; | 294 }; |
| 263 | 295 |
| 264 } | 296 } |
| 265 | 297 |
| 266 #endif | 298 #endif |
| OLD | NEW |