Add support for thread names to out of process heap profiling.

This CL adds a new memlog stack mode: native-with-thread-names. When enabled,
the thread name will be inserted as the first frame of each stack.

Other minor changes:
  * Fixed minor bug in the parsing logic for ProfilingTestDriver.
  * Fixed a JSON exporter issue [node and string ids should begin at 1, not 0.
chrome://tracing UI ignores nodes with id 0.]
  * Add TLS destructor for allocator shim.
  * base::android::AttachCurrentThread() now preserves thread name.

Change-Id: I8c9d82084d6439e663f94e563068c987d1cf3b23
Bug: 758739
Reviewed-on: https://chromium-review.googlesource.com/877085
Reviewed-by: Maria Khomenko <[email protected]>
Reviewed-by: Richard Coles <[email protected]>
Reviewed-by: Dmitry Skiba <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Albert J. Wong <[email protected]>
Commit-Queue: Erik Chen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#531992}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index bfa0c62f..5ed7048 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -991,6 +991,9 @@
     {flags_ui::kGenericExperimentChoiceDisabled, "", ""},
     {flag_descriptions::kOOPHPStackModeNative, switches::kMemlogStackMode,
      switches::kMemlogStackModeNative},
+    {flag_descriptions::kOOPHPStackModeNativeWithThreadNames,
+     switches::kMemlogStackMode,
+     switches::kMemlogStackModeNativeWithThreadNames},
     {flag_descriptions::kOOPHPStackModePseudo, switches::kMemlogStackMode,
      switches::kMemlogStackModePseudo},
     {flag_descriptions::kOOPHPStackModeMixed, switches::kMemlogStackMode,