ModelTypeStoreImpl and ModelTypeStoreBackend internally maintain singleton maps to achieve what KeyedServices are designed for: have single instantes of certain objects per profile.
They do so with a home-grown and rather error-prone way, which is to use the profile path as a key (since two profiles cannot have the same path). Among other things, this also means the objects can outlive the profile.
Let's instead adopt a proper KeyedService for this, which makes lifetime a lot more obvious, semantics more standard (like how incognito should behave).
Comment 1 by bugdroid1@chromium.org
, Jul 19