Creating infrastructure for profiler instrumentation only in developer build and Canary channel.

This introduces TrackingProfile class that is equivalent to ScopedProfile what tracking is enabled and does nothing otherwise.

There is an idea to remove the single-parametered ScopedProfile constructor, but for this CL, I’m leaving it. Otherwise, I’d have to replace ~100 ScopedProfile instantiations throughout the code with TrackingProfile, and the substantial changes would be lost in these changes. I’ll do this in a separate CL. I replaced one ScopedProfile just to make sure this will compile.

BUG=401560
[email protected]

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

Cr-Commit-Position: refs/heads/master@{#301695}
diff --git a/base/tracked_objects.h b/base/tracked_objects.h
index 055cf19..222f5818 100644
--- a/base/tracked_objects.h
+++ b/base/tracked_objects.h
@@ -709,6 +709,9 @@
   TaskStopwatch();
   ~TaskStopwatch();
 
+  // Starts stopwatch.
+  void Start();
+
   // Stops stopwatch.
   void Stop();
 
@@ -744,12 +747,9 @@
   TaskStopwatch* parent_;
 
 #if DCHECK_IS_ON
-  // State of the stopwatch. Stopwatch is first constructed in a running state,
-  // then stopped, then destructed.
-  enum {
-    RUNNING,
-    STOPPED
-  } state_;
+  // State of the stopwatch. Stopwatch is first constructed in a created state
+  // state, then is optionally started/stopped, then destructed.
+  enum { CREATED, RUNNING, STOPPED } state_;
 
   // Currently running stopwatch that is directly nested in this one, if such
   // stopwatch exists. NULL otherwise.