[refactor] Reduce performance overhead of `ContentProviderBasedProject`.
[refactor] Reduce performance overhead of `ContentProviderBasedProject`.

The `ContentProviderBasedProject` is used to provide files from source
maps and language plugins, and with moderate projects that can easily
be thousands if not tens of thousands of files. We used to have two
global WeakMaps that hold the MIME type and the optional metadata per
UISourceCode, and these can grow very big (imagine the example of Earth
here with almost 6000 source files times number of workers, which can
range from 10 to 40), and V8 deals poorly with these large WeakMaps.

Another performance problem was the mapping of URLs to content
providers, which was done via a JavaScript object (presumably in
dictionary mode), which also comes with significant overhead, and
V8 does better when this is done via a Map instead.

Bug: chromium:1148713
Change-Id: Ibaa5c379aee004249bd975b9f7a714303744fbf6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2550685
Auto-Submit: Benedikt Meurer <024a1e0af501338d11c3b837c6193d11c140d792@chromium.org>
Commit-Queue: Philip Pfaffe <639a645feae3653b7aaefa0387217d375f2f82ff@chromium.org>
Reviewed-by: Philip Pfaffe <639a645feae3653b7aaefa0387217d375f2f82ff@chromium.org>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend