diff --git a/atom/common/api/atom_api_id_weak_map.cc b/atom/common/api/atom_api_id_weak_map.cc index 0d3ddae3cc09..1669f25373c9 100644 --- a/atom/common/api/atom_api_id_weak_map.cc +++ b/atom/common/api/atom_api_id_weak_map.cc @@ -36,10 +36,6 @@ void IDWeakMap::Remove(int32_t id) { id_weak_map_.Remove(id); } -void IDWeakMap::Clear() { - id_weak_map_.Clear(); -} - // static void IDWeakMap::BuildPrototype(v8::Isolate* isolate, v8::Local prototype) { @@ -47,8 +43,7 @@ void IDWeakMap::BuildPrototype(v8::Isolate* isolate, .SetMethod("set", &IDWeakMap::Set) .SetMethod("get", &IDWeakMap::Get) .SetMethod("has", &IDWeakMap::Has) - .SetMethod("remove", &IDWeakMap::Remove) - .SetMethod("clear", &IDWeakMap::Clear); + .SetMethod("remove", &IDWeakMap::Remove); } // static diff --git a/atom/common/api/atom_api_id_weak_map.h b/atom/common/api/atom_api_id_weak_map.h index 616112ffe6f4..0151c7cea479 100644 --- a/atom/common/api/atom_api_id_weak_map.h +++ b/atom/common/api/atom_api_id_weak_map.h @@ -30,7 +30,6 @@ class IDWeakMap : public mate::Wrappable { v8::Local Get(v8::Isolate* isolate, int32_t id); bool Has(int32_t id); void Remove(int32_t id); - void Clear(); atom::IDWeakMap id_weak_map_; diff --git a/atom/common/id_weak_map.cc b/atom/common/id_weak_map.cc index a78dcbceba53..f7c3f98ea3d3 100644 --- a/atom/common/id_weak_map.cc +++ b/atom/common/id_weak_map.cc @@ -59,14 +59,6 @@ bool IDWeakMap::Has(int32_t id) const { return map_.find(id) != map_.end(); } -std::vector IDWeakMap::Keys() const { - std::vector keys; - keys.reserve(map_.size()); - for (const auto& iter : map_) - keys.emplace_back(iter.first); - return keys; -} - std::vector> IDWeakMap::Values(v8::Isolate* isolate) { std::vector> keys; keys.reserve(map_.size()); @@ -83,10 +75,6 @@ void IDWeakMap::Remove(int32_t id) { map_.erase(iter); } -void IDWeakMap::Clear() { - map_.clear(); -} - int32_t IDWeakMap::GetNextID() { return ++next_id_; } diff --git a/atom/common/id_weak_map.h b/atom/common/id_weak_map.h index 72c64c6ae5d4..f92270573fa6 100644 --- a/atom/common/id_weak_map.h +++ b/atom/common/id_weak_map.h @@ -31,18 +31,12 @@ class IDWeakMap { // Whethere there is an object with |id| in this WeakMap. bool Has(int32_t id) const; - // Returns IDs of all available objects. - std::vector Keys() const; - // Returns all objects. std::vector> Values(v8::Isolate* isolate); // Remove object with |id| in the WeakMap. void Remove(int32_t key); - // Clears the weak map. - void Clear(); - private: // Returns next available ID. int32_t GetNextID();