Not fully fixed yet, the next step is to delete the enum and to create instantiations like IDMap<unique_ptr<T>> instead, and to make the Add(T*) style stop working in unique_ptr mode. This will require a megapatch changing all use sites.
Looks like this can be done in two steps:
1. Remove the casts here:
https://cs.chromium.org/chromium/src/base/id_map.h?pv=1&rcl=1478186305&l=90
and here:
https://cs.chromium.org/chromium/src/base/id_map.h?pv=1&rcl=1478186305&l=93
to disable adding raw pointers in IDMapOwnPointer mode. Then clean up the resulting compiler errors by converting the calling code to add unique_ptrs. IDMapOwnPointer is used in 45 files so this probably won't take long to do by hand.
2. Eliminate the enum as described in Comment 2. There are ~200 files that use IDMap so I will try to see if there's a way to automate this.
Comment 1 by bugdroid1@chromium.org
, Sep 24 2016