tracing: Simplify TraceEventMemoryOverhead, use an enum insted of a map

TraceEventMemoryOverhead is a rather simple class which only purpose is
accounting various sources of memory overhead due to tracing itself.
For debugging purposes it keeps track of the actual class causing
overhead, so that they can be inspected distinctly in the tracing UI
The current implementation was using a small_map indexed by
const char* pointer, which has a bunch of problems:
- base::small_map can degenerate into a STL map when exceeding the
  inline capacity, which in turn can cause some extra impredictability,
  see "[chromium-dev] Please avoid std::unordered_map".
- The map implicitly assumes that two identical string literals will have
  identical pointers, which is not true, esepcially in component builds.
- Any sort of map is a really over-engineered solution, given that the
  sources of overheads we care about are known a priori and are a
  manageable number.

Hence, this CL is switching the implementation of
TraceEventMemoryOverhead to be just enum-base, which ditches completely
the map.

BUG=717223

Review-Url: https://codereview.chromium.org/2857543002
Cr-Commit-Position: refs/heads/master@{#468611}


CrOS-Libchrome-Original-Commit: eb6696a1bfb1c32c6d2d1baf9a0dabcc632119e7
9 files changed
tree: 561a70bb5e514967b0b1fb0ac576ed5bc7eb617b
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/