| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 V8GlobalValueMap_h | 5 #ifndef V8GlobalValueMap_h |
| 6 #define V8GlobalValueMap_h | 6 #define V8GlobalValueMap_h |
| 7 | 7 |
| 8 #include "wtf/Allocator.h" | 8 #include "wtf/Allocator.h" |
| 9 #include "wtf/HashMap.h" | 9 #include "wtf/HashMap.h" |
| 10 #include "wtf/text/StringHash.h" | 10 #include "wtf/text/StringHash.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 static void Dispose(v8::Isolate* isolate, v8::Global<ValueType> value, KeyTy
pe key) { } | 88 static void Dispose(v8::Isolate* isolate, v8::Global<ValueType> value, KeyTy
pe key) { } |
| 89 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>& da
ta) { } | 89 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>& da
ta) { } |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * A map for safely storing persistent V8 values, based on | 93 * A map for safely storing persistent V8 values, based on |
| 94 * v8::GlobalValueMap. | 94 * v8::GlobalValueMap. |
| 95 */ | 95 */ |
| 96 template <class KeyType, class ValueType, v8::PersistentContainerCallbackType ty
pe> | 96 template <class KeyType, class ValueType, v8::PersistentContainerCallbackType ty
pe> |
| 97 class V8GlobalValueMap : public v8::GlobalValueMap<KeyType, ValueType, V8GlobalV
alueMapTraits<KeyType, ValueType, type>> { | 97 class V8GlobalValueMap : public v8::GlobalValueMap<KeyType, ValueType, V8GlobalV
alueMapTraits<KeyType, ValueType, type>> { |
| 98 DISALLOW_ALLOCATION(); | 98 DISALLOW_NEW(); |
| 99 public: | 99 public: |
| 100 typedef V8GlobalValueMapTraits<KeyType, ValueType, type> Traits; | 100 typedef V8GlobalValueMapTraits<KeyType, ValueType, type> Traits; |
| 101 explicit V8GlobalValueMap(v8::Isolate* isolate) | 101 explicit V8GlobalValueMap(v8::Isolate* isolate) |
| 102 : v8::GlobalValueMap<KeyType, ValueType, Traits>(isolate) | 102 : v8::GlobalValueMap<KeyType, ValueType, Traits>(isolate) |
| 103 { | 103 { |
| 104 } | 104 } |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| 108 | 108 |
| 109 #endif // V8GlobalValueMap_h | 109 #endif // V8GlobalValueMap_h |
| OLD | NEW |