New issue
Advanced search Search tips

Issue 771828 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Jan 10
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Make IDMap not so single-use

Project Member Reported by a...@chromium.org, Oct 5 2017

Issue description

IDMap is very odd. A simple map for id-based objects perhaps has use, but IDMap is for pointer values only:

  T* Lookup(KeyType id) const {
    DCHECK(sequence_checker_.CalledOnValidSequence());
    typename HashTable::const_iterator i = data_.find(id);
    if (i == data_.end())
      return nullptr;
    return &*i->second;
  }

From what I can tell, the majority of uses of IDMap is to hold unique_ptr, so by allowing the objects to live directly in the container, that would simplify and speed things up.

The IDMap::Iterator class could also use some cleanup to allow range-for use.
 

Comment 1 by a...@chromium.org, Oct 5 2017

set_check_on_null_data() is a funny feature too. Very pointer-only, and it's used by... exactly one client (RenderProcessHostImpl).
Status: Archived (was: Untriaged)
Archiving P3s older than 1 year with no owner or component.

Sign in to add a comment