| Index: include/v8-util.h
|
| diff --git a/include/v8-util.h b/include/v8-util.h
|
| index 8199016a89fd5e554af4177d5909d97514542b0d..6454a19b7e4fe103523e790c10274ffc3e0dbfb4 100644
|
| --- a/include/v8-util.h
|
| +++ b/include/v8-util.h
|
| @@ -117,25 +117,25 @@ class DefaultGlobalMapTraits : public StdMapTraits<K, V> {
|
| public:
|
| // Weak callback & friends:
|
| static const PersistentContainerCallbackType kCallbackType = kNotWeak;
|
| - typedef PersistentValueMap<K, V, DefaultGlobalMapTraits<K, V> > MapType;
|
| - typedef void WeakCallbackInfoType;
|
| + typedef GlobalValueMap<K, V, DefaultGlobalMapTraits<K, V> > MapType;
|
| + typedef void WeakCallbackDataType;
|
|
|
| - static WeakCallbackInfoType* WeakCallbackParameter(MapType* map, const K& key,
|
| + static WeakCallbackDataType* WeakCallbackParameter(MapType* map, const K& key,
|
| Local<V> value) {
|
| return nullptr;
|
| }
|
| static MapType* MapFromWeakCallbackInfo(
|
| - const WeakCallbackInfo<WeakCallbackInfoType>& data) {
|
| + const WeakCallbackInfo<WeakCallbackDataType>& data) {
|
| return nullptr;
|
| }
|
| static K KeyFromWeakCallbackInfo(
|
| - const WeakCallbackInfo<WeakCallbackInfoType>& data) {
|
| + const WeakCallbackInfo<WeakCallbackDataType>& data) {
|
| return K();
|
| }
|
| - static void DisposeCallbackData(WeakCallbackInfoType* data) {}
|
| + static void DisposeCallbackData(WeakCallbackDataType* data) {}
|
| static void Dispose(Isolate* isolate, Global<V> value, K key) {}
|
| // This is a second pass callback, so SetSecondPassCallback cannot be called.
|
| - static void DisposeWeak(const WeakCallbackInfo<WeakCallbackInfoType>& data) {}
|
| + static void DisposeWeak(const WeakCallbackInfo<WeakCallbackDataType>& data) {}
|
|
|
| private:
|
| template <typename T>
|
| @@ -504,6 +504,22 @@ class StdPersistentValueMap : public PersistentValueMap<K, V, Traits> {
|
| };
|
|
|
|
|
| +/**
|
| + * A map that uses Global as value and std::map as the backing
|
| + * implementation. Globals are held non-weak.
|
| + *
|
| + * C++11 embedders don't need this class, as they can use
|
| + * Global directly in std containers.
|
| + */
|
| +template <typename K, typename V,
|
| + typename Traits = DefaultGlobalMapTraits<K, V> >
|
| +class StdGlobalValueMap : public GlobalValueMap<K, V, Traits> {
|
| + public:
|
| + explicit StdGlobalValueMap(Isolate* isolate)
|
| + : GlobalValueMap<K, V, Traits>(isolate) {}
|
| +};
|
| +
|
| +
|
| class DefaultPersistentValueVectorTraits {
|
| public:
|
| typedef std::vector<PersistentContainerValue> Impl;
|
|
|