[tracing] Switch TracedValue to pickles: lighter and accountable
commitfb1da8ca01bb7ed08e657bbdb53e1fabf3ac38a5
authorprimiano <primiano@chromium.org>
Thu, 11 Jun 2015 12:15:07 +0000 (11 05:15 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 11 Jun 2015 12:15:48 +0000 (11 12:15 +0000)
tree8ce588214a2af878eee2df2689768ed1120b11dc
parent7c70de9b414b4ce8f9386ba9855bde45c058ebd2
[tracing] Switch TracedValue to pickles: lighter and accountable

TraceValue is used pretty much everywhere in tracing.
It is conceptually similar but exposes a much simpler API of
base::Value. Until now it used base::Value under the hoods.

Problems:
  - We need a way to account accurately the memory used by tracing for
    the sake of memory profiling (See crbug.com/495628).
  - base::Value is too complex / uses too many std::strings
    (e.g., tracing doesn't need keys to be strings, just static char*)
  - is very hard to predict memory usage of std::string (strongly
    impl dependant)

Proposed solution:
  This CL introduces a drop-in replacement for TracedValue, inspired by
  the following principles:
   - Be simple and small: just a pickle.
   - Don't copy strings if not necessary: keep the const char* ptrs to
     "quoted" static strings.

For more details see the attached bug and the design doc goo.gl/xw7tyR

BUG=495628

Review URL: https://codereview.chromium.org/1173793003

Cr-Commit-Position: refs/heads/master@{#333932}
base/trace_event/trace_event_argument.cc
base/trace_event/trace_event_argument.h
base/trace_event/trace_event_argument_unittest.cc