Lines Matching refs:ValueType
45 template <class KeyType, class ValueType> class AbstractWeakReferenceMap {
54 virtual void visitDOMWrapper(DOMDataStore* store, KeyType* key, v8::Persistent<ValueType> object) = 0;
59 virtual v8::Persistent<ValueType> get(KeyType* obj) = 0;
60 virtual void set(KeyType* obj, v8::Persistent<ValueType> wrapper) = 0;
63 virtual bool removeIfPresent(KeyType*, v8::Persistent<ValueType>) = 0;
76 template<class KeyType, class ValueType> class WeakReferenceMap : public AbstractWeakReferenceMap<KeyType, ValueType> {
78 typedef AbstractWeakReferenceMap<KeyType, ValueType> Parent;
83 virtual v8::Persistent<ValueType> get(KeyType* obj)
85 ValueType* wrapper = m_map.get(obj);
86 return wrapper ? v8::Persistent<ValueType>(wrapper) : v8::Persistent<ValueType>();
89 virtual void set(KeyType* obj, v8::Persistent<ValueType> wrapper)
99 ValueType* wrapper = m_map.take(obj);
103 v8::Persistent<ValueType> handle(wrapper);
108 bool removeIfPresent(KeyType* key, v8::Persistent<ValueType> value)
110 typename HashMap<KeyType*, ValueType*>::iterator it = m_map.find(key);
129 typename HashMap<KeyType*, ValueType*>::iterator it = m_map.begin();
131 visitor->visitDOMWrapper(store, it->first, v8::Persistent<ValueType>(it->second));
136 HashMap<KeyType*, ValueType*> m_map;