Get rid of home-grown singleton maps for ModelTypeStore

Prior to this patch, ModelTypeStoreImpl and ModelTypeStoreBackend
internally maintain singleton maps to achieve what KeyedServices are
designed for: have single instances of certain objects per profile. The
implementation was rather error-prone (e.g. to leak data across
profiles) and the object lifetime questionable.

Instead, this patch replaces them with a newly introduced keyed service,
ModelTypeStoreService, which is designed to abstract away sync's needs
to persist data. The associated semantics wrt lifetime, incognito
etc. are more standard now.

For directory, we don't migrate the code other than making the keyed
service the authoritative source for defining where data should be
persisted (FS path). We do this to minimize the diff, and because we
expect all datatypes to be eventually migrated to USS in the long term.

Bug: 862942
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ib444220ead181b6765c863703439eec18fcb0886
Reviewed-on: https://chromium-review.googlesource.com/1134774
Reviewed-by: Colin Blundell <[email protected]>
Reviewed-by: Eric Noyau <[email protected]>
Reviewed-by: Bernhard Bauer <[email protected]>
Reviewed-by: Markus Heintz <[email protected]>
Reviewed-by: Mohamed Amir Yosef <[email protected]>
Reviewed-by: Sean Kau <[email protected]>
Commit-Queue: Mikel Astiz <[email protected]>
Cr-Commit-Position: refs/heads/master@{#576424}
53 files changed