Lines Matching defs:key
57 static PersistentContainerValue Set(Impl* impl, K key,
59 std::pair<Iterator, bool> res = impl->insert(std::make_pair(key, value));
67 static PersistentContainerValue Get(Impl* impl, K key) {
68 Iterator it = impl->find(key);
72 static PersistentContainerValue Remove(Impl* impl, K key) {
73 Iterator it = impl->find(key);
100 MapType* map, const K& key, Local<V> value) {
112 static void Dispose(Isolate* isolate, Global<V> value, K key) {}
128 static WeakCallbackDataType* WeakCallbackParameter(MapType* map, const K& key,
143 static void Dispose(Isolate* isolate, Global<V> value, K key) {}
183 Local<V> Get(const K& key) {
184 return Local<V>::New(isolate_, FromVal(Traits::Get(&impl_, key)));
190 bool Contains(const K& key) {
191 return Traits::Get(&impl_, key) != kPersistentContainerNotFound;
198 bool SetReturnValue(const K& key,
200 return SetReturnValueFromVal(&returnValue, Traits::Get(&impl_, key));
204 * Return value for key and remove it from the map.
206 Global<V> Remove(const K& key) {
207 return Release(Traits::Remove(&impl_, key)).Pass();
275 * The value will become invalid if the value for this key changes
277 * key; as a result of the weak callback for the same key; or as a
280 PersistentValueReference GetReference(const K& key) {
281 return PersistentValueReference(Traits::Get(&impl_, key));
324 void RemoveWeak(const K& key) {
326 p.val_ = FromVal(Traits::Remove(&impl_, key));
370 Global<V> Set(const K& key, Local<V> value) {
372 return SetUnique(key, &persistent);
378 Global<V> Set(const K& key, Global<V> value) {
379 return SetUnique(key, &value);
386 Global<V> SetUnique(const K& key, Global<V>* persistent) {
396 Traits::WeakCallbackParameter(this, key, value), WeakCallback,
400 Traits::Set(this->impl(), key, this->ClearAndLeak(persistent));
408 Global<V> Set(const K& key, Global<V> value,
411 return SetUnique(key, &value);
420 K key = Traits::KeyFromWeakCallbackInfo(data);
422 persistentValueMap->Remove(key).Pass(), key);
446 Global<V> Set(const K& key, Local<V> value) {
448 return SetUnique(key, &persistent);
454 Global<V> Set(const K& key, Global<V> value) {
455 return SetUnique(key, &value);
462 Global<V> SetUnique(const K& key, Global<V>* persistent) {
472 Traits::WeakCallbackParameter(this, key, value), OnWeakCallback,
476 Traits::Set(this->impl(), key, this->ClearAndLeak(persistent));
484 Global<V> Set(const K& key, Global<V> value,
487 return SetUnique(key, &value);
495 K key = Traits::KeyFromWeakCallbackInfo(data);
496 map->RemoveWeak(key);