Move string storage out of HistogramBase class.

With the move to persistent histograms, a copy of the histogram name
is saved in order to reconstruct the histogram at a later time.  It is
therefore unnecessary to have a std::string object inside each histogram
when they can point directly to the string in the persistent memory.

This saves 8-24 bytes on 32-bit builds and roughly double that on 64-bit
builds.  The range is due to different implementations of std::string,
some of which include direct storage for small strings.

This amounts to a substantial memory savings (>50% per object on some
buids) given the 3000+ histogram objects maintained by a typical Chrome
process.

For non-persistent histograms, the strings will be copied to a separate
memory area maintaining consistency with the existing interface that
doesn't guarantee passing immutable strings.

Bug: 733380
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I1467985b5755310b968174425eaf38db051bac2f
Reviewed-on: https://chromium-review.googlesource.com/741343
Reviewed-by: Stephen Lanham <slan@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: Tommi <tommi@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Brian White <bcwhite@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513768}

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