These helpers to convert between std::map and base::flat_map were
added during the rebase from Cr79 to Cr80 (see [1]) in order to keep
Brave building after such helpers were removed from where they used
to live in upstream Chromium, inside of Mojo.
This patch adapts all the code that depended on such functions not
to require them and removes this utils.h file, so that we no longer
depend on such conversions.
[1] https://github.com/brave/brave-core/commit/8d63987e
These functions (MapToFlatMap and FlatMapToMap) used to live in mojo,
but have been removed since Chromium converted all code using mojo to
use base::flat_map instead of std::map. We should do the same, but it
will require a more significant effort than the scope of Chromium
upgrade allows. For now, resurrected those functions and placed them in
brave/base/containers/utils.h.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/8d90918
commit 8d90918d46a4d54beb99fc7a66b7e18abc1d2940
Author: Lei Zhang <thestig@chromium.org>
Date: Wed Nov 6 02:51:45 2019 +0000
Remove mojo/public/cpp/bindings/map.h.
Convert all callers to use base::flat_map in the first place, instead of
using std::map and then converting them. Fix link errors along the way.